History

Merge tag 'v6.1-rc8' into rdma.git for-next

For dependencies in following patches

Jason Gunthorpe committed 3 years ago

Commit d69e8c62 parents 6cfe7bd 76dcd731377 files · +50615 −43700Browse files

Unified · Split

1377 files
  1. .mailmap +4 −0
  2. CREDITS +9 −0
  3. Documentation/admin-guide/kernel-parameters.txt +11 −0
  4. Documentation/admin-guide/pm/amd-pstate.rst +13 −17
  5. Documentation/arm64/booting.rst +8 −0
  6. Documentation/arm64/cpu-feature-registers.rst +37 −1
  7. Documentation/dev-tools/kmsan.rst +1 −0
  8. Documentation/devicetree/bindings/clock/samsung,exynosautov9-clock.yaml +1 −1
  9. Documentation/devicetree/bindings/hwlock/qcom-hwspinlock.yaml +21 −8
  10. Documentation/devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml +0 −7
  11. Documentation/devicetree/bindings/input/goodix,gt7375p.yaml +4 −1
  12. Documentation/devicetree/bindings/interconnect/qcom,msm8998-bwmon.yaml +1 −1
  13. Documentation/devicetree/bindings/media/allwinner,sun50i-h6-vpu-g2.yaml +5 −0
  14. Documentation/devicetree/bindings/net/engleder,tsnep.yaml +1 −1
  15. Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml +3 −0
  16. Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml +1 −1
  17. Documentation/devicetree/bindings/sound/realtek,rt1015p.yaml +1 −1
  18. Documentation/driver-api/driver-model/devres.rst +1 −0
  19. Documentation/driver-api/miscellaneous.rst +2 −3
  20. Documentation/kbuild/reproducible-builds.rst +10 −0
  21. Documentation/kernel-hacking/hacking.rst +1 −1
  22. Documentation/networking/generic_netlink.rst +1 −1
  23. Documentation/process/2.Process.rst +4 −11
  24. Documentation/process/code-of-conduct-interpretation.rst +1 −1
  25. Documentation/process/howto.rst +1 −1
  26. Documentation/trace/histogram.rst +1 −1
  27. Documentation/translations/it_IT/process/howto.rst +1 −1
  28. Documentation/translations/ja_JP/howto.rst +1 −1
  29. Documentation/translations/ko_KR/howto.rst +1 −1
  30. Documentation/translations/zh_CN/loongarch/introduction.rst +2 −2
  31. Documentation/translations/zh_CN/process/howto.rst +1 −1
  32. Documentation/translations/zh_TW/process/howto.rst +1 −1
  33. Documentation/virt/kvm/devices/vm.rst +3 −0
  34. MAINTAINERS +72 −38
  35. Makefile +2 −2
  36. arch/arm/boot/dts/am335x-pcm-953.dtsi +13 −15
  37. arch/arm/boot/dts/at91rm9200.dtsi +1 −1
  38. arch/arm/boot/dts/at91sam9g20ek_common.dtsi +9 −0
  39. arch/arm/boot/dts/imx6q-prti6q.dts +2 −2
  40. arch/arm/boot/dts/imx6q-yapp4-crux.dts +4 −0
  41. arch/arm/boot/dts/imx6qdl-gw5910.dtsi +1 −1
  42. arch/arm/boot/dts/imx6qdl-gw5913.dtsi +1 −1
  43. arch/arm/boot/dts/imx6qp-yapp4-crux-plus.dts +4 −0
  44. arch/arm/boot/dts/imx7s.dtsi +2 −2
  45. arch/arm/boot/dts/lan966x-pcb8291.dts +20 −0
  46. arch/arm/boot/dts/rk3036-evb.dts +1 −2
  47. arch/arm/boot/dts/rk3066a-mk808.dts +1 −1
  48. arch/arm/boot/dts/rk3188-radxarock.dts +1 −1
  49. arch/arm/boot/dts/rk3188.dtsi +1 −2
  50. arch/arm/boot/dts/rk3288-evb-act8846.dts +1 −1
  51. arch/arm/boot/dts/rk3288-evb.dtsi +3 −3
  52. arch/arm/boot/dts/rk3288-firefly.dtsi +1 −2
  53. arch/arm/boot/dts/rk3288-miqi.dts +1 −2
  54. arch/arm/boot/dts/rk3288-rock2-square.dts +1 −2
  55. arch/arm/boot/dts/rk3288-vmarc-som.dtsi +0 −1
  56. arch/arm/boot/dts/rk3xxx.dtsi +7 −0
  57. arch/arm/boot/dts/sama7g5-pinfunc.h +1 −1
  58. arch/arm/boot/dts/ste-href.dtsi +8 −0
  59. arch/arm/boot/dts/ste-snowball.dts +8 −0
  60. arch/arm/boot/dts/ste-ux500-samsung-codina-tmo.dts +8 −0
  61. arch/arm/boot/dts/ste-ux500-samsung-codina.dts +8 −0
  62. arch/arm/boot/dts/ste-ux500-samsung-gavini.dts +8 −0
  63. arch/arm/boot/dts/ste-ux500-samsung-golden.dts +8 −0
  64. arch/arm/boot/dts/ste-ux500-samsung-janice.dts +8 −0
  65. arch/arm/boot/dts/ste-ux500-samsung-kyle.dts +8 −0
  66. arch/arm/boot/dts/ste-ux500-samsung-skomer.dts +8 −0
  67. arch/arm/include/asm/perf_event.h +1 −1
  68. arch/arm/include/asm/pgtable-nommu.h +0 −6
  69. arch/arm/include/asm/pgtable.h +9 −7
  70. arch/arm/mach-at91/pm_suspend.S +6 −1
  71. arch/arm/mach-mxs/mach-mxs.c +3 −1
  72. arch/arm/mm/nommu.c +19 −0
  73. arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +1 −0
  74. arch/arm64/boot/dts/arm/juno-base.dtsi +14 −0
  75. arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi +6 −0
  76. arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi +6 −0
  77. arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi +6 −0
  78. arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi +9 −9
  79. arch/arm64/boot/dts/freescale/imx8mm-mx8menlo.dts +8 −8
  80. arch/arm64/boot/dts/freescale/imx8mm-tqma8mqml-mba8mx.dts +26 −6
  81. arch/arm64/boot/dts/freescale/imx8mm.dtsi +6 −6
  82. arch/arm64/boot/dts/freescale/imx8mn.dtsi +3 −3
  83. arch/arm64/boot/dts/freescale/imx8mp-evk.dts +3 −3
  84. arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi +10 −10
  85. arch/arm64/boot/dts/freescale/imx93-pinfunc.h +0 −0
  86. arch/arm64/boot/dts/freescale/imx93.dtsi +6 −5
  87. arch/arm64/boot/dts/qcom/ipq8074.dtsi +1 −1
  88. arch/arm64/boot/dts/qcom/msm8996.dtsi +1 −1
  89. arch/arm64/boot/dts/qcom/sa8155p-adp.dts +12 −1
  90. arch/arm64/boot/dts/qcom/sa8295p-adp.dts +12 −0
  91. arch/arm64/boot/dts/qcom/sc7280.dtsi +2 −1
  92. arch/arm64/boot/dts/qcom/sc8280xp-crd.dts +6 −0
  93. arch/arm64/boot/dts/qcom/sc8280xp.dtsi +8 −28
  94. arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi +6 −0
  95. arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi +6 −0
  96. arch/arm64/boot/dts/qcom/sm8250.dtsi +1 −0
  97. arch/arm64/boot/dts/qcom/sm8350-hdk.dts +12 −0
  98. arch/arm64/boot/dts/rockchip/px30-evb.dts +5 −5
  99. arch/arm64/boot/dts/rockchip/rk3308-evb.dts +6 −6
  100. arch/arm64/boot/dts/rockchip/rk3308-roc-cc.dts +1 −1
  101. arch/arm64/boot/dts/rockchip/rk3318-a95x-z2.dts +1 −1
  102. arch/arm64/boot/dts/rockchip/rk3368-orion-r68-meta.dts +1 −2
  103. arch/arm64/boot/dts/rockchip/rk3368-r88.dts +1 −2
  104. arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi +0 −4
  105. arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi +1 −1
  106. arch/arm64/boot/dts/rockchip/rk3399-nanopc-t4.dts +1 −1
  107. arch/arm64/boot/dts/rockchip/rk3399-nanopi-m4b.dts +1 −1
  108. arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi +1 −0
  109. arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts +2 −2
  110. arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts +1 −1
  111. arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts +1 −2
  112. arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi +1 −1
  113. arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi +0 −1
  114. arch/arm64/boot/dts/rockchip/rk3399-sapphire-excavator.dts +2 −2
  115. arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi +1 −2
  116. arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtsi +1 −1
  117. arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts +4 −3
  118. arch/arm64/boot/dts/rockchip/rk3566-quartz64-b.dts +1 −1
  119. arch/arm64/boot/dts/rockchip/rk3566-roc-pc.dts +2 −6
  120. arch/arm64/boot/dts/rockchip/rk3568-bpi-r2-pro.dts +0 −1
  121. arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts +0 −1
  122. arch/arm64/include/asm/cputype.h +1 −1
  123. arch/arm64/include/asm/pgtable.h +2 −2
  124. arch/arm64/include/asm/syscall_wrapper.h +1 −1
  125. arch/arm64/kernel/cpufeature.c +33 −9
  126. arch/arm64/kernel/efi.c +34 −18
  127. arch/arm64/kernel/entry-common.c +2 −1
  128. arch/arm64/kernel/entry-ftrace.S +1 −1
  129. arch/arm64/kvm/hyp/exception.c +2 −1
  130. arch/arm64/kvm/hyp/include/hyp/switch.h +20 −0
  131. arch/arm64/kvm/hyp/nvhe/mem_protect.c +1 −1
  132. arch/arm64/kvm/hyp/nvhe/switch.c +0 −26
  133. arch/arm64/kvm/hyp/vhe/switch.c +0 −8
  134. arch/arm64/mm/pageattr.c +3 −2
  135. arch/loongarch/Makefile +1 −1
  136. arch/loongarch/include/asm/irq.h +1 −1
  137. arch/loongarch/include/asm/pgtable.h +13 −4
  138. arch/loongarch/include/asm/smp.h +15 −15
  139. arch/loongarch/kernel/acpi.c +10 −21
  140. arch/loongarch/kernel/irq.c +1 −1
  141. arch/loongarch/kernel/process.c +5 −4
  142. arch/loongarch/kernel/setup.c +0 −1
  143. arch/loongarch/kernel/smp.c +22 −22
  144. arch/loongarch/kernel/unwind_prologue.c +2 −1
  145. arch/microblaze/Makefile +2 −2
  146. arch/mips/alchemy/common/gpiolib.c +1 −1
  147. arch/mips/boot/compressed/decompress.c +1 −0
  148. arch/mips/include/asm/fw/fw.h +1 −1
  149. arch/mips/include/asm/pgtable.h +1 −0
  150. arch/mips/kernel/jump_label.c +1 −1
  151. arch/mips/kernel/relocate_kernel.S +5 −10
  152. arch/mips/loongson64/reset.c +10 −0
  153. arch/mips/pic32/pic32mzda/early_console.c +6 −7
  154. arch/mips/pic32/pic32mzda/init.c +1 −1
  155. arch/nios2/boot/Makefile +1 −1
  156. arch/parisc/include/asm/hardware.h +6 −6
  157. arch/parisc/include/uapi/asm/pdc.h +13 −23
  158. arch/parisc/kernel/drivers.c +6 −8
  159. arch/powerpc/Kconfig +2 −1
  160. arch/powerpc/include/asm/interrupt.h +1 −0
  161. arch/powerpc/include/asm/syscalls.h +7 −0
  162. arch/powerpc/kernel/sys_ppc32.c +12 −1
  163. arch/powerpc/kernel/syscalls/syscall.tbl +5 −2
  164. arch/powerpc/kernel/vmlinux.lds.S +1 −1
  165. arch/powerpc/net/bpf_jit_comp32.c +21 −31
  166. arch/riscv/Kconfig +3 −3
  167. arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts +38 −0
  168. arch/riscv/include/asm/asm.h +1 −0
  169. arch/riscv/include/asm/efi.h +5 −1
  170. arch/riscv/include/asm/pgalloc.h +8 −3
  171. arch/riscv/include/asm/pgtable.h +1 −0
  172. arch/riscv/include/asm/smp.h +3 −0
  173. arch/riscv/kernel/entry.S +13 −0
  174. arch/riscv/kernel/machine_kexec.c +35 −11
  175. arch/riscv/kernel/process.c +2 −0
  176. arch/riscv/kernel/setup.c +6 −4
  177. arch/riscv/kernel/smp.c +95 −2
  178. arch/riscv/kernel/traps.c +18 −0
  179. arch/riscv/kernel/vdso/Makefile +5 −1
  180. arch/riscv/kernel/vdso/vdso.lds.S +2 −0
  181. arch/riscv/mm/init.c +0 −1
  182. arch/s390/Kconfig +3 −3
  183. arch/s390/Makefile +0 −2
  184. arch/s390/boot/Makefile +1 −2
  185. arch/s390/boot/startup.c +1 −2
  186. arch/s390/configs/btf.config +1 −0
  187. arch/s390/configs/debug_defconfig +32 −33
  188. arch/s390/configs/defconfig +33 −34
  189. arch/s390/configs/kasan.config +3 −0
  190. arch/s390/configs/zfcpdump_defconfig +0 −1
  191. arch/s390/include/asm/pgtable.h +1 −0
  192. arch/s390/include/asm/processor.h +10 −1
  193. arch/s390/kernel/crash_dump.c +1 −1
  194. arch/s390/kvm/kvm-s390.c +17 −9
  195. arch/s390/kvm/kvm-s390.h +0 −1
  196. arch/s390/kvm/pci.c +1 −1
  197. arch/sparc/include/asm/pgtable_64.h +1 −0
  198. arch/x86/boot/Makefile +1 −1
  199. arch/x86/coco/tdx/tdx.c +18 −7
  200. arch/x86/events/amd/core.c +2 −3
  201. arch/x86/events/amd/uncore.c +1 −0
  202. arch/x86/events/intel/core.c +1 −0
  203. arch/x86/events/intel/ds.c +14 −4
  204. arch/x86/events/intel/pt.c +9 −0
  205. arch/x86/events/rapl.c +1 −5
  206. arch/x86/hyperv/hv_init.c +36 −37
  207. arch/x86/include/asm/cpufeatures.h +3 −0
  208. arch/x86/include/asm/intel-family.h +10 −1
  209. arch/x86/include/asm/kvm_host.h +6 −1
  210. arch/x86/include/asm/msr-index.h +5 −3
  211. arch/x86/include/asm/nospec-branch.h +1 −1
  212. arch/x86/include/asm/pgtable.h +9 −0
  213. arch/x86/include/asm/qspinlock_paravirt.h +1 −1
  214. arch/x86/include/asm/spec-ctrl.h +5 −5
  215. arch/x86/include/asm/syscall_wrapper.h +1 −1
  216. arch/x86/kernel/asm-offsets.c +0 −6
  217. arch/x86/kernel/cpu/amd.c +2 −4
  218. arch/x86/kernel/cpu/bugs.c +18 −18
  219. arch/x86/kernel/cpu/hygon.c +2 −2
  220. arch/x86/kernel/cpu/sgx/ioctl.c +3 −0
  221. arch/x86/kernel/cpu/tsx.c +17 −21
  222. arch/x86/kernel/fpu/core.c +1 −1
  223. arch/x86/kernel/process.c +1 −1
  224. arch/x86/kernel/traps.c +7 −0
  225. arch/x86/kvm/.gitignore +2 −0
  226. arch/x86/kvm/Makefile +12 −0
  227. arch/x86/kvm/cpuid.c +10 −3
  228. arch/x86/kvm/debugfs.c +6 −1
  229. arch/x86/kvm/emulate.c +76 −32
  230. arch/x86/kvm/kvm-asm-offsets.c +29 −0
  231. arch/x86/kvm/mmu/mmu.c +9 −8
  232. arch/x86/kvm/pmu.c +1 −1
  233. arch/x86/kvm/svm/nested.c +9 −3
  234. arch/x86/kvm/svm/pmu.c +4 −3
  235. arch/x86/kvm/svm/sev.c +3 −3
  236. arch/x86/kvm/svm/svm.c +42 −89
  237. arch/x86/kvm/svm/svm.h +5 −6
  238. arch/x86/kvm/svm/svm_ops.h +0 −5
  239. arch/x86/kvm/svm/vmenter.S +209 −51
  240. arch/x86/kvm/vmx/capabilities.h +3 −16
  241. arch/x86/kvm/vmx/nested.c +1 −3
  242. arch/x86/kvm/vmx/pmu_intel.c +2 −2
  243. arch/x86/kvm/vmx/vmenter.S +1 −1
  244. arch/x86/kvm/vmx/vmx.c +16 −7
  245. arch/x86/kvm/x86.c +58 −28
  246. arch/x86/kvm/xen.c +57 −39
  247. arch/x86/lib/usercopy.c +3 −0
  248. arch/x86/mm/hugetlbpage.c +4 −0
  249. arch/x86/mm/ioremap.c +7 −1
  250. arch/x86/net/bpf_jit_comp.c +0 −13
  251. arch/x86/power/cpu.c +15 −7
  252. arch/x86/xen/enlighten_pv.c +2 −1
  253. arch/x86/xen/pmu.c +1 −1
  254. arch/x86/xen/setup.c +8 −18
  255. block/bfq-cgroup.c +4 −0
  256. block/blk-cgroup.c +1 −1
  257. block/blk-core.c +0 −1
  258. block/blk-mq.c +8 −4
  259. block/blk-settings.c +5 −4
  260. block/blk.h +1 −0
  261. block/genhd.c +1 −0
  262. block/sed-opal.c +28 −4
  263. drivers/accessibility/speakup/main.c +1 −1
  264. drivers/accessibility/speakup/utils.h +1 −1
  265. drivers/acpi/numa/hmat.c +20 −7
  266. drivers/acpi/numa/srat.c +1 −0
  267. drivers/acpi/video_detect.c +32 −9
  268. drivers/acpi/x86/utils.c +6 −0
  269. drivers/android/binder_alloc.c +7 −0
  270. drivers/ata/libata-scsi.c +13 −0
  271. drivers/ata/libata-transport.c +15 −4
  272. drivers/ata/pata_legacy.c +3 −2
  273. drivers/ata/pata_palmld.c +2 −2
  274. drivers/block/Kconfig +6 −0
  275. drivers/block/drbd/drbd_main.c +2 −2
  276. drivers/block/ublk_drv.c +71 −56
  277. drivers/bluetooth/virtio_bt.c +1 −1
  278. drivers/bus/intel-ixp4xx-eb.c +3 −6
  279. drivers/bus/sunxi-rsb.c +21 −17
  280. drivers/char/tpm/tpm-interface.c +3 −2
  281. drivers/clk/at91/at91rm9200.c +1 −1
  282. drivers/clk/clk-renesas-pcie.c +62 −3
  283. drivers/clk/clk.c +5 −1
  284. drivers/clk/mediatek/clk-mt8195-topckgen.c +3 −1
  285. drivers/clk/qcom/gcc-sc7280.c +1 −0
  286. drivers/clk/qcom/gcc-sc8280xp.c +6 −0
  287. drivers/clk/qcom/gdsc.c +6 −55
  288. drivers/clk/qcom/gdsc.h +0 −2
  289. drivers/clk/qcom/gpucc-sc7280.c +1 −0
  290. drivers/clk/renesas/r8a779g0-cpg-mssr.c +9 −4
  291. drivers/clk/samsung/clk-exynos-clkout.c +4 −2
  292. drivers/clk/samsung/clk-exynos7885.c +2 −2
  293. drivers/clk/sifive/Kconfig +3 −1
  294. drivers/clocksource/arm_arch_timer.c +5 −2
  295. drivers/clocksource/hyperv_timer.c +15 −14
  296. drivers/clocksource/timer-riscv.c +1 −1
  297. drivers/cpufreq/Kconfig.x86 +1 −1
  298. drivers/cpufreq/amd-pstate.c +34 −15
  299. drivers/cxl/core/mbox.c +1 −1
  300. drivers/cxl/core/pmem.c +2 −0
  301. drivers/cxl/core/port.c +9 −2
  302. drivers/cxl/core/region.c +85 −28
  303. drivers/cxl/cxl.h +3 −1
  304. drivers/cxl/pmem.c +67 −38
  305. drivers/dax/hmem/device.c +15 −9
  306. drivers/dma-buf/dma-buf.c +17 −6
  307. drivers/dma-buf/dma-heap.c +15 −13
  308. drivers/dma/apple-admac.c +1 −1
  309. drivers/dma/at_hdmac.c +60 −93
  310. drivers/dma/at_hdmac_regs.h +5 −5
  311. drivers/dma/idxd/cdev.c +18 −0
  312. drivers/dma/idxd/device.c +17 −9
  313. drivers/dma/idxd/idxd.h +32 −0
  314. drivers/dma/idxd/init.c +2 −2
  315. drivers/dma/idxd/sysfs.c +1 −1
  316. drivers/dma/mv_xor_v2.c +1 −0
  317. drivers/dma/pxa_dma.c +2 −2
  318. drivers/dma/stm32-dma.c +6 −8
  319. drivers/dma/stm32-mdma.c +1 −0
  320. drivers/dma/ti/k3-udma-glue.c +3 −0
  321. drivers/extcon/extcon-usbc-tusb320.c +7 −1
  322. drivers/firmware/arm_scmi/bus.c +11 −0
  323. drivers/firmware/arm_scmi/common.h +4 −1
  324. drivers/firmware/arm_scmi/driver.c +27 −14
  325. drivers/firmware/arm_scmi/mailbox.c +1 −1
  326. drivers/firmware/arm_scmi/optee.c +1 −1
  327. drivers/firmware/arm_scmi/shmem.c +27 −4
  328. drivers/firmware/arm_scmi/smc.c +1 −1
  329. drivers/firmware/arm_scmi/virtio.c +16 −10
  330. drivers/firmware/efi/efi.c +1 −1
  331. drivers/firmware/efi/libstub/Makefile +1 −1
  332. drivers/firmware/efi/libstub/arm64-stub.c +16 −1
  333. drivers/firmware/efi/libstub/efistub.h +28 −0
  334. drivers/firmware/efi/libstub/random.c +6 −1
  335. drivers/firmware/efi/libstub/smbios.c +48 −0
  336. drivers/firmware/efi/tpm.c +1 −1
  337. drivers/firmware/efi/vars.c +20 −48
  338. drivers/firmware/google/coreboot_table.c +29 −8
  339. drivers/fpga/Kconfig +3 −1
  340. drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 −0
  341. drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +7 −0
  342. drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c +1 −0
  343. drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +9 −7
  344. drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +1 −0
  345. drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h +3 −0
  346. drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +0 −1
  347. drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +26 −12
  348. drivers/gpu/drm/amd/amdgpu/amdgpu_cs.h +1 −0
  349. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +51 −5
  350. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 −1
  351. drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +7 −7
  352. drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +7 −1
  353. drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +8 −4
  354. drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +6 −4
  355. drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +9 −7
  356. drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +15 −38
  357. drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +10 −4
  358. drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +3 −0
  359. drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +2 −0
  360. drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 −26
  361. drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +41 −0
  362. drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c +2 −0
  363. drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +1 −1
  364. drivers/gpu/drm/amd/amdgpu/mmsch_v4_0.h +0 −1
  365. drivers/gpu/drm/amd/amdgpu/psp_v13_0.c +1 −0
  366. drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +1 −8
  367. drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h +383 −381
  368. drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx10.asm +6 −0
  369. drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +15 −19
  370. drivers/gpu/drm/amd/amdkfd/kfd_events.c +1 −2
  371. drivers/gpu/drm/amd/amdkfd/kfd_migrate.c +1 −3
  372. drivers/gpu/drm/amd/display/Kconfig +7 −0
  373. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +80 −17
  374. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +0 −6
  375. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +8 −2
  376. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +138 −116
  377. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h +6 −6
  378. drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +30 −0
  379. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c +16 −16
  380. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +9 −2
  381. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c +7 −4
  382. drivers/gpu/drm/amd/display/dc/dc.h +2 −0
  383. drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c +2 −1
  384. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +24 −10
  385. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c +19 −9
  386. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +25 −11
  387. drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubp.c +1 −0
  388. drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c +7 −0
  389. drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dio_stream_encoder.c +18 −6
  390. drivers/gpu/drm/amd/display/dc/dcn314/dcn314_hwseq.c +2 −4
  391. drivers/gpu/drm/amd/display/dc/dcn314/dcn314_optc.c +1 −1
  392. drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +1 −1
  393. drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c +3 −1
  394. drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +6 −12
  395. drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +1 −0
  396. drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c +1 −1
  397. drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +1 −0
  398. drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +1 −0
  399. drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c +2 −2
  400. drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +24 −6
  401. drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c +13 −4
  402. drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.h +5 −0
  403. drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c +14 −6
  404. drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.h +4 −2
  405. drivers/gpu/drm/amd/display/dc/dml/dcn32/display_rq_dlg_calc_32.c +2 −2
  406. drivers/gpu/drm/amd/display/dc/dml/dcn321/dcn321_fpu.c +12 −7
  407. drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h +4 −0
  408. drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +1 −1
  409. drivers/gpu/drm/amd/display/dc/gpio/dcn32/hw_factory_dcn32.c +14 −0
  410. drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c +6 −3
  411. drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c +12 −13
  412. drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +11 −12
  413. drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +8 −0
  414. drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_7.h +79 −38
  415. drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_4_ppsmc.h +7 −8
  416. drivers/gpu/drm/amd/pm/swsmu/inc/smu_v11_0.h +1 −9
  417. drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h +4 −9
  418. drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +7 −1
  419. drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1 −1
  420. drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +9 −0
  421. drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +28 −2
  422. drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +28 −2
  423. drivers/gpu/drm/display/drm_dp_dual_mode_helper.c +29 −22
  424. drivers/gpu/drm/display/drm_dp_mst_topology.c +1 −1
  425. drivers/gpu/drm/drm_drv.c +1 −1
  426. drivers/gpu/drm/drm_format_helper.c +47 −19
  427. drivers/gpu/drm/drm_internal.h +2 −1
  428. drivers/gpu/drm/drm_mode_config.c +0 −3
  429. drivers/gpu/drm/drm_panel_orientation_quirks.c +12 −0
  430. drivers/gpu/drm/i915/Makefile +1 −0
  431. drivers/gpu/drm/i915/display/intel_ddi.c +28 −40
  432. drivers/gpu/drm/i915/display/intel_display.c +7 −3
  433. drivers/gpu/drm/i915/display/intel_display_core.h +8 −0
  434. drivers/gpu/drm/i915/display/intel_display_power.c +4 −4
  435. drivers/gpu/drm/i915/display/intel_display_power_well.c +3 −4
  436. drivers/gpu/drm/i915/display/intel_dkl_phy.c +109 −0
  437. drivers/gpu/drm/i915/display/intel_dkl_phy.h +24 −0
  438. drivers/gpu/drm/i915/display/intel_dp.c +1 −1
  439. drivers/gpu/drm/i915/display/intel_dpll_mgr.c +27 −32
  440. drivers/gpu/drm/i915/display/intel_lvds.c +1 −2
  441. drivers/gpu/drm/i915/display/intel_panel.c +2 −2
  442. drivers/gpu/drm/i915/display/intel_panel.h +1 −1
  443. drivers/gpu/drm/i915/display/intel_psr.c +4 −1
  444. drivers/gpu/drm/i915/display/intel_sdvo.c +39 −25
  445. drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +2 −2
  446. drivers/gpu/drm/i915/gem/i915_gem_internal.c +4 −15
  447. drivers/gpu/drm/i915/gem/i915_gem_shmem.c +3 −3
  448. drivers/gpu/drm/i915/gem/i915_gem_ttm.c +9 −5
  449. drivers/gpu/drm/i915/gem/i915_gem_userptr.c +4 −3
  450. drivers/gpu/drm/i915/gt/intel_gt.c +12 −2
  451. drivers/gpu/drm/i915/gt/intel_gt_requests.c +1 −1
  452. drivers/gpu/drm/i915/gvt/kvmgt.c +3 −5
  453. drivers/gpu/drm/i915/i915_driver.c +1 −0
  454. drivers/gpu/drm/i915/i915_reg.h +3 −0
  455. drivers/gpu/drm/i915/i915_scatterlist.h +21 −13
  456. drivers/gpu/drm/i915/intel_dram.c +1 −2
  457. drivers/gpu/drm/imx/Kconfig +0 −1
  458. drivers/gpu/drm/imx/imx-tve.c +3 −2
  459. drivers/gpu/drm/lima/lima_devfreq.c +9 −6
  460. drivers/gpu/drm/panel/panel-simple.c +2 −0
  461. drivers/gpu/drm/panfrost/panfrost_mmu.c +10 −1
  462. drivers/gpu/drm/rcar-du/Kconfig +9 −4
  463. drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c +19 −7
  464. drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +2 −1
  465. drivers/gpu/drm/rockchip/rockchip_drm_gem.c +4 −1
  466. drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +8 −2
  467. drivers/gpu/drm/tegra/drm.c +4 −0
  468. drivers/gpu/drm/vc4/vc4_drv.c +6 −1
  469. drivers/gpu/drm/vc4/vc4_hdmi.c +36 −11
  470. drivers/gpu/drm/vc4/vc4_hdmi.h +1 −0
  471. drivers/gpu/drm/vc4/vc4_kms.c +4 −4
  472. drivers/gpu/host1x/dev.c +4 −0
  473. drivers/hid/hid-asus.c +1 −3
  474. drivers/hid/hid-hyperv.c +1 −1
  475. drivers/hid/wacom_wac.c +6 −5
  476. drivers/hv/channel_mgmt.c +5 −1
  477. drivers/hv/hv_balloon.c +1 −1
  478. drivers/hv/vmbus_drv.c +1 −0
  479. drivers/hwmon/asus-ec-sensors.c +2 −0
  480. drivers/hwmon/coretemp.c +8 −1
  481. drivers/hwmon/i5500_temp.c +1 −1
  482. drivers/hwmon/ibmpex.c +1 −0
  483. drivers/hwmon/ina3221.c +2 −2
  484. drivers/hwmon/ltc2947-core.c +1 −1
  485. drivers/hwmon/pmbus/pmbus.h +0 −1
  486. drivers/hwmon/scmi-hwmon.c +103 −13
  487. drivers/hwspinlock/qcom_hwspinlock.c +32 −10
  488. drivers/i2c/busses/i2c-cadence.c +8 −3
  489. drivers/i2c/busses/i2c-i801.c +1 −0
  490. drivers/i2c/busses/i2c-imx.c +4 −2
  491. drivers/i2c/busses/i2c-npcm7xx.c +10 −1
  492. drivers/i2c/busses/i2c-piix4.c +1 −0
  493. drivers/i2c/busses/i2c-qcom-geni.c +0 −1
  494. drivers/i2c/busses/i2c-tegra.c +10 −6
  495. drivers/i2c/i2c-core-base.c +5 −4
  496. drivers/iio/accel/bma400_core.c +15 −13
  497. drivers/iio/adc/aspeed_adc.c +5 −6
  498. drivers/iio/adc/at91-sama5d2_adc.c +2 −4
  499. drivers/iio/adc/at91_adc.c +3 −1
  500. drivers/iio/adc/mp2629_adc.c +3 −2
  501. drivers/iio/health/afe4403.c +3 −2
  502. drivers/iio/health/afe4404.c +7 −5
  503. drivers/iio/imu/bno055/bno055.c +1 −1
  504. drivers/iio/industrialio-sw-trigger.c +5 −1
  505. drivers/iio/light/Kconfig +2 −0
  506. drivers/iio/light/apds9960.c +6 −6
  507. drivers/iio/pressure/ms5611.h +4 −8
  508. drivers/iio/pressure/ms5611_core.c +27 −24
  509. drivers/iio/pressure/ms5611_spi.c +1 −1
  510. drivers/iio/trigger/iio-trig-sysfs.c +5 −1
  511. drivers/infiniband/core/cma.c +1 −1
  512. drivers/infiniband/core/device.c +9 −1
  513. drivers/infiniband/core/nldev.c +1 −1
  514. drivers/infiniband/hw/efa/efa_main.c +3 −1
  515. drivers/infiniband/hw/hfi1/pio.c +1 −2
  516. drivers/infiniband/hw/hns/hns_roce_hw_v2.c +4 −11
  517. drivers/infiniband/hw/hns/hns_roce_hw_v2.h +0 −2
  518. drivers/infiniband/hw/qedr/main.c +8 −1
  519. drivers/infiniband/sw/rxe/rxe_resp.c +3 −1
  520. drivers/input/joystick/iforce/iforce-main.c +4 −4
  521. drivers/input/misc/soc_button_array.c +13 −1
  522. drivers/input/mouse/synaptics.c +1 −0
  523. drivers/input/serio/i8042-acpipnpio.h +4 −4
  524. drivers/input/serio/i8042.c +0 −4
  525. drivers/input/touchscreen/goodix.c +11 −0
  526. drivers/input/touchscreen/raydium_i2c_ts.c +3 −1
  527. drivers/iommu/intel/dmar.c +1 −0
  528. drivers/iommu/intel/iommu.c +73 −8
  529. drivers/iommu/intel/iommu.h +4 −0
  530. drivers/iommu/intel/pasid.c +3 −2
  531. drivers/iommu/intel/svm.c +13 −6
  532. drivers/isdn/hardware/mISDN/netjet.c +1 −1
  533. drivers/isdn/mISDN/core.c +4 −3
  534. drivers/isdn/mISDN/dsp_pipeline.c +2 −1
  535. drivers/md/dm-bufio.c +2 −0
  536. drivers/md/dm-crypt.c +1 −0
  537. drivers/md/dm-integrity.c +15 −6
  538. drivers/md/dm-ioctl.c +2 −2
  539. drivers/md/dm-log-writes.c +1 −0
  540. drivers/media/common/videobuf2/frame_vector.c +12 −56
  541. drivers/misc/vmw_vmci/vmci_queue_pair.c +2 −0
  542. drivers/mmc/core/core.c +14 −3
  543. drivers/mmc/core/mmc_test.c +2 −1
  544. drivers/mmc/host/mtk-sd.c +2 −4
  545. drivers/mmc/host/sdhci-brcmstb.c +2 −1
  546. drivers/mmc/host/sdhci-cqhci.h +24 −0
  547. drivers/mmc/host/sdhci-esdhc-imx.c +5 −4
  548. drivers/mmc/host/sdhci-of-arasan.c +2 −1
  549. drivers/mmc/host/sdhci-pci-core.c +2 −0
  550. drivers/mmc/host/sdhci-pci-o2micro.c +7 −0
  551. drivers/mmc/host/sdhci-sprd.c +3 −1
  552. drivers/mmc/host/sdhci-tegra.c +2 −1
  553. drivers/mmc/host/sdhci.c +54 −7
  554. drivers/mmc/host/sdhci.h +2 −0
  555. drivers/mmc/host/sdhci_am654.c +4 −3
  556. drivers/mtd/nand/onenand/Kconfig +1 −0
  557. drivers/mtd/nand/raw/nand_base.c +2 −2
  558. drivers/mtd/nand/raw/qcom_nandc.c +7 −5
  559. drivers/net/arcnet/com20020_cs.c +9 −2
  560. drivers/net/bonding/bond_main.c +12 −5
  561. drivers/net/can/at91_can.c +1 −1
  562. drivers/net/can/c_can/c_can_main.c +1 −1
  563. drivers/net/can/can327.c +4 −2
  564. drivers/net/can/cc770/cc770.c +1 −1
  565. drivers/net/can/cc770/cc770_isa.c +6 −4
  566. drivers/net/can/ctucanfd/ctucanfd_base.c +1 −1
  567. drivers/net/can/dev/skb.c +1 −9
  568. drivers/net/can/flexcan/flexcan-core.c +1 −1
  569. drivers/net/can/grcan.c +1 −1
  570. drivers/net/can/ifi_canfd/ifi_canfd.c +1 −1
  571. drivers/net/can/janz-ican3.c +1 −1
  572. drivers/net/can/kvaser_pciefd.c +1 −1
  573. drivers/net/can/m_can/m_can.c +2 −2
  574. drivers/net/can/m_can/m_can_pci.c +6 −3
  575. drivers/net/can/mscan/mscan.c +1 −1
  576. drivers/net/can/pch_can.c +1 −1
  577. drivers/net/can/peak_canfd/peak_canfd.c +1 −1
  578. drivers/net/can/rcar/rcar_can.c +1 −1
  579. drivers/net/can/rcar/rcar_canfd.c +5 −10
  580. drivers/net/can/sja1000/sja1000.c +1 −1
  581. drivers/net/can/sja1000/sja1000_isa.c +6 −4
  582. drivers/net/can/slcan/slcan-core.c +1 −1
  583. drivers/net/can/softing/softing_main.c +1 −1
  584. drivers/net/can/spi/hi311x.c +1 −1
  585. drivers/net/can/spi/mcp251x.c +1 −1
  586. drivers/net/can/spi/mcp251xfd/mcp251xfd-tx.c +1 −1
  587. drivers/net/can/sun4i_can.c +1 −1
  588. drivers/net/can/ti_hecc.c +1 −1
  589. drivers/net/can/usb/ems_usb.c +1 −1
  590. drivers/net/can/usb/esd_usb.c +1 −1
  591. drivers/net/can/usb/etas_es58x/es58x_core.c +5 −2
  592. drivers/net/can/usb/gs_usb.c +1 −1
  593. drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c +1 −1
  594. drivers/net/can/usb/mcba_usb.c +8 −4
  595. drivers/net/can/usb/peak_usb/pcan_usb_core.c +1 −1
  596. drivers/net/can/usb/ucan.c +1 −1
  597. drivers/net/can/usb/usb_8dev.c +1 −1
  598. drivers/net/can/xilinx_can.c +1 −1
  599. drivers/net/dsa/dsa_loop.c +18 −7
  600. drivers/net/dsa/lan9303-core.c +1 −1
  601. drivers/net/dsa/sja1105/sja1105_mdio.c +6 −0
  602. drivers/net/ethernet/adi/adin1110.c +29 −9
  603. drivers/net/ethernet/altera/altera_tse_main.c +1 −0
  604. drivers/net/ethernet/amazon/ena/ena_netdev.c +7 −1
  605. drivers/net/ethernet/apm/xgene/xgene_enet_main.c +3 −1
  606. drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c +3 −2
  607. drivers/net/ethernet/aquantia/atlantic/aq_macsec.c +2 −0
  608. drivers/net/ethernet/aquantia/atlantic/aq_main.c +2 −2
  609. drivers/net/ethernet/aquantia/atlantic/aq_main.h +2 −0
  610. drivers/net/ethernet/aquantia/atlantic/macsec/macsec_api.c +11 −7
  611. drivers/net/ethernet/atheros/ag71xx.c +2 −1
  612. drivers/net/ethernet/broadcom/Kconfig +1 −1
  613. drivers/net/ethernet/broadcom/bgmac.c +0 −1
  614. drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +8 −4
  615. drivers/net/ethernet/broadcom/bnxt/bnxt.c +54 −10
  616. drivers/net/ethernet/broadcom/bnxt/bnxt.h +1 −0
  617. drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +1 −1
  618. drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c +2 −1
  619. drivers/net/ethernet/cavium/liquidio/lio_main.c +26 −8
  620. drivers/net/ethernet/cavium/thunder/thunder_bgx.c +3 −1
  621. drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +1 −0
  622. drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +1 −1
  623. drivers/net/ethernet/davicom/dm9051.c +3 −1
  624. drivers/net/ethernet/engleder/tsnep_main.c +56 −1
  625. drivers/net/ethernet/freescale/enetc/enetc.c +5 −3
  626. drivers/net/ethernet/freescale/enetc/enetc.h +1 −0
  627. drivers/net/ethernet/freescale/enetc/enetc_qos.c +13 −8
  628. drivers/net/ethernet/freescale/fec_main.c +8 −18
  629. drivers/net/ethernet/freescale/fman/mac.c +9 −0
  630. drivers/net/ethernet/hisilicon/hns3/hnae3.h +0 −1
  631. drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_rss.c +0 −20
  632. drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_rss.h +0 −2
  633. drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +95 −72
  634. drivers/net/ethernet/hisilicon/hns3/hns3_enet.h +1 −0
  635. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +12 −7
  636. drivers/net/ethernet/huawei/hinic/hinic_main.c +8 −1
  637. drivers/net/ethernet/ibm/ibmveth.c +2 −1
  638. drivers/net/ethernet/ibm/ibmveth.h +1 −0
  639. drivers/net/ethernet/ibm/ibmvnic.c +8 −8
  640. drivers/net/ethernet/intel/e100.c +1 −4
  641. drivers/net/ethernet/intel/fm10k/fm10k_main.c +9 −1
  642. drivers/net/ethernet/intel/i40e/i40e_main.c +10 −1
  643. drivers/net/ethernet/intel/iavf/iavf.h +0 −1
  644. drivers/net/ethernet/intel/iavf/iavf_main.c +31 −19
  645. drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +2 −0
  646. drivers/net/ethernet/intel/ice/ice_base.c +1 −1
  647. drivers/net/ethernet/intel/ice/ice_lib.c +25 −0
  648. drivers/net/ethernet/intel/ice/ice_lib.h +1 −0
  649. drivers/net/ethernet/intel/ice/ice_main.c +6 −6
  650. drivers/net/ethernet/intel/ice/ice_ptp.c +10 −10
  651. drivers/net/ethernet/intel/ice/ice_vf_lib.c +4 −1
  652. drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +9 −1
  653. drivers/net/ethernet/marvell/mv643xx_eth.c +1 −0
  654. drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +6 −2
  655. drivers/net/ethernet/marvell/octeon_ep/octep_main.c +11 −5
  656. drivers/net/ethernet/marvell/octeontx2/Kconfig +1 −0
  657. drivers/net/ethernet/marvell/octeontx2/af/mcs.c +1 −1
  658. drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +3 −0
  659. drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +2 −0
  660. drivers/net/ethernet/marvell/octeontx2/af/rvu_sdp.c +5 −2
  661. drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +1 −0
  662. drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +1 −1
  663. drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +105 −30
  664. drivers/net/ethernet/marvell/octeontx2/nic/otx2_struct.h +57 −0
  665. drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c +19 −13
  666. drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.h +1 −0
  667. drivers/net/ethernet/marvell/prestera/prestera_main.c +1 −0
  668. drivers/net/ethernet/marvell/prestera/prestera_router.c +1 −1
  669. drivers/net/ethernet/marvell/prestera/prestera_router_hw.c +2 −2
  670. drivers/net/ethernet/marvell/prestera/prestera_rxtx.c +6 −1
  671. drivers/net/ethernet/mediatek/mtk_eth_soc.c +11 −6
  672. drivers/net/ethernet/mediatek/mtk_ppe.c +17 −2
  673. drivers/net/ethernet/mediatek/mtk_ppe.h +1 −0
  674. drivers/net/ethernet/mediatek/mtk_star_emac.c +2 −0
  675. drivers/net/ethernet/mellanox/mlx4/qp.c +2 −1
  676. drivers/net/ethernet/mellanox/mlx5/core/cmd.c +35 −27
  677. drivers/net/ethernet/mellanox/mlx5/core/diag/cmd_tracepoint.h +45 −0
  678. drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +1 −1
  679. drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c +31 −0
  680. drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.c +32 −60
  681. drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c +8 −8
  682. drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.h +1 −2
  683. drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h +23 −1
  684. drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c +2 −2
  685. drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c +2 −2
  686. drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c +70 −71
  687. drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.h +4 −2
  688. drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c +11 −6
  689. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +0 −18
  690. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +10 −2
  691. drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +14 −13
  692. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +12 −19
  693. drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +5 −0
  694. drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +11 −6
  695. drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +8 −0
  696. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +11 −16
  697. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c +10 −6
  698. drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c +9 −3
  699. drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c +7 −5
  700. drivers/net/ethernet/mellanox/mlx5/core/lag/lag.h +13 −1
  701. drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c +64 −36
  702. drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.h +0 −1
  703. drivers/net/ethernet/mellanox/mlx5/core/main.c +6 −3
  704. drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c +88 −0
  705. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c +4 −1
  706. drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +2 −0
  707. drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c +3 −0
  708. drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c +18 −8
  709. drivers/net/ethernet/microchip/lan966x/lan966x_main.c +2 −2
  710. drivers/net/ethernet/microchip/lan966x/lan966x_main.h +2 −0
  711. drivers/net/ethernet/microchip/lan966x/lan966x_regs.h +15 −0
  712. drivers/net/ethernet/microchip/lan966x/lan966x_vlan.c +6 −0
  713. drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c +3 −0
  714. drivers/net/ethernet/microchip/sparx5/sparx5_main.c +3 −0
  715. drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c +12 −2
  716. drivers/net/ethernet/microchip/sparx5/sparx5_tc.c +2 −5
  717. drivers/net/ethernet/neterion/s2io.c +20 −9
  718. drivers/net/ethernet/netronome/nfp/nfp_devlink.c +1 −1
  719. drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c +6 −3
  720. drivers/net/ethernet/ni/nixge.c +16 −14
  721. drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +5 −1
  722. drivers/net/ethernet/pensando/ionic/ionic_main.c +7 −1
  723. drivers/net/ethernet/qlogic/qed/qed_mcp.c +12 −12
  724. drivers/net/ethernet/qlogic/qla3xxx.c +1 −0
  725. drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +2 −2
  726. drivers/net/ethernet/renesas/ravb_main.c +1 −0
  727. drivers/net/ethernet/sfc/ef100_netdev.c +1 −0
  728. drivers/net/ethernet/sfc/efx.c +6 −2
  729. drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +9 −2
  730. drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c +33 −13
  731. drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +3 −5
  732. drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +2 −0
  733. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +13 −2
  734. drivers/net/ethernet/sunplus/spl2sw_driver.c +0 −1
  735. drivers/net/ethernet/ti/am65-cpsw-nuss.c +2 −2
  736. drivers/net/ethernet/ti/cpsw.c +2 −0
  737. drivers/net/ethernet/tundra/tsi108_eth.c +4 −1
  738. drivers/net/ethernet/xilinx/xilinx_emaclite.c +1 −1
  739. drivers/net/hamradio/bpqether.c +1 −1
  740. drivers/net/ipvlan/ipvlan.h +1 −0
  741. drivers/net/ipvlan/ipvlan_main.c +2 −0
  742. drivers/net/loopback.c +1 −1
  743. drivers/net/macsec.c +17 −34
  744. drivers/net/macvlan.c +5 −3
  745. drivers/net/mctp/mctp-i2c.c +32 −15
  746. drivers/net/mdio/fwnode_mdio.c +1 −1
  747. drivers/net/mhi_net.c +2 −0
  748. drivers/net/netdevsim/dev.c +1 −0
  749. drivers/net/ntb_netdev.c +8 −1
  750. drivers/net/phy/at803x.c +3 −1
  751. drivers/net/phy/dp83867.c +7 −0
  752. drivers/net/phy/marvell.c +9 −7
  753. drivers/net/phy/mdio_bus.c +1 −1
  754. drivers/net/phy/mscc/mscc_macsec.c +1 −0
  755. drivers/net/phy/phy_device.c +2 −0
  756. drivers/net/phy/phylink.c +16 −6
  757. drivers/net/thunderbolt.c +14 −5
  758. drivers/net/tun.c +18 −7
  759. drivers/net/usb/cdc_ncm.c +1 −0
  760. drivers/net/usb/qmi_wwan.c +2 −0
  761. drivers/net/usb/smsc95xx.c +42 −4
  762. drivers/net/virtio_net.c +1 −2
  763. drivers/net/wan/lapbether.c +2 −1
  764. drivers/net/wireless/ath/ath11k/qmi.h +1 −1
  765. drivers/net/wireless/ath/ath11k/reg.c +1 −5
  766. drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c +4 −0
  767. drivers/net/wireless/cisco/airo.c +14 −4
  768. drivers/net/wireless/mac80211_hwsim.c +5 −0
  769. drivers/net/wireless/microchip/wilc1000/cfg80211.c +30 −9
  770. drivers/net/wireless/microchip/wilc1000/hif.c +16 −5
  771. drivers/net/wireless/ralink/rt2x00/rt2400pci.c +4 −4
  772. drivers/net/wireless/ralink/rt2x00/rt2400pci.h +1 −1
  773. drivers/net/wireless/ralink/rt2x00/rt2500pci.c +4 −4
  774. drivers/net/wireless/ralink/rt2x00/rt2500pci.h +1 −1
  775. drivers/net/wireless/ralink/rt2x00/rt2500usb.c +4 −4
  776. drivers/net/wireless/ralink/rt2x00/rt2500usb.h +1 −1
  777. drivers/net/wireless/ralink/rt2x00/rt2800lib.c +30 −30
  778. drivers/net/wireless/ralink/rt2x00/rt2800lib.h +4 −4
  779. drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +3 −3
  780. drivers/net/wireless/ralink/rt2x00/rt61pci.c +2 −2
  781. drivers/net/wireless/ralink/rt2x00/rt61pci.h +1 −1
  782. drivers/net/wireless/ralink/rt2x00/rt73usb.c +2 −2
  783. drivers/net/wireless/ralink/rt2x00/rt73usb.h +1 −1
  784. drivers/net/wwan/Kconfig +1 −1
  785. drivers/net/wwan/iosm/iosm_ipc_coredump.c +1 −0
  786. drivers/net/wwan/iosm/iosm_ipc_devlink.c +1 −0
  787. drivers/net/wwan/iosm/iosm_ipc_imem_ops.c +8 −0
  788. drivers/net/wwan/iosm/iosm_ipc_mux.h +1 −0
  789. drivers/net/wwan/iosm/iosm_ipc_mux_codec.c +14 −12
  790. drivers/net/wwan/iosm/iosm_ipc_pcie.c +15 −3
  791. drivers/net/wwan/iosm/iosm_ipc_protocol.h +1 −1
  792. drivers/net/wwan/iosm/iosm_ipc_wwan.c +7 −36
  793. drivers/net/wwan/mhi_wwan_mbim.c +1 −0
  794. drivers/net/wwan/t7xx/t7xx_modem_ops.c +2 −0
  795. drivers/nfc/fdp/fdp.c +9 −1
  796. drivers/nfc/nfcmrvl/i2c.c +9 −2
  797. drivers/nfc/nxp-nci/core.c +11 −4
  798. drivers/nfc/s3fwrn5/core.c +7 −2
  799. drivers/nfc/st-nci/se.c +36 −13
  800. drivers/nvme/host/core.c +2 −3
  801. drivers/nvme/host/multipath.c +3 −0
  802. drivers/nvme/host/pci.c +6 −2
  803. drivers/nvme/target/auth.c +2 −0
  804. drivers/nvme/target/configfs.c +6 −2
  805. drivers/nvmem/lan9662-otpc.c +2 −2
  806. drivers/nvmem/rmem.c +2 −2
  807. drivers/nvmem/u-boot-env.c +1 −1
  808. drivers/of/property.c +3 −1
  809. drivers/parisc/iosapic.c +1 −0
  810. drivers/parisc/pdc_stable.c +17 −17
  811. drivers/parport/parport_pc.c +1 −1
  812. drivers/pci/controller/pci-hyperv.c +90 −20
  813. drivers/phy/qualcomm/phy-qcom-qmp-combo.c +1 −1
  814. drivers/phy/ralink/phy-mt7621-pci.c +2 −1
  815. drivers/phy/st/phy-stm32-usbphyc.c +2 −0
  816. drivers/phy/sunplus/phy-sunplus-usb2.c +2 −2
  817. drivers/phy/tegra/xusb.c +16 −4
  818. drivers/pinctrl/devicetree.c +2 −0
  819. drivers/pinctrl/intel/pinctrl-intel.c +26 −1
  820. drivers/pinctrl/mediatek/mtk-eint.c +35 −8
  821. drivers/pinctrl/mediatek/mtk-eint.h +6 −0
  822. drivers/pinctrl/mediatek/pinctrl-mt2701.c +1 −0
  823. drivers/pinctrl/mediatek/pinctrl-mt2712.c +1 −0
  824. drivers/pinctrl/mediatek/pinctrl-mt6765.c +1 −0
  825. drivers/pinctrl/mediatek/pinctrl-mt6779.c +1 −0
  826. drivers/pinctrl/mediatek/pinctrl-mt6795.c +1 −0
  827. drivers/pinctrl/mediatek/pinctrl-mt7622.c +1 −0
  828. drivers/pinctrl/mediatek/pinctrl-mt7623.c +1 −0
  829. drivers/pinctrl/mediatek/pinctrl-mt7629.c +1 −0
  830. drivers/pinctrl/mediatek/pinctrl-mt7986.c +2 −0
  831. drivers/pinctrl/mediatek/pinctrl-mt8127.c +1 −0
  832. drivers/pinctrl/mediatek/pinctrl-mt8135.c +1 −0
  833. drivers/pinctrl/mediatek/pinctrl-mt8167.c +1 −0
  834. drivers/pinctrl/mediatek/pinctrl-mt8173.c +1 −0
  835. drivers/pinctrl/mediatek/pinctrl-mt8183.c +1 −0
  836. drivers/pinctrl/mediatek/pinctrl-mt8186.c +1 −0
  837. drivers/pinctrl/mediatek/pinctrl-mt8188.c +1 −0
  838. drivers/pinctrl/mediatek/pinctrl-mt8192.c +1 −0
  839. drivers/pinctrl/mediatek/pinctrl-mt8195.c +1 −0
  840. drivers/pinctrl/mediatek/pinctrl-mt8365.c +1 −0
  841. drivers/pinctrl/mediatek/pinctrl-mt8516.c +1 −0
  842. drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c +3 −0
  843. drivers/pinctrl/pinctrl-rockchip.c +40 −0
  844. drivers/pinctrl/pinctrl-single.c +1 −1
  845. drivers/pinctrl/qcom/pinctrl-sc8280xp.c +2 −2
  846. drivers/platform/surface/aggregator/ssh_packet_layer.c +20 −4
  847. drivers/platform/surface/surface_aggregator_registry.c +37 −0
  848. drivers/platform/x86/acer-wmi.c +9 −0
  849. drivers/platform/x86/amd/pmc.c +1 −2
  850. drivers/platform/x86/asus-wmi.c +2 −0
  851. drivers/platform/x86/hp-wmi.c +13 −2
  852. drivers/platform/x86/ideapad-laptop.c +59 −3
  853. drivers/platform/x86/intel/hid.c +3 −0
  854. drivers/platform/x86/intel/pmc/pltdrv.c +9 −0
  855. drivers/platform/x86/intel/pmt/class.c +30 −1
  856. drivers/platform/x86/p2sb.c +6 −9
  857. drivers/platform/x86/thinkpad_acpi.c +8 −0
  858. drivers/platform/x86/touchscreen_dmi.c +25 −0
  859. drivers/power/supply/ab8500_btemp.c +8 −1
  860. drivers/power/supply/ip5xxx_power.c +1 −1
  861. drivers/power/supply/rk817_charger.c +6 −8
  862. drivers/regulator/core.c +6 −2
  863. drivers/regulator/rt5759-regulator.c +1 −0
  864. drivers/regulator/slg51000-regulator.c +2 −0
  865. drivers/regulator/twl6030-regulator.c +13 −4
  866. drivers/s390/block/dasd_devmap.c +1 −1
  867. drivers/s390/block/dasd_eckd.c +21 −22
  868. drivers/s390/block/dasd_ioctl.c +1 −1
  869. drivers/s390/block/dcssblk.c +1 −0
  870. drivers/s390/crypto/ap_bus.c +4 −1
  871. drivers/s390/crypto/zcrypt_msgtype6.c +15 −6
  872. drivers/s390/scsi/zfcp_fsf.c +1 −1
  873. drivers/scsi/ibmvscsi/ibmvfc.c +11 −3
  874. drivers/scsi/mpi3mr/mpi3mr_os.c +2 −1
  875. drivers/scsi/scsi_debug.c +12 −1
  876. drivers/scsi/scsi_transport_iscsi.c +16 −15
  877. drivers/scsi/scsi_transport_sas.c +9 −4
  878. drivers/scsi/storvsc_drv.c +34 −35
  879. drivers/siox/siox-core.c +2 −0
  880. drivers/slimbus/Kconfig +1 −1
  881. drivers/slimbus/stream.c +4 −4
  882. drivers/soc/imx/imx93-pd.c +15 −2
  883. drivers/soc/imx/soc-imx8m.c +11 −0
  884. drivers/soundwire/intel.c +1 −0
  885. drivers/soundwire/qcom.c +9 −0
  886. drivers/spi/spi-amd.c +1 −1
  887. drivers/spi/spi-dw-dma.c +3 −0
  888. drivers/spi/spi-imx.c +8 −5
  889. drivers/spi/spi-intel.c +4 −4
  890. drivers/spi/spi-meson-spicc.c +22 −2
  891. drivers/spi/spi-mt65xx.c +20 −11
  892. drivers/spi/spi-stm32.c +2 −1
  893. drivers/spi/spi-tegra210-quad.c +8 −1
  894. drivers/staging/rtl8192e/rtllib_softmac_wx.c +1 −8
  895. drivers/target/loopback/tcm_loop.c +2 −1
  896. drivers/tee/optee/device.c +1 −1
  897. drivers/tty/n_gsm.c +38 −33
  898. drivers/tty/serial/8250/8250_lpss.c +13 −4
  899. drivers/tty/serial/8250/8250_omap.c +30 −22
  900. drivers/tty/serial/8250/8250_parisc.c +0 −0
  901. drivers/tty/serial/8250/8250_port.c +5 −2
  902. drivers/tty/serial/8250/Kconfig +2 −2
  903. drivers/tty/serial/8250/Makefile +1 −1
  904. drivers/tty/serial/fsl_lpuart.c +49 −27
  905. drivers/tty/serial/imx.c +1 −0
  906. drivers/usb/cdns3/cdnsp-gadget.c +4 −8
  907. drivers/usb/cdns3/cdnsp-ring.c +12 −5
  908. drivers/usb/cdns3/host.c +28 −28
  909. drivers/usb/chipidea/otg_fsm.c +2 −0
  910. drivers/usb/core/quirks.c +3 −0
  911. drivers/usb/dwc3/core.c +10 −0
  912. drivers/usb/dwc3/dwc3-exynos.c +1 −10
  913. drivers/usb/dwc3/gadget.c +9 −8
  914. drivers/usb/dwc3/host.c +0 −10
  915. drivers/usb/gadget/function/uvc_v4l2.c +21 −51
  916. drivers/usb/host/bcma-hcd.c +6 −4
  917. drivers/usb/serial/option.c +17 −2
  918. drivers/usb/typec/mux/intel_pmc_mux.c +13 −2
  919. drivers/usb/typec/tipd/core.c +3 −3
  920. drivers/vfio/pci/vfio_pci_core.c +5 −5
  921. drivers/vfio/vfio_main.c +21 −5
  922. drivers/video/fbdev/core/fbcon.c +1 −1
  923. drivers/virt/coco/sev-guest/sev-guest.c +70 −14
  924. drivers/watchdog/exar_wdt.c +3 −1
  925. drivers/watchdog/sp805_wdt.c +1 −1
  926. drivers/xen/pcpu.c +1 −1
  927. drivers/xen/platform-pci.c +7 −3
  928. drivers/xen/xen-pciback/conf_space_capability.c +6 −3
  929. fs/afs/fs_probe.c +2 −2
  930. fs/afs/server.c +1 −1
  931. fs/btrfs/backref.c +34 −20
  932. fs/btrfs/compression.c +8 −6
  933. fs/btrfs/ctree.c +46 −6
  934. fs/btrfs/ctree.h +11 −5
  935. fs/btrfs/disk-io.c +7 −7
  936. fs/btrfs/disk-io.h +2 −0
  937. fs/btrfs/export.c +1 −1
  938. fs/btrfs/export.h +1 −1
  939. fs/btrfs/extent-tree.c +13 −12
  940. fs/btrfs/file.c +22 −7
  941. fs/btrfs/inode.c +12 −4
  942. fs/btrfs/ioctl.c +13 −10
  943. fs/btrfs/qgroup.c +1 −8
  944. fs/btrfs/raid56.c +11 −7
  945. fs/btrfs/scrub.c +1 −8
  946. fs/btrfs/send.c +36 −12
  947. fs/btrfs/super.c +16 −0
  948. fs/btrfs/sysfs.c +5 −2
  949. fs/btrfs/tests/btrfs-tests.c +1 −1
  950. fs/btrfs/tests/qgroup-tests.c +19 −17
  951. fs/btrfs/tree-log.c +55 −4
  952. fs/btrfs/volumes.c +40 −11
  953. fs/btrfs/volumes.h +2 −2
  954. fs/btrfs/zoned.c +45 −4
  955. fs/btrfs/zoned.h +11 −0
  956. fs/ceph/caps.c +12 −36
  957. fs/ceph/inode.c +1 −1
  958. fs/ceph/snap.c +2 −1
  959. fs/cifs/cifsfs.c +28 −2
  960. fs/cifs/connect.c +11 −3
  961. fs/cifs/inode.c +0 −5
  962. fs/cifs/ioctl.c +2 −2
  963. fs/cifs/misc.c +5 −1
  964. fs/cifs/sess.c +2 −2
  965. fs/cifs/smb2misc.c +45 −36
  966. fs/cifs/smb2ops.c +22 −12
  967. fs/cifs/smb2transport.c +12 −7
  968. fs/erofs/fscache.c +21 −14
  969. fs/erofs/internal.h +4 −2
  970. fs/erofs/super.c +22 −17
  971. fs/erofs/sysfs.c +4 −4
  972. fs/erofs/zdata.c +14 −7
  973. fs/ext4/extents.c +13 −5
  974. fs/ext4/fast_commit.c +3 −2
  975. fs/ext4/ioctl.c +1 −2
  976. fs/ext4/migrate.c +2 −1
  977. fs/ext4/namei.c +9 −1
  978. fs/ext4/resize.c +5 −0
  979. fs/ext4/super.c +1 −1
  980. fs/file.c +10 −1
  981. fs/fs-writeback.c +19 −11
  982. fs/fscache/volume.c +5 −2
  983. fs/fuse/file.c +20 −21
  984. fs/fuse/readdir.c +9 −1
  985. fs/hugetlbfs/inode.c +6 −7
  986. fs/kernfs/dir.c +12 −2
  987. fs/ksmbd/vfs.c +3 −3
  988. fs/namei.c +2 −1
  989. fs/netfs/buffered_read.c +13 −7
  990. fs/netfs/io.c +3 −0
  991. fs/nfs/client.c +2 −2
  992. fs/nfs/delegation.c +17 −19
  993. fs/nfs/dir.c +2 −3
  994. fs/nfs/dns_resolve.c +4 −3
  995. fs/nfs/dns_resolve.h +1 −1
  996. fs/nfs/fs_context.c +7 −7
  997. fs/nfs/internal.h +7 −7
  998. fs/nfs/mount_clnt.c +2 −2
  999. fs/nfs/namespace.c +1 −1
  1000. fs/nfs/nfs3client.c +2 −2
  1001. fs/nfs/nfs42proc.c +3 −0
  1002. fs/nfs/nfs4_fs.h +1 −1
  1003. fs/nfs/nfs4client.c +10 −9
  1004. fs/nfs/nfs4namespace.c +8 −8
  1005. fs/nfs/nfs4proc.c +6 −4
  1006. fs/nfs/nfs4state.c +2 −0
  1007. fs/nfs/pnfs_nfs.c +3 −3
  1008. fs/nfs/super.c +2 −3
  1009. fs/nfsd/filecache.c +3 −3
  1010. fs/nfsd/nfs4state.c +1 −0
  1011. fs/nfsd/trace.h +4 −1
  1012. fs/nfsd/vfs.c +6 −5
  1013. fs/nilfs2/dat.c +7 −0
  1014. fs/nilfs2/segment.c +8 −7
  1015. fs/nilfs2/sufile.c +8 −0
  1016. fs/nilfs2/super.c +0 −2
  1017. fs/nilfs2/the_nilfs.c +0 −2
  1018. fs/proc/meminfo.c +1 −1
  1019. fs/read_write.c +15 −4
  1020. fs/udf/namei.c +1 −1
  1021. fs/userfaultfd.c +3 −0
  1022. fs/xfs/libxfs/xfs_ag.h +15 −0
  1023. fs/xfs/libxfs/xfs_alloc.c +1 −5
  1024. fs/xfs/libxfs/xfs_dir2_leaf.c +7 −2
  1025. fs/xfs/libxfs/xfs_format.h +1 −21
  1026. fs/xfs/libxfs/xfs_log_format.h +54 −6
  1027. fs/xfs/libxfs/xfs_refcount.c +199 −87
  1028. fs/xfs/libxfs/xfs_refcount.h +36 −4
  1029. fs/xfs/libxfs/xfs_refcount_btree.c +12 −3
  1030. fs/xfs/libxfs/xfs_rmap.c +2 −7
  1031. fs/xfs/libxfs/xfs_trans_resv.c +2 −2
  1032. fs/xfs/libxfs/xfs_types.h +30 −0
  1033. fs/xfs/scrub/alloc.c +1 −3
  1034. fs/xfs/scrub/ialloc.c +2 −3
  1035. fs/xfs/scrub/refcount.c +30 −42
  1036. fs/xfs/xfs_attr_item.c +33 −34
  1037. fs/xfs/xfs_bmap_item.c +28 −26
  1038. fs/xfs/xfs_error.c +7 −2
  1039. fs/xfs/xfs_extfree_item.c +45 −49
  1040. fs/xfs/xfs_extfree_item.h +16 −0
  1041. fs/xfs/xfs_file.c +4 −3
  1042. fs/xfs/xfs_inode.c +1 −1
  1043. fs/xfs/xfs_log_recover.c +8 −2
  1044. fs/xfs/xfs_ondisk.h +19 −4
  1045. fs/xfs/xfs_refcount_item.c +30 −27
  1046. fs/xfs/xfs_rmap_item.c +37 −33
  1047. fs/xfs/xfs_super.c +4 −8
  1048. fs/xfs/xfs_sysfs.h +6 −1
  1049. fs/xfs/xfs_trace.h +39 −9
  1050. fs/xfs/xfs_trans_ail.c +1 −2
  1051. fs/zonefs/super.c +44 −16
  1052. fs/zonefs/sysfs.c +0 −5
  1053. fs/zonefs/zonefs.h +4 −2
  1054. include/asm-generic/compat.h +1 −1
  1055. include/asm-generic/hyperv-tlfs.h +9 −0
  1056. include/asm-generic/tlb.h +4 −0
  1057. include/asm-generic/vmlinux.lds.h +1 −1
  1058. include/linux/blkdev.h +8 −8
  1059. include/linux/bpf.h +39 −21
  1060. include/linux/can/dev.h +16 −0
  1061. include/linux/can/platform/sja1000.h +1 −1
  1062. include/linux/efi.h +2 −1
  1063. include/linux/fault-inject.h +5 −2
  1064. include/linux/fortify-string.h +9 −4
  1065. include/linux/fs.h +8 −0
  1066. include/linux/fscache.h +1 −1
  1067. include/linux/gfp.h +16 −2
  1068. include/linux/io_uring.h +3 −0
  1069. include/linux/kvm_host.h +18 −7
  1070. include/linux/maple_tree.h +7 −0
  1071. include/linux/mlx5/driver.h +1 −0
  1072. include/linux/mm.h +21 −8
  1073. include/linux/mmc/mmc.h +1 −1
  1074. include/linux/pgtable.h +18 −0
  1075. include/linux/ring_buffer.h +1 −1
  1076. include/linux/skmsg.h +1 −1
  1077. include/linux/slab.h +0 −23
  1078. include/linux/trace.h +2 −2
  1079. include/linux/vfio.h +1 −0
  1080. include/net/inet_hashtables.h +2 −1
  1081. include/net/ip.h +1 −1
  1082. include/net/ipv6.h +1 −1
  1083. include/net/neighbour.h +1 −1
  1084. include/net/netlink.h +27 −21
  1085. include/net/sctp/stream_sched.h +2 −0
  1086. include/net/sock.h +8 −1
  1087. include/soc/at91/sama7-ddr.h +4 −1
  1088. include/sound/sof/dai.h +1 −1
  1089. include/sound/sof/info.h +4 −0
  1090. include/trace/events/huge_memory.h +4 −4
  1091. include/uapi/drm/panfrost_drm.h +1 −1
  1092. include/uapi/linux/audit.h +1 −1
  1093. include/uapi/linux/capability.h +1 −1
  1094. include/uapi/linux/idxd.h +1 −0
  1095. include/uapi/linux/in.h +1 −0
  1096. include/uapi/linux/io_uring.h +1 −1
  1097. include/uapi/linux/ip.h +4 −2
  1098. include/uapi/linux/ipv6.h +4 −2
  1099. init/Kconfig +1 −1
  1100. io_uring/filetable.c +0 −2
  1101. io_uring/io_uring.c +9 −3
  1102. io_uring/io_uring.h +9 −4
  1103. io_uring/kbuf.c +2 −0
  1104. io_uring/net.c +9 −14
  1105. io_uring/poll.c +71 −19
  1106. ipc/shm.c +25 −9
  1107. kernel/bpf/bpf_local_storage.c +1 −1
  1108. kernel/bpf/dispatcher.c +8 −20
  1109. kernel/bpf/percpu_freelist.c +11 −12
  1110. kernel/bpf/verifier.c +22 −9
  1111. kernel/events/core.c +55 −10
  1112. kernel/events/hw_breakpoint_test.c +2 −2
  1113. kernel/gcov/clang.c +2 −0
  1114. kernel/kprobes.c +11 −2
  1115. kernel/rseq.c +17 −2
  1116. kernel/sched/core.c +35 −17
  1117. kernel/sched/cpufreq_schedutil.c +15 −15
  1118. kernel/trace/fprobe.c +4 −1
  1119. kernel/trace/ftrace.c +6 −15
  1120. kernel/trace/kprobe_event_gen_test.c +39 −27
  1121. kernel/trace/rethook.c +3 −1
  1122. kernel/trace/ring_buffer.c +61 −21
  1123. kernel/trace/synth_event_gen_test.c +6 −10
  1124. kernel/trace/trace.c +17 −6
  1125. kernel/trace/trace.h +1 −0
  1126. kernel/trace/trace_dynevent.c +2 −0
  1127. kernel/trace/trace_eprobe.c +6 −2
  1128. kernel/trace/trace_events.c +11 −2
  1129. kernel/trace/trace_events_hist.c +5 −2
  1130. kernel/trace/trace_events_synth.c +2 −5
  1131. kernel/trace/trace_events_user.c +3 −1
  1132. kernel/trace/trace_osnoise.c +3 −3
  1133. kernel/trace/trace_syscalls.c +0 −2
  1134. lib/Kconfig.debug +14 −2
  1135. lib/Kconfig.kmsan +1 −0
  1136. lib/Makefile +1 −0
  1137. lib/fault-inject.c +8 −5
  1138. lib/maple_tree.c +40 −18
  1139. lib/nlattr.c +15 −26
  1140. lib/test_maple_tree.c +1193 −36733
  1141. lib/vdso/Makefile +1 −1
  1142. mm/compaction.c +11 −11
  1143. mm/damon/dbgfs.c +7 −0
  1144. mm/damon/sysfs.c +48 −2
  1145. mm/failslab.c +10 −2
  1146. mm/huge_memory.c +6 −3
  1147. mm/hugetlb.c +23 −12
  1148. mm/hugetlb_vmemmap.c +1 −0
  1149. mm/kfence/report.c +9 −4
  1150. mm/khugepaged.c +73 −24
  1151. mm/kmsan/kmsan.h +2 −0
  1152. mm/maccess.c +1 −1
  1153. mm/madvise.c +3 −3
  1154. mm/memcontrol.c +1 −1
  1155. mm/memory-failure.c +4 −1
  1156. mm/memory.c +13 −14
  1157. mm/memremap.c +1 −0
  1158. mm/migrate_device.c +6 −2
  1159. mm/mmap.c +6 −5
  1160. mm/mmu_gather.c +1 −3
  1161. mm/page_alloc.c +5 −2
  1162. mm/page_ext.c +1 −1
  1163. mm/slab_common.c +4 −20
  1164. mm/swapfile.c +4 −4
  1165. mm/userfaultfd.c +1 −1
  1166. mm/vmscan.c +59 −23
  1167. net/9p/trans_fd.c +16 −12
  1168. net/9p/trans_xen.c +9 −0
  1169. net/bluetooth/hci_conn.c +12 −6
  1170. net/bluetooth/iso.c +12 −2
  1171. net/bluetooth/l2cap_core.c +73 −13
  1172. net/bpf/test_run.c +1 −0
  1173. net/bridge/br_netlink.c +1 −1
  1174. net/bridge/br_sysfs_br.c +1 −1
  1175. net/bridge/br_vlan.c +14 −3
  1176. net/caif/chnl_net.c +0 −3
  1177. net/can/af_can.c +2 −1
  1178. net/can/isotp.c +38 −33
  1179. net/can/j1939/main.c +3 −0
  1180. net/core/flow_dissector.c +1 −1
  1181. net/core/lwtunnel.c +3 −1
  1182. net/core/neighbour.c +30 −28
  1183. net/core/skbuff.c +19 −17
  1184. net/core/skmsg.c +2 −5
  1185. net/core/sock_map.c +4 −3
  1186. net/dccp/ipv4.c +5 −18
  1187. net/dccp/ipv6.c +5 −19
  1188. net/dccp/proto.c +1 −2
  1189. net/dsa/dsa2.c +20 −3
  1190. net/dsa/dsa_priv.h +1 −0
  1191. net/dsa/master.c +1 −2
  1192. net/dsa/port.c +16 −0
  1193. net/hsr/hsr_forward.c +3 −2
  1194. net/ipv4/Kconfig +10 −0
  1195. net/ipv4/af_inet.c +3 −10
  1196. net/ipv4/esp4_offload.c +3 −0
  1197. net/ipv4/fib_semantics.c +5 −3
  1198. net/ipv4/fib_trie.c +4 −2
  1199. net/ipv4/inet_hashtables.c +77 −17
  1200. net/ipv4/ip_input.c +5 −0
  1201. net/ipv4/netfilter/ipt_CLUSTERIP.c +2 −2
  1202. net/ipv4/tcp.c +2 −3
  1203. net/ipv4/tcp_bpf.c +7 −5
  1204. net/ipv4/tcp_ipv4.c +5 −16
  1205. net/ipv4/tcp_ulp.c +3 −0
  1206. net/ipv4/udp_bpf.c +2 −2
  1207. net/ipv6/addrlabel.c +1 −0
  1208. net/ipv6/esp6_offload.c +3 −0
  1209. net/ipv6/route.c +10 −4
  1210. net/ipv6/tcp_ipv6.c +4 −16
  1211. net/ipv6/udp.c +1 −0
  1212. net/ipv6/xfrm6_policy.c +5 −1
  1213. net/kcm/kcmsock.c +6 −52
  1214. net/key/af_key.c +23 −11
  1215. net/l2tp/l2tp_core.c +15 −7
  1216. net/mac80211/airtime.c +3 −0
  1217. net/mac80211/main.c +6 −2
  1218. net/mac80211/mesh_pathtbl.c +1 −1
  1219. net/mac80211/s1g.c +3 −0
  1220. net/mac80211/tx.c +5 −0
  1221. net/mctp/af_mctp.c +3 −1
  1222. net/mctp/route.c +1 −1
  1223. net/mptcp/protocol.c +6 −7
  1224. net/mptcp/subflow.c +3 −3
  1225. net/netfilter/ipset/ip_set_hash_gen.h +6 −24
  1226. net/netfilter/ipset/ip_set_hash_ip.c +3 −5
  1227. net/netfilter/ipvs/ip_vs_app.c +8 −2
  1228. net/netfilter/ipvs/ip_vs_conn.c +23 −7
  1229. net/netfilter/nf_conntrack_core.c +1 −1
  1230. net/netfilter/nf_conntrack_netlink.c +14 −10
  1231. net/netfilter/nf_conntrack_standalone.c +1 −1
  1232. net/netfilter/nf_flow_table_offload.c +4 −0
  1233. net/netfilter/nf_nat_core.c +10 −1
  1234. net/netfilter/nf_tables_api.c +11 −6
  1235. net/netfilter/nfnetlink.c +1 −0
  1236. net/netfilter/nft_ct.c +3 −3
  1237. net/netfilter/nft_payload.c +3 −3
  1238. net/netfilter/xt_connmark.c +10 −8
  1239. net/nfc/nci/core.c +1 −1
  1240. net/nfc/nci/data.c +3 −1
  1241. net/openvswitch/conntrack.c +4 −4
  1242. net/openvswitch/datapath.c +1 −0
  1243. net/packet/af_packet.c +2 −4
  1244. net/rose/rose_link.c +3 −0
  1245. net/rxrpc/ar-internal.h +1 −0
  1246. net/rxrpc/conn_client.c +23 −15
  1247. net/sched/Kconfig +1 −1
  1248. net/sched/act_connmark.c +2 −2
  1249. net/sched/act_ct.c +4 −4
  1250. net/sched/act_ctinfo.c +3 −3
  1251. net/sched/sch_red.c +3 −1
  1252. net/sctp/outqueue.c +8 −5
  1253. net/sctp/stream.c +18 −7
  1254. net/sctp/stream_sched.c +5 −0
  1255. net/sctp/stream_sched_prio.c +19 −0
  1256. net/sctp/stream_sched_rr.c +5 −0
  1257. net/smc/af_smc.c +4 −2
  1258. net/sunrpc/auth_gss/auth_gss.c +1 −1
  1259. net/sunrpc/sysfs.c +10 −2
  1260. net/tipc/crypto.c +3 −0
  1261. net/tipc/discover.c +4 −1
  1262. net/tipc/netlink_compat.c +1 −1
  1263. net/tipc/topsrv.c +11 −9
  1264. net/tls/tls_device_fallback.c +3 −2
  1265. net/unix/unix_bpf.c +4 −4
  1266. net/vmw_vsock/af_vsock.c +4 −3
  1267. net/wireless/reg.c +9 −3
  1268. net/wireless/scan.c +11 −3
  1269. net/wireless/util.c +4 −2
  1270. net/x25/x25_dev.c +1 −1
  1271. net/xfrm/xfrm_device.c +14 −1
  1272. net/xfrm/xfrm_replay.c +1 −1
  1273. scripts/Makefile.modpost +1 −1
  1274. scripts/Makefile.package +2 −2
  1275. scripts/faddr2line +4 −3
  1276. scripts/kconfig/menu.c +4 −19
  1277. scripts/min-tool-version.sh +1 −1
  1278. scripts/package/mkdebian +1 −1
  1279. security/commoncap.c +4 −2
  1280. sound/arm/pxa2xx-ac97-lib.c +3 −1
  1281. sound/core/memalloc.c +8 −7
  1282. sound/core/seq/seq_memory.c +7 −4
  1283. sound/firewire/dice/dice-stream.c +7 −5
  1284. sound/hda/hdac_sysfs.c +3 −1
  1285. sound/hda/intel-dsp-config.c +5 −0
  1286. sound/pci/hda/hda_intel.c +7 −4
  1287. sound/pci/hda/patch_ca0132.c +1 −0
  1288. sound/pci/hda/patch_realtek.c +4 −0
  1289. sound/soc/amd/yc/acp6x-mach.c +7 −0
  1290. sound/soc/codecs/cs42l51.c +1 −1
  1291. sound/soc/codecs/hdac_hda.h +2 −2
  1292. sound/soc/codecs/max98373-i2c.c +4 −0
  1293. sound/soc/codecs/rt5514-spi.c +8 −7
  1294. sound/soc/codecs/rt5677-spi.c +10 −9
  1295. sound/soc/codecs/rt711-sdca-sdw.c +1 −1
  1296. sound/soc/codecs/sgtl5000.c +1 −0
  1297. sound/soc/codecs/tas2764.c +6 −13
  1298. sound/soc/codecs/tas2770.c +6 −14
  1299. sound/soc/codecs/tas2780.c +6 −13
  1300. sound/soc/codecs/tlv320adc3xxx.c +3 −0
  1301. sound/soc/codecs/wm8962.c +8 −0
  1302. sound/soc/fsl/fsl_asrc.c +1 −1
  1303. sound/soc/fsl/fsl_esai.c +1 −1
  1304. sound/soc/fsl/fsl_micfil.c +19 −0
  1305. sound/soc/fsl/fsl_sai.c +1 −1
  1306. sound/soc/intel/boards/bytcht_es8316.c +7 −0
  1307. sound/soc/intel/boards/sof_es8336.c +46 −14
  1308. sound/soc/intel/common/soc-acpi-intel-icl-match.c +13 −0
  1309. sound/soc/soc-core.c +15 −2
  1310. sound/soc/soc-dapm.c +1 −1
  1311. sound/soc/soc-ops.c +8 −3
  1312. sound/soc/soc-pcm.c +2 −5
  1313. sound/soc/soc-utils.c +1 −1
  1314. sound/soc/sof/ipc3-topology.c +10 −5
  1315. sound/soc/sof/topology.c +10 −10
  1316. sound/soc/stm/stm32_adfsdm.c +11 −0
  1317. sound/soc/stm/stm32_i2s.c +1 −1
  1318. sound/usb/card.c +20 −9
  1319. sound/usb/endpoint.c +2 −1
  1320. sound/usb/midi.c +1 −3
  1321. sound/usb/quirks-table.h +4 −0
  1322. sound/usb/quirks.c +6 −41
  1323. sound/usb/usbaudio.h +3 −0
  1324. tools/arch/x86/include/asm/msr-index.h +5 −3
  1325. tools/bpf/bpftool/common.c +3 −0
  1326. tools/iio/iio_generic_buffer.c +2 −2
  1327. tools/include/nolibc/string.h +10 −7
  1328. tools/include/uapi/linux/in.h +1 −0
  1329. tools/include/uapi/linux/stddef.h +47 −0
  1330. tools/kvm/kvm_stat/kvm_stat +83 −15
  1331. tools/lib/bpf/libbpf.c +1 −1
  1332. tools/lib/bpf/libbpf_probes.c +1 −1
  1333. tools/lib/bpf/ringbuf.c +20 −6
  1334. tools/perf/.gitignore +1 −0
  1335. tools/perf/tests/shell/test_brstack.sh +4 −1
  1336. tools/perf/util/parse-branch-options.c +3 −1
  1337. tools/perf/util/stat-display.c +4 −2
  1338. tools/testing/cxl/test/cxl.c +280 −21
  1339. tools/testing/radix-tree/.gitignore +1 −0
  1340. tools/testing/radix-tree/Makefile +16 −3
  1341. tools/testing/radix-tree/generated/autoconf.h +1 −1
  1342. tools/testing/radix-tree/linux.c +4 −0
  1343. tools/testing/radix-tree/maple.c +35770 −0
  1344. tools/testing/selftests/bpf/map_tests/sk_storage_map.c +20 −16
  1345. tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c +4 −4
  1346. tools/testing/selftests/bpf/prog_tests/varlen.c +7 −0
  1347. tools/testing/selftests/bpf/progs/test_varlen.c +5 −0
  1348. tools/testing/selftests/bpf/test_progs.c +1 −1
  1349. tools/testing/selftests/bpf/test_verifier.c +1 −1
  1350. tools/testing/selftests/bpf/verifier/ref_tracking.c +36 −0
  1351. tools/testing/selftests/kvm/.gitignore +1 −0
  1352. tools/testing/selftests/kvm/Makefile +1 −0
  1353. tools/testing/selftests/kvm/include/x86_64/processor.h +13 −0
  1354. tools/testing/selftests/kvm/lib/x86_64/processor.c +0 −13
  1355. tools/testing/selftests/kvm/x86_64/svm_nested_shutdown_test.c +67 −0
  1356. tools/testing/selftests/kvm/x86_64/triple_fault_event_test.c +56 −17
  1357. tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c +141 −1
  1358. tools/testing/selftests/landlock/Makefile +4 −3
  1359. tools/testing/selftests/net/fcnal-test.sh +7 −4
  1360. tools/testing/selftests/net/fib_nexthops.sh +11 −0
  1361. tools/testing/selftests/net/io_uring_zerocopy_tx.sh +1 −1
  1362. tools/testing/selftests/net/mptcp/mptcp_join.sh +3 −3
  1363. tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +5 −4
  1364. tools/testing/selftests/net/mptcp/simult_flows.sh +3 −2
  1365. tools/testing/selftests/net/pmtu.sh +6 −4
  1366. tools/testing/selftests/net/udpgro.sh +7 −5
  1367. tools/testing/selftests/net/udpgro_bench.sh +6 −4
  1368. tools/testing/selftests/net/udpgro_frglist.sh +6 −4
  1369. tools/testing/selftests/net/udpgro_fwd.sh +2 −1
  1370. tools/testing/selftests/net/veth.sh +6 −5
  1371. tools/testing/selftests/netfilter/rpath.sh +8 −6
  1372. tools/testing/selftests/pidfd/Makefile +1 −1
  1373. tools/testing/selftests/pidfd/pidfd_test.c +3 −1
  1374. tools/testing/selftests/pidfd/pidfd_wait.c +11 −1
  1375. tools/vm/slabinfo-gnuplot.sh +2 −2
  1376. virt/kvm/kvm_main.c +51 −17
  1377. virt/kvm/pfncache.c +52 −17
.mailmap+4−0
@@ -29,6 +29,7 @@ Alexandre Belloni <alexandre.belloni@bootlin.com> <alexandre.belloni@free-electr · 28 unmodified lines
2929 Alexei Starovoitov <ast@kernel.org> <alexei.starovoitov@gmail.com>
3030 Alexei Starovoitov <ast@kernel.org> <ast@fb.com>
3131 Alexei Starovoitov <ast@kernel.org> <ast@plumgrid.com>
32+Alex Hung <alexhung@gmail.com> <alex.hung@canonical.com>
3233 Alex Shi <alexs@kernel.org> <alex.shi@intel.com>
3334 Alex Shi <alexs@kernel.org> <alex.shi@linaro.org>
3435 Alex Shi <alexs@kernel.org> <alex.shi@linux.alibaba.com>
@@ -382,6 +383,7 @@ Santosh Shilimkar <santosh.shilimkar@oracle.org> · 347 unmodified lines
382383 Santosh Shilimkar <ssantosh@kernel.org>
383384 Sarangdhar Joshi <spjoshi@codeaurora.org>
384385 Sascha Hauer <s.hauer@pengutronix.de>
386+Satya Priya <quic_c_skakit@quicinc.com> <skakit@codeaurora.org>
385387 S.Çağlar Onur <caglar@pardus.org.tr>
386388 Sean Christopherson <seanjc@google.com> <sean.j.christopherson@intel.com>
387389 Sean Nyekjaer <sean@geanix.com> <sean.nyekjaer@prevas.dk>
@@ -389,6 +391,7 @@ Sebastian Reichel <sre@kernel.org> <sebastian.reichel@collabora.co.uk> · 1 unmodified line
389391 Sebastian Reichel <sre@kernel.org> <sre@debian.org>
390392 Sedat Dilek <sedat.dilek@gmail.com> <sedat.dilek@credativ.de>
391393 Seth Forshee <sforshee@kernel.org> <seth.forshee@canonical.com>
394+Shannon Nelson <shannon.nelson@amd.com> <snelson@pensando.io>
392395 Shiraz Hashim <shiraz.linux.kernel@gmail.com> <shiraz.hashim@st.com>
393396 Shuah Khan <shuah@kernel.org> <shuahkhan@gmail.com>
394397 Shuah Khan <shuah@kernel.org> <shuah.khan@hp.com>
@@ -416,6 +419,7 @@ TripleX Chung <xxx.phy@gmail.com> <triplex@zh-kernel.org> · 21 unmodified lines
416419 TripleX Chung <xxx.phy@gmail.com> <zhongyu@18mail.cn>
417420 Tsuneo Yoshioka <Tsuneo.Yoshioka@f-secure.com>
418421 Tycho Andersen <tycho@tycho.pizza> <tycho@tycho.ws>
422+Tzung-Bi Shih <tzungbi@kernel.org> <tzungbi@google.com>
419423 Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
420424 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
421425 Uwe Kleine-König <ukleinek@strlen.de>
CREDITS+9−0
@@ -918,6 +918,11 @@ S: Ottawa, Ontario · 917 unmodified lines
918918 S: K1N 6Z9
919919 S: CANADA
920920
921+N: Vivien Didelot
922+E: vivien.didelot@gmail.com
923+D: DSA framework and MV88E6XXX driver
924+S: Montreal, Quebec, Canada
925+
921926 N: Jeff Dike
922927 E: jdike@karaya.com
923928 W: http://user-mode-linux.sourceforge.net
@@ -2447,6 +2452,10 @@ S: 482 Shadowgraph Dr. · 1523 unmodified lines
24472452 S: San Jose, CA 95110
24482453 S: USA
24492454
2455+N: Michal Marek
2456+E: michal.lkml@markovi.net
2457+D: Kbuild Maintainer 2009-2017
2458+
24502459 N: Martin Mares
24512460 E: mj@ucw.cz
24522461 W: http://www.ucw.cz/~mj/
Documentation/admin-guide/kernel-parameters.txt+11−0
@@ -6959,3 +6959,14 @@ · 6958 unmodified lines
69596959 memory, and other data can't be written using
69606960 xmon commands.
69616961 off xmon is disabled.
6962+
6963+ amd_pstate= [X86]
6964+ disable
6965+ Do not enable amd_pstate as the default
6966+ scaling driver for the supported processors
6967+ passive
6968+ Use amd_pstate as a scaling driver, driver requests a
6969+ desired performance on this abstract scale and the power
6970+ management firmware translates the requests into actual
6971+ hardware states (core frequency, data fabric and memory
6972+ clocks etc.)
Documentation/admin-guide/pm/amd-pstate.rst+13−17
@@ -283,23 +283,19 @@ efficiency frequency management method on AMD processors. · 282 unmodified lines
283283 Kernel Module Options for ``amd-pstate``
284284 =========================================
285285
286−.. _shared_mem:
287−
288−``shared_mem``
289−Use a module param (shared_mem) to enable related processors manually with
290−**amd_pstate.shared_mem=1**.
291−Due to the performance issue on the processors with `Shared Memory Support
292−<perf_cap_>`_, we disable it presently and will re-enable this by default
293−once we address performance issue with this solution.
294−
295−To check whether the current processor is using `Full MSR Support <perf_cap_>`_
296−or `Shared Memory Support <perf_cap_>`_ : ::
297−
298− ray@hr-test1:~$ lscpu | grep cppc
299− Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm
300−
301−If the CPU flags have ``cppc``, then this processor supports `Full MSR Support
302−<perf_cap_>`_. Otherwise, it supports `Shared Memory Support <perf_cap_>`_.
286+Passive Mode
287+------------
288+
289+``amd_pstate=passive``
290+
291+It will be enabled if the ``amd_pstate=passive`` is passed to the kernel in the command line.
292+In this mode, ``amd_pstate`` driver software specifies a desired QoS target in the CPPC
293+performance scale as a relative number. This can be expressed as percentage of nominal
294+performance (infrastructure max). Below the nominal sustained performance level,
295+desired performance expresses the average performance level of the processor subject
296+to the Performance Reduction Tolerance register. Above the nominal performance level,
297+processor must provide at least nominal performance requested and go higher if current
298+operating conditions allow.
303299
304300
305301 ``cpupower`` tool support for ``amd-pstate``
Documentation/arm64/booting.rst+8−0
@@ -340,6 +340,14 @@ Before jumping into the kernel, the following conditions must be met: · 339 unmodified lines
340340 - SMCR_EL2.LEN must be initialised to the same value for all CPUs the
341341 kernel will execute on.
342342
343+ - HWFGRTR_EL2.nTPIDR2_EL0 (bit 55) must be initialised to 0b01.
344+
345+ - HWFGWTR_EL2.nTPIDR2_EL0 (bit 55) must be initialised to 0b01.
346+
347+ - HWFGRTR_EL2.nSMPRI_EL1 (bit 54) must be initialised to 0b01.
348+
349+ - HWFGWTR_EL2.nSMPRI_EL1 (bit 54) must be initialised to 0b01.
350+
343351 For CPUs with the Scalable Matrix Extension FA64 feature (FEAT_SME_FA64)
344352
345353 - If EL3 is present:
Documentation/arm64/cpu-feature-registers.rst+37−1
@@ -92,7 +92,7 @@ operation if the source belongs to the supported system register space. · 91 unmodified lines
9292
9393 The infrastructure emulates only the following system register space::
9494
95− Op0=3, Op1=0, CRn=0, CRm=0,4,5,6,7
95+ Op0=3, Op1=0, CRn=0, CRm=0,2,3,4,5,6,7
9696
9797 (See Table C5-6 'System instruction encodings for non-Debug System
9898 register accesses' in ARMv8 ARM DDI 0487A.h, for the list of
@@ -293,6 +293,42 @@ infrastructure: · 194 unmodified lines
293293 | WFXT | [3-0] | y |
294294 +------------------------------+---------+---------+
295295
296+ 10) MVFR0_EL1 - AArch32 Media and VFP Feature Register 0
297+
298+ +------------------------------+---------+---------+
299+ | Name | bits | visible |
300+ +------------------------------+---------+---------+
301+ | FPDP | [11-8] | y |
302+ +------------------------------+---------+---------+
303+
304+ 11) MVFR1_EL1 - AArch32 Media and VFP Feature Register 1
305+
306+ +------------------------------+---------+---------+
307+ | Name | bits | visible |
308+ +------------------------------+---------+---------+
309+ | SIMDFMAC | [31-28] | y |
310+ +------------------------------+---------+---------+
311+ | SIMDSP | [19-16] | y |
312+ +------------------------------+---------+---------+
313+ | SIMDInt | [15-12] | y |
314+ +------------------------------+---------+---------+
315+ | SIMDLS | [11-8] | y |
316+ +------------------------------+---------+---------+
317+
318+ 12) ID_ISAR5_EL1 - AArch32 Instruction Set Attribute Register 5
319+
320+ +------------------------------+---------+---------+
321+ | Name | bits | visible |
322+ +------------------------------+---------+---------+
323+ | CRC32 | [19-16] | y |
324+ +------------------------------+---------+---------+
325+ | SHA2 | [15-12] | y |
326+ +------------------------------+---------+---------+
327+ | SHA1 | [11-8] | y |
328+ +------------------------------+---------+---------+
329+ | AES | [7-4] | y |
330+ +------------------------------+---------+---------+
331+
296332
297333 Appendix I: Example
298334 -------------------
Documentation/dev-tools/kmsan.rst+1−0
@@ -67,6 +67,7 @@ uninitialized in the local variable, as well as the stack where the value was · 66 unmodified lines
6767 copied to another memory location before use.
6868
6969 A use of uninitialized value ``v`` is reported by KMSAN in the following cases:
70+
7071 - in a condition, e.g. ``if (v) { ... }``;
7172 - in an indexing or pointer dereferencing, e.g. ``array[v]`` or ``*v``;
7273 - when it is copied to userspace or hardware, e.g. ``copy_to_user(..., &v, ...)``;
Documentation/devicetree/bindings/clock/samsung,exynosautov9-clock.yaml+1−1
@@ -148,7 +148,7 @@ allOf: · 147 unmodified lines
148148 items:
149149 - const: oscclk
150150 - const: dout_clkcmu_fsys1_bus
151− - const: dout_clkcmu_fsys1_mmc_card
151+ - const: gout_clkcmu_fsys1_mmc_card
152152 - const: dout_clkcmu_fsys1_usbdrd
153153
154154 - if:
Documentation/devicetree/bindings/hwlock/qcom-hwspinlock.yaml+21−8
@@ -15,9 +15,22 @@ description: · 14 unmodified lines
1515
1616 properties:
1717 compatible:
18− enum:
19− - qcom,sfpb-mutex
20− - qcom,tcsr-mutex
18+ oneOf:
19+ - enum:
20+ - qcom,sfpb-mutex
21+ - qcom,tcsr-mutex
22+ - items:
23+ - enum:
24+ - qcom,apq8084-tcsr-mutex
25+ - qcom,ipq6018-tcsr-mutex
26+ - qcom,msm8226-tcsr-mutex
27+ - qcom,msm8994-tcsr-mutex
28+ - const: qcom,tcsr-mutex
29+ - items:
30+ - enum:
31+ - qcom,msm8974-tcsr-mutex
32+ - const: qcom,tcsr-mutex
33+ - const: syscon
2134
2235 reg:
2336 maxItems: 1
@@ -34,9 +47,9 @@ additionalProperties: false · 10 unmodified lines
3447
3548 examples:
3649 - |
37− tcsr_mutex: hwlock@1f40000 {
38− compatible = "qcom,tcsr-mutex";
39− reg = <0x01f40000 0x40000>;
40− #hwlock-cells = <1>;
41− };
50+ hwlock@1f40000 {
51+ compatible = "qcom,tcsr-mutex";
52+ reg = <0x01f40000 0x40000>;
53+ #hwlock-cells = <1>;
54+ };
4255 ...
Documentation/devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml+0−7
@@ -62,13 +62,6 @@ properties: · 61 unmodified lines
6262 description:
6363 Inform the driver that last channel will be used to sensor battery.
6464
65− aspeed,trim-data-valid:
66− type: boolean
67− description: |
68− The ADC reference voltage can be calibrated to obtain the trimming
69− data which will be stored in otp. This property informs the driver that
70− the data store in the otp is valid.
71−
7265 required:
7366 - compatible
7467 - reg
Documentation/devicetree/bindings/input/goodix,gt7375p.yaml+4−1
@@ -16,8 +16,11 @@ description: · 15 unmodified lines
1616
1717 properties:
1818 compatible:
19− items:
19+ oneOf:
2020 - const: goodix,gt7375p
21+ - items:
22+ - const: goodix,gt7986u
23+ - const: goodix,gt7375p
2124
2225 reg:
2326 enum:
Documentation/devicetree/bindings/interconnect/qcom,msm8998-bwmon.yaml+1−1
@@ -24,7 +24,7 @@ properties: · 23 unmodified lines
2424 oneOf:
2525 - items:
2626 - enum:
27− - qcom,sc7280-bwmon
27+ - qcom,sc7280-cpu-bwmon
2828 - qcom,sdm845-bwmon
2929 - const: qcom,msm8998-bwmon
3030 - const: qcom,msm8998-bwmon # BWMON v4
Documentation/devicetree/bindings/media/allwinner,sun50i-h6-vpu-g2.yaml+5−0
@@ -36,6 +36,9 @@ properties: · 35 unmodified lines
3636 resets:
3737 maxItems: 1
3838
39+ iommus:
40+ maxItems: 1
41+
3942 required:
4043 - compatible
4144 - reg
@@ -43,6 +46,7 @@ required: · 1 unmodified line
4346 - clocks
4447 - clock-names
4548 - resets
49+ - iommus
4650
4751 additionalProperties: false
4852
@@ -59,6 +63,7 @@ examples: · 10 unmodified lines
5963 clocks = <&ccu CLK_BUS_VP9>, <&ccu CLK_VP9>;
6064 clock-names = "bus", "mod";
6165 resets = <&ccu RST_BUS_VP9>;
66+ iommus = <&iommu 5>;
6267 };
6368
6469 ...
Documentation/devicetree/bindings/net/engleder,tsnep.yaml+1−1
@@ -47,7 +47,7 @@ properties: · 46 unmodified lines
4747
4848 nvmem-cells: true
4949
50− nvmem-cells-names: true
50+ nvmem-cell-names: true
5151
5252 phy-connection-type:
5353 enum:
Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml+3−0
@@ -81,6 +81,9 @@ properties: · 80 unmodified lines
8181
8282 power-supply: true
8383
84+ power-domains:
85+ maxItems: 1
86+
8487 resets:
8588 description: |
8689 A number of phandles to resets that need to be asserted during
Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml+1−1
@@ -8,7 +8,7 @@ title: Audio codec controlled by ChromeOS EC · 7 unmodified lines
88
99 maintainers:
1010 - Cheng-Yi Chiang <cychiang@chromium.org>
11− - Tzung-Bi Shih <tzungbi@google.com>
11+ - Tzung-Bi Shih <tzungbi@kernel.org>
1212
1313 description: |
1414 Google's ChromeOS EC codec is a digital mic codec provided by the
Documentation/devicetree/bindings/sound/realtek,rt1015p.yaml+1−1
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines
77 title: Realtek rt1015p codec devicetree bindings
88
99 maintainers:
10− - Tzung-Bi Shih <tzungbi@google.com>
10+ - Tzung-Bi Shih <tzungbi@kernel.org>
1111
1212 description: |
1313 Rt1015p is a rt1015 variant which does not support I2C and
Documentation/driver-api/driver-model/devres.rst+1−0
@@ -279,6 +279,7 @@ GPIO · 278 unmodified lines
279279 devm_gpio_request_one()
280280
281281 I2C
282+ devm_i2c_add_adapter()
282283 devm_i2c_new_dummy_device()
283284
284285 IIO
Documentation/driver-api/miscellaneous.rst+2−3
@@ -16,12 +16,11 @@ Parallel Port Devices · 15 unmodified lines
1616 16x50 UART Driver
1717 =================
1818
19−.. kernel-doc:: drivers/tty/serial/serial_core.c
20− :export:
21−
2219 .. kernel-doc:: drivers/tty/serial/8250/8250_core.c
2320 :export:
2421
22+See serial/driver.rst for related APIs.
23+
2524 Pulse-Width Modulation (PWM)
2625 ============================
2726
Documentation/kbuild/reproducible-builds.rst+10−0
@@ -119,6 +119,16 @@ To avoid this, you can make the vDSO different for different · 118 unmodified lines
119119 kernel versions by including an arbitrary string of "salt" in it.
120120 This is specified by the Kconfig symbol ``CONFIG_BUILD_SALT``.
121121
122+Git
123+---
124+
125+Uncommitted changes or different commit ids in git can also lead
126+to different compilation results. For example, after executing
127+``git reset HEAD^``, even if the code is the same, the
128+``include/config/kernel.release`` generated during compilation
129+will be different, which will eventually lead to binary differences.
130+See ``scripts/setlocalversion`` for details.
131+
122132 .. _KBUILD_BUILD_TIMESTAMP: kbuild.html#kbuild-build-timestamp
123133 .. _KBUILD_BUILD_USER and KBUILD_BUILD_HOST: kbuild.html#kbuild-build-user-kbuild-build-host
124134 .. _KCFLAGS: kbuild.html#kcflags
Documentation/kernel-hacking/hacking.rst+1−1
@@ -120,7 +120,7 @@ You can tell you are in a softirq (or tasklet) using the · 119 unmodified lines
120120 .. warning::
121121
122122 Beware that this will return a false positive if a
123− :ref:`botton half lock <local_bh_disable>` is held.
123+ :ref:`bottom half lock <local_bh_disable>` is held.
124124
125125 Some Basic Rules
126126 ================
Documentation/networking/generic_netlink.rst+1−1
@@ -6,4 +6,4 @@ Generic Netlink · 5 unmodified lines
66
77 A wiki document on how to use Generic Netlink can be found here:
88
9− * http://www.linuxfoundation.org/collaborate/workgroups/networking/generic_netlink_howto
9+ * https://wiki.linuxfoundation.org/networking/generic_netlink_howto
Documentation/process/2.Process.rst+4−11
@@ -126,17 +126,10 @@ than one development cycle past their initial release. So, for example, the · 125 unmodified lines
126126 5.2.21 was the final stable update of the 5.2 release.
127127
128128 Some kernels are designated "long term" kernels; they will receive support
129−for a longer period. As of this writing, the current long term kernels
130−and their maintainers are:
131−
132− ====== ================================ =======================
133− 3.16 Ben Hutchings (very long-term kernel)
134− 4.4 Greg Kroah-Hartman & Sasha Levin (very long-term kernel)
135− 4.9 Greg Kroah-Hartman & Sasha Levin
136− 4.14 Greg Kroah-Hartman & Sasha Levin
137− 4.19 Greg Kroah-Hartman & Sasha Levin
138− 5.4 Greg Kroah-Hartman & Sasha Levin
139− ====== ================================ =======================
129+for a longer period. Please refer to the following link for the list of active
130+long term kernel versions and their maintainers:
131+
132+ https://www.kernel.org/category/releases.html
140133
141134 The selection of a kernel for long-term support is purely a matter of a
142135 maintainer having the need and the time to maintain that release. There
Documentation/process/code-of-conduct-interpretation.rst+1−1
@@ -51,7 +51,7 @@ the Technical Advisory Board (TAB) or other maintainers if you're · 50 unmodified lines
5151 uncertain how to handle situations that come up. It will not be
5252 considered a violation report unless you want it to be. If you are
5353 uncertain about approaching the TAB or any other maintainers, please
54−reach out to our conflict mediator, Joanna Lee <joanna.lee@gesmer.com>.
54+reach out to our conflict mediator, Joanna Lee <jlee@linuxfoundation.org>.
5555
5656 In the end, "be kind to each other" is really what the end goal is for
5757 everybody. We know everyone is human and we all fail at times, but the
Documentation/process/howto.rst+1−1
@@ -36,7 +36,7 @@ experience, the following books are good for, if anything, reference: · 35 unmodified lines
3636 - "C: A Reference Manual" by Harbison and Steele [Prentice Hall]
3737
3838 The kernel is written using GNU C and the GNU toolchain. While it
39−adheres to the ISO C89 standard, it uses a number of extensions that are
39+adheres to the ISO C11 standard, it uses a number of extensions that are
4040 not featured in the standard. The kernel is a freestanding C
4141 environment, with no reliance on the standard C library, so some
4242 portions of the C standard are not supported. Arbitrary long long
Documentation/trace/histogram.rst+1−1
@@ -39,7 +39,7 @@ Documentation written by Tom Zanussi · 38 unmodified lines
3939 will use the event's kernel stacktrace as the key. The keywords
4040 'keys' or 'key' can be used to specify keys, and the keywords
4141 'values', 'vals', or 'val' can be used to specify values. Compound
42− keys consisting of up to two fields can be specified by the 'keys'
42+ keys consisting of up to three fields can be specified by the 'keys'
4343 keyword. Hashing a compound key produces a unique entry in the
4444 table for each unique combination of component keys, and can be
4545 useful for providing more fine-grained summaries of event data.
Documentation/translations/it_IT/process/howto.rst+1−1
@@ -44,7 +44,7 @@ altro, utili riferimenti: · 43 unmodified lines
4444 - "C: A Reference Manual" di Harbison and Steele [Prentice Hall]
4545
4646 Il kernel è stato scritto usando GNU C e la toolchain GNU.
47−Sebbene si attenga allo standard ISO C89, esso utilizza una serie di
47+Sebbene si attenga allo standard ISO C11, esso utilizza una serie di
4848 estensioni che non sono previste in questo standard. Il kernel è un
4949 ambiente C indipendente, che non ha alcuna dipendenza dalle librerie
5050 C standard, così alcune parti del C standard non sono supportate.
Documentation/translations/ja_JP/howto.rst+1−1
@@ -65,7 +65,7 @@ Linux カーネル開発のやり方 · 64 unmodified lines
6565 - 『新・詳説 C 言語 H&S リファレンス』 (サミュエル P ハービソン/ガイ L スティール共著 斉藤 信男監訳)[ソフトバンク]
6666
6767 カーネルは GNU C と GNU ツールチェインを使って書かれています。カーネル
68−は ISO C89 仕様に準拠して書く一方で、標準には無い言語拡張を多く使って
68+は ISO C11 仕様に準拠して書く一方で、標準には無い言語拡張を多く使って
6969 います。カーネルは標準 C ライブラリに依存しない、C 言語非依存環境です。
7070 そのため、C の標準の中で使えないものもあります。特に任意の long long
7171 の除算や浮動小数点は使えません。カーネルがツールチェインや C 言語拡張
Documentation/translations/ko_KR/howto.rst+1−1
@@ -62,7 +62,7 @@ Documentation/process/howto.rst · 61 unmodified lines
6262 - "Practical C Programming" by Steve Oualline [O'Reilly]
6363 - "C: A Reference Manual" by Harbison and Steele [Prentice Hall]
6464
65−커널은 GNU C와 GNU 툴체인을 사용하여 작성되었다. 이 툴들은 ISO C89 표준을
65+커널은 GNU C와 GNU 툴체인을 사용하여 작성되었다. 이 툴들은 ISO C11 표준을
6666 따르는 반면 표준에 있지 않은 많은 확장기능도 가지고 있다. 커널은 표준 C
6767 라이브러리와는 관계없이 freestanding C 환경이어서 C 표준의 일부는
6868 지원되지 않는다. 임의의 long long 나누기나 floating point는 지원되지 않는다.
Documentation/translations/zh_CN/loongarch/introduction.rst+2−2
@@ -70,8 +70,8 @@ LA64中每个寄存器为64位宽。 ``$r0`` 的内容总是固定为0,而其 · 69 unmodified lines
7070 ================= ================== =================== ==========
7171
7272 .. note::
73− 注意:在一些遗留代码中有时可能见到 ``$v0`` 和 ``$v1`` ,它们是
74− ``$a0`` 和 ``$a1`` 的别名,属于已经废弃的用法。
73+ 注意:在一些遗留代码中有时可能见到 ``$fv0`` 和 ``$fv1`` ,它们是
74+ ``$fa0`` 和 ``$fa1`` 的别名,属于已经废弃的用法。
7575
7676
7777 向量寄存器
Documentation/translations/zh_CN/process/howto.rst+1−1
@@ -45,7 +45,7 @@ Linux内核大部分是由C语言写成的,一些体系结构相关的代码 · 44 unmodified lines
4545 - "C: A Reference Manual" by Harbison and Steele [Prentice Hall]
4646 《C语言参考手册(原书第5版)》(邱仲潘 等译)[机械工业出版社]
4747
48−Linux内核使用GNU C和GNU工具链开发。虽然它遵循ISO C89标准,但也用到了一些
48+Linux内核使用GNU C和GNU工具链开发。虽然它遵循ISO C11标准,但也用到了一些
4949 标准中没有定义的扩展。内核是自给自足的C环境,不依赖于标准C库的支持,所以
5050 并不支持C标准中的部分定义。比如long long类型的大数除法和浮点运算就不允许
5151 使用。有时候确实很难弄清楚内核对工具链的要求和它所使用的扩展,不幸的是目
Documentation/translations/zh_TW/process/howto.rst+1−1
@@ -48,7 +48,7 @@ Linux內核大部分是由C語言寫成的,一些體系結構相關的代碼 · 47 unmodified lines
4848 - "C: A Reference Manual" by Harbison and Steele [Prentice Hall]
4949 《C語言參考手冊(原書第5版)》(邱仲潘 等譯)[機械工業出版社]
5050
51−Linux內核使用GNU C和GNU工具鏈開發。雖然它遵循ISO C89標準,但也用到了一些
51+Linux內核使用GNU C和GNU工具鏈開發。雖然它遵循ISO C11標準,但也用到了一些
5252 標準中沒有定義的擴展。內核是自給自足的C環境,不依賴於標準C庫的支持,所以
5353 並不支持C標準中的部分定義。比如long long類型的大數除法和浮點運算就不允許
5454 使用。有時候確實很難弄清楚內核對工具鏈的要求和它所使用的擴展,不幸的是目
Documentation/virt/kvm/devices/vm.rst+3−0
@@ -215,6 +215,7 @@ KVM_S390_VM_TOD_EXT). · 214 unmodified lines
215215 :Parameters: address of a buffer in user space to store the data (u8) to
216216 :Returns: -EFAULT if the given address is not accessible from kernel space;
217217 -EINVAL if setting the TOD clock extension to != 0 is not supported
218+ -EOPNOTSUPP for a PV guest (TOD managed by the ultravisor)
218219
219220 3.2. ATTRIBUTE: KVM_S390_VM_TOD_LOW
220221 -----------------------------------
@@ -224,6 +225,7 @@ the POP (u64). · 3 unmodified lines
224225
225226 :Parameters: address of a buffer in user space to store the data (u64) to
226227 :Returns: -EFAULT if the given address is not accessible from kernel space
228+ -EOPNOTSUPP for a PV guest (TOD managed by the ultravisor)
227229
228230 3.3. ATTRIBUTE: KVM_S390_VM_TOD_EXT
229231 -----------------------------------
@@ -237,6 +239,7 @@ it, it is stored as 0 and not allowed to be set to a value != 0. · 7 unmodified lines
237239 (kvm_s390_vm_tod_clock) to
238240 :Returns: -EFAULT if the given address is not accessible from kernel space;
239241 -EINVAL if setting the TOD clock extension to != 0 is not supported
242+ -EOPNOTSUPP for a PV guest (TOD managed by the ultravisor)
240243
241244 4. GROUP: KVM_S390_VM_CRYPTO
242245 ============================
MAINTAINERS+72−38
@@ -2197,7 +2197,7 @@ M: Wei Xu <xuwei5@hisilicon.com> · 2196 unmodified lines
21972197 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
21982198 S: Supported
21992199 W: http://www.hisilicon.com
2200−T: git git://github.com/hisilicon/linux-hisi.git
2200+T: git https://github.com/hisilicon/linux-hisi.git
22012201 F: arch/arm/boot/dts/hi3*
22022202 F: arch/arm/boot/dts/hip*
22032203 F: arch/arm/boot/dts/hisi*
@@ -3984,7 +3984,7 @@ M: Rafał Miłecki <rafal@milecki.pl> · 1780 unmodified lines
39843984 R: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
39853985 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
39863986 S: Maintained
3987−T: git git://github.com/broadcom/stblinux.git
3987+T: git https://github.com/broadcom/stblinux.git
39883988 F: Documentation/devicetree/bindings/arm/bcm/brcm,bcmbca.yaml
39893989 F: arch/arm64/boot/dts/broadcom/bcmbca/*
39903990 N: bcmbca
@@ -4009,7 +4009,7 @@ R: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com> · 18 unmodified lines
40094009 L: linux-rpi-kernel@lists.infradead.org (moderated for non-subscribers)
40104010 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
40114011 S: Maintained
4012−T: git git://github.com/broadcom/stblinux.git
4012+T: git https://github.com/broadcom/stblinux.git
40134013 F: Documentation/devicetree/bindings/pci/brcm,stb-pcie.yaml
40144014 F: drivers/pci/controller/pcie-brcmstb.c
40154015 F: drivers/staging/vc04_services
@@ -4023,7 +4023,7 @@ M: Ray Jui <rjui@broadcom.com> · 7 unmodified lines
40234023 M: Scott Branden <sbranden@broadcom.com>
40244024 R: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
40254025 S: Maintained
4026−T: git git://github.com/broadcom/mach-bcm
4026+T: git https://github.com/broadcom/mach-bcm
40274027 F: arch/arm/mach-bcm/
40284028 N: bcm281*
40294029 N: bcm113*
@@ -4088,7 +4088,7 @@ M: Florian Fainelli <f.fainelli@gmail.com> · 58 unmodified lines
40884088 R: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
40894089 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
40904090 S: Maintained
4091−T: git git://github.com/broadcom/stblinux.git
4091+T: git https://github.com/broadcom/stblinux.git
40924092 F: Documentation/devicetree/bindings/pci/brcm,stb-pcie.yaml
40934093 F: arch/arm/boot/dts/bcm7*.dts*
40944094 F: arch/arm/include/asm/hardware/cache-b15-rac.h
@@ -4121,7 +4121,7 @@ M: Florian Fainelli <f.fainelli@gmail.com> · 26 unmodified lines
41214121 R: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
41224122 L: linux-mips@vger.kernel.org
41234123 S: Maintained
4124−T: git git://github.com/broadcom/stblinux.git
4124+T: git https://github.com/broadcom/stblinux.git
41254125 F: arch/mips/bmips/*
41264126 F: arch/mips/boot/dts/brcm/bcm*.dts*
41274127 F: arch/mips/include/asm/mach-bmips/*
@@ -4262,7 +4262,7 @@ M: Scott Branden <sbranden@broadcom.com> · 134 unmodified lines
42624262 R: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
42634263 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
42644264 S: Maintained
4265−T: git git://github.com/broadcom/stblinux.git
4265+T: git https://github.com/broadcom/stblinux.git
42664266 F: arch/arm64/boot/dts/broadcom/northstar2/*
42674267 F: arch/arm64/boot/dts/broadcom/stingray/*
42684268 F: drivers/clk/bcm/clk-ns*
@@ -4332,7 +4332,7 @@ M: Florian Fainelli <f.fainelli@gmail.com> · 63 unmodified lines
43324332 R: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
43334333 L: linux-pm@vger.kernel.org
43344334 S: Maintained
4335−T: git git://github.com/broadcom/stblinux.git
4335+T: git https://github.com/broadcom/stblinux.git
43364336 F: drivers/soc/bcm/bcm63xx/bcm-pmb.c
43374337 F: include/dt-bindings/soc/bcm-pmb.h
43384338
@@ -4809,7 +4809,7 @@ R: Jeff Layton <jlayton@kernel.org> · 470 unmodified lines
48094809 L: ceph-devel@vger.kernel.org
48104810 S: Supported
48114811 W: http://ceph.com/
4812−T: git git://github.com/ceph/ceph-client.git
4812+T: git https://github.com/ceph/ceph-client.git
48134813 F: include/linux/ceph/
48144814 F: include/linux/crush/
48154815 F: net/ceph/
@@ -4821,7 +4821,7 @@ R: Jeff Layton <jlayton@kernel.org> · 5 unmodified lines
48214821 L: ceph-devel@vger.kernel.org
48224822 S: Supported
48234823 W: http://ceph.com/
4824−T: git git://github.com/ceph/ceph-client.git
4824+T: git https://github.com/ceph/ceph-client.git
48254825 F: Documentation/filesystems/ceph.rst
48264826 F: fs/ceph/
48274827
@@ -4911,7 +4911,7 @@ F: drivers/platform/chrome/ · 83 unmodified lines
49114911
49124912 CHROMEOS EC CODEC DRIVER
49134913 M: Cheng-Yi Chiang <cychiang@chromium.org>
4914−M: Tzung-Bi Shih <tzungbi@google.com>
4914+M: Tzung-Bi Shih <tzungbi@kernel.org>
49154915 R: Guenter Roeck <groeck@chromium.org>
49164916 L: chrome-platform@lists.linux.dev
49174917 S: Maintained
@@ -5041,7 +5041,7 @@ F: drivers/scsi/snic/ · 123 unmodified lines
50415041
50425042 CISCO VIC ETHERNET NIC DRIVER
50435043 M: Christian Benvenuti <benve@cisco.com>
5044−M: Govindarajulu Varadarajan <_govind@gmx.com>
5044+M: Satish Kharat <satishkh@cisco.com>
50455045 S: Supported
50465046 F: drivers/net/ethernet/cisco/enic/
50475047
@@ -5585,8 +5585,6 @@ F: drivers/scsi/cxgbi/cxgb3i · 537 unmodified lines
55855585
55865586 CXGB4 CRYPTO DRIVER (chcr)
55875587 M: Ayush Sawal <ayush.sawal@chelsio.com>
5588−M: Vinay Kumar Yadav <vinay.yadav@chelsio.com>
5589−M: Rohit Maheshwari <rohitm@chelsio.com>
55905588 L: linux-crypto@vger.kernel.org
55915589 S: Supported
55925590 W: http://www.chelsio.com
@@ -5594,8 +5592,6 @@ F: drivers/crypto/chelsio · 1 unmodified line
55945592
55955593 CXGB4 INLINE CRYPTO DRIVER
55965594 M: Ayush Sawal <ayush.sawal@chelsio.com>
5597−M: Vinay Kumar Yadav <vinay.yadav@chelsio.com>
5598−M: Rohit Maheshwari <rohitm@chelsio.com>
55995595 L: netdev@vger.kernel.org
56005596 S: Supported
56015597 W: http://www.chelsio.com
@@ -8602,8 +8598,8 @@ F: include/asm-generic/ · 3000 unmodified lines
86028598 F: include/uapi/asm-generic/
86038599
86048600 GENERIC PHY FRAMEWORK
8605−M: Kishon Vijay Abraham I <kishon@ti.com>
86068601 M: Vinod Koul <vkoul@kernel.org>
8602+M: Kishon Vijay Abraham I <kishon@kernel.org>
86078603 L: linux-phy@lists.infradead.org
86088604 S: Supported
86098605 Q: https://patchwork.kernel.org/project/linux-phy/list/
@@ -9217,7 +9213,7 @@ W: https://www.hisilicon.com · 607 unmodified lines
92179213 F: drivers/i2c/busses/i2c-hisi.c
92189214
92199215 HISILICON LPC BUS DRIVER
9220−M: john.garry@huawei.com
9216+M: Jay Fang <f.fangjian@huawei.com>
92219217 S: Maintained
92229218 W: http://www.hisilicon.com
92239219 F: Documentation/devicetree/bindings/arm/hisilicon/low-pin-count.yaml
@@ -9341,7 +9337,7 @@ S: Maintained · 117 unmodified lines
93419337 F: drivers/crypto/hisilicon/trng/trng.c
93429338
93439339 HISILICON V3XX SPI NOR FLASH Controller Driver
9344−M: John Garry <john.garry@huawei.com>
9340+M: Jay Fang <f.fangjian@huawei.com>
93459341 S: Maintained
93469342 W: http://www.hisilicon.com
93479343 F: drivers/spi/spi-hisi-sfc-v3xx.c
@@ -9507,7 +9503,6 @@ F: drivers/media/i2c/hi847.c · 159 unmodified lines
95079503 Hyper-V/Azure CORE AND DRIVERS
95089504 M: "K. Y. Srinivasan" <kys@microsoft.com>
95099505 M: Haiyang Zhang <haiyangz@microsoft.com>
9510−M: Stephen Hemminger <sthemmin@microsoft.com>
95119506 M: Wei Liu <wei.liu@kernel.org>
95129507 M: Dexuan Cui <decui@microsoft.com>
95139508 L: linux-hyperv@vger.kernel.org
@@ -9779,7 +9774,10 @@ S: Supported · 265 unmodified lines
97799774 F: drivers/pci/hotplug/rpaphp*
97809775
97819776 IBM Power SRIOV Virtual NIC Device Driver
9782−M: Dany Madden <drt@linux.ibm.com>
9777+M: Haren Myneni <haren@linux.ibm.com>
9778+M: Rick Lindsley <ricklind@linux.ibm.com>
9779+R: Nick Child <nnac123@linux.ibm.com>
9780+R: Dany Madden <danymadden@us.ibm.com>
97839781 R: Thomas Falcon <tlfalcon@linux.ibm.com>
97849782 L: netdev@vger.kernel.org
97859783 S: Supported
@@ -10286,7 +10284,7 @@ T: git https://github.com/intel/gvt-linux.git · 500 unmodified lines
1028610284 F: drivers/gpu/drm/i915/gvt/
1028710285
1028810286 INTEL HID EVENT DRIVER
10289−M: Alex Hung <alex.hung@canonical.com>
10287+M: Alex Hung <alexhung@gmail.com>
1029010288 L: platform-driver-x86@vger.kernel.org
1029110289 S: Maintained
1029210290 F: drivers/platform/x86/intel/hid.c
@@ -11034,6 +11032,7 @@ KCONFIG · 741 unmodified lines
1103411032 M: Masahiro Yamada <masahiroy@kernel.org>
1103511033 L: linux-kbuild@vger.kernel.org
1103611034 S: Maintained
11035+Q: https://patchwork.kernel.org/project/linux-kbuild/list/
1103711036 T: git git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kconfig
1103811037 F: Documentation/kbuild/kconfig*
1103911038 F: scripts/Kconfig.include
@@ -11091,10 +11090,12 @@ F: fs/autofs/ · 51 unmodified lines
1109111090
1109211091 KERNEL BUILD + files below scripts/ (unless maintained elsewhere)
1109311092 M: Masahiro Yamada <masahiroy@kernel.org>
11094−M: Michal Marek <michal.lkml@markovi.net>
11093+R: Nathan Chancellor <nathan@kernel.org>
1109511094 R: Nick Desaulniers <ndesaulniers@google.com>
11095+R: Nicolas Schier <nicolas@fjasle.eu>
1109611096 L: linux-kbuild@vger.kernel.org
1109711097 S: Maintained
11098+Q: https://patchwork.kernel.org/project/linux-kbuild/list/
1109811099 T: git git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git
1109911100 F: Documentation/kbuild/
1110011101 F: Makefile
@@ -11249,7 +11250,7 @@ L: kvm@vger.kernel.org · 148 unmodified lines
1124911250 L: kvm-riscv@lists.infradead.org
1125011251 L: linux-riscv@lists.infradead.org
1125111252 S: Maintained
11252−T: git git://github.com/kvm-riscv/linux.git
11253+T: git https://github.com/kvm-riscv/linux.git
1125311254 F: arch/riscv/include/asm/kvm*
1125411255 F: arch/riscv/include/uapi/asm/kvm*
1125511256 F: arch/riscv/kvm/
@@ -12224,7 +12225,6 @@ F: arch/mips/boot/dts/img/pistachio* · 968 unmodified lines
1222412225
1222512226 MARVELL 88E6XXX ETHERNET SWITCH FABRIC DRIVER
1222612227 M: Andrew Lunn <andrew@lunn.ch>
12227−M: Vivien Didelot <vivien.didelot@gmail.com>
1222812228 L: netdev@vger.kernel.org
1222912229 S: Maintained
1223012230 F: Documentation/devicetree/bindings/net/dsa/marvell.txt
@@ -13625,6 +13625,12 @@ S: Supported · 1394 unmodified lines
1362513625 F: drivers/misc/atmel-ssc.c
1362613626 F: include/linux/atmel-ssc.h
1362713627
13628+MICROCHIP SOC DRIVERS
13629+M: Conor Dooley <conor@kernel.org>
13630+S: Supported
13631+T: git https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/
13632+F: drivers/soc/microchip/
13633+
1362813634 MICROCHIP USB251XB DRIVER
1362913635 M: Richard Leitner <richard.leitner@skidata.com>
1363013636 L: linux-usb@vger.kernel.org
@@ -14331,7 +14337,6 @@ F: drivers/net/wireless/ · 700 unmodified lines
1433114337
1433214338 NETWORKING [DSA]
1433314339 M: Andrew Lunn <andrew@lunn.ch>
14334−M: Vivien Didelot <vivien.didelot@gmail.com>
1433514340 M: Florian Fainelli <f.fainelli@gmail.com>
1433614341 M: Vladimir Oltean <olteanv@gmail.com>
1433714342 S: Maintained
@@ -15640,7 +15645,7 @@ F: drivers/input/serio/gscps2.c · 1302 unmodified lines
1564015645 F: drivers/input/serio/hp_sdc*
1564115646 F: drivers/parisc/
1564215647 F: drivers/parport/parport_gsc.*
15643−F: drivers/tty/serial/8250/8250_gsc.c
15648+F: drivers/tty/serial/8250/8250_parisc.c
1564415649 F: drivers/video/console/sti*
1564515650 F: drivers/video/fbdev/sti*
1564615651 F: drivers/video/logo/logo_parisc*
@@ -15953,6 +15958,7 @@ Q: https://patchwork.kernel.org/project/linux-pci/list/ · 306 unmodified lines
1595315958 B: https://bugzilla.kernel.org
1595415959 C: irc://irc.oftc.net/linux-pci
1595515960 T: git git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git
15961+F: Documentation/devicetree/bindings/pci/
1595615962 F: drivers/pci/controller/
1595715963 F: drivers/pci/pci-bridge-emul.c
1595815964 F: drivers/pci/pci-bridge-emul.h
@@ -16059,7 +16065,7 @@ F: Documentation/devicetree/bindings/pci/microchip* · 100 unmodified lines
1605916065 F: drivers/pci/controller/*microchip*
1606016066
1606116067 PCIE DRIVER FOR QUALCOMM MSM
16062−M: Stanimir Varbanov <svarbanov@mm-sol.com>
16068+M: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
1606316069 L: linux-pci@vger.kernel.org
1606416070 L: linux-arm-msm@vger.kernel.org
1606516071 S: Maintained
@@ -16149,7 +16155,8 @@ F: include/linux/peci-cpu.h · 83 unmodified lines
1614916155 F: include/linux/peci.h
1615016156
1615116157 PENSANDO ETHERNET DRIVERS
16152−M: Shannon Nelson <snelson@pensando.io>
16158+M: Shannon Nelson <shannon.nelson@amd.com>
16159+M: Brett Creeley <brett.creeley@amd.com>
1615316160 M: drivers@pensando.io
1615416161 L: netdev@vger.kernel.org
1615516162 S: Supported
@@ -17232,7 +17239,7 @@ R: Dongsheng Yang <dongsheng.yang@easystack.cn> · 1076 unmodified lines
1723217239 L: ceph-devel@vger.kernel.org
1723317240 S: Supported
1723417241 W: http://ceph.com/
17235−T: git git://github.com/ceph/ceph-client.git
17242+T: git https://github.com/ceph/ceph-client.git
1723617243 F: Documentation/ABI/testing/sysfs-bus-rbd
1723717244 F: drivers/block/rbd.c
1723817245 F: drivers/block/rbd_types.h
@@ -17485,10 +17492,8 @@ S: Maintained · 246 unmodified lines
1748517492 F: drivers/net/wireless/realtek/rtw89/
1748617493
1748717494 REDPINE WIRELESS DRIVER
17488−M: Amitkumar Karwar <amitkarwar@gmail.com>
17489−M: Siva Rebbagondla <siva8118@gmail.com>
1749017495 L: linux-wireless@vger.kernel.org
17491−S: Maintained
17496+S: Orphan
1749217497 F: drivers/net/wireless/rsi/
1749317498
1749417499 REGISTER MAP ABSTRACTION
@@ -17733,7 +17738,7 @@ F: arch/riscv/ · 238 unmodified lines
1773317738 N: riscv
1773417739 K: riscv
1773517740
17736−RISC-V/MICROCHIP POLARFIRE SOC SUPPORT
17741+RISC-V MICROCHIP FPGA SUPPORT
1773717742 M: Conor Dooley <conor.dooley@microchip.com>
1773817743 M: Daire McNamara <daire.mcnamara@microchip.com>
1773917744 L: linux-riscv@lists.infradead.org
@@ -17751,17 +17756,26 @@ F: Documentation/devicetree/bindings/usb/microchip,mpfs-musb.yaml · 11 unmodified lines
1775117756 F: arch/riscv/boot/dts/microchip/
1775217757 F: drivers/char/hw_random/mpfs-rng.c
1775317758 F: drivers/clk/microchip/clk-mpfs.c
17754−F: drivers/i2c/busses/i2c-microchip-core.c
17759+F: drivers/i2c/busses/i2c-microchip-corei2c.c
1775517760 F: drivers/mailbox/mailbox-mpfs.c
1775617761 F: drivers/pci/controller/pcie-microchip-host.c
1775717762 F: drivers/reset/reset-mpfs.c
1775817763 F: drivers/rtc/rtc-mpfs.c
17759−F: drivers/soc/microchip/
17764+F: drivers/soc/microchip/mpfs-sys-controller.c
1776017765 F: drivers/spi/spi-microchip-core-qspi.c
1776117766 F: drivers/spi/spi-microchip-core.c
1776217767 F: drivers/usb/musb/mpfs.c
1776317768 F: include/soc/microchip/mpfs.h
1776417769
17770+RISC-V MISC SOC SUPPORT
17771+M: Conor Dooley <conor@kernel.org>
17772+L: linux-riscv@lists.infradead.org
17773+S: Maintained
17774+Q: https://patchwork.kernel.org/project/linux-riscv/list/
17775+T: git https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/
17776+F: Documentation/devicetree/bindings/riscv/
17777+F: arch/riscv/boot/dts/
17778+
1776517779 RNBD BLOCK DRIVERS
1776617780 M: Md. Haris Iqbal <haris.iqbal@ionos.com>
1776717781 M: Jack Wang <jinpu.wang@ionos.com>
@@ -18002,7 +18016,7 @@ L: linux-fbdev@vger.kernel.org · 234 unmodified lines
1800218016 S: Maintained
1800318017 F: drivers/video/fbdev/savage/
1800418018
18005−S390
18019+S390 ARCHITECTURE
1800618020 M: Heiko Carstens <hca@linux.ibm.com>
1800718021 M: Vasily Gorbik <gor@linux.ibm.com>
1800818022 M: Alexander Gordeev <agordeev@linux.ibm.com>
@@ -18057,6 +18071,15 @@ L: netdev@vger.kernel.org · 48 unmodified lines
1805718071 S: Supported
1805818072 F: drivers/s390/net/
1805918073
18074+S390 MM
18075+M: Alexander Gordeev <agordeev@linux.ibm.com>
18076+M: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
18077+L: linux-s390@vger.kernel.org
18078+S: Supported
18079+T: git git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git
18080+F: arch/s390/include/asm/pgtable.h
18081+F: arch/s390/mm
18082+
1806018083 S390 PCI SUBSYSTEM
1806118084 M: Niklas Schnelle <schnelle@linux.ibm.com>
1806218085 M: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
@@ -18788,7 +18811,6 @@ M: Palmer Dabbelt <palmer@dabbelt.com> · 725 unmodified lines
1878818811 M: Paul Walmsley <paul.walmsley@sifive.com>
1878918812 L: linux-riscv@lists.infradead.org
1879018813 S: Supported
18791−T: git https://github.com/sifive/riscv-linux.git
1879218814 N: sifive
1879318815 K: [^@]sifive
1879418816
@@ -18807,6 +18829,13 @@ S: Maintained · 12 unmodified lines
1880718829 F: Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml
1880818830 F: drivers/dma/sf-pdma/
1880918831
18832+SIFIVE SOC DRIVERS
18833+M: Conor Dooley <conor@kernel.org>
18834+L: linux-riscv@lists.infradead.org
18835+S: Maintained
18836+T: git https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/
18837+F: drivers/soc/sifive/
18838+
1881018839 SILEAD TOUCHSCREEN DRIVER
1881118840 M: Hans de Goede <hdegoede@redhat.com>
1881218841 L: linux-input@vger.kernel.org
@@ -19608,6 +19637,11 @@ M: Ion Badulescu <ionut@badula.org> · 795 unmodified lines
1960819637 S: Odd Fixes
1960919638 F: drivers/net/ethernet/adaptec/starfire*
1961019639
19640+STARFIVE DEVICETREES
19641+M: Emil Renner Berthing <kernel@esmil.dk>
19642+S: Maintained
19643+F: arch/riscv/boot/dts/starfive/
19644+
1961119645 STARFIVE JH7100 CLOCK DRIVERS
1961219646 M: Emil Renner Berthing <kernel@esmil.dk>
1961319647 S: Maintained
Makefile+2−2
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 6
33 PATCHLEVEL = 1
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc3
5+EXTRAVERSION = -rc8
66 NAME = Hurr durr I'ma ninja sloth
77
88 # *DOCUMENTATION*
@@ -1218,7 +1218,7 @@ quiet_cmd_ar_vmlinux.a = AR $@ · 1209 unmodified lines
12181218 cmd_ar_vmlinux.a = \
12191219 rm -f $@; \
12201220 $(AR) cDPrST $@ $(KBUILD_VMLINUX_OBJS); \
1221− $(AR) mPiT $$($(AR) t $@ | head -n1) $@ $$($(AR) t $@ | grep -F --file=$(srctree)/scripts/head-object-list.txt)
1221+ $(AR) mPiT $$($(AR) t $@ | sed -n 1p) $@ $$($(AR) t $@ | grep -F -f $(srctree)/scripts/head-object-list.txt)
12221222
12231223 targets += vmlinux.a
12241224 vmlinux.a: $(KBUILD_VMLINUX_OBJS) scripts/head-object-list.txt autoksyms_recursive FORCE
arch/arm/boot/dts/am335x-pcm-953.dtsi+13−15
@@ -12,22 +12,20 @@ · 11 unmodified lines
1212 compatible = "phytec,am335x-pcm-953", "phytec,am335x-phycore-som", "ti,am33xx";
1313
1414 /* Power */
15− regulators {
16− vcc3v3: fixedregulator@1 {
17− compatible = "regulator-fixed";
18− regulator-name = "vcc3v3";
19− regulator-min-microvolt = <3300000>;
20− regulator-max-microvolt = <3300000>;
21− regulator-boot-on;
22− };
15+ vcc3v3: fixedregulator1 {
16+ compatible = "regulator-fixed";
17+ regulator-name = "vcc3v3";
18+ regulator-min-microvolt = <3300000>;
19+ regulator-max-microvolt = <3300000>;
20+ regulator-boot-on;
21+ };
2322
24− vcc1v8: fixedregulator@2 {
25− compatible = "regulator-fixed";
26− regulator-name = "vcc1v8";
27− regulator-min-microvolt = <1800000>;
28− regulator-max-microvolt = <1800000>;
29− regulator-boot-on;
30− };
23+ vcc1v8: fixedregulator2 {
24+ compatible = "regulator-fixed";
25+ regulator-name = "vcc1v8";
26+ regulator-min-microvolt = <1800000>;
27+ regulator-max-microvolt = <1800000>;
28+ regulator-boot-on;
3129 };
3230
3331 /* User IO */
arch/arm/boot/dts/at91rm9200.dtsi+1−1
@@ -666,7 +666,7 @@ · 665 unmodified lines
666666 compatible = "atmel,at91rm9200-udc";
667667 reg = <0xfffb0000 0x4000>;
668668 interrupts = <11 IRQ_TYPE_LEVEL_HIGH 2>;
669− clocks = <&pmc PMC_TYPE_PERIPHERAL 11>, <&pmc PMC_TYPE_SYSTEM 2>;
669+ clocks = <&pmc PMC_TYPE_PERIPHERAL 11>, <&pmc PMC_TYPE_SYSTEM 1>;
670670 clock-names = "pclk", "hclk";
671671 status = "disabled";
672672 };
arch/arm/boot/dts/at91sam9g20ek_common.dtsi+9−0
@@ -39,6 +39,13 @@ · 38 unmodified lines
3939
4040 };
4141
42+ usb1 {
43+ pinctrl_usb1_vbus_gpio: usb1_vbus_gpio {
44+ atmel,pins =
45+ <AT91_PIOC 5 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; /* PC5 GPIO */
46+ };
47+ };
48+
4249 mmc0_slot1 {
4350 pinctrl_board_mmc0_slot1: mmc0_slot1-board {
4451 atmel,pins =
@@ -84,6 +91,8 @@ · 39 unmodified lines
8491 };
8592
8693 usb1: gadget@fffa4000 {
94+ pinctrl-0 = <&pinctrl_usb1_vbus_gpio>;
95+ pinctrl-names = "default";
8796 atmel,vbus-gpio = <&pioC 5 GPIO_ACTIVE_HIGH>;
8897 status = "okay";
8998 };
arch/arm/boot/dts/imx6q-prti6q.dts+2−2
@@ -364,8 +364,8 @@ · 363 unmodified lines
364364 pinctrl-names = "default";
365365 pinctrl-0 = <&pinctrl_wifi>;
366366 interrupts-extended = <&gpio1 30 IRQ_TYPE_LEVEL_HIGH>;
367− ref-clock-frequency = "38400000";
368− tcxo-clock-frequency = "19200000";
367+ ref-clock-frequency = <38400000>;
368+ tcxo-clock-frequency = <19200000>;
369369 };
370370 };
371371
arch/arm/boot/dts/imx6q-yapp4-crux.dts+4−0
@@ -33,6 +33,10 @@ · 32 unmodified lines
3333 status = "okay";
3434 };
3535
36+&reg_pu {
37+ regulator-always-on;
38+};
39+
3640 &reg_usb_h1_vbus {
3741 status = "okay";
3842 };
arch/arm/boot/dts/imx6qdl-gw5910.dtsi+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929
3030 user-pb {
3131 label = "user_pb";
32− gpios = <&gsc_gpio 0 GPIO_ACTIVE_LOW>;
32+ gpios = <&gsc_gpio 2 GPIO_ACTIVE_LOW>;
3333 linux,code = <BTN_0>;
3434 };
3535
arch/arm/boot/dts/imx6qdl-gw5913.dtsi+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626
2727 user-pb {
2828 label = "user_pb";
29− gpios = <&gsc_gpio 0 GPIO_ACTIVE_LOW>;
29+ gpios = <&gsc_gpio 2 GPIO_ACTIVE_LOW>;
3030 linux,code = <BTN_0>;
3131 };
3232
arch/arm/boot/dts/imx6qp-yapp4-crux-plus.dts+4−0
@@ -33,6 +33,10 @@ · 32 unmodified lines
3333 status = "okay";
3434 };
3535
36+&reg_pu {
37+ regulator-always-on;
38+};
39+
3640 &reg_usb_h1_vbus {
3741 status = "okay";
3842 };
arch/arm/boot/dts/imx7s.dtsi+2−2
@@ -1270,10 +1270,10 @@ · 1269 unmodified lines
12701270 clocks = <&clks IMX7D_NAND_USDHC_BUS_RAWNAND_CLK>;
12711271 };
12721272
1273− gpmi: nand-controller@33002000{
1273+ gpmi: nand-controller@33002000 {
12741274 compatible = "fsl,imx7d-gpmi-nand";
12751275 #address-cells = <1>;
1276− #size-cells = <1>;
1276+ #size-cells = <0>;
12771277 reg = <0x33002000 0x2000>, <0x33004000 0x4000>;
12781278 reg-names = "gpmi-nand", "bch";
12791279 interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
arch/arm/boot/dts/lan966x-pcb8291.dts+20−0
@@ -69,6 +69,12 @@ · 68 unmodified lines
6969 pins = "GPIO_35", "GPIO_36";
7070 function = "can0_b";
7171 };
72+
73+ sgpio_a_pins: sgpio-a-pins {
74+ /* SCK, D0, D1, LD */
75+ pins = "GPIO_32", "GPIO_33", "GPIO_34", "GPIO_35";
76+ function = "sgpio_a";
77+ };
7278 };
7379
7480 &can0 {
@@ -118,6 +124,20 @@ · 43 unmodified lines
118124 status = "okay";
119125 };
120126
127+&sgpio {
128+ pinctrl-0 = <&sgpio_a_pins>;
129+ pinctrl-names = "default";
130+ microchip,sgpio-port-ranges = <0 3>, <8 11>;
131+ status = "okay";
132+
133+ gpio@0 {
134+ ngpios = <64>;
135+ };
136+ gpio@1 {
137+ ngpios = <64>;
138+ };
139+};
140+
121141 &switch {
122142 status = "okay";
123143 };
arch/arm/boot/dts/rk3036-evb.dts+1−2
@@ -35,11 +35,10 @@ · 34 unmodified lines
3535 &i2c1 {
3636 status = "okay";
3737
38− hym8563: hym8563@51 {
38+ hym8563: rtc@51 {
3939 compatible = "haoyu,hym8563";
4040 reg = <0x51>;
4141 #clock-cells = <0>;
42− clock-frequency = <32768>;
4342 clock-output-names = "xin32k";
4443 };
4544 };
arch/arm/boot/dts/rk3066a-mk808.dts+1−1
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232 keyup-threshold-microvolt = <2500000>;
3333 poll-interval = <100>;
3434
35− recovery {
35+ button-recovery {
3636 label = "recovery";
3737 linux,code = <KEY_VENDOR>;
3838 press-threshold-microvolt = <0>;
arch/arm/boot/dts/rk3188-radxarock.dts+1−1
@@ -71,7 +71,7 @@ · 70 unmodified lines
7171 #sound-dai-cells = <0>;
7272 };
7373
74− ir_recv: gpio-ir-receiver {
74+ ir_recv: ir-receiver {
7575 compatible = "gpio-ir-receiver";
7676 gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
7777 pinctrl-names = "default";
arch/arm/boot/dts/rk3188.dtsi+1−2
@@ -379,7 +379,7 @@ · 378 unmodified lines
379379 rockchip,pins = <2 RK_PD3 1 &pcfg_pull_none>;
380380 };
381381
382− lcdc1_rgb24: ldcd1-rgb24 {
382+ lcdc1_rgb24: lcdc1-rgb24 {
383383 rockchip,pins = <2 RK_PA0 1 &pcfg_pull_none>,
384384 <2 RK_PA1 1 &pcfg_pull_none>,
385385 <2 RK_PA2 1 &pcfg_pull_none>,
@@ -607,7 +607,6 @@ · 221 unmodified lines
607607
608608 &global_timer {
609609 interrupts = <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>;
610− status = "disabled";
611610 };
612611
613612 &local_timer {
arch/arm/boot/dts/rk3288-evb-act8846.dts+1−1
@@ -54,7 +54,7 @@ · 53 unmodified lines
5454 vin-supply = <&vcc_sys>;
5555 };
5656
57− hym8563@51 {
57+ rtc@51 {
5858 compatible = "haoyu,hym8563";
5959 reg = <0x51>;
6060
arch/arm/boot/dts/rk3288-evb.dtsi+3−3
@@ -28,19 +28,19 @@ · 27 unmodified lines
2828 press-threshold-microvolt = <300000>;
2929 };
3030
31− menu {
31+ button-menu {
3232 label = "Menu";
3333 linux,code = <KEY_MENU>;
3434 press-threshold-microvolt = <640000>;
3535 };
3636
37− esc {
37+ button-esc {
3838 label = "Esc";
3939 linux,code = <KEY_ESC>;
4040 press-threshold-microvolt = <1000000>;
4141 };
4242
43− home {
43+ button-home {
4444 label = "Home";
4545 linux,code = <KEY_HOME>;
4646 press-threshold-microvolt = <1300000>;
arch/arm/boot/dts/rk3288-firefly.dtsi+1−2
@@ -233,11 +233,10 @@ · 232 unmodified lines
233233 vin-supply = <&vcc_sys>;
234234 };
235235
236− hym8563: hym8563@51 {
236+ hym8563: rtc@51 {
237237 compatible = "haoyu,hym8563";
238238 reg = <0x51>;
239239 #clock-cells = <0>;
240− clock-frequency = <32768>;
241240 clock-output-names = "xin32k";
242241 interrupt-parent = <&gpio7>;
243242 interrupts = <RK_PA4 IRQ_TYPE_EDGE_FALLING>;
arch/arm/boot/dts/rk3288-miqi.dts+1−2
@@ -162,11 +162,10 @@ · 161 unmodified lines
162162 vin-supply = <&vcc_sys>;
163163 };
164164
165− hym8563: hym8563@51 {
165+ hym8563: rtc@51 {
166166 compatible = "haoyu,hym8563";
167167 reg = <0x51>;
168168 #clock-cells = <0>;
169− clock-frequency = <32768>;
170169 clock-output-names = "xin32k";
171170 };
172171
arch/arm/boot/dts/rk3288-rock2-square.dts+1−2
@@ -165,11 +165,10 @@ · 164 unmodified lines
165165 };
166166
167167 &i2c0 {
168− hym8563: hym8563@51 {
168+ hym8563: rtc@51 {
169169 compatible = "haoyu,hym8563";
170170 reg = <0x51>;
171171 #clock-cells = <0>;
172− clock-frequency = <32768>;
173172 clock-output-names = "xin32k";
174173 interrupt-parent = <&gpio0>;
175174 interrupts = <RK_PA4 IRQ_TYPE_EDGE_FALLING>;
arch/arm/boot/dts/rk3288-vmarc-som.dtsi+0−1
@@ -241,7 +241,6 @@ · 240 unmodified lines
241241 interrupt-parent = <&gpio5>;
242242 interrupts = <RK_PC3 IRQ_TYPE_LEVEL_LOW>;
243243 #clock-cells = <0>;
244− clock-frequency = <32768>;
245244 clock-output-names = "hym8563";
246245 pinctrl-names = "default";
247246 pinctrl-0 = <&hym8563_int>;
arch/arm/boot/dts/rk3xxx.dtsi+7−0
@@ -76,6 +76,13 @@ · 75 unmodified lines
7676 reg = <0x1013c200 0x20>;
7777 interrupts = <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_EDGE_RISING)>;
7878 clocks = <&cru CORE_PERI>;
79+ status = "disabled";
80+ /* The clock source and the sched_clock provided by the arm_global_timer
81+ * on Rockchip rk3066a/rk3188 are quite unstable because their rates
82+ * depend on the CPU frequency.
83+ * Keep the arm_global_timer disabled in order to have the
84+ * DW_APB_TIMER (rk3066a) or ROCKCHIP_TIMER (rk3188) selected by default.
85+ */
7986 };
8087
8188 local_timer: local-timer@1013c600 {
arch/arm/boot/dts/sama7g5-pinfunc.h+1−1
@@ -261,7 +261,7 @@ · 260 unmodified lines
261261 #define PIN_PB2__FLEXCOM6_IO0 PINMUX_PIN(PIN_PB2, 2, 1)
262262 #define PIN_PB2__ADTRG PINMUX_PIN(PIN_PB2, 3, 1)
263263 #define PIN_PB2__A20 PINMUX_PIN(PIN_PB2, 4, 1)
264−#define PIN_PB2__FLEXCOM11_IO0 PINMUX_PIN(PIN_PB2, 6, 3)
264+#define PIN_PB2__FLEXCOM11_IO1 PINMUX_PIN(PIN_PB2, 6, 3)
265265 #define PIN_PB3 35
266266 #define PIN_PB3__GPIO PINMUX_PIN(PIN_PB3, 0, 0)
267267 #define PIN_PB3__RF1 PINMUX_PIN(PIN_PB3, 1, 1)
arch/arm/boot/dts/ste-href.dtsi+8−0
@@ -24,6 +24,14 @@ · 23 unmodified lines
2424 polling-delay = <0>;
2525 polling-delay-passive = <0>;
2626 thermal-sensors = <&bat_therm>;
27+
28+ trips {
29+ battery-crit-hi {
30+ temperature = <70000>;
31+ hysteresis = <2000>;
32+ type = "critical";
33+ };
34+ };
2735 };
2836 };
2937
arch/arm/boot/dts/ste-snowball.dts+8−0
@@ -28,6 +28,14 @@ · 27 unmodified lines
2828 polling-delay = <0>;
2929 polling-delay-passive = <0>;
3030 thermal-sensors = <&bat_therm>;
31+
32+ trips {
33+ battery-crit-hi {
34+ temperature = <70000>;
35+ hysteresis = <2000>;
36+ type = "critical";
37+ };
38+ };
3139 };
3240 };
3341
arch/arm/boot/dts/ste-ux500-samsung-codina-tmo.dts+8−0
@@ -44,6 +44,14 @@ · 43 unmodified lines
4444 polling-delay = <0>;
4545 polling-delay-passive = <0>;
4646 thermal-sensors = <&bat_therm>;
47+
48+ trips {
49+ battery-crit-hi {
50+ temperature = <70000>;
51+ hysteresis = <2000>;
52+ type = "critical";
53+ };
54+ };
4755 };
4856 };
4957
arch/arm/boot/dts/ste-ux500-samsung-codina.dts+8−0
@@ -57,6 +57,14 @@ · 56 unmodified lines
5757 polling-delay = <0>;
5858 polling-delay-passive = <0>;
5959 thermal-sensors = <&bat_therm>;
60+
61+ trips {
62+ battery-crit-hi {
63+ temperature = <70000>;
64+ hysteresis = <2000>;
65+ type = "critical";
66+ };
67+ };
6068 };
6169 };
6270
arch/arm/boot/dts/ste-ux500-samsung-gavini.dts+8−0
@@ -30,6 +30,14 @@ · 29 unmodified lines
3030 polling-delay = <0>;
3131 polling-delay-passive = <0>;
3232 thermal-sensors = <&bat_therm>;
33+
34+ trips {
35+ battery-crit-hi {
36+ temperature = <70000>;
37+ hysteresis = <2000>;
38+ type = "critical";
39+ };
40+ };
3341 };
3442 };
3543
arch/arm/boot/dts/ste-ux500-samsung-golden.dts+8−0
@@ -35,6 +35,14 @@ · 34 unmodified lines
3535 polling-delay = <0>;
3636 polling-delay-passive = <0>;
3737 thermal-sensors = <&bat_therm>;
38+
39+ trips {
40+ battery-crit-hi {
41+ temperature = <70000>;
42+ hysteresis = <2000>;
43+ type = "critical";
44+ };
45+ };
3846 };
3947 };
4048
arch/arm/boot/dts/ste-ux500-samsung-janice.dts+8−0
@@ -30,6 +30,14 @@ · 29 unmodified lines
3030 polling-delay = <0>;
3131 polling-delay-passive = <0>;
3232 thermal-sensors = <&bat_therm>;
33+
34+ trips {
35+ battery-crit-hi {
36+ temperature = <70000>;
37+ hysteresis = <2000>;
38+ type = "critical";
39+ };
40+ };
3341 };
3442 };
3543
arch/arm/boot/dts/ste-ux500-samsung-kyle.dts+8−0
@@ -34,6 +34,14 @@ · 33 unmodified lines
3434 polling-delay = <0>;
3535 polling-delay-passive = <0>;
3636 thermal-sensors = <&bat_therm>;
37+
38+ trips {
39+ battery-crit-hi {
40+ temperature = <70000>;
41+ hysteresis = <2000>;
42+ type = "critical";
43+ };
44+ };
3745 };
3846 };
3947
arch/arm/boot/dts/ste-ux500-samsung-skomer.dts+8−0
@@ -30,6 +30,14 @@ · 29 unmodified lines
3030 polling-delay = <0>;
3131 polling-delay-passive = <0>;
3232 thermal-sensors = <&bat_therm>;
33+
34+ trips {
35+ battery-crit-hi {
36+ temperature = <70000>;
37+ hysteresis = <2000>;
38+ type = "critical";
39+ };
40+ };
3341 };
3442 };
3543
arch/arm/include/asm/perf_event.h+1−1
@@ -17,7 +17,7 @@ extern unsigned long perf_misc_flags(struct pt_regs *regs); · 16 unmodified lines
1717
1818 #define perf_arch_fetch_caller_regs(regs, __ip) { \
1919 (regs)->ARM_pc = (__ip); \
20− (regs)->ARM_fp = (unsigned long) __builtin_frame_address(0); \
20+ frame_pointer((regs)) = (unsigned long) __builtin_frame_address(0); \
2121 (regs)->ARM_sp = current_stack_pointer; \
2222 (regs)->ARM_cpsr = SVC_MODE; \
2323 }
arch/arm/include/asm/pgtable-nommu.h+0−6
@@ -44,12 +44,6 @@ · 43 unmodified lines
4444
4545 typedef pte_t *pte_addr_t;
4646
47−/*
48− * ZERO_PAGE is a global shared page that is always zero: used
49− * for zero-mapped memory areas etc..
50− */
51−#define ZERO_PAGE(vaddr) (virt_to_page(0))
52−
5347 /*
5448 * Mark the prot value as uncacheable and unbufferable.
5549 */
arch/arm/include/asm/pgtable.h+9−7
@@ -10,6 +10,15 @@ · 9 unmodified lines
1010 #include <linux/const.h>
1111 #include <asm/proc-fns.h>
1212
13+#ifndef __ASSEMBLY__
14+/*
15+ * ZERO_PAGE is a global shared page that is always zero: used
16+ * for zero-mapped memory areas etc..
17+ */
18+extern struct page *empty_zero_page;
19+#define ZERO_PAGE(vaddr) (empty_zero_page)
20+#endif
21+
1322 #ifndef CONFIG_MMU
1423
1524 #include <asm-generic/pgtable-nopud.h>
@@ -139,13 +148,6 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, · 123 unmodified lines
139148 */
140149
141150 #ifndef __ASSEMBLY__
142−/*
143− * ZERO_PAGE is a global shared page that is always zero: used
144− * for zero-mapped memory areas etc..
145− */
146−extern struct page *empty_zero_page;
147−#define ZERO_PAGE(vaddr) (empty_zero_page)
148−
149151
150152 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
151153
arch/arm/mach-at91/pm_suspend.S+6−1
@@ -169,10 +169,15 @@ sr_ena_2: · 168 unmodified lines
169169 cmp tmp1, #UDDRC_STAT_SELFREF_TYPE_SW
170170 bne sr_ena_2
171171
172− /* Put DDR PHY's DLL in bypass mode for non-backup modes. */
172+ /* Disable DX DLLs for non-backup modes. */
173173 cmp r7, #AT91_PM_BACKUP
174174 beq sr_ena_3
175175
176+ /* Do not soft reset the AC DLL. */
177+ ldr tmp1, [r3, DDR3PHY_ACDLLCR]
178+ bic tmp1, tmp1, DDR3PHY_ACDLLCR_DLLSRST
179+ str tmp1, [r3, DDR3PHY_ACDLLCR]
180+
176181 /* Disable DX DLLs. */
177182 ldr tmp1, [r3, #DDR3PHY_DX0DLLCR]
178183 orr tmp1, tmp1, #DDR3PHY_DXDLLCR_DLLDIS
arch/arm/mach-mxs/mach-mxs.c+3−1
@@ -393,8 +393,10 @@ static void __init mxs_machine_init(void) · 392 unmodified lines
393393
394394 root = of_find_node_by_path("/");
395395 ret = of_property_read_string(root, "model", &soc_dev_attr->machine);
396− if (ret)
396+ if (ret) {
397+ kfree(soc_dev_attr);
397398 return;
399+ }
398400
399401 soc_dev_attr->family = "Freescale MXS Family";
400402 soc_dev_attr->soc_id = mxs_get_soc_id();
arch/arm/mm/nommu.c+19−0
@@ -26,6 +26,13 @@ · 25 unmodified lines
2626
2727 unsigned long vectors_base;
2828
29+/*
30+ * empty_zero_page is a special page that is used for
31+ * zero-initialized data and COW.
32+ */
33+struct page *empty_zero_page;
34+EXPORT_SYMBOL(empty_zero_page);
35+
2936 #ifdef CONFIG_ARM_MPU
3037 struct mpu_rgn_info mpu_rgn_info;
3138 #endif
@@ -148,9 +155,21 @@ void __init adjust_lowmem_bounds(void) · 116 unmodified lines
148155 */
149156 void __init paging_init(const struct machine_desc *mdesc)
150157 {
158+ void *zero_page;
159+
151160 early_trap_init((void *)vectors_base);
152161 mpu_setup();
162+
163+ /* allocate the zero page. */
164+ zero_page = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
165+ if (!zero_page)
166+ panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
167+ __func__, PAGE_SIZE, PAGE_SIZE);
168+
153169 bootmem_init();
170+
171+ empty_zero_page = virt_to_page(zero_page);
172+ flush_dcache_page(empty_zero_page);
154173 }
155174
156175 /*
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi+1−0
@@ -161,6 +161,7 @@ · 160 unmodified lines
161161 clocks = <&ccu CLK_BUS_VP9>, <&ccu CLK_VP9>;
162162 clock-names = "bus", "mod";
163163 resets = <&ccu RST_BUS_VP9>;
164+ iommus = <&iommu 5>;
164165 };
165166
166167 video-codec@1c0e000 {
arch/arm64/boot/dts/arm/juno-base.dtsi+14−0
@@ -751,12 +751,26 @@ · 750 unmodified lines
751751 polling-delay = <1000>;
752752 polling-delay-passive = <100>;
753753 thermal-sensors = <&scpi_sensors0 0>;
754+ trips {
755+ pmic_crit0: trip0 {
756+ temperature = <90000>;
757+ hysteresis = <2000>;
758+ type = "critical";
759+ };
760+ };
754761 };
755762
756763 soc {
757764 polling-delay = <1000>;
758765 polling-delay-passive = <100>;
759766 thermal-sensors = <&scpi_sensors0 3>;
767+ trips {
768+ soc_crit0: trip0 {
769+ temperature = <80000>;
770+ hysteresis = <2000>;
771+ type = "critical";
772+ };
773+ };
760774 };
761775
762776 big_cluster_thermal_zone: big-cluster {
arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi+6−0
@@ -779,6 +779,9 @@ · 778 unmodified lines
779779 little-endian;
780780 #address-cells = <1>;
781781 #size-cells = <0>;
782+ clock-frequency = <2500000>;
783+ clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL
784+ QORIQ_CLK_PLL_DIV(1)>;
782785 status = "disabled";
783786 };
784787
@@ -788,6 +791,9 @@ · 3 unmodified lines
788791 little-endian;
789792 #address-cells = <1>;
790793 #size-cells = <0>;
794+ clock-frequency = <2500000>;
795+ clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL
796+ QORIQ_CLK_PLL_DIV(1)>;
791797 status = "disabled";
792798 };
793799
arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi+6−0
@@ -532,6 +532,9 @@ · 531 unmodified lines
532532 little-endian;
533533 #address-cells = <1>;
534534 #size-cells = <0>;
535+ clock-frequency = <2500000>;
536+ clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL
537+ QORIQ_CLK_PLL_DIV(2)>;
535538 status = "disabled";
536539 };
537540
@@ -541,6 +544,9 @@ · 3 unmodified lines
541544 little-endian;
542545 #address-cells = <1>;
543546 #size-cells = <0>;
547+ clock-frequency = <2500000>;
548+ clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL
549+ QORIQ_CLK_PLL_DIV(2)>;
544550 status = "disabled";
545551 };
546552
arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi+6−0
@@ -1385,6 +1385,9 @@ · 1384 unmodified lines
13851385 #address-cells = <1>;
13861386 #size-cells = <0>;
13871387 little-endian;
1388+ clock-frequency = <2500000>;
1389+ clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL
1390+ QORIQ_CLK_PLL_DIV(2)>;
13881391 status = "disabled";
13891392 };
13901393
@@ -1395,6 +1398,9 @@ · 4 unmodified lines
13951398 little-endian;
13961399 #address-cells = <1>;
13971400 #size-cells = <0>;
1401+ clock-frequency = <2500000>;
1402+ clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL
1403+ QORIQ_CLK_PLL_DIV(2)>;
13981404 status = "disabled";
13991405 };
14001406
arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi+9−9
@@ -38,9 +38,9 @@ conn_subsys: bus@5b000000 { · 37 unmodified lines
3838 interrupts = <GIC_SPI 232 IRQ_TYPE_LEVEL_HIGH>;
3939 reg = <0x5b010000 0x10000>;
4040 clocks = <&sdhc0_lpcg IMX_LPCG_CLK_4>,
41− <&sdhc0_lpcg IMX_LPCG_CLK_5>,
42− <&sdhc0_lpcg IMX_LPCG_CLK_0>;
43− clock-names = "ipg", "per", "ahb";
41+ <&sdhc0_lpcg IMX_LPCG_CLK_0>,
42+ <&sdhc0_lpcg IMX_LPCG_CLK_5>;
43+ clock-names = "ipg", "ahb", "per";
4444 power-domains = <&pd IMX_SC_R_SDHC_0>;
4545 status = "disabled";
4646 };
@@ -49,9 +49,9 @@ conn_subsys: bus@5b000000 { · 2 unmodified lines
4949 interrupts = <GIC_SPI 233 IRQ_TYPE_LEVEL_HIGH>;
5050 reg = <0x5b020000 0x10000>;
5151 clocks = <&sdhc1_lpcg IMX_LPCG_CLK_4>,
52− <&sdhc1_lpcg IMX_LPCG_CLK_5>,
53− <&sdhc1_lpcg IMX_LPCG_CLK_0>;
54− clock-names = "ipg", "per", "ahb";
52+ <&sdhc1_lpcg IMX_LPCG_CLK_0>,
53+ <&sdhc1_lpcg IMX_LPCG_CLK_5>;
54+ clock-names = "ipg", "ahb", "per";
5555 power-domains = <&pd IMX_SC_R_SDHC_1>;
5656 fsl,tuning-start-tap = <20>;
5757 fsl,tuning-step = <2>;
@@ -62,9 +62,9 @@ conn_subsys: bus@5b000000 { · 4 unmodified lines
6262 interrupts = <GIC_SPI 234 IRQ_TYPE_LEVEL_HIGH>;
6363 reg = <0x5b030000 0x10000>;
6464 clocks = <&sdhc2_lpcg IMX_LPCG_CLK_4>,
65− <&sdhc2_lpcg IMX_LPCG_CLK_5>,
66− <&sdhc2_lpcg IMX_LPCG_CLK_0>;
67− clock-names = "ipg", "per", "ahb";
65+ <&sdhc2_lpcg IMX_LPCG_CLK_0>,
66+ <&sdhc2_lpcg IMX_LPCG_CLK_5>;
67+ clock-names = "ipg", "ahb", "per";
6868 power-domains = <&pd IMX_SC_R_SDHC_2>;
6969 status = "disabled";
7070 };
arch/arm64/boot/dts/freescale/imx8mm-mx8menlo.dts+8−8
@@ -250,21 +250,21 @@ · 249 unmodified lines
250250 /* SODIMM 96 */
251251 MX8MM_IOMUXC_SAI1_RXD2_GPIO4_IO4 0x1c4
252252 /* CPLD_D[7] */
253− MX8MM_IOMUXC_SAI1_RXD3_GPIO4_IO5 0x1c4
253+ MX8MM_IOMUXC_SAI1_RXD3_GPIO4_IO5 0x184
254254 /* CPLD_D[6] */
255− MX8MM_IOMUXC_SAI1_RXFS_GPIO4_IO0 0x1c4
255+ MX8MM_IOMUXC_SAI1_RXFS_GPIO4_IO0 0x184
256256 /* CPLD_D[5] */
257− MX8MM_IOMUXC_SAI1_TXC_GPIO4_IO11 0x1c4
257+ MX8MM_IOMUXC_SAI1_TXC_GPIO4_IO11 0x184
258258 /* CPLD_D[4] */
259− MX8MM_IOMUXC_SAI1_TXD0_GPIO4_IO12 0x1c4
259+ MX8MM_IOMUXC_SAI1_TXD0_GPIO4_IO12 0x184
260260 /* CPLD_D[3] */
261− MX8MM_IOMUXC_SAI1_TXD1_GPIO4_IO13 0x1c4
261+ MX8MM_IOMUXC_SAI1_TXD1_GPIO4_IO13 0x184
262262 /* CPLD_D[2] */
263− MX8MM_IOMUXC_SAI1_TXD2_GPIO4_IO14 0x1c4
263+ MX8MM_IOMUXC_SAI1_TXD2_GPIO4_IO14 0x184
264264 /* CPLD_D[1] */
265− MX8MM_IOMUXC_SAI1_TXD3_GPIO4_IO15 0x1c4
265+ MX8MM_IOMUXC_SAI1_TXD3_GPIO4_IO15 0x184
266266 /* CPLD_D[0] */
267− MX8MM_IOMUXC_SAI1_TXD4_GPIO4_IO16 0x1c4
267+ MX8MM_IOMUXC_SAI1_TXD4_GPIO4_IO16 0x184
268268 /* KBD_intK */
269269 MX8MM_IOMUXC_SAI2_MCLK_GPIO4_IO27 0x1c4
270270 /* DISP_reset */
arch/arm64/boot/dts/freescale/imx8mm-tqma8mqml-mba8mx.dts+26−6
@@ -34,11 +34,25 @@ · 33 unmodified lines
3434 off-on-delay-us = <12000>;
3535 };
3636
37− extcon_usbotg1: extcon-usbotg1 {
38− compatible = "linux,extcon-usb-gpio";
37+ connector {
38+ compatible = "gpio-usb-b-connector", "usb-b-connector";
39+ type = "micro";
40+ label = "X19";
3941 pinctrl-names = "default";
40− pinctrl-0 = <&pinctrl_usb1_extcon>;
41− id-gpio = <&gpio1 10 GPIO_ACTIVE_HIGH>;
42+ pinctrl-0 = <&pinctrl_usb1_connector>;
43+ id-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
44+
45+ ports {
46+ #address-cells = <1>;
47+ #size-cells = <0>;
48+
49+ port@0 {
50+ reg = <0>;
51+ usb_dr_connector: endpoint {
52+ remote-endpoint = <&usb1_drd_sw>;
53+ };
54+ };
55+ };
4256 };
4357 };
4458
@@ -105,13 +119,19 @@ · 60 unmodified lines
105119 pinctrl-names = "default";
106120 pinctrl-0 = <&pinctrl_usbotg1>;
107121 dr_mode = "otg";
108− extcon = <&extcon_usbotg1>;
109122 srp-disable;
110123 hnp-disable;
111124 adp-disable;
112125 power-active-high;
113126 over-current-active-low;
127+ usb-role-switch;
114128 status = "okay";
129+
130+ port {
131+ usb1_drd_sw: endpoint {
132+ remote-endpoint = <&usb_dr_connector>;
133+ };
134+ };
115135 };
116136
117137 &usbotg2 {
@@ -231,7 +251,7 @@ · 113 unmodified lines
231251 <MX8MM_IOMUXC_GPIO1_IO13_USB1_OTG_OC 0x84>;
232252 };
233253
234− pinctrl_usb1_extcon: usb1-extcongrp {
254+ pinctrl_usb1_connector: usb1-connectorgrp {
235255 fsl,pins = <MX8MM_IOMUXC_GPIO1_IO10_GPIO1_IO10 0x1c0>;
236256 };
237257
arch/arm64/boot/dts/freescale/imx8mm.dtsi+6−6
@@ -276,6 +276,7 @@ · 275 unmodified lines
276276 assigned-clocks = <&clk IMX8MM_CLK_USB_PHY_REF>;
277277 assigned-clock-parents = <&clk IMX8MM_SYS_PLL1_100M>;
278278 clock-names = "main_clk";
279+ power-domains = <&pgc_otg1>;
279280 };
280281
281282 usbphynop2: usbphynop2 {
@@ -285,6 +286,7 @@ · 3 unmodified lines
285286 assigned-clocks = <&clk IMX8MM_CLK_USB_PHY_REF>;
286287 assigned-clock-parents = <&clk IMX8MM_SYS_PLL1_100M>;
287288 clock-names = "main_clk";
289+ power-domains = <&pgc_otg2>;
288290 };
289291
290292 soc: soc@0 {
@@ -674,13 +676,11 @@ · 383 unmodified lines
674676 pgc_otg1: power-domain@2 {
675677 #power-domain-cells = <0>;
676678 reg = <IMX8MM_POWER_DOMAIN_OTG1>;
677− power-domains = <&pgc_hsiomix>;
678679 };
679680
680681 pgc_otg2: power-domain@3 {
681682 #power-domain-cells = <0>;
682683 reg = <IMX8MM_POWER_DOMAIN_OTG2>;
683− power-domains = <&pgc_hsiomix>;
684684 };
685685
686686 pgc_gpumix: power-domain@4 {
@@ -1186,7 +1186,7 @@ · 499 unmodified lines
11861186 assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_500M>;
11871187 phys = <&usbphynop1>;
11881188 fsl,usbmisc = <&usbmisc1 0>;
1189− power-domains = <&pgc_otg1>;
1189+ power-domains = <&pgc_hsiomix>;
11901190 status = "disabled";
11911191 };
11921192
@@ -1206,7 +1206,7 @@ · 13 unmodified lines
12061206 assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_500M>;
12071207 phys = <&usbphynop2>;
12081208 fsl,usbmisc = <&usbmisc2 0>;
1209− power-domains = <&pgc_otg2>;
1209+ power-domains = <&pgc_hsiomix>;
12101210 status = "disabled";
12111211 };
12121212
@@ -1244,10 +1244,10 @@ · 31 unmodified lines
12441244 clocks = <&clk IMX8MM_CLK_NAND_USDHC_BUS_RAWNAND_CLK>;
12451245 };
12461246
1247− gpmi: nand-controller@33002000{
1247+ gpmi: nand-controller@33002000 {
12481248 compatible = "fsl,imx8mm-gpmi-nand", "fsl,imx7d-gpmi-nand";
12491249 #address-cells = <1>;
1250− #size-cells = <1>;
1250+ #size-cells = <0>;
12511251 reg = <0x33002000 0x2000>, <0x33004000 0x4000>;
12521252 reg-names = "gpmi-nand", "bch";
12531253 interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
arch/arm64/boot/dts/freescale/imx8mn.dtsi+3−3
@@ -662,7 +662,6 @@ · 661 unmodified lines
662662 pgc_otg1: power-domain@1 {
663663 #power-domain-cells = <0>;
664664 reg = <IMX8MN_POWER_DOMAIN_OTG1>;
665− power-domains = <&pgc_hsiomix>;
666665 };
667666
668667 pgc_gpumix: power-domain@2 {
@@ -1076,7 +1075,7 @@ · 407 unmodified lines
10761075 assigned-clock-parents = <&clk IMX8MN_SYS_PLL2_500M>;
10771076 phys = <&usbphynop1>;
10781077 fsl,usbmisc = <&usbmisc1 0>;
1079− power-domains = <&pgc_otg1>;
1078+ power-domains = <&pgc_hsiomix>;
10801079 status = "disabled";
10811080 };
10821081
@@ -1103,7 +1102,7 @@ · 20 unmodified lines
11031102 gpmi: nand-controller@33002000 {
11041103 compatible = "fsl,imx8mn-gpmi-nand", "fsl,imx7d-gpmi-nand";
11051104 #address-cells = <1>;
1106− #size-cells = <1>;
1105+ #size-cells = <0>;
11071106 reg = <0x33002000 0x2000>, <0x33004000 0x4000>;
11081107 reg-names = "gpmi-nand", "bch";
11091108 interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
@@ -1175,5 +1174,6 @@ · 65 unmodified lines
11751174 assigned-clocks = <&clk IMX8MN_CLK_USB_PHY_REF>;
11761175 assigned-clock-parents = <&clk IMX8MN_SYS_PLL1_100M>;
11771176 clock-names = "main_clk";
1177+ power-domains = <&pgc_otg1>;
11781178 };
11791179 };
arch/arm64/boot/dts/freescale/imx8mp-evk.dts+3−3
@@ -544,14 +544,14 @@ · 543 unmodified lines
544544
545545 pinctrl_pcie0: pcie0grp {
546546 fsl,pins = <
547− MX8MP_IOMUXC_I2C4_SCL__PCIE_CLKREQ_B 0x61 /* open drain, pull up */
548− MX8MP_IOMUXC_SD1_DATA5__GPIO2_IO07 0x41
547+ MX8MP_IOMUXC_I2C4_SCL__PCIE_CLKREQ_B 0x60 /* open drain, pull up */
548+ MX8MP_IOMUXC_SD1_DATA5__GPIO2_IO07 0x40
549549 >;
550550 };
551551
552552 pinctrl_pcie0_reg: pcie0reggrp {
553553 fsl,pins = <
554− MX8MP_IOMUXC_SD1_DATA4__GPIO2_IO06 0x41
554+ MX8MP_IOMUXC_SD1_DATA4__GPIO2_IO06 0x40
555555 >;
556556 };
557557
arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi+10−10
@@ -354,16 +354,6 @@ · 353 unmodified lines
354354 "SODIMM_82",
355355 "SODIMM_70",
356356 "SODIMM_72";
357−
358− ctrl-sleep-moci-hog {
359− gpio-hog;
360− /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
361− gpios = <29 GPIO_ACTIVE_HIGH>;
362− line-name = "CTRL_SLEEP_MOCI#";
363− output-high;
364− pinctrl-names = "default";
365− pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
366− };
367357 };
368358
369359 &gpio3 {
@@ -432,6 +422,16 @@ · 62 unmodified lines
432422 "SODIMM_256",
433423 "SODIMM_48",
434424 "SODIMM_44";
425+
426+ ctrl-sleep-moci-hog {
427+ gpio-hog;
428+ /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
429+ gpios = <29 GPIO_ACTIVE_HIGH>;
430+ line-name = "CTRL_SLEEP_MOCI#";
431+ output-high;
432+ pinctrl-names = "default";
433+ pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
434+ };
435435 };
436436
437437 /* On-module I2C */
arch/arm64/boot/dts/freescale/imx93-pinfunc.h+0−0

File mode changed from 100755 to 100644.

arch/arm64/boot/dts/freescale/imx93.dtsi+6−5
@@ -451,7 +451,7 @@ · 450 unmodified lines
451451 clocks = <&clk IMX93_CLK_GPIO2_GATE>,
452452 <&clk IMX93_CLK_GPIO2_GATE>;
453453 clock-names = "gpio", "port";
454− gpio-ranges = <&iomuxc 0 32 32>;
454+ gpio-ranges = <&iomuxc 0 4 30>;
455455 };
456456
457457 gpio3: gpio@43820080 {
@@ -465,7 +465,8 @@ · 7 unmodified lines
465465 clocks = <&clk IMX93_CLK_GPIO3_GATE>,
466466 <&clk IMX93_CLK_GPIO3_GATE>;
467467 clock-names = "gpio", "port";
468− gpio-ranges = <&iomuxc 0 64 32>;
468+ gpio-ranges = <&iomuxc 0 84 8>, <&iomuxc 8 66 18>,
469+ <&iomuxc 26 34 2>, <&iomuxc 28 0 4>;
469470 };
470471
471472 gpio4: gpio@43830080 {
@@ -479,7 +480,7 @@ · 7 unmodified lines
479480 clocks = <&clk IMX93_CLK_GPIO4_GATE>,
480481 <&clk IMX93_CLK_GPIO4_GATE>;
481482 clock-names = "gpio", "port";
482− gpio-ranges = <&iomuxc 0 96 32>;
483+ gpio-ranges = <&iomuxc 0 38 28>, <&iomuxc 28 36 2>;
483484 };
484485
485486 gpio1: gpio@47400080 {
@@ -493,7 +494,7 @@ · 7 unmodified lines
493494 clocks = <&clk IMX93_CLK_GPIO1_GATE>,
494495 <&clk IMX93_CLK_GPIO1_GATE>;
495496 clock-names = "gpio", "port";
496− gpio-ranges = <&iomuxc 0 0 32>;
497+ gpio-ranges = <&iomuxc 0 92 16>;
497498 };
498499
499500 s4muap: mailbox@47520000 {
@@ -501,7 +502,7 @@ · 1 unmodified line
501502 reg = <0x47520000 0x10000>;
502503 interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>,
503504 <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
504− interrupt-names = "txirq", "rxirq";
505+ interrupt-names = "tx", "rx";
505506 #mbox-cells = <2>;
506507 };
507508
arch/arm64/boot/dts/qcom/ipq8074.dtsi+1−1
@@ -668,7 +668,7 @@ · 667 unmodified lines
668668
669669 apcs_glb: mailbox@b111000 {
670670 compatible = "qcom,ipq8074-apcs-apps-global";
671− reg = <0x0b111000 0x6000>;
671+ reg = <0x0b111000 0x1000>;
672672
673673 #clock-cells = <1>;
674674 #mbox-cells = <1>;
arch/arm64/boot/dts/qcom/msm8996.dtsi+1−1
@@ -3504,7 +3504,7 @@ · 3503 unmodified lines
35043504 };
35053505
35063506 saw3: syscon@9a10000 {
3507− compatible = "qcom,tcsr-msm8996", "syscon";
3507+ compatible = "syscon";
35083508 reg = <0x09a10000 0x1000>;
35093509 };
35103510
arch/arm64/boot/dts/qcom/sa8155p-adp.dts+12−1
@@ -43,7 +43,6 @@ · 42 unmodified lines
4343
4444 regulator-always-on;
4545 regulator-boot-on;
46− regulator-allow-set-load;
4746
4847 vin-supply = <&vreg_3p3>;
4948 };
@@ -137,6 +136,9 @@ · 87 unmodified lines
137136 regulator-max-microvolt = <880000>;
138137 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
139138 regulator-allow-set-load;
139+ regulator-allowed-modes =
140+ <RPMH_REGULATOR_MODE_LPM
141+ RPMH_REGULATOR_MODE_HPM>;
140142 };
141143
142144 vreg_l7a_1p8: ldo7 {
@@ -152,6 +154,9 @@ · 9 unmodified lines
152154 regulator-max-microvolt = <2960000>;
153155 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
154156 regulator-allow-set-load;
157+ regulator-allowed-modes =
158+ <RPMH_REGULATOR_MODE_LPM
159+ RPMH_REGULATOR_MODE_HPM>;
155160 };
156161
157162 vreg_l11a_0p8: ldo11 {
@@ -258,6 +263,9 @@ · 100 unmodified lines
258263 regulator-max-microvolt = <1200000>;
259264 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
260265 regulator-allow-set-load;
266+ regulator-allowed-modes =
267+ <RPMH_REGULATOR_MODE_LPM
268+ RPMH_REGULATOR_MODE_HPM>;
261269 };
262270
263271 vreg_l7c_1p8: ldo7 {
@@ -273,6 +281,9 @@ · 9 unmodified lines
273281 regulator-max-microvolt = <1200000>;
274282 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
275283 regulator-allow-set-load;
284+ regulator-allowed-modes =
285+ <RPMH_REGULATOR_MODE_LPM
286+ RPMH_REGULATOR_MODE_HPM>;
276287 };
277288
278289 vreg_l10c_3p3: ldo10 {
arch/arm64/boot/dts/qcom/sa8295p-adp.dts+12−0
@@ -83,6 +83,9 @@ · 82 unmodified lines
8383 regulator-max-microvolt = <1200000>;
8484 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
8585 regulator-allow-set-load;
86+ regulator-allowed-modes =
87+ <RPMH_REGULATOR_MODE_LPM
88+ RPMH_REGULATOR_MODE_HPM>;
8689 };
8790
8891 vreg_l4c: ldo4 {
@@ -98,6 +101,9 @@ · 9 unmodified lines
98101 regulator-max-microvolt = <1200000>;
99102 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
100103 regulator-allow-set-load;
104+ regulator-allowed-modes =
105+ <RPMH_REGULATOR_MODE_LPM
106+ RPMH_REGULATOR_MODE_HPM>;
101107 };
102108
103109 vreg_l7c: ldo7 {
@@ -113,6 +119,9 @@ · 9 unmodified lines
113119 regulator-max-microvolt = <2504000>;
114120 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
115121 regulator-allow-set-load;
122+ regulator-allowed-modes =
123+ <RPMH_REGULATOR_MODE_LPM
124+ RPMH_REGULATOR_MODE_HPM>;
116125 };
117126
118127 vreg_l17c: ldo17 {
@@ -121,6 +130,9 @@ · 2 unmodified lines
121130 regulator-max-microvolt = <2504000>;
122131 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
123132 regulator-allow-set-load;
133+ regulator-allowed-modes =
134+ <RPMH_REGULATOR_MODE_LPM
135+ RPMH_REGULATOR_MODE_HPM>;
124136 };
125137 };
126138
arch/arm64/boot/dts/qcom/sc7280.dtsi+2−1
@@ -2296,7 +2296,8 @@ · 2295 unmodified lines
22962296
22972297 lpass_audiocc: clock-controller@3300000 {
22982298 compatible = "qcom,sc7280-lpassaudiocc";
2299− reg = <0 0x03300000 0 0x30000>;
2299+ reg = <0 0x03300000 0 0x30000>,
2300+ <0 0x032a9000 0 0x1000>;
23002301 clocks = <&rpmhcc RPMH_CXO_CLK>,
23012302 <&lpass_aon LPASS_AON_CC_MAIN_RCG_CLK_SRC>;
23022303 clock-names = "bi_tcxo", "lpass_aon_cc_main_rcg_clk_src";
arch/arm64/boot/dts/qcom/sc8280xp-crd.dts+6−0
@@ -124,6 +124,9 @@ · 123 unmodified lines
124124 regulator-max-microvolt = <2504000>;
125125 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
126126 regulator-allow-set-load;
127+ regulator-allowed-modes =
128+ <RPMH_REGULATOR_MODE_LPM
129+ RPMH_REGULATOR_MODE_HPM>;
127130 };
128131
129132 vreg_l13c: ldo13 {
@@ -146,6 +149,9 @@ · 16 unmodified lines
146149 regulator-max-microvolt = <1200000>;
147150 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
148151 regulator-allow-set-load;
152+ regulator-allowed-modes =
153+ <RPMH_REGULATOR_MODE_LPM
154+ RPMH_REGULATOR_MODE_HPM>;
149155 };
150156
151157 vreg_l4d: ldo4 {
arch/arm64/boot/dts/qcom/sc8280xp.dtsi+8−28
@@ -885,13 +885,13 @@ · 884 unmodified lines
885885
886886 ufs_mem_phy: phy@1d87000 {
887887 compatible = "qcom,sc8280xp-qmp-ufs-phy";
888− reg = <0 0x01d87000 0 0xe10>;
888+ reg = <0 0x01d87000 0 0x1c8>;
889889 #address-cells = <2>;
890890 #size-cells = <2>;
891891 ranges;
892892 clock-names = "ref",
893893 "ref_aux";
894− clocks = <&rpmhcc RPMH_CXO_CLK>,
894+ clocks = <&gcc GCC_UFS_REF_CLKREF_CLK>,
895895 <&gcc GCC_UFS_PHY_PHY_AUX_CLK>;
896896
897897 resets = <&ufs_mem_hc 0>;
@@ -953,13 +953,13 @@ · 55 unmodified lines
953953
954954 ufs_card_phy: phy@1da7000 {
955955 compatible = "qcom,sc8280xp-qmp-ufs-phy";
956− reg = <0 0x01da7000 0 0xe10>;
956+ reg = <0 0x01da7000 0 0x1c8>;
957957 #address-cells = <2>;
958958 #size-cells = <2>;
959959 ranges;
960960 clock-names = "ref",
961961 "ref_aux";
962− clocks = <&gcc GCC_UFS_1_CARD_CLKREF_CLK>,
962+ clocks = <&gcc GCC_UFS_REF_CLKREF_CLK>,
963963 <&gcc GCC_UFS_CARD_PHY_AUX_CLK>;
964964
965965 resets = <&ufs_card_hc 0>;
@@ -1181,26 +1181,16 @@ · 215 unmodified lines
11811181 usb_0_ssphy: usb3-phy@88eb400 {
11821182 reg = <0 0x088eb400 0 0x100>,
11831183 <0 0x088eb600 0 0x3ec>,
1184− <0 0x088ec400 0 0x1f0>,
1184+ <0 0x088ec400 0 0x364>,
11851185 <0 0x088eba00 0 0x100>,
11861186 <0 0x088ebc00 0 0x3ec>,
1187− <0 0x088ec700 0 0x64>;
1187+ <0 0x088ec200 0 0x18>;
11881188 #phy-cells = <0>;
11891189 #clock-cells = <0>;
11901190 clocks = <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>;
11911191 clock-names = "pipe0";
11921192 clock-output-names = "usb0_phy_pipe_clk_src";
11931193 };
1194−
1195− usb_0_dpphy: dp-phy@88ed200 {
1196− reg = <0 0x088ed200 0 0x200>,
1197− <0 0x088ed400 0 0x200>,
1198− <0 0x088eda00 0 0x200>,
1199− <0 0x088ea600 0 0x200>,
1200− <0 0x088ea800 0 0x200>;
1201− #clock-cells = <1>;
1202− #phy-cells = <0>;
1203− };
12041194 };
12051195
12061196 usb_1_hsphy: phy@8902000 {
@@ -1242,8 +1232,8 @@ · 35 unmodified lines
12421232
12431233 usb_1_ssphy: usb3-phy@8903400 {
12441234 reg = <0 0x08903400 0 0x100>,
1245− <0 0x08903c00 0 0x3ec>,
1246− <0 0x08904400 0 0x1f0>,
1235+ <0 0x08903600 0 0x3ec>,
1236+ <0 0x08904400 0 0x364>,
12471237 <0 0x08903a00 0 0x100>,
12481238 <0 0x08903c00 0 0x3ec>,
12491239 <0 0x08904200 0 0x18>;
@@ -1253,16 +1243,6 @@ · 3 unmodified lines
12531243 clock-names = "pipe0";
12541244 clock-output-names = "usb1_phy_pipe_clk_src";
12551245 };
1256−
1257− usb_1_dpphy: dp-phy@8904200 {
1258− reg = <0 0x08904200 0 0x200>,
1259− <0 0x08904400 0 0x200>,
1260− <0 0x08904a00 0 0x200>,
1261− <0 0x08904600 0 0x200>,
1262− <0 0x08904800 0 0x200>;
1263− #clock-cells = <1>;
1264− #phy-cells = <0>;
1265− };
12661246 };
12671247
12681248 system-cache-controller@9200000 {
arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi+6−0
@@ -348,6 +348,9 @@ · 347 unmodified lines
348348 regulator-max-microvolt = <2960000>;
349349 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
350350 regulator-allow-set-load;
351+ regulator-allowed-modes =
352+ <RPMH_REGULATOR_MODE_LPM
353+ RPMH_REGULATOR_MODE_HPM>;
351354 };
352355
353356 vreg_l7c_3p0: ldo7 {
@@ -367,6 +370,9 @@ · 13 unmodified lines
367370 regulator-max-microvolt = <2960000>;
368371 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
369372 regulator-allow-set-load;
373+ regulator-allowed-modes =
374+ <RPMH_REGULATOR_MODE_LPM
375+ RPMH_REGULATOR_MODE_HPM>;
370376 };
371377
372378 vreg_l10c_3p3: ldo10 {
arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi+6−0
@@ -317,6 +317,9 @@ · 316 unmodified lines
317317 regulator-max-microvolt = <2960000>;
318318 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
319319 regulator-allow-set-load;
320+ regulator-allowed-modes =
321+ <RPMH_REGULATOR_MODE_LPM
322+ RPMH_REGULATOR_MODE_HPM>;
320323 };
321324
322325 vreg_l7c_2p85: ldo7 {
@@ -339,6 +342,9 @@ · 16 unmodified lines
339342 regulator-max-microvolt = <2960000>;
340343 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
341344 regulator-allow-set-load;
345+ regulator-allowed-modes =
346+ <RPMH_REGULATOR_MODE_LPM
347+ RPMH_REGULATOR_MODE_HPM>;
342348 };
343349
344350 vreg_l10c_3p3: ldo10 {
arch/arm64/boot/dts/qcom/sm8250.dtsi+1−0
@@ -334,6 +334,7 @@ · 333 unmodified lines
334334 exit-latency-us = <6562>;
335335 min-residency-us = <9987>;
336336 local-timer-stop;
337+ status = "disabled";
337338 };
338339 };
339340 };
arch/arm64/boot/dts/qcom/sm8350-hdk.dts+12−0
@@ -107,6 +107,9 @@ · 106 unmodified lines
107107 regulator-max-microvolt = <888000>;
108108 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
109109 regulator-allow-set-load;
110+ regulator-allowed-modes =
111+ <RPMH_REGULATOR_MODE_LPM
112+ RPMH_REGULATOR_MODE_HPM>;
110113 };
111114
112115 vreg_l6b_1p2: ldo6 {
@@ -115,6 +118,9 @@ · 2 unmodified lines
115118 regulator-max-microvolt = <1208000>;
116119 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
117120 regulator-allow-set-load;
121+ regulator-allowed-modes =
122+ <RPMH_REGULATOR_MODE_LPM
123+ RPMH_REGULATOR_MODE_HPM>;
118124 };
119125
120126 vreg_l7b_2p96: ldo7 {
@@ -123,6 +129,9 @@ · 2 unmodified lines
123129 regulator-max-microvolt = <2504000>;
124130 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
125131 regulator-allow-set-load;
132+ regulator-allowed-modes =
133+ <RPMH_REGULATOR_MODE_LPM
134+ RPMH_REGULATOR_MODE_HPM>;
126135 };
127136
128137 vreg_l9b_1p2: ldo9 {
@@ -131,6 +140,9 @@ · 2 unmodified lines
131140 regulator-max-microvolt = <1200000>;
132141 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
133142 regulator-allow-set-load;
143+ regulator-allowed-modes =
144+ <RPMH_REGULATOR_MODE_LPM
145+ RPMH_REGULATOR_MODE_HPM>;
134146 };
135147 };
136148
arch/arm64/boot/dts/rockchip/px30-evb.dts+5−5
@@ -30,31 +30,31 @@ · 29 unmodified lines
3030 keyup-threshold-microvolt = <1800000>;
3131 poll-interval = <100>;
3232
33− esc-key {
33+ button-esc {
3434 label = "esc";
3535 linux,code = <KEY_ESC>;
3636 press-threshold-microvolt = <1310000>;
3737 };
3838
39− home-key {
39+ button-home {
4040 label = "home";
4141 linux,code = <KEY_HOME>;
4242 press-threshold-microvolt = <624000>;
4343 };
4444
45− menu-key {
45+ button-menu {
4646 label = "menu";
4747 linux,code = <KEY_MENU>;
4848 press-threshold-microvolt = <987000>;
4949 };
5050
51− vol-down-key {
51+ button-down {
5252 label = "volume down";
5353 linux,code = <KEY_VOLUMEDOWN>;
5454 press-threshold-microvolt = <300000>;
5555 };
5656
57− vol-up-key {
57+ button-up {
5858 label = "volume up";
5959 linux,code = <KEY_VOLUMEUP>;
6060 press-threshold-microvolt = <17000>;
arch/arm64/boot/dts/rockchip/rk3308-evb.dts+6−6
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 poll-interval = <100>;
2424 keyup-threshold-microvolt = <1800000>;
2525
26− func-key {
26+ button-func {
2727 linux,code = <KEY_FN>;
2828 label = "function";
2929 press-threshold-microvolt = <18000>;
@@ -37,31 +37,31 @@ · 7 unmodified lines
3737 poll-interval = <100>;
3838 keyup-threshold-microvolt = <1800000>;
3939
40− esc-key {
40+ button-esc {
4141 linux,code = <KEY_MICMUTE>;
4242 label = "micmute";
4343 press-threshold-microvolt = <1130000>;
4444 };
4545
46− home-key {
46+ button-home {
4747 linux,code = <KEY_MODE>;
4848 label = "mode";
4949 press-threshold-microvolt = <901000>;
5050 };
5151
52− menu-key {
52+ button-menu {
5353 linux,code = <KEY_PLAY>;
5454 label = "play";
5555 press-threshold-microvolt = <624000>;
5656 };
5757
58− vol-down-key {
58+ button-down {
5959 linux,code = <KEY_VOLUMEDOWN>;
6060 label = "volume down";
6161 press-threshold-microvolt = <300000>;
6262 };
6363
64− vol-up-key {
64+ button-up {
6565 linux,code = <KEY_VOLUMEUP>;
6666 label = "volume up";
6767 press-threshold-microvolt = <18000>;
arch/arm64/boot/dts/rockchip/rk3308-roc-cc.dts+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 stdout-path = "serial2:1500000n8";
2020 };
2121
22− ir_rx {
22+ ir-receiver {
2323 compatible = "gpio-ir-receiver";
2424 gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>;
2525 pinctrl-names = "default";
arch/arm64/boot/dts/rockchip/rk3318-a95x-z2.dts+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 keyup-threshold-microvolt = <1800000>;
2626 poll-interval = <100>;
2727
28− recovery {
28+ button-recovery {
2929 label = "recovery";
3030 linux,code = <KEY_VENDOR>;
3131 press-threshold-microvolt = <17000>;
arch/arm64/boot/dts/rockchip/rk3368-orion-r68-meta.dts+1−2
@@ -208,11 +208,10 @@ · 207 unmodified lines
208208 vin-supply = <&vcc_sys>;
209209 };
210210
211− hym8563: hym8563@51 {
211+ hym8563: rtc@51 {
212212 compatible = "haoyu,hym8563";
213213 reg = <0x51>;
214214 #clock-cells = <0>;
215− clock-frequency = <32768>;
216215 clock-output-names = "xin32k";
217216 /* rtc_int is not connected */
218217 };
arch/arm64/boot/dts/rockchip/rk3368-r88.dts+1−2
@@ -192,11 +192,10 @@ · 191 unmodified lines
192192 vin-supply = <&vcc_sys>;
193193 };
194194
195− hym8563: hym8563@51 {
195+ hym8563: rtc@51 {
196196 compatible = "haoyu,hym8563";
197197 reg = <0x51>;
198198 #clock-cells = <0>;
199− clock-frequency = <32768>;
200199 clock-output-names = "xin32k";
201200 /* rtc_int is not connected */
202201 };
arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi+0−4
@@ -734,10 +734,6 @@ camera: &i2c7 { · 733 unmodified lines
734734 };
735735
736736 /* PINCTRL OVERRIDES */
737−&ec_ap_int_l {
738− rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_up>;
739−};
740−
741737 &ap_fw_wp {
742738 rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
743739 };
arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi+1−1
@@ -123,7 +123,7 @@ · 122 unmodified lines
123123 keyup-threshold-microvolt = <1800000>;
124124 poll-interval = <100>;
125125
126− recovery {
126+ button-recovery {
127127 label = "Recovery";
128128 linux,code = <KEY_VENDOR>;
129129 press-threshold-microvolt = <18000>;
arch/arm64/boot/dts/rockchip/rk3399-nanopc-t4.dts+1−1
@@ -39,7 +39,7 @@ · 38 unmodified lines
3939 keyup-threshold-microvolt = <1800000>;
4040 poll-interval = <100>;
4141
42− recovery {
42+ button-recovery {
4343 label = "Recovery";
4444 linux,code = <KEY_VENDOR>;
4545 press-threshold-microvolt = <18000>;
arch/arm64/boot/dts/rockchip/rk3399-nanopi-m4b.dts+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 keyup-threshold-microvolt = <1500000>;
2020 poll-interval = <100>;
2121
22− recovery {
22+ button-recovery {
2323 label = "Recovery";
2424 linux,code = <KEY_VENDOR>;
2525 press-threshold-microvolt = <18000>;
arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi+1−0
@@ -167,6 +167,7 @@ · 166 unmodified lines
167167 };
168168
169169 &emmc_phy {
170+ rockchip,enable-strobe-pulldown;
170171 status = "okay";
171172 };
172173
arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts+2−2
@@ -52,13 +52,13 @@ · 51 unmodified lines
5252 press-threshold-microvolt = <300000>;
5353 };
5454
55− back {
55+ button-back {
5656 label = "Back";
5757 linux,code = <KEY_BACK>;
5858 press-threshold-microvolt = <985000>;
5959 };
6060
61− menu {
61+ button-menu {
6262 label = "Menu";
6363 linux,code = <KEY_MENU>;
6464 press-threshold-microvolt = <1314000>;
arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts+1−1
@@ -207,7 +207,7 @@ · 206 unmodified lines
207207 cap-sd-highspeed;
208208 cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
209209 disable-wp;
210− max-frequency = <150000000>;
210+ max-frequency = <40000000>;
211211 pinctrl-names = "default";
212212 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
213213 vmmc-supply = <&vcc3v3_baseboard>;
arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts+1−2
@@ -98,13 +98,12 @@ · 97 unmodified lines
9898 };
9999
100100 &i2c0 {
101− hym8563: hym8563@51 {
101+ hym8563: rtc@51 {
102102 compatible = "haoyu,hym8563";
103103 reg = <0x51>;
104104 interrupt-parent = <&gpio0>;
105105 interrupts = <RK_PA5 IRQ_TYPE_EDGE_FALLING>;
106106 #clock-cells = <0>;
107− clock-frequency = <32768>;
108107 clock-output-names = "xin32k";
109108 pinctrl-names = "default";
110109 pinctrl-0 = <&hym8563_int>;
arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi+1−1
@@ -41,7 +41,7 @@ · 40 unmodified lines
4141 keyup-threshold-microvolt = <1500000>;
4242 poll-interval = <100>;
4343
44− recovery {
44+ button-recovery {
4545 label = "Recovery";
4646 linux,code = <KEY_VENDOR>;
4747 press-threshold-microvolt = <18000>;
arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi+0−1
@@ -509,7 +509,6 @@ · 508 unmodified lines
509509 &i2s1 {
510510 rockchip,playback-channels = <2>;
511511 rockchip,capture-channels = <2>;
512− status = "okay";
513512 };
514513
515514 &i2s2 {
arch/arm64/boot/dts/rockchip/rk3399-sapphire-excavator.dts+2−2
@@ -33,13 +33,13 @@ · 32 unmodified lines
3333 press-threshold-microvolt = <300000>;
3434 };
3535
36− back {
36+ button-back {
3737 label = "Back";
3838 linux,code = <KEY_BACK>;
3939 press-threshold-microvolt = <985000>;
4040 };
4141
42− menu {
42+ button-menu {
4343 label = "Menu";
4444 linux,code = <KEY_MENU>;
4545 press-threshold-microvolt = <1314000>;
arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi+1−2
@@ -297,11 +297,10 @@ · 296 unmodified lines
297297 clock-frequency = <400000>;
298298 status = "okay";
299299
300− hym8563: hym8563@51 {
300+ hym8563: rtc@51 {
301301 compatible = "haoyu,hym8563";
302302 reg = <0x51>;
303303 #clock-cells = <0>;
304− clock-frequency = <32768>;
305304 clock-output-names = "hym8563";
306305 pinctrl-names = "default";
307306 pinctrl-0 = <&hym8563_int>;
arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtsi+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 io-channel-names = "buttons";
2424 keyup-threshold-microvolt = <1750000>;
2525
26− recovery {
26+ button-recovery {
2727 label = "recovery";
2828 linux,code = <KEY_VENDOR>;
2929 press-threshold-microvolt = <0>;
arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts+4−3
@@ -740,7 +740,7 @@ · 739 unmodified lines
740740
741741 &uart1 {
742742 pinctrl-names = "default";
743− pinctrl-0 = <&uart1m0_xfer &uart1m0_ctsn>;
743+ pinctrl-0 = <&uart1m0_xfer &uart1m0_ctsn &uart1m0_rtsn>;
744744 status = "okay";
745745 uart-has-rtscts;
746746
@@ -748,13 +748,14 @@ · 1 unmodified line
748748 compatible = "brcm,bcm43438-bt";
749749 clocks = <&rk817 1>;
750750 clock-names = "lpo";
751− device-wakeup-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>;
752− host-wakeup-gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_HIGH>;
751+ host-wakeup-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>;
752+ device-wakeup-gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_HIGH>;
753753 shutdown-gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>;
754754 pinctrl-names = "default";
755755 pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>;
756756 vbat-supply = <&vcc_sys>;
757757 vddio-supply = <&vcca1v8_pmu>;
758+ max-speed = <3000000>;
758759 };
759760 };
760761
arch/arm64/boot/dts/rockchip/rk3566-quartz64-b.dts+1−1
@@ -246,7 +246,7 @@ · 245 unmodified lines
246246 compatible = "rockchip,rk809";
247247 reg = <0x20>;
248248 interrupt-parent = <&gpio0>;
249− interrupts = <RK_PA7 IRQ_TYPE_LEVEL_LOW>;
249+ interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
250250 assigned-clocks = <&cru I2S1_MCLKOUT_TX>;
251251 assigned-clock-parents = <&cru CLK_I2S1_8CH_TX>;
252252 clock-names = "mclk";
arch/arm64/boot/dts/rockchip/rk3566-roc-pc.dts+2−6
@@ -142,7 +142,7 @@ · 141 unmodified lines
142142 assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru SCLK_GMAC1>;
143143 assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru SCLK_GMAC1>, <&gmac1_clkin>;
144144 clock_in_out = "input";
145− phy-mode = "rgmii-id";
145+ phy-mode = "rgmii";
146146 phy-supply = <&vcc_3v3>;
147147 pinctrl-names = "default";
148148 pinctrl-0 = <&gmac1m0_miim
@@ -432,11 +432,7 @@ · 283 unmodified lines
432432
433433 &i2c3 {
434434 pinctrl-names = "default";
435− pinctrl-0 = <&i2c3m1_xfer>;
436− status = "okay";
437−};
438−
439−&i2c5 {
435+ pinctrl-0 = <&i2c3m0_xfer>;
440436 status = "okay";
441437 };
442438
arch/arm64/boot/dts/rockchip/rk3568-bpi-r2-pro.dts+0−1
@@ -500,7 +500,6 @@ · 499 unmodified lines
500500 interrupt-parent = <&gpio0>;
501501 interrupts = <RK_PD3 IRQ_TYPE_EDGE_FALLING>;
502502 #clock-cells = <0>;
503− clock-frequency = <32768>;
504503 clock-output-names = "rtcic_32kout";
505504 pinctrl-names = "default";
506505 pinctrl-0 = <&hym8563_int>;
arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts+0−1
@@ -509,7 +509,6 @@ · 508 unmodified lines
509509 interrupt-parent = <&gpio0>;
510510 interrupts = <RK_PD3 IRQ_TYPE_LEVEL_LOW>;
511511 #clock-cells = <0>;
512− clock-frequency = <32768>;
513512 clock-output-names = "rtcic_32kout";
514513 pinctrl-names = "default";
515514 pinctrl-0 = <&hym8563_int>;
arch/arm64/include/asm/cputype.h+1−1
@@ -41,7 +41,7 @@ · 40 unmodified lines
4141 (((midr) & MIDR_IMPLEMENTOR_MASK) >> MIDR_IMPLEMENTOR_SHIFT)
4242
4343 #define MIDR_CPU_MODEL(imp, partnum) \
44− (((imp) << MIDR_IMPLEMENTOR_SHIFT) | \
44+ ((_AT(u32, imp) << MIDR_IMPLEMENTOR_SHIFT) | \
4545 (0xf << MIDR_ARCHITECTURE_SHIFT) | \
4646 ((partnum) << MIDR_PARTNUM_SHIFT))
4747
arch/arm64/include/asm/pgtable.h+2−2
@@ -863,12 +863,12 @@ static inline bool pte_user_accessible_page(pte_t pte) · 862 unmodified lines
863863
864864 static inline bool pmd_user_accessible_page(pmd_t pmd)
865865 {
866− return pmd_present(pmd) && (pmd_user(pmd) || pmd_user_exec(pmd));
866+ return pmd_leaf(pmd) && (pmd_user(pmd) || pmd_user_exec(pmd));
867867 }
868868
869869 static inline bool pud_user_accessible_page(pud_t pud)
870870 {
871− return pud_present(pud) && pud_user(pud);
871+ return pud_leaf(pud) && pud_user(pud);
872872 }
873873 #endif
874874
arch/arm64/include/asm/syscall_wrapper.h+1−1
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 #ifndef __ASM_SYSCALL_WRAPPER_H
99 #define __ASM_SYSCALL_WRAPPER_H
1010
11−struct pt_regs;
11+#include <asm/ptrace.h>
1212
1313 #define SC_ARM64_REGS_TO_ARGS(x, ...) \
1414 __MAP(x,__SC_ARGS \
arch/arm64/kernel/cpufeature.c+33−9
@@ -428,6 +428,30 @@ static const struct arm64_ftr_bits ftr_id_aa64dfr0[] = { · 427 unmodified lines
428428 ARM64_FTR_END,
429429 };
430430
431+static const struct arm64_ftr_bits ftr_mvfr0[] = {
432+ ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, MVFR0_FPROUND_SHIFT, 4, 0),
433+ ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, MVFR0_FPSHVEC_SHIFT, 4, 0),
434+ ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, MVFR0_FPSQRT_SHIFT, 4, 0),
435+ ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, MVFR0_FPDIVIDE_SHIFT, 4, 0),
436+ ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, MVFR0_FPTRAP_SHIFT, 4, 0),
437+ ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, MVFR0_FPDP_SHIFT, 4, 0),
438+ ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, MVFR0_FPSP_SHIFT, 4, 0),
439+ ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, MVFR0_SIMD_SHIFT, 4, 0),
440+ ARM64_FTR_END,
441+};
442+
443+static const struct arm64_ftr_bits ftr_mvfr1[] = {
444+ ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, MVFR1_SIMDFMAC_SHIFT, 4, 0),
445+ ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, MVFR1_FPHP_SHIFT, 4, 0),
446+ ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, MVFR1_SIMDHP_SHIFT, 4, 0),
447+ ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, MVFR1_SIMDSP_SHIFT, 4, 0),
448+ ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, MVFR1_SIMDINT_SHIFT, 4, 0),
449+ ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, MVFR1_SIMDLS_SHIFT, 4, 0),
450+ ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, MVFR1_FPDNAN_SHIFT, 4, 0),
451+ ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, MVFR1_FPFTZ_SHIFT, 4, 0),
452+ ARM64_FTR_END,
453+};
454+
431455 static const struct arm64_ftr_bits ftr_mvfr2[] = {
432456 ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, MVFR2_FPMISC_SHIFT, 4, 0),
433457 ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, MVFR2_SIMDMISC_SHIFT, 4, 0),
@@ -458,10 +482,10 @@ static const struct arm64_ftr_bits ftr_id_isar0[] = { · 24 unmodified lines
458482
459483 static const struct arm64_ftr_bits ftr_id_isar5[] = {
460484 ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR5_RDM_SHIFT, 4, 0),
461− ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR5_CRC32_SHIFT, 4, 0),
462− ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR5_SHA2_SHIFT, 4, 0),
463− ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR5_SHA1_SHIFT, 4, 0),
464− ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR5_AES_SHIFT, 4, 0),
485+ ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR5_CRC32_SHIFT, 4, 0),
486+ ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR5_SHA2_SHIFT, 4, 0),
487+ ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR5_SHA1_SHIFT, 4, 0),
488+ ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR5_AES_SHIFT, 4, 0),
465489 ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR5_SEVL_SHIFT, 4, 0),
466490 ARM64_FTR_END,
467491 };
@@ -574,7 +598,7 @@ static const struct arm64_ftr_bits ftr_smcr[] = { · 106 unmodified lines
574598 * Common ftr bits for a 32bit register with all hidden, strict
575599 * attributes, with 4bit feature fields and a default safe value of
576600 * 0. Covers the following 32bit registers:
577− * id_isar[1-4], id_mmfr[1-3], id_pfr1, mvfr[0-1]
601+ * id_isar[1-3], id_mmfr[1-3]
578602 */
579603 static const struct arm64_ftr_bits ftr_generic_32bits[] = {
580604 ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, 28, 4, 0),
@@ -645,8 +669,8 @@ static const struct __ftr_reg_entry { · 64 unmodified lines
645669 ARM64_FTR_REG(SYS_ID_ISAR6_EL1, ftr_id_isar6),
646670
647671 /* Op1 = 0, CRn = 0, CRm = 3 */
648− ARM64_FTR_REG(SYS_MVFR0_EL1, ftr_generic_32bits),
649− ARM64_FTR_REG(SYS_MVFR1_EL1, ftr_generic_32bits),
672+ ARM64_FTR_REG(SYS_MVFR0_EL1, ftr_mvfr0),
673+ ARM64_FTR_REG(SYS_MVFR1_EL1, ftr_mvfr1),
650674 ARM64_FTR_REG(SYS_MVFR2_EL1, ftr_mvfr2),
651675 ARM64_FTR_REG(SYS_ID_PFR2_EL1, ftr_id_pfr2),
652676 ARM64_FTR_REG(SYS_ID_DFR1_EL1, ftr_id_dfr1),
@@ -3339,7 +3363,7 @@ static void __maybe_unused cpu_enable_cnp(struct arm64_cpu_capabilities const *c · 2686 unmodified lines
33393363
33403364 /*
33413365 * We emulate only the following system register space.
3342− * Op0 = 0x3, CRn = 0x0, Op1 = 0x0, CRm = [0, 4 - 7]
3366+ * Op0 = 0x3, CRn = 0x0, Op1 = 0x0, CRm = [0, 2 - 7]
33433367 * See Table C5-6 System instruction encodings for System register accesses,
33443368 * ARMv8 ARM(ARM DDI 0487A.f) for more details.
33453369 */
@@ -3349,7 +3373,7 @@ static inline bool __attribute_const__ is_emulated(u32 id) · 3 unmodified lines
33493373 sys_reg_CRn(id) == 0x0 &&
33503374 sys_reg_Op1(id) == 0x0 &&
33513375 (sys_reg_CRm(id) == 0 ||
3352− ((sys_reg_CRm(id) >= 4) && (sys_reg_CRm(id) <= 7))));
3376+ ((sys_reg_CRm(id) >= 2) && (sys_reg_CRm(id) <= 7))));
33533377 }
33543378
33553379 /*
arch/arm64/kernel/efi.c+34−18
@@ -12,6 +12,14 @@ · 11 unmodified lines
1212
1313 #include <asm/efi.h>
1414
15+static bool region_is_misaligned(const efi_memory_desc_t *md)
16+{
17+ if (PAGE_SIZE == EFI_PAGE_SIZE)
18+ return false;
19+ return !PAGE_ALIGNED(md->phys_addr) ||
20+ !PAGE_ALIGNED(md->num_pages << EFI_PAGE_SHIFT);
21+}
22+
1523 /*
1624 * Only regions of type EFI_RUNTIME_SERVICES_CODE need to be
1725 * executable, everything else can be mapped with the XN bits
@@ -25,14 +33,22 @@ static __init pteval_t create_mapping_protection(efi_memory_desc_t *md) · 7 unmodified lines
2533 if (type == EFI_MEMORY_MAPPED_IO)
2634 return PROT_DEVICE_nGnRE;
2735
28− if (WARN_ONCE(!PAGE_ALIGNED(md->phys_addr),
29− "UEFI Runtime regions are not aligned to 64 KB -- buggy firmware?"))
36+ if (region_is_misaligned(md)) {
37+ static bool __initdata code_is_misaligned;
38+
3039 /*
31− * If the region is not aligned to the page size of the OS, we
32− * can not use strict permissions, since that would also affect
33− * the mapping attributes of the adjacent regions.
40+ * Regions that are not aligned to the OS page size cannot be
41+ * mapped with strict permissions, as those might interfere
42+ * with the permissions that are needed by the adjacent
43+ * region's mapping. However, if we haven't encountered any
44+ * misaligned runtime code regions so far, we can safely use
45+ * non-executable permissions for non-code regions.
3446 */
35− return pgprot_val(PAGE_KERNEL_EXEC);
47+ code_is_misaligned |= (type == EFI_RUNTIME_SERVICES_CODE);
48+
49+ return code_is_misaligned ? pgprot_val(PAGE_KERNEL_EXEC)
50+ : pgprot_val(PAGE_KERNEL);
51+ }
3652
3753 /* R-- */
3854 if ((attr & (EFI_MEMORY_XP | EFI_MEMORY_RO)) ==
@@ -63,19 +79,16 @@ int __init efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md) · 24 unmodified lines
6379 bool page_mappings_only = (md->type == EFI_RUNTIME_SERVICES_CODE ||
6480 md->type == EFI_RUNTIME_SERVICES_DATA);
6581
66− if (!PAGE_ALIGNED(md->phys_addr) ||
67− !PAGE_ALIGNED(md->num_pages << EFI_PAGE_SHIFT)) {
68− /*
69− * If the end address of this region is not aligned to page
70− * size, the mapping is rounded up, and may end up sharing a
71− * page frame with the next UEFI memory region. If we create
72− * a block entry now, we may need to split it again when mapping
73− * the next region, and support for that is going to be removed
74− * from the MMU routines. So avoid block mappings altogether in
75− * that case.
76− */
82+ /*
83+ * If this region is not aligned to the page size used by the OS, the
84+ * mapping will be rounded outwards, and may end up sharing a page
85+ * frame with an adjacent runtime memory region. Given that the page
86+ * table descriptor covering the shared page will be rewritten when the
87+ * adjacent region gets mapped, we must avoid block mappings here so we
88+ * don't have to worry about splitting them when that happens.
89+ */
90+ if (region_is_misaligned(md))
7791 page_mappings_only = true;
78− }
7992
8093 create_pgd_mapping(mm, md->phys_addr, md->virt_addr,
8194 md->num_pages << EFI_PAGE_SHIFT,
@@ -102,6 +115,9 @@ int __init efi_set_mapping_permissions(struct mm_struct *mm, · 20 unmodified lines
102115 BUG_ON(md->type != EFI_RUNTIME_SERVICES_CODE &&
103116 md->type != EFI_RUNTIME_SERVICES_DATA);
104117
118+ if (region_is_misaligned(md))
119+ return 0;
120+
105121 /*
106122 * Calling apply_to_page_range() is only safe on regions that are
107123 * guaranteed to be mapped down to pages. Since we are only called
arch/arm64/kernel/entry-common.c+2−1
@@ -329,7 +329,8 @@ static void cortex_a76_erratum_1463225_svc_handler(void) · 328 unmodified lines
329329 __this_cpu_write(__in_cortex_a76_erratum_1463225_wa, 0);
330330 }
331331
332−static bool cortex_a76_erratum_1463225_debug_handler(struct pt_regs *regs)
332+static __always_inline bool
333+cortex_a76_erratum_1463225_debug_handler(struct pt_regs *regs)
333334 {
334335 if (!__this_cpu_read(__in_cortex_a76_erratum_1463225_wa))
335336 return false;
arch/arm64/kernel/entry-ftrace.S+1−1
@@ -299,11 +299,11 @@ SYM_TYPED_FUNC_START(ftrace_stub) · 298 unmodified lines
299299 ret
300300 SYM_FUNC_END(ftrace_stub)
301301
302+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
302303 SYM_TYPED_FUNC_START(ftrace_stub_graph)
303304 ret
304305 SYM_FUNC_END(ftrace_stub_graph)
305306
306−#ifdef CONFIG_FUNCTION_GRAPH_TRACER
307307 /*
308308 * void return_to_handler(void)
309309 *
arch/arm64/kvm/hyp/exception.c+2−1
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include <hyp/adjust_pc.h>
1414 #include <linux/kvm_host.h>
1515 #include <asm/kvm_emulate.h>
16+#include <asm/kvm_mmu.h>
1617
1718 #if !defined (__KVM_NVHE_HYPERVISOR__) && !defined (__KVM_VHE_HYPERVISOR__)
1819 #error Hypervisor code only!
@@ -115,7 +116,7 @@ static void enter_exception64(struct kvm_vcpu *vcpu, unsigned long target_mode, · 96 unmodified lines
115116 new |= (old & PSR_C_BIT);
116117 new |= (old & PSR_V_BIT);
117118
118− if (kvm_has_mte(vcpu->kvm))
119+ if (kvm_has_mte(kern_hyp_va(vcpu->kvm)))
119120 new |= PSR_TCO_BIT;
120121
121122 new |= (old & PSR_DIT_BIT);
arch/arm64/kvm/hyp/include/hyp/switch.h+20−0
@@ -87,6 +87,17 @@ static inline void __activate_traps_common(struct kvm_vcpu *vcpu) · 86 unmodified lines
8787
8888 vcpu->arch.mdcr_el2_host = read_sysreg(mdcr_el2);
8989 write_sysreg(vcpu->arch.mdcr_el2, mdcr_el2);
90+
91+ if (cpus_have_final_cap(ARM64_SME)) {
92+ sysreg_clear_set_s(SYS_HFGRTR_EL2,
93+ HFGxTR_EL2_nSMPRI_EL1_MASK |
94+ HFGxTR_EL2_nTPIDR2_EL0_MASK,
95+ 0);
96+ sysreg_clear_set_s(SYS_HFGWTR_EL2,
97+ HFGxTR_EL2_nSMPRI_EL1_MASK |
98+ HFGxTR_EL2_nTPIDR2_EL0_MASK,
99+ 0);
100+ }
90101 }
91102
92103 static inline void __deactivate_traps_common(struct kvm_vcpu *vcpu)
@@ -96,6 +107,15 @@ static inline void __deactivate_traps_common(struct kvm_vcpu *vcpu) · 3 unmodified lines
96107 write_sysreg(0, hstr_el2);
97108 if (kvm_arm_support_pmu_v3())
98109 write_sysreg(0, pmuserenr_el0);
110+
111+ if (cpus_have_final_cap(ARM64_SME)) {
112+ sysreg_clear_set_s(SYS_HFGRTR_EL2, 0,
113+ HFGxTR_EL2_nSMPRI_EL1_MASK |
114+ HFGxTR_EL2_nTPIDR2_EL0_MASK);
115+ sysreg_clear_set_s(SYS_HFGWTR_EL2, 0,
116+ HFGxTR_EL2_nSMPRI_EL1_MASK |
117+ HFGxTR_EL2_nTPIDR2_EL0_MASK);
118+ }
99119 }
100120
101121 static inline void ___activate_traps(struct kvm_vcpu *vcpu)
arch/arm64/kvm/hyp/nvhe/mem_protect.c+1−1
@@ -516,7 +516,7 @@ static enum pkvm_page_state hyp_get_page_state(kvm_pte_t pte) · 515 unmodified lines
516516 if (!kvm_pte_valid(pte))
517517 return PKVM_NOPAGE;
518518
519− return pkvm_getstate(kvm_pgtable_stage2_pte_prot(pte));
519+ return pkvm_getstate(kvm_pgtable_hyp_pte_prot(pte));
520520 }
521521
522522 static int __hyp_check_page_state_range(u64 addr, u64 size,
arch/arm64/kvm/hyp/nvhe/switch.c+0−26
@@ -55,18 +55,6 @@ static void __activate_traps(struct kvm_vcpu *vcpu) · 54 unmodified lines
5555 write_sysreg(val, cptr_el2);
5656 write_sysreg(__this_cpu_read(kvm_hyp_vector), vbar_el2);
5757
58− if (cpus_have_final_cap(ARM64_SME)) {
59− val = read_sysreg_s(SYS_HFGRTR_EL2);
60− val &= ~(HFGxTR_EL2_nTPIDR2_EL0_MASK |
61− HFGxTR_EL2_nSMPRI_EL1_MASK);
62− write_sysreg_s(val, SYS_HFGRTR_EL2);
63−
64− val = read_sysreg_s(SYS_HFGWTR_EL2);
65− val &= ~(HFGxTR_EL2_nTPIDR2_EL0_MASK |
66− HFGxTR_EL2_nSMPRI_EL1_MASK);
67− write_sysreg_s(val, SYS_HFGWTR_EL2);
68− }
69−
7058 if (cpus_have_final_cap(ARM64_WORKAROUND_SPECULATIVE_AT)) {
7159 struct kvm_cpu_context *ctxt = &vcpu->arch.ctxt;
7260
@@ -110,20 +98,6 @@ static void __deactivate_traps(struct kvm_vcpu *vcpu) · 37 unmodified lines
11098
11199 write_sysreg(this_cpu_ptr(&kvm_init_params)->hcr_el2, hcr_el2);
112100
113− if (cpus_have_final_cap(ARM64_SME)) {
114− u64 val;
115−
116− val = read_sysreg_s(SYS_HFGRTR_EL2);
117− val |= HFGxTR_EL2_nTPIDR2_EL0_MASK |
118− HFGxTR_EL2_nSMPRI_EL1_MASK;
119− write_sysreg_s(val, SYS_HFGRTR_EL2);
120−
121− val = read_sysreg_s(SYS_HFGWTR_EL2);
122− val |= HFGxTR_EL2_nTPIDR2_EL0_MASK |
123− HFGxTR_EL2_nSMPRI_EL1_MASK;
124− write_sysreg_s(val, SYS_HFGWTR_EL2);
125− }
126−
127101 cptr = CPTR_EL2_DEFAULT;
128102 if (vcpu_has_sve(vcpu) && (vcpu->arch.fp_state == FP_STATE_GUEST_OWNED))
129103 cptr |= CPTR_EL2_TZ;
arch/arm64/kvm/hyp/vhe/switch.c+0−8
@@ -63,10 +63,6 @@ static void __activate_traps(struct kvm_vcpu *vcpu) · 62 unmodified lines
6363 __activate_traps_fpsimd32(vcpu);
6464 }
6565
66− if (cpus_have_final_cap(ARM64_SME))
67− write_sysreg(read_sysreg(sctlr_el2) & ~SCTLR_ELx_ENTP2,
68− sctlr_el2);
69−
7066 write_sysreg(val, cpacr_el1);
7167
7268 write_sysreg(__this_cpu_read(kvm_hyp_vector), vbar_el1);
@@ -88,10 +84,6 @@ static void __deactivate_traps(struct kvm_vcpu *vcpu) · 15 unmodified lines
8884 */
8985 asm(ALTERNATIVE("nop", "isb", ARM64_WORKAROUND_SPECULATIVE_AT));
9086
91− if (cpus_have_final_cap(ARM64_SME))
92− write_sysreg(read_sysreg(sctlr_el2) | SCTLR_ELx_ENTP2,
93− sctlr_el2);
94−
9587 write_sysreg(CPACR_EL1_DEFAULT, cpacr_el1);
9688
9789 if (!arm64_kernel_unmapped_at_el0())
arch/arm64/mm/pageattr.c+3−2
@@ -26,7 +26,7 @@ bool can_set_direct_map(void) · 25 unmodified lines
2626 * mapped at page granularity, so that it is possible to
2727 * protect/unprotect single pages.
2828 */
29− return rodata_full || debug_pagealloc_enabled() ||
29+ return (rodata_enabled && rodata_full) || debug_pagealloc_enabled() ||
3030 IS_ENABLED(CONFIG_KFENCE);
3131 }
3232
@@ -102,7 +102,8 @@ static int change_memory_common(unsigned long addr, int numpages, · 69 unmodified lines
102102 * If we are manipulating read-only permissions, apply the same
103103 * change to the linear mapping of the pages that back this VM area.
104104 */
105− if (rodata_full && (pgprot_val(set_mask) == PTE_RDONLY ||
105+ if (rodata_enabled &&
106+ rodata_full && (pgprot_val(set_mask) == PTE_RDONLY ||
106107 pgprot_val(clear_mask) == PTE_RDONLY)) {
107108 for (i = 0; i < area->nr_pages; i++) {
108109 __change_memory_common((u64)page_address(area->pages[i]),
arch/loongarch/Makefile+1−1
@@ -97,7 +97,7 @@ KBUILD_LDFLAGS += -m $(ld-emul) · 96 unmodified lines
9797
9898 ifdef CONFIG_LOONGARCH
9999 CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \
100− egrep -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \
100+ grep -E -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \
101101 sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e 's/\$$/&&/g')
102102 endif
103103
arch/loongarch/include/asm/irq.h+1−1
@@ -117,7 +117,7 @@ extern struct fwnode_handle *liointc_handle; · 116 unmodified lines
117117 extern struct fwnode_handle *pch_lpc_handle;
118118 extern struct fwnode_handle *pch_pic_handle[MAX_IO_PICS];
119119
120−extern irqreturn_t loongson3_ipi_interrupt(int irq, void *dev);
120+extern irqreturn_t loongson_ipi_interrupt(int irq, void *dev);
121121
122122 #include <asm-generic/irq.h>
123123
arch/loongarch/include/asm/pgtable.h+13−4
@@ -349,13 +349,17 @@ static inline pte_t pte_mkclean(pte_t pte) · 348 unmodified lines
349349
350350 static inline pte_t pte_mkdirty(pte_t pte)
351351 {
352− pte_val(pte) |= (_PAGE_DIRTY | _PAGE_MODIFIED);
352+ pte_val(pte) |= _PAGE_MODIFIED;
353+ if (pte_val(pte) & _PAGE_WRITE)
354+ pte_val(pte) |= _PAGE_DIRTY;
353355 return pte;
354356 }
355357
356358 static inline pte_t pte_mkwrite(pte_t pte)
357359 {
358− pte_val(pte) |= (_PAGE_WRITE | _PAGE_DIRTY);
360+ pte_val(pte) |= _PAGE_WRITE;
361+ if (pte_val(pte) & _PAGE_MODIFIED)
362+ pte_val(pte) |= _PAGE_DIRTY;
359363 return pte;
360364 }
361365
@@ -455,7 +459,9 @@ static inline int pmd_write(pmd_t pmd) · 93 unmodified lines
455459
456460 static inline pmd_t pmd_mkwrite(pmd_t pmd)
457461 {
458− pmd_val(pmd) |= (_PAGE_WRITE | _PAGE_DIRTY);
462+ pmd_val(pmd) |= _PAGE_WRITE;
463+ if (pmd_val(pmd) & _PAGE_MODIFIED)
464+ pmd_val(pmd) |= _PAGE_DIRTY;
459465 return pmd;
460466 }
461467
@@ -478,10 +484,13 @@ static inline pmd_t pmd_mkclean(pmd_t pmd) · 16 unmodified lines
478484
479485 static inline pmd_t pmd_mkdirty(pmd_t pmd)
480486 {
481− pmd_val(pmd) |= (_PAGE_DIRTY | _PAGE_MODIFIED);
487+ pmd_val(pmd) |= _PAGE_MODIFIED;
488+ if (pmd_val(pmd) & _PAGE_WRITE)
489+ pmd_val(pmd) |= _PAGE_DIRTY;
482490 return pmd;
483491 }
484492
493+#define pmd_young pmd_young
485494 static inline int pmd_young(pmd_t pmd)
486495 {
487496 return !!(pmd_val(pmd) & _PAGE_ACCESSED);
arch/loongarch/include/asm/smp.h+15−15
@@ -19,21 +19,21 @@ extern cpumask_t cpu_sibling_map[]; · 18 unmodified lines
1919 extern cpumask_t cpu_core_map[];
2020 extern cpumask_t cpu_foreign_map[];
2121
22−void loongson3_smp_setup(void);
23−void loongson3_prepare_cpus(unsigned int max_cpus);
24−void loongson3_boot_secondary(int cpu, struct task_struct *idle);
25−void loongson3_init_secondary(void);
26−void loongson3_smp_finish(void);
27−void loongson3_send_ipi_single(int cpu, unsigned int action);
28−void loongson3_send_ipi_mask(const struct cpumask *mask, unsigned int action);
22+void loongson_smp_setup(void);
23+void loongson_prepare_cpus(unsigned int max_cpus);
24+void loongson_boot_secondary(int cpu, struct task_struct *idle);
25+void loongson_init_secondary(void);
26+void loongson_smp_finish(void);
27+void loongson_send_ipi_single(int cpu, unsigned int action);
28+void loongson_send_ipi_mask(const struct cpumask *mask, unsigned int action);
2929 #ifdef CONFIG_HOTPLUG_CPU
30−int loongson3_cpu_disable(void);
31−void loongson3_cpu_die(unsigned int cpu);
30+int loongson_cpu_disable(void);
31+void loongson_cpu_die(unsigned int cpu);
3232 #endif
3333
3434 static inline void plat_smp_setup(void)
3535 {
36− loongson3_smp_setup();
36+ loongson_smp_setup();
3737 }
3838
3939 static inline int raw_smp_processor_id(void)
@@ -85,28 +85,28 @@ extern void show_ipi_list(struct seq_file *p, int prec); · 45 unmodified lines
8585 */
8686 static inline void smp_send_reschedule(int cpu)
8787 {
88− loongson3_send_ipi_single(cpu, SMP_RESCHEDULE);
88+ loongson_send_ipi_single(cpu, SMP_RESCHEDULE);
8989 }
9090
9191 static inline void arch_send_call_function_single_ipi(int cpu)
9292 {
93− loongson3_send_ipi_single(cpu, SMP_CALL_FUNCTION);
93+ loongson_send_ipi_single(cpu, SMP_CALL_FUNCTION);
9494 }
9595
9696 static inline void arch_send_call_function_ipi_mask(const struct cpumask *mask)
9797 {
98− loongson3_send_ipi_mask(mask, SMP_CALL_FUNCTION);
98+ loongson_send_ipi_mask(mask, SMP_CALL_FUNCTION);
9999 }
100100
101101 #ifdef CONFIG_HOTPLUG_CPU
102102 static inline int __cpu_disable(void)
103103 {
104− return loongson3_cpu_disable();
104+ return loongson_cpu_disable();
105105 }
106106
107107 static inline void __cpu_die(unsigned int cpu)
108108 {
109− loongson3_cpu_die(cpu);
109+ loongson_cpu_die(cpu);
110110 }
111111
112112 extern void play_dead(void);
arch/loongarch/kernel/acpi.c+10−21
@@ -56,23 +56,6 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) · 55 unmodified lines
5656 return ioremap_cache(phys, size);
5757 }
5858
59−void __init acpi_boot_table_init(void)
60−{
61− /*
62− * If acpi_disabled, bail out
63− */
64− if (acpi_disabled)
65− return;
66−
67− /*
68− * Initialize the ACPI boot-time table parser.
69− */
70− if (acpi_table_init()) {
71− disable_acpi();
72− return;
73− }
74−}
75−
7659 #ifdef CONFIG_SMP
7760 static int set_processor_mask(u32 id, u32 flags)
7861 {
@@ -156,13 +139,21 @@ static void __init acpi_process_madt(void) · 77 unmodified lines
156139 loongson_sysconf.nr_cpus = num_processors;
157140 }
158141
159−int __init acpi_boot_init(void)
142+void __init acpi_boot_table_init(void)
160143 {
161144 /*
162145 * If acpi_disabled, bail out
163146 */
164147 if (acpi_disabled)
165− return -1;
148+ return;
149+
150+ /*
151+ * Initialize the ACPI boot-time table parser.
152+ */
153+ if (acpi_table_init()) {
154+ disable_acpi();
155+ return;
156+ }
166157
167158 loongson_sysconf.boot_cpu_id = read_csr_cpuid();
168159
@@ -173,8 +164,6 @@ int __init acpi_boot_init(void) · 4 unmodified lines
173164
174165 /* Do not enable ACPI SPCR console by default */
175166 acpi_parse_spcr(earlycon_acpi_spcr_enable, false);
176−
177− return 0;
178167 }
179168
180169 #ifdef CONFIG_ACPI_NUMA
arch/loongarch/kernel/irq.c+1−1
@@ -117,7 +117,7 @@ void __init init_IRQ(void) · 116 unmodified lines
117117 if (ipi_irq < 0)
118118 panic("IPI IRQ mapping failed\n");
119119 irq_set_percpu_devid(ipi_irq);
120− r = request_percpu_irq(ipi_irq, loongson3_ipi_interrupt, "IPI", &ipi_dummy_dev);
120+ r = request_percpu_irq(ipi_irq, loongson_ipi_interrupt, "IPI", &ipi_dummy_dev);
121121 if (r < 0)
122122 panic("IPI IRQ request failed\n");
123123 #endif
arch/loongarch/kernel/process.c+5−4
@@ -152,7 +152,7 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args) · 151 unmodified lines
152152 childregs->csr_crmd = p->thread.csr_crmd;
153153 childregs->csr_prmd = p->thread.csr_prmd;
154154 childregs->csr_ecfg = p->thread.csr_ecfg;
155− return 0;
155+ goto out;
156156 }
157157
158158 /* user thread */
@@ -171,14 +171,15 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args) · 12 unmodified lines
171171 */
172172 childregs->csr_euen = 0;
173173
174+ if (clone_flags & CLONE_SETTLS)
175+ childregs->regs[2] = tls;
176+
177+out:
174178 clear_tsk_thread_flag(p, TIF_USEDFPU);
175179 clear_tsk_thread_flag(p, TIF_USEDSIMD);
176180 clear_tsk_thread_flag(p, TIF_LSX_CTX_LIVE);
177181 clear_tsk_thread_flag(p, TIF_LASX_CTX_LIVE);
178182
179− if (clone_flags & CLONE_SETTLS)
180− childregs->regs[2] = tls;
181−
182183 return 0;
183184 }
184185
arch/loongarch/kernel/setup.c+0−1
@@ -257,7 +257,6 @@ void __init platform_init(void) · 256 unmodified lines
257257 #ifdef CONFIG_ACPI
258258 acpi_gbl_use_default_register_widths = false;
259259 acpi_boot_table_init();
260− acpi_boot_init();
261260 #endif
262261
263262 #ifdef CONFIG_NUMA
arch/loongarch/kernel/smp.c+22−22
@@ -136,12 +136,12 @@ static void ipi_write_action(int cpu, u32 action) · 135 unmodified lines
136136 }
137137 }
138138
139−void loongson3_send_ipi_single(int cpu, unsigned int action)
139+void loongson_send_ipi_single(int cpu, unsigned int action)
140140 {
141141 ipi_write_action(cpu_logical_map(cpu), (u32)action);
142142 }
143143
144−void loongson3_send_ipi_mask(const struct cpumask *mask, unsigned int action)
144+void loongson_send_ipi_mask(const struct cpumask *mask, unsigned int action)
145145 {
146146 unsigned int i;
147147
@@ -149,7 +149,7 @@ void loongson3_send_ipi_mask(const struct cpumask *mask, unsigned int action) · 1 unmodified line
149149 ipi_write_action(cpu_logical_map(i), (u32)action);
150150 }
151151
152−irqreturn_t loongson3_ipi_interrupt(int irq, void *dev)
152+irqreturn_t loongson_ipi_interrupt(int irq, void *dev)
153153 {
154154 unsigned int action;
155155 unsigned int cpu = smp_processor_id();
@@ -169,7 +169,7 @@ irqreturn_t loongson3_ipi_interrupt(int irq, void *dev) · 13 unmodified lines
169169 return IRQ_HANDLED;
170170 }
171171
172−void __init loongson3_smp_setup(void)
172+void __init loongson_smp_setup(void)
173173 {
174174 cpu_data[0].core = cpu_logical_map(0) % loongson_sysconf.cores_per_package;
175175 cpu_data[0].package = cpu_logical_map(0) / loongson_sysconf.cores_per_package;
@@ -178,7 +178,7 @@ void __init loongson3_smp_setup(void) · 2 unmodified lines
178178 pr_info("Detected %i available CPU(s)\n", loongson_sysconf.nr_cpus);
179179 }
180180
181−void __init loongson3_prepare_cpus(unsigned int max_cpus)
181+void __init loongson_prepare_cpus(unsigned int max_cpus)
182182 {
183183 int i = 0;
184184
@@ -193,7 +193,7 @@ void __init loongson3_prepare_cpus(unsigned int max_cpus) · 8 unmodified lines
193193 /*
194194 * Setup the PC, SP, and TP of a secondary processor and start it running!
195195 */
196−void loongson3_boot_secondary(int cpu, struct task_struct *idle)
196+void loongson_boot_secondary(int cpu, struct task_struct *idle)
197197 {
198198 unsigned long entry;
199199
@@ -205,13 +205,13 @@ void loongson3_boot_secondary(int cpu, struct task_struct *idle) · 5 unmodified lines
205205
206206 csr_mail_send(entry, cpu_logical_map(cpu), 0);
207207
208− loongson3_send_ipi_single(cpu, SMP_BOOT_CPU);
208+ loongson_send_ipi_single(cpu, SMP_BOOT_CPU);
209209 }
210210
211211 /*
212212 * SMP init and finish on secondary CPUs
213213 */
214−void loongson3_init_secondary(void)
214+void loongson_init_secondary(void)
215215 {
216216 unsigned int cpu = smp_processor_id();
217217 unsigned int imask = ECFGF_IP0 | ECFGF_IP1 | ECFGF_IP2 |
@@ -231,7 +231,7 @@ void loongson3_init_secondary(void) · 13 unmodified lines
231231 cpu_logical_map(cpu) / loongson_sysconf.cores_per_package;
232232 }
233233
234−void loongson3_smp_finish(void)
234+void loongson_smp_finish(void)
235235 {
236236 local_irq_enable();
237237 iocsr_write64(0, LOONGARCH_IOCSR_MBUF0);
@@ -240,7 +240,7 @@ void loongson3_smp_finish(void) · 2 unmodified lines
240240
241241 #ifdef CONFIG_HOTPLUG_CPU
242242
243−int loongson3_cpu_disable(void)
243+int loongson_cpu_disable(void)
244244 {
245245 unsigned long flags;
246246 unsigned int cpu = smp_processor_id();
@@ -262,7 +262,7 @@ int loongson3_cpu_disable(void) · 15 unmodified lines
262262 return 0;
263263 }
264264
265−void loongson3_cpu_die(unsigned int cpu)
265+void loongson_cpu_die(unsigned int cpu)
266266 {
267267 while (per_cpu(cpu_state, cpu) != CPU_DEAD)
268268 cpu_relax();
@@ -300,19 +300,19 @@ void play_dead(void) · 31 unmodified lines
300300 */
301301 #ifdef CONFIG_PM
302302
303−static int loongson3_ipi_suspend(void)
303+static int loongson_ipi_suspend(void)
304304 {
305305 return 0;
306306 }
307307
308−static void loongson3_ipi_resume(void)
308+static void loongson_ipi_resume(void)
309309 {
310310 iocsr_write32(0xffffffff, LOONGARCH_IOCSR_IPI_EN);
311311 }
312312
313−static struct syscore_ops loongson3_ipi_syscore_ops = {
314− .resume = loongson3_ipi_resume,
315− .suspend = loongson3_ipi_suspend,
313+static struct syscore_ops loongson_ipi_syscore_ops = {
314+ .resume = loongson_ipi_resume,
315+ .suspend = loongson_ipi_suspend,
316316 };
317317
318318 /*
@@ -321,7 +321,7 @@ static struct syscore_ops loongson3_ipi_syscore_ops = { · 2 unmodified lines
321321 */
322322 static int __init ipi_pm_init(void)
323323 {
324− register_syscore_ops(&loongson3_ipi_syscore_ops);
324+ register_syscore_ops(&loongson_ipi_syscore_ops);
325325 return 0;
326326 }
327327
@@ -425,7 +425,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) · 97 unmodified lines
425425 {
426426 init_new_context(current, &init_mm);
427427 current_thread_info()->cpu = 0;
428− loongson3_prepare_cpus(max_cpus);
428+ loongson_prepare_cpus(max_cpus);
429429 set_cpu_sibling_map(0);
430430 set_cpu_core_map(0);
431431 calculate_cpu_foreign_map();
@@ -436,7 +436,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) · 4 unmodified lines
436436
437437 int __cpu_up(unsigned int cpu, struct task_struct *tidle)
438438 {
439− loongson3_boot_secondary(cpu, tidle);
439+ loongson_boot_secondary(cpu, tidle);
440440
441441 /* Wait for CPU to start and be ready to sync counters */
442442 if (!wait_for_completion_timeout(&cpu_starting,
@@ -465,7 +465,7 @@ asmlinkage void start_secondary(void) · 22 unmodified lines
465465
466466 cpu_probe();
467467 constant_clockevent_init();
468− loongson3_init_secondary();
468+ loongson_init_secondary();
469469
470470 set_cpu_sibling_map(cpu);
471471 set_cpu_core_map(cpu);
@@ -487,11 +487,11 @@ asmlinkage void start_secondary(void) · 15 unmodified lines
487487 complete(&cpu_running);
488488
489489 /*
490− * irq will be enabled in loongson3_smp_finish(), enabling it too
490+ * irq will be enabled in loongson_smp_finish(), enabling it too
491491 * early is dangerous.
492492 */
493493 WARN_ON_ONCE(!irqs_disabled());
494− loongson3_smp_finish();
494+ loongson_smp_finish();
495495
496496 cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
497497 }
arch/loongarch/kernel/unwind_prologue.c+2−1
@@ -43,7 +43,8 @@ static bool unwind_by_prologue(struct unwind_state *state) · 42 unmodified lines
4343 {
4444 struct stack_info *info = &state->stack_info;
4545 union loongarch_instruction *ip, *ip_end;
46− unsigned long frame_size = 0, frame_ra = -1;
46+ long frame_ra = -1;
47+ unsigned long frame_size = 0;
4748 unsigned long size, offset, pc = state->pc;
4849
4950 if (state->sp >= info->end || state->sp < info->begin)
arch/microblaze/Makefile+2−2
@@ -67,12 +67,12 @@ linux.bin.ub linux.bin.gz: linux.bin · 66 unmodified lines
6767 linux.bin: vmlinux
6868 linux.bin linux.bin.gz linux.bin.ub:
6969 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
70− @echo 'Kernel: $(boot)/$@ is ready' ' (#'`cat .version`')'
70+ @echo 'Kernel: $(boot)/$@ is ready' ' (#'$(or $(KBUILD_BUILD_VERSION),`cat .version`)')'
7171
7272 PHONY += simpleImage.$(DTB)
7373 simpleImage.$(DTB): vmlinux
7474 $(Q)$(MAKE) $(build)=$(boot) $(addprefix $(boot)/$@., ub unstrip strip)
75− @echo 'Kernel: $(boot)/$@ is ready' ' (#'`cat .version`')'
75+ @echo 'Kernel: $(boot)/$@ is ready' ' (#'$(or $(KBUILD_BUILD_VERSION),`cat .version`)')'
7676
7777 define archhelp
7878 echo '* linux.bin - Create raw binary'
arch/mips/alchemy/common/gpiolib.c+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 #include <linux/init.h>
3232 #include <linux/kernel.h>
3333 #include <linux/types.h>
34−#include <linux/gpio.h>
34+#include <linux/gpio/driver.h>
3535 #include <asm/mach-au1x00/gpio-au1000.h>
3636 #include <asm/mach-au1x00/gpio-au1300.h>
3737
arch/mips/boot/compressed/decompress.c+1−0
@@ -9,6 +9,7 @@ · 8 unmodified lines
99
1010 #define DISABLE_BRANCH_PROFILING
1111
12+#define __NO_FORTIFY
1213 #include <linux/types.h>
1314 #include <linux/kernel.h>
1415 #include <linux/string.h>
arch/mips/include/asm/fw/fw.h+1−1
@@ -26,6 +26,6 @@ extern char *fw_getcmdline(void); · 25 unmodified lines
2626 extern void fw_meminit(void);
2727 extern char *fw_getenv(char *name);
2828 extern unsigned long fw_getenvl(char *name);
29−extern void fw_init_early_console(char port);
29+extern void fw_init_early_console(void);
3030
3131 #endif /* __ASM_FW_H_ */
arch/mips/include/asm/pgtable.h+1−0
@@ -622,6 +622,7 @@ static inline pmd_t pmd_mkdirty(pmd_t pmd) · 621 unmodified lines
622622 return pmd;
623623 }
624624
625+#define pmd_young pmd_young
625626 static inline int pmd_young(pmd_t pmd)
626627 {
627628 return !!(pmd_val(pmd) & _PAGE_ACCESSED);
arch/mips/kernel/jump_label.c+1−1
@@ -56,7 +56,7 @@ void arch_jump_label_transform(struct jump_entry *e, · 55 unmodified lines
5656 * The branch offset must fit in the instruction's 26
5757 * bit field.
5858 */
59− WARN_ON((offset >= BIT(25)) ||
59+ WARN_ON((offset >= (long)BIT(25)) ||
6060 (offset < -(long)BIT(25)));
6161
6262 insn.j_format.opcode = bc6_op;
arch/mips/kernel/relocate_kernel.S+5−10
@@ -145,8 +145,7 @@ LEAF(kexec_smp_wait) · 144 unmodified lines
145145 * kexec_args[0..3] are used to prepare register values.
146146 */
147147
148−kexec_args:
149− EXPORT(kexec_args)
148+EXPORT(kexec_args)
150149 arg0: PTR_WD 0x0
151150 arg1: PTR_WD 0x0
152151 arg2: PTR_WD 0x0
@@ -159,8 +158,7 @@ arg3: PTR_WD 0x0 · 6 unmodified lines
159158 * their registers a0-a3. secondary_kexec_args[0..3] are used
160159 * to prepare register values.
161160 */
162−secondary_kexec_args:
163− EXPORT(secondary_kexec_args)
161+EXPORT(secondary_kexec_args)
164162 s_arg0: PTR_WD 0x0
165163 s_arg1: PTR_WD 0x0
166164 s_arg2: PTR_WD 0x0
@@ -171,19 +169,16 @@ kexec_flag: · 4 unmodified lines
171169
172170 #endif
173171
174−kexec_start_address:
175− EXPORT(kexec_start_address)
172+EXPORT(kexec_start_address)
176173 PTR_WD 0x0
177174 .size kexec_start_address, PTRSIZE
178175
179−kexec_indirection_page:
180− EXPORT(kexec_indirection_page)
176+EXPORT(kexec_indirection_page)
181177 PTR_WD 0
182178 .size kexec_indirection_page, PTRSIZE
183179
184180 relocate_new_kernel_end:
185181
186−relocate_new_kernel_size:
187− EXPORT(relocate_new_kernel_size)
182+EXPORT(relocate_new_kernel_size)
188183 PTR_WD relocate_new_kernel_end - relocate_new_kernel
189184 .size relocate_new_kernel_size, PTRSIZE
arch/mips/loongson64/reset.c+10−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <asm/bootinfo.h>
1717 #include <asm/idle.h>
1818 #include <asm/reboot.h>
19+#include <asm/bug.h>
1920
2021 #include <loongson.h>
2122 #include <boot_param.h>
@@ -159,8 +160,17 @@ static int __init mips_reboot_setup(void) · 137 unmodified lines
159160
160161 #ifdef CONFIG_KEXEC
161162 kexec_argv = kmalloc(KEXEC_ARGV_SIZE, GFP_KERNEL);
163+ if (WARN_ON(!kexec_argv))
164+ return -ENOMEM;
165+
162166 kdump_argv = kmalloc(KEXEC_ARGV_SIZE, GFP_KERNEL);
167+ if (WARN_ON(!kdump_argv))
168+ return -ENOMEM;
169+
163170 kexec_envp = kmalloc(KEXEC_ENVP_SIZE, GFP_KERNEL);
171+ if (WARN_ON(!kexec_envp))
172+ return -ENOMEM;
173+
164174 fw_arg1 = KEXEC_ARGV_ADDR;
165175 memcpy(kexec_envp, (void *)fw_arg2, KEXEC_ENVP_SIZE);
166176
arch/mips/pic32/pic32mzda/early_console.c+6−7
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727 #define U_BRG(x) (UART_BASE(x) + 0x40)
2828
2929 static void __iomem *uart_base;
30−static char console_port = -1;
30+static int console_port = -1;
3131
3232 static int __init configure_uart_pins(int port)
3333 {
@@ -47,7 +47,7 @@ static int __init configure_uart_pins(int port) · 13 unmodified lines
4747 return 0;
4848 }
4949
50−static void __init configure_uart(char port, int baud)
50+static void __init configure_uart(int port, int baud)
5151 {
5252 u32 pbclk;
5353
@@ -60,7 +60,7 @@ static void __init configure_uart(char port, int baud) · 6 unmodified lines
6060 uart_base + PIC32_SET(U_STA(port)));
6161 }
6262
63−static void __init setup_early_console(char port, int baud)
63+static void __init setup_early_console(int port, int baud)
6464 {
6565 if (configure_uart_pins(port))
6666 return;
@@ -130,16 +130,15 @@ _out: · 63 unmodified lines
130130 return baud;
131131 }
132132
133−void __init fw_init_early_console(char port)
133+void __init fw_init_early_console(void)
134134 {
135135 char *arch_cmdline = pic32_getcmdline();
136− int baud = -1;
136+ int baud, port;
137137
138138 uart_base = ioremap(PIC32_BASE_UART, 0xc00);
139139
140140 baud = get_baud_from_cmdline(arch_cmdline);
141− if (port == -1)
142− port = get_port_from_cmdline(arch_cmdline);
141+ port = get_port_from_cmdline(arch_cmdline);
143142
144143 if (port == -1)
145144 port = EARLY_CONSOLE_PORT;
arch/mips/pic32/pic32mzda/init.c+1−1
@@ -47,7 +47,7 @@ void __init plat_mem_setup(void) · 46 unmodified lines
4747 strscpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
4848
4949 #ifdef CONFIG_EARLY_PRINTK
50− fw_init_early_console(-1);
50+ fw_init_early_console();
5151 #endif
5252 pic32_config_init();
5353 }
arch/nios2/boot/Makefile+1−1
@@ -20,7 +20,7 @@ $(obj)/vmlinux.bin: vmlinux FORCE · 19 unmodified lines
2020 $(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
2121 $(call if_changed,gzip)
2222
23−$(obj)/vmImage: $(obj)/vmlinux.gz
23+$(obj)/vmImage: $(obj)/vmlinux.gz FORCE
2424 $(call if_changed,uimage)
2525 @$(kecho) 'Kernel: $@ is ready'
2626
arch/parisc/include/asm/hardware.h+6−6
@@ -10,12 +10,12 @@ · 9 unmodified lines
1010 #define SVERSION_ANY_ID PA_SVERSION_ANY_ID
1111
1212 struct hp_hardware {
13− unsigned short hw_type:5; /* HPHW_xxx */
14− unsigned short hversion;
15− unsigned long sversion:28;
16− unsigned short opt;
17− const char name[80]; /* The hardware description */
18−};
13+ unsigned int hw_type:8; /* HPHW_xxx */
14+ unsigned int hversion:12;
15+ unsigned int sversion:12;
16+ unsigned char opt;
17+ unsigned char name[59]; /* The hardware description */
18+} __packed;
1919
2020 struct parisc_device;
2121
arch/parisc/include/uapi/asm/pdc.h+13−23
@@ -363,20 +363,25 @@ · 362 unmodified lines
363363
364364 #if !defined(__ASSEMBLY__)
365365
366−/* flags of the device_path */
366+/* flags for hardware_path */
367367 #define PF_AUTOBOOT 0x80
368368 #define PF_AUTOSEARCH 0x40
369369 #define PF_TIMER 0x0F
370370
371−struct device_path { /* page 1-69 */
372− unsigned char flags; /* flags see above! */
373− unsigned char bc[6]; /* bus converter routing info */
374− unsigned char mod;
375− unsigned int layers[6];/* device-specific layer-info */
376−} __attribute__((aligned(8))) ;
371+struct hardware_path {
372+ unsigned char flags; /* see bit definitions below */
373+ signed char bc[6]; /* Bus Converter routing info to a specific */
374+ /* I/O adaptor (< 0 means none, > 63 resvd) */
375+ signed char mod; /* fixed field of specified module */
376+};
377+
378+struct pdc_module_path { /* page 1-69 */
379+ struct hardware_path path;
380+ unsigned int layers[6]; /* device-specific info (ctlr #, unit # ...) */
381+} __attribute__((aligned(8)));
377382
378383 struct pz_device {
379− struct device_path dp; /* see above */
384+ struct pdc_module_path dp; /* see above */
380385 /* struct iomod *hpa; */
381386 unsigned int hpa; /* HPA base address */
382387 /* char *spa; */
@@ -611,21 +616,6 @@ struct pdc_initiator { /* PDC_INITIATOR */ · 228 unmodified lines
611616 int mode;
612617 };
613618
614−struct hardware_path {
615− char flags; /* see bit definitions below */
616− char bc[6]; /* Bus Converter routing info to a specific */
617− /* I/O adaptor (< 0 means none, > 63 resvd) */
618− char mod; /* fixed field of specified module */
619−};
620−
621−/*
622− * Device path specifications used by PDC.
623− */
624−struct pdc_module_path {
625− struct hardware_path path;
626− unsigned int layers[6]; /* device-specific info (ctlr #, unit # ...) */
627−};
628−
629619 /* Only used on some pre-PA2.0 boxes */
630620 struct pdc_memory_map { /* PDC_MEMORY_MAP */
631621 unsigned long hpa; /* mod's register set address */
arch/parisc/kernel/drivers.c+6−8
@@ -882,15 +882,13 @@ void __init walk_central_bus(void) · 881 unmodified lines
882882 &root);
883883 }
884884
885−static void print_parisc_device(struct parisc_device *dev)
885+static __init void print_parisc_device(struct parisc_device *dev)
886886 {
887− char hw_path[64];
888− static int count;
887+ static int count __initdata;
889888
890− print_pa_hwpath(dev, hw_path);
891− pr_info("%d. %s at %pap [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }",
892− ++count, dev->name, &(dev->hpa.start), hw_path, dev->id.hw_type,
893− dev->id.hversion_rev, dev->id.hversion, dev->id.sversion);
889+ pr_info("%d. %s at %pap { type:%d, hv:%#x, sv:%#x, rev:%#x }",
890+ ++count, dev->name, &(dev->hpa.start), dev->id.hw_type,
891+ dev->id.hversion, dev->id.sversion, dev->id.hversion_rev);
894892
895893 if (dev->num_addrs) {
896894 int k;
@@ -1079,7 +1077,7 @@ static __init int qemu_print_iodc_data(struct device *lin_dev, void *data) · 182 unmodified lines
10791077
10801078
10811079
1082−static int print_one_device(struct device * dev, void * data)
1080+static __init int print_one_device(struct device * dev, void * data)
10831081 {
10841082 struct parisc_device * pdev = to_parisc_device(dev);
10851083
arch/powerpc/Kconfig+2−1
@@ -147,6 +147,7 @@ config PPC · 146 unmodified lines
147147 select ARCH_MIGHT_HAVE_PC_SERIO
148148 select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
149149 select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
150+ select ARCH_SPLIT_ARG64 if PPC32
150151 select ARCH_STACKWALK
151152 select ARCH_SUPPORTS_ATOMIC_RMW
152153 select ARCH_SUPPORTS_DEBUG_PAGEALLOC if PPC_BOOK3S || PPC_8xx || 40x
@@ -285,7 +286,7 @@ config PPC · 132 unmodified lines
285286 #
286287
287288 config PPC_LONG_DOUBLE_128
288− depends on PPC64
289+ depends on PPC64 && ALTIVEC
289290 def_bool $(success,test "$(shell,echo __LONG_DOUBLE_128__ | $(CC) -E -P -)" = 1)
290291
291292 config PPC_BARRIER_NOSPEC
arch/powerpc/include/asm/interrupt.h+1−0
@@ -602,6 +602,7 @@ ____##func(struct pt_regs *regs) · 601 unmodified lines
602602 /* kernel/traps.c */
603603 DECLARE_INTERRUPT_HANDLER_NMI(system_reset_exception);
604604 #ifdef CONFIG_PPC_BOOK3S_64
605+DECLARE_INTERRUPT_HANDLER_RAW(machine_check_early_boot);
605606 DECLARE_INTERRUPT_HANDLER_ASYNC(machine_check_exception_async);
606607 #endif
607608 DECLARE_INTERRUPT_HANDLER_NMI(machine_check_exception);
arch/powerpc/include/asm/syscalls.h+7−0
@@ -104,6 +104,13 @@ long sys_ppc_ftruncate64(unsigned int fd, u32 reg4, · 103 unmodified lines
104104 unsigned long len1, unsigned long len2);
105105 long sys_ppc32_fadvise64(int fd, u32 unused, u32 offset1, u32 offset2,
106106 size_t len, int advice);
107+long sys_ppc_sync_file_range2(int fd, unsigned int flags,
108+ unsigned int offset1,
109+ unsigned int offset2,
110+ unsigned int nbytes1,
111+ unsigned int nbytes2);
112+long sys_ppc_fallocate(int fd, int mode, u32 offset1, u32 offset2,
113+ u32 len1, u32 len2);
107114 #endif
108115 #ifdef CONFIG_COMPAT
109116 long compat_sys_mmap2(unsigned long addr, size_t len,
arch/powerpc/kernel/sys_ppc32.c+12−1
@@ -112,7 +112,7 @@ PPC32_SYSCALL_DEFINE6(ppc32_fadvise64, · 111 unmodified lines
112112 advice);
113113 }
114114
115−COMPAT_SYSCALL_DEFINE6(ppc_sync_file_range2,
115+PPC32_SYSCALL_DEFINE6(ppc_sync_file_range2,
116116 int, fd, unsigned int, flags,
117117 unsigned int, offset1, unsigned int, offset2,
118118 unsigned int, nbytes1, unsigned int, nbytes2)
@@ -122,3 +122,14 @@ COMPAT_SYSCALL_DEFINE6(ppc_sync_file_range2, · 3 unmodified lines
122122
123123 return ksys_sync_file_range(fd, offset, nbytes, flags);
124124 }
125+
126+#ifdef CONFIG_PPC32
127+SYSCALL_DEFINE6(ppc_fallocate,
128+ int, fd, int, mode,
129+ u32, offset1, u32, offset2, u32, len1, u32, len2)
130+{
131+ return ksys_fallocate(fd, mode,
132+ merge_64(offset1, offset2),
133+ merge_64(len1, len2));
134+}
135+#endif
arch/powerpc/kernel/syscalls/syscall.tbl+5−2
@@ -394,8 +394,11 @@ · 393 unmodified lines
394394 305 common signalfd sys_signalfd compat_sys_signalfd
395395 306 common timerfd_create sys_timerfd_create
396396 307 common eventfd sys_eventfd
397−308 common sync_file_range2 sys_sync_file_range2 compat_sys_ppc_sync_file_range2
398−309 nospu fallocate sys_fallocate compat_sys_fallocate
397+308 32 sync_file_range2 sys_ppc_sync_file_range2 compat_sys_ppc_sync_file_range2
398+308 64 sync_file_range2 sys_sync_file_range2
399+308 spu sync_file_range2 sys_sync_file_range2
400+309 32 fallocate sys_ppc_fallocate compat_sys_fallocate
401+309 64 fallocate sys_fallocate
399402 310 nospu subpage_prot sys_subpage_prot
400403 311 32 timerfd_settime sys_timerfd_settime32
401404 311 64 timerfd_settime sys_timerfd_settime
arch/powerpc/kernel/vmlinux.lds.S+1−1
@@ -142,7 +142,7 @@ SECTIONS · 141 unmodified lines
142142 #endif
143143
144144 .data.rel.ro : AT(ADDR(.data.rel.ro) - LOAD_OFFSET) {
145− *(.data.rel.ro*)
145+ *(.data.rel.ro .data.rel.ro.*)
146146 }
147147
148148 .branch_lt : AT(ADDR(.branch_lt) - LOAD_OFFSET) {
arch/powerpc/net/bpf_jit_comp32.c+21−31
@@ -113,23 +113,19 @@ void bpf_jit_build_prologue(u32 *image, struct codegen_context *ctx) · 112 unmodified lines
113113 {
114114 int i;
115115
116− /* First arg comes in as a 32 bits pointer. */
117− EMIT(PPC_RAW_MR(bpf_to_ppc(BPF_REG_1), _R3));
118− EMIT(PPC_RAW_LI(bpf_to_ppc(BPF_REG_1) - 1, 0));
116+ /* Initialize tail_call_cnt, to be skipped if we do tail calls. */
117+ EMIT(PPC_RAW_LI(_R4, 0));
118+
119+#define BPF_TAILCALL_PROLOGUE_SIZE 4
120+
119121 EMIT(PPC_RAW_STWU(_R1, _R1, -BPF_PPC_STACKFRAME(ctx)));
120122
121− /*
122− * Initialize tail_call_cnt in stack frame if we do tail calls.
123− * Otherwise, put in NOPs so that it can be skipped when we are
124− * invoked through a tail call.
125− */
126123 if (ctx->seen & SEEN_TAILCALL)
127− EMIT(PPC_RAW_STW(bpf_to_ppc(BPF_REG_1) - 1, _R1,
128− bpf_jit_stack_offsetof(ctx, BPF_PPC_TC)));
129− else
130− EMIT(PPC_RAW_NOP());
124+ EMIT(PPC_RAW_STW(_R4, _R1, bpf_jit_stack_offsetof(ctx, BPF_PPC_TC)));
131125
132−#define BPF_TAILCALL_PROLOGUE_SIZE 16
126+ /* First arg comes in as a 32 bits pointer. */
127+ EMIT(PPC_RAW_MR(bpf_to_ppc(BPF_REG_1), _R3));
128+ EMIT(PPC_RAW_LI(bpf_to_ppc(BPF_REG_1) - 1, 0));
133129
134130 /*
135131 * We need a stack frame, but we don't necessarily need to
@@ -170,24 +166,24 @@ static void bpf_jit_emit_common_epilogue(u32 *image, struct codegen_context *ctx · 34 unmodified lines
170166 for (i = BPF_PPC_NVR_MIN; i <= 31; i++)
171167 if (bpf_is_seen_register(ctx, i))
172168 EMIT(PPC_RAW_LWZ(i, _R1, bpf_jit_stack_offsetof(ctx, i)));
173−}
174−
175−void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)
176−{
177− EMIT(PPC_RAW_MR(_R3, bpf_to_ppc(BPF_REG_0)));
178−
179− bpf_jit_emit_common_epilogue(image, ctx);
180−
181− /* Tear down our stack frame */
182169
183170 if (ctx->seen & SEEN_FUNC)
184171 EMIT(PPC_RAW_LWZ(_R0, _R1, BPF_PPC_STACKFRAME(ctx) + PPC_LR_STKOFF));
185172
173+ /* Tear down our stack frame */
186174 EMIT(PPC_RAW_ADDI(_R1, _R1, BPF_PPC_STACKFRAME(ctx)));
187175
188176 if (ctx->seen & SEEN_FUNC)
189177 EMIT(PPC_RAW_MTLR(_R0));
190178
179+}
180+
181+void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)
182+{
183+ EMIT(PPC_RAW_MR(_R3, bpf_to_ppc(BPF_REG_0)));
184+
185+ bpf_jit_emit_common_epilogue(image, ctx);
186+
191187 EMIT(PPC_RAW_BLR());
192188 }
193189
@@ -244,7 +240,6 @@ static int bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32 o · 50 unmodified lines
244240 EMIT(PPC_RAW_RLWINM(_R3, b2p_index, 2, 0, 29));
245241 EMIT(PPC_RAW_ADD(_R3, _R3, b2p_bpf_array));
246242 EMIT(PPC_RAW_LWZ(_R3, _R3, offsetof(struct bpf_array, ptrs)));
247− EMIT(PPC_RAW_STW(_R0, _R1, bpf_jit_stack_offsetof(ctx, BPF_PPC_TC)));
248243
249244 /*
250245 * if (prog == NULL)
@@ -255,19 +250,14 @@ static int bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32 o · 4 unmodified lines
255250
256251 /* goto *(prog->bpf_func + prologue_size); */
257252 EMIT(PPC_RAW_LWZ(_R3, _R3, offsetof(struct bpf_prog, bpf_func)));
258−
259− if (ctx->seen & SEEN_FUNC)
260− EMIT(PPC_RAW_LWZ(_R0, _R1, BPF_PPC_STACKFRAME(ctx) + PPC_LR_STKOFF));
261−
262253 EMIT(PPC_RAW_ADDIC(_R3, _R3, BPF_TAILCALL_PROLOGUE_SIZE));
263−
264− if (ctx->seen & SEEN_FUNC)
265− EMIT(PPC_RAW_MTLR(_R0));
266−
267254 EMIT(PPC_RAW_MTCTR(_R3));
268255
269256 EMIT(PPC_RAW_MR(_R3, bpf_to_ppc(BPF_REG_1)));
270257
258+ /* Put tail_call_cnt in r4 */
259+ EMIT(PPC_RAW_MR(_R4, _R0));
260+
271261 /* tear restore NVRs, ... */
272262 bpf_jit_emit_common_epilogue(image, ctx);
273263
arch/riscv/Kconfig+3−3
@@ -317,9 +317,9 @@ config SMP · 316 unmodified lines
317317 config NR_CPUS
318318 int "Maximum number of CPUs (2-512)"
319319 depends on SMP
320− range 2 512 if !SBI_V01
321− range 2 32 if SBI_V01 && 32BIT
322− range 2 64 if SBI_V01 && 64BIT
320+ range 2 512 if !RISCV_SBI_V01
321+ range 2 32 if RISCV_SBI_V01 && 32BIT
322+ range 2 64 if RISCV_SBI_V01 && 64BIT
323323 default "32" if 32BIT
324324 default "64" if 64BIT
325325
arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts+38−0
@@ -3,6 +3,8 @@ · 2 unmodified lines
33
44 #include "fu540-c000.dtsi"
55 #include <dt-bindings/gpio/gpio.h>
6+#include <dt-bindings/leds/common.h>
7+#include <dt-bindings/pwm/pwm.h>
68
79 /* Clock frequency (in Hz) of the PCB crystal for rtcclk */
810 #define RTCCLK_FREQ 1000000
@@ -42,6 +44,42 @@ · 33 unmodified lines
4244 compatible = "gpio-restart";
4345 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
4446 };
47+
48+ led-controller {
49+ compatible = "pwm-leds";
50+
51+ led-d1 {
52+ pwms = <&pwm0 0 7812500 PWM_POLARITY_INVERTED>;
53+ active-low;
54+ color = <LED_COLOR_ID_GREEN>;
55+ max-brightness = <255>;
56+ label = "d1";
57+ };
58+
59+ led-d2 {
60+ pwms = <&pwm0 1 7812500 PWM_POLARITY_INVERTED>;
61+ active-low;
62+ color = <LED_COLOR_ID_GREEN>;
63+ max-brightness = <255>;
64+ label = "d2";
65+ };
66+
67+ led-d3 {
68+ pwms = <&pwm0 2 7812500 PWM_POLARITY_INVERTED>;
69+ active-low;
70+ color = <LED_COLOR_ID_GREEN>;
71+ max-brightness = <255>;
72+ label = "d3";
73+ };
74+
75+ led-d4 {
76+ pwms = <&pwm0 3 7812500 PWM_POLARITY_INVERTED>;
77+ active-low;
78+ color = <LED_COLOR_ID_GREEN>;
79+ max-brightness = <255>;
80+ label = "d4";
81+ };
82+ };
4583 };
4684
4785 &uart0 {
arch/riscv/include/asm/asm.h+1−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #define REG_L __REG_SEL(ld, lw)
2424 #define REG_S __REG_SEL(sd, sw)
2525 #define REG_SC __REG_SEL(sc.d, sc.w)
26+#define REG_AMOSWAP_AQ __REG_SEL(amoswap.d.aq, amoswap.w.aq)
2627 #define REG_ASM __REG_SEL(.dword, .word)
2728 #define SZREG __REG_SEL(8, 4)
2829 #define LGREG __REG_SEL(3, 2)
arch/riscv/include/asm/efi.h+5−1
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <asm/mmu_context.h>
1111 #include <asm/ptrace.h>
1212 #include <asm/tlbflush.h>
13+#include <asm/pgalloc.h>
1314
1415 #ifdef CONFIG_EFI
1516 extern void efi_init(void);
@@ -20,7 +21,10 @@ extern void efi_init(void); · 4 unmodified lines
2021 int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md);
2122 int efi_set_mapping_permissions(struct mm_struct *mm, efi_memory_desc_t *md);
2223
23−#define arch_efi_call_virt_setup() efi_virtmap_load()
24+#define arch_efi_call_virt_setup() ({ \
25+ sync_kernel_mappings(efi_mm.pgd); \
26+ efi_virtmap_load(); \
27+ })
2428 #define arch_efi_call_virt_teardown() efi_virtmap_unload()
2529
2630 #define ARCH_EFI_IRQ_FLAGS_MASK (SR_IE | SR_SPIE)
arch/riscv/include/asm/pgalloc.h+8−3
@@ -127,6 +127,13 @@ static inline void p4d_free(struct mm_struct *mm, p4d_t *p4d) · 126 unmodified lines
127127 #define __p4d_free_tlb(tlb, p4d, addr) p4d_free((tlb)->mm, p4d)
128128 #endif /* __PAGETABLE_PMD_FOLDED */
129129
130+static inline void sync_kernel_mappings(pgd_t *pgd)
131+{
132+ memcpy(pgd + USER_PTRS_PER_PGD,
133+ init_mm.pgd + USER_PTRS_PER_PGD,
134+ (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
135+}
136+
130137 static inline pgd_t *pgd_alloc(struct mm_struct *mm)
131138 {
132139 pgd_t *pgd;
@@ -135,9 +142,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) · 2 unmodified lines
135142 if (likely(pgd != NULL)) {
136143 memset(pgd, 0, USER_PTRS_PER_PGD * sizeof(pgd_t));
137144 /* Copy kernel mappings */
138− memcpy(pgd + USER_PTRS_PER_PGD,
139− init_mm.pgd + USER_PTRS_PER_PGD,
140− (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
145+ sync_kernel_mappings(pgd);
141146 }
142147 return pgd;
143148 }
arch/riscv/include/asm/pgtable.h+1−0
@@ -600,6 +600,7 @@ static inline int pmd_dirty(pmd_t pmd) · 599 unmodified lines
600600 return pte_dirty(pmd_pte(pmd));
601601 }
602602
603+#define pmd_young pmd_young
603604 static inline int pmd_young(pmd_t pmd)
604605 {
605606 return pte_young(pmd_pte(pmd));
arch/riscv/include/asm/smp.h+3−0
@@ -50,6 +50,9 @@ void riscv_set_ipi_ops(const struct riscv_ipi_ops *ops); · 49 unmodified lines
5050 /* Clear IPI for current CPU */
5151 void riscv_clear_ipi(void);
5252
53+/* Check other CPUs stop or not */
54+bool smp_crash_stop_failed(void);
55+
5356 /* Secondary hart entry */
5457 asmlinkage void smp_callin(void);
5558
arch/riscv/kernel/entry.S+13−0
@@ -404,6 +404,19 @@ handle_syscall_trace_exit: · 403 unmodified lines
404404
405405 #ifdef CONFIG_VMAP_STACK
406406 handle_kernel_stack_overflow:
407+ /*
408+ * Takes the psuedo-spinlock for the shadow stack, in case multiple
409+ * harts are concurrently overflowing their kernel stacks. We could
410+ * store any value here, but since we're overflowing the kernel stack
411+ * already we only have SP to use as a scratch register. So we just
412+ * swap in the address of the spinlock, as that's definately non-zero.
413+ *
414+ * Pairs with a store_release in handle_bad_stack().
415+ */
416+1: la sp, spin_shadow_stack
417+ REG_AMOSWAP_AQ sp, sp, (sp)
418+ bnez sp, 1b
419+
407420 la sp, shadow_stack
408421 addi sp, sp, SHADOW_OVERFLOW_STACK_SIZE
409422
arch/riscv/kernel/machine_kexec.c+35−11
@@ -15,6 +15,8 @@ · 14 unmodified lines
1515 #include <linux/compiler.h> /* For unreachable() */
1616 #include <linux/cpu.h> /* For cpu_down() */
1717 #include <linux/reboot.h>
18+#include <linux/interrupt.h>
19+#include <linux/irq.h>
1820
1921 /*
2022 * kexec_image_info - Print received image details
@@ -138,20 +140,35 @@ void machine_shutdown(void) · 117 unmodified lines
138140 #endif
139141 }
140142
141−/* Override the weak function in kernel/panic.c */
142−void crash_smp_send_stop(void)
143+static void machine_kexec_mask_interrupts(void)
143144 {
144− static int cpus_stopped;
145+ unsigned int i;
146+ struct irq_desc *desc;
145147
146− /*
147− * This function can be called twice in panic path, but obviously
148− * we execute this only once.
149− */
150− if (cpus_stopped)
151− return;
148+ for_each_irq_desc(i, desc) {
149+ struct irq_chip *chip;
150+ int ret;
151+
152+ chip = irq_desc_get_chip(desc);
153+ if (!chip)
154+ continue;
155+
156+ /*
157+ * First try to remove the active state. If this
158+ * fails, try to EOI the interrupt.
159+ */
160+ ret = irq_set_irqchip_state(i, IRQCHIP_STATE_ACTIVE, false);
161+
162+ if (ret && irqd_irq_inprogress(&desc->irq_data) &&
163+ chip->irq_eoi)
164+ chip->irq_eoi(&desc->irq_data);
152165
153− smp_send_stop();
154− cpus_stopped = 1;
166+ if (chip->irq_mask)
167+ chip->irq_mask(&desc->irq_data);
168+
169+ if (chip->irq_disable && !irqd_irq_disabled(&desc->irq_data))
170+ chip->irq_disable(&desc->irq_data);
171+ }
155172 }
156173
157174 /*
@@ -169,6 +186,8 @@ machine_crash_shutdown(struct pt_regs *regs) · 11 unmodified lines
169186 crash_smp_send_stop();
170187
171188 crash_save_cpu(regs, smp_processor_id());
189+ machine_kexec_mask_interrupts();
190+
172191 pr_info("Starting crashdump kernel...\n");
173192 }
174193
@@ -195,6 +214,11 @@ machine_kexec(struct kimage *image) · 20 unmodified lines
195214 void *control_code_buffer = page_address(image->control_code_page);
196215 riscv_kexec_method kexec_method = NULL;
197216
217+#ifdef CONFIG_SMP
218+ WARN(smp_crash_stop_failed(),
219+ "Some CPUs may be stale, kdump will be unreliable.\n");
220+#endif
221+
198222 if (image->type != KEXEC_TYPE_CRASH)
199223 kexec_method = control_code_buffer;
200224 else
arch/riscv/kernel/process.c+2−0
@@ -164,6 +164,8 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args) · 163 unmodified lines
164164 unsigned long tls = args->tls;
165165 struct pt_regs *childregs = task_pt_regs(p);
166166
167+ memset(&p->thread.s, 0, sizeof(p->thread.s));
168+
167169 /* p->thread holds context to be restored by __switch_to() */
168170 if (unlikely(args->fn)) {
169171 /* Kernel thread */
arch/riscv/kernel/setup.c+6−4
@@ -283,6 +283,7 @@ void __init setup_arch(char **cmdline_p) · 282 unmodified lines
283283 else
284284 pr_err("No DTB found in kernel mappings\n");
285285 #endif
286+ early_init_fdt_scan_reserved_mem();
286287 misc_mem_init();
287288
288289 init_resources();
@@ -321,10 +322,11 @@ subsys_initcall(topology_init); · 32 unmodified lines
321322
322323 void free_initmem(void)
323324 {
324− if (IS_ENABLED(CONFIG_STRICT_KERNEL_RWX))
325− set_kernel_memory(lm_alias(__init_begin), lm_alias(__init_end),
326− IS_ENABLED(CONFIG_64BIT) ?
327− set_memory_rw : set_memory_rw_nx);
325+ if (IS_ENABLED(CONFIG_STRICT_KERNEL_RWX)) {
326+ set_kernel_memory(lm_alias(__init_begin), lm_alias(__init_end), set_memory_rw_nx);
327+ if (IS_ENABLED(CONFIG_64BIT))
328+ set_kernel_memory(__init_begin, __init_end, set_memory_nx);
329+ }
328330
329331 free_initmem_default(POISON_FREE_INITMEM);
330332 }
arch/riscv/kernel/smp.c+95−2
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/clockchips.h>
1313 #include <linux/interrupt.h>
1414 #include <linux/module.h>
15+#include <linux/kexec.h>
1516 #include <linux/profile.h>
1617 #include <linux/smp.h>
1718 #include <linux/sched.h>
@@ -22,11 +23,13 @@ · 4 unmodified lines
2223 #include <asm/sbi.h>
2324 #include <asm/tlbflush.h>
2425 #include <asm/cacheflush.h>
26+#include <asm/cpu_ops.h>
2527
2628 enum ipi_message_type {
2729 IPI_RESCHEDULE,
2830 IPI_CALL_FUNC,
2931 IPI_CPU_STOP,
32+ IPI_CPU_CRASH_STOP,
3033 IPI_IRQ_WORK,
3134 IPI_TIMER,
3235 IPI_MAX
@@ -71,6 +74,32 @@ static void ipi_stop(void) · 38 unmodified lines
7174 wait_for_interrupt();
7275 }
7376
77+#ifdef CONFIG_KEXEC_CORE
78+static atomic_t waiting_for_crash_ipi = ATOMIC_INIT(0);
79+
80+static inline void ipi_cpu_crash_stop(unsigned int cpu, struct pt_regs *regs)
81+{
82+ crash_save_cpu(regs, cpu);
83+
84+ atomic_dec(&waiting_for_crash_ipi);
85+
86+ local_irq_disable();
87+
88+#ifdef CONFIG_HOTPLUG_CPU
89+ if (cpu_has_hotplug(cpu))
90+ cpu_ops[cpu]->cpu_stop();
91+#endif
92+
93+ for(;;)
94+ wait_for_interrupt();
95+}
96+#else
97+static inline void ipi_cpu_crash_stop(unsigned int cpu, struct pt_regs *regs)
98+{
99+ unreachable();
100+}
101+#endif
102+
74103 static const struct riscv_ipi_ops *ipi_ops __ro_after_init;
75104
76105 void riscv_set_ipi_ops(const struct riscv_ipi_ops *ops)
@@ -124,8 +153,9 @@ void arch_irq_work_raise(void) · 47 unmodified lines
124153
125154 void handle_IPI(struct pt_regs *regs)
126155 {
127− unsigned long *pending_ipis = &ipi_data[smp_processor_id()].bits;
128− unsigned long *stats = ipi_data[smp_processor_id()].stats;
156+ unsigned int cpu = smp_processor_id();
157+ unsigned long *pending_ipis = &ipi_data[cpu].bits;
158+ unsigned long *stats = ipi_data[cpu].stats;
129159
130160 riscv_clear_ipi();
131161
@@ -154,6 +184,10 @@ void handle_IPI(struct pt_regs *regs) · 22 unmodified lines
154184 ipi_stop();
155185 }
156186
187+ if (ops & (1 << IPI_CPU_CRASH_STOP)) {
188+ ipi_cpu_crash_stop(cpu, get_irq_regs());
189+ }
190+
157191 if (ops & (1 << IPI_IRQ_WORK)) {
158192 stats[IPI_IRQ_WORK]++;
159193 irq_work_run();
@@ -176,6 +210,7 @@ static const char * const ipi_names[] = { · 16 unmodified lines
176210 [IPI_RESCHEDULE] = "Rescheduling interrupts",
177211 [IPI_CALL_FUNC] = "Function call interrupts",
178212 [IPI_CPU_STOP] = "CPU stop interrupts",
213+ [IPI_CPU_CRASH_STOP] = "CPU stop (for crash dump) interrupts",
179214 [IPI_IRQ_WORK] = "IRQ work interrupts",
180215 [IPI_TIMER] = "Timer broadcast interrupts",
181216 };
@@ -235,6 +270,64 @@ void smp_send_stop(void) · 53 unmodified lines
235270 cpumask_pr_args(cpu_online_mask));
236271 }
237272
273+#ifdef CONFIG_KEXEC_CORE
274+/*
275+ * The number of CPUs online, not counting this CPU (which may not be
276+ * fully online and so not counted in num_online_cpus()).
277+ */
278+static inline unsigned int num_other_online_cpus(void)
279+{
280+ unsigned int this_cpu_online = cpu_online(smp_processor_id());
281+
282+ return num_online_cpus() - this_cpu_online;
283+}
284+
285+void crash_smp_send_stop(void)
286+{
287+ static int cpus_stopped;
288+ cpumask_t mask;
289+ unsigned long timeout;
290+
291+ /*
292+ * This function can be called twice in panic path, but obviously
293+ * we execute this only once.
294+ */
295+ if (cpus_stopped)
296+ return;
297+
298+ cpus_stopped = 1;
299+
300+ /*
301+ * If this cpu is the only one alive at this point in time, online or
302+ * not, there are no stop messages to be sent around, so just back out.
303+ */
304+ if (num_other_online_cpus() == 0)
305+ return;
306+
307+ cpumask_copy(&mask, cpu_online_mask);
308+ cpumask_clear_cpu(smp_processor_id(), &mask);
309+
310+ atomic_set(&waiting_for_crash_ipi, num_other_online_cpus());
311+
312+ pr_crit("SMP: stopping secondary CPUs\n");
313+ send_ipi_mask(&mask, IPI_CPU_CRASH_STOP);
314+
315+ /* Wait up to one second for other CPUs to stop */
316+ timeout = USEC_PER_SEC;
317+ while ((atomic_read(&waiting_for_crash_ipi) > 0) && timeout--)
318+ udelay(1);
319+
320+ if (atomic_read(&waiting_for_crash_ipi) > 0)
321+ pr_warn("SMP: failed to stop secondary CPUs %*pbl\n",
322+ cpumask_pr_args(&mask));
323+}
324+
325+bool smp_crash_stop_failed(void)
326+{
327+ return (atomic_read(&waiting_for_crash_ipi) > 0);
328+}
329+#endif
330+
238331 void smp_send_reschedule(int cpu)
239332 {
240333 send_ipi_single(cpu, IPI_RESCHEDULE);
arch/riscv/kernel/traps.c+18−0
@@ -221,11 +221,29 @@ asmlinkage unsigned long get_overflow_stack(void) · 220 unmodified lines
221221 OVERFLOW_STACK_SIZE;
222222 }
223223
224+/*
225+ * A pseudo spinlock to protect the shadow stack from being used by multiple
226+ * harts concurrently. This isn't a real spinlock because the lock side must
227+ * be taken without a valid stack and only a single register, it's only taken
228+ * while in the process of panicing anyway so the performance and error
229+ * checking a proper spinlock gives us doesn't matter.
230+ */
231+unsigned long spin_shadow_stack;
232+
224233 asmlinkage void handle_bad_stack(struct pt_regs *regs)
225234 {
226235 unsigned long tsk_stk = (unsigned long)current->stack;
227236 unsigned long ovf_stk = (unsigned long)this_cpu_ptr(overflow_stack);
228237
238+ /*
239+ * We're done with the shadow stack by this point, as we're on the
240+ * overflow stack. Tell any other concurrent overflowing harts that
241+ * they can proceed with panicing by releasing the pseudo-spinlock.
242+ *
243+ * This pairs with an amoswap.aq in handle_kernel_stack_overflow.
244+ */
245+ smp_store_release(&spin_shadow_stack, 0);
246+
229247 console_verbose();
230248
231249 pr_emerg("Insufficient stack space to handle exception!\n");
arch/riscv/kernel/vdso/Makefile+5−1
@@ -17,6 +17,7 @@ vdso-syms += flush_icache · 16 unmodified lines
1717 obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o
1818
1919 ccflags-y := -fno-stack-protector
20+ccflags-y += -DDISABLE_BRANCH_PROFILING
2021
2122 ifneq ($(c-gettimeofday-y),)
2223 CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y)
@@ -28,9 +29,12 @@ obj-vdso := $(addprefix $(obj)/, $(obj-vdso)) · 5 unmodified lines
2829
2930 obj-y += vdso.o
3031 CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
32+ifneq ($(filter vgettimeofday, $(vdso-syms)),)
33+CPPFLAGS_vdso.lds += -DHAS_VGETTIMEOFDAY
34+endif
3135
3236 # Disable -pg to prevent insert call site
33−CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os
37+CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE)
3438
3539 # Disable profiling and instrumentation for VDSO code
3640 GCOV_PROFILE := n
arch/riscv/kernel/vdso/vdso.lds.S+2−0
@@ -68,9 +68,11 @@ VERSION · 67 unmodified lines
6868 LINUX_4.15 {
6969 global:
7070 __vdso_rt_sigreturn;
71+#ifdef HAS_VGETTIMEOFDAY
7172 __vdso_gettimeofday;
7273 __vdso_clock_gettime;
7374 __vdso_clock_getres;
75+#endif
7476 __vdso_getcpu;
7577 __vdso_flush_icache;
7678 local: *;
arch/riscv/mm/init.c+0−1
@@ -262,7 +262,6 @@ static void __init setup_bootmem(void) · 261 unmodified lines
262262 memblock_reserve(dtb_early_pa, fdt_totalsize(dtb_early_va));
263263 }
264264
265− early_init_fdt_scan_reserved_mem();
266265 dma_contiguous_reserve(dma32_phys_limit);
267266 if (IS_ENABLED(CONFIG_64BIT))
268267 hugetlb_cma_reserve(PUD_SHIFT - PAGE_SHIFT);
arch/s390/Kconfig+3−3
@@ -568,8 +568,7 @@ config EXPOLINE_FULL · 567 unmodified lines
568568 endchoice
569569
570570 config RELOCATABLE
571− bool "Build a relocatable kernel"
572− default y
571+ def_bool y
573572 help
574573 This builds a kernel image that retains relocation information
575574 so it can be loaded at an arbitrary address.
@@ -578,10 +577,11 @@ config RELOCATABLE · 2 unmodified lines
578577 bootup process.
579578 The relocations make the kernel image about 15% larger (compressed
580579 10%), but are discarded at runtime.
580+ Note: this option exists only for documentation purposes, please do
581+ not remove it.
581582
582583 config RANDOMIZE_BASE
583584 bool "Randomize the address of the kernel image (KASLR)"
584− depends on RELOCATABLE
585585 default y
586586 help
587587 In support of Kernel Address Space Layout Randomization (KASLR),
arch/s390/Makefile+0−2
@@ -14,10 +14,8 @@ KBUILD_AFLAGS_MODULE += -fPIC · 13 unmodified lines
1414 KBUILD_CFLAGS_MODULE += -fPIC
1515 KBUILD_AFLAGS += -m64
1616 KBUILD_CFLAGS += -m64
17−ifeq ($(CONFIG_RELOCATABLE),y)
1817 KBUILD_CFLAGS += -fPIE
1918 LDFLAGS_vmlinux := -pie
20−endif
2119 aflags_dwarf := -Wa,-gdwarf-2
2220 KBUILD_AFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -D__ASSEMBLY__
2321 ifndef CONFIG_AS_IS_LLVM
arch/s390/boot/Makefile+1−2
@@ -37,9 +37,8 @@ CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char · 36 unmodified lines
3737
3838 obj-y := head.o als.o startup.o mem_detect.o ipl_parm.o ipl_report.o
3939 obj-y += string.o ebcdic.o sclp_early_core.o mem.o ipl_vmparm.o cmdline.o
40−obj-y += version.o pgm_check_info.o ctype.o ipl_data.o
40+obj-y += version.o pgm_check_info.o ctype.o ipl_data.o machine_kexec_reloc.o
4141 obj-$(findstring y, $(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) $(CONFIG_PGSTE)) += uv.o
42−obj-$(CONFIG_RELOCATABLE) += machine_kexec_reloc.o
4342 obj-$(CONFIG_RANDOMIZE_BASE) += kaslr.o
4443 obj-y += $(if $(CONFIG_KERNEL_UNCOMPRESSED),,decompressor.o) info.o
4544 obj-$(CONFIG_KERNEL_ZSTD) += clz_ctz.o
arch/s390/boot/startup.c+1−2
@@ -291,8 +291,7 @@ void startup_kernel(void) · 290 unmodified lines
291291
292292 clear_bss_section();
293293 copy_bootdata();
294− if (IS_ENABLED(CONFIG_RELOCATABLE))
295− handle_relocs(__kaslr_offset);
294+ handle_relocs(__kaslr_offset);
296295
297296 if (__kaslr_offset) {
298297 /*
arch/s390/configs/btf.config+1−0
@@ -0,0 +1 @@
1+CONFIG_DEBUG_INFO_BTF=y
arch/s390/configs/debug_defconfig+32−33
@@ -723,52 +723,42 @@ CONFIG_CRYPTO_ECDSA=m · 722 unmodified lines
723723 CONFIG_CRYPTO_ECRDSA=m
724724 CONFIG_CRYPTO_SM2=m
725725 CONFIG_CRYPTO_CURVE25519=m
726−CONFIG_CRYPTO_GCM=y
727−CONFIG_CRYPTO_CHACHA20POLY1305=m
728−CONFIG_CRYPTO_AEGIS128=m
729−CONFIG_CRYPTO_SEQIV=y
730−CONFIG_CRYPTO_CFB=m
731−CONFIG_CRYPTO_LRW=m
732−CONFIG_CRYPTO_PCBC=m
733−CONFIG_CRYPTO_KEYWRAP=m
734−CONFIG_CRYPTO_ADIANTUM=m
735−CONFIG_CRYPTO_HCTR2=m
736−CONFIG_CRYPTO_XCBC=m
737−CONFIG_CRYPTO_VMAC=m
738−CONFIG_CRYPTO_CRC32=m
739−CONFIG_CRYPTO_CRC32_S390=y
740−CONFIG_CRYPTO_MD4=m
741−CONFIG_CRYPTO_MD5=y
742−CONFIG_CRYPTO_MICHAEL_MIC=m
743−CONFIG_CRYPTO_RMD160=m
744−CONFIG_CRYPTO_SHA512_S390=m
745−CONFIG_CRYPTO_SHA1_S390=m
746−CONFIG_CRYPTO_SHA256_S390=m
747−CONFIG_CRYPTO_SHA3=m
748−CONFIG_CRYPTO_SHA3_256_S390=m
749−CONFIG_CRYPTO_SHA3_512_S390=m
750−CONFIG_CRYPTO_SM3_GENERIC=m
751−CONFIG_CRYPTO_WP512=m
752−CONFIG_CRYPTO_GHASH_S390=m
753726 CONFIG_CRYPTO_AES_TI=m
754−CONFIG_CRYPTO_AES_S390=m
755727 CONFIG_CRYPTO_ANUBIS=m
756−CONFIG_CRYPTO_ARC4=m
728+CONFIG_CRYPTO_ARIA=m
757729 CONFIG_CRYPTO_BLOWFISH=m
758730 CONFIG_CRYPTO_CAMELLIA=m
759731 CONFIG_CRYPTO_CAST5=m
760732 CONFIG_CRYPTO_CAST6=m
761733 CONFIG_CRYPTO_DES=m
762−CONFIG_CRYPTO_DES_S390=m
763734 CONFIG_CRYPTO_FCRYPT=m
764735 CONFIG_CRYPTO_KHAZAD=m
765−CONFIG_CRYPTO_CHACHA_S390=m
766736 CONFIG_CRYPTO_SEED=m
767−CONFIG_CRYPTO_ARIA=m
768737 CONFIG_CRYPTO_SERPENT=m
769738 CONFIG_CRYPTO_SM4_GENERIC=m
770739 CONFIG_CRYPTO_TEA=m
771740 CONFIG_CRYPTO_TWOFISH=m
741+CONFIG_CRYPTO_ADIANTUM=m
742+CONFIG_CRYPTO_ARC4=m
743+CONFIG_CRYPTO_CFB=m
744+CONFIG_CRYPTO_HCTR2=m
745+CONFIG_CRYPTO_KEYWRAP=m
746+CONFIG_CRYPTO_LRW=m
747+CONFIG_CRYPTO_PCBC=m
748+CONFIG_CRYPTO_AEGIS128=m
749+CONFIG_CRYPTO_CHACHA20POLY1305=m
750+CONFIG_CRYPTO_GCM=y
751+CONFIG_CRYPTO_SEQIV=y
752+CONFIG_CRYPTO_MD4=m
753+CONFIG_CRYPTO_MD5=y
754+CONFIG_CRYPTO_MICHAEL_MIC=m
755+CONFIG_CRYPTO_RMD160=m
756+CONFIG_CRYPTO_SHA3=m
757+CONFIG_CRYPTO_SM3_GENERIC=m
758+CONFIG_CRYPTO_VMAC=m
759+CONFIG_CRYPTO_WP512=m
760+CONFIG_CRYPTO_XCBC=m
761+CONFIG_CRYPTO_CRC32=m
772762 CONFIG_CRYPTO_842=m
773763 CONFIG_CRYPTO_LZ4=m
774764 CONFIG_CRYPTO_LZ4HC=m
@@ -779,6 +769,16 @@ CONFIG_CRYPTO_USER_API_SKCIPHER=m · 4 unmodified lines
779769 CONFIG_CRYPTO_USER_API_RNG=m
780770 CONFIG_CRYPTO_USER_API_AEAD=m
781771 CONFIG_CRYPTO_STATS=y
772+CONFIG_CRYPTO_CRC32_S390=y
773+CONFIG_CRYPTO_SHA512_S390=m
774+CONFIG_CRYPTO_SHA1_S390=m
775+CONFIG_CRYPTO_SHA256_S390=m
776+CONFIG_CRYPTO_SHA3_256_S390=m
777+CONFIG_CRYPTO_SHA3_512_S390=m
778+CONFIG_CRYPTO_GHASH_S390=m
779+CONFIG_CRYPTO_AES_S390=m
780+CONFIG_CRYPTO_DES_S390=m
781+CONFIG_CRYPTO_CHACHA_S390=m
782782 CONFIG_ZCRYPT=m
783783 CONFIG_PKEY=m
784784 CONFIG_CRYPTO_PAES_S390=m
@@ -797,7 +797,6 @@ CONFIG_CMA_SIZE_MBYTES=0 · 12 unmodified lines
797797 CONFIG_PRINTK_TIME=y
798798 CONFIG_DYNAMIC_DEBUG=y
799799 CONFIG_DEBUG_INFO_DWARF4=y
800−CONFIG_DEBUG_INFO_BTF=y
801800 CONFIG_GDB_SCRIPTS=y
802801 CONFIG_HEADERS_INSTALL=y
803802 CONFIG_DEBUG_SECTION_MISMATCH=y
arch/s390/configs/defconfig+33−34
@@ -707,53 +707,43 @@ CONFIG_CRYPTO_ECDSA=m · 706 unmodified lines
707707 CONFIG_CRYPTO_ECRDSA=m
708708 CONFIG_CRYPTO_SM2=m
709709 CONFIG_CRYPTO_CURVE25519=m
710−CONFIG_CRYPTO_GCM=y
711−CONFIG_CRYPTO_CHACHA20POLY1305=m
712−CONFIG_CRYPTO_AEGIS128=m
713−CONFIG_CRYPTO_SEQIV=y
714−CONFIG_CRYPTO_CFB=m
715−CONFIG_CRYPTO_LRW=m
716−CONFIG_CRYPTO_OFB=m
717−CONFIG_CRYPTO_PCBC=m
718−CONFIG_CRYPTO_KEYWRAP=m
719−CONFIG_CRYPTO_ADIANTUM=m
720−CONFIG_CRYPTO_HCTR2=m
721−CONFIG_CRYPTO_XCBC=m
722−CONFIG_CRYPTO_VMAC=m
723−CONFIG_CRYPTO_CRC32=m
724−CONFIG_CRYPTO_CRC32_S390=y
725−CONFIG_CRYPTO_MD4=m
726−CONFIG_CRYPTO_MD5=y
727−CONFIG_CRYPTO_MICHAEL_MIC=m
728−CONFIG_CRYPTO_RMD160=m
729−CONFIG_CRYPTO_SHA512_S390=m
730−CONFIG_CRYPTO_SHA1_S390=m
731−CONFIG_CRYPTO_SHA256_S390=m
732−CONFIG_CRYPTO_SHA3=m
733−CONFIG_CRYPTO_SHA3_256_S390=m
734−CONFIG_CRYPTO_SHA3_512_S390=m
735−CONFIG_CRYPTO_SM3_GENERIC=m
736−CONFIG_CRYPTO_WP512=m
737−CONFIG_CRYPTO_GHASH_S390=m
738710 CONFIG_CRYPTO_AES_TI=m
739−CONFIG_CRYPTO_AES_S390=m
740711 CONFIG_CRYPTO_ANUBIS=m
741−CONFIG_CRYPTO_ARC4=m
712+CONFIG_CRYPTO_ARIA=m
742713 CONFIG_CRYPTO_BLOWFISH=m
743714 CONFIG_CRYPTO_CAMELLIA=m
744715 CONFIG_CRYPTO_CAST5=m
745716 CONFIG_CRYPTO_CAST6=m
746717 CONFIG_CRYPTO_DES=m
747−CONFIG_CRYPTO_DES_S390=m
748718 CONFIG_CRYPTO_FCRYPT=m
749719 CONFIG_CRYPTO_KHAZAD=m
750−CONFIG_CRYPTO_CHACHA_S390=m
751720 CONFIG_CRYPTO_SEED=m
752−CONFIG_CRYPTO_ARIA=m
753721 CONFIG_CRYPTO_SERPENT=m
754722 CONFIG_CRYPTO_SM4_GENERIC=m
755723 CONFIG_CRYPTO_TEA=m
756724 CONFIG_CRYPTO_TWOFISH=m
725+CONFIG_CRYPTO_ADIANTUM=m
726+CONFIG_CRYPTO_ARC4=m
727+CONFIG_CRYPTO_CFB=m
728+CONFIG_CRYPTO_HCTR2=m
729+CONFIG_CRYPTO_KEYWRAP=m
730+CONFIG_CRYPTO_LRW=m
731+CONFIG_CRYPTO_OFB=m
732+CONFIG_CRYPTO_PCBC=m
733+CONFIG_CRYPTO_AEGIS128=m
734+CONFIG_CRYPTO_CHACHA20POLY1305=m
735+CONFIG_CRYPTO_GCM=y
736+CONFIG_CRYPTO_SEQIV=y
737+CONFIG_CRYPTO_MD4=m
738+CONFIG_CRYPTO_MD5=y
739+CONFIG_CRYPTO_MICHAEL_MIC=m
740+CONFIG_CRYPTO_RMD160=m
741+CONFIG_CRYPTO_SHA3=m
742+CONFIG_CRYPTO_SM3_GENERIC=m
743+CONFIG_CRYPTO_VMAC=m
744+CONFIG_CRYPTO_WP512=m
745+CONFIG_CRYPTO_XCBC=m
746+CONFIG_CRYPTO_CRC32=m
757747 CONFIG_CRYPTO_842=m
758748 CONFIG_CRYPTO_LZ4=m
759749 CONFIG_CRYPTO_LZ4HC=m
@@ -764,6 +754,16 @@ CONFIG_CRYPTO_USER_API_SKCIPHER=m · 4 unmodified lines
764754 CONFIG_CRYPTO_USER_API_RNG=m
765755 CONFIG_CRYPTO_USER_API_AEAD=m
766756 CONFIG_CRYPTO_STATS=y
757+CONFIG_CRYPTO_CRC32_S390=y
758+CONFIG_CRYPTO_SHA512_S390=m
759+CONFIG_CRYPTO_SHA1_S390=m
760+CONFIG_CRYPTO_SHA256_S390=m
761+CONFIG_CRYPTO_SHA3_256_S390=m
762+CONFIG_CRYPTO_SHA3_512_S390=m
763+CONFIG_CRYPTO_GHASH_S390=m
764+CONFIG_CRYPTO_AES_S390=m
765+CONFIG_CRYPTO_DES_S390=m
766+CONFIG_CRYPTO_CHACHA_S390=m
767767 CONFIG_ZCRYPT=m
768768 CONFIG_PKEY=m
769769 CONFIG_CRYPTO_PAES_S390=m
@@ -781,7 +781,6 @@ CONFIG_CMA_SIZE_MBYTES=0 · 11 unmodified lines
781781 CONFIG_PRINTK_TIME=y
782782 CONFIG_DYNAMIC_DEBUG=y
783783 CONFIG_DEBUG_INFO_DWARF4=y
784−CONFIG_DEBUG_INFO_BTF=y
785784 CONFIG_GDB_SCRIPTS=y
786785 CONFIG_DEBUG_SECTION_MISMATCH=y
787786 CONFIG_MAGIC_SYSRQ=y
arch/s390/configs/kasan.config+3−0
@@ -0,0 +1,3 @@
1+CONFIG_KASAN=y
2+CONFIG_KASAN_INLINE=y
3+CONFIG_KASAN_VMALLOC=y
arch/s390/configs/zfcpdump_defconfig+0−1
@@ -74,7 +74,6 @@ CONFIG_PRINTK_TIME=y · 73 unmodified lines
7474 # CONFIG_SYMBOLIC_ERRNAME is not set
7575 CONFIG_DEBUG_KERNEL=y
7676 CONFIG_DEBUG_INFO_DWARF4=y
77−CONFIG_DEBUG_INFO_BTF=y
7877 CONFIG_DEBUG_FS=y
7978 CONFIG_PANIC_ON_OOPS=y
8079 # CONFIG_SCHED_DEBUG is not set
arch/s390/include/asm/pgtable.h+1−0
@@ -763,6 +763,7 @@ static inline int pmd_dirty(pmd_t pmd) · 762 unmodified lines
763763 return (pmd_val(pmd) & _SEGMENT_ENTRY_DIRTY) != 0;
764764 }
765765
766+#define pmd_young pmd_young
766767 static inline int pmd_young(pmd_t pmd)
767768 {
768769 return (pmd_val(pmd) & _SEGMENT_ENTRY_YOUNG) != 0;
arch/s390/include/asm/processor.h+10−1
@@ -199,7 +199,16 @@ unsigned long __get_wchan(struct task_struct *p); · 198 unmodified lines
199199 /* Has task runtime instrumentation enabled ? */
200200 #define is_ri_task(tsk) (!!(tsk)->thread.ri_cb)
201201
202−register unsigned long current_stack_pointer asm("r15");
202+/* avoid using global register due to gcc bug in versions < 8.4 */
203+#define current_stack_pointer (__current_stack_pointer())
204+
205+static __always_inline unsigned long __current_stack_pointer(void)
206+{
207+ unsigned long sp;
208+
209+ asm volatile("lgr %0,15" : "=d" (sp));
210+ return sp;
211+}
203212
204213 static __always_inline unsigned short stap(void)
205214 {
arch/s390/kernel/crash_dump.c+1−1
@@ -46,7 +46,7 @@ struct save_area { · 45 unmodified lines
4646 u64 fprs[16];
4747 u32 fpc;
4848 u32 prefix;
49− u64 todpreg;
49+ u32 todpreg;
5050 u64 timer;
5151 u64 todcmp;
5252 u64 vxrs_low[16];
arch/s390/kvm/kvm-s390.c+17−9
@@ -1207,6 +1207,8 @@ static int kvm_s390_vm_get_migration(struct kvm *kvm, · 1206 unmodified lines
12071207 return 0;
12081208 }
12091209
1210+static void __kvm_s390_set_tod_clock(struct kvm *kvm, const struct kvm_s390_vm_tod_clock *gtod);
1211+
12101212 static int kvm_s390_set_tod_ext(struct kvm *kvm, struct kvm_device_attr *attr)
12111213 {
12121214 struct kvm_s390_vm_tod_clock gtod;
@@ -1216,7 +1218,7 @@ static int kvm_s390_set_tod_ext(struct kvm *kvm, struct kvm_device_attr *attr) · 3 unmodified lines
12161218
12171219 if (!test_kvm_facility(kvm, 139) && gtod.epoch_idx)
12181220 return -EINVAL;
1219− kvm_s390_set_tod_clock(kvm, &gtod);
1221+ __kvm_s390_set_tod_clock(kvm, &gtod);
12201222
12211223 VM_EVENT(kvm, 3, "SET: TOD extension: 0x%x, TOD base: 0x%llx",
12221224 gtod.epoch_idx, gtod.tod);
@@ -1247,7 +1249,7 @@ static int kvm_s390_set_tod_low(struct kvm *kvm, struct kvm_device_attr *attr) · 24 unmodified lines
12471249 sizeof(gtod.tod)))
12481250 return -EFAULT;
12491251
1250− kvm_s390_set_tod_clock(kvm, &gtod);
1252+ __kvm_s390_set_tod_clock(kvm, &gtod);
12511253 VM_EVENT(kvm, 3, "SET: TOD base: 0x%llx", gtod.tod);
12521254 return 0;
12531255 }
@@ -1259,6 +1261,16 @@ static int kvm_s390_set_tod(struct kvm *kvm, struct kvm_device_attr *attr) · 5 unmodified lines
12591261 if (attr->flags)
12601262 return -EINVAL;
12611263
1264+ mutex_lock(&kvm->lock);
1265+ /*
1266+ * For protected guests, the TOD is managed by the ultravisor, so trying
1267+ * to change it will never bring the expected results.
1268+ */
1269+ if (kvm_s390_pv_is_protected(kvm)) {
1270+ ret = -EOPNOTSUPP;
1271+ goto out_unlock;
1272+ }
1273+
12621274 switch (attr->attr) {
12631275 case KVM_S390_VM_TOD_EXT:
12641276 ret = kvm_s390_set_tod_ext(kvm, attr);
@@ -1273,6 +1285,9 @@ static int kvm_s390_set_tod(struct kvm *kvm, struct kvm_device_attr *attr) · 8 unmodified lines
12731285 ret = -ENXIO;
12741286 break;
12751287 }
1288+
1289+out_unlock:
1290+ mutex_unlock(&kvm->lock);
12761291 return ret;
12771292 }
12781293
@@ -4377,13 +4392,6 @@ static void __kvm_s390_set_tod_clock(struct kvm *kvm, const struct kvm_s390_vm_t · 3098 unmodified lines
43774392 preempt_enable();
43784393 }
43794394
4380−void kvm_s390_set_tod_clock(struct kvm *kvm, const struct kvm_s390_vm_tod_clock *gtod)
4381−{
4382− mutex_lock(&kvm->lock);
4383− __kvm_s390_set_tod_clock(kvm, gtod);
4384− mutex_unlock(&kvm->lock);
4385−}
4386−
43874395 int kvm_s390_try_set_tod_clock(struct kvm *kvm, const struct kvm_s390_vm_tod_clock *gtod)
43884396 {
43894397 if (!mutex_trylock(&kvm->lock))
arch/s390/kvm/kvm-s390.h+0−1
@@ -363,7 +363,6 @@ int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu); · 362 unmodified lines
363363 int kvm_s390_handle_sigp_pei(struct kvm_vcpu *vcpu);
364364
365365 /* implemented in kvm-s390.c */
366−void kvm_s390_set_tod_clock(struct kvm *kvm, const struct kvm_s390_vm_tod_clock *gtod);
367366 int kvm_s390_try_set_tod_clock(struct kvm *kvm, const struct kvm_s390_vm_tod_clock *gtod);
368367 long kvm_arch_fault_in_page(struct kvm_vcpu *vcpu, gpa_t gpa, int writable);
369368 int kvm_s390_store_status_unloaded(struct kvm_vcpu *vcpu, unsigned long addr);
arch/s390/kvm/pci.c+1−1
@@ -126,7 +126,7 @@ int kvm_s390_pci_aen_init(u8 nisc) · 125 unmodified lines
126126 return -EPERM;
127127
128128 mutex_lock(&aift->aift_lock);
129− aift->kzdev = kcalloc(ZPCI_NR_DEVICES, sizeof(struct kvm_zdev),
129+ aift->kzdev = kcalloc(ZPCI_NR_DEVICES, sizeof(struct kvm_zdev *),
130130 GFP_KERNEL);
131131 if (!aift->kzdev) {
132132 rc = -ENOMEM;
arch/sparc/include/asm/pgtable_64.h+1−0
@@ -693,6 +693,7 @@ static inline unsigned long pmd_dirty(pmd_t pmd) · 692 unmodified lines
693693 return pte_dirty(pte);
694694 }
695695
696+#define pmd_young pmd_young
696697 static inline unsigned long pmd_young(pmd_t pmd)
697698 {
698699 pte_t pte = __pte(pmd_val(pmd));
arch/x86/boot/Makefile+1−1
@@ -83,7 +83,7 @@ cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \ · 82 unmodified lines
8383
8484 $(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
8585 $(call if_changed,image)
86− @$(kecho) 'Kernel: $@ is ready' ' (#'`cat .version`')'
86+ @$(kecho) 'Kernel: $@ is ready' ' (#'$(or $(KBUILD_BUILD_VERSION),`cat .version`)')'
8787
8888 OBJCOPYFLAGS_vmlinux.bin := -O binary -R .note -R .comment -S
8989 $(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE
arch/x86/coco/tdx/tdx.c+18−7
@@ -34,6 +34,8 @@ · 33 unmodified lines
3434 #define VE_GET_PORT_NUM(e) ((e) >> 16)
3535 #define VE_IS_IO_STRING(e) ((e) & BIT(4))
3636
37+#define ATTR_SEPT_VE_DISABLE BIT(28)
38+
3739 /*
3840 * Wrapper for standard use of __tdx_hypercall with no output aside from
3941 * return code.
@@ -98,10 +100,11 @@ static inline void tdx_module_call(u64 fn, u64 rcx, u64 rdx, u64 r8, u64 r9, · 58 unmodified lines
98100 panic("TDCALL %lld failed (Buggy TDX module!)\n", fn);
99101 }
100102
101−static u64 get_cc_mask(void)
103+static void tdx_parse_tdinfo(u64 *cc_mask)
102104 {
103105 struct tdx_module_output out;
104106 unsigned int gpa_width;
107+ u64 td_attr;
105108
106109 /*
107110 * TDINFO TDX module call is used to get the TD execution environment
@@ -109,19 +112,27 @@ static u64 get_cc_mask(void) · 1 unmodified line
109112 * information, etc. More details about the ABI can be found in TDX
110113 * Guest-Host-Communication Interface (GHCI), section 2.4.2 TDCALL
111114 * [TDG.VP.INFO].
115+ */
116+ tdx_module_call(TDX_GET_INFO, 0, 0, 0, 0, &out);
117+
118+ /*
119+ * The highest bit of a guest physical address is the "sharing" bit.
120+ * Set it for shared pages and clear it for private pages.
112121 *
113122 * The GPA width that comes out of this call is critical. TDX guests
114123 * can not meaningfully run without it.
115124 */
116− tdx_module_call(TDX_GET_INFO, 0, 0, 0, 0, &out);
117−
118125 gpa_width = out.rcx & GENMASK(5, 0);
126+ *cc_mask = BIT_ULL(gpa_width - 1);
119127
120128 /*
121− * The highest bit of a guest physical address is the "sharing" bit.
122− * Set it for shared pages and clear it for private pages.
129+ * The kernel can not handle #VE's when accessing normal kernel
130+ * memory. Ensure that no #VE will be delivered for accesses to
131+ * TD-private memory. Only VMM-shared memory (MMIO) will #VE.
123132 */
124− return BIT_ULL(gpa_width - 1);
133+ td_attr = out.rdx;
134+ if (!(td_attr & ATTR_SEPT_VE_DISABLE))
135+ panic("TD misconfiguration: SEPT_VE_DISABLE attibute must be set.\n");
125136 }
126137
127138 /*
@@ -758,7 +769,7 @@ void __init tdx_early_init(void) · 630 unmodified lines
758769 setup_force_cpu_cap(X86_FEATURE_TDX_GUEST);
759770
760771 cc_set_vendor(CC_VENDOR_INTEL);
761− cc_mask = get_cc_mask();
772+ tdx_parse_tdinfo(&cc_mask);
762773 cc_set_mask(cc_mask);
763774
764775 /*
arch/x86/events/amd/core.c+2−3
@@ -861,8 +861,7 @@ static int amd_pmu_handle_irq(struct pt_regs *regs) · 860 unmodified lines
861861 pmu_enabled = cpuc->enabled;
862862 cpuc->enabled = 0;
863863
864− /* stop everything (includes BRS) */
865− amd_pmu_disable_all();
864+ amd_brs_disable_all();
866865
867866 /* Drain BRS is in use (could be inactive) */
868867 if (cpuc->lbr_users)
@@ -873,7 +872,7 @@ static int amd_pmu_handle_irq(struct pt_regs *regs) · 4 unmodified lines
873872
874873 cpuc->enabled = pmu_enabled;
875874 if (pmu_enabled)
876− amd_pmu_enable_all(0);
875+ amd_brs_enable_all();
877876
878877 return amd_pmu_adjust_nmi_window(handled);
879878 }
arch/x86/events/amd/uncore.c+1−0
@@ -553,6 +553,7 @@ static void uncore_clean_online(void) · 552 unmodified lines
553553
554554 hlist_for_each_entry_safe(uncore, n, &uncore_unused_list, node) {
555555 hlist_del(&uncore->node);
556+ kfree(uncore->events);
556557 kfree(uncore);
557558 }
558559 }
arch/x86/events/intel/core.c+1−0
@@ -4911,6 +4911,7 @@ static const struct x86_cpu_desc isolation_ucodes[] = { · 4910 unmodified lines
49114911 INTEL_CPU_DESC(INTEL_FAM6_SKYLAKE_X, 5, 0x00000000),
49124912 INTEL_CPU_DESC(INTEL_FAM6_SKYLAKE_X, 6, 0x00000000),
49134913 INTEL_CPU_DESC(INTEL_FAM6_SKYLAKE_X, 7, 0x00000000),
4914+ INTEL_CPU_DESC(INTEL_FAM6_SKYLAKE_X, 11, 0x00000000),
49144915 INTEL_CPU_DESC(INTEL_FAM6_SKYLAKE_L, 3, 0x0000007c),
49154916 INTEL_CPU_DESC(INTEL_FAM6_SKYLAKE, 3, 0x0000007c),
49164917 INTEL_CPU_DESC(INTEL_FAM6_KABYLAKE, 9, 0x0000004e),
arch/x86/events/intel/ds.c+14−4
@@ -982,8 +982,13 @@ struct event_constraint intel_icl_pebs_event_constraints[] = { · 981 unmodified lines
982982 INTEL_FLAGS_UEVENT_CONSTRAINT(0x0400, 0x800000000ULL), /* SLOTS */
983983
984984 INTEL_PLD_CONSTRAINT(0x1cd, 0xff), /* MEM_TRANS_RETIRED.LOAD_LATENCY */
985− INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD(0x1d0, 0xf), /* MEM_INST_RETIRED.LOAD */
986− INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST(0x2d0, 0xf), /* MEM_INST_RETIRED.STORE */
985+ INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD(0x11d0, 0xf), /* MEM_INST_RETIRED.STLB_MISS_LOADS */
986+ INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST(0x12d0, 0xf), /* MEM_INST_RETIRED.STLB_MISS_STORES */
987+ INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD(0x21d0, 0xf), /* MEM_INST_RETIRED.LOCK_LOADS */
988+ INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD(0x41d0, 0xf), /* MEM_INST_RETIRED.SPLIT_LOADS */
989+ INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST(0x42d0, 0xf), /* MEM_INST_RETIRED.SPLIT_STORES */
990+ INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD(0x81d0, 0xf), /* MEM_INST_RETIRED.ALL_LOADS */
991+ INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST(0x82d0, 0xf), /* MEM_INST_RETIRED.ALL_STORES */
987992
988993 INTEL_FLAGS_EVENT_CONSTRAINT_DATALA_LD_RANGE(0xd1, 0xd4, 0xf), /* MEM_LOAD_*_RETIRED.* */
989994
@@ -1004,8 +1009,13 @@ struct event_constraint intel_spr_pebs_event_constraints[] = { · 14 unmodified lines
10041009 INTEL_FLAGS_EVENT_CONSTRAINT(0xc0, 0xfe),
10051010 INTEL_PLD_CONSTRAINT(0x1cd, 0xfe),
10061011 INTEL_PSD_CONSTRAINT(0x2cd, 0x1),
1007− INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD(0x1d0, 0xf),
1008− INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST(0x2d0, 0xf),
1012+ INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD(0x11d0, 0xf), /* MEM_INST_RETIRED.STLB_MISS_LOADS */
1013+ INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST(0x12d0, 0xf), /* MEM_INST_RETIRED.STLB_MISS_STORES */
1014+ INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD(0x21d0, 0xf), /* MEM_INST_RETIRED.LOCK_LOADS */
1015+ INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD(0x41d0, 0xf), /* MEM_INST_RETIRED.SPLIT_LOADS */
1016+ INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST(0x42d0, 0xf), /* MEM_INST_RETIRED.SPLIT_STORES */
1017+ INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD(0x81d0, 0xf), /* MEM_INST_RETIRED.ALL_LOADS */
1018+ INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST(0x82d0, 0xf), /* MEM_INST_RETIRED.ALL_STORES */
10091019
10101020 INTEL_FLAGS_EVENT_CONSTRAINT_DATALA_LD_RANGE(0xd1, 0xd4, 0xf),
10111021
arch/x86/events/intel/pt.c+9−0
@@ -1263,6 +1263,15 @@ static int pt_buffer_try_single(struct pt_buffer *buf, int nr_pages) · 1262 unmodified lines
12631263 if (1 << order != nr_pages)
12641264 goto out;
12651265
1266+ /*
1267+ * Some processors cannot always support single range for more than
1268+ * 4KB - refer errata TGL052, ADL037 and RPL017. Future processors might
1269+ * also be affected, so for now rather than trying to keep track of
1270+ * which ones, just disable it for all.
1271+ */
1272+ if (nr_pages > 1)
1273+ goto out;
1274+
12661275 buf->single = true;
12671276 buf->nr_pages = nr_pages;
12681277 ret = 0;
arch/x86/events/rapl.c+1−5
@@ -619,12 +619,8 @@ static int rapl_check_hw_unit(struct rapl_model *rm) · 618 unmodified lines
619619 case RAPL_UNIT_QUIRK_INTEL_HSW:
620620 rapl_hw_unit[PERF_RAPL_RAM] = 16;
621621 break;
622− /*
623− * SPR shares the same DRAM domain energy unit as HSW, plus it
624− * also has a fixed energy unit for Psys domain.
625− */
622+ /* SPR uses a fixed energy unit for Psys domain. */
626623 case RAPL_UNIT_QUIRK_INTEL_SPR:
627− rapl_hw_unit[PERF_RAPL_RAM] = 16;
628624 rapl_hw_unit[PERF_RAPL_PSYS] = 0;
629625 break;
630626 default:
arch/x86/hyperv/hv_init.c+36−37
@@ -77,7 +77,7 @@ static int hyperv_init_ghcb(void) · 76 unmodified lines
7777 static int hv_cpu_init(unsigned int cpu)
7878 {
7979 union hv_vp_assist_msr_contents msr = { 0 };
80− struct hv_vp_assist_page **hvp = &hv_vp_assist_page[smp_processor_id()];
80+ struct hv_vp_assist_page **hvp = &hv_vp_assist_page[cpu];
8181 int ret;
8282
8383 ret = hv_common_cpu_init(cpu);
@@ -87,34 +87,32 @@ static int hv_cpu_init(unsigned int cpu) · 3 unmodified lines
8787 if (!hv_vp_assist_page)
8888 return 0;
8989
90− if (!*hvp) {
91− if (hv_root_partition) {
92− /*
93− * For root partition we get the hypervisor provided VP assist
94− * page, instead of allocating a new page.
95− */
96− rdmsrl(HV_X64_MSR_VP_ASSIST_PAGE, msr.as_uint64);
97− *hvp = memremap(msr.pfn <<
98− HV_X64_MSR_VP_ASSIST_PAGE_ADDRESS_SHIFT,
99− PAGE_SIZE, MEMREMAP_WB);
100− } else {
101− /*
102− * The VP assist page is an "overlay" page (see Hyper-V TLFS's
103− * Section 5.2.1 "GPA Overlay Pages"). Here it must be zeroed
104− * out to make sure we always write the EOI MSR in
105− * hv_apic_eoi_write() *after* the EOI optimization is disabled
106− * in hv_cpu_die(), otherwise a CPU may not be stopped in the
107− * case of CPU offlining and the VM will hang.
108− */
90+ if (hv_root_partition) {
91+ /*
92+ * For root partition we get the hypervisor provided VP assist
93+ * page, instead of allocating a new page.
94+ */
95+ rdmsrl(HV_X64_MSR_VP_ASSIST_PAGE, msr.as_uint64);
96+ *hvp = memremap(msr.pfn << HV_X64_MSR_VP_ASSIST_PAGE_ADDRESS_SHIFT,
97+ PAGE_SIZE, MEMREMAP_WB);
98+ } else {
99+ /*
100+ * The VP assist page is an "overlay" page (see Hyper-V TLFS's
101+ * Section 5.2.1 "GPA Overlay Pages"). Here it must be zeroed
102+ * out to make sure we always write the EOI MSR in
103+ * hv_apic_eoi_write() *after* the EOI optimization is disabled
104+ * in hv_cpu_die(), otherwise a CPU may not be stopped in the
105+ * case of CPU offlining and the VM will hang.
106+ */
107+ if (!*hvp)
109108 *hvp = __vmalloc(PAGE_SIZE, GFP_KERNEL | __GFP_ZERO);
110− if (*hvp)
111− msr.pfn = vmalloc_to_pfn(*hvp);
112− }
113− WARN_ON(!(*hvp));
114− if (*hvp) {
115− msr.enable = 1;
116− wrmsrl(HV_X64_MSR_VP_ASSIST_PAGE, msr.as_uint64);
117− }
109+ if (*hvp)
110+ msr.pfn = vmalloc_to_pfn(*hvp);
111+
112+ }
113+ if (!WARN_ON(!(*hvp))) {
114+ msr.enable = 1;
115+ wrmsrl(HV_X64_MSR_VP_ASSIST_PAGE, msr.as_uint64);
118116 }
119117
120118 return hyperv_init_ghcb();
@@ -444,7 +442,7 @@ void __init hyperv_init(void) · 323 unmodified lines
444442
445443 if (hv_root_partition) {
446444 struct page *pg;
447− void *src, *dst;
445+ void *src;
448446
449447 /*
450448 * For the root partition, the hypervisor will set up its
@@ -459,13 +457,11 @@ void __init hyperv_init(void) · 8 unmodified lines
459457 wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
460458
461459 pg = vmalloc_to_page(hv_hypercall_pg);
462− dst = kmap_local_page(pg);
463460 src = memremap(hypercall_msr.guest_physical_address << PAGE_SHIFT, PAGE_SIZE,
464461 MEMREMAP_WB);
465− BUG_ON(!(src && dst));
466− memcpy(dst, src, HV_HYP_PAGE_SIZE);
462+ BUG_ON(!src);
463+ memcpy_to_page(pg, 0, src, HV_HYP_PAGE_SIZE);
467464 memunmap(src);
468− kunmap_local(dst);
469465 } else {
470466 hypercall_msr.guest_physical_address = vmalloc_to_pfn(hv_hypercall_pg);
471467 wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
@@ -537,6 +533,7 @@ common_free: · 65 unmodified lines
537533 void hyperv_cleanup(void)
538534 {
539535 union hv_x64_msr_hypercall_contents hypercall_msr;
536+ union hv_reference_tsc_msr tsc_msr;
540537
541538 unregister_syscore_ops(&hv_syscore_ops);
542539
@@ -552,12 +549,14 @@ void hyperv_cleanup(void) · 9 unmodified lines
552549 hv_hypercall_pg = NULL;
553550
554551 /* Reset the hypercall page */
555− hypercall_msr.as_uint64 = 0;
556− wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
552+ hypercall_msr.as_uint64 = hv_get_register(HV_X64_MSR_HYPERCALL);
553+ hypercall_msr.enable = 0;
554+ hv_set_register(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
557555
558556 /* Reset the TSC page */
559− hypercall_msr.as_uint64 = 0;
560− wrmsrl(HV_X64_MSR_REFERENCE_TSC, hypercall_msr.as_uint64);
557+ tsc_msr.as_uint64 = hv_get_register(HV_X64_MSR_REFERENCE_TSC);
558+ tsc_msr.enable = 0;
559+ hv_set_register(HV_X64_MSR_REFERENCE_TSC, tsc_msr.as_uint64);
561560 }
562561
563562 void hyperv_report_panic(struct pt_regs *regs, long err, bool in_die)
arch/x86/include/asm/cpufeatures.h+3−0
@@ -305,6 +305,9 @@ · 304 unmodified lines
305305 #define X86_FEATURE_USE_IBPB_FW (11*32+16) /* "" Use IBPB during runtime firmware calls */
306306 #define X86_FEATURE_RSB_VMEXIT_LITE (11*32+17) /* "" Fill RSB on VM exit when EIBRS is enabled */
307307
308+
309+#define X86_FEATURE_MSR_TSX_CTRL (11*32+20) /* "" MSR IA32_TSX_CTRL (Intel) implemented */
310+
308311 /* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */
309312 #define X86_FEATURE_AVX_VNNI (12*32+ 4) /* AVX VNNI instructions */
310313 #define X86_FEATURE_AVX512_BF16 (12*32+ 5) /* AVX512 BFLOAT16 instructions */
arch/x86/include/asm/intel-family.h+10−1
@@ -107,6 +107,11 @@ · 106 unmodified lines
107107
108108 #define INTEL_FAM6_SAPPHIRERAPIDS_X 0x8F /* Golden Cove */
109109
110+#define INTEL_FAM6_EMERALDRAPIDS_X 0xCF
111+
112+#define INTEL_FAM6_GRANITERAPIDS_X 0xAD
113+#define INTEL_FAM6_GRANITERAPIDS_D 0xAE
114+
110115 #define INTEL_FAM6_ALDERLAKE 0x97 /* Golden Cove / Gracemont */
111116 #define INTEL_FAM6_ALDERLAKE_L 0x9A /* Golden Cove / Gracemont */
112117 #define INTEL_FAM6_ALDERLAKE_N 0xBE
@@ -118,7 +123,7 @@ · 5 unmodified lines
118123 #define INTEL_FAM6_METEORLAKE 0xAC
119124 #define INTEL_FAM6_METEORLAKE_L 0xAA
120125
121−/* "Small Core" Processors (Atom) */
126+/* "Small Core" Processors (Atom/E-Core) */
122127
123128 #define INTEL_FAM6_ATOM_BONNELL 0x1C /* Diamondville, Pineview */
124129 #define INTEL_FAM6_ATOM_BONNELL_MID 0x26 /* Silverthorne, Lincroft */
@@ -145,6 +150,10 @@ · 20 unmodified lines
145150 #define INTEL_FAM6_ATOM_TREMONT 0x96 /* Elkhart Lake */
146151 #define INTEL_FAM6_ATOM_TREMONT_L 0x9C /* Jasper Lake */
147152
153+#define INTEL_FAM6_SIERRAFOREST_X 0xAF
154+
155+#define INTEL_FAM6_GRANDRIDGE 0xB6
156+
148157 /* Xeon Phi */
149158
150159 #define INTEL_FAM6_XEON_PHI_KNL 0x57 /* Knights Landing */
arch/x86/include/asm/kvm_host.h+6−1
@@ -501,7 +501,12 @@ struct kvm_pmc { · 500 unmodified lines
501501 bool intr;
502502 };
503503
504+/* More counters may conflict with other existing Architectural MSRs */
505+#define KVM_INTEL_PMC_MAX_GENERIC 8
506+#define MSR_ARCH_PERFMON_PERFCTR_MAX (MSR_ARCH_PERFMON_PERFCTR0 + KVM_INTEL_PMC_MAX_GENERIC - 1)
507+#define MSR_ARCH_PERFMON_EVENTSEL_MAX (MSR_ARCH_PERFMON_EVENTSEL0 + KVM_INTEL_PMC_MAX_GENERIC - 1)
504508 #define KVM_PMC_MAX_FIXED 3
509+#define KVM_AMD_PMC_MAX_GENERIC 6
505510 struct kvm_pmu {
506511 unsigned nr_arch_gp_counters;
507512 unsigned nr_arch_fixed_counters;
@@ -516,7 +521,7 @@ struct kvm_pmu { · 8 unmodified lines
516521 u64 reserved_bits;
517522 u64 raw_event_mask;
518523 u8 version;
519− struct kvm_pmc gp_counters[INTEL_PMC_MAX_GENERIC];
524+ struct kvm_pmc gp_counters[KVM_INTEL_PMC_MAX_GENERIC];
520525 struct kvm_pmc fixed_counters[KVM_PMC_MAX_FIXED];
521526 struct irq_work irq_work;
522527 DECLARE_BITMAP(reprogram_pmi, X86_PMC_IDX_MAX);
arch/x86/include/asm/msr-index.h+5−3
@@ -535,6 +535,11 @@ · 534 unmodified lines
535535 #define MSR_AMD64_CPUID_FN_1 0xc0011004
536536 #define MSR_AMD64_LS_CFG 0xc0011020
537537 #define MSR_AMD64_DC_CFG 0xc0011022
538+
539+#define MSR_AMD64_DE_CFG 0xc0011029
540+#define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT 1
541+#define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE BIT_ULL(MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT)
542+
538543 #define MSR_AMD64_BU_CFG2 0xc001102a
539544 #define MSR_AMD64_IBSFETCHCTL 0xc0011030
540545 #define MSR_AMD64_IBSFETCHLINAD 0xc0011031
@@ -640,9 +645,6 @@ · 99 unmodified lines
640645 #define FAM10H_MMIO_CONF_BASE_MASK 0xfffffffULL
641646 #define FAM10H_MMIO_CONF_BASE_SHIFT 20
642647 #define MSR_FAM10H_NODE_ID 0xc001100c
643−#define MSR_F10H_DECFG 0xc0011029
644−#define MSR_F10H_DECFG_LFENCE_SERIALIZE_BIT 1
645−#define MSR_F10H_DECFG_LFENCE_SERIALIZE BIT_ULL(MSR_F10H_DECFG_LFENCE_SERIALIZE_BIT)
646648
647649 /* K8 MSRs */
648650 #define MSR_K8_TOP_MEM1 0xc001001a
arch/x86/include/asm/nospec-branch.h+1−1
@@ -321,7 +321,7 @@ static inline void indirect_branch_prediction_barrier(void) · 320 unmodified lines
321321 /* The Intel SPEC CTRL MSR base value cache */
322322 extern u64 x86_spec_ctrl_base;
323323 DECLARE_PER_CPU(u64, x86_spec_ctrl_current);
324−extern void write_spec_ctrl_current(u64 val, bool force);
324+extern void update_spec_ctrl_cond(u64 val);
325325 extern u64 spec_ctrl_current(void);
326326
327327 /*
arch/x86/include/asm/pgtable.h+9−0
@@ -139,6 +139,7 @@ static inline int pmd_dirty(pmd_t pmd) · 138 unmodified lines
139139 return pmd_flags(pmd) & _PAGE_DIRTY;
140140 }
141141
142+#define pmd_young pmd_young
142143 static inline int pmd_young(pmd_t pmd)
143144 {
144145 return pmd_flags(pmd) & _PAGE_ACCESSED;
@@ -1438,6 +1439,14 @@ static inline bool arch_has_hw_pte_young(void) · 1293 unmodified lines
14381439 return true;
14391440 }
14401441
1442+#ifdef CONFIG_XEN_PV
1443+#define arch_has_hw_nonleaf_pmd_young arch_has_hw_nonleaf_pmd_young
1444+static inline bool arch_has_hw_nonleaf_pmd_young(void)
1445+{
1446+ return !cpu_feature_enabled(X86_FEATURE_XENPV);
1447+}
1448+#endif
1449+
14411450 #ifdef CONFIG_PAGE_TABLE_CHECK
14421451 static inline bool pte_user_accessible_page(pte_t pte)
14431452 {
arch/x86/include/asm/qspinlock_paravirt.h+1−1
@@ -37,7 +37,7 @@ __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text"); · 36 unmodified lines
3737 * rsi = lockval (second argument)
3838 * rdx = internal variable (set to 0)
3939 */
40−asm (".pushsection .spinlock.text;"
40+asm (".pushsection .spinlock.text, \"ax\";"
4141 ".globl " PV_UNLOCK ";"
4242 ".type " PV_UNLOCK ", @function;"
4343 ".align 4,0x90;"
arch/x86/include/asm/spec-ctrl.h+5−5
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 * Takes the guest view of SPEC_CTRL MSR as a parameter and also
1414 * the guest's version of VIRT_SPEC_CTRL, if emulated.
1515 */
16−extern void x86_virt_spec_ctrl(u64 guest_spec_ctrl, u64 guest_virt_spec_ctrl, bool guest);
16+extern void x86_virt_spec_ctrl(u64 guest_virt_spec_ctrl, bool guest);
1717
1818 /**
1919 * x86_spec_ctrl_set_guest - Set speculation control registers for the guest
@@ -24,9 +24,9 @@ extern void x86_virt_spec_ctrl(u64 guest_spec_ctrl, u64 guest_virt_spec_ctrl, bo · 4 unmodified lines
2424 * Avoids writing to the MSR if the content/bits are the same
2525 */
2626 static inline
27−void x86_spec_ctrl_set_guest(u64 guest_spec_ctrl, u64 guest_virt_spec_ctrl)
27+void x86_spec_ctrl_set_guest(u64 guest_virt_spec_ctrl)
2828 {
29− x86_virt_spec_ctrl(guest_spec_ctrl, guest_virt_spec_ctrl, true);
29+ x86_virt_spec_ctrl(guest_virt_spec_ctrl, true);
3030 }
3131
3232 /**
@@ -38,9 +38,9 @@ void x86_spec_ctrl_set_guest(u64 guest_spec_ctrl, u64 guest_virt_spec_ctrl) · 5 unmodified lines
3838 * Avoids writing to the MSR if the content/bits are the same
3939 */
4040 static inline
41−void x86_spec_ctrl_restore_host(u64 guest_spec_ctrl, u64 guest_virt_spec_ctrl)
41+void x86_spec_ctrl_restore_host(u64 guest_virt_spec_ctrl)
4242 {
43− x86_virt_spec_ctrl(guest_spec_ctrl, guest_virt_spec_ctrl, false);
43+ x86_virt_spec_ctrl(guest_virt_spec_ctrl, false);
4444 }
4545
4646 /* AMD specific Speculative Store Bypass MSR data */
arch/x86/include/asm/syscall_wrapper.h+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 #ifndef _ASM_X86_SYSCALL_WRAPPER_H
77 #define _ASM_X86_SYSCALL_WRAPPER_H
88
9−struct pt_regs;
9+#include <asm/ptrace.h>
1010
1111 extern long __x64_sys_ni_syscall(const struct pt_regs *regs);
1212 extern long __ia32_sys_ni_syscall(const struct pt_regs *regs);
arch/x86/kernel/asm-offsets.c+0−6
@@ -19,7 +19,6 @@ · 18 unmodified lines
1919 #include <asm/suspend.h>
2020 #include <asm/tlbflush.h>
2121 #include <asm/tdx.h>
22−#include "../kvm/vmx/vmx.h"
2322
2423 #ifdef CONFIG_XEN
2524 #include <xen/interface/xen.h>
@@ -108,9 +107,4 @@ static void __used common(void) · 82 unmodified lines
108107 OFFSET(TSS_sp0, tss_struct, x86_tss.sp0);
109108 OFFSET(TSS_sp1, tss_struct, x86_tss.sp1);
110109 OFFSET(TSS_sp2, tss_struct, x86_tss.sp2);
111−
112− if (IS_ENABLED(CONFIG_KVM_INTEL)) {
113− BLANK();
114− OFFSET(VMX_spec_ctrl, vcpu_vmx, spec_ctrl);
115− }
116110 }
arch/x86/kernel/cpu/amd.c+2−4
@@ -770,8 +770,6 @@ static void init_amd_gh(struct cpuinfo_x86 *c) · 769 unmodified lines
770770 set_cpu_bug(c, X86_BUG_AMD_TLB_MMATCH);
771771 }
772772
773−#define MSR_AMD64_DE_CFG 0xC0011029
774−
775773 static void init_amd_ln(struct cpuinfo_x86 *c)
776774 {
777775 /*
@@ -965,8 +963,8 @@ static void init_amd(struct cpuinfo_x86 *c) · 187 unmodified lines
965963 * msr_set_bit() uses the safe accessors, too, even if the MSR
966964 * is not present.
967965 */
968− msr_set_bit(MSR_F10H_DECFG,
969− MSR_F10H_DECFG_LFENCE_SERIALIZE_BIT);
966+ msr_set_bit(MSR_AMD64_DE_CFG,
967+ MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT);
970968
971969 /* A serializing LFENCE stops RDTSC speculation */
972970 set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC);
arch/x86/kernel/cpu/bugs.c+18−18
@@ -60,11 +60,18 @@ EXPORT_SYMBOL_GPL(x86_spec_ctrl_current); · 59 unmodified lines
6060
6161 static DEFINE_MUTEX(spec_ctrl_mutex);
6262
63+/* Update SPEC_CTRL MSR and its cached copy unconditionally */
64+static void update_spec_ctrl(u64 val)
65+{
66+ this_cpu_write(x86_spec_ctrl_current, val);
67+ wrmsrl(MSR_IA32_SPEC_CTRL, val);
68+}
69+
6370 /*
6471 * Keep track of the SPEC_CTRL MSR value for the current task, which may differ
6572 * from x86_spec_ctrl_base due to STIBP/SSB in __speculation_ctrl_update().
6673 */
67−void write_spec_ctrl_current(u64 val, bool force)
74+void update_spec_ctrl_cond(u64 val)
6875 {
6976 if (this_cpu_read(x86_spec_ctrl_current) == val)
7077 return;
@@ -75,7 +82,7 @@ void write_spec_ctrl_current(u64 val, bool force) · 4 unmodified lines
7582 * When KERNEL_IBRS this MSR is written on return-to-user, unless
7683 * forced the update can be delayed until that time.
7784 */
78− if (force || !cpu_feature_enabled(X86_FEATURE_KERNEL_IBRS))
85+ if (!cpu_feature_enabled(X86_FEATURE_KERNEL_IBRS))
7986 wrmsrl(MSR_IA32_SPEC_CTRL, val);
8087 }
8188
@@ -196,22 +203,15 @@ void __init check_bugs(void) · 114 unmodified lines
196203 }
197204
198205 /*
199− * NOTE: This function is *only* called for SVM. VMX spec_ctrl handling is
200− * done in vmenter.S.
206+ * NOTE: This function is *only* called for SVM, since Intel uses
207+ * MSR_IA32_SPEC_CTRL for SSBD.
201208 */
202209 void
203−x86_virt_spec_ctrl(u64 guest_spec_ctrl, u64 guest_virt_spec_ctrl, bool setguest)
210+x86_virt_spec_ctrl(u64 guest_virt_spec_ctrl, bool setguest)
204211 {
205− u64 msrval, guestval = guest_spec_ctrl, hostval = spec_ctrl_current();
212+ u64 guestval, hostval;
206213 struct thread_info *ti = current_thread_info();
207214
208− if (static_cpu_has(X86_FEATURE_MSR_SPEC_CTRL)) {
209− if (hostval != guestval) {
210− msrval = setguest ? guestval : hostval;
211− wrmsrl(MSR_IA32_SPEC_CTRL, msrval);
212− }
213− }
214−
215215 /*
216216 * If SSBD is not handled in MSR_SPEC_CTRL on AMD, update
217217 * MSR_AMD64_L2_CFG or MSR_VIRT_SPEC_CTRL if supported.
@@ -1335,7 +1335,7 @@ static void __init spec_ctrl_disable_kernel_rrsba(void) · 1117 unmodified lines
13351335
13361336 if (ia32_cap & ARCH_CAP_RRSBA) {
13371337 x86_spec_ctrl_base |= SPEC_CTRL_RRSBA_DIS_S;
1338− write_spec_ctrl_current(x86_spec_ctrl_base, true);
1338+ update_spec_ctrl(x86_spec_ctrl_base);
13391339 }
13401340 }
13411341
@@ -1457,7 +1457,7 @@ static void __init spectre_v2_select_mitigation(void) · 115 unmodified lines
14571457
14581458 if (spectre_v2_in_ibrs_mode(mode)) {
14591459 x86_spec_ctrl_base |= SPEC_CTRL_IBRS;
1460− write_spec_ctrl_current(x86_spec_ctrl_base, true);
1460+ update_spec_ctrl(x86_spec_ctrl_base);
14611461 }
14621462
14631463 switch (mode) {
@@ -1571,7 +1571,7 @@ static void __init spectre_v2_select_mitigation(void) · 107 unmodified lines
15711571 static void update_stibp_msr(void * __unused)
15721572 {
15731573 u64 val = spec_ctrl_current() | (x86_spec_ctrl_base & SPEC_CTRL_STIBP);
1574− write_spec_ctrl_current(val, true);
1574+ update_spec_ctrl(val);
15751575 }
15761576
15771577 /* Update x86_spec_ctrl_base in case SMT state changed. */
@@ -1804,7 +1804,7 @@ static enum ssb_mitigation __init __ssb_select_mitigation(void) · 226 unmodified lines
18041804 x86_amd_ssb_disable();
18051805 } else {
18061806 x86_spec_ctrl_base |= SPEC_CTRL_SSBD;
1807− write_spec_ctrl_current(x86_spec_ctrl_base, true);
1807+ update_spec_ctrl(x86_spec_ctrl_base);
18081808 }
18091809 }
18101810
@@ -2055,7 +2055,7 @@ int arch_prctl_spec_ctrl_get(struct task_struct *task, unsigned long which) · 244 unmodified lines
20552055 void x86_spec_ctrl_setup_ap(void)
20562056 {
20572057 if (boot_cpu_has(X86_FEATURE_MSR_SPEC_CTRL))
2058− write_spec_ctrl_current(x86_spec_ctrl_base, true);
2058+ update_spec_ctrl(x86_spec_ctrl_base);
20592059
20602060 if (ssb_mode == SPEC_STORE_BYPASS_DISABLE)
20612061 x86_amd_ssb_disable();
arch/x86/kernel/cpu/hygon.c+2−2
@@ -326,8 +326,8 @@ static void init_hygon(struct cpuinfo_x86 *c) · 325 unmodified lines
326326 * msr_set_bit() uses the safe accessors, too, even if the MSR
327327 * is not present.
328328 */
329− msr_set_bit(MSR_F10H_DECFG,
330− MSR_F10H_DECFG_LFENCE_SERIALIZE_BIT);
329+ msr_set_bit(MSR_AMD64_DE_CFG,
330+ MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT);
331331
332332 /* A serializing LFENCE stops RDTSC speculation */
333333 set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC);
arch/x86/kernel/cpu/sgx/ioctl.c+3−0
@@ -356,6 +356,9 @@ static int sgx_validate_offset_length(struct sgx_encl *encl, · 355 unmodified lines
356356 if (!length || !IS_ALIGNED(length, PAGE_SIZE))
357357 return -EINVAL;
358358
359+ if (offset + length < offset)
360+ return -EINVAL;
361+
359362 if (offset + length - PAGE_SIZE >= encl->size)
360363 return -EINVAL;
361364
arch/x86/kernel/cpu/tsx.c+17−21
@@ -58,24 +58,6 @@ static void tsx_enable(void) · 57 unmodified lines
5858 wrmsrl(MSR_IA32_TSX_CTRL, tsx);
5959 }
6060
61−static bool tsx_ctrl_is_supported(void)
62−{
63− u64 ia32_cap = x86_read_arch_cap_msr();
64−
65− /*
66− * TSX is controlled via MSR_IA32_TSX_CTRL. However, support for this
67− * MSR is enumerated by ARCH_CAP_TSX_MSR bit in MSR_IA32_ARCH_CAPABILITIES.
68− *
69− * TSX control (aka MSR_IA32_TSX_CTRL) is only available after a
70− * microcode update on CPUs that have their MSR_IA32_ARCH_CAPABILITIES
71− * bit MDS_NO=1. CPUs with MDS_NO=0 are not planned to get
72− * MSR_IA32_TSX_CTRL support even after a microcode update. Thus,
73− * tsx= cmdline requests will do nothing on CPUs without
74− * MSR_IA32_TSX_CTRL support.
75− */
76− return !!(ia32_cap & ARCH_CAP_TSX_CTRL_MSR);
77−}
78−
7961 static enum tsx_ctrl_states x86_get_tsx_auto_mode(void)
8062 {
8163 if (boot_cpu_has_bug(X86_BUG_TAA))
@@ -135,7 +117,7 @@ static void tsx_clear_cpuid(void) · 53 unmodified lines
135117 rdmsrl(MSR_TSX_FORCE_ABORT, msr);
136118 msr |= MSR_TFA_TSX_CPUID_CLEAR;
137119 wrmsrl(MSR_TSX_FORCE_ABORT, msr);
138− } else if (tsx_ctrl_is_supported()) {
120+ } else if (cpu_feature_enabled(X86_FEATURE_MSR_TSX_CTRL)) {
139121 rdmsrl(MSR_IA32_TSX_CTRL, msr);
140122 msr |= TSX_CTRL_CPUID_CLEAR;
141123 wrmsrl(MSR_IA32_TSX_CTRL, msr);
@@ -158,7 +140,8 @@ static void tsx_dev_mode_disable(void) · 16 unmodified lines
158140 u64 mcu_opt_ctrl;
159141
160142 /* Check if RTM_ALLOW exists */
161− if (!boot_cpu_has_bug(X86_BUG_TAA) || !tsx_ctrl_is_supported() ||
143+ if (!boot_cpu_has_bug(X86_BUG_TAA) ||
144+ !cpu_feature_enabled(X86_FEATURE_MSR_TSX_CTRL) ||
162145 !cpu_feature_enabled(X86_FEATURE_SRBDS_CTRL))
163146 return;
164147
@@ -191,7 +174,20 @@ void __init tsx_init(void) · 26 unmodified lines
191174 return;
192175 }
193176
194− if (!tsx_ctrl_is_supported()) {
177+ /*
178+ * TSX is controlled via MSR_IA32_TSX_CTRL. However, support for this
179+ * MSR is enumerated by ARCH_CAP_TSX_MSR bit in MSR_IA32_ARCH_CAPABILITIES.
180+ *
181+ * TSX control (aka MSR_IA32_TSX_CTRL) is only available after a
182+ * microcode update on CPUs that have their MSR_IA32_ARCH_CAPABILITIES
183+ * bit MDS_NO=1. CPUs with MDS_NO=0 are not planned to get
184+ * MSR_IA32_TSX_CTRL support even after a microcode update. Thus,
185+ * tsx= cmdline requests will do nothing on CPUs without
186+ * MSR_IA32_TSX_CTRL support.
187+ */
188+ if (x86_read_arch_cap_msr() & ARCH_CAP_TSX_CTRL_MSR) {
189+ setup_force_cpu_cap(X86_FEATURE_MSR_TSX_CTRL);
190+ } else {
195191 tsx_ctrl_state = TSX_CTRL_NOT_SUPPORTED;
196192 return;
197193 }
arch/x86/kernel/fpu/core.c+1−1
@@ -605,9 +605,9 @@ int fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal) · 604 unmodified lines
605605 if (test_thread_flag(TIF_NEED_FPU_LOAD))
606606 fpregs_restore_userregs();
607607 save_fpregs_to_fpstate(dst_fpu);
608+ fpregs_unlock();
608609 if (!(clone_flags & CLONE_THREAD))
609610 fpu_inherit_perms(dst_fpu);
610− fpregs_unlock();
611611
612612 /*
613613 * Children never inherit PASID state.
arch/x86/kernel/process.c+1−1
@@ -600,7 +600,7 @@ static __always_inline void __speculation_ctrl_update(unsigned long tifp, · 599 unmodified lines
600600 }
601601
602602 if (updmsr)
603− write_spec_ctrl_current(msr, false);
603+ update_spec_ctrl_cond(msr);
604604 }
605605
606606 static unsigned long speculation_ctrl_update_tif(struct task_struct *tsk)
arch/x86/kernel/traps.c+7−0
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <linux/context_tracking.h>
1616 #include <linux/interrupt.h>
1717 #include <linux/kallsyms.h>
18+#include <linux/kmsan.h>
1819 #include <linux/spinlock.h>
1920 #include <linux/kprobes.h>
2021 #include <linux/uaccess.h>
@@ -301,6 +302,12 @@ static noinstr bool handle_bug(struct pt_regs *regs) · 280 unmodified lines
301302 {
302303 bool handled = false;
303304
305+ /*
306+ * Normally @regs are unpoisoned by irqentry_enter(), but handle_bug()
307+ * is a rare case that uses @regs without passing them to
308+ * irqentry_enter().
309+ */
310+ kmsan_unpoison_entry_regs(regs);
304311 if (!is_valid_bugaddr(regs->ip))
305312 return handled;
306313
arch/x86/kvm/.gitignore+2−0
@@ -0,0 +1,2 @@
1+/kvm-asm-offsets.s
2+/kvm-asm-offsets.h
arch/x86/kvm/Makefile+12−0
@@ -34,3 +34,15 @@ endif · 33 unmodified lines
3434 obj-$(CONFIG_KVM) += kvm.o
3535 obj-$(CONFIG_KVM_INTEL) += kvm-intel.o
3636 obj-$(CONFIG_KVM_AMD) += kvm-amd.o
37+
38+AFLAGS_svm/vmenter.o := -iquote $(obj)
39+$(obj)/svm/vmenter.o: $(obj)/kvm-asm-offsets.h
40+
41+AFLAGS_vmx/vmenter.o := -iquote $(obj)
42+$(obj)/vmx/vmenter.o: $(obj)/kvm-asm-offsets.h
43+
44+$(obj)/kvm-asm-offsets.h: $(obj)/kvm-asm-offsets.s FORCE
45+ $(call filechk,offsets,__KVM_ASM_OFFSETS_H__)
46+
47+targets += kvm-asm-offsets.s
48+clean-files += kvm-asm-offsets.h
arch/x86/kvm/cpuid.c+10−3
@@ -1133,11 +1133,13 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) · 1132 unmodified lines
11331133 entry->eax = max(entry->eax, 0x80000021);
11341134 break;
11351135 case 0x80000001:
1136+ entry->ebx &= ~GENMASK(27, 16);
11361137 cpuid_entry_override(entry, CPUID_8000_0001_EDX);
11371138 cpuid_entry_override(entry, CPUID_8000_0001_ECX);
11381139 break;
11391140 case 0x80000006:
1140− /* L2 cache and TLB: pass through host info. */
1141+ /* Drop reserved bits, pass host L2 cache and TLB info. */
1142+ entry->edx &= ~GENMASK(17, 16);
11411143 break;
11421144 case 0x80000007: /* Advanced power management */
11431145 /* invariant TSC is CPUID.80000007H:EDX[8] */
@@ -1167,6 +1169,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) · 23 unmodified lines
11671169 g_phys_as = phys_as;
11681170
11691171 entry->eax = g_phys_as | (virt_as << 8);
1172+ entry->ecx &= ~(GENMASK(31, 16) | GENMASK(11, 8));
11701173 entry->edx = 0;
11711174 cpuid_entry_override(entry, CPUID_8000_0008_EBX);
11721175 break;
@@ -1186,6 +1189,9 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) · 13 unmodified lines
11861189 entry->ecx = entry->edx = 0;
11871190 break;
11881191 case 0x8000001a:
1192+ entry->eax &= GENMASK(2, 0);
1193+ entry->ebx = entry->ecx = entry->edx = 0;
1194+ break;
11891195 case 0x8000001e:
11901196 break;
11911197 case 0x8000001F:
@@ -1193,7 +1199,8 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) · 1 unmodified line
11931199 entry->eax = entry->ebx = entry->ecx = entry->edx = 0;
11941200 } else {
11951201 cpuid_entry_override(entry, CPUID_8000_001F_EAX);
1196−
1202+ /* Clear NumVMPL since KVM does not support VMPL. */
1203+ entry->ebx &= ~GENMASK(31, 12);
11971204 /*
11981205 * Enumerate '0' for "PA bits reduction", the adjusted
11991206 * MAXPHYADDR is enumerated directly (see 0x80000008).
@@ -1331,7 +1338,7 @@ int kvm_dev_ioctl_get_cpuid(struct kvm_cpuid2 *cpuid, · 131 unmodified lines
13311338 if (sanity_check_entries(entries, cpuid->nent, type))
13321339 return -EINVAL;
13331340
1334− array.entries = kvcalloc(sizeof(struct kvm_cpuid_entry2), cpuid->nent, GFP_KERNEL);
1341+ array.entries = kvcalloc(cpuid->nent, sizeof(struct kvm_cpuid_entry2), GFP_KERNEL);
13351342 if (!array.entries)
13361343 return -ENOMEM;
13371344
arch/x86/kvm/debugfs.c+6−1
@@ -158,11 +158,16 @@ out: · 157 unmodified lines
158158 static int kvm_mmu_rmaps_stat_open(struct inode *inode, struct file *file)
159159 {
160160 struct kvm *kvm = inode->i_private;
161+ int r;
161162
162163 if (!kvm_get_kvm_safe(kvm))
163164 return -ENOENT;
164165
165− return single_open(file, kvm_mmu_rmaps_stat_show, kvm);
166+ r = single_open(file, kvm_mmu_rmaps_stat_show, kvm);
167+ if (r < 0)
168+ kvm_put_kvm(kvm);
169+
170+ return r;
166171 }
167172
168173 static int kvm_mmu_rmaps_stat_release(struct inode *inode, struct file *file)
arch/x86/kvm/emulate.c+76−32
@@ -791,8 +791,7 @@ static int linearize(struct x86_emulate_ctxt *ctxt, · 790 unmodified lines
791791 ctxt->mode, linear);
792792 }
793793
794−static inline int assign_eip(struct x86_emulate_ctxt *ctxt, ulong dst,
795− enum x86emul_mode mode)
794+static inline int assign_eip(struct x86_emulate_ctxt *ctxt, ulong dst)
796795 {
797796 ulong linear;
798797 int rc;
@@ -802,41 +801,71 @@ static inline int assign_eip(struct x86_emulate_ctxt *ctxt, ulong dst, · 3 unmodified lines
802801
803802 if (ctxt->op_bytes != sizeof(unsigned long))
804803 addr.ea = dst & ((1UL << (ctxt->op_bytes << 3)) - 1);
805− rc = __linearize(ctxt, addr, &max_size, 1, false, true, mode, &linear);
804+ rc = __linearize(ctxt, addr, &max_size, 1, false, true, ctxt->mode, &linear);
806805 if (rc == X86EMUL_CONTINUE)
807806 ctxt->_eip = addr.ea;
808807 return rc;
809808 }
810809
810+static inline int emulator_recalc_and_set_mode(struct x86_emulate_ctxt *ctxt)
811+{
812+ u64 efer;
813+ struct desc_struct cs;
814+ u16 selector;
815+ u32 base3;
816+
817+ ctxt->ops->get_msr(ctxt, MSR_EFER, &efer);
818+
819+ if (!(ctxt->ops->get_cr(ctxt, 0) & X86_CR0_PE)) {
820+ /* Real mode. cpu must not have long mode active */
821+ if (efer & EFER_LMA)
822+ return X86EMUL_UNHANDLEABLE;
823+ ctxt->mode = X86EMUL_MODE_REAL;
824+ return X86EMUL_CONTINUE;
825+ }
826+
827+ if (ctxt->eflags & X86_EFLAGS_VM) {
828+ /* Protected/VM86 mode. cpu must not have long mode active */
829+ if (efer & EFER_LMA)
830+ return X86EMUL_UNHANDLEABLE;
831+ ctxt->mode = X86EMUL_MODE_VM86;
832+ return X86EMUL_CONTINUE;
833+ }
834+
835+ if (!ctxt->ops->get_segment(ctxt, &selector, &cs, &base3, VCPU_SREG_CS))
836+ return X86EMUL_UNHANDLEABLE;
837+
838+ if (efer & EFER_LMA) {
839+ if (cs.l) {
840+ /* Proper long mode */
841+ ctxt->mode = X86EMUL_MODE_PROT64;
842+ } else if (cs.d) {
843+ /* 32 bit compatibility mode*/
844+ ctxt->mode = X86EMUL_MODE_PROT32;
845+ } else {
846+ ctxt->mode = X86EMUL_MODE_PROT16;
847+ }
848+ } else {
849+ /* Legacy 32 bit / 16 bit mode */
850+ ctxt->mode = cs.d ? X86EMUL_MODE_PROT32 : X86EMUL_MODE_PROT16;
851+ }
852+
853+ return X86EMUL_CONTINUE;
854+}
855+
811856 static inline int assign_eip_near(struct x86_emulate_ctxt *ctxt, ulong dst)
812857 {
813− return assign_eip(ctxt, dst, ctxt->mode);
858+ return assign_eip(ctxt, dst);
814859 }
815860
816−static int assign_eip_far(struct x86_emulate_ctxt *ctxt, ulong dst,
817− const struct desc_struct *cs_desc)
861+static int assign_eip_far(struct x86_emulate_ctxt *ctxt, ulong dst)
818862 {
819− enum x86emul_mode mode = ctxt->mode;
820− int rc;
863+ int rc = emulator_recalc_and_set_mode(ctxt);
821864
822−#ifdef CONFIG_X86_64
823− if (ctxt->mode >= X86EMUL_MODE_PROT16) {
824− if (cs_desc->l) {
825− u64 efer = 0;
865+ if (rc != X86EMUL_CONTINUE)
866+ return rc;
826867
827− ctxt->ops->get_msr(ctxt, MSR_EFER, &efer);
828− if (efer & EFER_LMA)
829− mode = X86EMUL_MODE_PROT64;
830− } else
831− mode = X86EMUL_MODE_PROT32; /* temporary value */
832− }
833−#endif
834− if (mode == X86EMUL_MODE_PROT16 || mode == X86EMUL_MODE_PROT32)
835− mode = cs_desc->d ? X86EMUL_MODE_PROT32 : X86EMUL_MODE_PROT16;
836− rc = assign_eip(ctxt, dst, mode);
837− if (rc == X86EMUL_CONTINUE)
838− ctxt->mode = mode;
839− return rc;
868+ return assign_eip(ctxt, dst);
840869 }
841870
842871 static inline int jmp_rel(struct x86_emulate_ctxt *ctxt, int rel)
@@ -2172,7 +2201,7 @@ static int em_jmp_far(struct x86_emulate_ctxt *ctxt) · 1329 unmodified lines
21722201 if (rc != X86EMUL_CONTINUE)
21732202 return rc;
21742203
2175− rc = assign_eip_far(ctxt, ctxt->src.val, &new_desc);
2204+ rc = assign_eip_far(ctxt, ctxt->src.val);
21762205 /* Error handling is not implemented. */
21772206 if (rc != X86EMUL_CONTINUE)
21782207 return X86EMUL_UNHANDLEABLE;
@@ -2250,7 +2279,7 @@ static int em_ret_far(struct x86_emulate_ctxt *ctxt) · 71 unmodified lines
22502279 &new_desc);
22512280 if (rc != X86EMUL_CONTINUE)
22522281 return rc;
2253− rc = assign_eip_far(ctxt, eip, &new_desc);
2282+ rc = assign_eip_far(ctxt, eip);
22542283 /* Error handling is not implemented. */
22552284 if (rc != X86EMUL_CONTINUE)
22562285 return X86EMUL_UNHANDLEABLE;
@@ -2432,7 +2461,7 @@ static int rsm_load_state_32(struct x86_emulate_ctxt *ctxt, · 175 unmodified lines
24322461 ctxt->eflags = GET_SMSTATE(u32, smstate, 0x7ff4) | X86_EFLAGS_FIXED;
24332462 ctxt->_eip = GET_SMSTATE(u32, smstate, 0x7ff0);
24342463
2435− for (i = 0; i < NR_EMULATOR_GPRS; i++)
2464+ for (i = 0; i < 8; i++)
24362465 *reg_write(ctxt, i) = GET_SMSTATE(u32, smstate, 0x7fd0 + i * 4);
24372466
24382467 val = GET_SMSTATE(u32, smstate, 0x7fcc);
@@ -2489,7 +2518,7 @@ static int rsm_load_state_64(struct x86_emulate_ctxt *ctxt, · 50 unmodified lines
24892518 u16 selector;
24902519 int i, r;
24912520
2492− for (i = 0; i < NR_EMULATOR_GPRS; i++)
2521+ for (i = 0; i < 16; i++)
24932522 *reg_write(ctxt, i) = GET_SMSTATE(u64, smstate, 0x7ff8 - i * 8);
24942523
24952524 ctxt->_eip = GET_SMSTATE(u64, smstate, 0x7f78);
@@ -2633,7 +2662,7 @@ static int em_rsm(struct x86_emulate_ctxt *ctxt) · 137 unmodified lines
26332662 * those side effects need to be explicitly handled for both success
26342663 * and shutdown.
26352664 */
2636− return X86EMUL_CONTINUE;
2665+ return emulator_recalc_and_set_mode(ctxt);
26372666
26382667 emulate_shutdown:
26392668 ctxt->ops->triple_fault(ctxt);
@@ -2876,6 +2905,7 @@ static int em_sysexit(struct x86_emulate_ctxt *ctxt) · 236 unmodified lines
28762905 ops->set_segment(ctxt, ss_sel, &ss, 0, VCPU_SREG_SS);
28772906
28782907 ctxt->_eip = rdx;
2908+ ctxt->mode = usermode;
28792909 *reg_write(ctxt, VCPU_REGS_RSP) = rcx;
28802910
28812911 return X86EMUL_CONTINUE;
@@ -3469,7 +3499,7 @@ static int em_call_far(struct x86_emulate_ctxt *ctxt) · 587 unmodified lines
34693499 if (rc != X86EMUL_CONTINUE)
34703500 return rc;
34713501
3472− rc = assign_eip_far(ctxt, ctxt->src.val, &new_desc);
3502+ rc = assign_eip_far(ctxt, ctxt->src.val);
34733503 if (rc != X86EMUL_CONTINUE)
34743504 goto fail;
34753505
@@ -3611,11 +3641,25 @@ static int em_movbe(struct x86_emulate_ctxt *ctxt) · 135 unmodified lines
36113641
36123642 static int em_cr_write(struct x86_emulate_ctxt *ctxt)
36133643 {
3614− if (ctxt->ops->set_cr(ctxt, ctxt->modrm_reg, ctxt->src.val))
3644+ int cr_num = ctxt->modrm_reg;
3645+ int r;
3646+
3647+ if (ctxt->ops->set_cr(ctxt, cr_num, ctxt->src.val))
36153648 return emulate_gp(ctxt, 0);
36163649
36173650 /* Disable writeback. */
36183651 ctxt->dst.type = OP_NONE;
3652+
3653+ if (cr_num == 0) {
3654+ /*
3655+ * CR0 write might have updated CR0.PE and/or CR0.PG
3656+ * which can affect the cpu's execution mode.
3657+ */
3658+ r = emulator_recalc_and_set_mode(ctxt);
3659+ if (r != X86EMUL_CONTINUE)
3660+ return r;
3661+ }
3662+
36193663 return X86EMUL_CONTINUE;
36203664 }
36213665
arch/x86/kvm/kvm-asm-offsets.c+29−0
@@ -0,0 +1,29 @@
1+// SPDX-License-Identifier: GPL-2.0
2+/*
3+ * Generate definitions needed by assembly language modules.
4+ * This code generates raw asm output which is post-processed to extract
5+ * and format the required data.
6+ */
7+#define COMPILE_OFFSETS
8+
9+#include <linux/kbuild.h>
10+#include "vmx/vmx.h"
11+#include "svm/svm.h"
12+
13+static void __used common(void)
14+{
15+ if (IS_ENABLED(CONFIG_KVM_AMD)) {
16+ BLANK();
17+ OFFSET(SVM_vcpu_arch_regs, vcpu_svm, vcpu.arch.regs);
18+ OFFSET(SVM_current_vmcb, vcpu_svm, current_vmcb);
19+ OFFSET(SVM_spec_ctrl, vcpu_svm, spec_ctrl);
20+ OFFSET(SVM_vmcb01, vcpu_svm, vmcb01);
21+ OFFSET(KVM_VMCB_pa, kvm_vmcb_info, pa);
22+ OFFSET(SD_save_area_pa, svm_cpu_data, save_area_pa);
23+ }
24+
25+ if (IS_ENABLED(CONFIG_KVM_INTEL)) {
26+ BLANK();
27+ OFFSET(VMX_spec_ctrl, vcpu_vmx, spec_ctrl);
28+ }
29+}
arch/x86/kvm/mmu/mmu.c+9−8
@@ -2443,6 +2443,7 @@ static bool __kvm_mmu_prepare_zap_page(struct kvm *kvm, · 2442 unmodified lines
24432443 {
24442444 bool list_unstable, zapped_root = false;
24452445
2446+ lockdep_assert_held_write(&kvm->mmu_lock);
24462447 trace_kvm_mmu_prepare_zap_page(sp);
24472448 ++kvm->stat.mmu_shadow_zapped;
24482449 *nr_zapped = mmu_zap_unsync_children(kvm, sp, invalid_list);
@@ -4262,14 +4263,14 @@ static int direct_page_fault(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault · 1813 unmodified lines
42624263 if (is_page_fault_stale(vcpu, fault, mmu_seq))
42634264 goto out_unlock;
42644265
4265− r = make_mmu_pages_available(vcpu);
4266− if (r)
4267− goto out_unlock;
4268−
4269− if (is_tdp_mmu_fault)
4266+ if (is_tdp_mmu_fault) {
42704267 r = kvm_tdp_mmu_map(vcpu, fault);
4271− else
4268+ } else {
4269+ r = make_mmu_pages_available(vcpu);
4270+ if (r)
4271+ goto out_unlock;
42724272 r = __direct_map(vcpu, fault);
4273+ }
42734274
42744275 out_unlock:
42754276 if (is_tdp_mmu_fault)
@@ -6056,7 +6057,7 @@ void kvm_zap_gfn_range(struct kvm *kvm, gfn_t gfn_start, gfn_t gfn_end) · 1780 unmodified lines
60566057
60576058 write_lock(&kvm->mmu_lock);
60586059
6059− kvm_mmu_invalidate_begin(kvm, gfn_start, gfn_end);
6060+ kvm_mmu_invalidate_begin(kvm, 0, -1ul);
60606061
60616062 flush = kvm_rmap_zap_gfn_range(kvm, gfn_start, gfn_end);
60626063
@@ -6070,7 +6071,7 @@ void kvm_zap_gfn_range(struct kvm *kvm, gfn_t gfn_start, gfn_t gfn_end) · 7 unmodified lines
60706071 kvm_flush_remote_tlbs_with_address(kvm, gfn_start,
60716072 gfn_end - gfn_start);
60726073
6073− kvm_mmu_invalidate_end(kvm, gfn_start, gfn_end);
6074+ kvm_mmu_invalidate_end(kvm, 0, -1ul);
60746075
60756076 write_unlock(&kvm->mmu_lock);
60766077 }
arch/x86/kvm/pmu.c+1−1
@@ -56,7 +56,7 @@ static const struct x86_cpu_id vmx_icl_pebs_cpu[] = { · 55 unmodified lines
5656 * code. Each pmc, stored in kvm_pmc.idx field, is unique across
5757 * all perf counters (both gp and fixed). The mapping relationship
5858 * between pmc and perf counters is as the following:
59− * * Intel: [0 .. INTEL_PMC_MAX_GENERIC-1] <=> gp counters
59+ * * Intel: [0 .. KVM_INTEL_PMC_MAX_GENERIC-1] <=> gp counters
6060 * [INTEL_PMC_IDX_FIXED .. INTEL_PMC_IDX_FIXED + 2] <=> fixed
6161 * * AMD: [0 .. AMD64_NUM_COUNTERS-1] and, for families 15H
6262 * and later, [0 .. AMD64_NUM_COUNTERS_CORE-1] <=> gp counters
arch/x86/kvm/svm/nested.c+9−3
@@ -1091,6 +1091,12 @@ int nested_svm_vmexit(struct vcpu_svm *svm) · 1090 unmodified lines
10911091
10921092 static void nested_svm_triple_fault(struct kvm_vcpu *vcpu)
10931093 {
1094+ struct vcpu_svm *svm = to_svm(vcpu);
1095+
1096+ if (!vmcb12_is_intercept(&svm->nested.ctl, INTERCEPT_SHUTDOWN))
1097+ return;
1098+
1099+ kvm_clear_request(KVM_REQ_TRIPLE_FAULT, vcpu);
10941100 nested_svm_simple_vmexit(to_svm(vcpu), SVM_EXIT_SHUTDOWN);
10951101 }
10961102
@@ -1125,6 +1131,9 @@ void svm_free_nested(struct vcpu_svm *svm) · 28 unmodified lines
11251131 if (!svm->nested.initialized)
11261132 return;
11271133
1134+ if (WARN_ON_ONCE(svm->vmcb != svm->vmcb01.ptr))
1135+ svm_switch_vmcb(svm, &svm->vmcb01);
1136+
11281137 svm_vcpu_free_msrpm(svm->nested.msrpm);
11291138 svm->nested.msrpm = NULL;
11301139
@@ -1143,9 +1152,6 @@ void svm_free_nested(struct vcpu_svm *svm) · 12 unmodified lines
11431152 svm->nested.initialized = false;
11441153 }
11451154
1146−/*
1147− * Forcibly leave nested mode in order to be able to reset the VCPU later on.
1148− */
11491155 void svm_leave_nested(struct kvm_vcpu *vcpu)
11501156 {
11511157 struct vcpu_svm *svm = to_svm(vcpu);
arch/x86/kvm/svm/pmu.c+4−3
@@ -192,9 +192,10 @@ static void amd_pmu_init(struct kvm_vcpu *vcpu) · 191 unmodified lines
192192 struct kvm_pmu *pmu = vcpu_to_pmu(vcpu);
193193 int i;
194194
195− BUILD_BUG_ON(AMD64_NUM_COUNTERS_CORE > INTEL_PMC_MAX_GENERIC);
195+ BUILD_BUG_ON(KVM_AMD_PMC_MAX_GENERIC > AMD64_NUM_COUNTERS_CORE);
196+ BUILD_BUG_ON(KVM_AMD_PMC_MAX_GENERIC > INTEL_PMC_MAX_GENERIC);
196197
197− for (i = 0; i < AMD64_NUM_COUNTERS_CORE ; i++) {
198+ for (i = 0; i < KVM_AMD_PMC_MAX_GENERIC ; i++) {
198199 pmu->gp_counters[i].type = KVM_PMC_GP;
199200 pmu->gp_counters[i].vcpu = vcpu;
200201 pmu->gp_counters[i].idx = i;
@@ -207,7 +208,7 @@ static void amd_pmu_reset(struct kvm_vcpu *vcpu) · 6 unmodified lines
207208 struct kvm_pmu *pmu = vcpu_to_pmu(vcpu);
208209 int i;
209210
210− for (i = 0; i < AMD64_NUM_COUNTERS_CORE; i++) {
211+ for (i = 0; i < KVM_AMD_PMC_MAX_GENERIC; i++) {
211212 struct kvm_pmc *pmc = &pmu->gp_counters[i];
212213
213214 pmc_stop_counter(pmc);
arch/x86/kvm/svm/sev.c+3−3
@@ -196,7 +196,7 @@ static void sev_asid_free(struct kvm_sev_info *sev) · 195 unmodified lines
196196 __set_bit(sev->asid, sev_reclaim_asid_bitmap);
197197
198198 for_each_possible_cpu(cpu) {
199− sd = per_cpu(svm_data, cpu);
199+ sd = per_cpu_ptr(&svm_data, cpu);
200200 sd->sev_vmcbs[sev->asid] = NULL;
201201 }
202202
@@ -605,7 +605,7 @@ static int sev_es_sync_vmsa(struct vcpu_svm *svm) · 402 unmodified lines
605605 save->dr6 = svm->vcpu.arch.dr6;
606606
607607 pr_debug("Virtual Machine Save Area (VMSA):\n");
608− print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1, save, sizeof(*save), false);
608+ print_hex_dump_debug("", DUMP_PREFIX_NONE, 16, 1, save, sizeof(*save), false);
609609
610610 return 0;
611611 }
@@ -2600,7 +2600,7 @@ void sev_es_unmap_ghcb(struct vcpu_svm *svm) · 1988 unmodified lines
26002600
26012601 void pre_sev_run(struct vcpu_svm *svm, int cpu)
26022602 {
2603− struct svm_cpu_data *sd = per_cpu(svm_data, cpu);
2603+ struct svm_cpu_data *sd = per_cpu_ptr(&svm_data, cpu);
26042604 int asid = sev_get_asid(svm->vcpu.kvm);
26052605
26062606 /* Assign the asid allocated with this SEV guest */
arch/x86/kvm/svm/svm.c+42−89
@@ -245,7 +245,7 @@ struct kvm_ldttss_desc { · 244 unmodified lines
245245 u32 zero1;
246246 } __attribute__((packed));
247247
248−DEFINE_PER_CPU(struct svm_cpu_data *, svm_data);
248+DEFINE_PER_CPU(struct svm_cpu_data, svm_data);
249249
250250 /*
251251 * Only MSR_TSC_AUX is switched via the user return hook. EFER is switched via
@@ -346,12 +346,6 @@ int svm_set_efer(struct kvm_vcpu *vcpu, u64 efer) · 94 unmodified lines
346346 return 0;
347347 }
348348
349−static int is_external_interrupt(u32 info)
350−{
351− info &= SVM_EVTINJ_TYPE_MASK | SVM_EVTINJ_VALID;
352− return info == (SVM_EVTINJ_VALID | SVM_EVTINJ_TYPE_INTR);
353−}
354−
355349 static u32 svm_get_interrupt_shadow(struct kvm_vcpu *vcpu)
356350 {
357351 struct vcpu_svm *svm = to_svm(vcpu);
@@ -581,12 +575,7 @@ static int svm_hardware_enable(void) · 223 unmodified lines
581575 pr_err("%s: err EOPNOTSUPP on %d\n", __func__, me);
582576 return -EINVAL;
583577 }
584− sd = per_cpu(svm_data, me);
585− if (!sd) {
586− pr_err("%s: svm_data is NULL on %d\n", __func__, me);
587− return -EINVAL;
588− }
589−
578+ sd = per_cpu_ptr(&svm_data, me);
590579 sd->asid_generation = 1;
591580 sd->max_asid = cpuid_ebx(SVM_CPUID_FUNC) - 1;
592581 sd->next_asid = sd->max_asid + 1;
@@ -597,7 +586,7 @@ static int svm_hardware_enable(void) · 4 unmodified lines
597586
598587 wrmsrl(MSR_EFER, efer | EFER_SVME);
599588
600− wrmsrl(MSR_VM_HSAVE_PA, __sme_page_pa(sd->save_area));
589+ wrmsrl(MSR_VM_HSAVE_PA, sd->save_area_pa);
601590
602591 if (static_cpu_has(X86_FEATURE_TSCRATEMSR)) {
603592 /*
@@ -646,42 +635,37 @@ static int svm_hardware_enable(void) · 42 unmodified lines
646635
647636 static void svm_cpu_uninit(int cpu)
648637 {
649− struct svm_cpu_data *sd = per_cpu(svm_data, cpu);
638+ struct svm_cpu_data *sd = per_cpu_ptr(&svm_data, cpu);
650639
651− if (!sd)
640+ if (!sd->save_area)
652641 return;
653642
654− per_cpu(svm_data, cpu) = NULL;
655643 kfree(sd->sev_vmcbs);
656644 __free_page(sd->save_area);
657− kfree(sd);
645+ sd->save_area_pa = 0;
646+ sd->save_area = NULL;
658647 }
659648
660649 static int svm_cpu_init(int cpu)
661650 {
662− struct svm_cpu_data *sd;
651+ struct svm_cpu_data *sd = per_cpu_ptr(&svm_data, cpu);
663652 int ret = -ENOMEM;
664653
665− sd = kzalloc(sizeof(struct svm_cpu_data), GFP_KERNEL);
666− if (!sd)
667− return ret;
668− sd->cpu = cpu;
654+ memset(sd, 0, sizeof(struct svm_cpu_data));
669655 sd->save_area = alloc_page(GFP_KERNEL | __GFP_ZERO);
670656 if (!sd->save_area)
671− goto free_cpu_data;
657+ return ret;
672658
673659 ret = sev_cpu_init(sd);
674660 if (ret)
675661 goto free_save_area;
676662
677− per_cpu(svm_data, cpu) = sd;
678−
663+ sd->save_area_pa = __sme_page_pa(sd->save_area);
679664 return 0;
680665
681666 free_save_area:
682667 __free_page(sd->save_area);
683−free_cpu_data:
684− kfree(sd);
668+ sd->save_area = NULL;
685669 return ret;
686670
687671 }
@@ -730,6 +714,15 @@ static bool msr_write_intercepted(struct kvm_vcpu *vcpu, u32 msr) · 42 unmodified lines
730714 u32 offset;
731715 u32 *msrpm;
732716
717+ /*
718+ * For non-nested case:
719+ * If the L01 MSR bitmap does not intercept the MSR, then we need to
720+ * save it.
721+ *
722+ * For nested case:
723+ * If the L02 MSR bitmap does not intercept the MSR, then we need to
724+ * save it.
725+ */
733726 msrpm = is_guest_mode(vcpu) ? to_svm(vcpu)->nested.msrpm:
734727 to_svm(vcpu)->msrpm;
735728
@@ -1425,7 +1418,7 @@ static void svm_clear_current_vmcb(struct vmcb *vmcb) · 689 unmodified lines
14251418 int i;
14261419
14271420 for_each_online_cpu(i)
1428− cmpxchg(&per_cpu(svm_data, i)->current_vmcb, vmcb, NULL);
1421+ cmpxchg(per_cpu_ptr(&svm_data.current_vmcb, i), vmcb, NULL);
14291422 }
14301423
14311424 static void svm_vcpu_free(struct kvm_vcpu *vcpu)
@@ -1439,6 +1432,7 @@ static void svm_vcpu_free(struct kvm_vcpu *vcpu) · 7 unmodified lines
14391432 */
14401433 svm_clear_current_vmcb(svm->vmcb);
14411434
1435+ svm_leave_nested(vcpu);
14421436 svm_free_nested(svm);
14431437
14441438 sev_free_vcpu(vcpu);
@@ -1450,7 +1444,7 @@ static void svm_vcpu_free(struct kvm_vcpu *vcpu) · 5 unmodified lines
14501444 static void svm_prepare_switch_to_guest(struct kvm_vcpu *vcpu)
14511445 {
14521446 struct vcpu_svm *svm = to_svm(vcpu);
1453− struct svm_cpu_data *sd = per_cpu(svm_data, vcpu->cpu);
1447+ struct svm_cpu_data *sd = per_cpu_ptr(&svm_data, vcpu->cpu);
14541448
14551449 if (sev_es_guest(vcpu->kvm))
14561450 sev_es_unmap_ghcb(svm);
@@ -1462,7 +1456,7 @@ static void svm_prepare_switch_to_guest(struct kvm_vcpu *vcpu) · 5 unmodified lines
14621456 * Save additional host state that will be restored on VMEXIT (sev-es)
14631457 * or subsequent vmload of host save area.
14641458 */
1465− vmsave(__sme_page_pa(sd->save_area));
1459+ vmsave(sd->save_area_pa);
14661460 if (sev_es_guest(vcpu->kvm)) {
14671461 struct sev_es_save_area *hostsa;
14681462 hostsa = (struct sev_es_save_area *)(page_address(sd->save_area) + 0x400);
@@ -1487,7 +1481,7 @@ static void svm_prepare_host_switch(struct kvm_vcpu *vcpu) · 18 unmodified lines
14871481 static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
14881482 {
14891483 struct vcpu_svm *svm = to_svm(vcpu);
1490− struct svm_cpu_data *sd = per_cpu(svm_data, cpu);
1484+ struct svm_cpu_data *sd = per_cpu_ptr(&svm_data, cpu);
14911485
14921486 if (sd->current_vmcb != svm->vmcb) {
14931487 sd->current_vmcb = svm->vmcb;
@@ -2710,9 +2704,9 @@ static int svm_get_msr_feature(struct kvm_msr_entry *msr) · 1216 unmodified lines
27102704 msr->data = 0;
27112705
27122706 switch (msr->index) {
2713− case MSR_F10H_DECFG:
2714− if (boot_cpu_has(X86_FEATURE_LFENCE_RDTSC))
2715− msr->data |= MSR_F10H_DECFG_LFENCE_SERIALIZE;
2707+ case MSR_AMD64_DE_CFG:
2708+ if (cpu_feature_enabled(X86_FEATURE_LFENCE_RDTSC))
2709+ msr->data |= MSR_AMD64_DE_CFG_LFENCE_SERIALIZE;
27162710 break;
27172711 case MSR_IA32_PERF_CAPABILITIES:
27182712 return 0;
@@ -2813,7 +2807,7 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 94 unmodified lines
28132807 msr_info->data = 0x1E;
28142808 }
28152809 break;
2816− case MSR_F10H_DECFG:
2810+ case MSR_AMD64_DE_CFG:
28172811 msr_info->data = svm->msr_decfg;
28182812 break;
28192813 default:
@@ -3042,7 +3036,7 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr) · 222 unmodified lines
30423036 case MSR_VM_IGNNE:
30433037 vcpu_unimpl(vcpu, "unimplemented wrmsr: 0x%x data 0x%llx\n", ecx, data);
30443038 break;
3045− case MSR_F10H_DECFG: {
3039+ case MSR_AMD64_DE_CFG: {
30463040 struct kvm_msr_entry msr_entry;
30473041
30483042 msr_entry.index = msr->index;
@@ -3426,15 +3420,6 @@ static int svm_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath) · 377 unmodified lines
34263420 return 0;
34273421 }
34283422
3429− if (is_external_interrupt(svm->vmcb->control.exit_int_info) &&
3430− exit_code != SVM_EXIT_EXCP_BASE + PF_VECTOR &&
3431− exit_code != SVM_EXIT_NPF && exit_code != SVM_EXIT_TASK_SWITCH &&
3432− exit_code != SVM_EXIT_INTR && exit_code != SVM_EXIT_NMI)
3433− printk(KERN_ERR "%s: unexpected exit_int_info 0x%x "
3434− "exit_code 0x%x\n",
3435− __func__, svm->vmcb->control.exit_int_info,
3436− exit_code);
3437−
34383423 if (exit_fastpath != EXIT_FASTPATH_NONE)
34393424 return 1;
34403425
@@ -3443,7 +3428,7 @@ static int svm_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath) · 2 unmodified lines
34433428
34443429 static void reload_tss(struct kvm_vcpu *vcpu)
34453430 {
3446− struct svm_cpu_data *sd = per_cpu(svm_data, vcpu->cpu);
3431+ struct svm_cpu_data *sd = per_cpu_ptr(&svm_data, vcpu->cpu);
34473432
34483433 sd->tss_desc->type = 9; /* available 32/64-bit TSS */
34493434 load_TR_desc();
@@ -3451,7 +3436,7 @@ static void reload_tss(struct kvm_vcpu *vcpu) · 1 unmodified line
34513436
34523437 static void pre_svm_run(struct kvm_vcpu *vcpu)
34533438 {
3454− struct svm_cpu_data *sd = per_cpu(svm_data, vcpu->cpu);
3439+ struct svm_cpu_data *sd = per_cpu_ptr(&svm_data, vcpu->cpu);
34553440 struct vcpu_svm *svm = to_svm(vcpu);
34563441
34573442 /*
@@ -3911,30 +3896,16 @@ static fastpath_t svm_exit_handlers_fastpath(struct kvm_vcpu *vcpu) · 453 unmodified lines
39113896 return EXIT_FASTPATH_NONE;
39123897 }
39133898
3914−static noinstr void svm_vcpu_enter_exit(struct kvm_vcpu *vcpu)
3899+static noinstr void svm_vcpu_enter_exit(struct kvm_vcpu *vcpu, bool spec_ctrl_intercepted)
39153900 {
39163901 struct vcpu_svm *svm = to_svm(vcpu);
3917− unsigned long vmcb_pa = svm->current_vmcb->pa;
39183902
39193903 guest_state_enter_irqoff();
39203904
3921− if (sev_es_guest(vcpu->kvm)) {
3922− __svm_sev_es_vcpu_run(vmcb_pa);
3923− } else {
3924− struct svm_cpu_data *sd = per_cpu(svm_data, vcpu->cpu);
3925−
3926− /*
3927− * Use a single vmcb (vmcb01 because it's always valid) for
3928− * context switching guest state via VMLOAD/VMSAVE, that way
3929− * the state doesn't need to be copied between vmcb01 and
3930− * vmcb02 when switching vmcbs for nested virtualization.
3931− */
3932− vmload(svm->vmcb01.pa);
3933− __svm_vcpu_run(vmcb_pa, (unsigned long *)&vcpu->arch.regs);
3934− vmsave(svm->vmcb01.pa);
3935−
3936− vmload(__sme_page_pa(sd->save_area));
3937− }
3905+ if (sev_es_guest(vcpu->kvm))
3906+ __svm_sev_es_vcpu_run(svm, spec_ctrl_intercepted);
3907+ else
3908+ __svm_vcpu_run(svm, spec_ctrl_intercepted);
39383909
39393910 guest_state_exit_irqoff();
39403911 }
@@ -3942,6 +3913,7 @@ static noinstr void svm_vcpu_enter_exit(struct kvm_vcpu *vcpu) · 1 unmodified line
39423913 static __no_kcsan fastpath_t svm_vcpu_run(struct kvm_vcpu *vcpu)
39433914 {
39443915 struct vcpu_svm *svm = to_svm(vcpu);
3916+ bool spec_ctrl_intercepted = msr_write_intercepted(vcpu, MSR_IA32_SPEC_CTRL);
39453917
39463918 trace_kvm_entry(vcpu);
39473919
@@ -3998,34 +3970,15 @@ static __no_kcsan fastpath_t svm_vcpu_run(struct kvm_vcpu *vcpu) · 50 unmodified lines
39983970 * being speculatively taken.
39993971 */
40003972 if (!static_cpu_has(X86_FEATURE_V_SPEC_CTRL))
4001− x86_spec_ctrl_set_guest(svm->spec_ctrl, svm->virt_spec_ctrl);
4002−
4003− svm_vcpu_enter_exit(vcpu);
3973+ x86_spec_ctrl_set_guest(svm->virt_spec_ctrl);
40043974
4005− /*
4006− * We do not use IBRS in the kernel. If this vCPU has used the
4007− * SPEC_CTRL MSR it may have left it on; save the value and
4008− * turn it off. This is much more efficient than blindly adding
4009− * it to the atomic save/restore list. Especially as the former
4010− * (Saving guest MSRs on vmexit) doesn't even exist in KVM.
4011− *
4012− * For non-nested case:
4013− * If the L01 MSR bitmap does not intercept the MSR, then we need to
4014− * save it.
4015− *
4016− * For nested case:
4017− * If the L02 MSR bitmap does not intercept the MSR, then we need to
4018− * save it.
4019− */
4020− if (!static_cpu_has(X86_FEATURE_V_SPEC_CTRL) &&
4021− unlikely(!msr_write_intercepted(vcpu, MSR_IA32_SPEC_CTRL)))
4022− svm->spec_ctrl = native_read_msr(MSR_IA32_SPEC_CTRL);
3975+ svm_vcpu_enter_exit(vcpu, spec_ctrl_intercepted);
40233976
40243977 if (!sev_es_guest(vcpu->kvm))
40253978 reload_tss(vcpu);
40263979
40273980 if (!static_cpu_has(X86_FEATURE_V_SPEC_CTRL))
4028− x86_spec_ctrl_restore_host(svm->spec_ctrl, svm->virt_spec_ctrl);
3981+ x86_spec_ctrl_restore_host(svm->virt_spec_ctrl);
40293982
40303983 if (!sev_es_guest(vcpu->kvm)) {
40313984 vcpu->arch.cr2 = svm->vmcb->save.cr2;
arch/x86/kvm/svm/svm.h+5−6
@@ -209,7 +209,6 @@ struct vcpu_svm { · 208 unmodified lines
209209 struct vmcb *vmcb;
210210 struct kvm_vmcb_info vmcb01;
211211 struct kvm_vmcb_info *current_vmcb;
212− struct svm_cpu_data *svm_data;
213212 u32 asid;
214213 u32 sysenter_esp_hi;
215214 u32 sysenter_eip_hi;
@@ -281,8 +280,6 @@ struct vcpu_svm { · 65 unmodified lines
281280 };
282281
283282 struct svm_cpu_data {
284− int cpu;
285−
286283 u64 asid_generation;
287284 u32 max_asid;
288285 u32 next_asid;
@@ -290,13 +287,15 @@ struct svm_cpu_data { · 1 unmodified line
290287 struct kvm_ldttss_desc *tss_desc;
291288
292289 struct page *save_area;
290+ unsigned long save_area_pa;
291+
293292 struct vmcb *current_vmcb;
294293
295294 /* index = sev_asid, value = vmcb pointer */
296295 struct vmcb **sev_vmcbs;
297296 };
298297
299−DECLARE_PER_CPU(struct svm_cpu_data *, svm_data);
298+DECLARE_PER_CPU(struct svm_cpu_data, svm_data);
300299
301300 void recalc_intercepts(struct vcpu_svm *svm);
302301
@@ -683,7 +682,7 @@ void sev_es_unmap_ghcb(struct vcpu_svm *svm); · 380 unmodified lines
683682
684683 /* vmenter.S */
685684
686−void __svm_sev_es_vcpu_run(unsigned long vmcb_pa);
687−void __svm_vcpu_run(unsigned long vmcb_pa, unsigned long *regs);
685+void __svm_sev_es_vcpu_run(struct vcpu_svm *svm, bool spec_ctrl_intercepted);
686+void __svm_vcpu_run(struct vcpu_svm *svm, bool spec_ctrl_intercepted);
688687
689688 #endif
arch/x86/kvm/svm/svm_ops.h+0−5
@@ -61,9 +61,4 @@ static __always_inline void vmsave(unsigned long pa) · 60 unmodified lines
6161 svm_asm1(vmsave, "a" (pa), "memory");
6262 }
6363
64−static __always_inline void vmload(unsigned long pa)
65−{
66− svm_asm1(vmload, "a" (pa), "memory");
67−}
68−
6964 #endif /* __KVM_X86_SVM_OPS_H */
arch/x86/kvm/svm/vmenter.S+209−51
@@ -4,35 +4,97 @@ · 3 unmodified lines
44 #include <asm/bitsperlong.h>
55 #include <asm/kvm_vcpu_regs.h>
66 #include <asm/nospec-branch.h>
7+#include "kvm-asm-offsets.h"
78
89 #define WORD_SIZE (BITS_PER_LONG / 8)
910
1011 /* Intentionally omit RAX as it's context switched by hardware */
11−#define VCPU_RCX __VCPU_REGS_RCX * WORD_SIZE
12−#define VCPU_RDX __VCPU_REGS_RDX * WORD_SIZE
13−#define VCPU_RBX __VCPU_REGS_RBX * WORD_SIZE
12+#define VCPU_RCX (SVM_vcpu_arch_regs + __VCPU_REGS_RCX * WORD_SIZE)
13+#define VCPU_RDX (SVM_vcpu_arch_regs + __VCPU_REGS_RDX * WORD_SIZE)
14+#define VCPU_RBX (SVM_vcpu_arch_regs + __VCPU_REGS_RBX * WORD_SIZE)
1415 /* Intentionally omit RSP as it's context switched by hardware */
15−#define VCPU_RBP __VCPU_REGS_RBP * WORD_SIZE
16−#define VCPU_RSI __VCPU_REGS_RSI * WORD_SIZE
17−#define VCPU_RDI __VCPU_REGS_RDI * WORD_SIZE
16+#define VCPU_RBP (SVM_vcpu_arch_regs + __VCPU_REGS_RBP * WORD_SIZE)
17+#define VCPU_RSI (SVM_vcpu_arch_regs + __VCPU_REGS_RSI * WORD_SIZE)
18+#define VCPU_RDI (SVM_vcpu_arch_regs + __VCPU_REGS_RDI * WORD_SIZE)
1819
1920 #ifdef CONFIG_X86_64
20−#define VCPU_R8 __VCPU_REGS_R8 * WORD_SIZE
21−#define VCPU_R9 __VCPU_REGS_R9 * WORD_SIZE
22−#define VCPU_R10 __VCPU_REGS_R10 * WORD_SIZE
23−#define VCPU_R11 __VCPU_REGS_R11 * WORD_SIZE
24−#define VCPU_R12 __VCPU_REGS_R12 * WORD_SIZE
25−#define VCPU_R13 __VCPU_REGS_R13 * WORD_SIZE
26−#define VCPU_R14 __VCPU_REGS_R14 * WORD_SIZE
27−#define VCPU_R15 __VCPU_REGS_R15 * WORD_SIZE
21+#define VCPU_R8 (SVM_vcpu_arch_regs + __VCPU_REGS_R8 * WORD_SIZE)
22+#define VCPU_R9 (SVM_vcpu_arch_regs + __VCPU_REGS_R9 * WORD_SIZE)
23+#define VCPU_R10 (SVM_vcpu_arch_regs + __VCPU_REGS_R10 * WORD_SIZE)
24+#define VCPU_R11 (SVM_vcpu_arch_regs + __VCPU_REGS_R11 * WORD_SIZE)
25+#define VCPU_R12 (SVM_vcpu_arch_regs + __VCPU_REGS_R12 * WORD_SIZE)
26+#define VCPU_R13 (SVM_vcpu_arch_regs + __VCPU_REGS_R13 * WORD_SIZE)
27+#define VCPU_R14 (SVM_vcpu_arch_regs + __VCPU_REGS_R14 * WORD_SIZE)
28+#define VCPU_R15 (SVM_vcpu_arch_regs + __VCPU_REGS_R15 * WORD_SIZE)
2829 #endif
2930
31+#define SVM_vmcb01_pa (SVM_vmcb01 + KVM_VMCB_pa)
32+
3033 .section .noinstr.text, "ax"
3134
35+.macro RESTORE_GUEST_SPEC_CTRL
36+ /* No need to do anything if SPEC_CTRL is unset or V_SPEC_CTRL is set */
37+ ALTERNATIVE_2 "", \
38+ "jmp 800f", X86_FEATURE_MSR_SPEC_CTRL, \
39+ "", X86_FEATURE_V_SPEC_CTRL
40+801:
41+.endm
42+.macro RESTORE_GUEST_SPEC_CTRL_BODY
43+800:
44+ /*
45+ * SPEC_CTRL handling: if the guest's SPEC_CTRL value differs from the
46+ * host's, write the MSR. This is kept out-of-line so that the common
47+ * case does not have to jump.
48+ *
49+ * IMPORTANT: To avoid RSB underflow attacks and any other nastiness,
50+ * there must not be any returns or indirect branches between this code
51+ * and vmentry.
52+ */
53+ movl SVM_spec_ctrl(%_ASM_DI), %eax
54+ cmp PER_CPU_VAR(x86_spec_ctrl_current), %eax
55+ je 801b
56+ mov $MSR_IA32_SPEC_CTRL, %ecx
57+ xor %edx, %edx
58+ wrmsr
59+ jmp 801b
60+.endm
61+
62+.macro RESTORE_HOST_SPEC_CTRL
63+ /* No need to do anything if SPEC_CTRL is unset or V_SPEC_CTRL is set */
64+ ALTERNATIVE_2 "", \
65+ "jmp 900f", X86_FEATURE_MSR_SPEC_CTRL, \
66+ "", X86_FEATURE_V_SPEC_CTRL
67+901:
68+.endm
69+.macro RESTORE_HOST_SPEC_CTRL_BODY
70+900:
71+ /* Same for after vmexit. */
72+ mov $MSR_IA32_SPEC_CTRL, %ecx
73+
74+ /*
75+ * Load the value that the guest had written into MSR_IA32_SPEC_CTRL,
76+ * if it was not intercepted during guest execution.
77+ */
78+ cmpb $0, (%_ASM_SP)
79+ jnz 998f
80+ rdmsr
81+ movl %eax, SVM_spec_ctrl(%_ASM_DI)
82+998:
83+
84+ /* Now restore the host value of the MSR if different from the guest's. */
85+ movl PER_CPU_VAR(x86_spec_ctrl_current), %eax
86+ cmp SVM_spec_ctrl(%_ASM_DI), %eax
87+ je 901b
88+ xor %edx, %edx
89+ wrmsr
90+ jmp 901b
91+.endm
92+
93+
3294 /**
3395 * __svm_vcpu_run - Run a vCPU via a transition to SVM guest mode
34− * @vmcb_pa: unsigned long
35− * @regs: unsigned long * (to guest registers)
96+ * @svm: struct vcpu_svm *
97+ * @spec_ctrl_intercepted: bool
3698 */
3799 SYM_FUNC_START(__svm_vcpu_run)
38100 push %_ASM_BP
@@ -47,49 +109,71 @@ SYM_FUNC_START(__svm_vcpu_run) · 8 unmodified lines
47109 #endif
48110 push %_ASM_BX
49111
50− /* Save @regs. */
112+ /*
113+ * Save variables needed after vmexit on the stack, in inverse
114+ * order compared to when they are needed.
115+ */
116+
117+ /* Accessed directly from the stack in RESTORE_HOST_SPEC_CTRL. */
51118 push %_ASM_ARG2
52119
53− /* Save @vmcb. */
120+ /* Needed to restore access to percpu variables. */
121+ __ASM_SIZE(push) PER_CPU_VAR(svm_data + SD_save_area_pa)
122+
123+ /* Finally save @svm. */
54124 push %_ASM_ARG1
55125
56− /* Move @regs to RAX. */
57− mov %_ASM_ARG2, %_ASM_AX
126+.ifnc _ASM_ARG1, _ASM_DI
127+ /*
128+ * Stash @svm in RDI early. On 32-bit, arguments are in RAX, RCX
129+ * and RDX which are clobbered by RESTORE_GUEST_SPEC_CTRL.
130+ */
131+ mov %_ASM_ARG1, %_ASM_DI
132+.endif
133+
134+ /* Clobbers RAX, RCX, RDX. */
135+ RESTORE_GUEST_SPEC_CTRL
136+
137+ /*
138+ * Use a single vmcb (vmcb01 because it's always valid) for
139+ * context switching guest state via VMLOAD/VMSAVE, that way
140+ * the state doesn't need to be copied between vmcb01 and
141+ * vmcb02 when switching vmcbs for nested virtualization.
142+ */
143+ mov SVM_vmcb01_pa(%_ASM_DI), %_ASM_AX
144+1: vmload %_ASM_AX
145+2:
146+
147+ /* Get svm->current_vmcb->pa into RAX. */
148+ mov SVM_current_vmcb(%_ASM_DI), %_ASM_AX
149+ mov KVM_VMCB_pa(%_ASM_AX), %_ASM_AX
58150
59151 /* Load guest registers. */
60− mov VCPU_RCX(%_ASM_AX), %_ASM_CX
61− mov VCPU_RDX(%_ASM_AX), %_ASM_DX
62− mov VCPU_RBX(%_ASM_AX), %_ASM_BX
63− mov VCPU_RBP(%_ASM_AX), %_ASM_BP
64− mov VCPU_RSI(%_ASM_AX), %_ASM_SI
65− mov VCPU_RDI(%_ASM_AX), %_ASM_DI
152+ mov VCPU_RCX(%_ASM_DI), %_ASM_CX
153+ mov VCPU_RDX(%_ASM_DI), %_ASM_DX
154+ mov VCPU_RBX(%_ASM_DI), %_ASM_BX
155+ mov VCPU_RBP(%_ASM_DI), %_ASM_BP
156+ mov VCPU_RSI(%_ASM_DI), %_ASM_SI
66157 #ifdef CONFIG_X86_64
67− mov VCPU_R8 (%_ASM_AX), %r8
68− mov VCPU_R9 (%_ASM_AX), %r9
69− mov VCPU_R10(%_ASM_AX), %r10
70− mov VCPU_R11(%_ASM_AX), %r11
71− mov VCPU_R12(%_ASM_AX), %r12
72− mov VCPU_R13(%_ASM_AX), %r13
73− mov VCPU_R14(%_ASM_AX), %r14
74− mov VCPU_R15(%_ASM_AX), %r15
158+ mov VCPU_R8 (%_ASM_DI), %r8
159+ mov VCPU_R9 (%_ASM_DI), %r9
160+ mov VCPU_R10(%_ASM_DI), %r10
161+ mov VCPU_R11(%_ASM_DI), %r11
162+ mov VCPU_R12(%_ASM_DI), %r12
163+ mov VCPU_R13(%_ASM_DI), %r13
164+ mov VCPU_R14(%_ASM_DI), %r14
165+ mov VCPU_R15(%_ASM_DI), %r15
75166 #endif
76−
77− /* "POP" @vmcb to RAX. */
78− pop %_ASM_AX
167+ mov VCPU_RDI(%_ASM_DI), %_ASM_DI
79168
80169 /* Enter guest mode */
81170 sti
82171
83−1: vmrun %_ASM_AX
84−
85−2: cli
86−
87−#ifdef CONFIG_RETPOLINE
88− /* IMPORTANT: Stuff the RSB immediately after VM-Exit, before RET! */
89− FILL_RETURN_BUFFER %_ASM_AX, RSB_CLEAR_LOOPS, X86_FEATURE_RETPOLINE
90−#endif
172+3: vmrun %_ASM_AX
173+4:
174+ cli
91175
92− /* "POP" @regs to RAX. */
176+ /* Pop @svm to RAX while it's the only available register. */
93177 pop %_ASM_AX
94178
95179 /* Save all guest registers. */
@@ -110,6 +194,26 @@ SYM_FUNC_START(__svm_vcpu_run) · 14 unmodified lines
110194 mov %r15, VCPU_R15(%_ASM_AX)
111195 #endif
112196
197+ /* @svm can stay in RDI from now on. */
198+ mov %_ASM_AX, %_ASM_DI
199+
200+ mov SVM_vmcb01_pa(%_ASM_DI), %_ASM_AX
201+5: vmsave %_ASM_AX
202+6:
203+
204+ /* Restores GSBASE among other things, allowing access to percpu data. */
205+ pop %_ASM_AX
206+7: vmload %_ASM_AX
207+8:
208+
209+#ifdef CONFIG_RETPOLINE
210+ /* IMPORTANT: Stuff the RSB immediately after VM-Exit, before RET! */
211+ FILL_RETURN_BUFFER %_ASM_AX, RSB_CLEAR_LOOPS, X86_FEATURE_RETPOLINE
212+#endif
213+
214+ /* Clobbers RAX, RCX, RDX. */
215+ RESTORE_HOST_SPEC_CTRL
216+
113217 /*
114218 * Mitigate RETBleed for AMD/Hygon Zen uarch. RET should be
115219 * untrained as soon as we exit the VM and are back to the
@@ -145,6 +249,9 @@ SYM_FUNC_START(__svm_vcpu_run) · 29 unmodified lines
145249 xor %r15d, %r15d
146250 #endif
147251
252+ /* "Pop" @spec_ctrl_intercepted. */
253+ pop %_ASM_BX
254+
148255 pop %_ASM_BX
149256
150257 #ifdef CONFIG_X86_64
@@ -159,17 +266,33 @@ SYM_FUNC_START(__svm_vcpu_run) · 8 unmodified lines
159266 pop %_ASM_BP
160267 RET
161268
162−3: cmpb $0, kvm_rebooting
269+ RESTORE_GUEST_SPEC_CTRL_BODY
270+ RESTORE_HOST_SPEC_CTRL_BODY
271+
272+10: cmpb $0, kvm_rebooting
163273 jne 2b
164274 ud2
275+30: cmpb $0, kvm_rebooting
276+ jne 4b
277+ ud2
278+50: cmpb $0, kvm_rebooting
279+ jne 6b
280+ ud2
281+70: cmpb $0, kvm_rebooting
282+ jne 8b
283+ ud2
165284
166− _ASM_EXTABLE(1b, 3b)
285+ _ASM_EXTABLE(1b, 10b)
286+ _ASM_EXTABLE(3b, 30b)
287+ _ASM_EXTABLE(5b, 50b)
288+ _ASM_EXTABLE(7b, 70b)
167289
168290 SYM_FUNC_END(__svm_vcpu_run)
169291
170292 /**
171293 * __svm_sev_es_vcpu_run - Run a SEV-ES vCPU via a transition to SVM guest mode
172− * @vmcb_pa: unsigned long
294+ * @svm: struct vcpu_svm *
295+ * @spec_ctrl_intercepted: bool
173296 */
174297 SYM_FUNC_START(__svm_sev_es_vcpu_run)
175298 push %_ASM_BP
@@ -184,8 +307,31 @@ SYM_FUNC_START(__svm_sev_es_vcpu_run) · 8 unmodified lines
184307 #endif
185308 push %_ASM_BX
186309
187− /* Move @vmcb to RAX. */
188− mov %_ASM_ARG1, %_ASM_AX
310+ /*
311+ * Save variables needed after vmexit on the stack, in inverse
312+ * order compared to when they are needed.
313+ */
314+
315+ /* Accessed directly from the stack in RESTORE_HOST_SPEC_CTRL. */
316+ push %_ASM_ARG2
317+
318+ /* Save @svm. */
319+ push %_ASM_ARG1
320+
321+.ifnc _ASM_ARG1, _ASM_DI
322+ /*
323+ * Stash @svm in RDI early. On 32-bit, arguments are in RAX, RCX
324+ * and RDX which are clobbered by RESTORE_GUEST_SPEC_CTRL.
325+ */
326+ mov %_ASM_ARG1, %_ASM_DI
327+.endif
328+
329+ /* Clobbers RAX, RCX, RDX. */
330+ RESTORE_GUEST_SPEC_CTRL
331+
332+ /* Get svm->current_vmcb->pa into RAX. */
333+ mov SVM_current_vmcb(%_ASM_DI), %_ASM_AX
334+ mov KVM_VMCB_pa(%_ASM_AX), %_ASM_AX
189335
190336 /* Enter guest mode */
191337 sti
@@ -194,11 +340,17 @@ SYM_FUNC_START(__svm_sev_es_vcpu_run) · 2 unmodified lines
194340
195341 2: cli
196342
343+ /* Pop @svm to RDI, guest registers have been saved already. */
344+ pop %_ASM_DI
345+
197346 #ifdef CONFIG_RETPOLINE
198347 /* IMPORTANT: Stuff the RSB immediately after VM-Exit, before RET! */
199348 FILL_RETURN_BUFFER %_ASM_AX, RSB_CLEAR_LOOPS, X86_FEATURE_RETPOLINE
200349 #endif
201350
351+ /* Clobbers RAX, RCX, RDX. */
352+ RESTORE_HOST_SPEC_CTRL
353+
202354 /*
203355 * Mitigate RETBleed for AMD/Hygon Zen uarch. RET should be
204356 * untrained as soon as we exit the VM and are back to the
@@ -208,6 +360,9 @@ SYM_FUNC_START(__svm_sev_es_vcpu_run) · 3 unmodified lines
208360 */
209361 UNTRAIN_RET
210362
363+ /* "Pop" @spec_ctrl_intercepted. */
364+ pop %_ASM_BX
365+
211366 pop %_ASM_BX
212367
213368 #ifdef CONFIG_X86_64
@@ -222,6 +377,9 @@ SYM_FUNC_START(__svm_sev_es_vcpu_run) · 8 unmodified lines
222377 pop %_ASM_BP
223378 RET
224379
380+ RESTORE_GUEST_SPEC_CTRL_BODY
381+ RESTORE_HOST_SPEC_CTRL_BODY
382+
225383 3: cmpb $0, kvm_rebooting
226384 jne 2b
227385 ud2
arch/x86/kvm/vmx/capabilities.h+3−16
@@ -24,8 +24,6 @@ extern int __read_mostly pt_mode; · 23 unmodified lines
2424 #define PMU_CAP_FW_WRITES (1ULL << 13)
2525 #define PMU_CAP_LBR_FMT 0x3f
2626
27−#define DEBUGCTLMSR_LBR_MASK (DEBUGCTLMSR_LBR | DEBUGCTLMSR_FREEZE_LBRS_ON_PMI)
28−
2927 struct nested_vmx_msrs {
3028 /*
3129 * We only store the "true" versions of the VMX capability MSRs. We
@@ -400,6 +398,7 @@ static inline bool vmx_pebs_supported(void) · 368 unmodified lines
400398 static inline u64 vmx_get_perf_capabilities(void)
401399 {
402400 u64 perf_cap = PMU_CAP_FW_WRITES;
401+ struct x86_pmu_lbr lbr;
403402 u64 host_perf_cap = 0;
404403
405404 if (!enable_pmu)
@@ -408,7 +407,8 @@ static inline u64 vmx_get_perf_capabilities(void) · 2 unmodified lines
408407 if (boot_cpu_has(X86_FEATURE_PDCM))
409408 rdmsrl(MSR_IA32_PERF_CAPABILITIES, host_perf_cap);
410409
411− perf_cap |= host_perf_cap & PMU_CAP_LBR_FMT;
410+ if (x86_perf_get_lbr(&lbr) >= 0 && lbr.nr)
411+ perf_cap |= host_perf_cap & PMU_CAP_LBR_FMT;
412412
413413 if (vmx_pebs_supported()) {
414414 perf_cap |= host_perf_cap & PERF_CAP_PEBS_MASK;
@@ -419,19 +419,6 @@ static inline u64 vmx_get_perf_capabilities(void) · 4 unmodified lines
419419 return perf_cap;
420420 }
421421
422−static inline u64 vmx_supported_debugctl(void)
423−{
424− u64 debugctl = 0;
425−
426− if (boot_cpu_has(X86_FEATURE_BUS_LOCK_DETECT))
427− debugctl |= DEBUGCTLMSR_BUS_LOCK_DETECT;
428−
429− if (vmx_get_perf_capabilities() & PMU_CAP_LBR_FMT)
430− debugctl |= DEBUGCTLMSR_LBR_MASK;
431−
432− return debugctl;
433−}
434−
435422 static inline bool cpu_has_notify_vmexit(void)
436423 {
437424 return vmcs_config.cpu_based_2nd_exec_ctrl &
arch/x86/kvm/vmx/nested.c+1−3
@@ -4854,6 +4854,7 @@ void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 vm_exit_reason, · 4853 unmodified lines
48544854
48554855 static void nested_vmx_triple_fault(struct kvm_vcpu *vcpu)
48564856 {
4857+ kvm_clear_request(KVM_REQ_TRIPLE_FAULT, vcpu);
48574858 nested_vmx_vmexit(vcpu, EXIT_REASON_TRIPLE_FAULT, 0, 0);
48584859 }
48594860
@@ -6440,9 +6441,6 @@ out: · 1580 unmodified lines
64406441 return kvm_state.size;
64416442 }
64426443
6443−/*
6444− * Forcibly leave nested mode in order to be able to reset the VCPU later on.
6445− */
64466444 void vmx_leave_nested(struct kvm_vcpu *vcpu)
64476445 {
64486446 if (is_guest_mode(vcpu)) {
arch/x86/kvm/vmx/pmu_intel.c+2−2
@@ -617,7 +617,7 @@ static void intel_pmu_init(struct kvm_vcpu *vcpu) · 616 unmodified lines
617617 struct kvm_pmu *pmu = vcpu_to_pmu(vcpu);
618618 struct lbr_desc *lbr_desc = vcpu_to_lbr_desc(vcpu);
619619
620− for (i = 0; i < INTEL_PMC_MAX_GENERIC; i++) {
620+ for (i = 0; i < KVM_INTEL_PMC_MAX_GENERIC; i++) {
621621 pmu->gp_counters[i].type = KVM_PMC_GP;
622622 pmu->gp_counters[i].vcpu = vcpu;
623623 pmu->gp_counters[i].idx = i;
@@ -643,7 +643,7 @@ static void intel_pmu_reset(struct kvm_vcpu *vcpu) · 19 unmodified lines
643643 struct kvm_pmc *pmc = NULL;
644644 int i;
645645
646− for (i = 0; i < INTEL_PMC_MAX_GENERIC; i++) {
646+ for (i = 0; i < KVM_INTEL_PMC_MAX_GENERIC; i++) {
647647 pmc = &pmu->gp_counters[i];
648648
649649 pmc_stop_counter(pmc);
arch/x86/kvm/vmx/vmenter.S+1−1
@@ -1,12 +1,12 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
22 #include <linux/linkage.h>
33 #include <asm/asm.h>
4−#include <asm/asm-offsets.h>
54 #include <asm/bitsperlong.h>
65 #include <asm/kvm_vcpu_regs.h>
76 #include <asm/nospec-branch.h>
87 #include <asm/percpu.h>
98 #include <asm/segment.h>
9+#include "kvm-asm-offsets.h"
1010 #include "run_flags.h"
1111
1212 #define WORD_SIZE (BITS_PER_LONG / 8)
arch/x86/kvm/vmx/vmx.c+16−7
@@ -2021,15 +2021,17 @@ static u64 nested_vmx_truncate_sysenter_addr(struct kvm_vcpu *vcpu, · 2020 unmodified lines
20212021 return (unsigned long)data;
20222022 }
20232023
2024−static u64 vcpu_supported_debugctl(struct kvm_vcpu *vcpu)
2024+static u64 vmx_get_supported_debugctl(struct kvm_vcpu *vcpu, bool host_initiated)
20252025 {
2026− u64 debugctl = vmx_supported_debugctl();
2026+ u64 debugctl = 0;
20272027
2028− if (!intel_pmu_lbr_is_enabled(vcpu))
2029− debugctl &= ~DEBUGCTLMSR_LBR_MASK;
2028+ if (boot_cpu_has(X86_FEATURE_BUS_LOCK_DETECT) &&
2029+ (host_initiated || guest_cpuid_has(vcpu, X86_FEATURE_BUS_LOCK_DETECT)))
2030+ debugctl |= DEBUGCTLMSR_BUS_LOCK_DETECT;
20302031
2031− if (!guest_cpuid_has(vcpu, X86_FEATURE_BUS_LOCK_DETECT))
2032− debugctl &= ~DEBUGCTLMSR_BUS_LOCK_DETECT;
2032+ if ((vmx_get_perf_capabilities() & PMU_CAP_LBR_FMT) &&
2033+ (host_initiated || intel_pmu_lbr_is_enabled(vcpu)))
2034+ debugctl |= DEBUGCTLMSR_LBR | DEBUGCTLMSR_FREEZE_LBRS_ON_PMI;
20332035
20342036 return debugctl;
20352037 }
@@ -2103,7 +2105,9 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 67 unmodified lines
21032105 vmcs_writel(GUEST_SYSENTER_ESP, data);
21042106 break;
21052107 case MSR_IA32_DEBUGCTLMSR: {
2106− u64 invalid = data & ~vcpu_supported_debugctl(vcpu);
2108+ u64 invalid;
2109+
2110+ invalid = data & ~vmx_get_supported_debugctl(vcpu, msr_info->host_initiated);
21072111 if (invalid & (DEBUGCTLMSR_BTF|DEBUGCTLMSR_LBR)) {
21082112 if (report_ignored_msrs)
21092113 vcpu_unimpl(vcpu, "%s: BTF|LBR in IA32_DEBUGCTLMSR 0x%llx, nop\n",
@@ -8263,6 +8267,11 @@ static __init int hardware_setup(void) · 6153 unmodified lines
82638267 if (!cpu_has_virtual_nmis())
82648268 enable_vnmi = 0;
82658269
8270+#ifdef CONFIG_X86_SGX_KVM
8271+ if (!cpu_has_vmx_encls_vmexit())
8272+ enable_sgx = false;
8273+#endif
8274+
82668275 /*
82678276 * set_apic_access_page_addr() is used to reload apic access
82688277 * page upon invalidation. No need to do anything if not
arch/x86/kvm/x86.c+58−28
@@ -628,6 +628,12 @@ static void kvm_queue_exception_vmexit(struct kvm_vcpu *vcpu, unsigned int vecto · 627 unmodified lines
628628 ex->payload = payload;
629629 }
630630
631+/* Forcibly leave the nested mode in cases like a vCPU reset */
632+static void kvm_leave_nested(struct kvm_vcpu *vcpu)
633+{
634+ kvm_x86_ops.nested_ops->leave_nested(vcpu);
635+}
636+
631637 static void kvm_multiple_exception(struct kvm_vcpu *vcpu,
632638 unsigned nr, bool has_error, u32 error_code,
633639 bool has_payload, unsigned long payload, bool reinject)
@@ -1438,32 +1444,27 @@ static const u32 msrs_to_save_all[] = { · 804 unmodified lines
14381444 MSR_ARCH_PERFMON_FIXED_CTR0 + 2,
14391445 MSR_CORE_PERF_FIXED_CTR_CTRL, MSR_CORE_PERF_GLOBAL_STATUS,
14401446 MSR_CORE_PERF_GLOBAL_CTRL, MSR_CORE_PERF_GLOBAL_OVF_CTRL,
1447+ MSR_IA32_PEBS_ENABLE, MSR_IA32_DS_AREA, MSR_PEBS_DATA_CFG,
1448+
1449+ /* This part of MSRs should match KVM_INTEL_PMC_MAX_GENERIC. */
14411450 MSR_ARCH_PERFMON_PERFCTR0, MSR_ARCH_PERFMON_PERFCTR1,
14421451 MSR_ARCH_PERFMON_PERFCTR0 + 2, MSR_ARCH_PERFMON_PERFCTR0 + 3,
14431452 MSR_ARCH_PERFMON_PERFCTR0 + 4, MSR_ARCH_PERFMON_PERFCTR0 + 5,
14441453 MSR_ARCH_PERFMON_PERFCTR0 + 6, MSR_ARCH_PERFMON_PERFCTR0 + 7,
1445− MSR_ARCH_PERFMON_PERFCTR0 + 8, MSR_ARCH_PERFMON_PERFCTR0 + 9,
1446− MSR_ARCH_PERFMON_PERFCTR0 + 10, MSR_ARCH_PERFMON_PERFCTR0 + 11,
1447− MSR_ARCH_PERFMON_PERFCTR0 + 12, MSR_ARCH_PERFMON_PERFCTR0 + 13,
1448− MSR_ARCH_PERFMON_PERFCTR0 + 14, MSR_ARCH_PERFMON_PERFCTR0 + 15,
1449− MSR_ARCH_PERFMON_PERFCTR0 + 16, MSR_ARCH_PERFMON_PERFCTR0 + 17,
14501454 MSR_ARCH_PERFMON_EVENTSEL0, MSR_ARCH_PERFMON_EVENTSEL1,
14511455 MSR_ARCH_PERFMON_EVENTSEL0 + 2, MSR_ARCH_PERFMON_EVENTSEL0 + 3,
14521456 MSR_ARCH_PERFMON_EVENTSEL0 + 4, MSR_ARCH_PERFMON_EVENTSEL0 + 5,
14531457 MSR_ARCH_PERFMON_EVENTSEL0 + 6, MSR_ARCH_PERFMON_EVENTSEL0 + 7,
1454− MSR_ARCH_PERFMON_EVENTSEL0 + 8, MSR_ARCH_PERFMON_EVENTSEL0 + 9,
1455− MSR_ARCH_PERFMON_EVENTSEL0 + 10, MSR_ARCH_PERFMON_EVENTSEL0 + 11,
1456− MSR_ARCH_PERFMON_EVENTSEL0 + 12, MSR_ARCH_PERFMON_EVENTSEL0 + 13,
1457− MSR_ARCH_PERFMON_EVENTSEL0 + 14, MSR_ARCH_PERFMON_EVENTSEL0 + 15,
1458− MSR_ARCH_PERFMON_EVENTSEL0 + 16, MSR_ARCH_PERFMON_EVENTSEL0 + 17,
1459− MSR_IA32_PEBS_ENABLE, MSR_IA32_DS_AREA, MSR_PEBS_DATA_CFG,
14601458
14611459 MSR_K7_EVNTSEL0, MSR_K7_EVNTSEL1, MSR_K7_EVNTSEL2, MSR_K7_EVNTSEL3,
14621460 MSR_K7_PERFCTR0, MSR_K7_PERFCTR1, MSR_K7_PERFCTR2, MSR_K7_PERFCTR3,
1461+
1462+ /* This part of MSRs should match KVM_AMD_PMC_MAX_GENERIC. */
14631463 MSR_F15H_PERF_CTL0, MSR_F15H_PERF_CTL1, MSR_F15H_PERF_CTL2,
14641464 MSR_F15H_PERF_CTL3, MSR_F15H_PERF_CTL4, MSR_F15H_PERF_CTL5,
14651465 MSR_F15H_PERF_CTR0, MSR_F15H_PERF_CTR1, MSR_F15H_PERF_CTR2,
14661466 MSR_F15H_PERF_CTR3, MSR_F15H_PERF_CTR4, MSR_F15H_PERF_CTR5,
1467+
14671468 MSR_IA32_XFD, MSR_IA32_XFD_ERR,
14681469 };
14691470
@@ -1562,7 +1563,7 @@ static const u32 msr_based_features_all[] = { · 92 unmodified lines
15621563 MSR_IA32_VMX_EPT_VPID_CAP,
15631564 MSR_IA32_VMX_VMFUNC,
15641565
1565− MSR_F10H_DECFG,
1566+ MSR_AMD64_DE_CFG,
15661567 MSR_IA32_UCODE_REV,
15671568 MSR_IA32_ARCH_CAPABILITIES,
15681569 MSR_IA32_PERF_CAPABILITIES,
@@ -2315,11 +2316,11 @@ static void kvm_write_system_time(struct kvm_vcpu *vcpu, gpa_t system_time, · 746 unmodified lines
23152316
23162317 /* we verify if the enable bit is set... */
23172318 if (system_time & 1) {
2318− kvm_gfn_to_pfn_cache_init(vcpu->kvm, &vcpu->arch.pv_time, vcpu,
2319− KVM_HOST_USES_PFN, system_time & ~1ULL,
2320− sizeof(struct pvclock_vcpu_time_info));
2319+ kvm_gpc_activate(vcpu->kvm, &vcpu->arch.pv_time, vcpu,
2320+ KVM_HOST_USES_PFN, system_time & ~1ULL,
2321+ sizeof(struct pvclock_vcpu_time_info));
23212322 } else {
2322− kvm_gfn_to_pfn_cache_destroy(vcpu->kvm, &vcpu->arch.pv_time);
2323+ kvm_gpc_deactivate(vcpu->kvm, &vcpu->arch.pv_time);
23232324 }
23242325
23252326 return;
@@ -3388,7 +3389,7 @@ static int kvm_pv_enable_async_pf_int(struct kvm_vcpu *vcpu, u64 data) · 1062 unmodified lines
33883389
33893390 static void kvmclock_reset(struct kvm_vcpu *vcpu)
33903391 {
3391− kvm_gfn_to_pfn_cache_destroy(vcpu->kvm, &vcpu->arch.pv_time);
3392+ kvm_gpc_deactivate(vcpu->kvm, &vcpu->arch.pv_time);
33923393 vcpu->arch.time = 0;
33933394 }
33943395
@@ -5200,7 +5201,7 @@ static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu, · 1805 unmodified lines
52005201
52015202 if (events->flags & KVM_VCPUEVENT_VALID_SMM) {
52025203 if (!!(vcpu->arch.hflags & HF_SMM_MASK) != events->smi.smm) {
5203− kvm_x86_ops.nested_ops->leave_nested(vcpu);
5204+ kvm_leave_nested(vcpu);
52045205 kvm_smm_changed(vcpu, events->smi.smm);
52055206 }
52065207
@@ -7041,14 +7042,14 @@ static void kvm_init_msr_list(void) · 1834 unmodified lines
70417042 intel_pt_validate_hw_cap(PT_CAP_num_address_ranges) * 2)
70427043 continue;
70437044 break;
7044− case MSR_ARCH_PERFMON_PERFCTR0 ... MSR_ARCH_PERFMON_PERFCTR0 + 17:
7045+ case MSR_ARCH_PERFMON_PERFCTR0 ... MSR_ARCH_PERFMON_PERFCTR_MAX:
70457046 if (msrs_to_save_all[i] - MSR_ARCH_PERFMON_PERFCTR0 >=
7046− min(INTEL_PMC_MAX_GENERIC, kvm_pmu_cap.num_counters_gp))
7047+ min(KVM_INTEL_PMC_MAX_GENERIC, kvm_pmu_cap.num_counters_gp))
70477048 continue;
70487049 break;
7049− case MSR_ARCH_PERFMON_EVENTSEL0 ... MSR_ARCH_PERFMON_EVENTSEL0 + 17:
7050+ case MSR_ARCH_PERFMON_EVENTSEL0 ... MSR_ARCH_PERFMON_EVENTSEL_MAX:
70507051 if (msrs_to_save_all[i] - MSR_ARCH_PERFMON_EVENTSEL0 >=
7051− min(INTEL_PMC_MAX_GENERIC, kvm_pmu_cap.num_counters_gp))
7052+ min(KVM_INTEL_PMC_MAX_GENERIC, kvm_pmu_cap.num_counters_gp))
70527053 continue;
70537054 break;
70547055 case MSR_IA32_XFD:
@@ -9810,7 +9811,7 @@ static void update_cr8_intercept(struct kvm_vcpu *vcpu) · 2755 unmodified lines
98109811
98119812 int kvm_check_nested_events(struct kvm_vcpu *vcpu)
98129813 {
9813− if (kvm_check_request(KVM_REQ_TRIPLE_FAULT, vcpu)) {
9814+ if (kvm_test_request(KVM_REQ_TRIPLE_FAULT, vcpu)) {
98149815 kvm_x86_ops.nested_ops->triple_fault(vcpu);
98159816 return 1;
98169817 }
@@ -10044,7 +10045,20 @@ static int kvm_check_and_inject_events(struct kvm_vcpu *vcpu, · 227 unmodified lines
1004410045 kvm_x86_ops.nested_ops->has_events(vcpu))
1004510046 *req_immediate_exit = true;
1004610047
10047− WARN_ON(kvm_is_exception_pending(vcpu));
10048+ /*
10049+ * KVM must never queue a new exception while injecting an event; KVM
10050+ * is done emulating and should only propagate the to-be-injected event
10051+ * to the VMCS/VMCB. Queueing a new exception can put the vCPU into an
10052+ * infinite loop as KVM will bail from VM-Enter to inject the pending
10053+ * exception and start the cycle all over.
10054+ *
10055+ * Exempt triple faults as they have special handling and won't put the
10056+ * vCPU into an infinite loop. Triple fault can be queued when running
10057+ * VMX without unrestricted guest, as that requires KVM to emulate Real
10058+ * Mode events (see kvm_inject_realmode_interrupt()).
10059+ */
10060+ WARN_ON_ONCE(vcpu->arch.exception.pending ||
10061+ vcpu->arch.exception_vmexit.pending);
1004810062 return 0;
1004910063
1005010064 out:
@@ -10391,7 +10405,10 @@ void __kvm_set_or_clear_apicv_inhibit(struct kvm *kvm, · 340 unmodified lines
1039110405 kvm->arch.apicv_inhibit_reasons = new;
1039210406 if (new) {
1039310407 unsigned long gfn = gpa_to_gfn(APIC_DEFAULT_PHYS_BASE);
10408+ int idx = srcu_read_lock(&kvm->srcu);
10409+
1039410410 kvm_zap_gfn_range(kvm, gfn, gfn+1);
10411+ srcu_read_unlock(&kvm->srcu, idx);
1039510412 }
1039610413 } else {
1039710414 kvm->arch.apicv_inhibit_reasons = new;
@@ -10549,15 +10566,16 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) · 151 unmodified lines
1054910566 r = 0;
1055010567 goto out;
1055110568 }
10552− if (kvm_check_request(KVM_REQ_TRIPLE_FAULT, vcpu)) {
10553− if (is_guest_mode(vcpu)) {
10569+ if (kvm_test_request(KVM_REQ_TRIPLE_FAULT, vcpu)) {
10570+ if (is_guest_mode(vcpu))
1055410571 kvm_x86_ops.nested_ops->triple_fault(vcpu);
10555− } else {
10572+
10573+ if (kvm_check_request(KVM_REQ_TRIPLE_FAULT, vcpu)) {
1055610574 vcpu->run->exit_reason = KVM_EXIT_SHUTDOWN;
1055710575 vcpu->mmio_needed = 0;
1055810576 r = 0;
10559− goto out;
1056010577 }
10578+ goto out;
1056110579 }
1056210580 if (kvm_check_request(KVM_REQ_APF_HALT, vcpu)) {
1056310581 /* Page is swapped out. Do synthetic halt */
@@ -11816,6 +11834,8 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) · 1252 unmodified lines
1181611834 vcpu->arch.regs_avail = ~0;
1181711835 vcpu->arch.regs_dirty = ~0;
1181811836
11837+ kvm_gpc_init(&vcpu->arch.pv_time);
11838+
1181911839 if (!irqchip_in_kernel(vcpu->kvm) || kvm_vcpu_is_reset_bsp(vcpu))
1182011840 vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
1182111841 else
@@ -11984,8 +12004,18 @@ void kvm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) · 162 unmodified lines
1198412004 WARN_ON_ONCE(!init_event &&
1198512005 (old_cr0 || kvm_read_cr3(vcpu) || kvm_read_cr4(vcpu)));
1198612006
12007+ /*
12008+ * SVM doesn't unconditionally VM-Exit on INIT and SHUTDOWN, thus it's
12009+ * possible to INIT the vCPU while L2 is active. Force the vCPU back
12010+ * into L1 as EFER.SVME is cleared on INIT (along with all other EFER
12011+ * bits), i.e. virtualization is disabled.
12012+ */
12013+ if (is_guest_mode(vcpu))
12014+ kvm_leave_nested(vcpu);
12015+
1198712016 kvm_lapic_reset(vcpu, init_event);
1198812017
12018+ WARN_ON_ONCE(is_guest_mode(vcpu) || is_smm(vcpu));
1198912019 vcpu->arch.hflags = 0;
1199012020
1199112021 vcpu->arch.smi_pending = 0;
arch/x86/kvm/xen.c+57−39
@@ -42,13 +42,13 @@ static int kvm_xen_shared_info_init(struct kvm *kvm, gfn_t gfn) · 41 unmodified lines
4242 int idx = srcu_read_lock(&kvm->srcu);
4343
4444 if (gfn == GPA_INVALID) {
45− kvm_gfn_to_pfn_cache_destroy(kvm, gpc);
45+ kvm_gpc_deactivate(kvm, gpc);
4646 goto out;
4747 }
4848
4949 do {
50− ret = kvm_gfn_to_pfn_cache_init(kvm, gpc, NULL, KVM_HOST_USES_PFN,
51− gpa, PAGE_SIZE);
50+ ret = kvm_gpc_activate(kvm, gpc, NULL, KVM_HOST_USES_PFN, gpa,
51+ PAGE_SIZE);
5252 if (ret)
5353 goto out;
5454
@@ -554,15 +554,15 @@ int kvm_xen_vcpu_set_attr(struct kvm_vcpu *vcpu, struct kvm_xen_vcpu_attr *data) · 499 unmodified lines
554554 offsetof(struct compat_vcpu_info, time));
555555
556556 if (data->u.gpa == GPA_INVALID) {
557− kvm_gfn_to_pfn_cache_destroy(vcpu->kvm, &vcpu->arch.xen.vcpu_info_cache);
557+ kvm_gpc_deactivate(vcpu->kvm, &vcpu->arch.xen.vcpu_info_cache);
558558 r = 0;
559559 break;
560560 }
561561
562− r = kvm_gfn_to_pfn_cache_init(vcpu->kvm,
563− &vcpu->arch.xen.vcpu_info_cache,
564− NULL, KVM_HOST_USES_PFN, data->u.gpa,
565− sizeof(struct vcpu_info));
562+ r = kvm_gpc_activate(vcpu->kvm,
563+ &vcpu->arch.xen.vcpu_info_cache, NULL,
564+ KVM_HOST_USES_PFN, data->u.gpa,
565+ sizeof(struct vcpu_info));
566566 if (!r)
567567 kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
568568
@@ -570,16 +570,16 @@ int kvm_xen_vcpu_set_attr(struct kvm_vcpu *vcpu, struct kvm_xen_vcpu_attr *data) · 1 unmodified line
570570
571571 case KVM_XEN_VCPU_ATTR_TYPE_VCPU_TIME_INFO:
572572 if (data->u.gpa == GPA_INVALID) {
573− kvm_gfn_to_pfn_cache_destroy(vcpu->kvm,
574− &vcpu->arch.xen.vcpu_time_info_cache);
573+ kvm_gpc_deactivate(vcpu->kvm,
574+ &vcpu->arch.xen.vcpu_time_info_cache);
575575 r = 0;
576576 break;
577577 }
578578
579− r = kvm_gfn_to_pfn_cache_init(vcpu->kvm,
580− &vcpu->arch.xen.vcpu_time_info_cache,
581− NULL, KVM_HOST_USES_PFN, data->u.gpa,
582− sizeof(struct pvclock_vcpu_time_info));
579+ r = kvm_gpc_activate(vcpu->kvm,
580+ &vcpu->arch.xen.vcpu_time_info_cache,
581+ NULL, KVM_HOST_USES_PFN, data->u.gpa,
582+ sizeof(struct pvclock_vcpu_time_info));
583583 if (!r)
584584 kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
585585 break;
@@ -590,16 +590,15 @@ int kvm_xen_vcpu_set_attr(struct kvm_vcpu *vcpu, struct kvm_xen_vcpu_attr *data) · 4 unmodified lines
590590 break;
591591 }
592592 if (data->u.gpa == GPA_INVALID) {
593− kvm_gfn_to_pfn_cache_destroy(vcpu->kvm,
594− &vcpu->arch.xen.runstate_cache);
593+ kvm_gpc_deactivate(vcpu->kvm,
594+ &vcpu->arch.xen.runstate_cache);
595595 r = 0;
596596 break;
597597 }
598598
599− r = kvm_gfn_to_pfn_cache_init(vcpu->kvm,
600− &vcpu->arch.xen.runstate_cache,
601− NULL, KVM_HOST_USES_PFN, data->u.gpa,
602− sizeof(struct vcpu_runstate_info));
599+ r = kvm_gpc_activate(vcpu->kvm, &vcpu->arch.xen.runstate_cache,
600+ NULL, KVM_HOST_USES_PFN, data->u.gpa,
601+ sizeof(struct vcpu_runstate_info));
603602 break;
604603
605604 case KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_CURRENT:
@@ -955,6 +954,14 @@ static int kvm_xen_hypercall_complete_userspace(struct kvm_vcpu *vcpu) · 349 unmodified lines
955954 return kvm_xen_hypercall_set_result(vcpu, run->xen.u.hcall.result);
956955 }
957956
957+static inline int max_evtchn_port(struct kvm *kvm)
958+{
959+ if (IS_ENABLED(CONFIG_64BIT) && kvm->arch.xen.long_mode)
960+ return EVTCHN_2L_NR_CHANNELS;
961+ else
962+ return COMPAT_EVTCHN_2L_NR_CHANNELS;
963+}
964+
958965 static bool wait_pending_event(struct kvm_vcpu *vcpu, int nr_ports,
959966 evtchn_port_t *ports)
960967 {
@@ -1043,6 +1050,10 @@ static bool kvm_xen_schedop_poll(struct kvm_vcpu *vcpu, bool longmode, · 82 unmodified lines
10431050 *r = -EFAULT;
10441051 goto out;
10451052 }
1053+ if (ports[i] >= max_evtchn_port(vcpu->kvm)) {
1054+ *r = -EINVAL;
1055+ goto out;
1056+ }
10461057 }
10471058
10481059 if (sched_poll.nr_ports == 1)
@@ -1216,6 +1227,7 @@ int kvm_xen_hypercall(struct kvm_vcpu *vcpu) · 167 unmodified lines
12161227 bool longmode;
12171228 u64 input, params[6], r = -ENOSYS;
12181229 bool handled = false;
1230+ u8 cpl;
12191231
12201232 input = (u64)kvm_register_read(vcpu, VCPU_REGS_RAX);
12211233
@@ -1243,9 +1255,17 @@ int kvm_xen_hypercall(struct kvm_vcpu *vcpu) · 21 unmodified lines
12431255 params[5] = (u64)kvm_r9_read(vcpu);
12441256 }
12451257 #endif
1258+ cpl = static_call(kvm_x86_get_cpl)(vcpu);
12461259 trace_kvm_xen_hypercall(input, params[0], params[1], params[2],
12471260 params[3], params[4], params[5]);
12481261
1262+ /*
1263+ * Only allow hypercall acceleration for CPL0. The rare hypercalls that
1264+ * are permitted in guest userspace can be handled by the VMM.
1265+ */
1266+ if (unlikely(cpl > 0))
1267+ goto handle_in_userspace;
1268+
12491269 switch (input) {
12501270 case __HYPERVISOR_xen_version:
12511271 if (params[0] == XENVER_version && vcpu->kvm->arch.xen.xen_version) {
@@ -1280,10 +1300,11 @@ int kvm_xen_hypercall(struct kvm_vcpu *vcpu) · 28 unmodified lines
12801300 if (handled)
12811301 return kvm_xen_hypercall_set_result(vcpu, r);
12821302
1303+handle_in_userspace:
12831304 vcpu->run->exit_reason = KVM_EXIT_XEN;
12841305 vcpu->run->xen.type = KVM_EXIT_XEN_HCALL;
12851306 vcpu->run->xen.u.hcall.longmode = longmode;
1286− vcpu->run->xen.u.hcall.cpl = static_call(kvm_x86_get_cpl)(vcpu);
1307+ vcpu->run->xen.u.hcall.cpl = cpl;
12871308 vcpu->run->xen.u.hcall.input = input;
12881309 vcpu->run->xen.u.hcall.params[0] = params[0];
12891310 vcpu->run->xen.u.hcall.params[1] = params[1];
@@ -1298,14 +1319,6 @@ int kvm_xen_hypercall(struct kvm_vcpu *vcpu) · 8 unmodified lines
12981319 return 0;
12991320 }
13001321
1301−static inline int max_evtchn_port(struct kvm *kvm)
1302−{
1303− if (IS_ENABLED(CONFIG_64BIT) && kvm->arch.xen.long_mode)
1304− return EVTCHN_2L_NR_CHANNELS;
1305− else
1306− return COMPAT_EVTCHN_2L_NR_CHANNELS;
1307−}
1308−
13091322 static void kvm_xen_check_poller(struct kvm_vcpu *vcpu, int port)
13101323 {
13111324 int poll_evtchn = vcpu->arch.xen.poll_evtchn;
@@ -1667,18 +1680,18 @@ static int kvm_xen_eventfd_assign(struct kvm *kvm, · 355 unmodified lines
16671680 case EVTCHNSTAT_ipi:
16681681 /* IPI must map back to the same port# */
16691682 if (data->u.evtchn.deliver.port.port != data->u.evtchn.send_port)
1670− goto out; /* -EINVAL */
1683+ goto out_noeventfd; /* -EINVAL */
16711684 break;
16721685
16731686 case EVTCHNSTAT_interdomain:
16741687 if (data->u.evtchn.deliver.port.port) {
16751688 if (data->u.evtchn.deliver.port.port >= max_evtchn_port(kvm))
1676− goto out; /* -EINVAL */
1689+ goto out_noeventfd; /* -EINVAL */
16771690 } else {
16781691 eventfd = eventfd_ctx_fdget(data->u.evtchn.deliver.eventfd.fd);
16791692 if (IS_ERR(eventfd)) {
16801693 ret = PTR_ERR(eventfd);
1681− goto out;
1694+ goto out_noeventfd;
16821695 }
16831696 }
16841697 break;
@@ -1718,6 +1731,7 @@ static int kvm_xen_eventfd_assign(struct kvm *kvm, · 33 unmodified lines
17181731 out:
17191732 if (eventfd)
17201733 eventfd_ctx_put(eventfd);
1734+out_noeventfd:
17211735 kfree(evtchnfd);
17221736 return ret;
17231737 }
@@ -1816,7 +1830,12 @@ void kvm_xen_init_vcpu(struct kvm_vcpu *vcpu) · 92 unmodified lines
18161830 {
18171831 vcpu->arch.xen.vcpu_id = vcpu->vcpu_idx;
18181832 vcpu->arch.xen.poll_evtchn = 0;
1833+
18191834 timer_setup(&vcpu->arch.xen.poll_timer, cancel_evtchn_poll, 0);
1835+
1836+ kvm_gpc_init(&vcpu->arch.xen.runstate_cache);
1837+ kvm_gpc_init(&vcpu->arch.xen.vcpu_info_cache);
1838+ kvm_gpc_init(&vcpu->arch.xen.vcpu_time_info_cache);
18201839 }
18211840
18221841 void kvm_xen_destroy_vcpu(struct kvm_vcpu *vcpu)
@@ -1824,18 +1843,17 @@ void kvm_xen_destroy_vcpu(struct kvm_vcpu *vcpu) · 1 unmodified line
18241843 if (kvm_xen_timer_enabled(vcpu))
18251844 kvm_xen_stop_timer(vcpu);
18261845
1827− kvm_gfn_to_pfn_cache_destroy(vcpu->kvm,
1828− &vcpu->arch.xen.runstate_cache);
1829− kvm_gfn_to_pfn_cache_destroy(vcpu->kvm,
1830− &vcpu->arch.xen.vcpu_info_cache);
1831− kvm_gfn_to_pfn_cache_destroy(vcpu->kvm,
1832− &vcpu->arch.xen.vcpu_time_info_cache);
1846+ kvm_gpc_deactivate(vcpu->kvm, &vcpu->arch.xen.runstate_cache);
1847+ kvm_gpc_deactivate(vcpu->kvm, &vcpu->arch.xen.vcpu_info_cache);
1848+ kvm_gpc_deactivate(vcpu->kvm, &vcpu->arch.xen.vcpu_time_info_cache);
1849+
18331850 del_timer_sync(&vcpu->arch.xen.poll_timer);
18341851 }
18351852
18361853 void kvm_xen_init_vm(struct kvm *kvm)
18371854 {
18381855 idr_init(&kvm->arch.xen.evtchn_ports);
1856+ kvm_gpc_init(&kvm->arch.xen.shinfo_cache);
18391857 }
18401858
18411859 void kvm_xen_destroy_vm(struct kvm *kvm)
@@ -1843,7 +1861,7 @@ void kvm_xen_destroy_vm(struct kvm *kvm) · 1 unmodified line
18431861 struct evtchnfd *evtchnfd;
18441862 int i;
18451863
1846− kvm_gfn_to_pfn_cache_destroy(kvm, &kvm->arch.xen.shinfo_cache);
1864+ kvm_gpc_deactivate(kvm, &kvm->arch.xen.shinfo_cache);
18471865
18481866 idr_for_each_entry(&kvm->arch.xen.evtchn_ports, evtchnfd, i) {
18491867 if (!evtchnfd->deliver.port.port)
arch/x86/lib/usercopy.c+3−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66
77 #include <linux/uaccess.h>
88 #include <linux/export.h>
9+#include <linux/instrumented.h>
910
1011 #include <asm/tlbflush.h>
1112
@@ -44,7 +45,9 @@ copy_from_user_nmi(void *to, const void __user *from, unsigned long n) · 32 unmodified lines
4445 * called from other contexts.
4546 */
4647 pagefault_disable();
48+ instrument_copy_from_user_before(to, from, n);
4749 ret = raw_copy_from_user(to, from, n);
50+ instrument_copy_from_user_after(to, from, n, ret);
4851 pagefault_enable();
4952
5053 return ret;
arch/x86/mm/hugetlbpage.c+4−0
@@ -37,8 +37,12 @@ int pmd_huge(pmd_t pmd) · 36 unmodified lines
3737 */
3838 int pud_huge(pud_t pud)
3939 {
40+#if CONFIG_PGTABLE_LEVELS > 2
4041 return !pud_none(pud) &&
4142 (pud_val(pud) & (_PAGE_PRESENT|_PAGE_PSE)) != _PAGE_PRESENT;
43+#else
44+ return 0;
45+#endif
4246 }
4347
4448 #ifdef CONFIG_HUGETLB_PAGE
arch/x86/mm/ioremap.c+7−1
@@ -217,9 +217,15 @@ __ioremap_caller(resource_size_t phys_addr, unsigned long size, · 216 unmodified lines
217217 * Mappings have to be page-aligned
218218 */
219219 offset = phys_addr & ~PAGE_MASK;
220− phys_addr &= PHYSICAL_PAGE_MASK;
220+ phys_addr &= PAGE_MASK;
221221 size = PAGE_ALIGN(last_addr+1) - phys_addr;
222222
223+ /*
224+ * Mask out any bits not part of the actual physical
225+ * address, like memory encryption bits.
226+ */
227+ phys_addr &= PHYSICAL_PAGE_MASK;
228+
223229 retval = memtype_reserve(phys_addr, (u64)phys_addr + size,
224230 pcm, &new_pcm);
225231 if (retval) {
arch/x86/net/bpf_jit_comp.c+0−13
@@ -11,7 +11,6 @@ · 10 unmodified lines
1111 #include <linux/bpf.h>
1212 #include <linux/memory.h>
1313 #include <linux/sort.h>
14−#include <linux/init.h>
1514 #include <asm/extable.h>
1615 #include <asm/set_memory.h>
1716 #include <asm/nospec-branch.h>
@@ -389,18 +388,6 @@ out: · 371 unmodified lines
389388 return ret;
390389 }
391390
392−int __init bpf_arch_init_dispatcher_early(void *ip)
393−{
394− const u8 *nop_insn = x86_nops[5];
395−
396− if (is_endbr(*(u32 *)ip))
397− ip += ENDBR_INSN_SIZE;
398−
399− if (memcmp(ip, nop_insn, X86_PATCH_SIZE))
400− text_poke_early(ip, nop_insn, X86_PATCH_SIZE);
401− return 0;
402−}
403−
404391 int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t,
405392 void *old_addr, void *new_addr)
406393 {
arch/x86/power/cpu.c+15−7
@@ -513,15 +513,23 @@ static int pm_cpu_check(const struct x86_cpu_id *c) · 512 unmodified lines
513513
514514 static void pm_save_spec_msr(void)
515515 {
516− u32 spec_msr_id[] = {
517− MSR_IA32_SPEC_CTRL,
518− MSR_IA32_TSX_CTRL,
519− MSR_TSX_FORCE_ABORT,
520− MSR_IA32_MCU_OPT_CTRL,
521− MSR_AMD64_LS_CFG,
516+ struct msr_enumeration {
517+ u32 msr_no;
518+ u32 feature;
519+ } msr_enum[] = {
520+ { MSR_IA32_SPEC_CTRL, X86_FEATURE_MSR_SPEC_CTRL },
521+ { MSR_IA32_TSX_CTRL, X86_FEATURE_MSR_TSX_CTRL },
522+ { MSR_TSX_FORCE_ABORT, X86_FEATURE_TSX_FORCE_ABORT },
523+ { MSR_IA32_MCU_OPT_CTRL, X86_FEATURE_SRBDS_CTRL },
524+ { MSR_AMD64_LS_CFG, X86_FEATURE_LS_CFG_SSBD },
525+ { MSR_AMD64_DE_CFG, X86_FEATURE_LFENCE_RDTSC },
522526 };
527+ int i;
523528
524− msr_build_context(spec_msr_id, ARRAY_SIZE(spec_msr_id));
529+ for (i = 0; i < ARRAY_SIZE(msr_enum); i++) {
530+ if (boot_cpu_has(msr_enum[i].feature))
531+ msr_build_context(&msr_enum[i].msr_no, 1);
532+ }
525533 }
526534
527535 static int pm_check_save_msr(void)
arch/x86/xen/enlighten_pv.c+2−1
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <linux/start_kernel.h>
2424 #include <linux/sched.h>
2525 #include <linux/kprobes.h>
26+#include <linux/kstrtox.h>
2627 #include <linux/memblock.h>
2728 #include <linux/export.h>
2829 #include <linux/mm.h>
@@ -113,7 +114,7 @@ static __read_mostly bool xen_msr_safe = IS_ENABLED(CONFIG_XEN_PV_MSR_SAFE); · 84 unmodified lines
113114 static int __init parse_xen_msr_safe(char *str)
114115 {
115116 if (str)
116− return strtobool(str, &xen_msr_safe);
117+ return kstrtobool(str, &xen_msr_safe);
117118 return -EINVAL;
118119 }
119120 early_param("xen_msr_safe", parse_xen_msr_safe);
arch/x86/xen/pmu.c+1−1
@@ -302,7 +302,7 @@ static bool xen_amd_pmu_emulate(unsigned int msr, u64 *val, bool is_read) · 301 unmodified lines
302302 static bool pmu_msr_chk_emulated(unsigned int msr, uint64_t *val, bool is_read,
303303 bool *emul)
304304 {
305− int type, index;
305+ int type, index = 0;
306306
307307 if (is_amd_pmu_msr(msr))
308308 *emul = xen_amd_pmu_emulate(msr, val, is_read);
arch/x86/xen/setup.c+8−18
@@ -7,6 +7,7 @@ · 6 unmodified lines
77
88 #include <linux/init.h>
99 #include <linux/sched.h>
10+#include <linux/kstrtox.h>
1011 #include <linux/mm.h>
1112 #include <linux/pm.h>
1213 #include <linux/memblock.h>
@@ -85,7 +86,7 @@ static void __init xen_parse_512gb(void) · 72 unmodified lines
8586 arg = strstr(xen_start_info->cmd_line, "xen_512gb_limit=");
8687 if (!arg)
8788 val = true;
88− else if (strtobool(arg + strlen("xen_512gb_limit="), &val))
89+ else if (kstrtobool(arg + strlen("xen_512gb_limit="), &val))
8990 return;
9091
9192 xen_512gb_limit = val;
@@ -910,17 +911,9 @@ static int register_callback(unsigned type, const void *func) · 818 unmodified lines
910911
911912 void xen_enable_sysenter(void)
912913 {
913− int ret;
914− unsigned sysenter_feature;
915−
916− sysenter_feature = X86_FEATURE_SYSENTER32;
917−
918− if (!boot_cpu_has(sysenter_feature))
919− return;
920−
921− ret = register_callback(CALLBACKTYPE_sysenter, xen_entry_SYSENTER_compat);
922− if(ret != 0)
923− setup_clear_cpu_cap(sysenter_feature);
914+ if (cpu_feature_enabled(X86_FEATURE_SYSENTER32) &&
915+ register_callback(CALLBACKTYPE_sysenter, xen_entry_SYSENTER_compat))
916+ setup_clear_cpu_cap(X86_FEATURE_SYSENTER32);
924917 }
925918
926919 void xen_enable_syscall(void)
@@ -934,12 +927,9 @@ void xen_enable_syscall(void) · 7 unmodified lines
934927 mechanism for syscalls. */
935928 }
936929
937− if (boot_cpu_has(X86_FEATURE_SYSCALL32)) {
938− ret = register_callback(CALLBACKTYPE_syscall32,
939− xen_entry_SYSCALL_compat);
940− if (ret != 0)
941− setup_clear_cpu_cap(X86_FEATURE_SYSCALL32);
942− }
930+ if (cpu_feature_enabled(X86_FEATURE_SYSCALL32) &&
931+ register_callback(CALLBACKTYPE_syscall32, xen_entry_SYSCALL_compat))
932+ setup_clear_cpu_cap(X86_FEATURE_SYSCALL32);
943933 }
944934
945935 static void __init xen_pvmmu_arch_setup(void)
block/bfq-cgroup.c+4−0
@@ -610,6 +610,10 @@ struct bfq_group *bfq_bio_bfqg(struct bfq_data *bfqd, struct bio *bio) · 609 unmodified lines
610610 struct bfq_group *bfqg;
611611
612612 while (blkg) {
613+ if (!blkg->online) {
614+ blkg = blkg->parent;
615+ continue;
616+ }
613617 bfqg = blkg_to_bfqg(blkg);
614618 if (bfqg->online) {
615619 bio_associate_blkg_from_css(bio, &blkg->blkcg->css);
block/blk-cgroup.c+1−1
@@ -1213,7 +1213,7 @@ static int blkcg_css_online(struct cgroup_subsys_state *css) · 1212 unmodified lines
12131213 * parent so that offline always happens towards the root.
12141214 */
12151215 if (parent)
1216− blkcg_pin_online(css);
1216+ blkcg_pin_online(&parent->css);
12171217 return 0;
12181218 }
12191219
block/blk-core.c+0−1
@@ -425,7 +425,6 @@ struct request_queue *blk_alloc_queue(int node_id, bool alloc_srcu) · 424 unmodified lines
425425 PERCPU_REF_INIT_ATOMIC, GFP_KERNEL))
426426 goto fail_stats;
427427
428− blk_queue_dma_alignment(q, 511);
429428 blk_set_default_limits(&q->limits);
430429 q->nr_requests = BLKDEV_DEFAULT_RQ;
431430
block/blk-mq.c+8−4
@@ -1262,6 +1262,7 @@ static void blk_add_rq_to_plug(struct blk_plug *plug, struct request *rq) · 1261 unmodified lines
12621262 (!blk_queue_nomerges(rq->q) &&
12631263 blk_rq_bytes(last) >= BLK_PLUG_FLUSH_SIZE)) {
12641264 blk_mq_flush_plug_list(plug, false);
1265+ last = NULL;
12651266 trace_block_plug(rq->q);
12661267 }
12671268
@@ -4044,9 +4045,14 @@ EXPORT_SYMBOL(__blk_mq_alloc_disk); · 2776 unmodified lines
40444045 struct gendisk *blk_mq_alloc_disk_for_queue(struct request_queue *q,
40454046 struct lock_class_key *lkclass)
40464047 {
4048+ struct gendisk *disk;
4049+
40474050 if (!blk_get_queue(q))
40484051 return NULL;
4049− return __alloc_disk_node(q, NUMA_NO_NODE, lkclass);
4052+ disk = __alloc_disk_node(q, NUMA_NO_NODE, lkclass);
4053+ if (!disk)
4054+ blk_put_queue(q);
4055+ return disk;
40504056 }
40514057 EXPORT_SYMBOL(blk_mq_alloc_disk_for_queue);
40524058
@@ -4193,9 +4199,7 @@ int blk_mq_init_allocated_queue(struct blk_mq_tag_set *set, · 140 unmodified lines
41934199 return 0;
41944200
41954201 err_hctxs:
4196− xa_destroy(&q->hctx_table);
4197− q->nr_hw_queues = 0;
4198− blk_mq_sysfs_deinit(q);
4202+ blk_mq_release(q);
41994203 err_poll:
42004204 blk_stat_free_callback(q->poll_cb);
42014205 q->poll_cb = NULL;
block/blk-settings.c+5−4
@@ -57,8 +57,8 @@ void blk_set_default_limits(struct queue_limits *lim) · 56 unmodified lines
5757 lim->misaligned = 0;
5858 lim->zoned = BLK_ZONED_NONE;
5959 lim->zone_write_granularity = 0;
60+ lim->dma_alignment = 511;
6061 }
61−EXPORT_SYMBOL(blk_set_default_limits);
6262
6363 /**
6464 * blk_set_stacking_limits - set default limits for stacking devices
@@ -600,6 +600,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, · 535 unmodified lines
600600
601601 t->io_min = max(t->io_min, b->io_min);
602602 t->io_opt = lcm_not_zero(t->io_opt, b->io_opt);
603+ t->dma_alignment = max(t->dma_alignment, b->dma_alignment);
603604
604605 /* Set non-power-of-2 compatible chunk_sectors boundary */
605606 if (b->chunk_sectors)
@@ -773,7 +774,7 @@ EXPORT_SYMBOL(blk_queue_virt_boundary); · 167 unmodified lines
773774 **/
774775 void blk_queue_dma_alignment(struct request_queue *q, int mask)
775776 {
776− q->dma_alignment = mask;
777+ q->limits.dma_alignment = mask;
777778 }
778779 EXPORT_SYMBOL(blk_queue_dma_alignment);
779780
@@ -795,8 +796,8 @@ void blk_queue_update_dma_alignment(struct request_queue *q, int mask) · 15 unmodified lines
795796 {
796797 BUG_ON(mask > PAGE_SIZE);
797798
798− if (mask > q->dma_alignment)
799− q->dma_alignment = mask;
799+ if (mask > q->limits.dma_alignment)
800+ q->limits.dma_alignment = mask;
800801 }
801802 EXPORT_SYMBOL(blk_queue_update_dma_alignment);
802803
block/blk.h+1−0
@@ -331,6 +331,7 @@ void blk_rq_set_mixed_merge(struct request *rq); · 330 unmodified lines
331331 bool blk_rq_merge_ok(struct request *rq, struct bio *bio);
332332 enum elv_merge blk_try_merge(struct request *rq, struct bio *bio);
333333
334+void blk_set_default_limits(struct queue_limits *lim);
334335 int blk_dev_init(void);
335336
336337 /*
block/genhd.c+1−0
@@ -527,6 +527,7 @@ out_unregister_bdi: · 526 unmodified lines
527527 bdi_unregister(disk->bdi);
528528 out_unregister_queue:
529529 blk_unregister_queue(disk);
530+ rq_qos_exit(disk->queue);
530531 out_put_slave_dir:
531532 kobject_put(disk->slave_dir);
532533 out_put_holder_dir:
block/sed-opal.c+28−4
@@ -87,8 +87,8 @@ struct opal_dev { · 86 unmodified lines
8787 u64 lowest_lba;
8888
8989 size_t pos;
90− u8 cmd[IO_BUFFER_LENGTH];
91− u8 resp[IO_BUFFER_LENGTH];
90+ u8 *cmd;
91+ u8 *resp;
9292
9393 struct parsed_resp parsed;
9494 size_t prev_d_len;
@@ -2175,6 +2175,8 @@ void free_opal_dev(struct opal_dev *dev) · 2080 unmodified lines
21752175 return;
21762176
21772177 clean_opal_dev(dev);
2178+ kfree(dev->resp);
2179+ kfree(dev->cmd);
21782180 kfree(dev);
21792181 }
21802182 EXPORT_SYMBOL(free_opal_dev);
@@ -2187,6 +2189,18 @@ struct opal_dev *init_opal_dev(void *data, sec_send_recv *send_recv) · 6 unmodified lines
21872189 if (!dev)
21882190 return NULL;
21892191
2192+ /*
2193+ * Presumably DMA-able buffers must be cache-aligned. Kmalloc makes
2194+ * sure the allocated buffer is DMA-safe in that regard.
2195+ */
2196+ dev->cmd = kmalloc(IO_BUFFER_LENGTH, GFP_KERNEL);
2197+ if (!dev->cmd)
2198+ goto err_free_dev;
2199+
2200+ dev->resp = kmalloc(IO_BUFFER_LENGTH, GFP_KERNEL);
2201+ if (!dev->resp)
2202+ goto err_free_cmd;
2203+
21902204 INIT_LIST_HEAD(&dev->unlk_lst);
21912205 mutex_init(&dev->dev_lock);
21922206 dev->flags = 0;
@@ -2194,11 +2208,21 @@ struct opal_dev *init_opal_dev(void *data, sec_send_recv *send_recv) · 1 unmodified line
21942208 dev->send_recv = send_recv;
21952209 if (check_opal_support(dev) != 0) {
21962210 pr_debug("Opal is not supported on this device\n");
2197− kfree(dev);
2198− return NULL;
2211+ goto err_free_resp;
21992212 }
22002213
22012214 return dev;
2215+
2216+err_free_resp:
2217+ kfree(dev->resp);
2218+
2219+err_free_cmd:
2220+ kfree(dev->cmd);
2221+
2222+err_free_dev:
2223+ kfree(dev);
2224+
2225+ return NULL;
22022226 }
22032227 EXPORT_SYMBOL(init_opal_dev);
22042228
drivers/accessibility/speakup/main.c+1−1
@@ -1778,7 +1778,7 @@ static void speakup_con_update(struct vc_data *vc) · 1777 unmodified lines
17781778 {
17791779 unsigned long flags;
17801780
1781− if (!speakup_console[vc->vc_num] || spk_parked)
1781+ if (!speakup_console[vc->vc_num] || spk_parked || !synth)
17821782 return;
17831783 if (!spin_trylock_irqsave(&speakup_info.spinlock, flags))
17841784 /* Speakup output, discard */
drivers/accessibility/speakup/utils.h+1−1
@@ -54,7 +54,7 @@ static inline int oops(const char *msg, const char *info) · 53 unmodified lines
5454
5555 static inline struct st_key *hash_name(char *name)
5656 {
57− u_char *pn = (u_char *)name;
57+ unsigned char *pn = (unsigned char *)name;
5858 int hash = 0;
5959
6060 while (*pn) {
drivers/acpi/numa/hmat.c+20−7
@@ -562,17 +562,26 @@ static int initiator_cmp(void *priv, const struct list_head *a, · 561 unmodified lines
562562 {
563563 struct memory_initiator *ia;
564564 struct memory_initiator *ib;
565− unsigned long *p_nodes = priv;
566565
567566 ia = list_entry(a, struct memory_initiator, node);
568567 ib = list_entry(b, struct memory_initiator, node);
569568
570− set_bit(ia->processor_pxm, p_nodes);
571− set_bit(ib->processor_pxm, p_nodes);
572−
573569 return ia->processor_pxm - ib->processor_pxm;
574570 }
575571
572+static int initiators_to_nodemask(unsigned long *p_nodes)
573+{
574+ struct memory_initiator *initiator;
575+
576+ if (list_empty(&initiators))
577+ return -ENXIO;
578+
579+ list_for_each_entry(initiator, &initiators, node)
580+ set_bit(initiator->processor_pxm, p_nodes);
581+
582+ return 0;
583+}
584+
576585 static void hmat_register_target_initiators(struct memory_target *target)
577586 {
578587 static DECLARE_BITMAP(p_nodes, MAX_NUMNODES);
@@ -609,7 +618,10 @@ static void hmat_register_target_initiators(struct memory_target *target) · 30 unmodified lines
609618 * initiators.
610619 */
611620 bitmap_zero(p_nodes, MAX_NUMNODES);
612− list_sort(p_nodes, &initiators, initiator_cmp);
621+ list_sort(NULL, &initiators, initiator_cmp);
622+ if (initiators_to_nodemask(p_nodes) < 0)
623+ return;
624+
613625 if (!access0done) {
614626 for (i = WRITE_LATENCY; i <= READ_BANDWIDTH; i++) {
615627 loc = localities_types[i];
@@ -643,8 +655,9 @@ static void hmat_register_target_initiators(struct memory_target *target) · 27 unmodified lines
643655
644656 /* Access 1 ignores Generic Initiators */
645657 bitmap_zero(p_nodes, MAX_NUMNODES);
646− list_sort(p_nodes, &initiators, initiator_cmp);
647− best = 0;
658+ if (initiators_to_nodemask(p_nodes) < 0)
659+ return;
660+
648661 for (i = WRITE_LATENCY; i <= READ_BANDWIDTH; i++) {
649662 loc = localities_types[i];
650663 if (!loc)
drivers/acpi/numa/srat.c+1−0
@@ -327,6 +327,7 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, · 326 unmodified lines
327327 pr_warn("ACPI NUMA: Failed to add memblk for CFMWS node %d [mem %#llx-%#llx]\n",
328328 node, start, end);
329329 }
330+ node_set(node, numa_nodes_parsed);
330331
331332 /* Set the next available fake_pxm value */
332333 (*fake_pxm)++;
drivers/acpi/video_detect.c+32−9
@@ -645,6 +645,20 @@ static const struct dmi_system_id video_detect_dmi_table[] = { · 644 unmodified lines
645645 },
646646 },
647647
648+ /*
649+ * Models which have nvidia-ec-wmi support, but should not use it.
650+ * Note this indicates a likely firmware bug on these models and should
651+ * be revisited if/when Linux gets support for dynamic mux mode.
652+ */
653+ {
654+ .callback = video_detect_force_native,
655+ /* Dell G15 5515 */
656+ .matches = {
657+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
658+ DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5515"),
659+ },
660+ },
661+
648662 /*
649663 * Desktops which falsely report a backlight and which our heuristics
650664 * for this do not catch.
@@ -670,7 +684,7 @@ static const struct dmi_system_id video_detect_dmi_table[] = { · 19 unmodified lines
670684
671685 static bool google_cros_ec_present(void)
672686 {
673− return acpi_dev_found("GOOG0004");
687+ return acpi_dev_found("GOOG0004") || acpi_dev_found("GOOG000C");
674688 }
675689
676690 /*
@@ -718,6 +732,10 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native) · 41 unmodified lines
718732 if (apple_gmux_present())
719733 return acpi_backlight_apple_gmux;
720734
735+ /* Chromebooks should always prefer native backlight control. */
736+ if (google_cros_ec_present() && native_available)
737+ return acpi_backlight_native;
738+
721739 /* On systems with ACPI video use either native or ACPI video. */
722740 if (video_caps & ACPI_VIDEO_BACKLIGHT) {
723741 /*
@@ -735,13 +753,6 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native) · 11 unmodified lines
735753 return acpi_backlight_video;
736754 }
737755
738− /*
739− * Chromebooks that don't have backlight handle in ACPI table
740− * are supposed to use native backlight if it's available.
741− */
742− if (google_cros_ec_present() && native_available)
743− return acpi_backlight_native;
744−
745756 /* No ACPI video (old hw), use vendor specific fw methods. */
746757 return acpi_backlight_vendor;
747758 }
@@ -754,6 +765,18 @@ EXPORT_SYMBOL(acpi_video_get_backlight_type); · 6 unmodified lines
754765
755766 bool acpi_video_backlight_use_native(void)
756767 {
757− return __acpi_video_get_backlight_type(true) == acpi_backlight_native;
768+ /*
769+ * Call __acpi_video_get_backlight_type() to let it know that
770+ * a native backlight is available.
771+ */
772+ __acpi_video_get_backlight_type(true);
773+
774+ /*
775+ * For now just always return true. There is a whole bunch of laptop
776+ * models where (video_caps & ACPI_VIDEO_BACKLIGHT) is false causing
777+ * __acpi_video_get_backlight_type() to return vendor, while these
778+ * models only have a native backlight control.
779+ */
780+ return true;
758781 }
759782 EXPORT_SYMBOL(acpi_video_backlight_use_native);
drivers/acpi/x86/utils.c+6−0
@@ -219,6 +219,12 @@ static const struct dmi_system_id force_storage_d3_dmi[] = { · 218 unmodified lines
219219 DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 14 7425 2-in-1"),
220220 }
221221 },
222+ {
223+ .matches = {
224+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
225+ DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 16 5625"),
226+ }
227+ },
222228 {}
223229 };
224230
drivers/android/binder_alloc.c+7−0
@@ -739,6 +739,12 @@ int binder_alloc_mmap_handler(struct binder_alloc *alloc, · 738 unmodified lines
739739 const char *failure_string;
740740 struct binder_buffer *buffer;
741741
742+ if (unlikely(vma->vm_mm != alloc->mm)) {
743+ ret = -EINVAL;
744+ failure_string = "invalid vma->vm_mm";
745+ goto err_invalid_mm;
746+ }
747+
742748 mutex_lock(&binder_alloc_mmap_lock);
743749 if (alloc->buffer_size) {
744750 ret = -EBUSY;
@@ -785,6 +791,7 @@ err_alloc_pages_failed: · 40 unmodified lines
785791 alloc->buffer_size = 0;
786792 err_already_mapped:
787793 mutex_unlock(&binder_alloc_mmap_lock);
794+err_invalid_mm:
788795 binder_alloc_debug(BINDER_DEBUG_USER_ERROR,
789796 "%s: %d %lx-%lx %s failed %d\n", __func__,
790797 alloc->pid, vma->vm_start, vma->vm_end,
drivers/ata/libata-scsi.c+13−0
@@ -3264,6 +3264,7 @@ static unsigned int ata_scsiop_maint_in(struct ata_scsi_args *args, u8 *rbuf) · 3263 unmodified lines
32643264 case REPORT_LUNS:
32653265 case REQUEST_SENSE:
32663266 case SYNCHRONIZE_CACHE:
3267+ case SYNCHRONIZE_CACHE_16:
32673268 case REZERO_UNIT:
32683269 case SEEK_6:
32693270 case SEEK_10:
@@ -3922,6 +3923,7 @@ static inline ata_xlat_func_t ata_get_xlat_func(struct ata_device *dev, u8 cmd) · 652 unmodified lines
39223923 return ata_scsi_write_same_xlat;
39233924
39243925 case SYNCHRONIZE_CACHE:
3926+ case SYNCHRONIZE_CACHE_16:
39253927 if (ata_try_flush_cache(dev))
39263928 return ata_scsi_flush_xlat;
39273929 break;
@@ -3962,9 +3964,19 @@ static inline ata_xlat_func_t ata_get_xlat_func(struct ata_device *dev, u8 cmd) · 34 unmodified lines
39623964
39633965 int __ata_scsi_queuecmd(struct scsi_cmnd *scmd, struct ata_device *dev)
39643966 {
3967+ struct ata_port *ap = dev->link->ap;
39653968 u8 scsi_op = scmd->cmnd[0];
39663969 ata_xlat_func_t xlat_func;
39673970
3971+ /*
3972+ * scsi_queue_rq() will defer commands if scsi_host_in_recovery().
3973+ * However, this check is done without holding the ap->lock (a libata
3974+ * specific lock), so we can have received an error irq since then,
3975+ * therefore we must check if EH is pending, while holding ap->lock.
3976+ */
3977+ if (ap->pflags & (ATA_PFLAG_EH_PENDING | ATA_PFLAG_EH_IN_PROGRESS))
3978+ return SCSI_MLQUEUE_DEVICE_BUSY;
3979+
39683980 if (unlikely(!scmd->cmd_len))
39693981 goto bad_cdb_len;
39703982
@@ -4145,6 +4157,7 @@ void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd) · 174 unmodified lines
41454157 * turning this into a no-op.
41464158 */
41474159 case SYNCHRONIZE_CACHE:
4160+ case SYNCHRONIZE_CACHE_16:
41484161 fallthrough;
41494162
41504163 /* no-op's, complete with success */
drivers/ata/libata-transport.c+15−4
@@ -301,7 +301,9 @@ int ata_tport_add(struct device *parent, · 300 unmodified lines
301301 pm_runtime_enable(dev);
302302 pm_runtime_forbid(dev);
303303
304− transport_add_device(dev);
304+ error = transport_add_device(dev);
305+ if (error)
306+ goto tport_transport_add_err;
305307 transport_configure_device(dev);
306308
307309 error = ata_tlink_add(&ap->link);
@@ -312,12 +314,12 @@ int ata_tport_add(struct device *parent, · 4 unmodified lines
312314
313315 tport_link_err:
314316 transport_remove_device(dev);
317+ tport_transport_add_err:
315318 device_del(dev);
316319
317320 tport_err:
318321 transport_destroy_device(dev);
319322 put_device(dev);
320− ata_host_put(ap->host);
321323 return error;
322324 }
323325
@@ -456,7 +458,9 @@ int ata_tlink_add(struct ata_link *link) · 132 unmodified lines
456458 goto tlink_err;
457459 }
458460
459− transport_add_device(dev);
461+ error = transport_add_device(dev);
462+ if (error)
463+ goto tlink_transport_err;
460464 transport_configure_device(dev);
461465
462466 ata_for_each_dev(ata_dev, link, ALL) {
@@ -471,6 +475,7 @@ int ata_tlink_add(struct ata_link *link) · 8 unmodified lines
471475 ata_tdev_delete(ata_dev);
472476 }
473477 transport_remove_device(dev);
478+ tlink_transport_err:
474479 device_del(dev);
475480 tlink_err:
476481 transport_destroy_device(dev);
@@ -708,7 +713,13 @@ static int ata_tdev_add(struct ata_device *ata_dev) · 231 unmodified lines
708713 return error;
709714 }
710715
711− transport_add_device(dev);
716+ error = transport_add_device(dev);
717+ if (error) {
718+ device_del(dev);
719+ ata_tdev_free(ata_dev);
720+ return error;
721+ }
722+
712723 transport_configure_device(dev);
713724 return 0;
714725 }
drivers/ata/pata_legacy.c+3−2
@@ -315,9 +315,10 @@ static void pdc20230_set_piomode(struct ata_port *ap, struct ata_device *adev) · 314 unmodified lines
315315 outb(inb(0x1F4) & 0x07, 0x1F4);
316316
317317 rt = inb(0x1F3);
318− rt &= 0x07 << (3 * adev->devno);
318+ rt &= ~(0x07 << (3 * !adev->devno));
319319 if (pio)
320− rt |= (1 + 3 * pio) << (3 * adev->devno);
320+ rt |= (1 + 3 * pio) << (3 * !adev->devno);
321+ outb(rt, 0x1F3);
321322
322323 udelay(100);
323324 outb(inb(0x1F2) | 0x01, 0x1F2);
drivers/ata/pata_palmld.c+2−2
@@ -63,8 +63,8 @@ static int palmld_pata_probe(struct platform_device *pdev) · 62 unmodified lines
6363
6464 /* remap drive's physical memory address */
6565 mem = devm_platform_ioremap_resource(pdev, 0);
66− if (!mem)
67− return -ENOMEM;
66+ if (IS_ERR(mem))
67+ return PTR_ERR(mem);
6868
6969 /* request and activate power and reset GPIOs */
7070 lda->power = devm_gpiod_get(dev, "power", GPIOD_OUT_HIGH);
drivers/block/Kconfig+6−0
@@ -408,6 +408,12 @@ config BLK_DEV_UBLK · 407 unmodified lines
408408 definition isn't finalized yet, and might change according to future
409409 requirement, so mark is as experimental now.
410410
411+ Say Y if you want to get better performance because task_work_add()
412+ can be used in IO path for replacing io_uring cmd, which will become
413+ shared between IO tasks and ubq daemon, meantime task_work_add() can
414+ can handle batch more effectively, but task_work_add() isn't exported
415+ for module, so ublk has to be built to kernel.
416+
411417 source "drivers/block/rnbd/Kconfig"
412418
413419 endif # BLK_DEV
drivers/block/drbd/drbd_main.c+2−2
@@ -2672,7 +2672,7 @@ static int init_submitter(struct drbd_device *device) · 2671 unmodified lines
26722672 enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsigned int minor)
26732673 {
26742674 struct drbd_resource *resource = adm_ctx->resource;
2675− struct drbd_connection *connection;
2675+ struct drbd_connection *connection, *n;
26762676 struct drbd_device *device;
26772677 struct drbd_peer_device *peer_device, *tmp_peer_device;
26782678 struct gendisk *disk;
@@ -2789,7 +2789,7 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig · 110 unmodified lines
27892789 return NO_ERROR;
27902790
27912791 out_idr_remove_from_resource:
2792− for_each_connection(connection, resource) {
2792+ for_each_connection_safe(connection, n, resource) {
27932793 peer_device = idr_remove(&connection->peer_devices, vnr);
27942794 if (peer_device)
27952795 kref_put(&connection->kref, drbd_destroy_connection);
drivers/block/ublk_drv.c+71−56
@@ -57,11 +57,12 @@ · 56 unmodified lines
5757 #define UBLK_PARAM_TYPE_ALL (UBLK_PARAM_TYPE_BASIC | UBLK_PARAM_TYPE_DISCARD)
5858
5959 struct ublk_rq_data {
60+ struct llist_node node;
6061 struct callback_head work;
6162 };
6263
6364 struct ublk_uring_cmd_pdu {
64− struct request *req;
65+ struct ublk_queue *ubq;
6566 };
6667
6768 /*
@@ -119,6 +120,8 @@ struct ublk_queue { · 51 unmodified lines
119120 struct task_struct *ubq_daemon;
120121 char *io_cmd_buf;
121122
123+ struct llist_head io_cmds;
124+
122125 unsigned long io_addr; /* mapped vm address */
123126 unsigned int max_io_sz;
124127 bool force_abort;
@@ -761,11 +764,31 @@ static inline void __ublk_rq_task_work(struct request *req) · 636 unmodified lines
761764 ubq_complete_io_cmd(io, UBLK_IO_RES_OK);
762765 }
763766
767+static inline void ublk_forward_io_cmds(struct ublk_queue *ubq)
768+{
769+ struct llist_node *io_cmds = llist_del_all(&ubq->io_cmds);
770+ struct ublk_rq_data *data, *tmp;
771+
772+ io_cmds = llist_reverse_order(io_cmds);
773+ llist_for_each_entry_safe(data, tmp, io_cmds, node)
774+ __ublk_rq_task_work(blk_mq_rq_from_pdu(data));
775+}
776+
777+static inline void ublk_abort_io_cmds(struct ublk_queue *ubq)
778+{
779+ struct llist_node *io_cmds = llist_del_all(&ubq->io_cmds);
780+ struct ublk_rq_data *data, *tmp;
781+
782+ llist_for_each_entry_safe(data, tmp, io_cmds, node)
783+ __ublk_abort_rq(ubq, blk_mq_rq_from_pdu(data));
784+}
785+
764786 static void ublk_rq_task_work_cb(struct io_uring_cmd *cmd)
765787 {
766788 struct ublk_uring_cmd_pdu *pdu = ublk_get_uring_cmd_pdu(cmd);
789+ struct ublk_queue *ubq = pdu->ubq;
767790
768− __ublk_rq_task_work(pdu->req);
791+ ublk_forward_io_cmds(ubq);
769792 }
770793
771794 static void ublk_rq_task_work_fn(struct callback_head *work)
@@ -773,8 +796,45 @@ static void ublk_rq_task_work_fn(struct callback_head *work) · 1 unmodified line
773796 struct ublk_rq_data *data = container_of(work,
774797 struct ublk_rq_data, work);
775798 struct request *req = blk_mq_rq_from_pdu(data);
799+ struct ublk_queue *ubq = req->mq_hctx->driver_data;
800+
801+ ublk_forward_io_cmds(ubq);
802+}
776803
777− __ublk_rq_task_work(req);
804+static void ublk_queue_cmd(struct ublk_queue *ubq, struct request *rq)
805+{
806+ struct ublk_rq_data *data = blk_mq_rq_to_pdu(rq);
807+ struct ublk_io *io;
808+
809+ if (!llist_add(&data->node, &ubq->io_cmds))
810+ return;
811+
812+ io = &ubq->ios[rq->tag];
813+ /*
814+ * If the check pass, we know that this is a re-issued request aborted
815+ * previously in monitor_work because the ubq_daemon(cmd's task) is
816+ * PF_EXITING. We cannot call io_uring_cmd_complete_in_task() anymore
817+ * because this ioucmd's io_uring context may be freed now if no inflight
818+ * ioucmd exists. Otherwise we may cause null-deref in ctx->fallback_work.
819+ *
820+ * Note: monitor_work sets UBLK_IO_FLAG_ABORTED and ends this request(releasing
821+ * the tag). Then the request is re-started(allocating the tag) and we are here.
822+ * Since releasing/allocating a tag implies smp_mb(), finding UBLK_IO_FLAG_ABORTED
823+ * guarantees that here is a re-issued request aborted previously.
824+ */
825+ if (unlikely(io->flags & UBLK_IO_FLAG_ABORTED)) {
826+ ublk_abort_io_cmds(ubq);
827+ } else if (ublk_can_use_task_work(ubq)) {
828+ if (task_work_add(ubq->ubq_daemon, &data->work,
829+ TWA_SIGNAL_NO_IPI))
830+ ublk_abort_io_cmds(ubq);
831+ } else {
832+ struct io_uring_cmd *cmd = io->cmd;
833+ struct ublk_uring_cmd_pdu *pdu = ublk_get_uring_cmd_pdu(cmd);
834+
835+ pdu->ubq = ubq;
836+ io_uring_cmd_complete_in_task(cmd, ublk_rq_task_work_cb);
837+ }
778838 }
779839
780840 static blk_status_t ublk_queue_rq(struct blk_mq_hw_ctx *hctx,
@@ -788,6 +848,7 @@ static blk_status_t ublk_queue_rq(struct blk_mq_hw_ctx *hctx, · 7 unmodified lines
788848 res = ublk_setup_iod(ubq, rq);
789849 if (unlikely(res != BLK_STS_OK))
790850 return BLK_STS_IOERR;
851+
791852 /* With recovery feature enabled, force_abort is set in
792853 * ublk_stop_dev() before calling del_gendisk(). We have to
793854 * abort all requeued and new rqs here to let del_gendisk()
@@ -803,53 +864,15 @@ static blk_status_t ublk_queue_rq(struct blk_mq_hw_ctx *hctx, · 9 unmodified lines
803864 blk_mq_start_request(bd->rq);
804865
805866 if (unlikely(ubq_daemon_is_dying(ubq))) {
806− fail:
807867 __ublk_abort_rq(ubq, rq);
808868 return BLK_STS_OK;
809869 }
810870
811− if (ublk_can_use_task_work(ubq)) {
812− struct ublk_rq_data *data = blk_mq_rq_to_pdu(rq);
813− enum task_work_notify_mode notify_mode = bd->last ?
814− TWA_SIGNAL_NO_IPI : TWA_NONE;
815−
816− if (task_work_add(ubq->ubq_daemon, &data->work, notify_mode))
817− goto fail;
818− } else {
819− struct ublk_io *io = &ubq->ios[rq->tag];
820− struct io_uring_cmd *cmd = io->cmd;
821− struct ublk_uring_cmd_pdu *pdu = ublk_get_uring_cmd_pdu(cmd);
822−
823− /*
824− * If the check pass, we know that this is a re-issued request aborted
825− * previously in monitor_work because the ubq_daemon(cmd's task) is
826− * PF_EXITING. We cannot call io_uring_cmd_complete_in_task() anymore
827− * because this ioucmd's io_uring context may be freed now if no inflight
828− * ioucmd exists. Otherwise we may cause null-deref in ctx->fallback_work.
829− *
830− * Note: monitor_work sets UBLK_IO_FLAG_ABORTED and ends this request(releasing
831− * the tag). Then the request is re-started(allocating the tag) and we are here.
832− * Since releasing/allocating a tag implies smp_mb(), finding UBLK_IO_FLAG_ABORTED
833− * guarantees that here is a re-issued request aborted previously.
834− */
835− if ((io->flags & UBLK_IO_FLAG_ABORTED))
836− goto fail;
837−
838− pdu->req = rq;
839− io_uring_cmd_complete_in_task(cmd, ublk_rq_task_work_cb);
840− }
871+ ublk_queue_cmd(ubq, rq);
841872
842873 return BLK_STS_OK;
843874 }
844875
845−static void ublk_commit_rqs(struct blk_mq_hw_ctx *hctx)
846−{
847− struct ublk_queue *ubq = hctx->driver_data;
848−
849− if (ublk_can_use_task_work(ubq))
850− __set_notify_signal(ubq->ubq_daemon);
851−}
852−
853876 static int ublk_init_hctx(struct blk_mq_hw_ctx *hctx, void *driver_data,
854877 unsigned int hctx_idx)
855878 {
@@ -871,7 +894,6 @@ static int ublk_init_rq(struct blk_mq_tag_set *set, struct request *req, · 15 unmodified lines
871894
872895 static const struct blk_mq_ops ublk_mq_ops = {
873896 .queue_rq = ublk_queue_rq,
874− .commit_rqs = ublk_commit_rqs,
875897 .init_hctx = ublk_init_hctx,
876898 .init_request = ublk_init_rq,
877899 };
@@ -1164,22 +1186,12 @@ static void ublk_mark_io_ready(struct ublk_device *ub, struct ublk_queue *ubq) · 286 unmodified lines
11641186 }
11651187
11661188 static void ublk_handle_need_get_data(struct ublk_device *ub, int q_id,
1167− int tag, struct io_uring_cmd *cmd)
1189+ int tag)
11681190 {
11691191 struct ublk_queue *ubq = ublk_get_queue(ub, q_id);
11701192 struct request *req = blk_mq_tag_to_rq(ub->tag_set.tags[q_id], tag);
11711193
1172− if (ublk_can_use_task_work(ubq)) {
1173− struct ublk_rq_data *data = blk_mq_rq_to_pdu(req);
1174−
1175− /* should not fail since we call it just in ubq->ubq_daemon */
1176− task_work_add(ubq->ubq_daemon, &data->work, TWA_SIGNAL_NO_IPI);
1177− } else {
1178− struct ublk_uring_cmd_pdu *pdu = ublk_get_uring_cmd_pdu(cmd);
1179−
1180− pdu->req = req;
1181− io_uring_cmd_complete_in_task(cmd, ublk_rq_task_work_cb);
1182− }
1194+ ublk_queue_cmd(ubq, req);
11831195 }
11841196
11851197 static int ublk_ch_uring_cmd(struct io_uring_cmd *cmd, unsigned int issue_flags)
@@ -1267,7 +1279,7 @@ static int ublk_ch_uring_cmd(struct io_uring_cmd *cmd, unsigned int issue_flags) · 81 unmodified lines
12671279 io->addr = ub_cmd->addr;
12681280 io->cmd = cmd;
12691281 io->flags |= UBLK_IO_FLAG_ACTIVE;
1270− ublk_handle_need_get_data(ub, ub_cmd->q_id, ub_cmd->tag, cmd);
1282+ ublk_handle_need_get_data(ub, ub_cmd->q_id, ub_cmd->tag);
12711283 break;
12721284 default:
12731285 goto out;
@@ -1658,6 +1670,9 @@ static int ublk_ctrl_add_dev(struct io_uring_cmd *cmd) · 384 unmodified lines
16581670 */
16591671 ub->dev_info.flags &= UBLK_F_ALL;
16601672
1673+ if (!IS_BUILTIN(CONFIG_BLK_DEV_UBLK))
1674+ ub->dev_info.flags |= UBLK_F_URING_CMD_COMP_IN_TASK;
1675+
16611676 /* We are not ready to support zero copy */
16621677 ub->dev_info.flags &= ~UBLK_F_SUPPORT_ZERO_COPY;
16631678
drivers/bluetooth/virtio_bt.c+1−1
@@ -219,7 +219,7 @@ static void virtbt_rx_work(struct work_struct *work) · 218 unmodified lines
219219 if (!skb)
220220 return;
221221
222− skb->len = len;
222+ skb_put(skb, len);
223223 virtbt_rx_handle(vbt, skb);
224224
225225 if (virtbt_add_inbuf(vbt) < 0)
drivers/bus/intel-ixp4xx-eb.c+3−6
@@ -49,7 +49,7 @@ · 48 unmodified lines
4949 #define IXP4XX_EXP_SIZE_SHIFT 10
5050 #define IXP4XX_EXP_CNFG_0 BIT(9) /* Always zero */
5151 #define IXP43X_EXP_SYNC_INTEL BIT(8) /* Only on IXP43x */
52−#define IXP43X_EXP_EXP_CHIP BIT(7) /* Only on IXP43x */
52+#define IXP43X_EXP_EXP_CHIP BIT(7) /* Only on IXP43x, dangerous to touch on IXP42x */
5353 #define IXP4XX_EXP_BYTE_RD16 BIT(6)
5454 #define IXP4XX_EXP_HRDY_POL BIT(5) /* Only on IXP42x */
5555 #define IXP4XX_EXP_MUX_EN BIT(4)
@@ -57,8 +57,6 @@ · 1 unmodified line
5757 #define IXP4XX_EXP_WORD BIT(2) /* Always zero */
5858 #define IXP4XX_EXP_WR_EN BIT(1)
5959 #define IXP4XX_EXP_BYTE_EN BIT(0)
60−#define IXP42X_RESERVED (BIT(30)|IXP4XX_EXP_CNFG_0|BIT(8)|BIT(7)|IXP4XX_EXP_WORD)
61−#define IXP43X_RESERVED (BIT(30)|IXP4XX_EXP_CNFG_0|BIT(5)|IXP4XX_EXP_WORD)
6260
6361 #define IXP4XX_EXP_CNFG0 0x20
6462 #define IXP4XX_EXP_CNFG0_MEM_MAP BIT(31)
@@ -252,10 +250,9 @@ static void ixp4xx_exp_setup_chipselect(struct ixp4xx_eb *eb, · 187 unmodified lines
252250 cs_cfg |= val << IXP4XX_EXP_CYC_TYPE_SHIFT;
253251 }
254252
255− if (eb->is_42x)
256− cs_cfg &= ~IXP42X_RESERVED;
257253 if (eb->is_43x) {
258− cs_cfg &= ~IXP43X_RESERVED;
254+ /* Should always be zero */
255+ cs_cfg &= ~IXP4XX_EXP_WORD;
259256 /*
260257 * This bit for Intel strata flash is currently unused, but let's
261258 * report it if we find one.
drivers/bus/sunxi-rsb.c+21−17
@@ -267,6 +267,9 @@ EXPORT_SYMBOL_GPL(sunxi_rsb_driver_register); · 266 unmodified lines
267267 /* common code that starts a transfer */
268268 static int _sunxi_rsb_run_xfer(struct sunxi_rsb *rsb)
269269 {
270+ u32 int_mask, status;
271+ bool timeout;
272+
270273 if (readl(rsb->regs + RSB_CTRL) & RSB_CTRL_START_TRANS) {
271274 dev_dbg(rsb->dev, "RSB transfer still in progress\n");
272275 return -EBUSY;
@@ -274,13 +277,23 @@ static int _sunxi_rsb_run_xfer(struct sunxi_rsb *rsb) · 1 unmodified line
274277
275278 reinit_completion(&rsb->complete);
276279
277− writel(RSB_INTS_LOAD_BSY | RSB_INTS_TRANS_ERR | RSB_INTS_TRANS_OVER,
278− rsb->regs + RSB_INTE);
280+ int_mask = RSB_INTS_LOAD_BSY | RSB_INTS_TRANS_ERR | RSB_INTS_TRANS_OVER;
281+ writel(int_mask, rsb->regs + RSB_INTE);
279282 writel(RSB_CTRL_START_TRANS | RSB_CTRL_GLOBAL_INT_ENB,
280283 rsb->regs + RSB_CTRL);
281284
282− if (!wait_for_completion_io_timeout(&rsb->complete,
283− msecs_to_jiffies(100))) {
285+ if (irqs_disabled()) {
286+ timeout = readl_poll_timeout_atomic(rsb->regs + RSB_INTS,
287+ status, (status & int_mask),
288+ 10, 100000);
289+ writel(status, rsb->regs + RSB_INTS);
290+ } else {
291+ timeout = !wait_for_completion_io_timeout(&rsb->complete,
292+ msecs_to_jiffies(100));
293+ status = rsb->status;
294+ }
295+
296+ if (timeout) {
284297 dev_dbg(rsb->dev, "RSB timeout\n");
285298
286299 /* abort the transfer */
@@ -292,18 +305,18 @@ static int _sunxi_rsb_run_xfer(struct sunxi_rsb *rsb) · 5 unmodified lines
292305 return -ETIMEDOUT;
293306 }
294307
295− if (rsb->status & RSB_INTS_LOAD_BSY) {
308+ if (status & RSB_INTS_LOAD_BSY) {
296309 dev_dbg(rsb->dev, "RSB busy\n");
297310 return -EBUSY;
298311 }
299312
300− if (rsb->status & RSB_INTS_TRANS_ERR) {
301− if (rsb->status & RSB_INTS_TRANS_ERR_ACK) {
313+ if (status & RSB_INTS_TRANS_ERR) {
314+ if (status & RSB_INTS_TRANS_ERR_ACK) {
302315 dev_dbg(rsb->dev, "RSB slave nack\n");
303316 return -EINVAL;
304317 }
305318
306− if (rsb->status & RSB_INTS_TRANS_ERR_DATA) {
319+ if (status & RSB_INTS_TRANS_ERR_DATA) {
307320 dev_dbg(rsb->dev, "RSB transfer data error\n");
308321 return -EIO;
309322 }
@@ -812,14 +825,6 @@ static int sunxi_rsb_remove(struct platform_device *pdev) · 502 unmodified lines
812825 return 0;
813826 }
814827
815−static void sunxi_rsb_shutdown(struct platform_device *pdev)
816−{
817− struct sunxi_rsb *rsb = platform_get_drvdata(pdev);
818−
819− pm_runtime_disable(&pdev->dev);
820− sunxi_rsb_hw_exit(rsb);
821−}
822−
823828 static const struct dev_pm_ops sunxi_rsb_dev_pm_ops = {
824829 SET_RUNTIME_PM_OPS(sunxi_rsb_runtime_suspend,
825830 sunxi_rsb_runtime_resume, NULL)
@@ -835,7 +840,6 @@ MODULE_DEVICE_TABLE(of, sunxi_rsb_of_match_table); · 9 unmodified lines
835840 static struct platform_driver sunxi_rsb_driver = {
836841 .probe = sunxi_rsb_probe,
837842 .remove = sunxi_rsb_remove,
838− .shutdown = sunxi_rsb_shutdown,
839843 .driver = {
840844 .name = RSB_CTRL_NAME,
841845 .of_match_table = sunxi_rsb_of_match_table,
drivers/char/tpm/tpm-interface.c+3−2
@@ -401,13 +401,14 @@ int tpm_pm_suspend(struct device *dev) · 400 unmodified lines
401401 !pm_suspend_via_firmware())
402402 goto suspended;
403403
404− if (!tpm_chip_start(chip)) {
404+ rc = tpm_try_get_ops(chip);
405+ if (!rc) {
405406 if (chip->flags & TPM_CHIP_FLAG_TPM2)
406407 tpm2_shutdown(chip, TPM2_SU_STATE);
407408 else
408409 rc = tpm1_pm_suspend(chip, tpm_suspend_pcr);
409410
410− tpm_chip_stop(chip);
411+ tpm_put_ops(chip);
411412 }
412413
413414 suspended:
drivers/clk/at91/at91rm9200.c+1−1
@@ -40,7 +40,7 @@ static const struct clk_pll_characteristics rm9200_pll_characteristics = { · 39 unmodified lines
4040 };
4141
4242 static const struct sck at91rm9200_systemck[] = {
43− { .n = "udpck", .p = "usbck", .id = 2 },
43+ { .n = "udpck", .p = "usbck", .id = 1 },
4444 { .n = "uhpck", .p = "usbck", .id = 4 },
4545 { .n = "pck0", .p = "prog0", .id = 8 },
4646 { .n = "pck1", .p = "prog1", .id = 9 },
drivers/clk/clk-renesas-pcie.c+62−3
@@ -90,13 +90,66 @@ static const struct regmap_access_table rs9_writeable_table = { · 89 unmodified lines
9090 .n_yes_ranges = ARRAY_SIZE(rs9_writeable_ranges),
9191 };
9292
93+static int rs9_regmap_i2c_write(void *context,
94+ unsigned int reg, unsigned int val)
95+{
96+ struct i2c_client *i2c = context;
97+ const u8 data[3] = { reg, 1, val };
98+ const int count = ARRAY_SIZE(data);
99+ int ret;
100+
101+ ret = i2c_master_send(i2c, data, count);
102+ if (ret == count)
103+ return 0;
104+ else if (ret < 0)
105+ return ret;
106+ else
107+ return -EIO;
108+}
109+
110+static int rs9_regmap_i2c_read(void *context,
111+ unsigned int reg, unsigned int *val)
112+{
113+ struct i2c_client *i2c = context;
114+ struct i2c_msg xfer[2];
115+ u8 txdata = reg;
116+ u8 rxdata[2];
117+ int ret;
118+
119+ xfer[0].addr = i2c->addr;
120+ xfer[0].flags = 0;
121+ xfer[0].len = 1;
122+ xfer[0].buf = (void *)&txdata;
123+
124+ xfer[1].addr = i2c->addr;
125+ xfer[1].flags = I2C_M_RD;
126+ xfer[1].len = 2;
127+ xfer[1].buf = (void *)rxdata;
128+
129+ ret = i2c_transfer(i2c->adapter, xfer, 2);
130+ if (ret < 0)
131+ return ret;
132+ if (ret != 2)
133+ return -EIO;
134+
135+ /*
136+ * Byte 0 is transfer length, which is always 1 due
137+ * to BCP register programming to 1 in rs9_probe(),
138+ * ignore it and use data from Byte 1.
139+ */
140+ *val = rxdata[1];
141+ return 0;
142+}
143+
93144 static const struct regmap_config rs9_regmap_config = {
94145 .reg_bits = 8,
95146 .val_bits = 8,
96− .cache_type = REGCACHE_FLAT,
97− .max_register = 0x8,
147+ .cache_type = REGCACHE_NONE,
148+ .max_register = RS9_REG_BCP,
98149 .rd_table = &rs9_readable_table,
99150 .wr_table = &rs9_writeable_table,
151+ .reg_write = rs9_regmap_i2c_write,
152+ .reg_read = rs9_regmap_i2c_read,
100153 };
101154
102155 static int rs9_get_output_config(struct rs9_driver_data *rs9, int idx)
@@ -242,11 +295,17 @@ static int rs9_probe(struct i2c_client *client) · 139 unmodified lines
242295 return ret;
243296 }
244297
245− rs9->regmap = devm_regmap_init_i2c(client, &rs9_regmap_config);
298+ rs9->regmap = devm_regmap_init(&client->dev, NULL,
299+ client, &rs9_regmap_config);
246300 if (IS_ERR(rs9->regmap))
247301 return dev_err_probe(&client->dev, PTR_ERR(rs9->regmap),
248302 "Failed to allocate register map\n");
249303
304+ /* Always read back 1 Byte via I2C */
305+ ret = regmap_write(rs9->regmap, RS9_REG_BCP, 1);
306+ if (ret < 0)
307+ return ret;
308+
250309 /* Register clock */
251310 for (i = 0; i < rs9->chip_info->num_clks; i++) {
252311 snprintf(name, 5, "DIF%d", i);
drivers/clk/clk.c+5−1
@@ -1459,10 +1459,14 @@ static void clk_core_init_rate_req(struct clk_core * const core, · 1458 unmodified lines
14591459 {
14601460 struct clk_core *parent;
14611461
1462− if (WARN_ON(!core || !req))
1462+ if (WARN_ON(!req))
14631463 return;
14641464
14651465 memset(req, 0, sizeof(*req));
1466+ req->max_rate = ULONG_MAX;
1467+
1468+ if (!core)
1469+ return;
14661470
14671471 req->rate = rate;
14681472 clk_core_get_boundaries(core, &req->min_rate, &req->max_rate);
drivers/clk/mediatek/clk-mt8195-topckgen.c+3−1
@@ -1270,8 +1270,10 @@ static int clk_mt8195_topck_probe(struct platform_device *pdev) · 1269 unmodified lines
12701270 hw = devm_clk_hw_register_mux(&pdev->dev, "mfg_ck_fast_ref", mfg_fast_parents,
12711271 ARRAY_SIZE(mfg_fast_parents), CLK_SET_RATE_PARENT,
12721272 (base + 0x250), 8, 1, 0, &mt8195_clk_lock);
1273− if (IS_ERR(hw))
1273+ if (IS_ERR(hw)) {
1274+ r = PTR_ERR(hw);
12741275 goto unregister_muxes;
1276+ }
12751277 top_clk_data->hws[CLK_TOP_MFG_CK_FAST_REF] = hw;
12761278
12771279 r = clk_mt8195_reg_mfg_mux_notifier(&pdev->dev,
drivers/clk/qcom/gcc-sc7280.c+1−0
@@ -3467,6 +3467,7 @@ static int gcc_sc7280_probe(struct platform_device *pdev) · 3466 unmodified lines
34673467 regmap_update_bits(regmap, 0x28004, BIT(0), BIT(0));
34683468 regmap_update_bits(regmap, 0x28014, BIT(0), BIT(0));
34693469 regmap_update_bits(regmap, 0x71004, BIT(0), BIT(0));
3470+ regmap_update_bits(regmap, 0x7100C, BIT(13), BIT(13));
34703471
34713472 ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks,
34723473 ARRAY_SIZE(gcc_dfs_clocks));
drivers/clk/qcom/gcc-sc8280xp.c+6−0
@@ -5364,6 +5364,8 @@ static struct clk_branch gcc_ufs_1_card_clkref_clk = { · 5363 unmodified lines
53645364 .enable_mask = BIT(0),
53655365 .hw.init = &(const struct clk_init_data) {
53665366 .name = "gcc_ufs_1_card_clkref_clk",
5367+ .parent_data = &gcc_parent_data_tcxo,
5368+ .num_parents = 1,
53675369 .ops = &clk_branch2_ops,
53685370 },
53695371 },
@@ -5432,6 +5434,8 @@ static struct clk_branch gcc_ufs_card_clkref_clk = { · 62 unmodified lines
54325434 .enable_mask = BIT(0),
54335435 .hw.init = &(const struct clk_init_data) {
54345436 .name = "gcc_ufs_card_clkref_clk",
5437+ .parent_data = &gcc_parent_data_tcxo,
5438+ .num_parents = 1,
54355439 .ops = &clk_branch2_ops,
54365440 },
54375441 },
@@ -5848,6 +5852,8 @@ static struct clk_branch gcc_ufs_ref_clkref_clk = { · 410 unmodified lines
58485852 .enable_mask = BIT(0),
58495853 .hw.init = &(const struct clk_init_data) {
58505854 .name = "gcc_ufs_ref_clkref_clk",
5855+ .parent_data = &gcc_parent_data_tcxo,
5856+ .num_parents = 1,
58515857 .ops = &clk_branch2_ops,
58525858 },
58535859 },
drivers/clk/qcom/gdsc.c+6−55
@@ -11,7 +11,6 @@ · 10 unmodified lines
1111 #include <linux/kernel.h>
1212 #include <linux/ktime.h>
1313 #include <linux/pm_domain.h>
14−#include <linux/pm_runtime.h>
1514 #include <linux/regmap.h>
1615 #include <linux/regulator/consumer.h>
1716 #include <linux/reset-controller.h>
@@ -56,22 +55,6 @@ enum gdsc_status { · 38 unmodified lines
5655 GDSC_ON
5756 };
5857
59−static int gdsc_pm_runtime_get(struct gdsc *sc)
60−{
61− if (!sc->dev)
62− return 0;
63−
64− return pm_runtime_resume_and_get(sc->dev);
65−}
66−
67−static int gdsc_pm_runtime_put(struct gdsc *sc)
68−{
69− if (!sc->dev)
70− return 0;
71−
72− return pm_runtime_put_sync(sc->dev);
73−}
74−
7558 /* Returns 1 if GDSC status is status, 0 if not, and < 0 on error */
7659 static int gdsc_check_status(struct gdsc *sc, enum gdsc_status status)
7760 {
@@ -271,8 +254,9 @@ static void gdsc_retain_ff_on(struct gdsc *sc) · 193 unmodified lines
271254 regmap_update_bits(sc->regmap, sc->gdscr, mask, mask);
272255 }
273256
274−static int _gdsc_enable(struct gdsc *sc)
257+static int gdsc_enable(struct generic_pm_domain *domain)
275258 {
259+ struct gdsc *sc = domain_to_gdsc(domain);
276260 int ret;
277261
278262 if (sc->pwrsts == PWRSTS_ON)
@@ -328,22 +312,11 @@ static int _gdsc_enable(struct gdsc *sc) · 49 unmodified lines
328312 return 0;
329313 }
330314
331−static int gdsc_enable(struct generic_pm_domain *domain)
315+static int gdsc_disable(struct generic_pm_domain *domain)
332316 {
333317 struct gdsc *sc = domain_to_gdsc(domain);
334318 int ret;
335319
336− ret = gdsc_pm_runtime_get(sc);
337− if (ret)
338− return ret;
339−
340− return _gdsc_enable(sc);
341−}
342−
343−static int _gdsc_disable(struct gdsc *sc)
344−{
345− int ret;
346−
347320 if (sc->pwrsts == PWRSTS_ON)
348321 return gdsc_assert_reset(sc);
349322
@@ -388,18 +361,6 @@ static int _gdsc_disable(struct gdsc *sc) · 38 unmodified lines
388361 return 0;
389362 }
390363
391−static int gdsc_disable(struct generic_pm_domain *domain)
392−{
393− struct gdsc *sc = domain_to_gdsc(domain);
394− int ret;
395−
396− ret = _gdsc_disable(sc);
397−
398− gdsc_pm_runtime_put(sc);
399−
400− return ret;
401−}
402−
403364 static int gdsc_init(struct gdsc *sc)
404365 {
405366 u32 mask, val;
@@ -447,11 +408,6 @@ static int gdsc_init(struct gdsc *sc) · 41 unmodified lines
447408 return ret;
448409 }
449410
450− /* ...and the power-domain */
451− ret = gdsc_pm_runtime_get(sc);
452− if (ret)
453− goto err_disable_supply;
454−
455411 /*
456412 * Votable GDSCs can be ON due to Vote from other masters.
457413 * If a Votable GDSC is ON, make sure we have a Vote.
@@ -459,14 +415,14 @@ static int gdsc_init(struct gdsc *sc) · 1 unmodified line
459415 if (sc->flags & VOTABLE) {
460416 ret = gdsc_update_collapse_bit(sc, false);
461417 if (ret)
462− goto err_put_rpm;
418+ goto err_disable_supply;
463419 }
464420
465421 /* Turn on HW trigger mode if supported */
466422 if (sc->flags & HW_CTRL) {
467423 ret = gdsc_hwctrl(sc, true);
468424 if (ret < 0)
469− goto err_put_rpm;
425+ goto err_disable_supply;
470426 }
471427
472428 /*
@@ -496,13 +452,10 @@ static int gdsc_init(struct gdsc *sc) · 23 unmodified lines
496452
497453 ret = pm_genpd_init(&sc->pd, NULL, !on);
498454 if (ret)
499− goto err_put_rpm;
455+ goto err_disable_supply;
500456
501457 return 0;
502458
503−err_put_rpm:
504− if (on)
505− gdsc_pm_runtime_put(sc);
506459 err_disable_supply:
507460 if (on && sc->rsupply)
508461 regulator_disable(sc->rsupply);
@@ -541,8 +494,6 @@ int gdsc_register(struct gdsc_desc *desc, · 32 unmodified lines
541494 for (i = 0; i < num; i++) {
542495 if (!scs[i])
543496 continue;
544− if (pm_runtime_enabled(dev))
545− scs[i]->dev = dev;
546497 scs[i]->regmap = regmap;
547498 scs[i]->rcdev = rcdev;
548499 ret = gdsc_init(scs[i]);
drivers/clk/qcom/gdsc.h+0−2
@@ -30,7 +30,6 @@ struct reset_controller_dev; · 29 unmodified lines
3030 * @resets: ids of resets associated with this gdsc
3131 * @reset_count: number of @resets
3232 * @rcdev: reset controller
33− * @dev: the device holding the GDSC, used for pm_runtime calls
3433 */
3534 struct gdsc {
3635 struct generic_pm_domain pd;
@@ -74,7 +73,6 @@ struct gdsc { · 37 unmodified lines
7473
7574 const char *supply;
7675 struct regulator *rsupply;
77− struct device *dev;
7876 };
7977
8078 struct gdsc_desc {
drivers/clk/qcom/gpucc-sc7280.c+1−0
@@ -463,6 +463,7 @@ static int gpu_cc_sc7280_probe(struct platform_device *pdev) · 462 unmodified lines
463463 */
464464 regmap_update_bits(regmap, 0x1170, BIT(0), BIT(0));
465465 regmap_update_bits(regmap, 0x1098, BIT(0), BIT(0));
466+ regmap_update_bits(regmap, 0x1098, BIT(13), BIT(13));
466467
467468 return qcom_cc_really_probe(pdev, &gpu_cc_sc7280_desc, regmap);
468469 }
drivers/clk/renesas/r8a779g0-cpg-mssr.c+9−4
@@ -47,6 +47,7 @@ enum clk_ids { · 46 unmodified lines
4747 CLK_S0_VIO,
4848 CLK_S0_VC,
4949 CLK_S0_HSC,
50+ CLK_SASYNCPER,
5051 CLK_SV_VIP,
5152 CLK_SV_IR,
5253 CLK_SDSRC,
@@ -84,6 +85,7 @@ static const struct cpg_core_clk r8a779g0_core_clks[] __initconst = { · 31 unmodified lines
8485 DEF_FIXED(".s0_vio", CLK_S0_VIO, CLK_PLL1_DIV2, 2, 1),
8586 DEF_FIXED(".s0_vc", CLK_S0_VC, CLK_PLL1_DIV2, 2, 1),
8687 DEF_FIXED(".s0_hsc", CLK_S0_HSC, CLK_PLL1_DIV2, 2, 1),
88+ DEF_FIXED(".sasyncper", CLK_SASYNCPER, CLK_PLL5_DIV4, 3, 1),
8789 DEF_FIXED(".sv_vip", CLK_SV_VIP, CLK_PLL1, 5, 1),
8890 DEF_FIXED(".sv_ir", CLK_SV_IR, CLK_PLL1, 5, 1),
8991 DEF_BASE(".sdsrc", CLK_SDSRC, CLK_TYPE_GEN4_SDSRC, CLK_PLL5),
@@ -128,6 +130,9 @@ static const struct cpg_core_clk r8a779g0_core_clks[] __initconst = { · 38 unmodified lines
128130 DEF_FIXED("s0d4_hsc", R8A779G0_CLK_S0D4_HSC, CLK_S0_HSC, 4, 1),
129131 DEF_FIXED("cl16m_hsc", R8A779G0_CLK_CL16M_HSC, CLK_S0_HSC, 48, 1),
130132 DEF_FIXED("s0d2_cc", R8A779G0_CLK_S0D2_CC, CLK_S0, 2, 1),
133+ DEF_FIXED("sasyncperd1",R8A779G0_CLK_SASYNCPERD1, CLK_SASYNCPER,1, 1),
134+ DEF_FIXED("sasyncperd2",R8A779G0_CLK_SASYNCPERD2, CLK_SASYNCPER,2, 1),
135+ DEF_FIXED("sasyncperd4",R8A779G0_CLK_SASYNCPERD4, CLK_SASYNCPER,4, 1),
131136 DEF_FIXED("svd1_ir", R8A779G0_CLK_SVD1_IR, CLK_SV_IR, 1, 1),
132137 DEF_FIXED("svd2_ir", R8A779G0_CLK_SVD2_IR, CLK_SV_IR, 2, 1),
133138 DEF_FIXED("svd1_vip", R8A779G0_CLK_SVD1_VIP, CLK_SV_VIP, 1, 1),
@@ -153,10 +158,10 @@ static const struct mssr_mod_clk r8a779g0_mod_clks[] __initconst = { · 19 unmodified lines
153158 DEF_MOD("avb0", 211, R8A779G0_CLK_S0D4_HSC),
154159 DEF_MOD("avb1", 212, R8A779G0_CLK_S0D4_HSC),
155160 DEF_MOD("avb2", 213, R8A779G0_CLK_S0D4_HSC),
156− DEF_MOD("hscif0", 514, R8A779G0_CLK_S0D3_PER),
157− DEF_MOD("hscif1", 515, R8A779G0_CLK_S0D3_PER),
158− DEF_MOD("hscif2", 516, R8A779G0_CLK_S0D3_PER),
159− DEF_MOD("hscif3", 517, R8A779G0_CLK_S0D3_PER),
161+ DEF_MOD("hscif0", 514, R8A779G0_CLK_SASYNCPERD1),
162+ DEF_MOD("hscif1", 515, R8A779G0_CLK_SASYNCPERD1),
163+ DEF_MOD("hscif2", 516, R8A779G0_CLK_SASYNCPERD1),
164+ DEF_MOD("hscif3", 517, R8A779G0_CLK_SASYNCPERD1),
160165 DEF_MOD("i2c0", 518, R8A779G0_CLK_S0D6_PER),
161166 DEF_MOD("i2c1", 519, R8A779G0_CLK_S0D6_PER),
162167 DEF_MOD("i2c2", 520, R8A779G0_CLK_S0D6_PER),
drivers/clk/samsung/clk-exynos-clkout.c+4−2
@@ -81,17 +81,19 @@ MODULE_DEVICE_TABLE(of, exynos_clkout_ids); · 80 unmodified lines
8181 static int exynos_clkout_match_parent_dev(struct device *dev, u32 *mux_mask)
8282 {
8383 const struct exynos_clkout_variant *variant;
84+ const struct of_device_id *match;
8485
8586 if (!dev->parent) {
8687 dev_err(dev, "not instantiated from MFD\n");
8788 return -EINVAL;
8889 }
8990
90− variant = of_device_get_match_data(dev->parent);
91− if (!variant) {
91+ match = of_match_device(exynos_clkout_ids, dev->parent);
92+ if (!match) {
9293 dev_err(dev, "cannot match parent device\n");
9394 return -EINVAL;
9495 }
96+ variant = match->data;
9597
9698 *mux_mask = variant->mux_mask;
9799
drivers/clk/samsung/clk-exynos7885.c+2−2
@@ -231,7 +231,7 @@ static const struct samsung_div_clock top_div_clks[] __initconst = { · 230 unmodified lines
231231 CLK_CON_DIV_PLL_SHARED0_DIV2, 0, 1),
232232 DIV(CLK_DOUT_SHARED0_DIV3, "dout_shared0_div3", "fout_shared0_pll",
233233 CLK_CON_DIV_PLL_SHARED0_DIV3, 0, 2),
234− DIV(CLK_DOUT_SHARED0_DIV4, "dout_shared0_div4", "fout_shared0_pll",
234+ DIV(CLK_DOUT_SHARED0_DIV4, "dout_shared0_div4", "dout_shared0_div2",
235235 CLK_CON_DIV_PLL_SHARED0_DIV4, 0, 1),
236236 DIV(CLK_DOUT_SHARED0_DIV5, "dout_shared0_div5", "fout_shared0_pll",
237237 CLK_CON_DIV_PLL_SHARED0_DIV5, 0, 3),
@@ -239,7 +239,7 @@ static const struct samsung_div_clock top_div_clks[] __initconst = { · 1 unmodified line
239239 CLK_CON_DIV_PLL_SHARED1_DIV2, 0, 1),
240240 DIV(CLK_DOUT_SHARED1_DIV3, "dout_shared1_div3", "fout_shared1_pll",
241241 CLK_CON_DIV_PLL_SHARED1_DIV3, 0, 2),
242− DIV(CLK_DOUT_SHARED1_DIV4, "dout_shared1_div4", "fout_shared1_pll",
242+ DIV(CLK_DOUT_SHARED1_DIV4, "dout_shared1_div4", "dout_shared1_div2",
243243 CLK_CON_DIV_PLL_SHARED1_DIV4, 0, 1),
244244
245245 /* CORE */
drivers/clk/sifive/Kconfig+3−1
@@ -2,7 +2,8 @@ · 1 unmodified line
22
33 menuconfig CLK_SIFIVE
44 bool "SiFive SoC driver support"
5− depends on RISCV || COMPILE_TEST
5+ depends on SOC_SIFIVE || COMPILE_TEST
6+ default SOC_SIFIVE
67 help
78 SoC drivers for SiFive Linux-capable SoCs.
89
@@ -10,6 +11,7 @@ if CLK_SIFIVE · 1 unmodified line
1011
1112 config CLK_SIFIVE_PRCI
1213 bool "PRCI driver for SiFive SoCs"
14+ default SOC_SIFIVE
1315 select RESET_CONTROLLER
1416 select RESET_SIMPLE
1517 select CLK_ANALOGBITS_WRPLL_CLN28HPC
drivers/clocksource/arm_arch_timer.c+5−2
@@ -806,6 +806,9 @@ static u64 __arch_timer_check_delta(void) · 805 unmodified lines
806806 /*
807807 * XGene-1 implements CVAL in terms of TVAL, meaning
808808 * that the maximum timer range is 32bit. Shame on them.
809+ *
810+ * Note that TVAL is signed, thus has only 31 of its
811+ * 32 bits to express magnitude.
809812 */
810813 MIDR_ALL_VERSIONS(MIDR_CPU_MODEL(ARM_CPU_IMP_APM,
811814 APM_CPU_PART_POTENZA)),
@@ -813,8 +816,8 @@ static u64 __arch_timer_check_delta(void) · 1 unmodified line
813816 };
814817
815818 if (is_midr_in_range_list(read_cpuid_id(), broken_cval_midrs)) {
816− pr_warn_once("Broken CNTx_CVAL_EL1, limiting width to 32bits");
817− return CLOCKSOURCE_MASK(32);
819+ pr_warn_once("Broken CNTx_CVAL_EL1, using 31 bit TVAL instead.\n");
820+ return CLOCKSOURCE_MASK(31);
818821 }
819822 #endif
820823 return CLOCKSOURCE_MASK(arch_counter_get_width());
drivers/clocksource/hyperv_timer.c+15−14
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <linux/interrupt.h>
2222 #include <linux/irq.h>
2323 #include <linux/acpi.h>
24+#include <linux/hyperv.h>
2425 #include <clocksource/hyperv_timer.h>
2526 #include <asm/hyperv-tlfs.h>
2627 #include <asm/mshyperv.h>
@@ -395,25 +396,25 @@ static u64 notrace read_hv_sched_clock_tsc(void) · 368 unmodified lines
395396
396397 static void suspend_hv_clock_tsc(struct clocksource *arg)
397398 {
398− u64 tsc_msr;
399+ union hv_reference_tsc_msr tsc_msr;
399400
400401 /* Disable the TSC page */
401− tsc_msr = hv_get_register(HV_REGISTER_REFERENCE_TSC);
402− tsc_msr &= ~BIT_ULL(0);
403− hv_set_register(HV_REGISTER_REFERENCE_TSC, tsc_msr);
402+ tsc_msr.as_uint64 = hv_get_register(HV_REGISTER_REFERENCE_TSC);
403+ tsc_msr.enable = 0;
404+ hv_set_register(HV_REGISTER_REFERENCE_TSC, tsc_msr.as_uint64);
404405 }
405406
406407
407408 static void resume_hv_clock_tsc(struct clocksource *arg)
408409 {
409410 phys_addr_t phys_addr = virt_to_phys(&tsc_pg);
410− u64 tsc_msr;
411+ union hv_reference_tsc_msr tsc_msr;
411412
412413 /* Re-enable the TSC page */
413− tsc_msr = hv_get_register(HV_REGISTER_REFERENCE_TSC);
414− tsc_msr &= GENMASK_ULL(11, 0);
415− tsc_msr |= BIT_ULL(0) | (u64)phys_addr;
416− hv_set_register(HV_REGISTER_REFERENCE_TSC, tsc_msr);
414+ tsc_msr.as_uint64 = hv_get_register(HV_REGISTER_REFERENCE_TSC);
415+ tsc_msr.enable = 1;
416+ tsc_msr.pfn = HVPFN_DOWN(phys_addr);
417+ hv_set_register(HV_REGISTER_REFERENCE_TSC, tsc_msr.as_uint64);
417418 }
418419
419420 #ifdef HAVE_VDSO_CLOCKMODE_HVCLOCK
@@ -495,7 +496,7 @@ static __always_inline void hv_setup_sched_clock(void *sched_clock) {} · 75 unmodified lines
495496
496497 static bool __init hv_init_tsc_clocksource(void)
497498 {
498− u64 tsc_msr;
499+ union hv_reference_tsc_msr tsc_msr;
499500 phys_addr_t phys_addr;
500501
501502 if (!(ms_hyperv.features & HV_MSR_REFERENCE_TSC_AVAILABLE))
@@ -530,10 +531,10 @@ static bool __init hv_init_tsc_clocksource(void) · 28 unmodified lines
530531 * (which already has at least the low 12 bits set to zero since
531532 * it is page aligned). Also set the "enable" bit, which is bit 0.
532533 */
533− tsc_msr = hv_get_register(HV_REGISTER_REFERENCE_TSC);
534− tsc_msr &= GENMASK_ULL(11, 0);
535− tsc_msr = tsc_msr | 0x1 | (u64)phys_addr;
536− hv_set_register(HV_REGISTER_REFERENCE_TSC, tsc_msr);
534+ tsc_msr.as_uint64 = hv_get_register(HV_REGISTER_REFERENCE_TSC);
535+ tsc_msr.enable = 1;
536+ tsc_msr.pfn = HVPFN_DOWN(phys_addr);
537+ hv_set_register(HV_REGISTER_REFERENCE_TSC, tsc_msr.as_uint64);
537538
538539 clocksource_register_hz(&hyperv_cs_tsc, NSEC_PER_SEC/100);
539540
drivers/clocksource/timer-riscv.c+1−1
@@ -51,7 +51,7 @@ static int riscv_clock_next_event(unsigned long delta, · 50 unmodified lines
5151 static unsigned int riscv_clock_event_irq;
5252 static DEFINE_PER_CPU(struct clock_event_device, riscv_clock_event) = {
5353 .name = "riscv_timer_clockevent",
54− .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_C3STOP,
54+ .features = CLOCK_EVT_FEAT_ONESHOT,
5555 .rating = 100,
5656 .set_next_event = riscv_clock_next_event,
5757 };
drivers/cpufreq/Kconfig.x86+1−1
@@ -35,7 +35,7 @@ config X86_PCC_CPUFREQ · 34 unmodified lines
3535 If in doubt, say N.
3636
3737 config X86_AMD_PSTATE
38− tristate "AMD Processor P-State driver"
38+ bool "AMD Processor P-State driver"
3939 depends on X86 && ACPI
4040 select ACPI_PROCESSOR
4141 select ACPI_CPPC_LIB if X86_64
drivers/cpufreq/amd-pstate.c+34−15
@@ -59,12 +59,8 @@ · 58 unmodified lines
5959 * we disable it by default to go acpi-cpufreq on these processors and add a
6060 * module parameter to be able to enable it manually for debugging.
6161 */
62−static bool shared_mem = false;
63−module_param(shared_mem, bool, 0444);
64−MODULE_PARM_DESC(shared_mem,
65− "enable amd-pstate on processors with shared memory solution (false = disabled (default), true = enabled)");
66−
6762 static struct cpufreq_driver amd_pstate_driver;
63+static int cppc_load __initdata;
6864
6965 static inline int pstate_enable(bool enable)
7066 {
@@ -424,12 +420,22 @@ static void amd_pstate_boost_init(struct amd_cpudata *cpudata) · 353 unmodified lines
424420 amd_pstate_driver.boost_enabled = true;
425421 }
426422
423+static void amd_perf_ctl_reset(unsigned int cpu)
424+{
425+ wrmsrl_on_cpu(cpu, MSR_AMD_PERF_CTL, 0);
426+}
427+
427428 static int amd_pstate_cpu_init(struct cpufreq_policy *policy)
428429 {
429430 int min_freq, max_freq, nominal_freq, lowest_nonlinear_freq, ret;
430431 struct device *dev;
431432 struct amd_cpudata *cpudata;
432433
434+ /*
435+ * Resetting PERF_CTL_MSR will put the CPU in P0 frequency,
436+ * which is ideal for initialization process.
437+ */
438+ amd_perf_ctl_reset(policy->cpu);
433439 dev = get_cpu_device(policy->cpu);
434440 if (!dev)
435441 return -ENODEV;
@@ -616,6 +622,15 @@ static int __init amd_pstate_init(void) · 180 unmodified lines
616622
617623 if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
618624 return -ENODEV;
625+ /*
626+ * by default the pstate driver is disabled to load
627+ * enable the amd_pstate passive mode driver explicitly
628+ * with amd_pstate=passive in kernel command line
629+ */
630+ if (!cppc_load) {
631+ pr_debug("driver load is disabled, boot with amd_pstate=passive to enable this\n");
632+ return -ENODEV;
633+ }
619634
620635 if (!acpi_cpc_valid()) {
621636 pr_warn_once("the _CPC object is not present in SBIOS or ACPI disabled\n");
@@ -630,13 +645,11 @@ static int __init amd_pstate_init(void) · 8 unmodified lines
630645 if (boot_cpu_has(X86_FEATURE_CPPC)) {
631646 pr_debug("AMD CPPC MSR based functionality is supported\n");
632647 amd_pstate_driver.adjust_perf = amd_pstate_adjust_perf;
633− } else if (shared_mem) {
648+ } else {
649+ pr_debug("AMD CPPC shared memory based functionality is supported\n");
634650 static_call_update(amd_pstate_enable, cppc_enable);
635651 static_call_update(amd_pstate_init_perf, cppc_init_perf);
636652 static_call_update(amd_pstate_update_perf, cppc_update_perf);
637− } else {
638− pr_info("This processor supports shared memory solution, you can enable it with amd_pstate.shared_mem=1\n");
639− return -ENODEV;
640653 }
641654
642655 /* enable amd pstate feature */
@@ -653,16 +666,22 @@ static int __init amd_pstate_init(void) · 10 unmodified lines
653666
654667 return ret;
655668 }
669+device_initcall(amd_pstate_init);
656670
657−static void __exit amd_pstate_exit(void)
671+static int __init amd_pstate_param(char *str)
658672 {
659− cpufreq_unregister_driver(&amd_pstate_driver);
673+ if (!str)
674+ return -EINVAL;
660675
661− amd_pstate_enable(false);
662−}
676+ if (!strcmp(str, "disable")) {
677+ cppc_load = 0;
678+ pr_info("driver is explicitly disabled\n");
679+ } else if (!strcmp(str, "passive"))
680+ cppc_load = 1;
663681
664−module_init(amd_pstate_init);
665−module_exit(amd_pstate_exit);
682+ return 0;
683+}
684+early_param("amd_pstate", amd_pstate_param);
666685
667686 MODULE_AUTHOR("Huang Rui <ray.huang@amd.com>");
668687 MODULE_DESCRIPTION("AMD Processor P-state Frequency Driver");
drivers/cxl/core/mbox.c+1−1
@@ -174,7 +174,7 @@ int cxl_mbox_send_cmd(struct cxl_dev_state *cxlds, u16 opcode, void *in, · 173 unmodified lines
174174 };
175175 int rc;
176176
177− if (out_size > cxlds->payload_size)
177+ if (in_size > cxlds->payload_size || out_size > cxlds->payload_size)
178178 return -E2BIG;
179179
180180 rc = cxlds->mbox_send(cxlds, &mbox_cmd);
drivers/cxl/core/pmem.c+2−0
@@ -188,6 +188,7 @@ static void cxl_nvdimm_release(struct device *dev) · 187 unmodified lines
188188 {
189189 struct cxl_nvdimm *cxl_nvd = to_cxl_nvdimm(dev);
190190
191+ xa_destroy(&cxl_nvd->pmem_regions);
191192 kfree(cxl_nvd);
192193 }
193194
@@ -230,6 +231,7 @@ static struct cxl_nvdimm *cxl_nvdimm_alloc(struct cxl_memdev *cxlmd) · 36 unmodified lines
230231
231232 dev = &cxl_nvd->dev;
232233 cxl_nvd->cxlmd = cxlmd;
234+ xa_init(&cxl_nvd->pmem_regions);
233235 device_initialize(dev);
234236 lockdep_set_class(&dev->mutex, &cxl_nvdimm_key);
235237 device_set_pm_not_required(dev);
drivers/cxl/core/port.c+9−2
@@ -811,6 +811,7 @@ static struct cxl_dport *find_dport(struct cxl_port *port, int id) · 810 unmodified lines
811811 static int add_dport(struct cxl_port *port, struct cxl_dport *new)
812812 {
813813 struct cxl_dport *dup;
814+ int rc;
814815
815816 device_lock_assert(&port->dev);
816817 dup = find_dport(port, new->port_id);
@@ -821,8 +822,14 @@ static int add_dport(struct cxl_port *port, struct cxl_dport *new) · 4 unmodified lines
821822 dev_name(dup->dport));
822823 return -EBUSY;
823824 }
824− return xa_insert(&port->dports, (unsigned long)new->dport, new,
825− GFP_KERNEL);
825+
826+ rc = xa_insert(&port->dports, (unsigned long)new->dport, new,
827+ GFP_KERNEL);
828+ if (rc)
829+ return rc;
830+
831+ port->nr_dports++;
832+ return 0;
826833 }
827834
828835 /*
drivers/cxl/core/region.c+85−28
@@ -174,7 +174,8 @@ static int cxl_region_decode_commit(struct cxl_region *cxlr) · 173 unmodified lines
174174 iter = to_cxl_port(iter->dev.parent)) {
175175 cxl_rr = cxl_rr_load(iter, cxlr);
176176 cxld = cxl_rr->decoder;
177− rc = cxld->commit(cxld);
177+ if (cxld->commit)
178+ rc = cxld->commit(cxld);
178179 if (rc)
179180 break;
180181 }
@@ -657,6 +658,9 @@ static struct cxl_region_ref *alloc_region_ref(struct cxl_port *port, · 476 unmodified lines
657658 xa_for_each(&port->regions, index, iter) {
658659 struct cxl_region_params *ip = &iter->region->params;
659660
661+ if (!ip->res)
662+ continue;
663+
660664 if (ip->res->start > p->res->start) {
661665 dev_dbg(&cxlr->dev,
662666 "%s: HPA order violation %s:%pr vs %pr\n",
@@ -686,18 +690,27 @@ static struct cxl_region_ref *alloc_region_ref(struct cxl_port *port, · 23 unmodified lines
686690 return cxl_rr;
687691 }
688692
689−static void free_region_ref(struct cxl_region_ref *cxl_rr)
693+static void cxl_rr_free_decoder(struct cxl_region_ref *cxl_rr)
690694 {
691− struct cxl_port *port = cxl_rr->port;
692695 struct cxl_region *cxlr = cxl_rr->region;
693696 struct cxl_decoder *cxld = cxl_rr->decoder;
694697
698+ if (!cxld)
699+ return;
700+
695701 dev_WARN_ONCE(&cxlr->dev, cxld->region != cxlr, "region mismatch\n");
696702 if (cxld->region == cxlr) {
697703 cxld->region = NULL;
698704 put_device(&cxlr->dev);
699705 }
706+}
700707
708+static void free_region_ref(struct cxl_region_ref *cxl_rr)
709+{
710+ struct cxl_port *port = cxl_rr->port;
711+ struct cxl_region *cxlr = cxl_rr->region;
712+
713+ cxl_rr_free_decoder(cxl_rr);
701714 xa_erase(&port->regions, (unsigned long)cxlr);
702715 xa_destroy(&cxl_rr->endpoints);
703716 kfree(cxl_rr);
@@ -728,6 +741,33 @@ static int cxl_rr_ep_add(struct cxl_region_ref *cxl_rr, · 24 unmodified lines
728741 return 0;
729742 }
730743
744+static int cxl_rr_alloc_decoder(struct cxl_port *port, struct cxl_region *cxlr,
745+ struct cxl_endpoint_decoder *cxled,
746+ struct cxl_region_ref *cxl_rr)
747+{
748+ struct cxl_decoder *cxld;
749+
750+ if (port == cxled_to_port(cxled))
751+ cxld = &cxled->cxld;
752+ else
753+ cxld = cxl_region_find_decoder(port, cxlr);
754+ if (!cxld) {
755+ dev_dbg(&cxlr->dev, "%s: no decoder available\n",
756+ dev_name(&port->dev));
757+ return -EBUSY;
758+ }
759+
760+ if (cxld->region) {
761+ dev_dbg(&cxlr->dev, "%s: %s already attached to %s\n",
762+ dev_name(&port->dev), dev_name(&cxld->dev),
763+ dev_name(&cxld->region->dev));
764+ return -EBUSY;
765+ }
766+
767+ cxl_rr->decoder = cxld;
768+ return 0;
769+}
770+
731771 /**
732772 * cxl_port_attach_region() - track a region's interest in a port by endpoint
733773 * @port: port to add a new region reference 'struct cxl_region_ref'
@@ -794,12 +834,6 @@ static int cxl_port_attach_region(struct cxl_port *port, · 60 unmodified lines
794834 cxl_rr->nr_targets++;
795835 nr_targets_inc = true;
796836 }
797−
798− /*
799− * The decoder for @cxlr was allocated when the region was first
800− * attached to @port.
801− */
802− cxld = cxl_rr->decoder;
803837 } else {
804838 cxl_rr = alloc_region_ref(port, cxlr);
805839 if (IS_ERR(cxl_rr)) {
@@ -810,26 +844,11 @@ static int cxl_port_attach_region(struct cxl_port *port, · 4 unmodified lines
810844 }
811845 nr_targets_inc = true;
812846
813− if (port == cxled_to_port(cxled))
814− cxld = &cxled->cxld;
815− else
816− cxld = cxl_region_find_decoder(port, cxlr);
817− if (!cxld) {
818− dev_dbg(&cxlr->dev, "%s: no decoder available\n",
819− dev_name(&port->dev));
820− goto out_erase;
821− }
822−
823− if (cxld->region) {
824− dev_dbg(&cxlr->dev, "%s: %s already attached to %s\n",
825− dev_name(&port->dev), dev_name(&cxld->dev),
826− dev_name(&cxld->region->dev));
827− rc = -EBUSY;
847+ rc = cxl_rr_alloc_decoder(port, cxlr, cxled, cxl_rr);
848+ if (rc)
828849 goto out_erase;
829− }
830−
831− cxl_rr->decoder = cxld;
832850 }
851+ cxld = cxl_rr->decoder;
833852
834853 rc = cxl_rr_ep_add(cxl_rr, cxled);
835854 if (rc) {
@@ -971,7 +990,14 @@ static int cxl_port_setup_targets(struct cxl_port *port, · 135 unmodified lines
971990 if (cxl_rr->nr_targets_set) {
972991 int i, distance;
973992
974− distance = p->nr_targets / cxl_rr->nr_targets;
993+ /*
994+ * Passthrough ports impose no distance requirements between
995+ * peers
996+ */
997+ if (port->nr_dports == 1)
998+ distance = 0;
999+ else
1000+ distance = p->nr_targets / cxl_rr->nr_targets;
9751001 for (i = 0; i < cxl_rr->nr_targets_set; i++)
9761002 if (ep->dport == cxlsd->target[i]) {
9771003 rc = check_last_peer(cxled, ep, cxl_rr,
@@ -1508,9 +1534,24 @@ static const struct attribute_group *region_groups[] = { · 530 unmodified lines
15081534
15091535 static void cxl_region_release(struct device *dev)
15101536 {
1537+ struct cxl_root_decoder *cxlrd = to_cxl_root_decoder(dev->parent);
15111538 struct cxl_region *cxlr = to_cxl_region(dev);
1539+ int id = atomic_read(&cxlrd->region_id);
1540+
1541+ /*
1542+ * Try to reuse the recently idled id rather than the cached
1543+ * next id to prevent the region id space from increasing
1544+ * unnecessarily.
1545+ */
1546+ if (cxlr->id < id)
1547+ if (atomic_try_cmpxchg(&cxlrd->region_id, &id, cxlr->id)) {
1548+ memregion_free(id);
1549+ goto out;
1550+ }
15121551
15131552 memregion_free(cxlr->id);
1553+out:
1554+ put_device(dev->parent);
15141555 kfree(cxlr);
15151556 }
15161557
@@ -1538,8 +1579,19 @@ static struct cxl_region *to_cxl_region(struct device *dev) · 21 unmodified lines
15381579 static void unregister_region(void *dev)
15391580 {
15401581 struct cxl_region *cxlr = to_cxl_region(dev);
1582+ struct cxl_region_params *p = &cxlr->params;
1583+ int i;
15411584
15421585 device_del(dev);
1586+
1587+ /*
1588+ * Now that region sysfs is shutdown, the parameter block is now
1589+ * read-only, so no need to hold the region rwsem to access the
1590+ * region parameters.
1591+ */
1592+ for (i = 0; i < p->interleave_ways; i++)
1593+ detach_target(cxlr, i);
1594+
15431595 cxl_region_iomem_release(cxlr);
15441596 put_device(dev);
15451597 }
@@ -1561,6 +1613,11 @@ static struct cxl_region *cxl_region_alloc(struct cxl_root_decoder *cxlrd, int i · 15 unmodified lines
15611613 device_initialize(dev);
15621614 lockdep_set_class(&dev->mutex, &cxl_region_key);
15631615 dev->parent = &cxlrd->cxlsd.cxld.dev;
1616+ /*
1617+ * Keep root decoder pinned through cxl_region_release to fixup
1618+ * region id allocations
1619+ */
1620+ get_device(dev->parent);
15641621 device_set_pm_not_required(dev);
15651622 dev->bus = &cxl_bus_type;
15661623 dev->type = &cxl_region_type;
drivers/cxl/cxl.h+3−1
@@ -423,7 +423,7 @@ struct cxl_nvdimm { · 422 unmodified lines
423423 struct device dev;
424424 struct cxl_memdev *cxlmd;
425425 struct cxl_nvdimm_bridge *bridge;
426− struct cxl_pmem_region *region;
426+ struct xarray pmem_regions;
427427 };
428428
429429 struct cxl_pmem_region_mapping {
@@ -457,6 +457,7 @@ struct cxl_pmem_region { · 27 unmodified lines
457457 * @regions: cxl_region_ref instances, regions mapped by this port
458458 * @parent_dport: dport that points to this port in the parent
459459 * @decoder_ida: allocator for decoder ids
460+ * @nr_dports: number of entries in @dports
460461 * @hdm_end: track last allocated HDM decoder instance for allocation ordering
461462 * @commit_end: cursor to track highest committed decoder for commit ordering
462463 * @component_reg_phys: component register capability base address (optional)
@@ -475,6 +476,7 @@ struct cxl_port { · 12 unmodified lines
475476 struct xarray regions;
476477 struct cxl_dport *parent_dport;
477478 struct ida decoder_ida;
479+ int nr_dports;
478480 int hdm_end;
479481 int commit_end;
480482 resource_size_t component_reg_phys;
drivers/cxl/pmem.c+67−38
@@ -30,17 +30,20 @@ static void unregister_nvdimm(void *nvdimm) · 29 unmodified lines
3030 struct cxl_nvdimm *cxl_nvd = nvdimm_provider_data(nvdimm);
3131 struct cxl_nvdimm_bridge *cxl_nvb = cxl_nvd->bridge;
3232 struct cxl_pmem_region *cxlr_pmem;
33+ unsigned long index;
3334
3435 device_lock(&cxl_nvb->dev);
35− cxlr_pmem = cxl_nvd->region;
3636 dev_set_drvdata(&cxl_nvd->dev, NULL);
37− cxl_nvd->region = NULL;
38− device_unlock(&cxl_nvb->dev);
37+ xa_for_each(&cxl_nvd->pmem_regions, index, cxlr_pmem) {
38+ get_device(&cxlr_pmem->dev);
39+ device_unlock(&cxl_nvb->dev);
3940
40− if (cxlr_pmem) {
4141 device_release_driver(&cxlr_pmem->dev);
4242 put_device(&cxlr_pmem->dev);
43+
44+ device_lock(&cxl_nvb->dev);
4345 }
46+ device_unlock(&cxl_nvb->dev);
4447
4548 nvdimm_delete(nvdimm);
4649 cxl_nvd->bridge = NULL;
@@ -107,7 +110,7 @@ static int cxl_pmem_get_config_size(struct cxl_dev_state *cxlds, · 60 unmodified lines
107110
108111 *cmd = (struct nd_cmd_get_config_size) {
109112 .config_size = cxlds->lsa_size,
110− .max_xfer = cxlds->payload_size,
113+ .max_xfer = cxlds->payload_size - sizeof(struct cxl_mbox_set_lsa),
111114 };
112115
113116 return 0;
@@ -148,7 +151,7 @@ static int cxl_pmem_set_config_data(struct cxl_dev_state *cxlds, · 34 unmodified lines
148151 return -EINVAL;
149152
150153 /* 4-byte status follows the input data in the payload */
151− if (struct_size(cmd, in_buf, cmd->in_length) + 4 > buf_len)
154+ if (size_add(struct_size(cmd, in_buf, cmd->in_length), 4) > buf_len)
152155 return -EINVAL;
153156
154157 set_lsa =
@@ -366,25 +369,49 @@ static int match_cxl_nvdimm(struct device *dev, void *data) · 211 unmodified lines
366369
367370 static void unregister_nvdimm_region(void *nd_region)
368371 {
369− struct cxl_nvdimm_bridge *cxl_nvb;
370− struct cxl_pmem_region *cxlr_pmem;
372+ nvdimm_region_delete(nd_region);
373+}
374+
375+static int cxl_nvdimm_add_region(struct cxl_nvdimm *cxl_nvd,
376+ struct cxl_pmem_region *cxlr_pmem)
377+{
378+ int rc;
379+
380+ rc = xa_insert(&cxl_nvd->pmem_regions, (unsigned long)cxlr_pmem,
381+ cxlr_pmem, GFP_KERNEL);
382+ if (rc)
383+ return rc;
384+
385+ get_device(&cxlr_pmem->dev);
386+ return 0;
387+}
388+
389+static void cxl_nvdimm_del_region(struct cxl_nvdimm *cxl_nvd,
390+ struct cxl_pmem_region *cxlr_pmem)
391+{
392+ /*
393+ * It is possible this is called without a corresponding
394+ * cxl_nvdimm_add_region for @cxlr_pmem
395+ */
396+ cxlr_pmem = xa_erase(&cxl_nvd->pmem_regions, (unsigned long)cxlr_pmem);
397+ if (cxlr_pmem)
398+ put_device(&cxlr_pmem->dev);
399+}
400+
401+static void release_mappings(void *data)
402+{
371403 int i;
404+ struct cxl_pmem_region *cxlr_pmem = data;
405+ struct cxl_nvdimm_bridge *cxl_nvb = cxlr_pmem->bridge;
372406
373− cxlr_pmem = nd_region_provider_data(nd_region);
374− cxl_nvb = cxlr_pmem->bridge;
375407 device_lock(&cxl_nvb->dev);
376408 for (i = 0; i < cxlr_pmem->nr_mappings; i++) {
377409 struct cxl_pmem_region_mapping *m = &cxlr_pmem->mapping[i];
378410 struct cxl_nvdimm *cxl_nvd = m->cxl_nvd;
379411
380− if (cxl_nvd->region) {
381− put_device(&cxlr_pmem->dev);
382− cxl_nvd->region = NULL;
383− }
412+ cxl_nvdimm_del_region(cxl_nvd, cxlr_pmem);
384413 }
385414 device_unlock(&cxl_nvb->dev);
386−
387− nvdimm_region_delete(nd_region);
388415 }
389416
390417 static void cxlr_pmem_remove_resource(void *res)
@@ -422,7 +449,7 @@ static int cxl_pmem_region_probe(struct device *dev) · 31 unmodified lines
422449 if (!cxl_nvb->nvdimm_bus) {
423450 dev_dbg(dev, "nvdimm bus not found\n");
424451 rc = -ENXIO;
425− goto err;
452+ goto out_nvb;
426453 }
427454
428455 memset(&mappings, 0, sizeof(mappings));
@@ -431,7 +458,7 @@ static int cxl_pmem_region_probe(struct device *dev) · 2 unmodified lines
431458 res = devm_kzalloc(dev, sizeof(*res), GFP_KERNEL);
432459 if (!res) {
433460 rc = -ENOMEM;
434− goto err;
461+ goto out_nvb;
435462 }
436463
437464 res->name = "Persistent Memory";
@@ -442,11 +469,11 @@ static int cxl_pmem_region_probe(struct device *dev) · 4 unmodified lines
442469
443470 rc = insert_resource(&iomem_resource, res);
444471 if (rc)
445− goto err;
472+ goto out_nvb;
446473
447474 rc = devm_add_action_or_reset(dev, cxlr_pmem_remove_resource, res);
448475 if (rc)
449− goto err;
476+ goto out_nvb;
450477
451478 ndr_desc.res = res;
452479 ndr_desc.provider_data = cxlr_pmem;
@@ -462,7 +489,7 @@ static int cxl_pmem_region_probe(struct device *dev) · 9 unmodified lines
462489 nd_set = devm_kzalloc(dev, sizeof(*nd_set), GFP_KERNEL);
463490 if (!nd_set) {
464491 rc = -ENOMEM;
465− goto err;
492+ goto out_nvb;
466493 }
467494
468495 ndr_desc.memregion = cxlr->id;
@@ -472,9 +499,13 @@ static int cxl_pmem_region_probe(struct device *dev) · 3 unmodified lines
472499 info = kmalloc_array(cxlr_pmem->nr_mappings, sizeof(*info), GFP_KERNEL);
473500 if (!info) {
474501 rc = -ENOMEM;
475− goto err;
502+ goto out_nvb;
476503 }
477504
505+ rc = devm_add_action_or_reset(dev, release_mappings, cxlr_pmem);
506+ if (rc)
507+ goto out_nvd;
508+
478509 for (i = 0; i < cxlr_pmem->nr_mappings; i++) {
479510 struct cxl_pmem_region_mapping *m = &cxlr_pmem->mapping[i];
480511 struct cxl_memdev *cxlmd = m->cxlmd;
@@ -486,7 +517,7 @@ static int cxl_pmem_region_probe(struct device *dev) · 5 unmodified lines
486517 dev_dbg(dev, "[%d]: %s: no cxl_nvdimm found\n", i,
487518 dev_name(&cxlmd->dev));
488519 rc = -ENODEV;
489− goto err;
520+ goto out_nvd;
490521 }
491522
492523 /* safe to drop ref now with bridge lock held */
@@ -498,10 +529,17 @@ static int cxl_pmem_region_probe(struct device *dev) · 5 unmodified lines
498529 dev_dbg(dev, "[%d]: %s: no nvdimm found\n", i,
499530 dev_name(&cxlmd->dev));
500531 rc = -ENODEV;
501− goto err;
532+ goto out_nvd;
502533 }
503− cxl_nvd->region = cxlr_pmem;
504− get_device(&cxlr_pmem->dev);
534+
535+ /*
536+ * Pin the region per nvdimm device as those may be released
537+ * out-of-order with respect to the region, and a single nvdimm
538+ * maybe associated with multiple regions
539+ */
540+ rc = cxl_nvdimm_add_region(cxl_nvd, cxlr_pmem);
541+ if (rc)
542+ goto out_nvd;
505543 m->cxl_nvd = cxl_nvd;
506544 mappings[i] = (struct nd_mapping_desc) {
507545 .nvdimm = nvdimm,
@@ -527,27 +565,18 @@ static int cxl_pmem_region_probe(struct device *dev) · 19 unmodified lines
527565 nvdimm_pmem_region_create(cxl_nvb->nvdimm_bus, &ndr_desc);
528566 if (!cxlr_pmem->nd_region) {
529567 rc = -ENOMEM;
530− goto err;
568+ goto out_nvd;
531569 }
532570
533571 rc = devm_add_action_or_reset(dev, unregister_nvdimm_region,
534572 cxlr_pmem->nd_region);
535−out:
573+out_nvd:
536574 kfree(info);
575+out_nvb:
537576 device_unlock(&cxl_nvb->dev);
538577 put_device(&cxl_nvb->dev);
539578
540579 return rc;
541−
542−err:
543− dev_dbg(dev, "failed to create nvdimm region\n");
544− for (i--; i >= 0; i--) {
545− nvdimm = mappings[i].nvdimm;
546− cxl_nvd = nvdimm_provider_data(nvdimm);
547− put_device(&cxl_nvd->region->dev);
548− cxl_nvd->region = NULL;
549− }
550− goto out;
551580 }
552581
553582 static struct cxl_driver cxl_pmem_region_driver = {
drivers/dax/hmem/device.c+15−9
@@ -8,6 +8,13 @@ · 7 unmodified lines
88 static bool nohmem;
99 module_param_named(disable, nohmem, bool, 0444);
1010
11+static struct resource hmem_active = {
12+ .name = "HMEM devices",
13+ .start = 0,
14+ .end = -1,
15+ .flags = IORESOURCE_MEM,
16+};
17+
1118 void hmem_register_device(int target_nid, struct resource *r)
1219 {
1320 /* define a clean / non-busy resource for the platform device */
@@ -41,6 +48,12 @@ void hmem_register_device(int target_nid, struct resource *r) · 27 unmodified lines
4148 goto out_pdev;
4249 }
4350
51+ if (!__request_region(&hmem_active, res.start, resource_size(&res),
52+ dev_name(&pdev->dev), 0)) {
53+ dev_dbg(&pdev->dev, "hmem range %pr already active\n", &res);
54+ goto out_active;
55+ }
56+
4457 pdev->dev.numa_node = numa_map_to_online_node(target_nid);
4558 info = (struct memregion_info) {
4659 .target_node = target_nid,
@@ -66,6 +79,8 @@ void hmem_register_device(int target_nid, struct resource *r) · 19 unmodified lines
6679 return;
6780
6881 out_resource:
82+ __release_region(&hmem_active, res.start, resource_size(&res));
83+out_active:
6984 platform_device_put(pdev);
7085 out_pdev:
7186 memregion_free(id);
@@ -73,15 +88,6 @@ out_pdev: · 1 unmodified line
7388
7489 static __init int hmem_register_one(struct resource *res, void *data)
7590 {
76− /*
77− * If the resource is not a top-level resource it was already
78− * assigned to a device by the HMAT parsing.
79− */
80− if (res->parent != &iomem_resource) {
81− pr_info("HMEM: skip %pr, already claimed\n", res);
82− return 0;
83− }
84−
8591 hmem_register_device(phys_to_target_node(res->start), res);
8692
8793 return 0;
drivers/dma-buf/dma-buf.c+17−6
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <linux/slab.h>
1616 #include <linux/dma-buf.h>
1717 #include <linux/dma-fence.h>
18+#include <linux/dma-fence-unwrap.h>
1819 #include <linux/anon_inodes.h>
1920 #include <linux/export.h>
2021 #include <linux/debugfs.h>
@@ -391,8 +392,10 @@ static long dma_buf_import_sync_file(struct dma_buf *dmabuf, · 370 unmodified lines
391392 const void __user *user_data)
392393 {
393394 struct dma_buf_import_sync_file arg;
394− struct dma_fence *fence;
395+ struct dma_fence *fence, *f;
395396 enum dma_resv_usage usage;
397+ struct dma_fence_unwrap iter;
398+ unsigned int num_fences;
396399 int ret = 0;
397400
398401 if (copy_from_user(&arg, user_data, sizeof(arg)))
@@ -411,13 +414,21 @@ static long dma_buf_import_sync_file(struct dma_buf *dmabuf, · 12 unmodified lines
411414 usage = (arg.flags & DMA_BUF_SYNC_WRITE) ? DMA_RESV_USAGE_WRITE :
412415 DMA_RESV_USAGE_READ;
413416
414− dma_resv_lock(dmabuf->resv, NULL);
417+ num_fences = 0;
418+ dma_fence_unwrap_for_each(f, &iter, fence)
419+ ++num_fences;
415420
416− ret = dma_resv_reserve_fences(dmabuf->resv, 1);
417− if (!ret)
418− dma_resv_add_fence(dmabuf->resv, fence, usage);
421+ if (num_fences > 0) {
422+ dma_resv_lock(dmabuf->resv, NULL);
419423
420− dma_resv_unlock(dmabuf->resv);
424+ ret = dma_resv_reserve_fences(dmabuf->resv, num_fences);
425+ if (!ret) {
426+ dma_fence_unwrap_for_each(f, &iter, fence)
427+ dma_resv_add_fence(dmabuf->resv, f, usage);
428+ }
429+
430+ dma_resv_unlock(dmabuf->resv);
431+ }
421432
422433 dma_fence_put(fence);
423434
drivers/dma-buf/dma-heap.c+15−13
@@ -233,18 +233,6 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) · 232 unmodified lines
233233 return ERR_PTR(-EINVAL);
234234 }
235235
236− /* check the name is unique */
237− mutex_lock(&heap_list_lock);
238− list_for_each_entry(h, &heap_list, list) {
239− if (!strcmp(h->name, exp_info->name)) {
240− mutex_unlock(&heap_list_lock);
241− pr_err("dma_heap: Already registered heap named %s\n",
242− exp_info->name);
243− return ERR_PTR(-EINVAL);
244− }
245− }
246− mutex_unlock(&heap_list_lock);
247−
248236 heap = kzalloc(sizeof(*heap), GFP_KERNEL);
249237 if (!heap)
250238 return ERR_PTR(-ENOMEM);
@@ -283,13 +271,27 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) · 32 unmodified lines
283271 err_ret = ERR_CAST(dev_ret);
284272 goto err2;
285273 }
286− /* Add heap to the list */
274+
287275 mutex_lock(&heap_list_lock);
276+ /* check the name is unique */
277+ list_for_each_entry(h, &heap_list, list) {
278+ if (!strcmp(h->name, exp_info->name)) {
279+ mutex_unlock(&heap_list_lock);
280+ pr_err("dma_heap: Already registered heap named %s\n",
281+ exp_info->name);
282+ err_ret = ERR_PTR(-EINVAL);
283+ goto err3;
284+ }
285+ }
286+
287+ /* Add heap to the list */
288288 list_add(&heap->list, &heap_list);
289289 mutex_unlock(&heap_list_lock);
290290
291291 return heap;
292292
293+err3:
294+ device_destroy(dma_heap_class, heap->heap_devt);
293295 err2:
294296 cdev_del(&heap->heap_cdev);
295297 err1:
drivers/dma/apple-admac.c+1−1
@@ -493,7 +493,7 @@ static struct dma_chan *admac_dma_of_xlate(struct of_phandle_args *dma_spec, · 492 unmodified lines
493493 return NULL;
494494 }
495495
496− return &ad->channels[index].chan;
496+ return dma_get_slave_channel(&ad->channels[index].chan);
497497 }
498498
499499 static int admac_drain_reports(struct admac_data *ad, int channo)
drivers/dma/at_hdmac.c+60−93
@@ -256,6 +256,8 @@ static void atc_dostart(struct at_dma_chan *atchan, struct at_desc *first) · 255 unmodified lines
256256 ATC_SPIP_BOUNDARY(first->boundary));
257257 channel_writel(atchan, DPIP, ATC_DPIP_HOLE(first->dst_hole) |
258258 ATC_DPIP_BOUNDARY(first->boundary));
259+ /* Don't allow CPU to reorder channel enable. */
260+ wmb();
259261 dma_writel(atdma, CHER, atchan->mask);
260262
261263 vdbg_dump_regs(atchan);
@@ -316,7 +318,8 @@ static int atc_get_bytes_left(struct dma_chan *chan, dma_cookie_t cookie) · 54 unmodified lines
316318 struct at_desc *desc_first = atc_first_active(atchan);
317319 struct at_desc *desc;
318320 int ret;
319− u32 ctrla, dscr, trials;
321+ u32 ctrla, dscr;
322+ unsigned int i;
320323
321324 /*
322325 * If the cookie doesn't match to the currently running transfer then
@@ -386,7 +389,7 @@ static int atc_get_bytes_left(struct dma_chan *chan, dma_cookie_t cookie) · 63 unmodified lines
386389 dscr = channel_readl(atchan, DSCR);
387390 rmb(); /* ensure DSCR is read before CTRLA */
388391 ctrla = channel_readl(atchan, CTRLA);
389− for (trials = 0; trials < ATC_MAX_DSCR_TRIALS; ++trials) {
392+ for (i = 0; i < ATC_MAX_DSCR_TRIALS; ++i) {
390393 u32 new_dscr;
391394
392395 rmb(); /* ensure DSCR is read after CTRLA */
@@ -412,7 +415,7 @@ static int atc_get_bytes_left(struct dma_chan *chan, dma_cookie_t cookie) · 19 unmodified lines
412415 rmb(); /* ensure DSCR is read before CTRLA */
413416 ctrla = channel_readl(atchan, CTRLA);
414417 }
415− if (unlikely(trials >= ATC_MAX_DSCR_TRIALS))
418+ if (unlikely(i == ATC_MAX_DSCR_TRIALS))
416419 return -ETIMEDOUT;
417420
418421 /* for the first descriptor we can be more accurate */
@@ -462,18 +465,6 @@ atc_chain_complete(struct at_dma_chan *atchan, struct at_desc *desc) · 43 unmodified lines
462465 if (!atc_chan_is_cyclic(atchan))
463466 dma_cookie_complete(txd);
464467
465− /* If the transfer was a memset, free our temporary buffer */
466− if (desc->memset_buffer) {
467− dma_pool_free(atdma->memset_pool, desc->memset_vaddr,
468− desc->memset_paddr);
469− desc->memset_buffer = false;
470− }
471−
472− /* move children to free_list */
473− list_splice_init(&desc->tx_list, &atchan->free_list);
474− /* move myself to free_list */
475− list_move(&desc->desc_node, &atchan->free_list);
476−
477468 spin_unlock_irqrestore(&atchan->lock, flags);
478469
479470 dma_descriptor_unmap(txd);
@@ -483,42 +474,20 @@ atc_chain_complete(struct at_dma_chan *atchan, struct at_desc *desc) · 3 unmodified lines
483474 dmaengine_desc_get_callback_invoke(txd, NULL);
484475
485476 dma_run_dependencies(txd);
486−}
487−
488−/**
489− * atc_complete_all - finish work for all transactions
490− * @atchan: channel to complete transactions for
491− *
492− * Eventually submit queued descriptors if any
493− *
494− * Assume channel is idle while calling this function
495− * Called with atchan->lock held and bh disabled
496− */
497−static void atc_complete_all(struct at_dma_chan *atchan)
498−{
499− struct at_desc *desc, *_desc;
500− LIST_HEAD(list);
501− unsigned long flags;
502−
503− dev_vdbg(chan2dev(&atchan->chan_common), "complete all\n");
504477
505478 spin_lock_irqsave(&atchan->lock, flags);
506−
507− /*
508− * Submit queued descriptors ASAP, i.e. before we go through
509− * the completed ones.
510− */
511− if (!list_empty(&atchan->queue))
512− atc_dostart(atchan, atc_first_queued(atchan));
513− /* empty active_list now it is completed */
514− list_splice_init(&atchan->active_list, &list);
515− /* empty queue list by moving descriptors (if any) to active_list */
516− list_splice_init(&atchan->queue, &atchan->active_list);
517−
479+ /* move children to free_list */
480+ list_splice_init(&desc->tx_list, &atchan->free_list);
481+ /* add myself to free_list */
482+ list_add(&desc->desc_node, &atchan->free_list);
518483 spin_unlock_irqrestore(&atchan->lock, flags);
519484
520− list_for_each_entry_safe(desc, _desc, &list, desc_node)
521− atc_chain_complete(atchan, desc);
485+ /* If the transfer was a memset, free our temporary buffer */
486+ if (desc->memset_buffer) {
487+ dma_pool_free(atdma->memset_pool, desc->memset_vaddr,
488+ desc->memset_paddr);
489+ desc->memset_buffer = false;
490+ }
522491 }
523492
524493 /**
@@ -527,26 +496,28 @@ static void atc_complete_all(struct at_dma_chan *atchan) · 2 unmodified lines
527496 */
528497 static void atc_advance_work(struct at_dma_chan *atchan)
529498 {
499+ struct at_desc *desc;
530500 unsigned long flags;
531− int ret;
532501
533502 dev_vdbg(chan2dev(&atchan->chan_common), "advance_work\n");
534503
535504 spin_lock_irqsave(&atchan->lock, flags);
536− ret = atc_chan_is_enabled(atchan);
537− spin_unlock_irqrestore(&atchan->lock, flags);
538− if (ret)
539− return;
540−
541− if (list_empty(&atchan->active_list) ||
542− list_is_singular(&atchan->active_list))
543− return atc_complete_all(atchan);
505+ if (atc_chan_is_enabled(atchan) || list_empty(&atchan->active_list))
506+ return spin_unlock_irqrestore(&atchan->lock, flags);
544507
545− atc_chain_complete(atchan, atc_first_active(atchan));
508+ desc = atc_first_active(atchan);
509+ /* Remove the transfer node from the active list. */
510+ list_del_init(&desc->desc_node);
511+ spin_unlock_irqrestore(&atchan->lock, flags);
512+ atc_chain_complete(atchan, desc);
546513
547514 /* advance work */
548515 spin_lock_irqsave(&atchan->lock, flags);
549− atc_dostart(atchan, atc_first_active(atchan));
516+ if (!list_empty(&atchan->active_list)) {
517+ desc = atc_first_queued(atchan);
518+ list_move_tail(&desc->desc_node, &atchan->active_list);
519+ atc_dostart(atchan, desc);
520+ }
550521 spin_unlock_irqrestore(&atchan->lock, flags);
551522 }
552523
@@ -558,6 +529,7 @@ static void atc_advance_work(struct at_dma_chan *atchan) · 5 unmodified lines
558529 static void atc_handle_error(struct at_dma_chan *atchan)
559530 {
560531 struct at_desc *bad_desc;
532+ struct at_desc *desc;
561533 struct at_desc *child;
562534 unsigned long flags;
563535
@@ -570,13 +542,12 @@ static void atc_handle_error(struct at_dma_chan *atchan) · 6 unmodified lines
570542 bad_desc = atc_first_active(atchan);
571543 list_del_init(&bad_desc->desc_node);
572544
573− /* As we are stopped, take advantage to push queued descriptors
574− * in active_list */
575− list_splice_init(&atchan->queue, atchan->active_list.prev);
576−
577545 /* Try to restart the controller */
578− if (!list_empty(&atchan->active_list))
579− atc_dostart(atchan, atc_first_active(atchan));
546+ if (!list_empty(&atchan->active_list)) {
547+ desc = atc_first_queued(atchan);
548+ list_move_tail(&desc->desc_node, &atchan->active_list);
549+ atc_dostart(atchan, desc);
550+ }
580551
581552 /*
582553 * KERN_CRITICAL may seem harsh, but since this only happens
@@ -691,19 +662,11 @@ static dma_cookie_t atc_tx_submit(struct dma_async_tx_descriptor *tx) · 108 unmodified lines
691662 spin_lock_irqsave(&atchan->lock, flags);
692663 cookie = dma_cookie_assign(tx);
693664
694− if (list_empty(&atchan->active_list)) {
695− dev_vdbg(chan2dev(tx->chan), "tx_submit: started %u\n",
696− desc->txd.cookie);
697− atc_dostart(atchan, desc);
698− list_add_tail(&desc->desc_node, &atchan->active_list);
699− } else {
700− dev_vdbg(chan2dev(tx->chan), "tx_submit: queued %u\n",
701− desc->txd.cookie);
702− list_add_tail(&desc->desc_node, &atchan->queue);
703− }
704−
665+ list_add_tail(&desc->desc_node, &atchan->queue);
705666 spin_unlock_irqrestore(&atchan->lock, flags);
706667
668+ dev_vdbg(chan2dev(tx->chan), "tx_submit: queued %u\n",
669+ desc->txd.cookie);
707670 return cookie;
708671 }
709672
@@ -1445,11 +1408,8 @@ static int atc_terminate_all(struct dma_chan *chan) · 735 unmodified lines
14451408 struct at_dma_chan *atchan = to_at_dma_chan(chan);
14461409 struct at_dma *atdma = to_at_dma(chan->device);
14471410 int chan_id = atchan->chan_common.chan_id;
1448− struct at_desc *desc, *_desc;
14491411 unsigned long flags;
14501412
1451− LIST_HEAD(list);
1452−
14531413 dev_vdbg(chan2dev(chan), "%s\n", __func__);
14541414
14551415 /*
@@ -1468,19 +1428,15 @@ static int atc_terminate_all(struct dma_chan *chan) · 12 unmodified lines
14681428 cpu_relax();
14691429
14701430 /* active_list entries will end up before queued entries */
1471− list_splice_init(&atchan->queue, &list);
1472− list_splice_init(&atchan->active_list, &list);
1473−
1474− spin_unlock_irqrestore(&atchan->lock, flags);
1475−
1476− /* Flush all pending and queued descriptors */
1477− list_for_each_entry_safe(desc, _desc, &list, desc_node)
1478− atc_chain_complete(atchan, desc);
1431+ list_splice_tail_init(&atchan->queue, &atchan->free_list);
1432+ list_splice_tail_init(&atchan->active_list, &atchan->free_list);
14791433
14801434 clear_bit(ATC_IS_PAUSED, &atchan->status);
14811435 /* if channel dedicated to cyclic operations, free it */
14821436 clear_bit(ATC_IS_CYCLIC, &atchan->status);
14831437
1438+ spin_unlock_irqrestore(&atchan->lock, flags);
1439+
14841440 return 0;
14851441 }
14861442
@@ -1535,20 +1491,26 @@ atc_tx_status(struct dma_chan *chan, · 48 unmodified lines
15351491 }
15361492
15371493 /**
1538− * atc_issue_pending - try to finish work
1494+ * atc_issue_pending - takes the first transaction descriptor in the pending
1495+ * queue and starts the transfer.
15391496 * @chan: target DMA channel
15401497 */
15411498 static void atc_issue_pending(struct dma_chan *chan)
15421499 {
1543− struct at_dma_chan *atchan = to_at_dma_chan(chan);
1500+ struct at_dma_chan *atchan = to_at_dma_chan(chan);
1501+ struct at_desc *desc;
1502+ unsigned long flags;
15441503
15451504 dev_vdbg(chan2dev(chan), "issue_pending\n");
15461505
1547− /* Not needed for cyclic transfers */
1548− if (atc_chan_is_cyclic(atchan))
1549− return;
1506+ spin_lock_irqsave(&atchan->lock, flags);
1507+ if (atc_chan_is_enabled(atchan) || list_empty(&atchan->queue))
1508+ return spin_unlock_irqrestore(&atchan->lock, flags);
15501509
1551− atc_advance_work(atchan);
1510+ desc = atc_first_queued(atchan);
1511+ list_move_tail(&desc->desc_node, &atchan->active_list);
1512+ atc_dostart(atchan, desc);
1513+ spin_unlock_irqrestore(&atchan->lock, flags);
15521514 }
15531515
15541516 /**
@@ -1966,7 +1928,11 @@ static int __init at_dma_probe(struct platform_device *pdev) · 411 unmodified lines
19661928 dma_has_cap(DMA_SLAVE, atdma->dma_common.cap_mask) ? "slave " : "",
19671929 plat_dat->nr_channels);
19681930
1969− dma_async_device_register(&atdma->dma_common);
1931+ err = dma_async_device_register(&atdma->dma_common);
1932+ if (err) {
1933+ dev_err(&pdev->dev, "Unable to register: %d.\n", err);
1934+ goto err_dma_async_device_register;
1935+ }
19701936
19711937 /*
19721938 * Do not return an error if the dmac node is not present in order to
@@ -1986,6 +1952,7 @@ static int __init at_dma_probe(struct platform_device *pdev) · 13 unmodified lines
19861952
19871953 err_of_dma_controller_register:
19881954 dma_async_device_unregister(&atdma->dma_common);
1955+err_dma_async_device_register:
19891956 dma_pool_destroy(atdma->memset_pool);
19901957 err_memset_pool_create:
19911958 dma_pool_destroy(atdma->dma_desc_pool);
drivers/dma/at_hdmac_regs.h+5−5
@@ -186,13 +186,13 @@ · 185 unmodified lines
186186 /* LLI == Linked List Item; aka DMA buffer descriptor */
187187 struct at_lli {
188188 /* values that are not changed by hardware */
189− dma_addr_t saddr;
190− dma_addr_t daddr;
189+ u32 saddr;
190+ u32 daddr;
191191 /* value that may get written back: */
192− u32 ctrla;
192+ u32 ctrla;
193193 /* more values that are not changed by hardware */
194− u32 ctrlb;
195− dma_addr_t dscr; /* chain to next lli */
194+ u32 ctrlb;
195+ u32 dscr; /* chain to next lli */
196196 };
197197
198198 /**
drivers/dma/idxd/cdev.c+18−0
@@ -312,6 +312,24 @@ static int idxd_user_drv_probe(struct idxd_dev *idxd_dev) · 311 unmodified lines
312312 if (idxd->state != IDXD_DEV_ENABLED)
313313 return -ENXIO;
314314
315+ /*
316+ * User type WQ is enabled only when SVA is enabled for two reasons:
317+ * - If no IOMMU or IOMMU Passthrough without SVA, userspace
318+ * can directly access physical address through the WQ.
319+ * - The IDXD cdev driver does not provide any ways to pin
320+ * user pages and translate the address from user VA to IOVA or
321+ * PA without IOMMU SVA. Therefore the application has no way
322+ * to instruct the device to perform DMA function. This makes
323+ * the cdev not usable for normal application usage.
324+ */
325+ if (!device_user_pasid_enabled(idxd)) {
326+ idxd->cmd_status = IDXD_SCMD_WQ_USER_NO_IOMMU;
327+ dev_dbg(&idxd->pdev->dev,
328+ "User type WQ cannot be enabled without SVA.\n");
329+
330+ return -EOPNOTSUPP;
331+ }
332+
315333 mutex_lock(&wq->wq_lock);
316334 wq->type = IDXD_WQT_USER;
317335 rc = drv_enable_wq(wq);
drivers/dma/idxd/device.c+17−9
@@ -390,7 +390,7 @@ static void idxd_wq_disable_cleanup(struct idxd_wq *wq) · 389 unmodified lines
390390 clear_bit(WQ_FLAG_ATS_DISABLE, &wq->flags);
391391 memset(wq->name, 0, WQ_NAME_SIZE);
392392 wq->max_xfer_bytes = WQ_DEFAULT_MAX_XFER;
393− wq->max_batch_size = WQ_DEFAULT_MAX_BATCH;
393+ idxd_wq_set_max_batch_size(idxd->data->type, wq, WQ_DEFAULT_MAX_BATCH);
394394 if (wq->opcap_bmap)
395395 bitmap_copy(wq->opcap_bmap, idxd->opcap_bmap, IDXD_MAX_OPCAP_BITS);
396396 }
@@ -730,13 +730,21 @@ static void idxd_device_wqs_clear_state(struct idxd_device *idxd) · 333 unmodified lines
730730
731731 void idxd_device_clear_state(struct idxd_device *idxd)
732732 {
733− if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags))
734− return;
733+ /* IDXD is always disabled. Other states are cleared only when IDXD is configurable. */
734+ if (test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags)) {
735+ /*
736+ * Clearing wq state is protected by wq lock.
737+ * So no need to be protected by device lock.
738+ */
739+ idxd_device_wqs_clear_state(idxd);
740+
741+ spin_lock(&idxd->dev_lock);
742+ idxd_groups_clear_state(idxd);
743+ idxd_engines_clear_state(idxd);
744+ } else {
745+ spin_lock(&idxd->dev_lock);
746+ }
735747
736− idxd_device_wqs_clear_state(idxd);
737− spin_lock(&idxd->dev_lock);
738− idxd_groups_clear_state(idxd);
739− idxd_engines_clear_state(idxd);
740748 idxd->state = IDXD_DEV_DISABLED;
741749 spin_unlock(&idxd->dev_lock);
742750 }
@@ -869,7 +877,7 @@ static int idxd_wq_config_write(struct idxd_wq *wq) · 126 unmodified lines
869877
870878 /* bytes 12-15 */
871879 wq->wqcfg->max_xfer_shift = ilog2(wq->max_xfer_bytes);
872− wq->wqcfg->max_batch_shift = ilog2(wq->max_batch_size);
880+ idxd_wqcfg_set_max_batch_shift(idxd->data->type, wq->wqcfg, ilog2(wq->max_batch_size));
873881
874882 /* bytes 32-63 */
875883 if (idxd->hw.wq_cap.op_config && wq->opcap_bmap) {
@@ -1051,7 +1059,7 @@ static int idxd_wq_load_config(struct idxd_wq *wq) · 175 unmodified lines
10511059 wq->priority = wq->wqcfg->priority;
10521060
10531061 wq->max_xfer_bytes = 1ULL << wq->wqcfg->max_xfer_shift;
1054− wq->max_batch_size = 1ULL << wq->wqcfg->max_batch_shift;
1062+ idxd_wq_set_max_batch_size(idxd->data->type, wq, 1U << wq->wqcfg->max_batch_shift);
10551063
10561064 for (i = 0; i < WQCFG_STRIDES(idxd); i++) {
10571065 wqcfg_offset = WQCFG_OFFSET(idxd, wq->id, i);
drivers/dma/idxd/idxd.h+32−0
@@ -548,6 +548,38 @@ static inline int idxd_wq_refcount(struct idxd_wq *wq) · 547 unmodified lines
548548 return wq->client_count;
549549 };
550550
551+/*
552+ * Intel IAA does not support batch processing.
553+ * The max batch size of device, max batch size of wq and
554+ * max batch shift of wqcfg should be always 0 on IAA.
555+ */
556+static inline void idxd_set_max_batch_size(int idxd_type, struct idxd_device *idxd,
557+ u32 max_batch_size)
558+{
559+ if (idxd_type == IDXD_TYPE_IAX)
560+ idxd->max_batch_size = 0;
561+ else
562+ idxd->max_batch_size = max_batch_size;
563+}
564+
565+static inline void idxd_wq_set_max_batch_size(int idxd_type, struct idxd_wq *wq,
566+ u32 max_batch_size)
567+{
568+ if (idxd_type == IDXD_TYPE_IAX)
569+ wq->max_batch_size = 0;
570+ else
571+ wq->max_batch_size = max_batch_size;
572+}
573+
574+static inline void idxd_wqcfg_set_max_batch_shift(int idxd_type, union wqcfg *wqcfg,
575+ u32 max_batch_shift)
576+{
577+ if (idxd_type == IDXD_TYPE_IAX)
578+ wqcfg->max_batch_shift = 0;
579+ else
580+ wqcfg->max_batch_shift = max_batch_shift;
581+}
582+
551583 int __must_check __idxd_driver_register(struct idxd_device_driver *idxd_drv,
552584 struct module *module, const char *mod_name);
553585 #define idxd_driver_register(driver) \
drivers/dma/idxd/init.c+2−2
@@ -183,7 +183,7 @@ static int idxd_setup_wqs(struct idxd_device *idxd) · 182 unmodified lines
183183 init_completion(&wq->wq_dead);
184184 init_completion(&wq->wq_resurrect);
185185 wq->max_xfer_bytes = WQ_DEFAULT_MAX_XFER;
186− wq->max_batch_size = WQ_DEFAULT_MAX_BATCH;
186+ idxd_wq_set_max_batch_size(idxd->data->type, wq, WQ_DEFAULT_MAX_BATCH);
187187 wq->enqcmds_retries = IDXD_ENQCMDS_RETRIES;
188188 wq->wqcfg = kzalloc_node(idxd->wqcfg_size, GFP_KERNEL, dev_to_node(dev));
189189 if (!wq->wqcfg) {
@@ -418,7 +418,7 @@ static void idxd_read_caps(struct idxd_device *idxd) · 228 unmodified lines
418418
419419 idxd->max_xfer_bytes = 1ULL << idxd->hw.gen_cap.max_xfer_shift;
420420 dev_dbg(dev, "max xfer size: %llu bytes\n", idxd->max_xfer_bytes);
421− idxd->max_batch_size = 1U << idxd->hw.gen_cap.max_batch_shift;
421+ idxd_set_max_batch_size(idxd->data->type, idxd, 1U << idxd->hw.gen_cap.max_batch_shift);
422422 dev_dbg(dev, "max batch size: %u\n", idxd->max_batch_size);
423423 if (idxd->hw.gen_cap.config_en)
424424 set_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags);
drivers/dma/idxd/sysfs.c+1−1
@@ -1046,7 +1046,7 @@ static ssize_t wq_max_batch_size_store(struct device *dev, struct device_attribu · 1045 unmodified lines
10461046 if (batch_size > idxd->max_batch_size)
10471047 return -EINVAL;
10481048
1049− wq->max_batch_size = (u32)batch_size;
1049+ idxd_wq_set_max_batch_size(idxd->data->type, wq, (u32)batch_size);
10501050
10511051 return count;
10521052 }
drivers/dma/mv_xor_v2.c+1−0
@@ -893,6 +893,7 @@ static int mv_xor_v2_remove(struct platform_device *pdev) · 892 unmodified lines
893893 tasklet_kill(&xor_dev->irq_tasklet);
894894
895895 clk_disable_unprepare(xor_dev->clk);
896+ clk_disable_unprepare(xor_dev->reg_clk);
896897
897898 return 0;
898899 }
drivers/dma/pxa_dma.c+2−2
@@ -1247,14 +1247,14 @@ static int pxad_init_phys(struct platform_device *op, · 1246 unmodified lines
12471247 return -ENOMEM;
12481248
12491249 for (i = 0; i < nb_phy_chans; i++)
1250− if (platform_get_irq(op, i) > 0)
1250+ if (platform_get_irq_optional(op, i) > 0)
12511251 nr_irq++;
12521252
12531253 for (i = 0; i < nb_phy_chans; i++) {
12541254 phy = &pdev->phys[i];
12551255 phy->base = pdev->base;
12561256 phy->idx = i;
1257− irq = platform_get_irq(op, i);
1257+ irq = platform_get_irq_optional(op, i);
12581258 if ((nr_irq > 1) && (irq > 0))
12591259 ret = devm_request_irq(&op->dev, irq,
12601260 pxad_chan_handler,
drivers/dma/stm32-dma.c+6−8
@@ -675,6 +675,8 @@ static void stm32_dma_handle_chan_paused(struct stm32_dma_chan *chan) · 674 unmodified lines
675675
676676 chan->chan_reg.dma_sndtr = stm32_dma_read(dmadev, STM32_DMA_SNDTR(chan->id));
677677
678+ chan->status = DMA_PAUSED;
679+
678680 dev_dbg(chan2dev(chan), "vchan %pK: paused\n", &chan->vchan);
679681 }
680682
@@ -789,9 +791,7 @@ static irqreturn_t stm32_dma_chan_irq(int irq, void *devid) · 108 unmodified lines
789791 if (status & STM32_DMA_TCI) {
790792 stm32_dma_irq_clear(chan, STM32_DMA_TCI);
791793 if (scr & STM32_DMA_SCR_TCIE) {
792− if (chan->status == DMA_PAUSED && !(scr & STM32_DMA_SCR_EN))
793− stm32_dma_handle_chan_paused(chan);
794− else
794+ if (chan->status != DMA_PAUSED)
795795 stm32_dma_handle_chan_done(chan, scr);
796796 }
797797 status &= ~STM32_DMA_TCI;
@@ -838,13 +838,11 @@ static int stm32_dma_pause(struct dma_chan *c) · 40 unmodified lines
838838 return -EPERM;
839839
840840 spin_lock_irqsave(&chan->vchan.lock, flags);
841+
841842 ret = stm32_dma_disable_chan(chan);
842− /*
843− * A transfer complete flag is set to indicate the end of transfer due to the stream
844− * interruption, so wait for interrupt
845− */
846843 if (!ret)
847− chan->status = DMA_PAUSED;
844+ stm32_dma_handle_chan_paused(chan);
845+
848846 spin_unlock_irqrestore(&chan->vchan.lock, flags);
849847
850848 return ret;
drivers/dma/stm32-mdma.c+1−0
@@ -1539,6 +1539,7 @@ static struct dma_chan *stm32_mdma_of_xlate(struct of_phandle_args *dma_spec, · 1538 unmodified lines
15391539 return NULL;
15401540 }
15411541
1542+ memset(&config, 0, sizeof(config));
15421543 config.request = dma_spec->args[0];
15431544 config.priority_level = dma_spec->args[1];
15441545 config.transfer_config = dma_spec->args[2];
drivers/dma/ti/k3-udma-glue.c+3−0
@@ -299,6 +299,7 @@ struct k3_udma_glue_tx_channel *k3_udma_glue_request_tx_chn(struct device *dev, · 298 unmodified lines
299299 ret = device_register(&tx_chn->common.chan_dev);
300300 if (ret) {
301301 dev_err(dev, "Channel Device registration failed %d\n", ret);
302+ put_device(&tx_chn->common.chan_dev);
302303 tx_chn->common.chan_dev.parent = NULL;
303304 goto err;
304305 }
@@ -917,6 +918,7 @@ k3_udma_glue_request_rx_chn_priv(struct device *dev, const char *name, · 612 unmodified lines
917918 ret = device_register(&rx_chn->common.chan_dev);
918919 if (ret) {
919920 dev_err(dev, "Channel Device registration failed %d\n", ret);
921+ put_device(&rx_chn->common.chan_dev);
920922 rx_chn->common.chan_dev.parent = NULL;
921923 goto err;
922924 }
@@ -1048,6 +1050,7 @@ k3_udma_glue_request_remote_rx_chn(struct device *dev, const char *name, · 125 unmodified lines
10481050 ret = device_register(&rx_chn->common.chan_dev);
10491051 if (ret) {
10501052 dev_err(dev, "Channel Device registration failed %d\n", ret);
1053+ put_device(&rx_chn->common.chan_dev);
10511054 rx_chn->common.chan_dev.parent = NULL;
10521055 goto err;
10531056 }
drivers/extcon/extcon-usbc-tusb320.c+7−1
@@ -327,7 +327,13 @@ static irqreturn_t tusb320_irq_handler(int irq, void *dev_id) · 326 unmodified lines
327327 return IRQ_NONE;
328328
329329 tusb320_extcon_irq_handler(priv, reg);
330− tusb320_typec_irq_handler(priv, reg);
330+
331+ /*
332+ * Type-C support is optional. Only call the Type-C handler if a
333+ * port had been registered previously.
334+ */
335+ if (priv->port)
336+ tusb320_typec_irq_handler(priv, reg);
331337
332338 regmap_write(priv->regmap, TUSB320_REG9, reg);
333339
drivers/firmware/arm_scmi/bus.c+11−0
@@ -216,9 +216,20 @@ void scmi_device_destroy(struct scmi_device *scmi_dev) · 215 unmodified lines
216216 device_unregister(&scmi_dev->dev);
217217 }
218218
219+void scmi_device_link_add(struct device *consumer, struct device *supplier)
220+{
221+ struct device_link *link;
222+
223+ link = device_link_add(consumer, supplier, DL_FLAG_AUTOREMOVE_CONSUMER);
224+
225+ WARN_ON(!link);
226+}
227+
219228 void scmi_set_handle(struct scmi_device *scmi_dev)
220229 {
221230 scmi_dev->handle = scmi_handle_get(&scmi_dev->dev);
231+ if (scmi_dev->handle)
232+ scmi_device_link_add(&scmi_dev->dev, scmi_dev->handle->dev);
222233 }
223234
224235 int scmi_protocol_register(const struct scmi_protocol *proto)
drivers/firmware/arm_scmi/common.h+4−1
@@ -97,6 +97,7 @@ static inline void unpack_scmi_header(u32 msg_hdr, struct scmi_msg_hdr *hdr) · 96 unmodified lines
9797 struct scmi_revision_info *
9898 scmi_revision_area_get(const struct scmi_protocol_handle *ph);
9999 int scmi_handle_put(const struct scmi_handle *handle);
100+void scmi_device_link_add(struct device *consumer, struct device *supplier);
100101 struct scmi_handle *scmi_handle_get(struct device *dev);
101102 void scmi_set_handle(struct scmi_device *scmi_dev);
102103 void scmi_setup_protocol_implemented(const struct scmi_protocol_handle *ph,
@@ -117,6 +118,7 @@ void scmi_protocol_release(const struct scmi_handle *handle, u8 protocol_id); · 14 unmodified lines
117118 *
118119 * @dev: Reference to device in the SCMI hierarchy corresponding to this
119120 * channel
121+ * @rx_timeout_ms: The configured RX timeout in milliseconds.
120122 * @handle: Pointer to SCMI entity handle
121123 * @no_completion_irq: Flag to indicate that this channel has no completion
122124 * interrupt mechanism for synchronous commands.
@@ -126,6 +128,7 @@ void scmi_protocol_release(const struct scmi_handle *handle, u8 protocol_id); · 3 unmodified lines
126128 */
127129 struct scmi_chan_info {
128130 struct device *dev;
131+ unsigned int rx_timeout_ms;
129132 struct scmi_handle *handle;
130133 bool no_completion_irq;
131134 void *transport_info;
@@ -232,7 +235,7 @@ void scmi_free_channel(struct scmi_chan_info *cinfo, struct idr *idr, int id); · 100 unmodified lines
232235 struct scmi_shared_mem;
233236
234237 void shmem_tx_prepare(struct scmi_shared_mem __iomem *shmem,
235− struct scmi_xfer *xfer);
238+ struct scmi_xfer *xfer, struct scmi_chan_info *cinfo);
236239 u32 shmem_read_header(struct scmi_shared_mem __iomem *shmem);
237240 void shmem_fetch_response(struct scmi_shared_mem __iomem *shmem,
238241 struct scmi_xfer *xfer);
drivers/firmware/arm_scmi/driver.c+27−14
@@ -2013,6 +2013,7 @@ static int scmi_chan_setup(struct scmi_info *info, struct device *dev, · 2012 unmodified lines
20132013 return -ENOMEM;
20142014
20152015 cinfo->dev = dev;
2016+ cinfo->rx_timeout_ms = info->desc->max_rx_timeout_ms;
20162017
20172018 ret = info->desc->ops->chan_setup(cinfo, info->dev, tx);
20182019 if (ret)
@@ -2044,8 +2045,12 @@ scmi_txrx_setup(struct scmi_info *info, struct device *dev, int prot_id) · 25 unmodified lines
20442045 {
20452046 int ret = scmi_chan_setup(info, dev, prot_id, true);
20462047
2047− if (!ret) /* Rx is optional, hence no error check */
2048− scmi_chan_setup(info, dev, prot_id, false);
2048+ if (!ret) {
2049+ /* Rx is optional, report only memory errors */
2050+ ret = scmi_chan_setup(info, dev, prot_id, false);
2051+ if (ret && ret != -ENOMEM)
2052+ ret = 0;
2053+ }
20492054
20502055 return ret;
20512056 }
@@ -2273,10 +2278,16 @@ int scmi_protocol_device_request(const struct scmi_device_id *id_table) · 221 unmodified lines
22732278 sdev = scmi_get_protocol_device(child, info,
22742279 id_table->protocol_id,
22752280 id_table->name);
2276− /* Set handle if not already set: device existed */
2277− if (sdev && !sdev->handle)
2278− sdev->handle =
2279− scmi_handle_get_from_info_unlocked(info);
2281+ if (sdev) {
2282+ /* Set handle if not already set: device existed */
2283+ if (!sdev->handle)
2284+ sdev->handle =
2285+ scmi_handle_get_from_info_unlocked(info);
2286+ /* Relink consumer and suppliers */
2287+ if (sdev->handle)
2288+ scmi_device_link_add(&sdev->dev,
2289+ sdev->handle->dev);
2290+ }
22802291 } else {
22812292 dev_err(info->dev,
22822293 "Failed. SCMI protocol %d not active.\n",
@@ -2475,20 +2486,17 @@ void scmi_free_channel(struct scmi_chan_info *cinfo, struct idr *idr, int id) · 192 unmodified lines
24752486
24762487 static int scmi_remove(struct platform_device *pdev)
24772488 {
2478− int ret = 0, id;
2489+ int ret, id;
24792490 struct scmi_info *info = platform_get_drvdata(pdev);
24802491 struct device_node *child;
24812492
24822493 mutex_lock(&scmi_list_mutex);
24832494 if (info->users)
2484− ret = -EBUSY;
2485− else
2486− list_del(&info->node);
2495+ dev_warn(&pdev->dev,
2496+ "Still active SCMI users will be forcibly unbound.\n");
2497+ list_del(&info->node);
24872498 mutex_unlock(&scmi_list_mutex);
24882499
2489− if (ret)
2490− return ret;
2491−
24922500 scmi_notification_exit(&info->handle);
24932501
24942502 mutex_lock(&info->protocols_mtx);
@@ -2500,7 +2508,11 @@ static int scmi_remove(struct platform_device *pdev) · 5 unmodified lines
25002508 idr_destroy(&info->active_protocols);
25012509
25022510 /* Safe to free channels since no more users */
2503− return scmi_cleanup_txrx_channels(info);
2511+ ret = scmi_cleanup_txrx_channels(info);
2512+ if (ret)
2513+ dev_warn(&pdev->dev, "Failed to cleanup SCMI channels.\n");
2514+
2515+ return 0;
25042516 }
25052517
25062518 static ssize_t protocol_version_show(struct device *dev,
@@ -2571,6 +2583,7 @@ MODULE_DEVICE_TABLE(of, scmi_of_match); · 64 unmodified lines
25712583 static struct platform_driver scmi_driver = {
25722584 .driver = {
25732585 .name = "arm-scmi",
2586+ .suppress_bind_attrs = true,
25742587 .of_match_table = scmi_of_match,
25752588 .dev_groups = versions_groups,
25762589 },
drivers/firmware/arm_scmi/mailbox.c+1−1
@@ -36,7 +36,7 @@ static void tx_prepare(struct mbox_client *cl, void *m) · 35 unmodified lines
3636 {
3737 struct scmi_mailbox *smbox = client_to_scmi_mailbox(cl);
3838
39− shmem_tx_prepare(smbox->shmem, m);
39+ shmem_tx_prepare(smbox->shmem, m, smbox->cinfo);
4040 }
4141
4242 static void rx_callback(struct mbox_client *cl, void *m)
drivers/firmware/arm_scmi/optee.c+1−1
@@ -498,7 +498,7 @@ static int scmi_optee_send_message(struct scmi_chan_info *cinfo, · 497 unmodified lines
498498 msg_tx_prepare(channel->req.msg, xfer);
499499 ret = invoke_process_msg_channel(channel, msg_command_size(xfer));
500500 } else {
501− shmem_tx_prepare(channel->req.shmem, xfer);
501+ shmem_tx_prepare(channel->req.shmem, xfer, cinfo);
502502 ret = invoke_process_smt_channel(channel);
503503 }
504504
drivers/firmware/arm_scmi/shmem.c+27−4
@@ -5,10 +5,13 @@ · 4 unmodified lines
55 * Copyright (C) 2019 ARM Ltd.
66 */
77
8+#include <linux/ktime.h>
89 #include <linux/io.h>
910 #include <linux/processor.h>
1011 #include <linux/types.h>
1112
13+#include <asm-generic/bug.h>
14+
1215 #include "common.h"
1316
1417 /*
@@ -30,16 +33,36 @@ struct scmi_shared_mem { · 15 unmodified lines
3033 };
3134
3235 void shmem_tx_prepare(struct scmi_shared_mem __iomem *shmem,
33− struct scmi_xfer *xfer)
36+ struct scmi_xfer *xfer, struct scmi_chan_info *cinfo)
3437 {
38+ ktime_t stop;
39+
3540 /*
3641 * Ideally channel must be free by now unless OS timeout last
3742 * request and platform continued to process the same, wait
3843 * until it releases the shared memory, otherwise we may endup
39− * overwriting its response with new message payload or vice-versa
44+ * overwriting its response with new message payload or vice-versa.
45+ * Giving up anyway after twice the expected channel timeout so as
46+ * not to bail-out on intermittent issues where the platform is
47+ * occasionally a bit slower to answer.
48+ *
49+ * Note that after a timeout is detected we bail-out and carry on but
50+ * the transport functionality is probably permanently compromised:
51+ * this is just to ease debugging and avoid complete hangs on boot
52+ * due to a misbehaving SCMI firmware.
4053 */
41− spin_until_cond(ioread32(&shmem->channel_status) &
42− SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE);
54+ stop = ktime_add_ms(ktime_get(), 2 * cinfo->rx_timeout_ms);
55+ spin_until_cond((ioread32(&shmem->channel_status) &
56+ SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE) ||
57+ ktime_after(ktime_get(), stop));
58+ if (!(ioread32(&shmem->channel_status) &
59+ SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE)) {
60+ WARN_ON_ONCE(1);
61+ dev_err(cinfo->dev,
62+ "Timeout waiting for a free TX channel !\n");
63+ return;
64+ }
65+
4366 /* Mark channel busy + clear error */
4467 iowrite32(0x0, &shmem->channel_status);
4568 iowrite32(xfer->hdr.poll_completion ? 0 : SCMI_SHMEM_FLAG_INTR_ENABLED,
drivers/firmware/arm_scmi/smc.c+1−1
@@ -188,7 +188,7 @@ static int smc_send_message(struct scmi_chan_info *cinfo, · 187 unmodified lines
188188 */
189189 smc_channel_lock_acquire(scmi_info, xfer);
190190
191− shmem_tx_prepare(scmi_info->shmem, xfer);
191+ shmem_tx_prepare(scmi_info->shmem, xfer, cinfo);
192192
193193 arm_smccc_1_1_invoke(scmi_info->func_id, 0, 0, 0, 0, 0, 0, 0, &res);
194194
drivers/firmware/arm_scmi/virtio.c+16−10
@@ -148,7 +148,6 @@ static void scmi_vio_channel_cleanup_sync(struct scmi_vio_channel *vioch) · 147 unmodified lines
148148 {
149149 unsigned long flags;
150150 DECLARE_COMPLETION_ONSTACK(vioch_shutdown_done);
151− void *deferred_wq = NULL;
152151
153152 /*
154153 * Prepare to wait for the last release if not already released
@@ -162,16 +161,11 @@ static void scmi_vio_channel_cleanup_sync(struct scmi_vio_channel *vioch) · 7 unmodified lines
162161
163162 vioch->shutdown_done = &vioch_shutdown_done;
164163 virtio_break_device(vioch->vqueue->vdev);
165− if (!vioch->is_rx && vioch->deferred_tx_wq) {
166− deferred_wq = vioch->deferred_tx_wq;
164+ if (!vioch->is_rx && vioch->deferred_tx_wq)
167165 /* Cannot be kicked anymore after this...*/
168166 vioch->deferred_tx_wq = NULL;
169− }
170167 spin_unlock_irqrestore(&vioch->lock, flags);
171168
172− if (deferred_wq)
173− destroy_workqueue(deferred_wq);
174−
175169 scmi_vio_channel_release(vioch);
176170
177171 /* Let any possibly concurrent RX path release the channel */
@@ -416,6 +410,11 @@ static bool virtio_chan_available(struct device *dev, int idx) · 238 unmodified lines
416410 return vioch && !vioch->cinfo;
417411 }
418412
413+static void scmi_destroy_tx_workqueue(void *deferred_tx_wq)
414+{
415+ destroy_workqueue(deferred_tx_wq);
416+}
417+
419418 static int virtio_chan_setup(struct scmi_chan_info *cinfo, struct device *dev,
420419 bool tx)
421420 {
@@ -430,6 +429,8 @@ static int virtio_chan_setup(struct scmi_chan_info *cinfo, struct device *dev, · 8 unmodified lines
430429
431430 /* Setup a deferred worker for polling. */
432431 if (tx && !vioch->deferred_tx_wq) {
432+ int ret;
433+
433434 vioch->deferred_tx_wq =
434435 alloc_workqueue(dev_name(&scmi_vdev->dev),
435436 WQ_UNBOUND | WQ_FREEZABLE | WQ_SYSFS,
@@ -437,6 +438,11 @@ static int virtio_chan_setup(struct scmi_chan_info *cinfo, struct device *dev, · 1 unmodified line
437438 if (!vioch->deferred_tx_wq)
438439 return -ENOMEM;
439440
441+ ret = devm_add_action_or_reset(dev, scmi_destroy_tx_workqueue,
442+ vioch->deferred_tx_wq);
443+ if (ret)
444+ return ret;
445+
440446 INIT_WORK(&vioch->deferred_tx_work,
441447 scmi_vio_deferred_tx_worker);
442448 }
@@ -444,12 +450,12 @@ static int virtio_chan_setup(struct scmi_chan_info *cinfo, struct device *dev, · 1 unmodified line
444450 for (i = 0; i < vioch->max_msg; i++) {
445451 struct scmi_vio_msg *msg;
446452
447− msg = devm_kzalloc(cinfo->dev, sizeof(*msg), GFP_KERNEL);
453+ msg = devm_kzalloc(dev, sizeof(*msg), GFP_KERNEL);
448454 if (!msg)
449455 return -ENOMEM;
450456
451457 if (tx) {
452− msg->request = devm_kzalloc(cinfo->dev,
458+ msg->request = devm_kzalloc(dev,
453459 VIRTIO_SCMI_MAX_PDU_SIZE,
454460 GFP_KERNEL);
455461 if (!msg->request)
@@ -458,7 +464,7 @@ static int virtio_chan_setup(struct scmi_chan_info *cinfo, struct device *dev, · 2 unmodified lines
458464 refcount_set(&msg->users, 1);
459465 }
460466
461− msg->input = devm_kzalloc(cinfo->dev, VIRTIO_SCMI_MAX_PDU_SIZE,
467+ msg->input = devm_kzalloc(dev, VIRTIO_SCMI_MAX_PDU_SIZE,
462468 GFP_KERNEL);
463469 if (!msg->input)
464470 return -ENOMEM;
drivers/firmware/efi/efi.c+1−1
@@ -611,7 +611,7 @@ int __init efi_config_parse_tables(const efi_config_table_t *config_tables, · 610 unmodified lines
611611
612612 seed = early_memremap(efi_rng_seed, sizeof(*seed));
613613 if (seed != NULL) {
614− size = READ_ONCE(seed->size);
614+ size = min(seed->size, EFI_RANDOM_SEED_SIZE);
615615 early_memunmap(seed, sizeof(*seed));
616616 } else {
617617 pr_err("Could not map UEFI random seed!\n");
drivers/firmware/efi/libstub/Makefile+1−1
@@ -82,7 +82,7 @@ $(obj)/lib-%.o: $(srctree)/lib/%.c FORCE · 81 unmodified lines
8282 lib-$(CONFIG_EFI_GENERIC_STUB) += efi-stub.o string.o intrinsics.o systable.o
8383
8484 lib-$(CONFIG_ARM) += arm32-stub.o
85−lib-$(CONFIG_ARM64) += arm64-stub.o
85+lib-$(CONFIG_ARM64) += arm64-stub.o smbios.o
8686 lib-$(CONFIG_X86) += x86-stub.o
8787 lib-$(CONFIG_RISCV) += riscv-stub.o
8888 lib-$(CONFIG_LOONGARCH) += loongarch-stub.o
drivers/firmware/efi/libstub/arm64-stub.c+16−1
@@ -15,6 +15,21 @@ · 14 unmodified lines
1515
1616 #include "efistub.h"
1717
18+static bool system_needs_vamap(void)
19+{
20+ const u8 *type1_family = efi_get_smbios_string(1, family);
21+
22+ /*
23+ * Ampere Altra machines crash in SetTime() if SetVirtualAddressMap()
24+ * has not been called prior.
25+ */
26+ if (!type1_family || strcmp(type1_family, "Altra"))
27+ return false;
28+
29+ efi_warn("Working around broken SetVirtualAddressMap()\n");
30+ return true;
31+}
32+
1833 efi_status_t check_platform_features(void)
1934 {
2035 u64 tg;
@@ -24,7 +39,7 @@ efi_status_t check_platform_features(void) · 3 unmodified lines
2439 * UEFI runtime regions 1:1 and so calling SetVirtualAddressMap() is
2540 * unnecessary.
2641 */
27− if (VA_BITS_MIN >= 48)
42+ if (VA_BITS_MIN >= 48 && !system_needs_vamap())
2843 efi_novamap = true;
2944
3045 /* UEFI mandates support for 4 KB granularity, no need to check */
drivers/firmware/efi/libstub/efistub.h+28−0
@@ -975,4 +975,32 @@ efi_enable_reset_attack_mitigation(void) { } · 974 unmodified lines
975975
976976 void efi_retrieve_tpm2_eventlog(void);
977977
978+struct efi_smbios_record {
979+ u8 type;
980+ u8 length;
981+ u16 handle;
982+};
983+
984+struct efi_smbios_type1_record {
985+ struct efi_smbios_record header;
986+
987+ u8 manufacturer;
988+ u8 product_name;
989+ u8 version;
990+ u8 serial_number;
991+ efi_guid_t uuid;
992+ u8 wakeup_type;
993+ u8 sku_number;
994+ u8 family;
995+};
996+
997+#define efi_get_smbios_string(__type, __name) ({ \
998+ int size = sizeof(struct efi_smbios_type ## __type ## _record); \
999+ int off = offsetof(struct efi_smbios_type ## __type ## _record, \
1000+ __name); \
1001+ __efi_get_smbios_string(__type, off, size); \
1002+})
1003+
1004+const u8 *__efi_get_smbios_string(u8 type, int offset, int recsize);
1005+
9781006 #endif
drivers/firmware/efi/libstub/random.c+6−1
@@ -75,7 +75,12 @@ efi_status_t efi_random_get_seed(void) · 74 unmodified lines
7575 if (status != EFI_SUCCESS)
7676 return status;
7777
78− status = efi_bs_call(allocate_pool, EFI_RUNTIME_SERVICES_DATA,
78+ /*
79+ * Use EFI_ACPI_RECLAIM_MEMORY here so that it is guaranteed that the
80+ * allocation will survive a kexec reboot (although we refresh the seed
81+ * beforehand)
82+ */
83+ status = efi_bs_call(allocate_pool, EFI_ACPI_RECLAIM_MEMORY,
7984 sizeof(*seed) + EFI_RANDOM_SEED_SIZE,
8085 (void **)&seed);
8186 if (status != EFI_SUCCESS)
drivers/firmware/efi/libstub/smbios.c+48−0
@@ -0,0 +1,48 @@
1+// SPDX-License-Identifier: GPL-2.0-only
2+// Copyright 2022 Google LLC
3+// Author: Ard Biesheuvel <ardb@google.com>
4+
5+#include <linux/efi.h>
6+
7+#include "efistub.h"
8+
9+typedef struct efi_smbios_protocol efi_smbios_protocol_t;
10+
11+struct efi_smbios_protocol {
12+ efi_status_t (__efiapi *add)(efi_smbios_protocol_t *, efi_handle_t,
13+ u16 *, struct efi_smbios_record *);
14+ efi_status_t (__efiapi *update_string)(efi_smbios_protocol_t *, u16 *,
15+ unsigned long *, u8 *);
16+ efi_status_t (__efiapi *remove)(efi_smbios_protocol_t *, u16);
17+ efi_status_t (__efiapi *get_next)(efi_smbios_protocol_t *, u16 *, u8 *,
18+ struct efi_smbios_record **,
19+ efi_handle_t *);
20+
21+ u8 major_version;
22+ u8 minor_version;
23+};
24+
25+const u8 *__efi_get_smbios_string(u8 type, int offset, int recsize)
26+{
27+ struct efi_smbios_record *record;
28+ efi_smbios_protocol_t *smbios;
29+ efi_status_t status;
30+ u16 handle = 0xfffe;
31+ const u8 *strtable;
32+
33+ status = efi_bs_call(locate_protocol, &EFI_SMBIOS_PROTOCOL_GUID, NULL,
34+ (void **)&smbios) ?:
35+ efi_call_proto(smbios, get_next, &handle, &type, &record, NULL);
36+ if (status != EFI_SUCCESS)
37+ return NULL;
38+
39+ strtable = (u8 *)record + recsize;
40+ for (int i = 1; i < ((u8 *)record)[offset]; i++) {
41+ int len = strlen(strtable);
42+
43+ if (!len)
44+ return NULL;
45+ strtable += len + 1;
46+ }
47+ return strtable;
48+}
drivers/firmware/efi/tpm.c+1−1
@@ -97,7 +97,7 @@ int __init efi_tpm_eventlog_init(void) · 96 unmodified lines
9797 goto out_calc;
9898 }
9999
100− memblock_reserve((unsigned long)final_tbl,
100+ memblock_reserve(efi.tpm_final_log,
101101 tbl_size + sizeof(*final_tbl));
102102 efi_tpm_final_log_size = tbl_size;
103103
drivers/firmware/efi/vars.c+20−48
@@ -21,29 +21,22 @@ static struct efivars *__efivars; · 20 unmodified lines
2121
2222 static DEFINE_SEMAPHORE(efivars_lock);
2323
24−static efi_status_t check_var_size(u32 attributes, unsigned long size)
25−{
26− const struct efivar_operations *fops;
27−
28− fops = __efivars->ops;
29−
30− if (!fops->query_variable_store)
31− return (size <= SZ_64K) ? EFI_SUCCESS : EFI_OUT_OF_RESOURCES;
32−
33− return fops->query_variable_store(attributes, size, false);
34−}
35−
36−static
37−efi_status_t check_var_size_nonblocking(u32 attributes, unsigned long size)
24+static efi_status_t check_var_size(bool nonblocking, u32 attributes,
25+ unsigned long size)
3826 {
3927 const struct efivar_operations *fops;
28+ efi_status_t status;
4029
4130 fops = __efivars->ops;
4231
4332 if (!fops->query_variable_store)
33+ status = EFI_UNSUPPORTED;
34+ else
35+ status = fops->query_variable_store(attributes, size,
36+ nonblocking);
37+ if (status == EFI_UNSUPPORTED)
4438 return (size <= SZ_64K) ? EFI_SUCCESS : EFI_OUT_OF_RESOURCES;
45−
46− return fops->query_variable_store(attributes, size, true);
39+ return status;
4740 }
4841
4942 /**
@@ -195,26 +188,6 @@ efi_status_t efivar_get_next_variable(unsigned long *name_size, · 145 unmodified lines
195188 }
196189 EXPORT_SYMBOL_NS_GPL(efivar_get_next_variable, EFIVAR);
197190
198−/*
199− * efivar_set_variable_blocking() - local helper function for set_variable
200− *
201− * Must be called with efivars_lock held.
202− */
203−static efi_status_t
204−efivar_set_variable_blocking(efi_char16_t *name, efi_guid_t *vendor,
205− u32 attr, unsigned long data_size, void *data)
206−{
207− efi_status_t status;
208−
209− if (data_size > 0) {
210− status = check_var_size(attr, data_size +
211− ucs2_strsize(name, 1024));
212− if (status != EFI_SUCCESS)
213− return status;
214− }
215− return __efivars->ops->set_variable(name, vendor, attr, data_size, data);
216−}
217−
218191 /*
219192 * efivar_set_variable_locked() - set a variable identified by name/vendor
220193 *
@@ -228,23 +201,21 @@ efi_status_t efivar_set_variable_locked(efi_char16_t *name, efi_guid_t *vendor, · 7 unmodified lines
228201 efi_set_variable_t *setvar;
229202 efi_status_t status;
230203
231− if (!nonblocking)
232− return efivar_set_variable_blocking(name, vendor, attr,
233− data_size, data);
204+ if (data_size > 0) {
205+ status = check_var_size(nonblocking, attr,
206+ data_size + ucs2_strsize(name, 1024));
207+ if (status != EFI_SUCCESS)
208+ return status;
209+ }
234210
235211 /*
236212 * If no _nonblocking variant exists, the ordinary one
237213 * is assumed to be non-blocking.
238214 */
239− setvar = __efivars->ops->set_variable_nonblocking ?:
240− __efivars->ops->set_variable;
215+ setvar = __efivars->ops->set_variable_nonblocking;
216+ if (!setvar || !nonblocking)
217+ setvar = __efivars->ops->set_variable;
241218
242− if (data_size > 0) {
243− status = check_var_size_nonblocking(attr, data_size +
244− ucs2_strsize(name, 1024));
245− if (status != EFI_SUCCESS)
246− return status;
247− }
248219 return setvar(name, vendor, attr, data_size, data);
249220 }
250221 EXPORT_SYMBOL_NS_GPL(efivar_set_variable_locked, EFIVAR);
@@ -264,7 +235,8 @@ efi_status_t efivar_set_variable(efi_char16_t *name, efi_guid_t *vendor, · 13 unmodified lines
264235 if (efivar_lock())
265236 return EFI_ABORTED;
266237
267− status = efivar_set_variable_blocking(name, vendor, attr, data_size, data);
238+ status = efivar_set_variable_locked(name, vendor, attr, data_size,
239+ data, false);
268240 efivar_unlock();
269241 return status;
270242 }
drivers/firmware/google/coreboot_table.c+29−8
@@ -149,12 +149,8 @@ static int coreboot_table_probe(struct platform_device *pdev) · 148 unmodified lines
149149 if (!ptr)
150150 return -ENOMEM;
151151
152− ret = bus_register(&coreboot_bus_type);
153− if (!ret) {
154− ret = coreboot_table_populate(dev, ptr);
155− if (ret)
156− bus_unregister(&coreboot_bus_type);
157− }
152+ ret = coreboot_table_populate(dev, ptr);
153+
158154 memunmap(ptr);
159155
160156 return ret;
@@ -169,7 +165,6 @@ static int __cb_dev_unregister(struct device *dev, void *dummy) · 8 unmodified lines
169165 static int coreboot_table_remove(struct platform_device *pdev)
170166 {
171167 bus_for_each_dev(&coreboot_bus_type, NULL, NULL, __cb_dev_unregister);
172− bus_unregister(&coreboot_bus_type);
173168 return 0;
174169 }
175170
@@ -199,6 +194,32 @@ static struct platform_driver coreboot_table_driver = { · 23 unmodified lines
199194 .of_match_table = of_match_ptr(coreboot_of_match),
200195 },
201196 };
202−module_platform_driver(coreboot_table_driver);
197+
198+static int __init coreboot_table_driver_init(void)
199+{
200+ int ret;
201+
202+ ret = bus_register(&coreboot_bus_type);
203+ if (ret)
204+ return ret;
205+
206+ ret = platform_driver_register(&coreboot_table_driver);
207+ if (ret) {
208+ bus_unregister(&coreboot_bus_type);
209+ return ret;
210+ }
211+
212+ return 0;
213+}
214+
215+static void __exit coreboot_table_driver_exit(void)
216+{
217+ platform_driver_unregister(&coreboot_table_driver);
218+ bus_unregister(&coreboot_bus_type);
219+}
220+
221+module_init(coreboot_table_driver_init);
222+module_exit(coreboot_table_driver_exit);
223+
203224 MODULE_AUTHOR("Google, Inc.");
204225 MODULE_LICENSE("GPL");
drivers/fpga/Kconfig+3−1
@@ -246,7 +246,9 @@ config FPGA_MGR_VERSAL_FPGA · 245 unmodified lines
246246
247247 config FPGA_M10_BMC_SEC_UPDATE
248248 tristate "Intel MAX10 BMC Secure Update driver"
249− depends on MFD_INTEL_M10_BMC && FW_UPLOAD
249+ depends on MFD_INTEL_M10_BMC
250+ select FW_LOADER
251+ select FW_UPLOAD
250252 help
251253 Secure update support for the Intel MAX10 board management
252254 controller.
drivers/gpu/drm/amd/amdgpu/amdgpu.h+1−0
@@ -1293,6 +1293,7 @@ void amdgpu_device_pcie_port_wreg(struct amdgpu_device *adev, · 1292 unmodified lines
12931293 u32 reg, u32 v);
12941294 struct dma_fence *amdgpu_device_switch_gang(struct amdgpu_device *adev,
12951295 struct dma_fence *gang);
1296+bool amdgpu_device_has_display_hardware(struct amdgpu_device *adev);
12961297
12971298 /* atpx handler */
12981299 #if defined(CONFIG_VGA_SWITCHEROO)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c+7−0
@@ -706,6 +706,13 @@ err: · 705 unmodified lines
706706
707707 void amdgpu_amdkfd_set_compute_idle(struct amdgpu_device *adev, bool idle)
708708 {
709+ /* Temporary workaround to fix issues observed in some
710+ * compute applications when GFXOFF is enabled on GFX11.
711+ */
712+ if (IP_VERSION_MAJ(adev->ip_versions[GC_HWIP][0]) == 11) {
713+ pr_debug("GFXOFF is %s\n", idle ? "enabled" : "disabled");
714+ amdgpu_gfx_off_ctrl(adev, idle);
715+ }
709716 amdgpu_dpm_switch_power_profile(adev,
710717 PP_SMC_POWER_PROFILE_COMPUTE,
711718 !idle);
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c+1−0
@@ -41,5 +41,6 @@ const struct kfd2kgd_calls aldebaran_kfd2kgd = { · 40 unmodified lines
4141 .get_atc_vmid_pasid_mapping_info =
4242 kgd_gfx_v9_get_atc_vmid_pasid_mapping_info,
4343 .set_vm_context_page_table_base = kgd_gfx_v9_set_vm_context_page_table_base,
44+ .get_cu_occupancy = kgd_gfx_v9_get_cu_occupancy,
4445 .program_trap_handler_settings = kgd_gfx_v9_program_trap_handler_settings
4546 };
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c+9−7
@@ -171,9 +171,7 @@ int amdgpu_amdkfd_reserve_mem_limit(struct amdgpu_device *adev, · 170 unmodified lines
171171 (kfd_mem_limit.ttm_mem_used + ttm_mem_needed >
172172 kfd_mem_limit.max_ttm_mem_limit) ||
173173 (adev && adev->kfd.vram_used + vram_needed >
174− adev->gmc.real_vram_size -
175− atomic64_read(&adev->vram_pin_size) -
176− reserved_for_pt)) {
174+ adev->gmc.real_vram_size - reserved_for_pt)) {
177175 ret = -ENOMEM;
178176 goto release;
179177 }
@@ -988,6 +986,7 @@ static int init_user_pages(struct kgd_mem *mem, uint64_t user_addr, · 808 unmodified lines
988986 struct amdkfd_process_info *process_info = mem->process_info;
989987 struct amdgpu_bo *bo = mem->bo;
990988 struct ttm_operation_ctx ctx = { true, false };
989+ struct hmm_range *range;
991990 int ret = 0;
992991
993992 mutex_lock(&process_info->lock);
@@ -1017,7 +1016,7 @@ static int init_user_pages(struct kgd_mem *mem, uint64_t user_addr, · 23 unmodified lines
10171016 return 0;
10181017 }
10191018
1020− ret = amdgpu_ttm_tt_get_user_pages(bo, bo->tbo.ttm->pages);
1019+ ret = amdgpu_ttm_tt_get_user_pages(bo, bo->tbo.ttm->pages, &range);
10211020 if (ret) {
10221021 pr_err("%s: Failed to get user pages: %d\n", __func__, ret);
10231022 goto unregister_out;
@@ -1035,7 +1034,7 @@ static int init_user_pages(struct kgd_mem *mem, uint64_t user_addr, · 11 unmodified lines
10351034 amdgpu_bo_unreserve(bo);
10361035
10371036 release_out:
1038− amdgpu_ttm_tt_get_user_pages_done(bo->tbo.ttm);
1037+ amdgpu_ttm_tt_get_user_pages_done(bo->tbo.ttm, range);
10391038 unregister_out:
10401039 if (ret)
10411040 amdgpu_mn_unregister(bo);
@@ -2372,6 +2371,8 @@ static int update_invalid_user_pages(struct amdkfd_process_info *process_info, · 1330 unmodified lines
23722371 /* Go through userptr_inval_list and update any invalid user_pages */
23732372 list_for_each_entry(mem, &process_info->userptr_inval_list,
23742373 validate_list.head) {
2374+ struct hmm_range *range;
2375+
23752376 invalid = atomic_read(&mem->invalid);
23762377 if (!invalid)
23772378 /* BO hasn't been invalidated since the last
@@ -2382,7 +2383,8 @@ static int update_invalid_user_pages(struct amdkfd_process_info *process_info, · 4 unmodified lines
23822383 bo = mem->bo;
23832384
23842385 /* Get updated user pages */
2385− ret = amdgpu_ttm_tt_get_user_pages(bo, bo->tbo.ttm->pages);
2386+ ret = amdgpu_ttm_tt_get_user_pages(bo, bo->tbo.ttm->pages,
2387+ &range);
23862388 if (ret) {
23872389 pr_debug("Failed %d to get user pages\n", ret);
23882390
@@ -2401,7 +2403,7 @@ static int update_invalid_user_pages(struct amdkfd_process_info *process_info, · 12 unmodified lines
24012403 * FIXME: Cannot ignore the return code, must hold
24022404 * notifier_lock
24032405 */
2404− amdgpu_ttm_tt_get_user_pages_done(bo->tbo.ttm);
2406+ amdgpu_ttm_tt_get_user_pages_done(bo->tbo.ttm, range);
24052407 }
24062408
24072409 /* Mark the BO as valid unless it was invalidated
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c+1−0
@@ -209,6 +209,7 @@ void amdgpu_bo_list_get_list(struct amdgpu_bo_list *list, · 208 unmodified lines
209209 list_add_tail(&e->tv.head, &bucket[priority]);
210210
211211 e->user_pages = NULL;
212+ e->range = NULL;
212213 }
213214
214215 /* Connect the sorted buckets in the output list. */
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h+3−0
@@ -26,6 +26,8 @@ · 25 unmodified lines
2626 #include <drm/ttm/ttm_execbuf_util.h>
2727 #include <drm/amdgpu_drm.h>
2828
29+struct hmm_range;
30+
2931 struct amdgpu_device;
3032 struct amdgpu_bo;
3133 struct amdgpu_bo_va;
@@ -36,6 +38,7 @@ struct amdgpu_bo_list_entry { · 4 unmodified lines
3638 struct amdgpu_bo_va *bo_va;
3739 uint32_t priority;
3840 struct page **user_pages;
41+ struct hmm_range *range;
3942 bool user_invalidated;
4043 };
4144
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c+0−1
@@ -328,7 +328,6 @@ static void amdgpu_connector_free_edid(struct drm_connector *connector) · 327 unmodified lines
328328
329329 kfree(amdgpu_connector->edid);
330330 amdgpu_connector->edid = NULL;
331− drm_connector_update_edid_property(connector, NULL);
332331 }
333332
334333 static int amdgpu_connector_ddc_get_modes(struct drm_connector *connector)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c+26−12
@@ -109,6 +109,7 @@ static int amdgpu_cs_p1_ib(struct amdgpu_cs_parser *p, · 108 unmodified lines
109109 return r;
110110
111111 ++(num_ibs[r]);
112+ p->gang_leader_idx = r;
112113 return 0;
113114 }
114115
@@ -287,8 +288,10 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p, · 172 unmodified lines
287288 }
288289 }
289290
290− if (!p->gang_size)
291− return -EINVAL;
291+ if (!p->gang_size) {
292+ ret = -EINVAL;
293+ goto free_partial_kdata;
294+ }
292295
293296 for (i = 0; i < p->gang_size; ++i) {
294297 ret = amdgpu_job_alloc(p->adev, num_ibs[i], &p->jobs[i], vm);
@@ -300,7 +303,7 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p, · 5 unmodified lines
300303 if (ret)
301304 goto free_all_kdata;
302305 }
303− p->gang_leader = p->jobs[p->gang_size - 1];
306+ p->gang_leader = p->jobs[p->gang_leader_idx];
304307
305308 if (p->ctx->vram_lost_counter != p->gang_leader->vram_lost_counter) {
306309 ret = -ECANCELED;
@@ -910,7 +913,7 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p, · 603 unmodified lines
910913 goto out_free_user_pages;
911914 }
912915
913− r = amdgpu_ttm_tt_get_user_pages(bo, e->user_pages);
916+ r = amdgpu_ttm_tt_get_user_pages(bo, e->user_pages, &e->range);
914917 if (r) {
915918 kvfree(e->user_pages);
916919 e->user_pages = NULL;
@@ -988,10 +991,12 @@ out_free_user_pages: · 71 unmodified lines
988991
989992 if (!e->user_pages)
990993 continue;
991− amdgpu_ttm_tt_get_user_pages_done(bo->tbo.ttm);
994+ amdgpu_ttm_tt_get_user_pages_done(bo->tbo.ttm, e->range);
992995 kvfree(e->user_pages);
993996 e->user_pages = NULL;
997+ e->range = NULL;
994998 }
999+ mutex_unlock(&p->bo_list->bo_list_mutex);
9951000 return r;
9961001 }
9971002
@@ -1194,16 +1199,18 @@ static int amdgpu_cs_sync_rings(struct amdgpu_cs_parser *p) · 196 unmodified lines
11941199 return r;
11951200 }
11961201
1197− for (i = 0; i < p->gang_size - 1; ++i) {
1202+ for (i = 0; i < p->gang_size; ++i) {
1203+ if (p->jobs[i] == leader)
1204+ continue;
1205+
11981206 r = amdgpu_sync_clone(&leader->sync, &p->jobs[i]->sync);
11991207 if (r)
12001208 return r;
12011209 }
12021210
1203− r = amdgpu_ctx_wait_prev_fence(p->ctx, p->entities[p->gang_size - 1]);
1211+ r = amdgpu_ctx_wait_prev_fence(p->ctx, p->entities[p->gang_leader_idx]);
12041212 if (r && r != -ERESTARTSYS)
12051213 DRM_ERROR("amdgpu_ctx_wait_prev_fence failed.\n");
1206−
12071214 return r;
12081215 }
12091216
@@ -1237,9 +1244,12 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p, · 27 unmodified lines
12371244 for (i = 0; i < p->gang_size; ++i)
12381245 drm_sched_job_arm(&p->jobs[i]->base);
12391246
1240− for (i = 0; i < (p->gang_size - 1); ++i) {
1247+ for (i = 0; i < p->gang_size; ++i) {
12411248 struct dma_fence *fence;
12421249
1250+ if (p->jobs[i] == leader)
1251+ continue;
1252+
12431253 fence = &p->jobs[i]->base.s_fence->scheduled;
12441254 r = amdgpu_sync_fence(&leader->sync, fence);
12451255 if (r)
@@ -1264,7 +1274,8 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p, · 18 unmodified lines
12641274 amdgpu_bo_list_for_each_userptr_entry(e, p->bo_list) {
12651275 struct amdgpu_bo *bo = ttm_to_amdgpu_bo(e->tv.bo);
12661276
1267− r |= !amdgpu_ttm_tt_get_user_pages_done(bo->tbo.ttm);
1277+ r |= !amdgpu_ttm_tt_get_user_pages_done(bo->tbo.ttm, e->range);
1278+ e->range = NULL;
12681279 }
12691280 if (r) {
12701281 r = -EAGAIN;
@@ -1275,7 +1286,10 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p, · 4 unmodified lines
12751286 list_for_each_entry(e, &p->validated, tv.head) {
12761287
12771288 /* Everybody except for the gang leader uses READ */
1278− for (i = 0; i < (p->gang_size - 1); ++i) {
1289+ for (i = 0; i < p->gang_size; ++i) {
1290+ if (p->jobs[i] == leader)
1291+ continue;
1292+
12791293 dma_resv_add_fence(e->tv.bo->base.resv,
12801294 &p->jobs[i]->base.s_fence->finished,
12811295 DMA_RESV_USAGE_READ);
@@ -1285,7 +1299,7 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p, · 3 unmodified lines
12851299 e->tv.num_shared = 0;
12861300 }
12871301
1288− seq = amdgpu_ctx_add_fence(p->ctx, p->entities[p->gang_size - 1],
1302+ seq = amdgpu_ctx_add_fence(p->ctx, p->entities[p->gang_leader_idx],
12891303 p->fence);
12901304 amdgpu_cs_post_dependencies(p);
12911305
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.h+1−0
@@ -54,6 +54,7 @@ struct amdgpu_cs_parser { · 53 unmodified lines
5454
5555 /* scheduler job objects */
5656 unsigned int gang_size;
57+ unsigned int gang_leader_idx;
5758 struct drm_sched_entity *entities[AMDGPU_CS_GANG_SIZE];
5859 struct amdgpu_job *jobs[AMDGPU_CS_GANG_SIZE];
5960 struct amdgpu_job *gang_leader;
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+51−5
@@ -4060,15 +4060,18 @@ void amdgpu_device_fini_sw(struct amdgpu_device *adev) · 4059 unmodified lines
40604060 * at suspend time.
40614061 *
40624062 */
4063−static void amdgpu_device_evict_resources(struct amdgpu_device *adev)
4063+static int amdgpu_device_evict_resources(struct amdgpu_device *adev)
40644064 {
4065+ int ret;
4066+
40654067 /* No need to evict vram on APUs for suspend to ram or s2idle */
40664068 if ((adev->in_s3 || adev->in_s0ix) && (adev->flags & AMD_IS_APU))
4067− return;
4069+ return 0;
40684070
4069− if (amdgpu_ttm_evict_resources(adev, TTM_PL_VRAM))
4071+ ret = amdgpu_ttm_evict_resources(adev, TTM_PL_VRAM);
4072+ if (ret)
40704073 DRM_WARN("evicting device resources failed\n");
4071−
4074+ return ret;
40724075 }
40734076
40744077 /*
@@ -4118,7 +4121,9 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon) · 43 unmodified lines
41184121 if (!adev->in_s0ix)
41194122 amdgpu_amdkfd_suspend(adev, adev->in_runpm);
41204123
4121− amdgpu_device_evict_resources(adev);
4124+ r = amdgpu_device_evict_resources(adev);
4125+ if (r)
4126+ return r;
41224127
41234128 amdgpu_fence_driver_hw_fini(adev);
41244129
@@ -6039,3 +6044,44 @@ struct dma_fence *amdgpu_device_switch_gang(struct amdgpu_device *adev, · 1914 unmodified lines
60396044 dma_fence_put(old);
60406045 return NULL;
60416046 }
6047+
6048+bool amdgpu_device_has_display_hardware(struct amdgpu_device *adev)
6049+{
6050+ switch (adev->asic_type) {
6051+#ifdef CONFIG_DRM_AMDGPU_SI
6052+ case CHIP_HAINAN:
6053+#endif
6054+ case CHIP_TOPAZ:
6055+ /* chips with no display hardware */
6056+ return false;
6057+#ifdef CONFIG_DRM_AMDGPU_SI
6058+ case CHIP_TAHITI:
6059+ case CHIP_PITCAIRN:
6060+ case CHIP_VERDE:
6061+ case CHIP_OLAND:
6062+#endif
6063+#ifdef CONFIG_DRM_AMDGPU_CIK
6064+ case CHIP_BONAIRE:
6065+ case CHIP_HAWAII:
6066+ case CHIP_KAVERI:
6067+ case CHIP_KABINI:
6068+ case CHIP_MULLINS:
6069+#endif
6070+ case CHIP_TONGA:
6071+ case CHIP_FIJI:
6072+ case CHIP_POLARIS10:
6073+ case CHIP_POLARIS11:
6074+ case CHIP_POLARIS12:
6075+ case CHIP_VEGAM:
6076+ case CHIP_CARRIZO:
6077+ case CHIP_STONEY:
6078+ /* chips with display hardware */
6079+ return true;
6080+ default:
6081+ /* IP discovery */
6082+ if (!adev->ip_versions[DCE_HWIP][0] ||
6083+ (adev->harvest_ip_mask & AMD_HARVEST_IP_DMU_MASK))
6084+ return false;
6085+ return true;
6086+ }
6087+}
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c+2−1
@@ -2201,7 +2201,8 @@ amdgpu_pci_remove(struct pci_dev *pdev) · 2200 unmodified lines
22012201 pm_runtime_forbid(dev->dev);
22022202 }
22032203
2204− if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 2)) {
2204+ if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 2) &&
2205+ !amdgpu_sriov_vf(adev)) {
22052206 bool need_to_reset_gpu = false;
22062207
22072208 if (adev->gmc.xgmi.num_physical_nodes > 1) {
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c+7−7
@@ -378,6 +378,7 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data, · 377 unmodified lines
378378 struct amdgpu_device *adev = drm_to_adev(dev);
379379 struct drm_amdgpu_gem_userptr *args = data;
380380 struct drm_gem_object *gobj;
381+ struct hmm_range *range;
381382 struct amdgpu_bo *bo;
382383 uint32_t handle;
383384 int r;
@@ -413,14 +414,13 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data, · 29 unmodified lines
413414 if (r)
414415 goto release_object;
415416
416− if (args->flags & AMDGPU_GEM_USERPTR_REGISTER) {
417− r = amdgpu_mn_register(bo, args->addr);
418− if (r)
419− goto release_object;
420− }
417+ r = amdgpu_mn_register(bo, args->addr);
418+ if (r)
419+ goto release_object;
421420
422421 if (args->flags & AMDGPU_GEM_USERPTR_VALIDATE) {
423− r = amdgpu_ttm_tt_get_user_pages(bo, bo->tbo.ttm->pages);
422+ r = amdgpu_ttm_tt_get_user_pages(bo, bo->tbo.ttm->pages,
423+ &range);
424424 if (r)
425425 goto release_object;
426426
@@ -443,7 +443,7 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data, · 16 unmodified lines
443443
444444 user_pages_done:
445445 if (args->flags & AMDGPU_GEM_USERPTR_VALIDATE)
446− amdgpu_ttm_tt_get_user_pages_done(bo->tbo.ttm);
446+ amdgpu_ttm_tt_get_user_pages_done(bo->tbo.ttm, range);
447447
448448 release_object:
449449 drm_gem_object_put(gobj);
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c+7−1
@@ -479,6 +479,12 @@ int amdgpu_gmc_allocate_vm_inv_eng(struct amdgpu_device *adev) · 478 unmodified lines
479479 unsigned i;
480480 unsigned vmhub, inv_eng;
481481
482+ if (adev->enable_mes) {
483+ /* reserve engine 5 for firmware */
484+ for (vmhub = 0; vmhub < AMDGPU_MAX_VMHUBS; vmhub++)
485+ vm_inv_engs[vmhub] &= ~(1 << 5);
486+ }
487+
482488 for (i = 0; i < adev->num_rings; ++i) {
483489 ring = adev->rings[i];
484490 vmhub = ring->funcs->vmhub;
@@ -656,7 +662,7 @@ void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev) · 171 unmodified lines
656662 }
657663
658664 if (amdgpu_sriov_vf(adev) ||
659− !amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_DCE)) {
665+ !amdgpu_device_has_display_hardware(adev)) {
660666 size = 0;
661667 } else {
662668 size = amdgpu_gmc_get_vbios_fb_size(adev);
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c+8−4
@@ -169,7 +169,11 @@ static void amdgpu_job_free_cb(struct drm_sched_job *s_job) · 168 unmodified lines
169169 amdgpu_sync_free(&job->sync);
170170 amdgpu_sync_free(&job->sched_sync);
171171
172− dma_fence_put(&job->hw_fence);
172+ /* only put the hw fence if has embedded fence */
173+ if (!job->hw_fence.ops)
174+ kfree(job);
175+ else
176+ dma_fence_put(&job->hw_fence);
173177 }
174178
175179 void amdgpu_job_set_gang_leader(struct amdgpu_job *job,
@@ -254,6 +258,9 @@ static struct dma_fence *amdgpu_job_dependency(struct drm_sched_job *sched_job, · 78 unmodified lines
254258 DRM_ERROR("Error adding fence (%d)\n", r);
255259 }
256260
261+ if (!fence && job->gang_submit)
262+ fence = amdgpu_device_switch_gang(ring->adev, job->gang_submit);
263+
257264 while (fence == NULL && vm && !job->vmid) {
258265 r = amdgpu_vmid_grab(vm, ring, &job->sync,
259266 &job->base.s_fence->finished,
@@ -264,9 +271,6 @@ static struct dma_fence *amdgpu_job_dependency(struct drm_sched_job *sched_job, · 4 unmodified lines
264271 fence = amdgpu_sync_get_fence(&job->sync);
265272 }
266273
267− if (!fence && job->gang_submit)
268− fence = amdgpu_device_switch_gang(ring->adev, job->gang_submit);
269−
270274 return fence;
271275 }
272276
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c+6−4
@@ -337,12 +337,14 @@ static int amdgpu_firmware_info(struct drm_amdgpu_info_firmware *fw_info, · 336 unmodified lines
337337 fw_info->feature = adev->psp.cap_feature_version;
338338 break;
339339 case AMDGPU_INFO_FW_MES_KIQ:
340− fw_info->ver = adev->mes.ucode_fw_version[0];
341− fw_info->feature = 0;
340+ fw_info->ver = adev->mes.kiq_version & AMDGPU_MES_VERSION_MASK;
341+ fw_info->feature = (adev->mes.kiq_version & AMDGPU_MES_FEAT_VERSION_MASK)
342+ >> AMDGPU_MES_FEAT_VERSION_SHIFT;
342343 break;
343344 case AMDGPU_INFO_FW_MES:
344− fw_info->ver = adev->mes.ucode_fw_version[1];
345− fw_info->feature = 0;
345+ fw_info->ver = adev->mes.sched_version & AMDGPU_MES_VERSION_MASK;
346+ fw_info->feature = (adev->mes.sched_version & AMDGPU_MES_FEAT_VERSION_MASK)
347+ >> AMDGPU_MES_FEAT_VERSION_SHIFT;
346348 break;
347349 case AMDGPU_INFO_FW_IMU:
348350 fw_info->ver = adev->gfx.imu_fw_version;
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c+9−7
@@ -172,6 +172,7 @@ void psp_ta_free_shared_buf(struct ta_mem_context *mem_ctx) · 171 unmodified lines
172172 {
173173 amdgpu_bo_free_kernel(&mem_ctx->shared_bo, &mem_ctx->shared_mc_addr,
174174 &mem_ctx->shared_buf);
175+ mem_ctx->shared_bo = NULL;
175176 }
176177
177178 static void psp_free_shared_bufs(struct psp_context *psp)
@@ -182,6 +183,7 @@ static void psp_free_shared_bufs(struct psp_context *psp) · 4 unmodified lines
182183 /* free TMR memory buffer */
183184 pptr = amdgpu_sriov_vf(psp->adev) ? &tmr_buf : NULL;
184185 amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, pptr);
186+ psp->tmr_bo = NULL;
185187
186188 /* free xgmi shared memory */
187189 psp_ta_free_shared_buf(&psp->xgmi_context.context.mem_context);
@@ -743,7 +745,7 @@ static int psp_load_toc(struct psp_context *psp, · 555 unmodified lines
743745 /* Set up Trusted Memory Region */
744746 static int psp_tmr_init(struct psp_context *psp)
745747 {
746− int ret;
748+ int ret = 0;
747749 int tmr_size;
748750 void *tmr_buf;
749751 void **pptr;
@@ -770,10 +772,12 @@ static int psp_tmr_init(struct psp_context *psp) · 20 unmodified lines
770772 }
771773 }
772774
773− pptr = amdgpu_sriov_vf(psp->adev) ? &tmr_buf : NULL;
774− ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, PSP_TMR_ALIGNMENT,
775− AMDGPU_GEM_DOMAIN_VRAM,
776− &psp->tmr_bo, &psp->tmr_mc_addr, pptr);
775+ if (!psp->tmr_bo) {
776+ pptr = amdgpu_sriov_vf(psp->adev) ? &tmr_buf : NULL;
777+ ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, PSP_TMR_ALIGNMENT,
778+ AMDGPU_GEM_DOMAIN_VRAM,
779+ &psp->tmr_bo, &psp->tmr_mc_addr, pptr);
780+ }
777781
778782 return ret;
779783 }
@@ -2732,8 +2736,6 @@ static int psp_suspend(void *handle) · 1952 unmodified lines
27322736 }
27332737
27342738 out:
2735− psp_free_shared_bufs(psp);
2736−
27372739 return ret;
27382740 }
27392741
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c+15−38
@@ -643,9 +643,6 @@ struct amdgpu_ttm_tt { · 642 unmodified lines
643643 struct task_struct *usertask;
644644 uint32_t userflags;
645645 bool bound;
646−#if IS_ENABLED(CONFIG_DRM_AMDGPU_USERPTR)
647− struct hmm_range *range;
648−#endif
649646 };
650647
651648 #define ttm_to_amdgpu_ttm_tt(ptr) container_of(ptr, struct amdgpu_ttm_tt, ttm)
@@ -658,7 +655,8 @@ struct amdgpu_ttm_tt { · 6 unmodified lines
658655 * Calling function must call amdgpu_ttm_tt_userptr_range_done() once and only
659656 * once afterwards to stop HMM tracking
660657 */
661−int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages)
658+int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages,
659+ struct hmm_range **range)
662660 {
663661 struct ttm_tt *ttm = bo->tbo.ttm;
664662 struct amdgpu_ttm_tt *gtt = ttm_to_amdgpu_ttm_tt(ttm);
@@ -668,16 +666,15 @@ int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages) · 3 unmodified lines
668666 bool readonly;
669667 int r = 0;
670668
669+ /* Make sure get_user_pages_done() can cleanup gracefully */
670+ *range = NULL;
671+
671672 mm = bo->notifier.mm;
672673 if (unlikely(!mm)) {
673674 DRM_DEBUG_DRIVER("BO is not registered?\n");
674675 return -EFAULT;
675676 }
676677
677− /* Another get_user_pages is running at the same time?? */
678− if (WARN_ON(gtt->range))
679− return -EFAULT;
680−
681678 if (!mmget_not_zero(mm)) /* Happens during process shutdown */
682679 return -ESRCH;
683680
@@ -695,7 +692,7 @@ int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages) · 11 unmodified lines
695692
696693 readonly = amdgpu_ttm_tt_is_readonly(ttm);
697694 r = amdgpu_hmm_range_get_pages(&bo->notifier, mm, pages, start,
698− ttm->num_pages, &gtt->range, readonly,
695+ ttm->num_pages, range, readonly,
699696 true, NULL);
700697 out_unlock:
701698 mmap_read_unlock(mm);
@@ -713,30 +710,24 @@ out_unlock: · 11 unmodified lines
713710 *
714711 * Returns: true if pages are still valid
715712 */
716−bool amdgpu_ttm_tt_get_user_pages_done(struct ttm_tt *ttm)
713+bool amdgpu_ttm_tt_get_user_pages_done(struct ttm_tt *ttm,
714+ struct hmm_range *range)
717715 {
718716 struct amdgpu_ttm_tt *gtt = ttm_to_amdgpu_ttm_tt(ttm);
719− bool r = false;
720717
721− if (!gtt || !gtt->userptr)
718+ if (!gtt || !gtt->userptr || !range)
722719 return false;
723720
724721 DRM_DEBUG_DRIVER("user_pages_done 0x%llx pages 0x%x\n",
725722 gtt->userptr, ttm->num_pages);
726723
727− WARN_ONCE(!gtt->range || !gtt->range->hmm_pfns,
728− "No user pages to check\n");
724+ WARN_ONCE(!range->hmm_pfns, "No user pages to check\n");
729725
730− if (gtt->range) {
731− /*
732− * FIXME: Must always hold notifier_lock for this, and must
733− * not ignore the return code.
734− */
735− r = amdgpu_hmm_range_get_pages_done(gtt->range);
736− gtt->range = NULL;
737− }
738−
739− return !r;
726+ /*
727+ * FIXME: Must always hold notifier_lock for this, and must
728+ * not ignore the return code.
729+ */
730+ return !amdgpu_hmm_range_get_pages_done(range);
740731 }
741732 #endif
742733
@@ -813,20 +804,6 @@ static void amdgpu_ttm_tt_unpin_userptr(struct ttm_device *bdev, · 70 unmodified lines
813804 /* unmap the pages mapped to the device */
814805 dma_unmap_sgtable(adev->dev, ttm->sg, direction, 0);
815806 sg_free_table(ttm->sg);
816−
817−#if IS_ENABLED(CONFIG_DRM_AMDGPU_USERPTR)
818− if (gtt->range) {
819− unsigned long i;
820−
821− for (i = 0; i < ttm->num_pages; i++) {
822− if (ttm->pages[i] !=
823− hmm_pfn_to_page(gtt->range->hmm_pfns[i]))
824− break;
825− }
826−
827− WARN((i == ttm->num_pages), "Missing get_user_page_done\n");
828− }
829−#endif
830807 }
831808
832809 static void amdgpu_ttm_gart_bind(struct amdgpu_device *adev,
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h+10−4
@@ -39,6 +39,8 @@ · 38 unmodified lines
3939
4040 #define AMDGPU_POISON 0xd0bed0be
4141
42+struct hmm_range;
43+
4244 struct amdgpu_gtt_mgr {
4345 struct ttm_resource_manager manager;
4446 struct drm_mm mm;
@@ -149,15 +151,19 @@ void amdgpu_ttm_recover_gart(struct ttm_buffer_object *tbo); · 104 unmodified lines
149151 uint64_t amdgpu_ttm_domain_start(struct amdgpu_device *adev, uint32_t type);
150152
151153 #if IS_ENABLED(CONFIG_DRM_AMDGPU_USERPTR)
152−int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages);
153−bool amdgpu_ttm_tt_get_user_pages_done(struct ttm_tt *ttm);
154+int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages,
155+ struct hmm_range **range);
156+bool amdgpu_ttm_tt_get_user_pages_done(struct ttm_tt *ttm,
157+ struct hmm_range *range);
154158 #else
155159 static inline int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo,
156− struct page **pages)
160+ struct page **pages,
161+ struct hmm_range **range)
157162 {
158163 return -EPERM;
159164 }
160−static inline bool amdgpu_ttm_tt_get_user_pages_done(struct ttm_tt *ttm)
165+static inline bool amdgpu_ttm_tt_get_user_pages_done(struct ttm_tt *ttm,
166+ struct hmm_range *range)
161167 {
162168 return false;
163169 }
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c+3−0
@@ -156,6 +156,9 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) · 155 unmodified lines
156156 break;
157157 case IP_VERSION(3, 0, 2):
158158 fw_name = FIRMWARE_VANGOGH;
159+ if ((adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) &&
160+ (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG))
161+ adev->vcn.indirect_sram = true;
159162 break;
160163 case IP_VERSION(3, 0, 16):
161164 fw_name = FIRMWARE_DIMGREY_CAVEFISH;
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c+2−0
@@ -500,6 +500,8 @@ static int amdgpu_vkms_sw_init(void *handle) · 499 unmodified lines
500500
501501 adev_to_drm(adev)->mode_config.fb_base = adev->gmc.aper_base;
502502
503+ adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
504+
503505 r = amdgpu_display_modeset_create_props(adev);
504506 if (r)
505507 return r;
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c+0−26
@@ -143,32 +143,6 @@ int amdgpu_vm_set_pasid(struct amdgpu_device *adev, struct amdgpu_vm *vm, · 142 unmodified lines
143143 return 0;
144144 }
145145
146−/*
147− * vm eviction_lock can be taken in MMU notifiers. Make sure no reclaim-FS
148− * happens while holding this lock anywhere to prevent deadlocks when
149− * an MMU notifier runs in reclaim-FS context.
150− */
151−static inline void amdgpu_vm_eviction_lock(struct amdgpu_vm *vm)
152−{
153− mutex_lock(&vm->eviction_lock);
154− vm->saved_flags = memalloc_noreclaim_save();
155−}
156−
157−static inline int amdgpu_vm_eviction_trylock(struct amdgpu_vm *vm)
158−{
159− if (mutex_trylock(&vm->eviction_lock)) {
160− vm->saved_flags = memalloc_noreclaim_save();
161− return 1;
162− }
163− return 0;
164−}
165−
166−static inline void amdgpu_vm_eviction_unlock(struct amdgpu_vm *vm)
167−{
168− memalloc_noreclaim_restore(vm->saved_flags);
169− mutex_unlock(&vm->eviction_lock);
170−}
171−
172146 /**
173147 * amdgpu_vm_bo_evicted - vm_bo is evicted
174148 *
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h+41−0
@@ -492,7 +492,48 @@ void amdgpu_debugfs_vm_bo_info(struct amdgpu_vm *vm, struct seq_file *m); · 491 unmodified lines
492492 */
493493 static inline uint64_t amdgpu_vm_tlb_seq(struct amdgpu_vm *vm)
494494 {
495+ unsigned long flags;
496+ spinlock_t *lock;
497+
498+ /*
499+ * Workaround to stop racing between the fence signaling and handling
500+ * the cb. The lock is static after initially setting it up, just make
501+ * sure that the dma_fence structure isn't freed up.
502+ */
503+ rcu_read_lock();
504+ lock = vm->last_tlb_flush->lock;
505+ rcu_read_unlock();
506+
507+ spin_lock_irqsave(lock, flags);
508+ spin_unlock_irqrestore(lock, flags);
509+
495510 return atomic64_read(&vm->tlb_seq);
496511 }
497512
513+/*
514+ * vm eviction_lock can be taken in MMU notifiers. Make sure no reclaim-FS
515+ * happens while holding this lock anywhere to prevent deadlocks when
516+ * an MMU notifier runs in reclaim-FS context.
517+ */
518+static inline void amdgpu_vm_eviction_lock(struct amdgpu_vm *vm)
519+{
520+ mutex_lock(&vm->eviction_lock);
521+ vm->saved_flags = memalloc_noreclaim_save();
522+}
523+
524+static inline bool amdgpu_vm_eviction_trylock(struct amdgpu_vm *vm)
525+{
526+ if (mutex_trylock(&vm->eviction_lock)) {
527+ vm->saved_flags = memalloc_noreclaim_save();
528+ return true;
529+ }
530+ return false;
531+}
532+
533+static inline void amdgpu_vm_eviction_unlock(struct amdgpu_vm *vm)
534+{
535+ memalloc_noreclaim_restore(vm->saved_flags);
536+ mutex_unlock(&vm->eviction_lock);
537+}
538+
498539 #endif
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c+2−0
@@ -597,7 +597,9 @@ static int amdgpu_vm_pt_alloc(struct amdgpu_device *adev, · 596 unmodified lines
597597 if (entry->bo)
598598 return 0;
599599
600+ amdgpu_vm_eviction_unlock(vm);
600601 r = amdgpu_vm_pt_create(adev, vm, cursor->level, immediate, &pt);
602+ amdgpu_vm_eviction_lock(vm);
601603 if (r)
602604 return r;
603605
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c+1−1
@@ -435,7 +435,7 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man, · 434 unmodified lines
435435 if (place->flags & TTM_PL_FLAG_TOPDOWN)
436436 vres->flags |= DRM_BUDDY_TOPDOWN_ALLOCATION;
437437
438− if (fpfn || lpfn != man->size)
438+ if (fpfn || lpfn != mgr->mm.size)
439439 /* Allocate blocks in desired range */
440440 vres->flags |= DRM_BUDDY_RANGE_ALLOCATION;
441441
drivers/gpu/drm/amd/amdgpu/mmsch_v4_0.h+0−1
@@ -32,7 +32,6 @@ · 31 unmodified lines
3232
3333 #define RB_ENABLED (1 << 0)
3434 #define RB4_ENABLED (1 << 1)
35−#define MMSCH_DOORBELL_OFFSET 0x8
3635
3736 #define MMSCH_VF_ENGINE_STATUS__PASS 0x1
3837
drivers/gpu/drm/amd/amdgpu/psp_v13_0.c+1−0
@@ -45,6 +45,7 @@ MODULE_FIRMWARE("amdgpu/psp_13_0_0_ta.bin"); · 44 unmodified lines
4545 MODULE_FIRMWARE("amdgpu/psp_13_0_7_sos.bin");
4646 MODULE_FIRMWARE("amdgpu/psp_13_0_7_ta.bin");
4747 MODULE_FIRMWARE("amdgpu/psp_13_0_10_sos.bin");
48+MODULE_FIRMWARE("amdgpu/psp_13_0_10_ta.bin");
4849
4950 /* For large FW files the time to complete can be very long */
5051 #define USBC_PD_POLLING_LIMIT_S 240
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c+1−8
@@ -100,7 +100,6 @@ static int vcn_v4_0_sw_init(void *handle) · 99 unmodified lines
100100 struct amdgpu_ring *ring;
101101 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
102102 int i, r;
103− int vcn_doorbell_index = 0;
104103
105104 r = amdgpu_vcn_sw_init(adev);
106105 if (r)
@@ -112,12 +111,6 @@ static int vcn_v4_0_sw_init(void *handle) · 5 unmodified lines
112111 if (r)
113112 return r;
114113
115− if (amdgpu_sriov_vf(adev)) {
116− vcn_doorbell_index = adev->doorbell_index.vcn.vcn_ring0_1 - MMSCH_DOORBELL_OFFSET;
117− /* get DWORD offset */
118− vcn_doorbell_index = vcn_doorbell_index << 1;
119− }
120−
121114 for (i = 0; i < adev->vcn.num_vcn_inst; i++) {
122115 volatile struct amdgpu_vcn4_fw_shared *fw_shared;
123116
@@ -135,7 +128,7 @@ static int vcn_v4_0_sw_init(void *handle) · 11 unmodified lines
135128 ring = &adev->vcn.inst[i].ring_enc[0];
136129 ring->use_doorbell = true;
137130 if (amdgpu_sriov_vf(adev))
138− ring->doorbell_index = vcn_doorbell_index + i * (adev->vcn.num_enc_rings + 1) + 1;
131+ ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 << 1) + i * (adev->vcn.num_enc_rings + 1) + 1;
139132 else
140133 ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 << 1) + 2 + 8 * i;
141134
drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h+383−381
@@ -2495,442 +2495,444 @@ static const uint32_t cwsr_trap_gfx10_hex[] = { · 2494 unmodified lines
24952495 0xbf9f0000, 0x00000000,
24962496 };
24972497 static const uint32_t cwsr_trap_gfx11_hex[] = {
2498− 0xbfa00001, 0xbfa0021e,
2498+ 0xbfa00001, 0xbfa00221,
24992499 0xb0804006, 0xb8f8f802,
25002500 0x9178ff78, 0x00020006,
2501− 0xb8fbf803, 0xbf0d9f6d,
2502− 0xbfa20006, 0x8b6eff78,
2503− 0x00002000, 0xbfa10009,
2504− 0x8b6eff6d, 0x00ff0000,
2505− 0xbfa2001e, 0x8b6eff7b,
2506− 0x00000400, 0xbfa20041,
2507− 0xbf830010, 0xb8fbf803,
2508− 0xbfa0fffa, 0x8b6eff7b,
2509− 0x00000900, 0xbfa20015,
2510− 0x8b6eff7b, 0x000071ff,
2511− 0xbfa10008, 0x8b6fff7b,
2512− 0x00007080, 0xbfa10001,
2513− 0xbeee1287, 0xb8eff801,
2514− 0x846e8c6e, 0x8b6e6f6e,
2515− 0xbfa2000a, 0x8b6eff6d,
2516− 0x00ff0000, 0xbfa20007,
2517− 0xb8eef801, 0x8b6eff6e,
2518− 0x00000800, 0xbfa20003,
2501+ 0xb8fbf803, 0xbf0d9e6d,
2502+ 0xbfa10001, 0xbfbd0000,
2503+ 0xbf0d9f6d, 0xbfa20006,
2504+ 0x8b6eff78, 0x00002000,
2505+ 0xbfa10009, 0x8b6eff6d,
2506+ 0x00ff0000, 0xbfa2001e,
25192507 0x8b6eff7b, 0x00000400,
2520− 0xbfa20026, 0xbefa4d82,
2521− 0xbf89fc07, 0x84fa887a,
2522− 0xf4005bbd, 0xf8000010,
2523− 0xbf89fc07, 0x846e976e,
2524− 0x9177ff77, 0x00800000,
2525− 0x8c776e77, 0xf4045bbd,
2526− 0xf8000000, 0xbf89fc07,
2527− 0xf4045ebd, 0xf8000008,
2528− 0xbf89fc07, 0x8bee6e6e,
2529− 0xbfa10001, 0xbe80486e,
2530− 0x8b6eff6d, 0x01ff0000,
2531− 0xbfa20005, 0x8c78ff78,
2532− 0x00002000, 0x80ec886c,
2533− 0x82ed806d, 0xbfa00005,
2534− 0x8b6eff6d, 0x01000000,
2535− 0xbfa20002, 0x806c846c,
2536− 0x826d806d, 0x8b6dff6d,
2537− 0x0000ffff, 0x8bfe7e7e,
2538− 0x8bea6a6a, 0xb978f802,
2539− 0xbe804a6c, 0x8b6dff6d,
2540− 0x0000ffff, 0xbefa0080,
2541− 0xb97a0283, 0xbeee007e,
2542− 0xbeef007f, 0xbefe0180,
2543− 0xbefe4d84, 0xbf89fc07,
2544− 0x8b7aff7f, 0x04000000,
2545− 0x847a857a, 0x8c6d7a6d,
2546− 0xbefa007e, 0x8b7bff7f,
2547− 0x0000ffff, 0xbefe00c1,
2548− 0xbeff00c1, 0xdca6c000,
2549− 0x007a0000, 0x7e000280,
2550− 0xbefe007a, 0xbeff007b,
2551− 0xb8fb02dc, 0x847b997b,
2552− 0xb8fa3b05, 0x807a817a,
2553− 0xbf0d997b, 0xbfa20002,
2554− 0x847a897a, 0xbfa00001,
2555− 0x847a8a7a, 0xb8fb1e06,
2556− 0x847b8a7b, 0x807a7b7a,
2508+ 0xbfa20041, 0xbf830010,
2509+ 0xb8fbf803, 0xbfa0fffa,
2510+ 0x8b6eff7b, 0x00000900,
2511+ 0xbfa20015, 0x8b6eff7b,
2512+ 0x000071ff, 0xbfa10008,
2513+ 0x8b6fff7b, 0x00007080,
2514+ 0xbfa10001, 0xbeee1287,
2515+ 0xb8eff801, 0x846e8c6e,
2516+ 0x8b6e6f6e, 0xbfa2000a,
2517+ 0x8b6eff6d, 0x00ff0000,
2518+ 0xbfa20007, 0xb8eef801,
2519+ 0x8b6eff6e, 0x00000800,
2520+ 0xbfa20003, 0x8b6eff7b,
2521+ 0x00000400, 0xbfa20026,
2522+ 0xbefa4d82, 0xbf89fc07,
2523+ 0x84fa887a, 0xf4005bbd,
2524+ 0xf8000010, 0xbf89fc07,
2525+ 0x846e976e, 0x9177ff77,
2526+ 0x00800000, 0x8c776e77,
2527+ 0xf4045bbd, 0xf8000000,
2528+ 0xbf89fc07, 0xf4045ebd,
2529+ 0xf8000008, 0xbf89fc07,
2530+ 0x8bee6e6e, 0xbfa10001,
2531+ 0xbe80486e, 0x8b6eff6d,
2532+ 0x01ff0000, 0xbfa20005,
2533+ 0x8c78ff78, 0x00002000,
2534+ 0x80ec886c, 0x82ed806d,
2535+ 0xbfa00005, 0x8b6eff6d,
2536+ 0x01000000, 0xbfa20002,
2537+ 0x806c846c, 0x826d806d,
2538+ 0x8b6dff6d, 0x0000ffff,
2539+ 0x8bfe7e7e, 0x8bea6a6a,
2540+ 0xb978f802, 0xbe804a6c,
2541+ 0x8b6dff6d, 0x0000ffff,
2542+ 0xbefa0080, 0xb97a0283,
2543+ 0xbeee007e, 0xbeef007f,
2544+ 0xbefe0180, 0xbefe4d84,
2545+ 0xbf89fc07, 0x8b7aff7f,
2546+ 0x04000000, 0x847a857a,
2547+ 0x8c6d7a6d, 0xbefa007e,
25572548 0x8b7bff7f, 0x0000ffff,
2558− 0x807aff7a, 0x00000200,
2559− 0x807a7e7a, 0x827b807b,
2560− 0xd7610000, 0x00010870,
2561− 0xd7610000, 0x00010a71,
2562− 0xd7610000, 0x00010c72,
2563− 0xd7610000, 0x00010e73,
2564− 0xd7610000, 0x00011074,
2565− 0xd7610000, 0x00011275,
2566− 0xd7610000, 0x00011476,
2567− 0xd7610000, 0x00011677,
2568− 0xd7610000, 0x00011a79,
2569− 0xd7610000, 0x00011c7e,
2570− 0xd7610000, 0x00011e7f,
2571− 0xbefe00ff, 0x00003fff,
2572− 0xbeff0080, 0xdca6c040,
2573− 0x007a0000, 0xd760007a,
2574− 0x00011d00, 0xd760007b,
2575− 0x00011f00, 0xbefe007a,
2576− 0xbeff007b, 0xbef4007e,
2577− 0x8b75ff7f, 0x0000ffff,
2578− 0x8c75ff75, 0x00040000,
2579− 0xbef60080, 0xbef700ff,
2580− 0x10807fac, 0xbef1007d,
2581− 0xbef00080, 0xb8f302dc,
2582− 0x84739973, 0xbefe00c1,
2583− 0x857d9973, 0x8b7d817d,
2584− 0xbf06817d, 0xbfa20002,
2585− 0xbeff0080, 0xbfa00002,
2586− 0xbeff00c1, 0xbfa00009,
2549+ 0xbefe00c1, 0xbeff00c1,
2550+ 0xdca6c000, 0x007a0000,
2551+ 0x7e000280, 0xbefe007a,
2552+ 0xbeff007b, 0xb8fb02dc,
2553+ 0x847b997b, 0xb8fa3b05,
2554+ 0x807a817a, 0xbf0d997b,
2555+ 0xbfa20002, 0x847a897a,
2556+ 0xbfa00001, 0x847a8a7a,
2557+ 0xb8fb1e06, 0x847b8a7b,
2558+ 0x807a7b7a, 0x8b7bff7f,
2559+ 0x0000ffff, 0x807aff7a,
2560+ 0x00000200, 0x807a7e7a,
2561+ 0x827b807b, 0xd7610000,
2562+ 0x00010870, 0xd7610000,
2563+ 0x00010a71, 0xd7610000,
2564+ 0x00010c72, 0xd7610000,
2565+ 0x00010e73, 0xd7610000,
2566+ 0x00011074, 0xd7610000,
2567+ 0x00011275, 0xd7610000,
2568+ 0x00011476, 0xd7610000,
2569+ 0x00011677, 0xd7610000,
2570+ 0x00011a79, 0xd7610000,
2571+ 0x00011c7e, 0xd7610000,
2572+ 0x00011e7f, 0xbefe00ff,
2573+ 0x00003fff, 0xbeff0080,
2574+ 0xdca6c040, 0x007a0000,
2575+ 0xd760007a, 0x00011d00,
2576+ 0xd760007b, 0x00011f00,
2577+ 0xbefe007a, 0xbeff007b,
2578+ 0xbef4007e, 0x8b75ff7f,
2579+ 0x0000ffff, 0x8c75ff75,
2580+ 0x00040000, 0xbef60080,
2581+ 0xbef700ff, 0x10807fac,
2582+ 0xbef1007d, 0xbef00080,
2583+ 0xb8f302dc, 0x84739973,
2584+ 0xbefe00c1, 0x857d9973,
2585+ 0x8b7d817d, 0xbf06817d,
2586+ 0xbfa20002, 0xbeff0080,
2587+ 0xbfa00002, 0xbeff00c1,
2588+ 0xbfa00009, 0xbef600ff,
2589+ 0x01000000, 0xe0685080,
2590+ 0x701d0100, 0xe0685100,
2591+ 0x701d0200, 0xe0685180,
2592+ 0x701d0300, 0xbfa00008,
25872593 0xbef600ff, 0x01000000,
2588− 0xe0685080, 0x701d0100,
2589− 0xe0685100, 0x701d0200,
2590− 0xe0685180, 0x701d0300,
2591− 0xbfa00008, 0xbef600ff,
2592− 0x01000000, 0xe0685100,
2593− 0x701d0100, 0xe0685200,
2594− 0x701d0200, 0xe0685300,
2595− 0x701d0300, 0xb8f03b05,
2596− 0x80708170, 0xbf0d9973,
2597− 0xbfa20002, 0x84708970,
2598− 0xbfa00001, 0x84708a70,
2599− 0xb8fa1e06, 0x847a8a7a,
2600− 0x80707a70, 0x8070ff70,
2601− 0x00000200, 0xbef600ff,
2602− 0x01000000, 0x7e000280,
2603− 0x7e020280, 0x7e040280,
2604− 0xbefd0080, 0xd7610002,
2605− 0x0000fa71, 0x807d817d,
2606− 0xd7610002, 0x0000fa6c,
2607− 0x807d817d, 0x917aff6d,
2608− 0x80000000, 0xd7610002,
2609− 0x0000fa7a, 0x807d817d,
2610− 0xd7610002, 0x0000fa6e,
2611− 0x807d817d, 0xd7610002,
2612− 0x0000fa6f, 0x807d817d,
2613− 0xd7610002, 0x0000fa78,
2614− 0x807d817d, 0xb8faf803,
2615− 0xd7610002, 0x0000fa7a,
2616− 0x807d817d, 0xd7610002,
2617− 0x0000fa7b, 0x807d817d,
2618− 0xb8f1f801, 0xd7610002,
2619− 0x0000fa71, 0x807d817d,
2620− 0xb8f1f814, 0xd7610002,
2621− 0x0000fa71, 0x807d817d,
2622− 0xb8f1f815, 0xd7610002,
2623− 0x0000fa71, 0x807d817d,
2624− 0xbefe00ff, 0x0000ffff,
2625− 0xbeff0080, 0xe0685000,
2626− 0x701d0200, 0xbefe00c1,
2594+ 0xe0685100, 0x701d0100,
2595+ 0xe0685200, 0x701d0200,
2596+ 0xe0685300, 0x701d0300,
26272597 0xb8f03b05, 0x80708170,
26282598 0xbf0d9973, 0xbfa20002,
26292599 0x84708970, 0xbfa00001,
26302600 0x84708a70, 0xb8fa1e06,
26312601 0x847a8a7a, 0x80707a70,
2602+ 0x8070ff70, 0x00000200,
26322603 0xbef600ff, 0x01000000,
2633− 0xbef90080, 0xbefd0080,
2634− 0xbf800000, 0xbe804100,
2635− 0xbe824102, 0xbe844104,
2636− 0xbe864106, 0xbe884108,
2637− 0xbe8a410a, 0xbe8c410c,
2638− 0xbe8e410e, 0xd7610002,
2639− 0x0000f200, 0x80798179,
2640− 0xd7610002, 0x0000f201,
2604+ 0x7e000280, 0x7e020280,
2605+ 0x7e040280, 0xbefd0080,
2606+ 0xd7610002, 0x0000fa71,
2607+ 0x807d817d, 0xd7610002,
2608+ 0x0000fa6c, 0x807d817d,
2609+ 0x917aff6d, 0x80000000,
2610+ 0xd7610002, 0x0000fa7a,
2611+ 0x807d817d, 0xd7610002,
2612+ 0x0000fa6e, 0x807d817d,
2613+ 0xd7610002, 0x0000fa6f,
2614+ 0x807d817d, 0xd7610002,
2615+ 0x0000fa78, 0x807d817d,
2616+ 0xb8faf803, 0xd7610002,
2617+ 0x0000fa7a, 0x807d817d,
2618+ 0xd7610002, 0x0000fa7b,
2619+ 0x807d817d, 0xb8f1f801,
2620+ 0xd7610002, 0x0000fa71,
2621+ 0x807d817d, 0xb8f1f814,
2622+ 0xd7610002, 0x0000fa71,
2623+ 0x807d817d, 0xb8f1f815,
2624+ 0xd7610002, 0x0000fa71,
2625+ 0x807d817d, 0xbefe00ff,
2626+ 0x0000ffff, 0xbeff0080,
2627+ 0xe0685000, 0x701d0200,
2628+ 0xbefe00c1, 0xb8f03b05,
2629+ 0x80708170, 0xbf0d9973,
2630+ 0xbfa20002, 0x84708970,
2631+ 0xbfa00001, 0x84708a70,
2632+ 0xb8fa1e06, 0x847a8a7a,
2633+ 0x80707a70, 0xbef600ff,
2634+ 0x01000000, 0xbef90080,
2635+ 0xbefd0080, 0xbf800000,
2636+ 0xbe804100, 0xbe824102,
2637+ 0xbe844104, 0xbe864106,
2638+ 0xbe884108, 0xbe8a410a,
2639+ 0xbe8c410c, 0xbe8e410e,
2640+ 0xd7610002, 0x0000f200,
26412641 0x80798179, 0xd7610002,
2642− 0x0000f202, 0x80798179,
2643− 0xd7610002, 0x0000f203,
2642+ 0x0000f201, 0x80798179,
2643+ 0xd7610002, 0x0000f202,
26442644 0x80798179, 0xd7610002,
2645− 0x0000f204, 0x80798179,
2646− 0xd7610002, 0x0000f205,
2645+ 0x0000f203, 0x80798179,
2646+ 0xd7610002, 0x0000f204,
26472647 0x80798179, 0xd7610002,
2648− 0x0000f206, 0x80798179,
2649− 0xd7610002, 0x0000f207,
2648+ 0x0000f205, 0x80798179,
2649+ 0xd7610002, 0x0000f206,
26502650 0x80798179, 0xd7610002,
2651− 0x0000f208, 0x80798179,
2652− 0xd7610002, 0x0000f209,
2651+ 0x0000f207, 0x80798179,
2652+ 0xd7610002, 0x0000f208,
26532653 0x80798179, 0xd7610002,
2654− 0x0000f20a, 0x80798179,
2655− 0xd7610002, 0x0000f20b,
2654+ 0x0000f209, 0x80798179,
2655+ 0xd7610002, 0x0000f20a,
26562656 0x80798179, 0xd7610002,
2657− 0x0000f20c, 0x80798179,
2658− 0xd7610002, 0x0000f20d,
2657+ 0x0000f20b, 0x80798179,
2658+ 0xd7610002, 0x0000f20c,
26592659 0x80798179, 0xd7610002,
2660− 0x0000f20e, 0x80798179,
2661− 0xd7610002, 0x0000f20f,
2662− 0x80798179, 0xbf06a079,
2663− 0xbfa10006, 0xe0685000,
2664− 0x701d0200, 0x8070ff70,
2665− 0x00000080, 0xbef90080,
2666− 0x7e040280, 0x807d907d,
2667− 0xbf0aff7d, 0x00000060,
2668− 0xbfa2ffbc, 0xbe804100,
2669− 0xbe824102, 0xbe844104,
2670− 0xbe864106, 0xbe884108,
2671− 0xbe8a410a, 0xd7610002,
2672− 0x0000f200, 0x80798179,
2673− 0xd7610002, 0x0000f201,
2660+ 0x0000f20d, 0x80798179,
2661+ 0xd7610002, 0x0000f20e,
26742662 0x80798179, 0xd7610002,
2675− 0x0000f202, 0x80798179,
2676− 0xd7610002, 0x0000f203,
2663+ 0x0000f20f, 0x80798179,
2664+ 0xbf06a079, 0xbfa10006,
2665+ 0xe0685000, 0x701d0200,
2666+ 0x8070ff70, 0x00000080,
2667+ 0xbef90080, 0x7e040280,
2668+ 0x807d907d, 0xbf0aff7d,
2669+ 0x00000060, 0xbfa2ffbc,
2670+ 0xbe804100, 0xbe824102,
2671+ 0xbe844104, 0xbe864106,
2672+ 0xbe884108, 0xbe8a410a,
2673+ 0xd7610002, 0x0000f200,
26772674 0x80798179, 0xd7610002,
2678− 0x0000f204, 0x80798179,
2679− 0xd7610002, 0x0000f205,
2675+ 0x0000f201, 0x80798179,
2676+ 0xd7610002, 0x0000f202,
26802677 0x80798179, 0xd7610002,
2681− 0x0000f206, 0x80798179,
2682− 0xd7610002, 0x0000f207,
2678+ 0x0000f203, 0x80798179,
2679+ 0xd7610002, 0x0000f204,
26832680 0x80798179, 0xd7610002,
2684− 0x0000f208, 0x80798179,
2685− 0xd7610002, 0x0000f209,
2681+ 0x0000f205, 0x80798179,
2682+ 0xd7610002, 0x0000f206,
26862683 0x80798179, 0xd7610002,
2687− 0x0000f20a, 0x80798179,
2688− 0xd7610002, 0x0000f20b,
2689− 0x80798179, 0xe0685000,
2690− 0x701d0200, 0xbefe00c1,
2691− 0x857d9973, 0x8b7d817d,
2692− 0xbf06817d, 0xbfa20002,
2693− 0xbeff0080, 0xbfa00001,
2694− 0xbeff00c1, 0xb8fb4306,
2695− 0x8b7bc17b, 0xbfa10044,
2696− 0xbfbd0000, 0x8b7aff6d,
2697− 0x80000000, 0xbfa10040,
2698− 0x847b867b, 0x847b827b,
2699− 0xbef6007b, 0xb8f03b05,
2700− 0x80708170, 0xbf0d9973,
2701− 0xbfa20002, 0x84708970,
2702− 0xbfa00001, 0x84708a70,
2703− 0xb8fa1e06, 0x847a8a7a,
2704− 0x80707a70, 0x8070ff70,
2705− 0x00000200, 0x8070ff70,
2706− 0x00000080, 0xbef600ff,
2707− 0x01000000, 0xd71f0000,
2708− 0x000100c1, 0xd7200000,
2709− 0x000200c1, 0x16000084,
2710− 0x857d9973, 0x8b7d817d,
2711− 0xbf06817d, 0xbefd0080,
2712− 0xbfa20012, 0xbe8300ff,
2713− 0x00000080, 0xbf800000,
2714− 0xbf800000, 0xbf800000,
2715− 0xd8d80000, 0x01000000,
2716− 0xbf890000, 0xe0685000,
2717− 0x701d0100, 0x807d037d,
2718− 0x80700370, 0xd5250000,
2719− 0x0001ff00, 0x00000080,
2720− 0xbf0a7b7d, 0xbfa2fff4,
2721− 0xbfa00011, 0xbe8300ff,
2722− 0x00000100, 0xbf800000,
2723− 0xbf800000, 0xbf800000,
2724− 0xd8d80000, 0x01000000,
2725− 0xbf890000, 0xe0685000,
2726− 0x701d0100, 0x807d037d,
2727− 0x80700370, 0xd5250000,
2728− 0x0001ff00, 0x00000100,
2729− 0xbf0a7b7d, 0xbfa2fff4,
2684+ 0x0000f207, 0x80798179,
2685+ 0xd7610002, 0x0000f208,
2686+ 0x80798179, 0xd7610002,
2687+ 0x0000f209, 0x80798179,
2688+ 0xd7610002, 0x0000f20a,
2689+ 0x80798179, 0xd7610002,
2690+ 0x0000f20b, 0x80798179,
2691+ 0xe0685000, 0x701d0200,
27302692 0xbefe00c1, 0x857d9973,
27312693 0x8b7d817d, 0xbf06817d,
2732− 0xbfa20004, 0xbef000ff,
2733− 0x00000200, 0xbeff0080,
2734− 0xbfa00003, 0xbef000ff,
2735− 0x00000400, 0xbeff00c1,
2736− 0xb8fb3b05, 0x807b817b,
2737− 0x847b827b, 0x857d9973,
2694+ 0xbfa20002, 0xbeff0080,
2695+ 0xbfa00001, 0xbeff00c1,
2696+ 0xb8fb4306, 0x8b7bc17b,
2697+ 0xbfa10044, 0xbfbd0000,
2698+ 0x8b7aff6d, 0x80000000,
2699+ 0xbfa10040, 0x847b867b,
2700+ 0x847b827b, 0xbef6007b,
2701+ 0xb8f03b05, 0x80708170,
2702+ 0xbf0d9973, 0xbfa20002,
2703+ 0x84708970, 0xbfa00001,
2704+ 0x84708a70, 0xb8fa1e06,
2705+ 0x847a8a7a, 0x80707a70,
2706+ 0x8070ff70, 0x00000200,
2707+ 0x8070ff70, 0x00000080,
2708+ 0xbef600ff, 0x01000000,
2709+ 0xd71f0000, 0x000100c1,
2710+ 0xd7200000, 0x000200c1,
2711+ 0x16000084, 0x857d9973,
27382712 0x8b7d817d, 0xbf06817d,
2739− 0xbfa20017, 0xbef600ff,
2740− 0x01000000, 0xbefd0084,
2741− 0xbf0a7b7d, 0xbfa10037,
2742− 0x7e008700, 0x7e028701,
2743− 0x7e048702, 0x7e068703,
2744− 0xe0685000, 0x701d0000,
2745− 0xe0685080, 0x701d0100,
2746− 0xe0685100, 0x701d0200,
2747− 0xe0685180, 0x701d0300,
2748− 0x807d847d, 0x8070ff70,
2749− 0x00000200, 0xbf0a7b7d,
2750− 0xbfa2ffef, 0xbfa00025,
2713+ 0xbefd0080, 0xbfa20012,
2714+ 0xbe8300ff, 0x00000080,
2715+ 0xbf800000, 0xbf800000,
2716+ 0xbf800000, 0xd8d80000,
2717+ 0x01000000, 0xbf890000,
2718+ 0xe0685000, 0x701d0100,
2719+ 0x807d037d, 0x80700370,
2720+ 0xd5250000, 0x0001ff00,
2721+ 0x00000080, 0xbf0a7b7d,
2722+ 0xbfa2fff4, 0xbfa00011,
2723+ 0xbe8300ff, 0x00000100,
2724+ 0xbf800000, 0xbf800000,
2725+ 0xbf800000, 0xd8d80000,
2726+ 0x01000000, 0xbf890000,
2727+ 0xe0685000, 0x701d0100,
2728+ 0x807d037d, 0x80700370,
2729+ 0xd5250000, 0x0001ff00,
2730+ 0x00000100, 0xbf0a7b7d,
2731+ 0xbfa2fff4, 0xbefe00c1,
2732+ 0x857d9973, 0x8b7d817d,
2733+ 0xbf06817d, 0xbfa20004,
2734+ 0xbef000ff, 0x00000200,
2735+ 0xbeff0080, 0xbfa00003,
2736+ 0xbef000ff, 0x00000400,
2737+ 0xbeff00c1, 0xb8fb3b05,
2738+ 0x807b817b, 0x847b827b,
2739+ 0x857d9973, 0x8b7d817d,
2740+ 0xbf06817d, 0xbfa20017,
27512741 0xbef600ff, 0x01000000,
27522742 0xbefd0084, 0xbf0a7b7d,
2753− 0xbfa10011, 0x7e008700,
2743+ 0xbfa10037, 0x7e008700,
27542744 0x7e028701, 0x7e048702,
27552745 0x7e068703, 0xe0685000,
2756− 0x701d0000, 0xe0685100,
2757− 0x701d0100, 0xe0685200,
2758− 0x701d0200, 0xe0685300,
2746+ 0x701d0000, 0xe0685080,
2747+ 0x701d0100, 0xe0685100,
2748+ 0x701d0200, 0xe0685180,
27592749 0x701d0300, 0x807d847d,
2760− 0x8070ff70, 0x00000400,
2750+ 0x8070ff70, 0x00000200,
27612751 0xbf0a7b7d, 0xbfa2ffef,
2762− 0xb8fb1e06, 0x8b7bc17b,
2763− 0xbfa1000c, 0x847b837b,
2764− 0x807b7d7b, 0xbefe00c1,
2765− 0xbeff0080, 0x7e008700,
2752+ 0xbfa00025, 0xbef600ff,
2753+ 0x01000000, 0xbefd0084,
2754+ 0xbf0a7b7d, 0xbfa10011,
2755+ 0x7e008700, 0x7e028701,
2756+ 0x7e048702, 0x7e068703,
27662757 0xe0685000, 0x701d0000,
2767− 0x807d817d, 0x8070ff70,
2768− 0x00000080, 0xbf0a7b7d,
2769− 0xbfa2fff8, 0xbfa00146,
2770− 0xbef4007e, 0x8b75ff7f,
2771− 0x0000ffff, 0x8c75ff75,
2772− 0x00040000, 0xbef60080,
2773− 0xbef700ff, 0x10807fac,
2774− 0xb8f202dc, 0x84729972,
2775− 0x8b6eff7f, 0x04000000,
2776− 0xbfa1003a, 0xbefe00c1,
2777− 0x857d9972, 0x8b7d817d,
2778− 0xbf06817d, 0xbfa20002,
2779− 0xbeff0080, 0xbfa00001,
2780− 0xbeff00c1, 0xb8ef4306,
2781− 0x8b6fc16f, 0xbfa1002f,
2782− 0x846f866f, 0x846f826f,
2783− 0xbef6006f, 0xb8f83b05,
2784− 0x80788178, 0xbf0d9972,
2785− 0xbfa20002, 0x84788978,
2786− 0xbfa00001, 0x84788a78,
2787− 0xb8ee1e06, 0x846e8a6e,
2788− 0x80786e78, 0x8078ff78,
2789− 0x00000200, 0x8078ff78,
2790− 0x00000080, 0xbef600ff,
2791− 0x01000000, 0x857d9972,
2792− 0x8b7d817d, 0xbf06817d,
2793− 0xbefd0080, 0xbfa2000c,
2794− 0xe0500000, 0x781d0000,
2795− 0xbf8903f7, 0xdac00000,
2796− 0x00000000, 0x807dff7d,
2797− 0x00000080, 0x8078ff78,
2798− 0x00000080, 0xbf0a6f7d,
2799− 0xbfa2fff5, 0xbfa0000b,
2800− 0xe0500000, 0x781d0000,
2801− 0xbf8903f7, 0xdac00000,
2802− 0x00000000, 0x807dff7d,
2803− 0x00000100, 0x8078ff78,
2804− 0x00000100, 0xbf0a6f7d,
2805− 0xbfa2fff5, 0xbef80080,
2758+ 0xe0685100, 0x701d0100,
2759+ 0xe0685200, 0x701d0200,
2760+ 0xe0685300, 0x701d0300,
2761+ 0x807d847d, 0x8070ff70,
2762+ 0x00000400, 0xbf0a7b7d,
2763+ 0xbfa2ffef, 0xb8fb1e06,
2764+ 0x8b7bc17b, 0xbfa1000c,
2765+ 0x847b837b, 0x807b7d7b,
2766+ 0xbefe00c1, 0xbeff0080,
2767+ 0x7e008700, 0xe0685000,
2768+ 0x701d0000, 0x807d817d,
2769+ 0x8070ff70, 0x00000080,
2770+ 0xbf0a7b7d, 0xbfa2fff8,
2771+ 0xbfa00146, 0xbef4007e,
2772+ 0x8b75ff7f, 0x0000ffff,
2773+ 0x8c75ff75, 0x00040000,
2774+ 0xbef60080, 0xbef700ff,
2775+ 0x10807fac, 0xb8f202dc,
2776+ 0x84729972, 0x8b6eff7f,
2777+ 0x04000000, 0xbfa1003a,
28062778 0xbefe00c1, 0x857d9972,
28072779 0x8b7d817d, 0xbf06817d,
28082780 0xbfa20002, 0xbeff0080,
28092781 0xbfa00001, 0xbeff00c1,
2810− 0xb8ef3b05, 0x806f816f,
2811− 0x846f826f, 0x857d9972,
2812− 0x8b7d817d, 0xbf06817d,
2813− 0xbfa20024, 0xbef600ff,
2814− 0x01000000, 0xbeee0078,
2782+ 0xb8ef4306, 0x8b6fc16f,
2783+ 0xbfa1002f, 0x846f866f,
2784+ 0x846f826f, 0xbef6006f,
2785+ 0xb8f83b05, 0x80788178,
2786+ 0xbf0d9972, 0xbfa20002,
2787+ 0x84788978, 0xbfa00001,
2788+ 0x84788a78, 0xb8ee1e06,
2789+ 0x846e8a6e, 0x80786e78,
28152790 0x8078ff78, 0x00000200,
2816− 0xbefd0084, 0xbf0a6f7d,
2817− 0xbfa10050, 0xe0505000,
2818− 0x781d0000, 0xe0505080,
2819− 0x781d0100, 0xe0505100,
2820− 0x781d0200, 0xe0505180,
2821− 0x781d0300, 0xbf8903f7,
2822− 0x7e008500, 0x7e028501,
2823− 0x7e048502, 0x7e068503,
2824− 0x807d847d, 0x8078ff78,
2825− 0x00000200, 0xbf0a6f7d,
2826− 0xbfa2ffee, 0xe0505000,
2827− 0x6e1d0000, 0xe0505080,
2828− 0x6e1d0100, 0xe0505100,
2829− 0x6e1d0200, 0xe0505180,
2830− 0x6e1d0300, 0xbf8903f7,
2831− 0xbfa00034, 0xbef600ff,
2832− 0x01000000, 0xbeee0078,
2833− 0x8078ff78, 0x00000400,
2834− 0xbefd0084, 0xbf0a6f7d,
2835− 0xbfa10012, 0xe0505000,
2836− 0x781d0000, 0xe0505100,
2837− 0x781d0100, 0xe0505200,
2838− 0x781d0200, 0xe0505300,
2839− 0x781d0300, 0xbf8903f7,
2840− 0x7e008500, 0x7e028501,
2841− 0x7e048502, 0x7e068503,
2842− 0x807d847d, 0x8078ff78,
2843− 0x00000400, 0xbf0a6f7d,
2844− 0xbfa2ffee, 0xb8ef1e06,
2845− 0x8b6fc16f, 0xbfa1000e,
2846− 0x846f836f, 0x806f7d6f,
2847− 0xbefe00c1, 0xbeff0080,
2791+ 0x8078ff78, 0x00000080,
2792+ 0xbef600ff, 0x01000000,
2793+ 0x857d9972, 0x8b7d817d,
2794+ 0xbf06817d, 0xbefd0080,
2795+ 0xbfa2000c, 0xe0500000,
2796+ 0x781d0000, 0xbf8903f7,
2797+ 0xdac00000, 0x00000000,
2798+ 0x807dff7d, 0x00000080,
2799+ 0x8078ff78, 0x00000080,
2800+ 0xbf0a6f7d, 0xbfa2fff5,
2801+ 0xbfa0000b, 0xe0500000,
2802+ 0x781d0000, 0xbf8903f7,
2803+ 0xdac00000, 0x00000000,
2804+ 0x807dff7d, 0x00000100,
2805+ 0x8078ff78, 0x00000100,
2806+ 0xbf0a6f7d, 0xbfa2fff5,
2807+ 0xbef80080, 0xbefe00c1,
2808+ 0x857d9972, 0x8b7d817d,
2809+ 0xbf06817d, 0xbfa20002,
2810+ 0xbeff0080, 0xbfa00001,
2811+ 0xbeff00c1, 0xb8ef3b05,
2812+ 0x806f816f, 0x846f826f,
2813+ 0x857d9972, 0x8b7d817d,
2814+ 0xbf06817d, 0xbfa20024,
2815+ 0xbef600ff, 0x01000000,
2816+ 0xbeee0078, 0x8078ff78,
2817+ 0x00000200, 0xbefd0084,
2818+ 0xbf0a6f7d, 0xbfa10050,
28482819 0xe0505000, 0x781d0000,
2820+ 0xe0505080, 0x781d0100,
2821+ 0xe0505100, 0x781d0200,
2822+ 0xe0505180, 0x781d0300,
28492823 0xbf8903f7, 0x7e008500,
2850− 0x807d817d, 0x8078ff78,
2851− 0x00000080, 0xbf0a6f7d,
2852− 0xbfa2fff7, 0xbeff00c1,
2824+ 0x7e028501, 0x7e048502,
2825+ 0x7e068503, 0x807d847d,
2826+ 0x8078ff78, 0x00000200,
2827+ 0xbf0a6f7d, 0xbfa2ffee,
28532828 0xe0505000, 0x6e1d0000,
2854− 0xe0505100, 0x6e1d0100,
2855− 0xe0505200, 0x6e1d0200,
2856− 0xe0505300, 0x6e1d0300,
2857− 0xbf8903f7, 0xb8f83b05,
2858− 0x80788178, 0xbf0d9972,
2859− 0xbfa20002, 0x84788978,
2860− 0xbfa00001, 0x84788a78,
2861− 0xb8ee1e06, 0x846e8a6e,
2862− 0x80786e78, 0x8078ff78,
2863− 0x00000200, 0x80f8ff78,
2864− 0x00000050, 0xbef600ff,
2865− 0x01000000, 0xbefd00ff,
2866− 0x0000006c, 0x80f89078,
2867− 0xf428403a, 0xf0000000,
2868− 0xbf89fc07, 0x80fd847d,
2869− 0xbf800000, 0xbe804300,
2870− 0xbe824302, 0x80f8a078,
2871− 0xf42c403a, 0xf0000000,
2872− 0xbf89fc07, 0x80fd887d,
2873− 0xbf800000, 0xbe804300,
2874− 0xbe824302, 0xbe844304,
2875− 0xbe864306, 0x80f8c078,
2876− 0xf430403a, 0xf0000000,
2877− 0xbf89fc07, 0x80fd907d,
2878− 0xbf800000, 0xbe804300,
2879− 0xbe824302, 0xbe844304,
2880− 0xbe864306, 0xbe884308,
2881− 0xbe8a430a, 0xbe8c430c,
2882− 0xbe8e430e, 0xbf06807d,
2883− 0xbfa1fff0, 0xb980f801,
2884− 0x00000000, 0xbfbd0000,
2829+ 0xe0505080, 0x6e1d0100,
2830+ 0xe0505100, 0x6e1d0200,
2831+ 0xe0505180, 0x6e1d0300,
2832+ 0xbf8903f7, 0xbfa00034,
2833+ 0xbef600ff, 0x01000000,
2834+ 0xbeee0078, 0x8078ff78,
2835+ 0x00000400, 0xbefd0084,
2836+ 0xbf0a6f7d, 0xbfa10012,
2837+ 0xe0505000, 0x781d0000,
2838+ 0xe0505100, 0x781d0100,
2839+ 0xe0505200, 0x781d0200,
2840+ 0xe0505300, 0x781d0300,
2841+ 0xbf8903f7, 0x7e008500,
2842+ 0x7e028501, 0x7e048502,
2843+ 0x7e068503, 0x807d847d,
2844+ 0x8078ff78, 0x00000400,
2845+ 0xbf0a6f7d, 0xbfa2ffee,
2846+ 0xb8ef1e06, 0x8b6fc16f,
2847+ 0xbfa1000e, 0x846f836f,
2848+ 0x806f7d6f, 0xbefe00c1,
2849+ 0xbeff0080, 0xe0505000,
2850+ 0x781d0000, 0xbf8903f7,
2851+ 0x7e008500, 0x807d817d,
2852+ 0x8078ff78, 0x00000080,
2853+ 0xbf0a6f7d, 0xbfa2fff7,
2854+ 0xbeff00c1, 0xe0505000,
2855+ 0x6e1d0000, 0xe0505100,
2856+ 0x6e1d0100, 0xe0505200,
2857+ 0x6e1d0200, 0xe0505300,
2858+ 0x6e1d0300, 0xbf8903f7,
28852859 0xb8f83b05, 0x80788178,
28862860 0xbf0d9972, 0xbfa20002,
28872861 0x84788978, 0xbfa00001,
28882862 0x84788a78, 0xb8ee1e06,
28892863 0x846e8a6e, 0x80786e78,
28902864 0x8078ff78, 0x00000200,
2865+ 0x80f8ff78, 0x00000050,
28912866 0xbef600ff, 0x01000000,
2892− 0xf4205bfa, 0xf0000000,
2893− 0x80788478, 0xf4205b3a,
2867+ 0xbefd00ff, 0x0000006c,
2868+ 0x80f89078, 0xf428403a,
2869+ 0xf0000000, 0xbf89fc07,
2870+ 0x80fd847d, 0xbf800000,
2871+ 0xbe804300, 0xbe824302,
2872+ 0x80f8a078, 0xf42c403a,
2873+ 0xf0000000, 0xbf89fc07,
2874+ 0x80fd887d, 0xbf800000,
2875+ 0xbe804300, 0xbe824302,
2876+ 0xbe844304, 0xbe864306,
2877+ 0x80f8c078, 0xf430403a,
2878+ 0xf0000000, 0xbf89fc07,
2879+ 0x80fd907d, 0xbf800000,
2880+ 0xbe804300, 0xbe824302,
2881+ 0xbe844304, 0xbe864306,
2882+ 0xbe884308, 0xbe8a430a,
2883+ 0xbe8c430c, 0xbe8e430e,
2884+ 0xbf06807d, 0xbfa1fff0,
2885+ 0xb980f801, 0x00000000,
2886+ 0xbfbd0000, 0xb8f83b05,
2887+ 0x80788178, 0xbf0d9972,
2888+ 0xbfa20002, 0x84788978,
2889+ 0xbfa00001, 0x84788a78,
2890+ 0xb8ee1e06, 0x846e8a6e,
2891+ 0x80786e78, 0x8078ff78,
2892+ 0x00000200, 0xbef600ff,
2893+ 0x01000000, 0xf4205bfa,
28942894 0xf0000000, 0x80788478,
2895− 0xf4205b7a, 0xf0000000,
2896− 0x80788478, 0xf4205c3a,
2895+ 0xf4205b3a, 0xf0000000,
2896+ 0x80788478, 0xf4205b7a,
28972897 0xf0000000, 0x80788478,
2898− 0xf4205c7a, 0xf0000000,
2899− 0x80788478, 0xf4205eba,
2898+ 0xf4205c3a, 0xf0000000,
2899+ 0x80788478, 0xf4205c7a,
29002900 0xf0000000, 0x80788478,
2901− 0xf4205efa, 0xf0000000,
2902− 0x80788478, 0xf4205e7a,
2901+ 0xf4205eba, 0xf0000000,
2902+ 0x80788478, 0xf4205efa,
29032903 0xf0000000, 0x80788478,
2904− 0xf4205cfa, 0xf0000000,
2905− 0x80788478, 0xf4205bba,
2904+ 0xf4205e7a, 0xf0000000,
2905+ 0x80788478, 0xf4205cfa,
29062906 0xf0000000, 0x80788478,
2907− 0xbf89fc07, 0xb96ef814,
29082907 0xf4205bba, 0xf0000000,
29092908 0x80788478, 0xbf89fc07,
2910− 0xb96ef815, 0xbefd006f,
2911− 0xbefe0070, 0xbeff0071,
2912− 0x8b6f7bff, 0x000003ff,
2913− 0xb96f4803, 0x8b6f7bff,
2914− 0xfffff800, 0x856f8b6f,
2915− 0xb96fa2c3, 0xb973f801,
2916− 0xb8ee3b05, 0x806e816e,
2917− 0xbf0d9972, 0xbfa20002,
2918− 0x846e896e, 0xbfa00001,
2919− 0x846e8a6e, 0xb8ef1e06,
2920− 0x846f8a6f, 0x806e6f6e,
2921− 0x806eff6e, 0x00000200,
2922− 0x806e746e, 0x826f8075,
2923− 0x8b6fff6f, 0x0000ffff,
2924− 0xf4085c37, 0xf8000050,
2925− 0xf4085d37, 0xf8000060,
2926− 0xf4005e77, 0xf8000074,
2927− 0xbf89fc07, 0x8b6dff6d,
2928− 0x0000ffff, 0x8bfe7e7e,
2929− 0x8bea6a6a, 0xb8eef802,
2930− 0xbf0d866e, 0xbfa20002,
2931− 0xb97af802, 0xbe80486c,
2932− 0xb97af802, 0xbe804a6c,
2933− 0xbfb00000, 0xbf9f0000,
2909+ 0xb96ef814, 0xf4205bba,
2910+ 0xf0000000, 0x80788478,
2911+ 0xbf89fc07, 0xb96ef815,
2912+ 0xbefd006f, 0xbefe0070,
2913+ 0xbeff0071, 0x8b6f7bff,
2914+ 0x000003ff, 0xb96f4803,
2915+ 0x8b6f7bff, 0xfffff800,
2916+ 0x856f8b6f, 0xb96fa2c3,
2917+ 0xb973f801, 0xb8ee3b05,
2918+ 0x806e816e, 0xbf0d9972,
2919+ 0xbfa20002, 0x846e896e,
2920+ 0xbfa00001, 0x846e8a6e,
2921+ 0xb8ef1e06, 0x846f8a6f,
2922+ 0x806e6f6e, 0x806eff6e,
2923+ 0x00000200, 0x806e746e,
2924+ 0x826f8075, 0x8b6fff6f,
2925+ 0x0000ffff, 0xf4085c37,
2926+ 0xf8000050, 0xf4085d37,
2927+ 0xf8000060, 0xf4005e77,
2928+ 0xf8000074, 0xbf89fc07,
2929+ 0x8b6dff6d, 0x0000ffff,
2930+ 0x8bfe7e7e, 0x8bea6a6a,
2931+ 0xb8eef802, 0xbf0d866e,
2932+ 0xbfa20002, 0xb97af802,
2933+ 0xbe80486c, 0xb97af802,
2934+ 0xbe804a6c, 0xbfb00000,
29342935 0xbf9f0000, 0xbf9f0000,
29352936 0xbf9f0000, 0xbf9f0000,
2937+ 0xbf9f0000, 0x00000000,
29362938 };
drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx10.asm+6−0
@@ -186,6 +186,12 @@ L_SKIP_RESTORE: · 185 unmodified lines
186186 s_getreg_b32 s_save_trapsts, hwreg(HW_REG_TRAPSTS)
187187
188188 #if SW_SA_TRAP
189+ // If ttmp1[30] is set then issue s_barrier to unblock dependent waves.
190+ s_bitcmp1_b32 s_save_pc_hi, 30
191+ s_cbranch_scc0 L_TRAP_NO_BARRIER
192+ s_barrier
193+
194+L_TRAP_NO_BARRIER:
189195 // If ttmp1[31] is set then trap may occur early.
190196 // Spin wait until SAVECTX exception is raised.
191197 s_bitcmp1_b32 s_save_pc_hi, 31
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c+15−19
@@ -1950,7 +1950,7 @@ static int criu_checkpoint(struct file *filep, · 1949 unmodified lines
19501950 {
19511951 int ret;
19521952 uint32_t num_devices, num_bos, num_objects;
1953− uint64_t priv_size, priv_offset = 0;
1953+ uint64_t priv_size, priv_offset = 0, bo_priv_offset;
19541954
19551955 if (!args->devices || !args->bos || !args->priv_data)
19561956 return -EINVAL;
@@ -1994,38 +1994,34 @@ static int criu_checkpoint(struct file *filep, · 37 unmodified lines
19941994 if (ret)
19951995 goto exit_unlock;
19961996
1997− ret = criu_checkpoint_bos(p, num_bos, (uint8_t __user *)args->bos,
1998− (uint8_t __user *)args->priv_data, &priv_offset);
1999− if (ret)
2000− goto exit_unlock;
1997+ /* Leave room for BOs in the private data. They need to be restored
1998+ * before events, but we checkpoint them last to simplify the error
1999+ * handling.
2000+ */
2001+ bo_priv_offset = priv_offset;
2002+ priv_offset += num_bos * sizeof(struct kfd_criu_bo_priv_data);
20012003
20022004 if (num_objects) {
20032005 ret = kfd_criu_checkpoint_queues(p, (uint8_t __user *)args->priv_data,
20042006 &priv_offset);
20052007 if (ret)
2006− goto close_bo_fds;
2008+ goto exit_unlock;
20072009
20082010 ret = kfd_criu_checkpoint_events(p, (uint8_t __user *)args->priv_data,
20092011 &priv_offset);
20102012 if (ret)
2011− goto close_bo_fds;
2013+ goto exit_unlock;
20122014
20132015 ret = kfd_criu_checkpoint_svm(p, (uint8_t __user *)args->priv_data, &priv_offset);
20142016 if (ret)
2015− goto close_bo_fds;
2017+ goto exit_unlock;
20162018 }
20172019
2018−close_bo_fds:
2019− if (ret) {
2020− /* If IOCTL returns err, user assumes all FDs opened in criu_dump_bos are closed */
2021− uint32_t i;
2022− struct kfd_criu_bo_bucket *bo_buckets = (struct kfd_criu_bo_bucket *) args->bos;
2023−
2024− for (i = 0; i < num_bos; i++) {
2025− if (bo_buckets[i].alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_VRAM)
2026− close_fd(bo_buckets[i].dmabuf_fd);
2027− }
2028− }
2020+ /* This must be the last thing in this function that can fail.
2021+ * Otherwise we leak dmabuf file descriptors.
2022+ */
2023+ ret = criu_checkpoint_bos(p, num_bos, (uint8_t __user *)args->bos,
2024+ (uint8_t __user *)args->priv_data, &bo_priv_offset);
20292025
20302026 exit_unlock:
20312027 mutex_unlock(&p->mutex);
drivers/gpu/drm/amd/amdkfd/kfd_events.c+1−2
@@ -506,6 +506,7 @@ int kfd_criu_restore_event(struct file *devkfd, · 505 unmodified lines
506506 ret = create_other_event(p, ev, &ev_priv->event_id);
507507 break;
508508 }
509+ mutex_unlock(&p->event_mutex);
509510
510511 exit:
511512 if (ret)
@@ -513,8 +514,6 @@ exit: · 1 unmodified line
513514
514515 kfree(ev_priv);
515516
516− mutex_unlock(&p->event_mutex);
517−
518517 return ret;
519518 }
520519
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c+1−3
@@ -973,12 +973,10 @@ out_unlock_prange: · 972 unmodified lines
973973 out_unlock_svms:
974974 mutex_unlock(&p->svms.lock);
975975 out_unref_process:
976+ pr_debug("CPU fault svms 0x%p address 0x%lx done\n", &p->svms, addr);
976977 kfd_unref_process(p);
977978 out_mmput:
978979 mmput(mm);
979−
980− pr_debug("CPU fault svms 0x%p address 0x%lx done\n", &p->svms, addr);
981−
982980 return r ? VM_FAULT_SIGBUS : 0;
983981 }
984982
drivers/gpu/drm/amd/display/Kconfig+7−0
@@ -5,6 +5,7 @@ menu "Display Engine Configuration" · 4 unmodified lines
55 config DRM_AMD_DC
66 bool "AMD DC - Enable new display engine"
77 default y
8+ depends on BROKEN || !CC_IS_CLANG || X86_64 || SPARC64 || ARM64
89 select SND_HDA_COMPONENT if SND_HDA_CORE
910 select DRM_AMD_DC_DCN if (X86 || PPC_LONG_DOUBLE_128)
1011 help
@@ -12,6 +13,12 @@ config DRM_AMD_DC · 1 unmodified line
1213 support for AMDGPU. This adds required support for Vega and
1314 Raven ASICs.
1415
16+ calculate_bandwidth() is presently broken on all !(X86_64 || SPARC64 || ARM64)
17+ architectures built with Clang (all released versions), whereby the stack
18+ frame gets blown up to well over 5k. This would cause an immediate kernel
19+ panic on most architectures. We'll revert this when the following bug report
20+ has been resolved: https://github.com/llvm/llvm-project/issues/41896.
21+
1522 config DRM_AMD_DC_DCN
1623 def_bool n
1724 help
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+80−17
@@ -147,6 +147,14 @@ MODULE_FIRMWARE(FIRMWARE_NAVI12_DMCU); · 146 unmodified lines
147147 /* Number of bytes in PSP footer for firmware. */
148148 #define PSP_FOOTER_BYTES 0x100
149149
150+/*
151+ * DMUB Async to Sync Mechanism Status
152+ */
153+#define DMUB_ASYNC_TO_SYNC_ACCESS_FAIL 1
154+#define DMUB_ASYNC_TO_SYNC_ACCESS_TIMEOUT 2
155+#define DMUB_ASYNC_TO_SYNC_ACCESS_SUCCESS 3
156+#define DMUB_ASYNC_TO_SYNC_ACCESS_INVALID 4
157+
150158 /**
151159 * DOC: overview
152160 *
@@ -1364,7 +1372,44 @@ static const struct dmi_system_id hpd_disconnect_quirk_table[] = { · 1211 unmodified lines
13641372 DMI_MATCH(DMI_PRODUCT_NAME, "Precision 3460"),
13651373 },
13661374 },
1375+ {
1376+ .matches = {
1377+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
1378+ DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex Tower Plus 7010"),
1379+ },
1380+ },
1381+ {
1382+ .matches = {
1383+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
1384+ DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex Tower 7010"),
1385+ },
1386+ },
1387+ {
1388+ .matches = {
1389+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
1390+ DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex SFF Plus 7010"),
1391+ },
1392+ },
1393+ {
1394+ .matches = {
1395+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
1396+ DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex SFF 7010"),
1397+ },
1398+ },
1399+ {
1400+ .matches = {
1401+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
1402+ DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex Micro Plus 7010"),
1403+ },
1404+ },
1405+ {
1406+ .matches = {
1407+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
1408+ DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex Micro 7010"),
1409+ },
1410+ },
13671411 {}
1412+ /* TODO: refactor this from a fixed table to a dynamic option */
13681413 };
13691414
13701415 static void retrieve_dmi_info(struct amdgpu_display_manager *dm)
@@ -1549,6 +1594,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) · 178 unmodified lines
15491594
15501595 adev->dm.dc->debug.visual_confirm = amdgpu_dc_visual_confirm;
15511596
1597+ /* TODO: Remove after DP2 receiver gets proper support of Cable ID feature */
1598+ adev->dm.dc->debug.ignore_cable_id = true;
1599+
15521600 r = dm_dmub_hw_init(adev);
15531601 if (r) {
15541602 DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
@@ -1634,12 +1682,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) · 79 unmodified lines
16341682 }
16351683 }
16361684
1637− if (amdgpu_dm_initialize_drm_device(adev)) {
1638− DRM_ERROR(
1639− "amdgpu: failed to initialize sw for display support.\n");
1640− goto error;
1641− }
1642−
16431685 /* Enable outbox notification only after IRQ handlers are registered and DMUB is alive.
16441686 * It is expected that DMUB will resend any pending notifications at this point, for
16451687 * example HPD from DPIA.
@@ -1647,6 +1689,12 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) · 1 unmodified line
16471689 if (dc_is_dmub_outbox_supported(adev->dm.dc))
16481690 dc_enable_dmub_outbox(adev->dm.dc);
16491691
1692+ if (amdgpu_dm_initialize_drm_device(adev)) {
1693+ DRM_ERROR(
1694+ "amdgpu: failed to initialize sw for display support.\n");
1695+ goto error;
1696+ }
1697+
16501698 /* create fake encoders for MST */
16511699 dm_dp_create_fake_mst_encoders(adev);
16521700
@@ -6464,7 +6512,7 @@ static int dm_update_mst_vcpi_slots_for_dsc(struct drm_atomic_state *state, · 4811 unmodified lines
64646512 struct drm_connector_state *new_con_state;
64656513 struct amdgpu_dm_connector *aconnector;
64666514 struct dm_connector_state *dm_conn_state;
6467− int i, j;
6515+ int i, j, ret;
64686516 int vcpi, pbn_div, pbn, slot_num = 0;
64696517
64706518 for_each_new_connector_in_state(state, connector, new_con_state, i) {
@@ -6511,8 +6559,11 @@ static int dm_update_mst_vcpi_slots_for_dsc(struct drm_atomic_state *state, · 40 unmodified lines
65116559 dm_conn_state->pbn = pbn;
65126560 dm_conn_state->vcpi_slots = slot_num;
65136561
6514− drm_dp_mst_atomic_enable_dsc(state, aconnector->port, dm_conn_state->pbn,
6515− false);
6562+ ret = drm_dp_mst_atomic_enable_dsc(state, aconnector->port,
6563+ dm_conn_state->pbn, false);
6564+ if (ret < 0)
6565+ return ret;
6566+
65166567 continue;
65176568 }
65186569
@@ -7619,9 +7670,10 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, · 1100 unmodified lines
76197670 bundle->surface_updates[planes_count].plane_info =
76207671 &bundle->plane_infos[planes_count];
76217672
7622− fill_dc_dirty_rects(plane, old_plane_state, new_plane_state,
7623− new_crtc_state,
7624− &bundle->flip_addrs[planes_count]);
7673+ if (acrtc_state->stream->link->psr_settings.psr_feature_enabled)
7674+ fill_dc_dirty_rects(plane, old_plane_state,
7675+ new_plane_state, new_crtc_state,
7676+ &bundle->flip_addrs[planes_count]);
76257677
76267678 /*
76277679 * Only allow immediate flips for fast updates that don't
@@ -9525,10 +9577,9 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, · 1897 unmodified lines
95259577
95269578 #if defined(CONFIG_DRM_AMD_DC_DCN)
95279579 if (dc_resource_is_dsc_encoding_supported(dc)) {
9528− if (!pre_validate_dsc(state, &dm_state, vars)) {
9529− ret = -EINVAL;
9580+ ret = pre_validate_dsc(state, &dm_state, vars);
9581+ if (ret != 0)
95309582 goto fail;
9531− }
95329583 }
95339584 #endif
95349585
@@ -9623,9 +9674,9 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, · 88 unmodified lines
96239674 }
96249675
96259676 #if defined(CONFIG_DRM_AMD_DC_DCN)
9626− if (!compute_mst_dsc_configs_for_state(state, dm_state->context, vars)) {
9677+ ret = compute_mst_dsc_configs_for_state(state, dm_state->context, vars);
9678+ if (ret) {
96279679 DRM_DEBUG_DRIVER("compute_mst_dsc_configs_for_state() failed\n");
9628− ret = -EINVAL;
96299680 goto fail;
96309681 }
96319682
@@ -10105,6 +10156,8 @@ static int amdgpu_dm_set_dmub_async_sync_status(bool is_cmd_aux, · 473 unmodified lines
1010510156 *operation_result = AUX_RET_ERROR_TIMEOUT;
1010610157 } else if (status_type == DMUB_ASYNC_TO_SYNC_ACCESS_FAIL) {
1010710158 *operation_result = AUX_RET_ERROR_ENGINE_ACQUIRE;
10159+ } else if (status_type == DMUB_ASYNC_TO_SYNC_ACCESS_INVALID) {
10160+ *operation_result = AUX_RET_ERROR_INVALID_REPLY;
1010810161 } else {
1010910162 *operation_result = AUX_RET_ERROR_UNKNOWN;
1011010163 }
@@ -10152,6 +10205,16 @@ int amdgpu_dm_process_dmub_aux_transfer_sync(bool is_cmd_aux, struct dc_context · 41 unmodified lines
1015210205 payload->reply[0] = adev->dm.dmub_notify->aux_reply.command;
1015310206 if (!payload->write && adev->dm.dmub_notify->aux_reply.length &&
1015410207 payload->reply[0] == AUX_TRANSACTION_REPLY_AUX_ACK) {
10208+
10209+ if (payload->length != adev->dm.dmub_notify->aux_reply.length) {
10210+ DRM_WARN("invalid read from DPIA AUX %x(%d) got length %d!\n",
10211+ payload->address, payload->length,
10212+ adev->dm.dmub_notify->aux_reply.length);
10213+ return amdgpu_dm_set_dmub_async_sync_status(is_cmd_aux, ctx,
10214+ DMUB_ASYNC_TO_SYNC_ACCESS_INVALID,
10215+ (uint32_t *)operation_result);
10216+ }
10217+
1015510218 memcpy(payload->data, adev->dm.dmub_notify->aux_reply.data,
1015610219 adev->dm.dmub_notify->aux_reply.length);
1015710220 }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h+0−6
@@ -50,12 +50,6 @@ · 49 unmodified lines
5050
5151 #define AMDGPU_DMUB_NOTIFICATION_MAX 5
5252
53−/*
54− * DMUB Async to Sync Mechanism Status
55− */
56−#define DMUB_ASYNC_TO_SYNC_ACCESS_FAIL 1
57−#define DMUB_ASYNC_TO_SYNC_ACCESS_TIMEOUT 2
58−#define DMUB_ASYNC_TO_SYNC_ACCESS_SUCCESS 3
5953 /*
6054 #include "include/amdgpu_dal_power_if.h"
6155 #include "amdgpu_dm_irq.h"
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c+8−2
@@ -412,7 +412,7 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, · 411 unmodified lines
412412 {
413413 struct amdgpu_crtc *acrtc = NULL;
414414 struct drm_plane *cursor_plane;
415−
415+ bool is_dcn;
416416 int res = -ENOMEM;
417417
418418 cursor_plane = kzalloc(sizeof(*cursor_plane), GFP_KERNEL);
@@ -450,8 +450,14 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, · 31 unmodified lines
450450 acrtc->otg_inst = -1;
451451
452452 dm->adev->mode_info.crtcs[crtc_index] = acrtc;
453− drm_crtc_enable_color_mgmt(&acrtc->base, MAX_COLOR_LUT_ENTRIES,
453+
454+ /* Don't enable DRM CRTC degamma property for DCE since it doesn't
455+ * support programmable degamma anywhere.
456+ */
457+ is_dcn = dm->adev->dm.dc->caps.color.dpp.dcn_arch;
458+ drm_crtc_enable_color_mgmt(&acrtc->base, is_dcn ? MAX_COLOR_LUT_ENTRIES : 0,
454459 true, MAX_COLOR_LUT_ENTRIES);
460+
455461 drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LEGACY_LUT_ENTRIES);
456462
457463 return 0;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c+138−116
@@ -703,13 +703,13 @@ static int bpp_x16_from_pbn(struct dsc_mst_fairness_params param, int pbn) · 702 unmodified lines
703703 return dsc_config.bits_per_pixel;
704704 }
705705
706−static bool increase_dsc_bpp(struct drm_atomic_state *state,
707− struct drm_dp_mst_topology_state *mst_state,
708− struct dc_link *dc_link,
709− struct dsc_mst_fairness_params *params,
710− struct dsc_mst_fairness_vars *vars,
711− int count,
712− int k)
706+static int increase_dsc_bpp(struct drm_atomic_state *state,
707+ struct drm_dp_mst_topology_state *mst_state,
708+ struct dc_link *dc_link,
709+ struct dsc_mst_fairness_params *params,
710+ struct dsc_mst_fairness_vars *vars,
711+ int count,
712+ int k)
713713 {
714714 int i;
715715 bool bpp_increased[MAX_PIPES];
@@ -719,6 +719,7 @@ static bool increase_dsc_bpp(struct drm_atomic_state *state, · 3 unmodified lines
719719 int remaining_to_increase = 0;
720720 int link_timeslots_used;
721721 int fair_pbn_alloc;
722+ int ret = 0;
722723
723724 for (i = 0; i < count; i++) {
724725 if (vars[i + k].dsc_enabled) {
@@ -757,52 +758,60 @@ static bool increase_dsc_bpp(struct drm_atomic_state *state, · 32 unmodified lines
757758
758759 if (initial_slack[next_index] > fair_pbn_alloc) {
759760 vars[next_index].pbn += fair_pbn_alloc;
760− if (drm_dp_atomic_find_time_slots(state,
761− params[next_index].port->mgr,
762− params[next_index].port,
763− vars[next_index].pbn) < 0)
764− return false;
765− if (!drm_dp_mst_atomic_check(state)) {
761+ ret = drm_dp_atomic_find_time_slots(state,
762+ params[next_index].port->mgr,
763+ params[next_index].port,
764+ vars[next_index].pbn);
765+ if (ret < 0)
766+ return ret;
767+
768+ ret = drm_dp_mst_atomic_check(state);
769+ if (ret == 0) {
766770 vars[next_index].bpp_x16 = bpp_x16_from_pbn(params[next_index], vars[next_index].pbn);
767771 } else {
768772 vars[next_index].pbn -= fair_pbn_alloc;
769− if (drm_dp_atomic_find_time_slots(state,
770− params[next_index].port->mgr,
771− params[next_index].port,
772− vars[next_index].pbn) < 0)
773− return false;
773+ ret = drm_dp_atomic_find_time_slots(state,
774+ params[next_index].port->mgr,
775+ params[next_index].port,
776+ vars[next_index].pbn);
777+ if (ret < 0)
778+ return ret;
774779 }
775780 } else {
776781 vars[next_index].pbn += initial_slack[next_index];
777− if (drm_dp_atomic_find_time_slots(state,
778− params[next_index].port->mgr,
779− params[next_index].port,
780− vars[next_index].pbn) < 0)
781− return false;
782− if (!drm_dp_mst_atomic_check(state)) {
782+ ret = drm_dp_atomic_find_time_slots(state,
783+ params[next_index].port->mgr,
784+ params[next_index].port,
785+ vars[next_index].pbn);
786+ if (ret < 0)
787+ return ret;
788+
789+ ret = drm_dp_mst_atomic_check(state);
790+ if (ret == 0) {
783791 vars[next_index].bpp_x16 = params[next_index].bw_range.max_target_bpp_x16;
784792 } else {
785793 vars[next_index].pbn -= initial_slack[next_index];
786− if (drm_dp_atomic_find_time_slots(state,
787− params[next_index].port->mgr,
788− params[next_index].port,
789− vars[next_index].pbn) < 0)
790− return false;
794+ ret = drm_dp_atomic_find_time_slots(state,
795+ params[next_index].port->mgr,
796+ params[next_index].port,
797+ vars[next_index].pbn);
798+ if (ret < 0)
799+ return ret;
791800 }
792801 }
793802
794803 bpp_increased[next_index] = true;
795804 remaining_to_increase--;
796805 }
797− return true;
806+ return 0;
798807 }
799808
800−static bool try_disable_dsc(struct drm_atomic_state *state,
801− struct dc_link *dc_link,
802− struct dsc_mst_fairness_params *params,
803− struct dsc_mst_fairness_vars *vars,
804− int count,
805− int k)
809+static int try_disable_dsc(struct drm_atomic_state *state,
810+ struct dc_link *dc_link,
811+ struct dsc_mst_fairness_params *params,
812+ struct dsc_mst_fairness_vars *vars,
813+ int count,
814+ int k)
806815 {
807816 int i;
808817 bool tried[MAX_PIPES];
@@ -810,6 +819,7 @@ static bool try_disable_dsc(struct drm_atomic_state *state, · 1 unmodified line
810819 int max_kbps_increase;
811820 int next_index;
812821 int remaining_to_try = 0;
822+ int ret;
813823
814824 for (i = 0; i < count; i++) {
815825 if (vars[i + k].dsc_enabled
@@ -840,49 +850,52 @@ static bool try_disable_dsc(struct drm_atomic_state *state, · 24 unmodified lines
840850 break;
841851
842852 vars[next_index].pbn = kbps_to_peak_pbn(params[next_index].bw_range.stream_kbps);
843− if (drm_dp_atomic_find_time_slots(state,
844− params[next_index].port->mgr,
845− params[next_index].port,
846− vars[next_index].pbn) < 0)
847− return false;
853+ ret = drm_dp_atomic_find_time_slots(state,
854+ params[next_index].port->mgr,
855+ params[next_index].port,
856+ vars[next_index].pbn);
857+ if (ret < 0)
858+ return ret;
848859
849− if (!drm_dp_mst_atomic_check(state)) {
860+ ret = drm_dp_mst_atomic_check(state);
861+ if (ret == 0) {
850862 vars[next_index].dsc_enabled = false;
851863 vars[next_index].bpp_x16 = 0;
852864 } else {
853865 vars[next_index].pbn = kbps_to_peak_pbn(params[next_index].bw_range.max_kbps);
854− if (drm_dp_atomic_find_time_slots(state,
855− params[next_index].port->mgr,
856− params[next_index].port,
857− vars[next_index].pbn) < 0)
858− return false;
866+ ret = drm_dp_atomic_find_time_slots(state,
867+ params[next_index].port->mgr,
868+ params[next_index].port,
869+ vars[next_index].pbn);
870+ if (ret < 0)
871+ return ret;
859872 }
860873
861874 tried[next_index] = true;
862875 remaining_to_try--;
863876 }
864− return true;
877+ return 0;
865878 }
866879
867−static bool compute_mst_dsc_configs_for_link(struct drm_atomic_state *state,
868− struct dc_state *dc_state,
869− struct dc_link *dc_link,
870− struct dsc_mst_fairness_vars *vars,
871− struct drm_dp_mst_topology_mgr *mgr,
872− int *link_vars_start_index)
880+static int compute_mst_dsc_configs_for_link(struct drm_atomic_state *state,
881+ struct dc_state *dc_state,
882+ struct dc_link *dc_link,
883+ struct dsc_mst_fairness_vars *vars,
884+ struct drm_dp_mst_topology_mgr *mgr,
885+ int *link_vars_start_index)
873886 {
874887 struct dc_stream_state *stream;
875888 struct dsc_mst_fairness_params params[MAX_PIPES];
876889 struct amdgpu_dm_connector *aconnector;
877890 struct drm_dp_mst_topology_state *mst_state = drm_atomic_get_mst_topology_state(state, mgr);
878891 int count = 0;
879− int i, k;
892+ int i, k, ret;
880893 bool debugfs_overwrite = false;
881894
882895 memset(params, 0, sizeof(params));
883896
884897 if (IS_ERR(mst_state))
885− return false;
898+ return PTR_ERR(mst_state);
886899
887900 mst_state->pbn_div = dm_mst_get_pbn_divider(dc_link);
888901 #if defined(CONFIG_DRM_AMD_DC_DCN)
@@ -933,7 +946,7 @@ static bool compute_mst_dsc_configs_for_link(struct drm_atomic_state *state, · 44 unmodified lines
933946
934947 if (count == 0) {
935948 ASSERT(0);
936− return true;
949+ return 0;
937950 }
938951
939952 /* k is start index of vars for current phy link used by mst hub */
@@ -947,13 +960,17 @@ static bool compute_mst_dsc_configs_for_link(struct drm_atomic_state *state, · 7 unmodified lines
947960 vars[i + k].pbn = kbps_to_peak_pbn(params[i].bw_range.stream_kbps);
948961 vars[i + k].dsc_enabled = false;
949962 vars[i + k].bpp_x16 = 0;
950− if (drm_dp_atomic_find_time_slots(state, params[i].port->mgr, params[i].port,
951− vars[i + k].pbn) < 0)
952− return false;
963+ ret = drm_dp_atomic_find_time_slots(state, params[i].port->mgr, params[i].port,
964+ vars[i + k].pbn);
965+ if (ret < 0)
966+ return ret;
953967 }
954− if (!drm_dp_mst_atomic_check(state) && !debugfs_overwrite) {
968+ ret = drm_dp_mst_atomic_check(state);
969+ if (ret == 0 && !debugfs_overwrite) {
955970 set_dsc_configs_from_fairness_vars(params, vars, count, k);
956− return true;
971+ return 0;
972+ } else if (ret != -ENOSPC) {
973+ return ret;
957974 }
958975
959976 /* Try max compression */
@@ -962,31 +979,36 @@ static bool compute_mst_dsc_configs_for_link(struct drm_atomic_state *state, · 2 unmodified lines
962979 vars[i + k].pbn = kbps_to_peak_pbn(params[i].bw_range.min_kbps);
963980 vars[i + k].dsc_enabled = true;
964981 vars[i + k].bpp_x16 = params[i].bw_range.min_target_bpp_x16;
965− if (drm_dp_atomic_find_time_slots(state, params[i].port->mgr,
966− params[i].port, vars[i + k].pbn) < 0)
967− return false;
982+ ret = drm_dp_atomic_find_time_slots(state, params[i].port->mgr,
983+ params[i].port, vars[i + k].pbn);
984+ if (ret < 0)
985+ return ret;
968986 } else {
969987 vars[i + k].pbn = kbps_to_peak_pbn(params[i].bw_range.stream_kbps);
970988 vars[i + k].dsc_enabled = false;
971989 vars[i + k].bpp_x16 = 0;
972− if (drm_dp_atomic_find_time_slots(state, params[i].port->mgr,
973− params[i].port, vars[i + k].pbn) < 0)
974− return false;
990+ ret = drm_dp_atomic_find_time_slots(state, params[i].port->mgr,
991+ params[i].port, vars[i + k].pbn);
992+ if (ret < 0)
993+ return ret;
975994 }
976995 }
977− if (drm_dp_mst_atomic_check(state))
978− return false;
996+ ret = drm_dp_mst_atomic_check(state);
997+ if (ret != 0)
998+ return ret;
979999
9801000 /* Optimize degree of compression */
981− if (!increase_dsc_bpp(state, mst_state, dc_link, params, vars, count, k))
982− return false;
1001+ ret = increase_dsc_bpp(state, mst_state, dc_link, params, vars, count, k);
1002+ if (ret < 0)
1003+ return ret;
9831004
984− if (!try_disable_dsc(state, dc_link, params, vars, count, k))
985− return false;
1005+ ret = try_disable_dsc(state, dc_link, params, vars, count, k);
1006+ if (ret < 0)
1007+ return ret;
9861008
9871009 set_dsc_configs_from_fairness_vars(params, vars, count, k);
9881010
989− return true;
1011+ return 0;
9901012 }
9911013
9921014 static bool is_dsc_need_re_compute(
@@ -1087,15 +1109,17 @@ static bool is_dsc_need_re_compute( · 94 unmodified lines
10871109 return is_dsc_need_re_compute;
10881110 }
10891111
1090−bool compute_mst_dsc_configs_for_state(struct drm_atomic_state *state,
1091− struct dc_state *dc_state,
1092− struct dsc_mst_fairness_vars *vars)
1112+int compute_mst_dsc_configs_for_state(struct drm_atomic_state *state,
1113+ struct dc_state *dc_state,
1114+ struct dsc_mst_fairness_vars *vars)
10931115 {
10941116 int i, j;
10951117 struct dc_stream_state *stream;
10961118 bool computed_streams[MAX_PIPES];
10971119 struct amdgpu_dm_connector *aconnector;
1120+ struct drm_dp_mst_topology_mgr *mst_mgr;
10981121 int link_vars_start_index = 0;
1122+ int ret = 0;
10991123
11001124 for (i = 0; i < dc_state->stream_count; i++)
11011125 computed_streams[i] = false;
@@ -1108,7 +1132,7 @@ bool compute_mst_dsc_configs_for_state(struct drm_atomic_state *state, · 6 unmodified lines
11081132
11091133 aconnector = (struct amdgpu_dm_connector *)stream->dm_stream_context;
11101134
1111− if (!aconnector || !aconnector->dc_sink)
1135+ if (!aconnector || !aconnector->dc_sink || !aconnector->port)
11121136 continue;
11131137
11141138 if (!aconnector->dc_sink->dsc_caps.dsc_dec_caps.is_dsc_supported)
@@ -1118,19 +1142,16 @@ bool compute_mst_dsc_configs_for_state(struct drm_atomic_state *state, · 3 unmodified lines
11181142 continue;
11191143
11201144 if (dcn20_remove_stream_from_ctx(stream->ctx->dc, dc_state, stream) != DC_OK)
1121− return false;
1145+ return -EINVAL;
11221146
11231147 if (!is_dsc_need_re_compute(state, dc_state, stream->link))
11241148 continue;
11251149
1126− mutex_lock(&aconnector->mst_mgr.lock);
1127− if (!compute_mst_dsc_configs_for_link(state, dc_state, stream->link, vars,
1128− &aconnector->mst_mgr,
1129− &link_vars_start_index)) {
1130− mutex_unlock(&aconnector->mst_mgr.lock);
1131− return false;
1132− }
1133− mutex_unlock(&aconnector->mst_mgr.lock);
1150+ mst_mgr = aconnector->port->mgr;
1151+ ret = compute_mst_dsc_configs_for_link(state, dc_state, stream->link, vars, mst_mgr,
1152+ &link_vars_start_index);
1153+ if (ret != 0)
1154+ return ret;
11341155
11351156 for (j = 0; j < dc_state->stream_count; j++) {
11361157 if (dc_state->streams[j]->link == stream->link)
@@ -1143,22 +1164,23 @@ bool compute_mst_dsc_configs_for_state(struct drm_atomic_state *state, · 6 unmodified lines
11431164
11441165 if (stream->timing.flags.DSC == 1)
11451166 if (dc_stream_add_dsc_to_resource(stream->ctx->dc, dc_state, stream) != DC_OK)
1146− return false;
1167+ return -EINVAL;
11471168 }
11481169
1149− return true;
1170+ return ret;
11501171 }
11511172
1152−static bool
1153− pre_compute_mst_dsc_configs_for_state(struct drm_atomic_state *state,
1154− struct dc_state *dc_state,
1155− struct dsc_mst_fairness_vars *vars)
1173+static int pre_compute_mst_dsc_configs_for_state(struct drm_atomic_state *state,
1174+ struct dc_state *dc_state,
1175+ struct dsc_mst_fairness_vars *vars)
11561176 {
11571177 int i, j;
11581178 struct dc_stream_state *stream;
11591179 bool computed_streams[MAX_PIPES];
11601180 struct amdgpu_dm_connector *aconnector;
1181+ struct drm_dp_mst_topology_mgr *mst_mgr;
11611182 int link_vars_start_index = 0;
1183+ int ret = 0;
11621184
11631185 for (i = 0; i < dc_state->stream_count; i++)
11641186 computed_streams[i] = false;
@@ -1171,7 +1193,7 @@ static bool · 6 unmodified lines
11711193
11721194 aconnector = (struct amdgpu_dm_connector *)stream->dm_stream_context;
11731195
1174− if (!aconnector || !aconnector->dc_sink)
1196+ if (!aconnector || !aconnector->dc_sink || !aconnector->port)
11751197 continue;
11761198
11771199 if (!aconnector->dc_sink->dsc_caps.dsc_dec_caps.is_dsc_supported)
@@ -1183,14 +1205,11 @@ static bool · 5 unmodified lines
11831205 if (!is_dsc_need_re_compute(state, dc_state, stream->link))
11841206 continue;
11851207
1186− mutex_lock(&aconnector->mst_mgr.lock);
1187− if (!compute_mst_dsc_configs_for_link(state, dc_state, stream->link, vars,
1188− &aconnector->mst_mgr,
1189− &link_vars_start_index)) {
1190− mutex_unlock(&aconnector->mst_mgr.lock);
1191− return false;
1192− }
1193− mutex_unlock(&aconnector->mst_mgr.lock);
1208+ mst_mgr = aconnector->port->mgr;
1209+ ret = compute_mst_dsc_configs_for_link(state, dc_state, stream->link, vars, mst_mgr,
1210+ &link_vars_start_index);
1211+ if (ret != 0)
1212+ return ret;
11941213
11951214 for (j = 0; j < dc_state->stream_count; j++) {
11961215 if (dc_state->streams[j]->link == stream->link)
@@ -1198,7 +1217,7 @@ static bool · 1 unmodified line
11981217 }
11991218 }
12001219
1201− return true;
1220+ return ret;
12021221 }
12031222
12041223 static int find_crtc_index_in_state_by_stream(struct drm_atomic_state *state,
@@ -1253,9 +1272,9 @@ static bool is_dsc_precompute_needed(struct drm_atomic_state *state) · 48 unmodified lines
12531272 return ret;
12541273 }
12551274
1256−bool pre_validate_dsc(struct drm_atomic_state *state,
1257− struct dm_atomic_state **dm_state_ptr,
1258− struct dsc_mst_fairness_vars *vars)
1275+int pre_validate_dsc(struct drm_atomic_state *state,
1276+ struct dm_atomic_state **dm_state_ptr,
1277+ struct dsc_mst_fairness_vars *vars)
12591278 {
12601279 int i;
12611280 struct dm_atomic_state *dm_state;
@@ -1264,11 +1283,12 @@ bool pre_validate_dsc(struct drm_atomic_state *state, · 2 unmodified lines
12641283
12651284 if (!is_dsc_precompute_needed(state)) {
12661285 DRM_INFO_ONCE("DSC precompute is not needed.\n");
1267− return true;
1286+ return 0;
12681287 }
1269− if (dm_atomic_get_state(state, dm_state_ptr)) {
1288+ ret = dm_atomic_get_state(state, dm_state_ptr);
1289+ if (ret != 0) {
12701290 DRM_INFO_ONCE("dm_atomic_get_state() failed\n");
1271− return false;
1291+ return ret;
12721292 }
12731293 dm_state = *dm_state_ptr;
12741294
@@ -1280,7 +1300,7 @@ bool pre_validate_dsc(struct drm_atomic_state *state, · 5 unmodified lines
12801300
12811301 local_dc_state = kmemdup(dm_state->context, sizeof(struct dc_state), GFP_KERNEL);
12821302 if (!local_dc_state)
1283− return false;
1303+ return -ENOMEM;
12841304
12851305 for (i = 0; i < local_dc_state->stream_count; i++) {
12861306 struct dc_stream_state *stream = dm_state->context->streams[i];
@@ -1316,9 +1336,9 @@ bool pre_validate_dsc(struct drm_atomic_state *state, · 29 unmodified lines
13161336 if (ret != 0)
13171337 goto clean_exit;
13181338
1319− if (!pre_compute_mst_dsc_configs_for_state(state, local_dc_state, vars)) {
1339+ ret = pre_compute_mst_dsc_configs_for_state(state, local_dc_state, vars);
1340+ if (ret != 0) {
13201341 DRM_INFO_ONCE("pre_compute_mst_dsc_configs_for_state() failed\n");
1321− ret = -EINVAL;
13221342 goto clean_exit;
13231343 }
13241344
@@ -1349,7 +1369,7 @@ clean_exit: · 24 unmodified lines
13491369
13501370 kfree(local_dc_state);
13511371
1352− return (ret == 0);
1372+ return ret;
13531373 }
13541374
13551375 static unsigned int kbps_from_pbn(unsigned int pbn)
@@ -1392,6 +1412,7 @@ enum dc_status dm_dp_mst_is_port_support_mode( · 36 unmodified lines
13921412 unsigned int upper_link_bw_in_kbps = 0, down_link_bw_in_kbps = 0;
13931413 unsigned int max_compressed_bw_in_kbps = 0;
13941414 struct dc_dsc_bw_range bw_range = {0};
1415+ struct drm_dp_mst_topology_mgr *mst_mgr;
13951416
13961417 /*
13971418 * check if the mode could be supported if DSC pass-through is supported
@@ -1400,7 +1421,8 @@ enum dc_status dm_dp_mst_is_port_support_mode( · 2 unmodified lines
14001421 */
14011422 if (is_dsc_common_config_possible(stream, &bw_range) &&
14021423 aconnector->port->passthrough_aux) {
1403− mutex_lock(&aconnector->mst_mgr.lock);
1424+ mst_mgr = aconnector->port->mgr;
1425+ mutex_lock(&mst_mgr->lock);
14041426
14051427 cur_link_settings = stream->link->verified_link_cap;
14061428
@@ -1413,7 +1435,7 @@ enum dc_status dm_dp_mst_is_port_support_mode( · 6 unmodified lines
14131435 end_to_end_bw_in_kbps = min(upper_link_bw_in_kbps,
14141436 down_link_bw_in_kbps);
14151437
1416− mutex_unlock(&aconnector->mst_mgr.lock);
1438+ mutex_unlock(&mst_mgr->lock);
14171439
14181440 /*
14191441 * use the maximum dsc compression bandwidth as the required
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h+6−6
@@ -53,15 +53,15 @@ struct dsc_mst_fairness_vars { · 52 unmodified lines
5353 struct amdgpu_dm_connector *aconnector;
5454 };
5555
56−bool compute_mst_dsc_configs_for_state(struct drm_atomic_state *state,
57− struct dc_state *dc_state,
58− struct dsc_mst_fairness_vars *vars);
56+int compute_mst_dsc_configs_for_state(struct drm_atomic_state *state,
57+ struct dc_state *dc_state,
58+ struct dsc_mst_fairness_vars *vars);
5959
6060 bool needs_dsc_aux_workaround(struct dc_link *link);
6161
62−bool pre_validate_dsc(struct drm_atomic_state *state,
63− struct dm_atomic_state **dm_state_ptr,
64− struct dsc_mst_fairness_vars *vars);
62+int pre_validate_dsc(struct drm_atomic_state *state,
63+ struct dm_atomic_state **dm_state_ptr,
64+ struct dsc_mst_fairness_vars *vars);
6565
6666 enum dc_status dm_dp_mst_is_port_support_mode(
6767 struct amdgpu_dm_connector *aconnector,
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c+30−0
@@ -2393,6 +2393,26 @@ static enum bp_result get_vram_info_v25( · 2392 unmodified lines
23932393 return result;
23942394 }
23952395
2396+static enum bp_result get_vram_info_v30(
2397+ struct bios_parser *bp,
2398+ struct dc_vram_info *info)
2399+{
2400+ struct atom_vram_info_header_v3_0 *info_v30;
2401+ enum bp_result result = BP_RESULT_OK;
2402+
2403+ info_v30 = GET_IMAGE(struct atom_vram_info_header_v3_0,
2404+ DATA_TABLES(vram_info));
2405+
2406+ if (info_v30 == NULL)
2407+ return BP_RESULT_BADBIOSTABLE;
2408+
2409+ info->num_chans = info_v30->channel_num;
2410+ info->dram_channel_width_bytes = (1 << info_v30->channel_width) / 8;
2411+
2412+ return result;
2413+}
2414+
2415+
23962416 /*
23972417 * get_integrated_info_v11
23982418 *
@@ -3060,6 +3080,16 @@ static enum bp_result bios_parser_get_vram_info( · 661 unmodified lines
30603080 }
30613081 break;
30623082
3083+ case 3:
3084+ switch (revision.minor) {
3085+ case 0:
3086+ result = get_vram_info_v30(bp, info);
3087+ break;
3088+ default:
3089+ break;
3090+ }
3091+ break;
3092+
30633093 default:
30643094 return result;
30653095 }
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c+16−16
@@ -363,32 +363,32 @@ static struct wm_table ddr5_wm_table = { · 362 unmodified lines
363363 .wm_inst = WM_A,
364364 .wm_type = WM_TYPE_PSTATE_CHG,
365365 .pstate_latency_us = 11.72,
366− .sr_exit_time_us = 9,
367− .sr_enter_plus_exit_time_us = 11,
366+ .sr_exit_time_us = 12.5,
367+ .sr_enter_plus_exit_time_us = 14.5,
368368 .valid = true,
369369 },
370370 {
371371 .wm_inst = WM_B,
372372 .wm_type = WM_TYPE_PSTATE_CHG,
373373 .pstate_latency_us = 11.72,
374− .sr_exit_time_us = 9,
375− .sr_enter_plus_exit_time_us = 11,
374+ .sr_exit_time_us = 12.5,
375+ .sr_enter_plus_exit_time_us = 14.5,
376376 .valid = true,
377377 },
378378 {
379379 .wm_inst = WM_C,
380380 .wm_type = WM_TYPE_PSTATE_CHG,
381381 .pstate_latency_us = 11.72,
382− .sr_exit_time_us = 9,
383− .sr_enter_plus_exit_time_us = 11,
382+ .sr_exit_time_us = 12.5,
383+ .sr_enter_plus_exit_time_us = 14.5,
384384 .valid = true,
385385 },
386386 {
387387 .wm_inst = WM_D,
388388 .wm_type = WM_TYPE_PSTATE_CHG,
389389 .pstate_latency_us = 11.72,
390− .sr_exit_time_us = 9,
391− .sr_enter_plus_exit_time_us = 11,
390+ .sr_exit_time_us = 12.5,
391+ .sr_enter_plus_exit_time_us = 14.5,
392392 .valid = true,
393393 },
394394 }
@@ -400,32 +400,32 @@ static struct wm_table lpddr5_wm_table = { · 5 unmodified lines
400400 .wm_inst = WM_A,
401401 .wm_type = WM_TYPE_PSTATE_CHG,
402402 .pstate_latency_us = 11.65333,
403− .sr_exit_time_us = 11.5,
404− .sr_enter_plus_exit_time_us = 14.5,
403+ .sr_exit_time_us = 16.5,
404+ .sr_enter_plus_exit_time_us = 18.5,
405405 .valid = true,
406406 },
407407 {
408408 .wm_inst = WM_B,
409409 .wm_type = WM_TYPE_PSTATE_CHG,
410410 .pstate_latency_us = 11.65333,
411− .sr_exit_time_us = 11.5,
412− .sr_enter_plus_exit_time_us = 14.5,
411+ .sr_exit_time_us = 16.5,
412+ .sr_enter_plus_exit_time_us = 18.5,
413413 .valid = true,
414414 },
415415 {
416416 .wm_inst = WM_C,
417417 .wm_type = WM_TYPE_PSTATE_CHG,
418418 .pstate_latency_us = 11.65333,
419− .sr_exit_time_us = 11.5,
420− .sr_enter_plus_exit_time_us = 14.5,
419+ .sr_exit_time_us = 16.5,
420+ .sr_enter_plus_exit_time_us = 18.5,
421421 .valid = true,
422422 },
423423 {
424424 .wm_inst = WM_D,
425425 .wm_type = WM_TYPE_PSTATE_CHG,
426426 .pstate_latency_us = 11.65333,
427− .sr_exit_time_us = 11.5,
428− .sr_enter_plus_exit_time_us = 14.5,
427+ .sr_exit_time_us = 16.5,
428+ .sr_enter_plus_exit_time_us = 18.5,
429429 .valid = true,
430430 },
431431 }
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c+9−2
@@ -123,9 +123,10 @@ static int dcn314_smu_send_msg_with_param(struct clk_mgr_internal *clk_mgr, · 122 unmodified lines
123123 uint32_t result;
124124
125125 result = dcn314_smu_wait_for_response(clk_mgr, 10, 200000);
126− ASSERT(result == VBIOSSMC_Result_OK);
127126
128− smu_print("SMU response after wait: %d\n", result);
127+ if (result != VBIOSSMC_Result_OK)
128+ smu_print("SMU Response was not OK. SMU response after wait received is: %d\n",
129+ result);
129130
130131 if (result == VBIOSSMC_Status_BUSY)
131132 return -1;
@@ -216,6 +217,12 @@ int dcn314_smu_set_hard_min_dcfclk(struct clk_mgr_internal *clk_mgr, int request · 84 unmodified lines
216217 VBIOSSMC_MSG_SetHardMinDcfclkByFreq,
217218 khz_to_mhz_ceil(requested_dcfclk_khz));
218219
220+#ifdef DBG
221+ smu_print("actual_dcfclk_set_mhz %d is set to : %d\n",
222+ actual_dcfclk_set_mhz,
223+ actual_dcfclk_set_mhz * 1000);
224+#endif
225+
219226 return actual_dcfclk_set_mhz * 1000;
220227 }
221228
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c+7−4
@@ -157,6 +157,7 @@ void dcn32_init_clocks(struct clk_mgr *clk_mgr_base) · 156 unmodified lines
157157 struct clk_mgr_internal *clk_mgr = TO_CLK_MGR_INTERNAL(clk_mgr_base);
158158 unsigned int num_levels;
159159 struct clk_limit_num_entries *num_entries_per_clk = &clk_mgr_base->bw_params->clk_table.num_entries_per_clk;
160+ unsigned int i;
160161
161162 memset(&(clk_mgr_base->clks), 0, sizeof(struct dc_clocks));
162163 clk_mgr_base->clks.p_state_change_support = true;
@@ -205,18 +206,17 @@ void dcn32_init_clocks(struct clk_mgr *clk_mgr_base) · 42 unmodified lines
205206 clk_mgr->dpm_present = true;
206207
207208 if (clk_mgr_base->ctx->dc->debug.min_disp_clk_khz) {
208− unsigned int i;
209−
210209 for (i = 0; i < num_levels; i++)
211210 if (clk_mgr_base->bw_params->clk_table.entries[i].dispclk_mhz
212211 < khz_to_mhz_ceil(clk_mgr_base->ctx->dc->debug.min_disp_clk_khz))
213212 clk_mgr_base->bw_params->clk_table.entries[i].dispclk_mhz
214213 = khz_to_mhz_ceil(clk_mgr_base->ctx->dc->debug.min_disp_clk_khz);
215214 }
215+ for (i = 0; i < num_levels; i++)
216+ if (clk_mgr_base->bw_params->clk_table.entries[i].dispclk_mhz > 1950)
217+ clk_mgr_base->bw_params->clk_table.entries[i].dispclk_mhz = 1950;
216218
217219 if (clk_mgr_base->ctx->dc->debug.min_dpp_clk_khz) {
218− unsigned int i;
219−
220220 for (i = 0; i < num_levels; i++)
221221 if (clk_mgr_base->bw_params->clk_table.entries[i].dppclk_mhz
222222 < khz_to_mhz_ceil(clk_mgr_base->ctx->dc->debug.min_dpp_clk_khz))
@@ -669,6 +669,9 @@ static void dcn32_get_memclk_states_from_smu(struct clk_mgr *clk_mgr_base) · 446 unmodified lines
669669 &clk_mgr_base->bw_params->clk_table.entries[0].memclk_mhz,
670670 &num_entries_per_clk->num_memclk_levels);
671671
672+ /* memclk must have at least one level */
673+ num_entries_per_clk->num_memclk_levels = num_entries_per_clk->num_memclk_levels ? num_entries_per_clk->num_memclk_levels : 1;
674+
672675 dcn32_init_single_clock(clk_mgr, PPCLK_FCLK,
673676 &clk_mgr_base->bw_params->clk_table.entries[0].fclk_mhz,
674677 &num_entries_per_clk->num_fclk_levels);
drivers/gpu/drm/amd/display/dc/dc.h+2−0
@@ -852,6 +852,8 @@ struct dc_debug_options { · 851 unmodified lines
852852 bool enable_double_buffered_dsc_pg_support;
853853 bool enable_dp_dig_pixel_rate_div_policy;
854854 enum lttpr_mode lttpr_mode_override;
855+ unsigned int dsc_delay_factor_wa_x1000;
856+ unsigned int min_prefetch_in_strobe_ns;
855857 };
856858
857859 struct gpu_info_soc_bounding_box_v1_0;
drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c+2−1
@@ -359,7 +359,8 @@ static const struct dce_audio_registers audio_regs[] = { · 358 unmodified lines
359359 audio_regs(2),
360360 audio_regs(3),
361361 audio_regs(4),
362− audio_regs(5)
362+ audio_regs(5),
363+ audio_regs(6),
363364 };
364365
365366 #define DCE120_AUD_COMMON_MASK_SH_LIST(mask_sh)\
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c+24−10
@@ -436,34 +436,48 @@ void dpp1_set_cursor_position( · 435 unmodified lines
436436 uint32_t height)
437437 {
438438 struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
439− int src_x_offset = pos->x - pos->x_hotspot - param->viewport.x;
440− int src_y_offset = pos->y - pos->y_hotspot - param->viewport.y;
439+ int x_pos = pos->x - param->viewport.x;
440+ int y_pos = pos->y - param->viewport.y;
441+ int x_hotspot = pos->x_hotspot;
442+ int y_hotspot = pos->y_hotspot;
443+ int src_x_offset = x_pos - pos->x_hotspot;
444+ int src_y_offset = y_pos - pos->y_hotspot;
445+ int cursor_height = (int)height;
446+ int cursor_width = (int)width;
441447 uint32_t cur_en = pos->enable ? 1 : 0;
442448
443− // Cursor width/height and hotspots need to be rotated for offset calculation
449+ // Transform cursor width / height and hotspots for offset calculations
444450 if (param->rotation == ROTATION_ANGLE_90 || param->rotation == ROTATION_ANGLE_270) {
445− swap(width, height);
451+ swap(cursor_height, cursor_width);
452+ swap(x_hotspot, y_hotspot);
453+
446454 if (param->rotation == ROTATION_ANGLE_90) {
447− src_x_offset = pos->x - pos->y_hotspot - param->viewport.x;
448− src_y_offset = pos->y - pos->x_hotspot - param->viewport.y;
455+ // hotspot = (-y, x)
456+ src_x_offset = x_pos - (cursor_width - x_hotspot);
457+ src_y_offset = y_pos - y_hotspot;
458+ } else if (param->rotation == ROTATION_ANGLE_270) {
459+ // hotspot = (y, -x)
460+ src_x_offset = x_pos - x_hotspot;
461+ src_y_offset = y_pos - (cursor_height - y_hotspot);
449462 }
450463 } else if (param->rotation == ROTATION_ANGLE_180) {
464+ // hotspot = (-x, -y)
451465 if (!param->mirror)
452− src_x_offset = pos->x - param->viewport.x;
466+ src_x_offset = x_pos - (cursor_width - x_hotspot);
453467
454− src_y_offset = pos->y - param->viewport.y;
468+ src_y_offset = y_pos - (cursor_height - y_hotspot);
455469 }
456470
457471 if (src_x_offset >= (int)param->viewport.width)
458472 cur_en = 0; /* not visible beyond right edge*/
459473
460− if (src_x_offset + (int)width <= 0)
474+ if (src_x_offset + cursor_width <= 0)
461475 cur_en = 0; /* not visible beyond left edge*/
462476
463477 if (src_y_offset >= (int)param->viewport.height)
464478 cur_en = 0; /* not visible beyond bottom edge*/
465479
466− if (src_y_offset + (int)height <= 0)
480+ if (src_y_offset + cursor_height <= 0)
467481 cur_en = 0; /* not visible beyond top edge*/
468482
469483 REG_UPDATE(CURSOR0_CONTROL,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c+19−9
@@ -1179,10 +1179,12 @@ void hubp1_cursor_set_position( · 1178 unmodified lines
11791179 const struct dc_cursor_mi_param *param)
11801180 {
11811181 struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
1182− int src_x_offset = pos->x - pos->x_hotspot - param->viewport.x;
1183− int src_y_offset = pos->y - pos->y_hotspot - param->viewport.y;
1182+ int x_pos = pos->x - param->viewport.x;
1183+ int y_pos = pos->y - param->viewport.y;
11841184 int x_hotspot = pos->x_hotspot;
11851185 int y_hotspot = pos->y_hotspot;
1186+ int src_x_offset = x_pos - pos->x_hotspot;
1187+ int src_y_offset = y_pos - pos->y_hotspot;
11861188 int cursor_height = (int)hubp->curs_attr.height;
11871189 int cursor_width = (int)hubp->curs_attr.width;
11881190 uint32_t dst_x_offset;
@@ -1200,18 +1202,26 @@ void hubp1_cursor_set_position( · 11 unmodified lines
12001202 if (hubp->curs_attr.address.quad_part == 0)
12011203 return;
12021204
1203− // Rotated cursor width/height and hotspots tweaks for offset calculation
1205+ // Transform cursor width / height and hotspots for offset calculations
12041206 if (param->rotation == ROTATION_ANGLE_90 || param->rotation == ROTATION_ANGLE_270) {
12051207 swap(cursor_height, cursor_width);
1208+ swap(x_hotspot, y_hotspot);
1209+
12061210 if (param->rotation == ROTATION_ANGLE_90) {
1207− src_x_offset = pos->x - pos->y_hotspot - param->viewport.x;
1208− src_y_offset = pos->y - pos->x_hotspot - param->viewport.y;
1211+ // hotspot = (-y, x)
1212+ src_x_offset = x_pos - (cursor_width - x_hotspot);
1213+ src_y_offset = y_pos - y_hotspot;
1214+ } else if (param->rotation == ROTATION_ANGLE_270) {
1215+ // hotspot = (y, -x)
1216+ src_x_offset = x_pos - x_hotspot;
1217+ src_y_offset = y_pos - (cursor_height - y_hotspot);
12091218 }
12101219 } else if (param->rotation == ROTATION_ANGLE_180) {
1220+ // hotspot = (-x, -y)
12111221 if (!param->mirror)
1212− src_x_offset = pos->x - param->viewport.x;
1222+ src_x_offset = x_pos - (cursor_width - x_hotspot);
12131223
1214− src_y_offset = pos->y - param->viewport.y;
1224+ src_y_offset = y_pos - (cursor_height - y_hotspot);
12151225 }
12161226
12171227 dst_x_offset = (src_x_offset >= 0) ? src_x_offset : 0;
@@ -1248,8 +1258,8 @@ void hubp1_cursor_set_position( · 30 unmodified lines
12481258 CURSOR_Y_POSITION, pos->y);
12491259
12501260 REG_SET_2(CURSOR_HOT_SPOT, 0,
1251− CURSOR_HOT_SPOT_X, x_hotspot,
1252− CURSOR_HOT_SPOT_Y, y_hotspot);
1261+ CURSOR_HOT_SPOT_X, pos->x_hotspot,
1262+ CURSOR_HOT_SPOT_Y, pos->y_hotspot);
12531263
12541264 REG_SET(CURSOR_DST_OFFSET, 0,
12551265 CURSOR_DST_X_OFFSET, dst_x_offset);
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c+25−11
@@ -623,6 +623,10 @@ void hubp2_cursor_set_attributes( · 622 unmodified lines
623623 hubp->att.size.bits.width = attr->width;
624624 hubp->att.size.bits.height = attr->height;
625625 hubp->att.cur_ctl.bits.mode = attr->color_format;
626+
627+ hubp->cur_rect.w = attr->width;
628+ hubp->cur_rect.h = attr->height;
629+
626630 hubp->att.cur_ctl.bits.pitch = hw_pitch;
627631 hubp->att.cur_ctl.bits.line_per_chunk = lpc;
628632 hubp->att.cur_ctl.bits.cur_2x_magnify = attr->attribute_flags.bits.ENABLE_MAGNIFICATION;
@@ -969,10 +973,12 @@ void hubp2_cursor_set_position( · 340 unmodified lines
969973 const struct dc_cursor_mi_param *param)
970974 {
971975 struct dcn20_hubp *hubp2 = TO_DCN20_HUBP(hubp);
972− int src_x_offset = pos->x - pos->x_hotspot - param->viewport.x;
973− int src_y_offset = pos->y - pos->y_hotspot - param->viewport.y;
976+ int x_pos = pos->x - param->viewport.x;
977+ int y_pos = pos->y - param->viewport.y;
974978 int x_hotspot = pos->x_hotspot;
975979 int y_hotspot = pos->y_hotspot;
980+ int src_x_offset = x_pos - pos->x_hotspot;
981+ int src_y_offset = y_pos - pos->y_hotspot;
976982 int cursor_height = (int)hubp->curs_attr.height;
977983 int cursor_width = (int)hubp->curs_attr.width;
978984 uint32_t dst_x_offset;
@@ -990,18 +996,26 @@ void hubp2_cursor_set_position( · 11 unmodified lines
990996 if (hubp->curs_attr.address.quad_part == 0)
991997 return;
992998
993− // Rotated cursor width/height and hotspots tweaks for offset calculation
999+ // Transform cursor width / height and hotspots for offset calculations
9941000 if (param->rotation == ROTATION_ANGLE_90 || param->rotation == ROTATION_ANGLE_270) {
9951001 swap(cursor_height, cursor_width);
1002+ swap(x_hotspot, y_hotspot);
1003+
9961004 if (param->rotation == ROTATION_ANGLE_90) {
997− src_x_offset = pos->x - pos->y_hotspot - param->viewport.x;
998− src_y_offset = pos->y - pos->x_hotspot - param->viewport.y;
1005+ // hotspot = (-y, x)
1006+ src_x_offset = x_pos - (cursor_width - x_hotspot);
1007+ src_y_offset = y_pos - y_hotspot;
1008+ } else if (param->rotation == ROTATION_ANGLE_270) {
1009+ // hotspot = (y, -x)
1010+ src_x_offset = x_pos - x_hotspot;
1011+ src_y_offset = y_pos - (cursor_height - y_hotspot);
9991012 }
10001013 } else if (param->rotation == ROTATION_ANGLE_180) {
1014+ // hotspot = (-x, -y)
10011015 if (!param->mirror)
1002− src_x_offset = pos->x - param->viewport.x;
1016+ src_x_offset = x_pos - (cursor_width - x_hotspot);
10031017
1004− src_y_offset = pos->y - param->viewport.y;
1018+ src_y_offset = y_pos - (cursor_height - y_hotspot);
10051019 }
10061020
10071021 dst_x_offset = (src_x_offset >= 0) ? src_x_offset : 0;
@@ -1038,8 +1052,8 @@ void hubp2_cursor_set_position( · 30 unmodified lines
10381052 CURSOR_Y_POSITION, pos->y);
10391053
10401054 REG_SET_2(CURSOR_HOT_SPOT, 0,
1041− CURSOR_HOT_SPOT_X, x_hotspot,
1042− CURSOR_HOT_SPOT_Y, y_hotspot);
1055+ CURSOR_HOT_SPOT_X, pos->x_hotspot,
1056+ CURSOR_HOT_SPOT_Y, pos->y_hotspot);
10431057
10441058 REG_SET(CURSOR_DST_OFFSET, 0,
10451059 CURSOR_DST_X_OFFSET, dst_x_offset);
@@ -1048,8 +1062,8 @@ void hubp2_cursor_set_position( · 2 unmodified lines
10481062 hubp->pos.cur_ctl.bits.cur_enable = cur_en;
10491063 hubp->pos.position.bits.x_pos = pos->x;
10501064 hubp->pos.position.bits.y_pos = pos->y;
1051− hubp->pos.hot_spot.bits.x_hot = x_hotspot;
1052− hubp->pos.hot_spot.bits.y_hot = y_hotspot;
1065+ hubp->pos.hot_spot.bits.x_hot = pos->x_hotspot;
1066+ hubp->pos.hot_spot.bits.y_hot = pos->y_hotspot;
10531067 hubp->pos.dst_offset.bits.dst_x_offset = dst_x_offset;
10541068 /* Cursor Rectangle Cache
10551069 * Cursor bitmaps have different hotspot values
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubp.c+1−0
@@ -87,6 +87,7 @@ static struct hubp_funcs dcn31_hubp_funcs = { · 86 unmodified lines
8787 .hubp_init = hubp3_init,
8888 .set_unbounded_requesting = hubp31_set_unbounded_requesting,
8989 .hubp_soft_reset = hubp31_soft_reset,
90+ .hubp_set_flip_int = hubp1_set_flip_int,
9091 .hubp_in_blank = hubp1_in_blank,
9192 .program_extended_blank = hubp31_program_extended_blank,
9293 };
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c+7−0
@@ -96,6 +96,13 @@ static void dccg314_set_pixel_rate_div( · 95 unmodified lines
9696 struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
9797 enum pixel_rate_div cur_k1 = PIXEL_RATE_DIV_NA, cur_k2 = PIXEL_RATE_DIV_NA;
9898
99+ // Don't program 0xF into the register field. Not valid since
100+ // K1 / K2 field is only 1 / 2 bits wide
101+ if (k1 == PIXEL_RATE_DIV_NA || k2 == PIXEL_RATE_DIV_NA) {
102+ BREAK_TO_DEBUGGER();
103+ return;
104+ }
105+
99106 dccg314_get_pixel_rate_div(dccg, otg_inst, &cur_k1, &cur_k2);
100107 if (k1 == PIXEL_RATE_DIV_NA || k2 == PIXEL_RATE_DIV_NA || (k1 == cur_k1 && k2 == cur_k2))
101108 return;
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dio_stream_encoder.c+18−6
@@ -49,18 +49,30 @@ · 48 unmodified lines
4949 #define CTX \
5050 enc1->base.ctx
5151
52+static void enc314_reset_fifo(struct stream_encoder *enc, bool reset)
53+{
54+ struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc);
55+ uint32_t reset_val = reset ? 1 : 0;
56+ uint32_t is_symclk_on;
57+
58+ REG_UPDATE(DIG_FIFO_CTRL0, DIG_FIFO_RESET, reset_val);
59+ REG_GET(DIG_FE_CNTL, DIG_SYMCLK_FE_ON, &is_symclk_on);
60+
61+ if (is_symclk_on)
62+ REG_WAIT(DIG_FIFO_CTRL0, DIG_FIFO_RESET_DONE, reset_val, 10, 5000);
63+ else
64+ udelay(10);
65+}
5266
5367 static void enc314_enable_fifo(struct stream_encoder *enc)
5468 {
5569 struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc);
5670
57− /* TODO: Confirm if we need to wait for DIG_SYMCLK_FE_ON */
58− REG_WAIT(DIG_FE_CNTL, DIG_SYMCLK_FE_ON, 1, 10, 5000);
5971 REG_UPDATE(DIG_FIFO_CTRL0, DIG_FIFO_READ_START_LEVEL, 0x7);
60− REG_UPDATE(DIG_FIFO_CTRL0, DIG_FIFO_RESET, 1);
61− REG_WAIT(DIG_FIFO_CTRL0, DIG_FIFO_RESET_DONE, 1, 10, 5000);
62− REG_UPDATE(DIG_FIFO_CTRL0, DIG_FIFO_RESET, 0);
63− REG_WAIT(DIG_FIFO_CTRL0, DIG_FIFO_RESET_DONE, 0, 10, 5000);
72+
73+ enc314_reset_fifo(enc, true);
74+ enc314_reset_fifo(enc, false);
75+
6476 REG_UPDATE(DIG_FIFO_CTRL0, DIG_FIFO_ENABLE, 1);
6577 }
6678
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_hwseq.c+2−4
@@ -348,10 +348,8 @@ unsigned int dcn314_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsig · 347 unmodified lines
348348 two_pix_per_container = optc2_is_two_pixels_per_containter(&stream->timing);
349349 odm_combine_factor = get_odm_config(pipe_ctx, NULL);
350350
351− if (pipe_ctx->stream->signal == SIGNAL_TYPE_VIRTUAL)
352− return odm_combine_factor;
353−
354351 if (is_dp_128b_132b_signal(pipe_ctx)) {
352+ *k1_div = PIXEL_RATE_DIV_BY_1;
355353 *k2_div = PIXEL_RATE_DIV_BY_1;
356354 } else if (dc_is_hdmi_tmds_signal(pipe_ctx->stream->signal) || dc_is_dvi_signal(pipe_ctx->stream->signal)) {
357355 *k1_div = PIXEL_RATE_DIV_BY_1;
@@ -359,7 +357,7 @@ unsigned int dcn314_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsig · 1 unmodified line
359357 *k2_div = PIXEL_RATE_DIV_BY_2;
360358 else
361359 *k2_div = PIXEL_RATE_DIV_BY_4;
362− } else if (dc_is_dp_signal(pipe_ctx->stream->signal)) {
360+ } else if (dc_is_dp_signal(pipe_ctx->stream->signal) || dc_is_virtual_signal(pipe_ctx->stream->signal)) {
363361 if (two_pix_per_container) {
364362 *k1_div = PIXEL_RATE_DIV_BY_1;
365363 *k2_div = PIXEL_RATE_DIV_BY_2;
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_optc.c+1−1
@@ -237,7 +237,7 @@ static struct timing_generator_funcs dcn314_tg_funcs = { · 236 unmodified lines
237237 .clear_optc_underflow = optc1_clear_optc_underflow,
238238 .setup_global_swap_lock = NULL,
239239 .get_crc = optc1_get_crc,
240− .configure_crc = optc2_configure_crc,
240+ .configure_crc = optc1_configure_crc,
241241 .set_dsc_config = optc3_set_dsc_config,
242242 .get_dsc_status = optc2_get_dsc_status,
243243 .set_dwb_source = NULL,
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c+1−1
@@ -847,7 +847,7 @@ static const struct resource_caps res_cap_dcn314 = { · 846 unmodified lines
847847 .num_ddc = 5,
848848 .num_vmid = 16,
849849 .num_mpc_3dlut = 2,
850− .num_dsc = 3,
850+ .num_dsc = 4,
851851 };
852852
853853 static const struct dc_plane_cap plane_cap = {
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c+3−1
@@ -96,8 +96,10 @@ static void dccg32_set_pixel_rate_div( · 95 unmodified lines
9696
9797 // Don't program 0xF into the register field. Not valid since
9898 // K1 / K2 field is only 1 / 2 bits wide
99− if (k1 == PIXEL_RATE_DIV_NA || k2 == PIXEL_RATE_DIV_NA)
99+ if (k1 == PIXEL_RATE_DIV_NA || k2 == PIXEL_RATE_DIV_NA) {
100+ BREAK_TO_DEBUGGER();
100101 return;
102+ }
101103
102104 dccg32_get_pixel_rate_div(dccg, otg_inst, &cur_k1, &cur_k2);
103105 if (k1 == cur_k1 && k2 == cur_k2)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c+6−12
@@ -283,8 +283,7 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc *dc, struct dc_state *c · 282 unmodified lines
283283 using the max for calculation */
284284
285285 if (hubp->curs_attr.width > 0) {
286− // Round cursor width to next multiple of 64
287− cursor_size = (((hubp->curs_attr.width + 63) / 64) * 64) * hubp->curs_attr.height;
286+ cursor_size = hubp->curs_attr.pitch * hubp->curs_attr.height;
288287
289288 switch (pipe->stream->cursor_attributes.color_format) {
290289 case CURSOR_MODE_MONO:
@@ -309,9 +308,9 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc *dc, struct dc_state *c · 18 unmodified lines
309308 cursor_size > 16384) {
310309 /* cursor_num_mblk = CEILING(num_cursors*cursor_width*cursor_width*cursor_Bpe/mblk_bytes, 1)
311310 */
312− cache_lines_used += (((hubp->curs_attr.width * hubp->curs_attr.height * cursor_bpp +
313− DCN3_2_MALL_MBLK_SIZE_BYTES - 1) / DCN3_2_MALL_MBLK_SIZE_BYTES) *
314− DCN3_2_MALL_MBLK_SIZE_BYTES) / dc->caps.cache_line_size + 2;
311+ cache_lines_used += (((cursor_size + DCN3_2_MALL_MBLK_SIZE_BYTES - 1) /
312+ DCN3_2_MALL_MBLK_SIZE_BYTES) * DCN3_2_MALL_MBLK_SIZE_BYTES) /
313+ dc->caps.cache_line_size + 2;
315314 }
316315 break;
317316 }
@@ -727,10 +726,7 @@ void dcn32_update_mall_sel(struct dc *dc, struct dc_state *context) · 409 unmodified lines
727726 struct hubp *hubp = pipe->plane_res.hubp;
728727
729728 if (pipe->stream && pipe->plane_state && hubp && hubp->funcs->hubp_update_mall_sel) {
730− //Round cursor width up to next multiple of 64
731− int cursor_width = ((hubp->curs_attr.width + 63) / 64) * 64;
732− int cursor_height = hubp->curs_attr.height;
733− int cursor_size = cursor_width * cursor_height;
729+ int cursor_size = hubp->curs_attr.pitch * hubp->curs_attr.height;
734730
735731 switch (hubp->curs_attr.color_format) {
736732 case CURSOR_MODE_MONO:
@@ -1175,10 +1171,8 @@ unsigned int dcn32_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsign · 438 unmodified lines
11751171 two_pix_per_container = optc2_is_two_pixels_per_containter(&stream->timing);
11761172 odm_combine_factor = get_odm_config(pipe_ctx, NULL);
11771173
1178− if (pipe_ctx->stream->signal == SIGNAL_TYPE_VIRTUAL)
1179− return odm_combine_factor;
1180−
11811174 if (is_dp_128b_132b_signal(pipe_ctx)) {
1175+ *k1_div = PIXEL_RATE_DIV_BY_1;
11821176 *k2_div = PIXEL_RATE_DIV_BY_1;
11831177 } else if (dc_is_hdmi_tmds_signal(pipe_ctx->stream->signal) || dc_is_dvi_signal(pipe_ctx->stream->signal)) {
11841178 *k1_div = PIXEL_RATE_DIV_BY_1;
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c+1−0
@@ -724,6 +724,7 @@ static const struct dc_debug_options debug_defaults_drv = { · 723 unmodified lines
724724 .enable_dp_dig_pixel_rate_div_policy = 1,
725725 .allow_sw_cursor_fallback = false,
726726 .alloc_extra_way_for_cursor = true,
727+ .min_prefetch_in_strobe_ns = 60000, // 60us
727728 };
728729
729730 static const struct dc_debug_options debug_defaults_diags = {
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c+1−1
@@ -111,7 +111,7 @@ uint32_t dcn32_helper_calculate_num_ways_for_subvp(struct dc *dc, struct dc_stat · 110 unmodified lines
111111 mall_alloc_width_blk_aligned = full_vp_width_blk_aligned;
112112
113113 /* mall_alloc_height_blk_aligned_l/c = CEILING(sub_vp_height_l/c - 1, blk_height_l/c) + blk_height_l/c */
114− mall_alloc_height_blk_aligned = (pipe->stream->timing.v_addressable - 1 + mblk_height - 1) /
114+ mall_alloc_height_blk_aligned = (pipe->plane_res.scl_data.viewport.height - 1 + mblk_height - 1) /
115115 mblk_height * mblk_height + mblk_height;
116116
117117 /* full_mblk_width_ub_l/c = mall_alloc_width_blk_aligned_l/c;
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c+1−0
@@ -722,6 +722,7 @@ static const struct dc_debug_options debug_defaults_drv = { · 721 unmodified lines
722722 .enable_dp_dig_pixel_rate_div_policy = 1,
723723 .allow_sw_cursor_fallback = false,
724724 .alloc_extra_way_for_cursor = true,
725+ .min_prefetch_in_strobe_ns = 60000, // 60us
725726 };
726727
727728 static const struct dc_debug_options debug_defaults_diags = {
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c+1−0
@@ -1228,6 +1228,7 @@ int dcn20_populate_dml_pipes_from_context( · 1227 unmodified lines
12281228 pipes[pipe_cnt].pipe.src.dcc = false;
12291229 pipes[pipe_cnt].pipe.src.dcc_rate = 1;
12301230 pipes[pipe_cnt].pipe.dest.synchronized_vblank_all_planes = synchronized_vblank;
1231+ pipes[pipe_cnt].pipe.dest.synchronize_timings = synchronized_vblank;
12311232 pipes[pipe_cnt].pipe.dest.hblank_start = timing->h_total - timing->h_front_porch;
12321233 pipes[pipe_cnt].pipe.dest.hblank_end = pipes[pipe_cnt].pipe.dest.hblank_start
12331234 - timing->h_addressable
drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c+2−2
@@ -146,8 +146,8 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_14_soc = { · 145 unmodified lines
146146 },
147147 },
148148 .num_states = 5,
149− .sr_exit_time_us = 9.0,
150− .sr_enter_plus_exit_time_us = 11.0,
149+ .sr_exit_time_us = 16.5,
150+ .sr_enter_plus_exit_time_us = 18.5,
151151 .sr_exit_z8_time_us = 442.0,
152152 .sr_enter_plus_exit_z8_time_us = 560.0,
153153 .writeback_latency_us = 12.0,
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c+24−6
@@ -157,7 +157,7 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_2_soc = { · 156 unmodified lines
157157 .dispclk_dppclk_vco_speed_mhz = 4300.0,
158158 .do_urgent_latency_adjustment = true,
159159 .urgent_latency_adjustment_fabric_clock_component_us = 1.0,
160− .urgent_latency_adjustment_fabric_clock_reference_mhz = 1000,
160+ .urgent_latency_adjustment_fabric_clock_reference_mhz = 3000,
161161 };
162162
163163 void dcn32_build_wm_range_table_fpu(struct clk_mgr_internal *clk_mgr)
@@ -211,7 +211,7 @@ void dcn32_build_wm_range_table_fpu(struct clk_mgr_internal *clk_mgr) · 47 unmodified lines
211211 /* 'DalDummyClockChangeLatencyNs' registry key option set to 0x7FFFFFFF can be used to disable Set C for dummy p-state */
212212 if (clk_mgr->base.ctx->dc->bb_overrides.dummy_clock_change_latency_ns != 0x7FFFFFFF) {
213213 clk_mgr->base.bw_params->wm_table.nv_entries[WM_C].valid = true;
214− clk_mgr->base.bw_params->wm_table.nv_entries[WM_C].dml_input.pstate_latency_us = 38;
214+ clk_mgr->base.bw_params->wm_table.nv_entries[WM_C].dml_input.pstate_latency_us = 50;
215215 clk_mgr->base.bw_params->wm_table.nv_entries[WM_C].dml_input.fclk_change_latency_us = fclk_change_latency_us;
216216 clk_mgr->base.bw_params->wm_table.nv_entries[WM_C].dml_input.sr_exit_time_us = sr_exit_time_us;
217217 clk_mgr->base.bw_params->wm_table.nv_entries[WM_C].dml_input.sr_enter_plus_exit_time_us = sr_enter_plus_exit_time_us;
@@ -221,7 +221,7 @@ void dcn32_build_wm_range_table_fpu(struct clk_mgr_internal *clk_mgr) · 3 unmodified lines
221221 clk_mgr->base.bw_params->wm_table.nv_entries[WM_C].pmfw_breakdown.min_uclk = min_uclk_mhz;
222222 clk_mgr->base.bw_params->wm_table.nv_entries[WM_C].pmfw_breakdown.max_uclk = 0xFFFF;
223223 clk_mgr->base.bw_params->dummy_pstate_table[0].dram_speed_mts = clk_mgr->base.bw_params->clk_table.entries[0].memclk_mhz * 16;
224− clk_mgr->base.bw_params->dummy_pstate_table[0].dummy_pstate_latency_us = 38;
224+ clk_mgr->base.bw_params->dummy_pstate_table[0].dummy_pstate_latency_us = 50;
225225 clk_mgr->base.bw_params->dummy_pstate_table[1].dram_speed_mts = clk_mgr->base.bw_params->clk_table.entries[1].memclk_mhz * 16;
226226 clk_mgr->base.bw_params->dummy_pstate_table[1].dummy_pstate_latency_us = 9;
227227 clk_mgr->base.bw_params->dummy_pstate_table[2].dram_speed_mts = clk_mgr->base.bw_params->clk_table.entries[2].memclk_mhz * 16;
@@ -1803,6 +1803,12 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context, · 1575 unmodified lines
18031803 */
18041804 context->bw_ctx.dml.soc.dram_clock_change_latency_us =
18051805 dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.pstate_latency_us;
1806+ /* For DCN32/321 need to validate with fclk pstate change latency equal to dummy so
1807+ * prefetch is scheduled correctly to account for dummy pstate.
1808+ */
1809+ if (dummy_latency_index == 0)
1810+ context->bw_ctx.dml.soc.fclk_change_latency_us =
1811+ dc->clk_mgr->bw_params->dummy_pstate_table[dummy_latency_index].dummy_pstate_latency_us;
18061812 dcn32_internal_validate_bw(dc, context, pipes, &pipe_cnt, &vlevel, false);
18071813 maxMpcComb = context->bw_ctx.dml.vba.maxMpcComb;
18081814 dcfclk_from_fw_based_mclk_switching = context->bw_ctx.dml.vba.DCFCLKState[vlevel][context->bw_ctx.dml.vba.maxMpcComb];
@@ -1904,7 +1910,7 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context, · 95 unmodified lines
19041910
19051911 if (context->bw_ctx.dml.vba.DRAMClockChangeSupport[vlevel][maxMpcComb] ==
19061912 dm_dram_clock_change_unsupported) {
1907− int min_dram_speed_mts_offset = dc->clk_mgr->bw_params->clk_table.num_entries - 1;
1913+ int min_dram_speed_mts_offset = dc->clk_mgr->bw_params->clk_table.num_entries_per_clk.num_memclk_levels - 1;
19081914
19091915 min_dram_speed_mts =
19101916 dc->clk_mgr->bw_params->clk_table.entries[min_dram_speed_mts_offset].memclk_mhz * 16;
@@ -1990,6 +1996,10 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context, · 79 unmodified lines
19901996
19911997 context->perf_params.stutter_period_us = context->bw_ctx.dml.vba.StutterPeriod;
19921998
1999+ if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching && dummy_latency_index == 0)
2000+ context->bw_ctx.dml.soc.fclk_change_latency_us =
2001+ dc->clk_mgr->bw_params->dummy_pstate_table[dummy_latency_index].dummy_pstate_latency_us;
2002+
19932003 dcn32_calculate_dlg_params(dc, context, pipes, pipe_cnt, vlevel);
19942004
19952005 if (!pstate_en)
@@ -1997,8 +2007,12 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context, · 1 unmodified line
19972007 context->bw_ctx.dml.soc.dram_clock_change_latency_us =
19982008 dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.pstate_latency_us;
19992009
2000− if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching)
2010+ if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching) {
20012011 dcn30_setup_mclk_switch_using_fw_based_vblank_stretch(dc, context);
2012+ if (dummy_latency_index == 0)
2013+ context->bw_ctx.dml.soc.fclk_change_latency_us =
2014+ dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.fclk_change_latency_us;
2015+ }
20022016 }
20032017
20042018 static void dcn32_get_optimal_dcfclk_fclk_for_uclk(unsigned int uclk_mts,
@@ -2359,9 +2373,13 @@ void dcn32_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_pa · 354 unmodified lines
23592373
23602374 if (dc->ctx->dc_bios->vram_info.dram_channel_width_bytes)
23612375 dcn3_2_soc.dram_channel_width_bytes = dc->ctx->dc_bios->vram_info.dram_channel_width_bytes;
2362−
23632376 }
23642377
2378+ /* DML DSC delay factor workaround */
2379+ dcn3_2_ip.dsc_delay_factor_wa = dc->debug.dsc_delay_factor_wa_x1000 / 1000.0;
2380+
2381+ dcn3_2_ip.min_prefetch_in_strobe_us = dc->debug.min_prefetch_in_strobe_ns / 1000.0;
2382+
23652383 /* Override dispclk_dppclk_vco_speed_mhz from Clk Mgr */
23662384 dcn3_2_soc.dispclk_dppclk_vco_speed_mhz = dc->clk_mgr->dentist_vco_freq_khz / 1000.0;
23672385 dc->dml.soc.dispclk_dppclk_vco_speed_mhz = dc->clk_mgr->dentist_vco_freq_khz / 1000.0;
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c+13−4
@@ -364,10 +364,11 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman · 363 unmodified lines
364364 for (k = 0; k < mode_lib->vba.NumberOfActiveSurfaces; ++k) {
365365 v->DSCDelay[k] = dml32_DSCDelayRequirement(mode_lib->vba.DSCEnabled[k],
366366 mode_lib->vba.ODMCombineEnabled[k], mode_lib->vba.DSCInputBitPerComponent[k],
367− mode_lib->vba.OutputBpp[k], mode_lib->vba.HActive[k], mode_lib->vba.HTotal[k],
367+ mode_lib->vba.OutputBppPerState[mode_lib->vba.VoltageLevel][k],
368+ mode_lib->vba.HActive[k], mode_lib->vba.HTotal[k],
368369 mode_lib->vba.NumberOfDSCSlices[k], mode_lib->vba.OutputFormat[k],
369370 mode_lib->vba.Output[k], mode_lib->vba.PixelClock[k],
370− mode_lib->vba.PixelClockBackEnd[k]);
371+ mode_lib->vba.PixelClockBackEnd[k], mode_lib->vba.ip.dsc_delay_factor_wa);
371372 }
372373
373374 for (k = 0; k < mode_lib->vba.NumberOfActiveSurfaces; ++k)
@@ -717,6 +718,8 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman · 343 unmodified lines
717718
718719 do {
719720 MaxTotalRDBandwidth = 0;
721+ DestinationLineTimesForPrefetchLessThan2 = false;
722+ VRatioPrefetchMoreThanMax = false;
720723 #ifdef __DML_VBA_DEBUG__
721724 dml_print("DML::%s: Start loop: VStartup = %d\n", __func__, mode_lib->vba.VStartupLines);
722725 #endif
@@ -785,6 +788,8 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman · 62 unmodified lines
785788 v->SwathHeightY[k],
786789 v->SwathHeightC[k],
787790 TWait,
791+ v->DRAMSpeedPerState[mode_lib->vba.VoltageLevel] <= MEM_STROBE_FREQ_MHZ ?
792+ mode_lib->vba.ip.min_prefetch_in_strobe_us : 0,
788793 /* Output */
789794 &v->DSTXAfterScaler[k],
790795 &v->DSTYAfterScaler[k],
@@ -1627,7 +1632,7 @@ static void mode_support_configuration(struct vba_vars_st *v, · 836 unmodified lines
16271632 && !mode_lib->vba.MSOOrODMSplitWithNonDPLink
16281633 && !mode_lib->vba.NotEnoughLanesForMSO
16291634 && mode_lib->vba.LinkCapacitySupport[i] == true && !mode_lib->vba.P2IWith420
1630− && !mode_lib->vba.DSCOnlyIfNecessaryWithBPP
1635+ //&& !mode_lib->vba.DSCOnlyIfNecessaryWithBPP
16311636 && !mode_lib->vba.DSC422NativeNotSupported
16321637 && !mode_lib->vba.MPCCombineMethodIncompatible
16331638 && mode_lib->vba.ODMCombine2To1SupportCheckOK[i] == true
@@ -2475,7 +2480,8 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 841 unmodified lines
24752480 mode_lib->vba.OutputBppPerState[i][k], mode_lib->vba.HActive[k],
24762481 mode_lib->vba.HTotal[k], mode_lib->vba.NumberOfDSCSlices[k],
24772482 mode_lib->vba.OutputFormat[k], mode_lib->vba.Output[k],
2478− mode_lib->vba.PixelClock[k], mode_lib->vba.PixelClockBackEnd[k]);
2483+ mode_lib->vba.PixelClock[k], mode_lib->vba.PixelClockBackEnd[k],
2484+ mode_lib->vba.ip.dsc_delay_factor_wa);
24792485 }
24802486
24812487 for (k = 0; k <= mode_lib->vba.NumberOfActiveSurfaces - 1; k++) {
@@ -3190,6 +3196,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 708 unmodified lines
31903196 mode_lib->vba.FCLKChangeLatency, mode_lib->vba.UrgLatency[i],
31913197 mode_lib->vba.SREnterPlusExitTime);
31923198
3199+ memset(&v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull, 0, sizeof(DmlPipe));
31933200 v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.myPipe.Dppclk = mode_lib->vba.RequiredDPPCLK[i][j][k];
31943201 v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.myPipe.Dispclk = mode_lib->vba.RequiredDISPCLK[i][j];
31953202 v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.myPipe.PixelClock = mode_lib->vba.PixelClock[k];
@@ -3242,6 +3249,8 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 46 unmodified lines
32423249 v->swath_width_chroma_ub_this_state[k],
32433250 v->SwathHeightYThisState[k],
32443251 v->SwathHeightCThisState[k], v->TWait,
3252+ v->DRAMSpeedPerState[i] <= MEM_STROBE_FREQ_MHZ ?
3253+ mode_lib->vba.ip.min_prefetch_in_strobe_us : 0,
32453254
32463255 /* Output */
32473256 &v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.DSTXAfterScaler[k],
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.h+5−0
@@ -46,9 +46,14 @@ · 45 unmodified lines
4646 // Prefetch schedule max vratio
4747 #define __DML_MAX_VRATIO_PRE__ 4.0
4848
49+#define __DML_VBA_MAX_DST_Y_PRE__ 63.75
50+
4951 #define BPP_INVALID 0
5052 #define BPP_BLENDED_PIPE 0xffffffff
5153
54+#define MEM_STROBE_FREQ_MHZ 1600
55+#define MEM_STROBE_MAX_DELIVERY_TIME_US 60.0
56+
5257 struct display_mode_lib;
5358
5459 void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib);
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c+14−6
@@ -1726,7 +1726,8 @@ unsigned int dml32_DSCDelayRequirement(bool DSCEnabled, · 1725 unmodified lines
17261726 enum output_format_class OutputFormat,
17271727 enum output_encoder_class Output,
17281728 double PixelClock,
1729− double PixelClockBackEnd)
1729+ double PixelClockBackEnd,
1730+ double dsc_delay_factor_wa)
17301731 {
17311732 unsigned int DSCDelayRequirement_val;
17321733
@@ -1746,7 +1747,7 @@ unsigned int dml32_DSCDelayRequirement(bool DSCEnabled, · 13 unmodified lines
17461747 }
17471748
17481749 DSCDelayRequirement_val = DSCDelayRequirement_val + (HTotal - HActive) *
1749− dml_ceil(DSCDelayRequirement_val / HActive, 1);
1750+ dml_ceil((double)DSCDelayRequirement_val / HActive, 1);
17501751
17511752 DSCDelayRequirement_val = DSCDelayRequirement_val * PixelClock / PixelClockBackEnd;
17521753
@@ -1764,7 +1765,7 @@ unsigned int dml32_DSCDelayRequirement(bool DSCEnabled, · 11 unmodified lines
17641765 dml_print("DML::%s: DSCDelayRequirement_val = %d\n", __func__, DSCDelayRequirement_val);
17651766 #endif
17661767
1767− return DSCDelayRequirement_val;
1768+ return dml_ceil(DSCDelayRequirement_val * dsc_delay_factor_wa, 1);
17681769 }
17691770
17701771 void dml32_CalculateSurfaceSizeInMall(
@@ -3416,6 +3417,7 @@ bool dml32_CalculatePrefetchSchedule( · 1645 unmodified lines
34163417 unsigned int SwathHeightY,
34173418 unsigned int SwathHeightC,
34183419 double TWait,
3420+ double TPreReq,
34193421 /* Output */
34203422 double *DSTXAfterScaler,
34213423 double *DSTYAfterScaler,
@@ -3666,6 +3668,7 @@ bool dml32_CalculatePrefetchSchedule( · 244 unmodified lines
36663668 dst_y_prefetch_equ = VStartup - (*TSetup + dml_max(TWait + TCalc, *Tdmdl)) / LineTime -
36673669 (*DSTYAfterScaler + (double) *DSTXAfterScaler / (double) myPipe->HTotal);
36683670
3671+ dst_y_prefetch_equ = dml_min(dst_y_prefetch_equ, __DML_VBA_MAX_DST_Y_PRE__);
36693672 #ifdef __DML_VBA_DEBUG__
36703673 dml_print("DML::%s: HTotal = %d\n", __func__, myPipe->HTotal);
36713674 dml_print("DML::%s: min_Lsw = %f\n", __func__, min_Lsw);
@@ -3725,7 +3728,8 @@ bool dml32_CalculatePrefetchSchedule( · 53 unmodified lines
37253728 *VRatioPrefetchY = 0;
37263729 *VRatioPrefetchC = 0;
37273730 *RequiredPrefetchPixDataBWLuma = 0;
3728− if (dst_y_prefetch_equ > 1) {
3731+ if (dst_y_prefetch_equ > 1 &&
3732+ (Tpre_rounded >= TPreReq || dst_y_prefetch_equ == __DML_VBA_MAX_DST_Y_PRE__)) {
37293733 double PrefetchBandwidth1;
37303734 double PrefetchBandwidth2;
37313735 double PrefetchBandwidth3;
@@ -3871,7 +3875,11 @@ bool dml32_CalculatePrefetchSchedule( · 139 unmodified lines
38713875 }
38723876
38733877 if (dst_y_prefetch_oto < dst_y_prefetch_equ) {
3874− *DestinationLinesForPrefetch = dst_y_prefetch_oto;
3878+ if (dst_y_prefetch_oto * LineTime < TPreReq) {
3879+ *DestinationLinesForPrefetch = dst_y_prefetch_equ;
3880+ } else {
3881+ *DestinationLinesForPrefetch = dst_y_prefetch_oto;
3882+ }
38753883 TimeForFetchingMetaPTE = Tvm_oto;
38763884 TimeForFetchingRowInVBlank = Tr0_oto;
38773885 *PrefetchBandwidth = prefetch_bw_oto;
@@ -4396,7 +4404,7 @@ void dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport( · 518 unmodified lines
43964404
43974405 if (v->NumberOfActiveSurfaces > 1) {
43984406 ActiveClockChangeLatencyHidingY = ActiveClockChangeLatencyHidingY
4399− - (1 - 1 / v->NumberOfActiveSurfaces) * SwathHeightY[k] * v->HTotal[k]
4407+ - (1.0 - 1.0 / v->NumberOfActiveSurfaces) * SwathHeightY[k] * v->HTotal[k]
44004408 / v->PixelClock[k] / v->VRatio[k];
44014409 }
44024410
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.h+4−2
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 #include "os_types.h"
3131 #include "../dc_features.h"
3232 #include "../display_mode_structs.h"
33−#include "dml/display_mode_vba.h"
33+#include "../display_mode_vba.h"
3434
3535 unsigned int dml32_dscceComputeDelay(
3636 unsigned int bpc,
@@ -327,7 +327,8 @@ unsigned int dml32_DSCDelayRequirement(bool DSCEnabled, · 290 unmodified lines
327327 enum output_format_class OutputFormat,
328328 enum output_encoder_class Output,
329329 double PixelClock,
330− double PixelClockBackEnd);
330+ double PixelClockBackEnd,
331+ double dsc_delay_factor_wa);
331332
332333 void dml32_CalculateSurfaceSizeInMall(
333334 unsigned int NumberOfActiveSurfaces,
@@ -742,6 +743,7 @@ bool dml32_CalculatePrefetchSchedule( · 408 unmodified lines
742743 unsigned int SwathHeightY,
743744 unsigned int SwathHeightC,
744745 double TWait,
746+ double TPreReq,
745747 /* Output */
746748 double *DSTXAfterScaler,
747749 double *DSTYAfterScaler,
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_rq_dlg_calc_32.c+2−2
@@ -291,8 +291,8 @@ void dml32_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib, · 290 unmodified lines
291291
292292 dml_print("DML_DLG: %s: vready_after_vcount0 = %d\n", __func__, dlg_regs->vready_after_vcount0);
293293
294− dst_x_after_scaler = get_dst_x_after_scaler(mode_lib, e2e_pipe_param, num_pipes, pipe_idx);
295− dst_y_after_scaler = get_dst_y_after_scaler(mode_lib, e2e_pipe_param, num_pipes, pipe_idx);
294+ dst_x_after_scaler = dml_ceil(get_dst_x_after_scaler(mode_lib, e2e_pipe_param, num_pipes, pipe_idx), 1);
295+ dst_y_after_scaler = dml_ceil(get_dst_y_after_scaler(mode_lib, e2e_pipe_param, num_pipes, pipe_idx), 1);
296296
297297 // do some adjustment on the dst_after scaler to account for odm combine mode
298298 dml_print("DML_DLG: %s: input dst_x_after_scaler = %d\n", __func__, dst_x_after_scaler);
drivers/gpu/drm/amd/display/dc/dml/dcn321/dcn321_fpu.c+12−7
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include "dcn321_fpu.h"
3030 #include "dcn32/dcn32_resource.h"
3131 #include "dcn321/dcn321_resource.h"
32+#include "dml/dcn32/display_mode_vba_util_32.h"
3233
3334 #define DCN3_2_DEFAULT_DET_SIZE 256
3435
@@ -119,15 +120,15 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_21_soc = { · 84 unmodified lines
119120 },
120121 },
121122 .num_states = 1,
122− .sr_exit_time_us = 12.36,
123− .sr_enter_plus_exit_time_us = 16.72,
123+ .sr_exit_time_us = 19.95,
124+ .sr_enter_plus_exit_time_us = 24.36,
124125 .sr_exit_z8_time_us = 285.0,
125126 .sr_enter_plus_exit_z8_time_us = 320,
126127 .writeback_latency_us = 12.0,
127128 .round_trip_ping_latency_dcfclk_cycles = 263,
128− .urgent_latency_pixel_data_only_us = 4.0,
129− .urgent_latency_pixel_mixed_with_vm_data_us = 4.0,
130− .urgent_latency_vm_data_only_us = 4.0,
129+ .urgent_latency_pixel_data_only_us = 4,
130+ .urgent_latency_pixel_mixed_with_vm_data_us = 4,
131+ .urgent_latency_vm_data_only_us = 4,
131132 .fclk_change_latency_us = 20,
132133 .usr_retraining_latency_us = 2,
133134 .smn_latency_us = 2,
@@ -155,7 +156,7 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_21_soc = { · 21 unmodified lines
155156 .dispclk_dppclk_vco_speed_mhz = 4300.0,
156157 .do_urgent_latency_adjustment = true,
157158 .urgent_latency_adjustment_fabric_clock_component_us = 1.0,
158− .urgent_latency_adjustment_fabric_clock_reference_mhz = 1000,
159+ .urgent_latency_adjustment_fabric_clock_reference_mhz = 3000,
159160 };
160161
161162 static void get_optimal_ntuple(struct _vcs_dpi_voltage_scaling_st *entry)
@@ -538,9 +539,13 @@ void dcn321_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_p · 376 unmodified lines
538539
539540 if (dc->ctx->dc_bios->vram_info.dram_channel_width_bytes)
540541 dcn3_21_soc.dram_channel_width_bytes = dc->ctx->dc_bios->vram_info.dram_channel_width_bytes;
541−
542542 }
543543
544+ /* DML DSC delay factor workaround */
545+ dcn3_21_ip.dsc_delay_factor_wa = dc->debug.dsc_delay_factor_wa_x1000 / 1000.0;
546+
547+ dcn3_21_ip.min_prefetch_in_strobe_us = dc->debug.min_prefetch_in_strobe_ns / 1000.0;
548+
544549 /* Override dispclk_dppclk_vco_speed_mhz from Clk Mgr */
545550 dcn3_21_soc.dispclk_dppclk_vco_speed_mhz = dc->clk_mgr->dentist_vco_freq_khz / 1000.0;
546551 dc->dml.soc.dispclk_dppclk_vco_speed_mhz = dc->clk_mgr->dentist_vco_freq_khz / 1000.0;
drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h+4−0
@@ -364,6 +364,10 @@ struct _vcs_dpi_ip_params_st { · 363 unmodified lines
364364 unsigned int max_num_dp2p0_outputs;
365365 unsigned int max_num_dp2p0_streams;
366366 unsigned int VBlankNomDefaultUS;
367+
368+ /* DM workarounds */
369+ double dsc_delay_factor_wa; // TODO: Remove after implementing root cause fix
370+ double min_prefetch_in_strobe_us;
367371 };
368372
369373 struct _vcs_dpi_display_xfc_params_st {
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c+1−1
@@ -625,7 +625,7 @@ static void fetch_pipe_params(struct display_mode_lib *mode_lib) · 624 unmodified lines
625625 mode_lib->vba.skip_dio_check[mode_lib->vba.NumberOfActivePlanes] =
626626 dout->is_virtual;
627627
628− if (!dout->dsc_enable)
628+ if (dout->dsc_enable)
629629 mode_lib->vba.ForcedOutputLinkBPP[mode_lib->vba.NumberOfActivePlanes] = dout->output_bpp;
630630 else
631631 mode_lib->vba.ForcedOutputLinkBPP[mode_lib->vba.NumberOfActivePlanes] = 0.0;
drivers/gpu/drm/amd/display/dc/gpio/dcn32/hw_factory_dcn32.c+14−0
@@ -107,6 +107,13 @@ static const struct ddc_registers ddc_data_regs_dcn[] = { · 106 unmodified lines
107107 ddc_data_regs_dcn2(3),
108108 ddc_data_regs_dcn2(4),
109109 ddc_data_regs_dcn2(5),
110+ {
111+ // add a dummy entry for cases no such port
112+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,},
113+ .ddc_setup = 0,
114+ .phy_aux_cntl = 0,
115+ .dc_gpio_aux_ctrl_5 = 0
116+ },
110117 {
111118 DDC_GPIO_VGA_REG_LIST(DATA),
112119 .ddc_setup = 0,
@@ -121,6 +128,13 @@ static const struct ddc_registers ddc_clk_regs_dcn[] = { · 8 unmodified lines
121128 ddc_clk_regs_dcn2(3),
122129 ddc_clk_regs_dcn2(4),
123130 ddc_clk_regs_dcn2(5),
131+ {
132+ // add a dummy entry for cases no such port
133+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,},
134+ .ddc_setup = 0,
135+ .phy_aux_cntl = 0,
136+ .dc_gpio_aux_ctrl_5 = 0
137+ },
124138 {
125139 DDC_GPIO_VGA_REG_LIST(CLK),
126140 .ddc_setup = 0,
drivers/gpu/drm/amd/display/dc/gpio/hw_ddc.c+6−3
@@ -94,11 +94,14 @@ static enum gpio_result set_config( · 93 unmodified lines
9494 * is required for detection of AUX mode */
9595 if (hw_gpio->base.en != GPIO_DDC_LINE_VIP_PAD) {
9696 if (!ddc_data_pd_en || !ddc_clk_pd_en) {
97−
98− REG_SET_2(gpio.MASK_reg, regval,
97+ if (hw_gpio->base.en == GPIO_DDC_LINE_DDC_VGA) {
98+ // bit 4 of mask has different usage in some cases
99+ REG_SET(gpio.MASK_reg, regval, DC_GPIO_DDC1DATA_PD_EN, 1);
100+ } else {
101+ REG_SET_2(gpio.MASK_reg, regval,
99102 DC_GPIO_DDC1DATA_PD_EN, 1,
100103 DC_GPIO_DDC1CLK_PD_EN, 1);
101−
104+ }
102105 if (config_data->type ==
103106 GPIO_CONFIG_TYPE_I2C_AUX_DUAL_MODE)
104107 msleep(3);
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c+12−13
@@ -67,22 +67,21 @@ int vega10_fan_ctrl_get_fan_speed_info(struct pp_hwmgr *hwmgr, · 66 unmodified lines
6767 int vega10_fan_ctrl_get_fan_speed_pwm(struct pp_hwmgr *hwmgr,
6868 uint32_t *speed)
6969 {
70− uint32_t current_rpm;
71− uint32_t percent = 0;
72−
73− if (hwmgr->thermal_controller.fanInfo.bNoFan)
74− return 0;
70+ struct amdgpu_device *adev = hwmgr->adev;
71+ uint32_t duty100, duty;
72+ uint64_t tmp64;
7573
76− if (vega10_get_current_rpm(hwmgr, &current_rpm))
77− return -1;
74+ duty100 = REG_GET_FIELD(RREG32_SOC15(THM, 0, mmCG_FDO_CTRL1),
75+ CG_FDO_CTRL1, FMAX_DUTY100);
76+ duty = REG_GET_FIELD(RREG32_SOC15(THM, 0, mmCG_THERMAL_STATUS),
77+ CG_THERMAL_STATUS, FDO_PWM_DUTY);
7878
79− if (hwmgr->thermal_controller.
80− advanceFanControlParameters.usMaxFanRPM != 0)
81− percent = current_rpm * 255 /
82− hwmgr->thermal_controller.
83− advanceFanControlParameters.usMaxFanRPM;
79+ if (!duty100)
80+ return -EINVAL;
8481
85− *speed = MIN(percent, 255);
82+ tmp64 = (uint64_t)duty * 255;
83+ do_div(tmp64, duty100);
84+ *speed = MIN((uint32_t)tmp64, 255);
8685
8786 return 0;
8887 }
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c+11−12
@@ -1156,22 +1156,21 @@ static int smu_smc_hw_setup(struct smu_context *smu) · 1155 unmodified lines
11561156 uint64_t features_supported;
11571157 int ret = 0;
11581158
1159− if (adev->in_suspend && smu_is_dpm_running(smu)) {
1160− dev_info(adev->dev, "dpm has been enabled\n");
1161− /* this is needed specifically */
1162− switch (adev->ip_versions[MP1_HWIP][0]) {
1163− case IP_VERSION(11, 0, 7):
1164− case IP_VERSION(11, 0, 11):
1165− case IP_VERSION(11, 5, 0):
1166− case IP_VERSION(11, 0, 12):
1159+ switch (adev->ip_versions[MP1_HWIP][0]) {
1160+ case IP_VERSION(11, 0, 7):
1161+ case IP_VERSION(11, 0, 11):
1162+ case IP_VERSION(11, 5, 0):
1163+ case IP_VERSION(11, 0, 12):
1164+ if (adev->in_suspend && smu_is_dpm_running(smu)) {
1165+ dev_info(adev->dev, "dpm has been enabled\n");
11671166 ret = smu_system_features_control(smu, true);
11681167 if (ret)
11691168 dev_err(adev->dev, "Failed system features control!\n");
1170− break;
1171− default:
1172− break;
1169+ return ret;
11731170 }
1174− return ret;
1171+ break;
1172+ default:
1173+ break;
11751174 }
11761175
11771176 ret = smu_init_display_count(smu, 0);
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h+8−0
@@ -1388,6 +1388,14 @@ enum smu_cmn2asic_mapping_type { · 1387 unmodified lines
13881388 CMN2ASIC_MAPPING_WORKLOAD,
13891389 };
13901390
1391+enum smu_baco_seq {
1392+ BACO_SEQ_BACO = 0,
1393+ BACO_SEQ_MSR,
1394+ BACO_SEQ_BAMACO,
1395+ BACO_SEQ_ULPS,
1396+ BACO_SEQ_COUNT,
1397+};
1398+
13911399 #define MSG_MAP(msg, index, valid_in_vf) \
13921400 [SMU_MSG_##msg] = {1, (index), (valid_in_vf)}
13931401
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_7.h+79−38
@@ -25,10 +25,10 @@ · 24 unmodified lines
2525
2626 // *** IMPORTANT ***
2727 // PMFW TEAM: Always increment the interface version on any change to this file
28−#define SMU13_DRIVER_IF_VERSION 0x2C
28+#define SMU13_DRIVER_IF_VERSION 0x35
2929
3030 //Increment this version if SkuTable_t or BoardTable_t change
31−#define PPTABLE_VERSION 0x20
31+#define PPTABLE_VERSION 0x27
3232
3333 #define NUM_GFXCLK_DPM_LEVELS 16
3434 #define NUM_SOCCLK_DPM_LEVELS 8
@@ -96,7 +96,7 @@ · 61 unmodified lines
9696 #define FEATURE_MEM_TEMP_READ_BIT 47
9797 #define FEATURE_ATHUB_MMHUB_PG_BIT 48
9898 #define FEATURE_SOC_PCC_BIT 49
99−#define FEATURE_SPARE_50_BIT 50
99+#define FEATURE_EDC_PWRBRK_BIT 50
100100 #define FEATURE_SPARE_51_BIT 51
101101 #define FEATURE_SPARE_52_BIT 52
102102 #define FEATURE_SPARE_53_BIT 53
@@ -282,15 +282,15 @@ typedef enum { · 179 unmodified lines
282282 } I2cControllerPort_e;
283283
284284 typedef enum {
285− I2C_CONTROLLER_NAME_VR_GFX = 0,
286− I2C_CONTROLLER_NAME_VR_SOC,
287− I2C_CONTROLLER_NAME_VR_VMEMP,
288− I2C_CONTROLLER_NAME_VR_VDDIO,
289− I2C_CONTROLLER_NAME_LIQUID0,
290− I2C_CONTROLLER_NAME_LIQUID1,
291− I2C_CONTROLLER_NAME_PLX,
292− I2C_CONTROLLER_NAME_OTHER,
293− I2C_CONTROLLER_NAME_COUNT,
285+ I2C_CONTROLLER_NAME_VR_GFX = 0,
286+ I2C_CONTROLLER_NAME_VR_SOC,
287+ I2C_CONTROLLER_NAME_VR_VMEMP,
288+ I2C_CONTROLLER_NAME_VR_VDDIO,
289+ I2C_CONTROLLER_NAME_LIQUID0,
290+ I2C_CONTROLLER_NAME_LIQUID1,
291+ I2C_CONTROLLER_NAME_PLX,
292+ I2C_CONTROLLER_NAME_FAN_INTAKE,
293+ I2C_CONTROLLER_NAME_COUNT,
294294 } I2cControllerName_e;
295295
296296 typedef enum {
@@ -302,6 +302,7 @@ typedef enum { · 5 unmodified lines
302302 I2C_CONTROLLER_THROTTLER_LIQUID0,
303303 I2C_CONTROLLER_THROTTLER_LIQUID1,
304304 I2C_CONTROLLER_THROTTLER_PLX,
305+ I2C_CONTROLLER_THROTTLER_FAN_INTAKE,
305306 I2C_CONTROLLER_THROTTLER_INA3221,
306307 I2C_CONTROLLER_THROTTLER_COUNT,
307308 } I2cControllerThrottler_e;
@@ -309,8 +310,9 @@ typedef enum { · 1 unmodified line
309310 typedef enum {
310311 I2C_CONTROLLER_PROTOCOL_VR_XPDE132G5,
311312 I2C_CONTROLLER_PROTOCOL_VR_IR35217,
312− I2C_CONTROLLER_PROTOCOL_TMP_TMP102A,
313+ I2C_CONTROLLER_PROTOCOL_TMP_MAX31875,
313314 I2C_CONTROLLER_PROTOCOL_INA3221,
315+ I2C_CONTROLLER_PROTOCOL_TMP_MAX6604,
314316 I2C_CONTROLLER_PROTOCOL_COUNT,
315317 } I2cControllerProtocol_e;
316318
@@ -690,6 +692,9 @@ typedef struct { · 373 unmodified lines
690692 #define PP_OD_FEATURE_UCLK_BIT 8
691693 #define PP_OD_FEATURE_ZERO_FAN_BIT 9
692694 #define PP_OD_FEATURE_TEMPERATURE_BIT 10
695+#define PP_OD_FEATURE_POWER_FEATURE_CTRL_BIT 11
696+#define PP_OD_FEATURE_ASIC_TDC_BIT 12
697+#define PP_OD_FEATURE_COUNT 13
693698
694699 typedef enum {
695700 PP_OD_POWER_FEATURE_ALWAYS_ENABLED,
@@ -697,6 +702,11 @@ typedef enum { · 1 unmodified line
697702 PP_OD_POWER_FEATURE_ALWAYS_DISABLED,
698703 } PP_OD_POWER_FEATURE_e;
699704
705+typedef enum {
706+ FAN_MODE_AUTO = 0,
707+ FAN_MODE_MANUAL_LINEAR,
708+} FanMode_e;
709+
700710 typedef struct {
701711 uint32_t FeatureCtrlMask;
702712
@@ -708,8 +718,8 @@ typedef struct { · 5 unmodified lines
708718 uint8_t RuntimePwrSavingFeaturesCtrl;
709719
710720 //Frequency changes
711− int16_t GfxclkFmin; // MHz
712− int16_t GfxclkFmax; // MHz
721+ int16_t GfxclkFmin; // MHz
722+ int16_t GfxclkFmax; // MHz
713723 uint16_t UclkFmin; // MHz
714724 uint16_t UclkFmax; // MHz
715725
@@ -730,7 +740,12 @@ typedef struct { · 14 unmodified lines
730740 uint8_t MaxOpTemp;
731741 uint8_t Padding[4];
732742
733− uint32_t Spare[12];
743+ uint16_t GfxVoltageFullCtrlMode;
744+ uint16_t GfxclkFullCtrlMode;
745+ uint16_t UclkFullCtrlMode;
746+ int16_t AsicTdc;
747+
748+ uint32_t Spare[10];
734749 uint32_t MmHubPadding[8]; // SMU internal use. Adding here instead of external as a workaround
735750 } OverDriveTable_t;
736751
@@ -748,8 +763,8 @@ typedef struct { · 11 unmodified lines
748763 uint8_t IdlePwrSavingFeaturesCtrl;
749764 uint8_t RuntimePwrSavingFeaturesCtrl;
750765
751− uint16_t GfxclkFmin; // MHz
752− uint16_t GfxclkFmax; // MHz
766+ int16_t GfxclkFmin; // MHz
767+ int16_t GfxclkFmax; // MHz
753768 uint16_t UclkFmin; // MHz
754769 uint16_t UclkFmax; // MHz
755770
@@ -769,7 +784,12 @@ typedef struct { · 13 unmodified lines
769784 uint8_t MaxOpTemp;
770785 uint8_t Padding[4];
771786
772− uint32_t Spare[12];
787+ uint16_t GfxVoltageFullCtrlMode;
788+ uint16_t GfxclkFullCtrlMode;
789+ uint16_t UclkFullCtrlMode;
790+ int16_t AsicTdc;
791+
792+ uint32_t Spare[10];
773793
774794 } OverDriveLimits_t;
775795
@@ -903,7 +923,8 @@ typedef struct { · 127 unmodified lines
903923 uint16_t FanStartTempMin;
904924 uint16_t FanStartTempMax;
905925
906− uint32_t Spare[12];
926+ uint16_t PowerMinPpt0[POWER_SOURCE_COUNT];
927+ uint32_t Spare[11];
907928
908929 } MsgLimits_t;
909930
@@ -1086,11 +1107,13 @@ typedef struct { · 176 unmodified lines
10861107 uint32_t GfxoffSpare[15];
10871108
10881109 // GFX GPO
1089− float DfllBtcMasterScalerM;
1110+ uint32_t DfllBtcMasterScalerM;
10901111 int32_t DfllBtcMasterScalerB;
1091− float DfllBtcSlaveScalerM;
1112+ uint32_t DfllBtcSlaveScalerM;
10921113 int32_t DfllBtcSlaveScalerB;
1093− uint32_t GfxGpoSpare[12];
1114+ uint32_t DfllPccAsWaitCtrl; //GDFLL_AS_WAIT_CTRL_PCC register value to be passed to RLC msg
1115+ uint32_t DfllPccAsStepCtrl; //GDFLL_AS_STEP_CTRL_PCC register value to be passed to RLC msg
1116+ uint32_t GfxGpoSpare[10];
10941117
10951118 // GFX DCS
10961119
@@ -1106,7 +1129,10 @@ typedef struct { · 9 unmodified lines
11061129 uint16_t DcsTimeout; //This is the amount of time SMU FW waits for RLC to put GFX into GFXOFF before reverting to the fallback mechanism of throttling GFXCLK to Fmin.
11071130
11081131
1109− uint32_t DcsSpare[16];
1132+ uint32_t DcsSpare[14];
1133+
1134+ // UCLK section
1135+ uint16_t ShadowFreqTableUclk[NUM_UCLK_DPM_LEVELS]; // In MHz
11101136
11111137 // UCLK section
11121138 uint8_t UseStrobeModeOptimizations; //Set to indicate that FW should use strobe mode optimizations
@@ -1163,13 +1189,14 @@ typedef struct { · 50 unmodified lines
11631189 uint16_t IntakeTempHighIntakeAcousticLimit;
11641190 uint16_t IntakeTempAcouticLimitReleaseRate;
11651191
1166− uint16_t FanStalledTempLimitOffset;
1192+ int16_t FanAbnormalTempLimitOffset;
11671193 uint16_t FanStalledTriggerRpm;
1168− uint16_t FanAbnormalTriggerRpm;
1169− uint16_t FanPadding;
1170−
1171− uint32_t FanSpare[14];
1194+ uint16_t FanAbnormalTriggerRpmCoeff;
1195+ uint16_t FanAbnormalDetectionEnable;
11721196
1197+ uint8_t FanIntakeSensorSupport;
1198+ uint8_t FanIntakePadding[3];
1199+ uint32_t FanSpare[13];
11731200 // SECTION: VDD_GFX AVFS
11741201
11751202 uint8_t OverrideGfxAvfsFuses;
@@ -1193,7 +1220,6 @@ typedef struct { · 17 unmodified lines
11931220 uint32_t dGbV_dT_vmin;
11941221 uint32_t dGbV_dT_vmax;
11951222
1196− //Unused: PMFW-9370
11971223 uint32_t V2F_vmin_range_low;
11981224 uint32_t V2F_vmin_range_high;
11991225 uint32_t V2F_vmax_range_low;
@@ -1238,8 +1264,21 @@ typedef struct { · 38 unmodified lines
12381264 // SECTION: Advanced Options
12391265 uint32_t DebugOverrides;
12401266
1267+ // Section: Total Board Power idle vs active coefficients
1268+ uint8_t TotalBoardPowerSupport;
1269+ uint8_t TotalBoardPowerPadding[3];
1270+
1271+ int16_t TotalIdleBoardPowerM;
1272+ int16_t TotalIdleBoardPowerB;
1273+ int16_t TotalBoardPowerM;
1274+ int16_t TotalBoardPowerB;
1275+
1276+ QuadraticInt_t qFeffCoeffGameClock[POWER_SOURCE_COUNT];
1277+ QuadraticInt_t qFeffCoeffBaseClock[POWER_SOURCE_COUNT];
1278+ QuadraticInt_t qFeffCoeffBoostClock[POWER_SOURCE_COUNT];
1279+
12411280 // SECTION: Sku Reserved
1242− uint32_t Spare[64];
1281+ uint32_t Spare[43];
12431282
12441283 // Padding for MMHUB - do not modify this
12451284 uint32_t MmHubPadding[8];
@@ -1304,7 +1343,8 @@ typedef struct { · 58 unmodified lines
13041343 // SECTION: Clock Spread Spectrum
13051344
13061345 // UCLK Spread Spectrum
1307− uint16_t UclkSpreadPadding;
1346+ uint8_t UclkTrainingModeSpreadPercent; // Q4.4
1347+ uint8_t UclkSpreadPadding;
13081348 uint16_t UclkSpreadFreq; // kHz
13091349
13101350 // UCLK Spread Spectrum
@@ -1317,11 +1357,7 @@ typedef struct { · 6 unmodified lines
13171357
13181358 // Section: Memory Config
13191359 uint8_t DramWidth; // Width of interface to the channel for each DRAM module. See DRAM_BIT_WIDTH_TYPE_e
1320− uint8_t PaddingMem1[3];
1321−
1322− // Section: Total Board Power
1323− uint16_t TotalBoardPower; //Only needed for TCP Estimated case, where TCP = TGP+Total Board Power
1324− uint16_t BoardPowerPadding;
1360+ uint8_t PaddingMem1[7];
13251361
13261362 // SECTION: UMC feature flags
13271363 uint8_t HsrEnabled;
@@ -1423,8 +1459,11 @@ typedef struct { · 95 unmodified lines
14231459 uint16_t Vcn1ActivityPercentage ;
14241460
14251461 uint32_t EnergyAccumulator;
1426− uint16_t AverageSocketPower ;
1462+ uint16_t AverageSocketPower;
1463+ uint16_t AverageTotalBoardPower;
1464+
14271465 uint16_t AvgTemperature[TEMP_COUNT];
1466+ uint16_t AvgTemperatureFanIntake;
14281467
14291468 uint8_t PcieRate ;
14301469 uint8_t PcieWidth ;
@@ -1592,5 +1631,7 @@ typedef struct { · 161 unmodified lines
15921631 #define IH_INTERRUPT_CONTEXT_ID_AUDIO_D0 0x5
15931632 #define IH_INTERRUPT_CONTEXT_ID_AUDIO_D3 0x6
15941633 #define IH_INTERRUPT_CONTEXT_ID_THERMAL_THROTTLING 0x7
1634+#define IH_INTERRUPT_CONTEXT_ID_FAN_ABNORMAL 0x8
1635+#define IH_INTERRUPT_CONTEXT_ID_FAN_RECOVERY 0x9
15951636
15961637 #endif
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_4_ppsmc.h+7−8
@@ -54,14 +54,14 @@ · 53 unmodified lines
5454 #define PPSMC_MSG_TestMessage 0x01 ///< To check if PMFW is alive and responding. Requirement specified by PMFW team
5555 #define PPSMC_MSG_GetPmfwVersion 0x02 ///< Get PMFW version
5656 #define PPSMC_MSG_GetDriverIfVersion 0x03 ///< Get PMFW_DRIVER_IF version
57−#define PPSMC_MSG_EnableGfxOff 0x04 ///< Enable GFXOFF
58−#define PPSMC_MSG_DisableGfxOff 0x05 ///< Disable GFXOFF
57+#define PPSMC_MSG_SPARE0 0x04 ///< SPARE
58+#define PPSMC_MSG_SPARE1 0x05 ///< SPARE
5959 #define PPSMC_MSG_PowerDownVcn 0x06 ///< Power down VCN
6060 #define PPSMC_MSG_PowerUpVcn 0x07 ///< Power up VCN; VCN is power gated by default
6161 #define PPSMC_MSG_SetHardMinVcn 0x08 ///< For wireless display
6262 #define PPSMC_MSG_SetSoftMinGfxclk 0x09 ///< Set SoftMin for GFXCLK, argument is frequency in MHz
63−#define PPSMC_MSG_ActiveProcessNotify 0x0A ///< Needs update
64−#define PPSMC_MSG_ForcePowerDownGfx 0x0B ///< Force power down GFX, i.e. enter GFXOFF
63+#define PPSMC_MSG_SPARE2 0x0A ///< SPARE
64+#define PPSMC_MSG_SPARE3 0x0B ///< SPARE
6565 #define PPSMC_MSG_PrepareMp1ForUnload 0x0C ///< Prepare PMFW for GFX driver unload
6666 #define PPSMC_MSG_SetDriverDramAddrHigh 0x0D ///< Set high 32 bits of DRAM address for Driver table transfer
6767 #define PPSMC_MSG_SetDriverDramAddrLow 0x0E ///< Set low 32 bits of DRAM address for Driver table transfer
@@ -73,8 +73,7 @@ · 5 unmodified lines
7373 #define PPSMC_MSG_SetSoftMinFclk 0x14 ///< Set hard min for FCLK
7474 #define PPSMC_MSG_SetSoftMinVcn 0x15 ///< Set soft min for VCN clocks (VCLK and DCLK)
7575
76−
77−#define PPSMC_MSG_EnableGfxImu 0x16 ///< Needs update
76+#define PPSMC_MSG_EnableGfxImu 0x16 ///< Enable GFX IMU
7877
7978 #define PPSMC_MSG_GetGfxclkFrequency 0x17 ///< Get GFX clock frequency
8079 #define PPSMC_MSG_GetFclkFrequency 0x18 ///< Get FCLK frequency
@@ -102,8 +101,8 @@ · 21 unmodified lines
102101 #define PPSMC_MSG_SetHardMinIspxclkByFreq 0x2C ///< Set HardMin by frequency for ISPXCLK
103102 #define PPSMC_MSG_PowerDownUmsch 0x2D ///< Power down VCN.UMSCH (aka VSCH) scheduler
104103 #define PPSMC_MSG_PowerUpUmsch 0x2E ///< Power up VCN.UMSCH (aka VSCH) scheduler
105−#define PPSMC_Message_IspStutterOn_MmhubPgDis 0x2F ///< ISP StutterOn mmHub PgDis
106−#define PPSMC_Message_IspStutterOff_MmhubPgEn 0x30 ///< ISP StufferOff mmHub PgEn
104+#define PPSMC_MSG_IspStutterOn_MmhubPgDis 0x2F ///< ISP StutterOn mmHub PgDis
105+#define PPSMC_MSG_IspStutterOff_MmhubPgEn 0x30 ///< ISP StufferOff mmHub PgEn
107106
108107 #define PPSMC_Message_Count 0x31 ///< Total number of PPSMC messages
109108 /** @}*/
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v11_0.h+1−9
@@ -147,14 +147,6 @@ struct smu_11_5_power_context { · 146 unmodified lines
147147 uint32_t max_fast_ppt_limit;
148148 };
149149
150−enum smu_v11_0_baco_seq {
151− BACO_SEQ_BACO = 0,
152− BACO_SEQ_MSR,
153− BACO_SEQ_BAMACO,
154− BACO_SEQ_ULPS,
155− BACO_SEQ_COUNT,
156−};
157−
158150 #if defined(SWSMU_CODE_LAYER_L2) || defined(SWSMU_CODE_LAYER_L3)
159151
160152 int smu_v11_0_init_microcode(struct smu_context *smu);
@@ -257,7 +249,7 @@ int smu_v11_0_baco_enter(struct smu_context *smu); · 96 unmodified lines
257249 int smu_v11_0_baco_exit(struct smu_context *smu);
258250
259251 int smu_v11_0_baco_set_armd3_sequence(struct smu_context *smu,
260− enum smu_v11_0_baco_seq baco_seq);
252+ enum smu_baco_seq baco_seq);
261253
262254 int smu_v11_0_mode1_reset(struct smu_context *smu);
263255
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h+4−9
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_4 0x07
3232 #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_5 0x04
3333 #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_0_10 0x32
34−#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_7 0x2C
34+#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_7 0x35
3535 #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_10 0x1D
3636
3737 #define SMU13_MODE1_RESET_WAIT_TIME_IN_MS 500 //500ms
@@ -124,14 +124,6 @@ struct smu_13_0_power_context { · 86 unmodified lines
124124 enum smu_13_0_power_state power_state;
125125 };
126126
127−enum smu_v13_0_baco_seq {
128− BACO_SEQ_BACO = 0,
129− BACO_SEQ_MSR,
130− BACO_SEQ_BAMACO,
131− BACO_SEQ_ULPS,
132− BACO_SEQ_COUNT,
133−};
134−
135127 #if defined(SWSMU_CODE_LAYER_L2) || defined(SWSMU_CODE_LAYER_L3)
136128
137129 int smu_v13_0_init_microcode(struct smu_context *smu);
@@ -218,6 +210,9 @@ int smu_v13_0_set_azalia_d3_pme(struct smu_context *smu); · 80 unmodified lines
218210 int smu_v13_0_get_max_sustainable_clocks_by_dc(struct smu_context *smu,
219211 struct pp_smu_nv_clock_table *max_clocks);
220212
213+int smu_v13_0_baco_set_armd3_sequence(struct smu_context *smu,
214+ enum smu_baco_seq baco_seq);
215+
221216 bool smu_v13_0_baco_is_support(struct smu_context *smu);
222217
223218 enum smu_baco_state smu_v13_0_baco_get_state(struct smu_context *smu);
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c+7−1
@@ -377,7 +377,13 @@ static void sienna_cichlid_check_bxco_support(struct smu_context *smu) · 376 unmodified lines
377377 if (((adev->pdev->device == 0x73A1) &&
378378 (adev->pdev->revision == 0x00)) ||
379379 ((adev->pdev->device == 0x73BF) &&
380− (adev->pdev->revision == 0xCF)))
380+ (adev->pdev->revision == 0xCF)) ||
381+ ((adev->pdev->device == 0x7422) &&
382+ (adev->pdev->revision == 0x00)) ||
383+ ((adev->pdev->device == 0x73A3) &&
384+ (adev->pdev->revision == 0x00)) ||
385+ ((adev->pdev->device == 0x73E3) &&
386+ (adev->pdev->revision == 0x00)))
381387 smu_baco->platform_support = false;
382388
383389 }
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c+1−1
@@ -1576,7 +1576,7 @@ int smu_v11_0_set_azalia_d3_pme(struct smu_context *smu) · 1575 unmodified lines
15761576 }
15771577
15781578 int smu_v11_0_baco_set_armd3_sequence(struct smu_context *smu,
1579− enum smu_v11_0_baco_seq baco_seq)
1579+ enum smu_baco_seq baco_seq)
15801580 {
15811581 return smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_ArmD3, baco_seq, NULL);
15821582 }
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c+9−0
@@ -2230,6 +2230,15 @@ int smu_v13_0_gfx_ulv_control(struct smu_context *smu, · 2229 unmodified lines
22302230 return ret;
22312231 }
22322232
2233+int smu_v13_0_baco_set_armd3_sequence(struct smu_context *smu,
2234+ enum smu_baco_seq baco_seq)
2235+{
2236+ return smu_cmn_send_smc_msg_with_param(smu,
2237+ SMU_MSG_ArmD3,
2238+ baco_seq,
2239+ NULL);
2240+}
2241+
22332242 bool smu_v13_0_baco_is_support(struct smu_context *smu)
22342243 {
22352244 struct smu_baco_context *smu_baco = &smu->smu_baco;
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c+28−2
@@ -120,6 +120,7 @@ static struct cmn2asic_msg_mapping smu_v13_0_0_message_map[SMU_MSG_MAX_COUNT] = · 119 unmodified lines
120120 MSG_MAP(Mode1Reset, PPSMC_MSG_Mode1Reset, 0),
121121 MSG_MAP(PrepareMp1ForUnload, PPSMC_MSG_PrepareMp1ForUnload, 0),
122122 MSG_MAP(DFCstateControl, PPSMC_MSG_SetExternalClientDfCstateAllow, 0),
123+ MSG_MAP(ArmD3, PPSMC_MSG_ArmD3, 0),
123124 };
124125
125126 static struct cmn2asic_mapping smu_v13_0_0_clk_map[SMU_CLK_COUNT] = {
@@ -1566,6 +1567,31 @@ static int smu_v13_0_0_set_power_profile_mode(struct smu_context *smu, · 1440 unmodified lines
15661567 NULL);
15671568 }
15681569
1570+static int smu_v13_0_0_baco_enter(struct smu_context *smu)
1571+{
1572+ struct smu_baco_context *smu_baco = &smu->smu_baco;
1573+ struct amdgpu_device *adev = smu->adev;
1574+
1575+ if (adev->in_runpm && smu_cmn_is_audio_func_enabled(adev))
1576+ return smu_v13_0_baco_set_armd3_sequence(smu,
1577+ smu_baco->maco_support ? BACO_SEQ_BAMACO : BACO_SEQ_BACO);
1578+ else
1579+ return smu_v13_0_baco_enter(smu);
1580+}
1581+
1582+static int smu_v13_0_0_baco_exit(struct smu_context *smu)
1583+{
1584+ struct amdgpu_device *adev = smu->adev;
1585+
1586+ if (adev->in_runpm && smu_cmn_is_audio_func_enabled(adev)) {
1587+ /* Wait for PMFW handling for the Dstate change */
1588+ usleep_range(10000, 11000);
1589+ return smu_v13_0_baco_set_armd3_sequence(smu, BACO_SEQ_ULPS);
1590+ } else {
1591+ return smu_v13_0_baco_exit(smu);
1592+ }
1593+}
1594+
15691595 static bool smu_v13_0_0_is_mode1_reset_supported(struct smu_context *smu)
15701596 {
15711597 struct amdgpu_device *adev = smu->adev;
@@ -1827,8 +1853,8 @@ static const struct pptable_funcs smu_v13_0_0_ppt_funcs = { · 255 unmodified lines
18271853 .baco_is_support = smu_v13_0_baco_is_support,
18281854 .baco_get_state = smu_v13_0_baco_get_state,
18291855 .baco_set_state = smu_v13_0_baco_set_state,
1830− .baco_enter = smu_v13_0_baco_enter,
1831− .baco_exit = smu_v13_0_baco_exit,
1856+ .baco_enter = smu_v13_0_0_baco_enter,
1857+ .baco_exit = smu_v13_0_0_baco_exit,
18321858 .mode1_reset_is_support = smu_v13_0_0_is_mode1_reset_supported,
18331859 .mode1_reset = smu_v13_0_mode1_reset,
18341860 .set_mp1_state = smu_v13_0_0_set_mp1_state,
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c+28−2
@@ -122,6 +122,7 @@ static struct cmn2asic_msg_mapping smu_v13_0_7_message_map[SMU_MSG_MAX_COUNT] = · 121 unmodified lines
122122 MSG_MAP(PrepareMp1ForUnload, PPSMC_MSG_PrepareMp1ForUnload, 0),
123123 MSG_MAP(SetMGpuFanBoostLimitRpm, PPSMC_MSG_SetMGpuFanBoostLimitRpm, 0),
124124 MSG_MAP(DFCstateControl, PPSMC_MSG_SetExternalClientDfCstateAllow, 0),
125+ MSG_MAP(ArmD3, PPSMC_MSG_ArmD3, 0),
125126 };
126127
127128 static struct cmn2asic_mapping smu_v13_0_7_clk_map[SMU_CLK_COUNT] = {
@@ -1578,6 +1579,31 @@ static int smu_v13_0_7_set_mp1_state(struct smu_context *smu, · 1450 unmodified lines
15781579 return ret;
15791580 }
15801581
1582+static int smu_v13_0_7_baco_enter(struct smu_context *smu)
1583+{
1584+ struct smu_baco_context *smu_baco = &smu->smu_baco;
1585+ struct amdgpu_device *adev = smu->adev;
1586+
1587+ if (adev->in_runpm && smu_cmn_is_audio_func_enabled(adev))
1588+ return smu_v13_0_baco_set_armd3_sequence(smu,
1589+ smu_baco->maco_support ? BACO_SEQ_BAMACO : BACO_SEQ_BACO);
1590+ else
1591+ return smu_v13_0_baco_enter(smu);
1592+}
1593+
1594+static int smu_v13_0_7_baco_exit(struct smu_context *smu)
1595+{
1596+ struct amdgpu_device *adev = smu->adev;
1597+
1598+ if (adev->in_runpm && smu_cmn_is_audio_func_enabled(adev)) {
1599+ /* Wait for PMFW handling for the Dstate change */
1600+ usleep_range(10000, 11000);
1601+ return smu_v13_0_baco_set_armd3_sequence(smu, BACO_SEQ_ULPS);
1602+ } else {
1603+ return smu_v13_0_baco_exit(smu);
1604+ }
1605+}
1606+
15811607 static bool smu_v13_0_7_is_mode1_reset_supported(struct smu_context *smu)
15821608 {
15831609 struct amdgpu_device *adev = smu->adev;
@@ -1655,8 +1681,8 @@ static const struct pptable_funcs smu_v13_0_7_ppt_funcs = { · 71 unmodified lines
16551681 .baco_is_support = smu_v13_0_baco_is_support,
16561682 .baco_get_state = smu_v13_0_baco_get_state,
16571683 .baco_set_state = smu_v13_0_baco_set_state,
1658− .baco_enter = smu_v13_0_baco_enter,
1659− .baco_exit = smu_v13_0_baco_exit,
1684+ .baco_enter = smu_v13_0_7_baco_enter,
1685+ .baco_exit = smu_v13_0_7_baco_exit,
16601686 .mode1_reset_is_support = smu_v13_0_7_is_mode1_reset_supported,
16611687 .mode1_reset = smu_v13_0_mode1_reset,
16621688 .set_mp1_state = smu_v13_0_7_set_mp1_state,
drivers/gpu/drm/display/drm_dp_dual_mode_helper.c+29−22
@@ -63,23 +63,45 @@ · 62 unmodified lines
6363 ssize_t drm_dp_dual_mode_read(struct i2c_adapter *adapter,
6464 u8 offset, void *buffer, size_t size)
6565 {
66+ u8 zero = 0;
67+ char *tmpbuf = NULL;
68+ /*
69+ * As sub-addressing is not supported by all adaptors,
70+ * always explicitly read from the start and discard
71+ * any bytes that come before the requested offset.
72+ * This way, no matter whether the adaptor supports it
73+ * or not, we'll end up reading the proper data.
74+ */
6675 struct i2c_msg msgs[] = {
6776 {
6877 .addr = DP_DUAL_MODE_SLAVE_ADDRESS,
6978 .flags = 0,
7079 .len = 1,
71− .buf = &offset,
80+ .buf = &zero,
7281 },
7382 {
7483 .addr = DP_DUAL_MODE_SLAVE_ADDRESS,
7584 .flags = I2C_M_RD,
76− .len = size,
85+ .len = size + offset,
7786 .buf = buffer,
7887 },
7988 };
8089 int ret;
8190
91+ if (offset) {
92+ tmpbuf = kmalloc(size + offset, GFP_KERNEL);
93+ if (!tmpbuf)
94+ return -ENOMEM;
95+
96+ msgs[1].buf = tmpbuf;
97+ }
98+
8299 ret = i2c_transfer(adapter, msgs, ARRAY_SIZE(msgs));
100+ if (tmpbuf)
101+ memcpy(buffer, tmpbuf + offset, size);
102+
103+ kfree(tmpbuf);
104+
83105 if (ret < 0)
84106 return ret;
85107 if (ret != ARRAY_SIZE(msgs))
@@ -208,18 +230,6 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(const struct drm_device *dev, · 122 unmodified lines
208230 if (ret)
209231 return DRM_DP_DUAL_MODE_UNKNOWN;
210232
211− /*
212− * Sigh. Some (maybe all?) type 1 adaptors are broken and ack
213− * the offset but ignore it, and instead they just always return
214− * data from the start of the HDMI ID buffer. So for a broken
215− * type 1 HDMI adaptor a single byte read will always give us
216− * 0x44, and for a type 1 DVI adaptor it should give 0x00
217− * (assuming it implements any registers). Fortunately neither
218− * of those values will match the type 2 signature of the
219− * DP_DUAL_MODE_ADAPTOR_ID register so we can proceed with
220− * the type 2 adaptor detection safely even in the presence
221− * of broken type 1 adaptors.
222− */
223233 ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_ADAPTOR_ID,
224234 &adaptor_id, sizeof(adaptor_id));
225235 drm_dbg_kms(dev, "DP dual mode adaptor ID: %02x (err %zd)\n", adaptor_id, ret);
@@ -233,11 +243,10 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(const struct drm_device *dev, · 7 unmodified lines
233243 return DRM_DP_DUAL_MODE_TYPE2_DVI;
234244 }
235245 /*
236− * If neither a proper type 1 ID nor a broken type 1 adaptor
237− * as described above, assume type 1, but let the user know
238− * that we may have misdetected the type.
246+ * If not a proper type 1 ID, still assume type 1, but let
247+ * the user know that we may have misdetected the type.
239248 */
240− if (!is_type1_adaptor(adaptor_id) && adaptor_id != hdmi_id[0])
249+ if (!is_type1_adaptor(adaptor_id))
241250 drm_err(dev, "Unexpected DP dual mode adaptor ID %02x\n", adaptor_id);
242251
243252 }
@@ -343,10 +352,8 @@ EXPORT_SYMBOL(drm_dp_dual_mode_get_tmds_output); · 99 unmodified lines
343352 * @enable: enable (as opposed to disable) the TMDS output buffers
344353 *
345354 * Set the state of the TMDS output buffers in the adaptor. For
346− * type2 this is set via the DP_DUAL_MODE_TMDS_OEN register. As
347− * some type 1 adaptors have problems with registers (see comments
348− * in drm_dp_dual_mode_detect()) we avoid touching the register,
349− * making this function a no-op on type 1 adaptors.
355+ * type2 this is set via the DP_DUAL_MODE_TMDS_OEN register.
356+ * Type1 adaptors do not support any register writes.
350357 *
351358 * Returns:
352359 * 0 on success, negative error code on failure
drivers/gpu/drm/display/drm_dp_mst_topology.c+1−1
@@ -5186,7 +5186,7 @@ int drm_dp_mst_add_affected_dsc_crtcs(struct drm_atomic_state *state, struct drm · 5185 unmodified lines
51865186 mst_state = drm_atomic_get_mst_topology_state(state, mgr);
51875187
51885188 if (IS_ERR(mst_state))
5189− return -EINVAL;
5189+ return PTR_ERR(mst_state);
51905190
51915191 list_for_each_entry(pos, &mst_state->payloads, next) {
51925192
drivers/gpu/drm/drm_drv.c+1−1
@@ -615,7 +615,7 @@ static int drm_dev_init(struct drm_device *dev, · 614 unmodified lines
615615 mutex_init(&dev->clientlist_mutex);
616616 mutex_init(&dev->master_mutex);
617617
618− ret = drmm_add_action(dev, drm_dev_init_release, NULL);
618+ ret = drmm_add_action_or_reset(dev, drm_dev_init_release, NULL);
619619 if (ret)
620620 return ret;
621621
drivers/gpu/drm/drm_format_helper.c+47−19
@@ -807,6 +807,38 @@ static bool is_listed_fourcc(const uint32_t *fourccs, size_t nfourccs, uint32_t · 806 unmodified lines
807807 return false;
808808 }
809809
810+static const uint32_t conv_from_xrgb8888[] = {
811+ DRM_FORMAT_XRGB8888,
812+ DRM_FORMAT_ARGB8888,
813+ DRM_FORMAT_XRGB2101010,
814+ DRM_FORMAT_ARGB2101010,
815+ DRM_FORMAT_RGB565,
816+ DRM_FORMAT_RGB888,
817+};
818+
819+static const uint32_t conv_from_rgb565_888[] = {
820+ DRM_FORMAT_XRGB8888,
821+ DRM_FORMAT_ARGB8888,
822+};
823+
824+static bool is_conversion_supported(uint32_t from, uint32_t to)
825+{
826+ switch (from) {
827+ case DRM_FORMAT_XRGB8888:
828+ case DRM_FORMAT_ARGB8888:
829+ return is_listed_fourcc(conv_from_xrgb8888, ARRAY_SIZE(conv_from_xrgb8888), to);
830+ case DRM_FORMAT_RGB565:
831+ case DRM_FORMAT_RGB888:
832+ return is_listed_fourcc(conv_from_rgb565_888, ARRAY_SIZE(conv_from_rgb565_888), to);
833+ case DRM_FORMAT_XRGB2101010:
834+ return to == DRM_FORMAT_ARGB2101010;
835+ case DRM_FORMAT_ARGB2101010:
836+ return to == DRM_FORMAT_XRGB2101010;
837+ default:
838+ return false;
839+ }
840+}
841+
810842 /**
811843 * drm_fb_build_fourcc_list - Filters a list of supported color formats against
812844 * the device's native formats
@@ -827,7 +859,9 @@ static bool is_listed_fourcc(const uint32_t *fourccs, size_t nfourccs, uint32_t · 14 unmodified lines
827859 * be handed over to drm_universal_plane_init() et al. Native formats
828860 * will go before emulated formats. Other heuristics might be applied
829861 * to optimize the order. Formats near the beginning of the list are
830− * usually preferred over formats near the end of the list.
862+ * usually preferred over formats near the end of the list. Formats
863+ * without conversion helpers will be skipped. New drivers should only
864+ * pass in XRGB8888 and avoid exposing additional emulated formats.
831865 *
832866 * Returns:
833867 * The number of color-formats 4CC codes returned in @fourccs_out.
@@ -839,7 +873,7 @@ size_t drm_fb_build_fourcc_list(struct drm_device *dev, · 5 unmodified lines
839873 {
840874 u32 *fourccs = fourccs_out;
841875 const u32 *fourccs_end = fourccs_out + nfourccs_out;
842− bool found_native = false;
876+ uint32_t native_format = 0;
843877 size_t i;
844878
845879 /*
@@ -858,26 +892,18 @@ size_t drm_fb_build_fourcc_list(struct drm_device *dev, · 12 unmodified lines
858892
859893 drm_dbg_kms(dev, "adding native format %p4cc\n", &fourcc);
860894
861− if (!found_native)
862− found_native = is_listed_fourcc(driver_fourccs, driver_nfourccs, fourcc);
895+ /*
896+ * There should only be one native format with the current API.
897+ * This API needs to be refactored to correctly support arbitrary
898+ * sets of native formats, since it needs to report which native
899+ * format to use for each emulated format.
900+ */
901+ if (!native_format)
902+ native_format = fourcc;
863903 *fourccs = fourcc;
864904 ++fourccs;
865905 }
866906
867− /*
868− * The plane's atomic_update helper converts the framebuffer's color format
869− * to a native format when copying to device memory.
870− *
871− * If there is not a single format supported by both, device and
872− * driver, the native formats are likely not supported by the conversion
873− * helpers. Therefore *only* support the native formats and add a
874− * conversion helper ASAP.
875− */
876− if (!found_native) {
877− drm_warn(dev, "Format conversion helpers required to add extra formats.\n");
878− goto out;
879− }
880−
881907 /*
882908 * The extra formats, emulated by the driver, go second.
883909 */
@@ -890,6 +916,9 @@ size_t drm_fb_build_fourcc_list(struct drm_device *dev, · 6 unmodified lines
890916 } else if (fourccs == fourccs_end) {
891917 drm_warn(dev, "Ignoring emulated format %p4cc\n", &fourcc);
892918 continue; /* end of available output buffer */
919+ } else if (!is_conversion_supported(fourcc, native_format)) {
920+ drm_dbg_kms(dev, "Unsupported emulated format %p4cc\n", &fourcc);
921+ continue; /* format is not supported for conversion */
893922 }
894923
895924 drm_dbg_kms(dev, "adding emulated format %p4cc\n", &fourcc);
@@ -898,7 +927,6 @@ size_t drm_fb_build_fourcc_list(struct drm_device *dev, · 2 unmodified lines
898927 ++fourccs;
899928 }
900929
901−out:
902930 return fourccs - fourccs_out;
903931 }
904932 EXPORT_SYMBOL(drm_fb_build_fourcc_list);
drivers/gpu/drm/drm_internal.h+2−1
@@ -104,7 +104,8 @@ static inline void drm_vblank_flush_worker(struct drm_vblank_crtc *vblank) · 103 unmodified lines
104104
105105 static inline void drm_vblank_destroy_worker(struct drm_vblank_crtc *vblank)
106106 {
107− kthread_destroy_worker(vblank->worker);
107+ if (vblank->worker)
108+ kthread_destroy_worker(vblank->worker);
108109 }
109110
110111 int drm_vblank_worker_init(struct drm_vblank_crtc *vblank);
drivers/gpu/drm/drm_mode_config.c+0−3
@@ -151,9 +151,6 @@ int drm_mode_getresources(struct drm_device *dev, void *data, · 150 unmodified lines
151151 count = 0;
152152 connector_id = u64_to_user_ptr(card_res->connector_id_ptr);
153153 drm_for_each_connector_iter(connector, &conn_iter) {
154− if (connector->registration_state != DRM_CONNECTOR_REGISTERED)
155− continue;
156−
157154 /* only expose writeback connectors if userspace understands them */
158155 if (!file_priv->writeback_connectors &&
159156 (connector->connector_type == DRM_MODE_CONNECTOR_WRITEBACK))
drivers/gpu/drm/drm_panel_orientation_quirks.c+12−0
@@ -134,6 +134,12 @@ static const struct dmi_system_id orientation_data[] = { · 133 unmodified lines
134134 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "One S1003"),
135135 },
136136 .driver_data = (void *)&lcd800x1280_rightside_up,
137+ }, { /* Acer Switch V 10 (SW5-017) */
138+ .matches = {
139+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Acer"),
140+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "SW5-017"),
141+ },
142+ .driver_data = (void *)&lcd800x1280_rightside_up,
137143 }, { /* Anbernic Win600 */
138144 .matches = {
139145 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Anbernic"),
@@ -319,6 +325,12 @@ static const struct dmi_system_id orientation_data[] = { · 179 unmodified lines
319325 DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21"),
320326 },
321327 .driver_data = (void *)&lcd1200x1920_rightside_up,
328+ }, { /* Nanote UMPC-01 */
329+ .matches = {
330+ DMI_MATCH(DMI_SYS_VENDOR, "RWC CO.,LTD"),
331+ DMI_MATCH(DMI_PRODUCT_NAME, "UMPC-01"),
332+ },
333+ .driver_data = (void *)&lcd1200x1920_rightside_up,
322334 }, { /* OneGX1 Pro */
323335 .matches = {
324336 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "SYSTEM_MANUFACTURER"),
drivers/gpu/drm/i915/Makefile+1−0
@@ -282,6 +282,7 @@ i915-y += \ · 281 unmodified lines
282282 display/intel_ddi.o \
283283 display/intel_ddi_buf_trans.o \
284284 display/intel_display_trace.o \
285+ display/intel_dkl_phy.o \
285286 display/intel_dp.o \
286287 display/intel_dp_aux.o \
287288 display/intel_dp_aux_backlight.o \
drivers/gpu/drm/i915/display/intel_ddi.c+28−40
@@ -43,6 +43,7 @@ · 42 unmodified lines
4343 #include "intel_de.h"
4444 #include "intel_display_power.h"
4545 #include "intel_display_types.h"
46+#include "intel_dkl_phy.h"
4647 #include "intel_dp.h"
4748 #include "intel_dp_link_training.h"
4849 #include "intel_dp_mst.h"
@@ -1262,33 +1263,30 @@ static void tgl_dkl_phy_set_signal_levels(struct intel_encoder *encoder, · 1213 unmodified lines
12621263 for (ln = 0; ln < 2; ln++) {
12631264 int level;
12641265
1265− intel_de_write(dev_priv, HIP_INDEX_REG(tc_port),
1266− HIP_INDEX_VAL(tc_port, ln));
1267−
1268− intel_de_write(dev_priv, DKL_TX_PMD_LANE_SUS(tc_port), 0);
1266+ intel_dkl_phy_write(dev_priv, DKL_TX_PMD_LANE_SUS(tc_port), ln, 0);
12691267
12701268 level = intel_ddi_level(encoder, crtc_state, 2*ln+0);
12711269
1272− intel_de_rmw(dev_priv, DKL_TX_DPCNTL0(tc_port),
1273− DKL_TX_PRESHOOT_COEFF_MASK |
1274− DKL_TX_DE_EMPAHSIS_COEFF_MASK |
1275− DKL_TX_VSWING_CONTROL_MASK,
1276− DKL_TX_PRESHOOT_COEFF(trans->entries[level].dkl.preshoot) |
1277− DKL_TX_DE_EMPHASIS_COEFF(trans->entries[level].dkl.de_emphasis) |
1278− DKL_TX_VSWING_CONTROL(trans->entries[level].dkl.vswing));
1270+ intel_dkl_phy_rmw(dev_priv, DKL_TX_DPCNTL0(tc_port), ln,
1271+ DKL_TX_PRESHOOT_COEFF_MASK |
1272+ DKL_TX_DE_EMPAHSIS_COEFF_MASK |
1273+ DKL_TX_VSWING_CONTROL_MASK,
1274+ DKL_TX_PRESHOOT_COEFF(trans->entries[level].dkl.preshoot) |
1275+ DKL_TX_DE_EMPHASIS_COEFF(trans->entries[level].dkl.de_emphasis) |
1276+ DKL_TX_VSWING_CONTROL(trans->entries[level].dkl.vswing));
12791277
12801278 level = intel_ddi_level(encoder, crtc_state, 2*ln+1);
12811279
1282− intel_de_rmw(dev_priv, DKL_TX_DPCNTL1(tc_port),
1283− DKL_TX_PRESHOOT_COEFF_MASK |
1284− DKL_TX_DE_EMPAHSIS_COEFF_MASK |
1285− DKL_TX_VSWING_CONTROL_MASK,
1286− DKL_TX_PRESHOOT_COEFF(trans->entries[level].dkl.preshoot) |
1287− DKL_TX_DE_EMPHASIS_COEFF(trans->entries[level].dkl.de_emphasis) |
1288− DKL_TX_VSWING_CONTROL(trans->entries[level].dkl.vswing));
1280+ intel_dkl_phy_rmw(dev_priv, DKL_TX_DPCNTL1(tc_port), ln,
1281+ DKL_TX_PRESHOOT_COEFF_MASK |
1282+ DKL_TX_DE_EMPAHSIS_COEFF_MASK |
1283+ DKL_TX_VSWING_CONTROL_MASK,
1284+ DKL_TX_PRESHOOT_COEFF(trans->entries[level].dkl.preshoot) |
1285+ DKL_TX_DE_EMPHASIS_COEFF(trans->entries[level].dkl.de_emphasis) |
1286+ DKL_TX_VSWING_CONTROL(trans->entries[level].dkl.vswing));
12891287
1290− intel_de_rmw(dev_priv, DKL_TX_DPCNTL2(tc_port),
1291− DKL_TX_DP20BITMODE, 0);
1288+ intel_dkl_phy_rmw(dev_priv, DKL_TX_DPCNTL2(tc_port), ln,
1289+ DKL_TX_DP20BITMODE, 0);
12921290
12931291 if (IS_ALDERLAKE_P(dev_priv)) {
12941292 u32 val;
@@ -1306,10 +1304,10 @@ static void tgl_dkl_phy_set_signal_levels(struct intel_encoder *encoder, · 11 unmodified lines
13061304 val |= DKL_TX_DPCNTL2_CFG_LOADGENSELECT_TX2(0);
13071305 }
13081306
1309− intel_de_rmw(dev_priv, DKL_TX_DPCNTL2(tc_port),
1310− DKL_TX_DPCNTL2_CFG_LOADGENSELECT_TX1_MASK |
1311− DKL_TX_DPCNTL2_CFG_LOADGENSELECT_TX2_MASK,
1312− val);
1307+ intel_dkl_phy_rmw(dev_priv, DKL_TX_DPCNTL2(tc_port), ln,
1308+ DKL_TX_DPCNTL2_CFG_LOADGENSELECT_TX1_MASK |
1309+ DKL_TX_DPCNTL2_CFG_LOADGENSELECT_TX2_MASK,
1310+ val);
13131311 }
13141312 }
13151313 }
@@ -2019,12 +2017,8 @@ icl_program_mg_dp_mode(struct intel_digital_port *dig_port, · 703 unmodified lines
20192017 return;
20202018
20212019 if (DISPLAY_VER(dev_priv) >= 12) {
2022− intel_de_write(dev_priv, HIP_INDEX_REG(tc_port),
2023− HIP_INDEX_VAL(tc_port, 0x0));
2024− ln0 = intel_de_read(dev_priv, DKL_DP_MODE(tc_port));
2025− intel_de_write(dev_priv, HIP_INDEX_REG(tc_port),
2026− HIP_INDEX_VAL(tc_port, 0x1));
2027− ln1 = intel_de_read(dev_priv, DKL_DP_MODE(tc_port));
2020+ ln0 = intel_dkl_phy_read(dev_priv, DKL_DP_MODE(tc_port), 0);
2021+ ln1 = intel_dkl_phy_read(dev_priv, DKL_DP_MODE(tc_port), 1);
20282022 } else {
20292023 ln0 = intel_de_read(dev_priv, MG_DP_MODE(0, tc_port));
20302024 ln1 = intel_de_read(dev_priv, MG_DP_MODE(1, tc_port));
@@ -2085,12 +2079,8 @@ icl_program_mg_dp_mode(struct intel_digital_port *dig_port, · 54 unmodified lines
20852079 }
20862080
20872081 if (DISPLAY_VER(dev_priv) >= 12) {
2088− intel_de_write(dev_priv, HIP_INDEX_REG(tc_port),
2089− HIP_INDEX_VAL(tc_port, 0x0));
2090− intel_de_write(dev_priv, DKL_DP_MODE(tc_port), ln0);
2091− intel_de_write(dev_priv, HIP_INDEX_REG(tc_port),
2092− HIP_INDEX_VAL(tc_port, 0x1));
2093− intel_de_write(dev_priv, DKL_DP_MODE(tc_port), ln1);
2082+ intel_dkl_phy_write(dev_priv, DKL_DP_MODE(tc_port), 0, ln0);
2083+ intel_dkl_phy_write(dev_priv, DKL_DP_MODE(tc_port), 1, ln1);
20942084 } else {
20952085 intel_de_write(dev_priv, MG_DP_MODE(0, tc_port), ln0);
20962086 intel_de_write(dev_priv, MG_DP_MODE(1, tc_port), ln1);
@@ -3094,10 +3084,8 @@ static void adlp_tbt_to_dp_alt_switch_wa(struct intel_encoder *encoder) · 997 unmodified lines
30943084 enum tc_port tc_port = intel_port_to_tc(i915, encoder->port);
30953085 int ln;
30963086
3097− for (ln = 0; ln < 2; ln++) {
3098− intel_de_write(i915, HIP_INDEX_REG(tc_port), HIP_INDEX_VAL(tc_port, ln));
3099− intel_de_rmw(i915, DKL_PCS_DW5(tc_port), DKL_PCS_DW5_CORE_SOFTRESET, 0);
3100− }
3087+ for (ln = 0; ln < 2; ln++)
3088+ intel_dkl_phy_rmw(i915, DKL_PCS_DW5(tc_port), ln, DKL_PCS_DW5_CORE_SOFTRESET, 0);
31013089 }
31023090
31033091 static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
drivers/gpu/drm/i915/display/intel_display.c+7−3
@@ -3723,12 +3723,16 @@ out: · 3722 unmodified lines
37233723
37243724 static u8 bigjoiner_pipes(struct drm_i915_private *i915)
37253725 {
3726+ u8 pipes;
3727+
37263728 if (DISPLAY_VER(i915) >= 12)
3727− return BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D);
3729+ pipes = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D);
37283730 else if (DISPLAY_VER(i915) >= 11)
3729− return BIT(PIPE_B) | BIT(PIPE_C);
3731+ pipes = BIT(PIPE_B) | BIT(PIPE_C);
37303732 else
3731− return 0;
3733+ pipes = 0;
3734+
3735+ return pipes & RUNTIME_INFO(i915)->pipe_mask;
37323736 }
37333737
37343738 static bool transcoder_ddi_func_is_enabled(struct drm_i915_private *dev_priv,
drivers/gpu/drm/i915/display/intel_display_core.h+8−0
@@ -315,6 +315,14 @@ struct intel_display { · 314 unmodified lines
315315 struct intel_global_obj obj;
316316 } dbuf;
317317
318+ struct {
319+ /*
320+ * dkl.phy_lock protects against concurrent access of the
321+ * Dekel TypeC PHYs.
322+ */
323+ spinlock_t phy_lock;
324+ } dkl;
325+
318326 struct {
319327 /* VLV/CHV/BXT/GLK DSI MMIO register base address */
320328 u32 mmio_base;
drivers/gpu/drm/i915/display/intel_display_power.c+4−4
@@ -2434,7 +2434,7 @@ intel_display_power_ddi_io_domain(struct drm_i915_private *i915, enum port port) · 2433 unmodified lines
24342434 {
24352435 const struct intel_ddi_port_domains *domains = intel_port_domains_for_port(i915, port);
24362436
2437− if (drm_WARN_ON(&i915->drm, !domains) || domains->ddi_io == POWER_DOMAIN_INVALID)
2437+ if (drm_WARN_ON(&i915->drm, !domains || domains->ddi_io == POWER_DOMAIN_INVALID))
24382438 return POWER_DOMAIN_PORT_DDI_IO_A;
24392439
24402440 return domains->ddi_io + (int)(port - domains->port_start);
@@ -2445,7 +2445,7 @@ intel_display_power_ddi_lanes_domain(struct drm_i915_private *i915, enum port po · 4 unmodified lines
24452445 {
24462446 const struct intel_ddi_port_domains *domains = intel_port_domains_for_port(i915, port);
24472447
2448− if (drm_WARN_ON(&i915->drm, !domains) || domains->ddi_lanes == POWER_DOMAIN_INVALID)
2448+ if (drm_WARN_ON(&i915->drm, !domains || domains->ddi_lanes == POWER_DOMAIN_INVALID))
24492449 return POWER_DOMAIN_PORT_DDI_LANES_A;
24502450
24512451 return domains->ddi_lanes + (int)(port - domains->port_start);
@@ -2471,7 +2471,7 @@ intel_display_power_legacy_aux_domain(struct drm_i915_private *i915, enum aux_ch · 19 unmodified lines
24712471 {
24722472 const struct intel_ddi_port_domains *domains = intel_port_domains_for_aux_ch(i915, aux_ch);
24732473
2474− if (drm_WARN_ON(&i915->drm, !domains) || domains->aux_legacy_usbc == POWER_DOMAIN_INVALID)
2474+ if (drm_WARN_ON(&i915->drm, !domains || domains->aux_legacy_usbc == POWER_DOMAIN_INVALID))
24752475 return POWER_DOMAIN_AUX_A;
24762476
24772477 return domains->aux_legacy_usbc + (int)(aux_ch - domains->aux_ch_start);
@@ -2482,7 +2482,7 @@ intel_display_power_tbt_aux_domain(struct drm_i915_private *i915, enum aux_ch au · 4 unmodified lines
24822482 {
24832483 const struct intel_ddi_port_domains *domains = intel_port_domains_for_aux_ch(i915, aux_ch);
24842484
2485− if (drm_WARN_ON(&i915->drm, !domains) || domains->aux_tbt == POWER_DOMAIN_INVALID)
2485+ if (drm_WARN_ON(&i915->drm, !domains || domains->aux_tbt == POWER_DOMAIN_INVALID))
24862486 return POWER_DOMAIN_AUX_TBT1;
24872487
24882488 return domains->aux_tbt + (int)(aux_ch - domains->aux_ch_start);
drivers/gpu/drm/i915/display/intel_display_power_well.c+3−4
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include "intel_de.h"
1313 #include "intel_display_power_well.h"
1414 #include "intel_display_types.h"
15+#include "intel_dkl_phy.h"
1516 #include "intel_dmc.h"
1617 #include "intel_dpio_phy.h"
1718 #include "intel_dpll.h"
@@ -529,11 +530,9 @@ icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv, · 511 unmodified lines
529530 enum tc_port tc_port;
530531
531532 tc_port = TGL_AUX_PW_TO_TC_PORT(i915_power_well_instance(power_well)->hsw.idx);
532− intel_de_write(dev_priv, HIP_INDEX_REG(tc_port),
533− HIP_INDEX_VAL(tc_port, 0x2));
534533
535− if (intel_de_wait_for_set(dev_priv, DKL_CMN_UC_DW_27(tc_port),
536− DKL_CMN_UC_DW27_UC_HEALTH, 1))
534+ if (wait_for(intel_dkl_phy_read(dev_priv, DKL_CMN_UC_DW_27(tc_port), 2) &
535+ DKL_CMN_UC_DW27_UC_HEALTH, 1))
537536 drm_warn(&dev_priv->drm,
538537 "Timeout waiting TC uC health\n");
539538 }
drivers/gpu/drm/i915/display/intel_dkl_phy.c+109−0
@@ -0,0 +1,109 @@
1+// SPDX-License-Identifier: MIT
2+/*
3+ * Copyright © 2022 Intel Corporation
4+ */
5+
6+#include "i915_drv.h"
7+#include "i915_reg.h"
8+
9+#include "intel_de.h"
10+#include "intel_display.h"
11+#include "intel_dkl_phy.h"
12+
13+static void
14+dkl_phy_set_hip_idx(struct drm_i915_private *i915, i915_reg_t reg, int idx)
15+{
16+ enum tc_port tc_port = DKL_REG_TC_PORT(reg);
17+
18+ drm_WARN_ON(&i915->drm, tc_port < TC_PORT_1 || tc_port >= I915_MAX_TC_PORTS);
19+
20+ intel_de_write(i915,
21+ HIP_INDEX_REG(tc_port),
22+ HIP_INDEX_VAL(tc_port, idx));
23+}
24+
25+/**
26+ * intel_dkl_phy_read - read a Dekel PHY register
27+ * @i915: i915 device instance
28+ * @reg: Dekel PHY register
29+ * @ln: lane instance of @reg
30+ *
31+ * Read the @reg Dekel PHY register.
32+ *
33+ * Returns the read value.
34+ */
35+u32
36+intel_dkl_phy_read(struct drm_i915_private *i915, i915_reg_t reg, int ln)
37+{
38+ u32 val;
39+
40+ spin_lock(&i915->display.dkl.phy_lock);
41+
42+ dkl_phy_set_hip_idx(i915, reg, ln);
43+ val = intel_de_read(i915, reg);
44+
45+ spin_unlock(&i915->display.dkl.phy_lock);
46+
47+ return val;
48+}
49+
50+/**
51+ * intel_dkl_phy_write - write a Dekel PHY register
52+ * @i915: i915 device instance
53+ * @reg: Dekel PHY register
54+ * @ln: lane instance of @reg
55+ * @val: value to write
56+ *
57+ * Write @val to the @reg Dekel PHY register.
58+ */
59+void
60+intel_dkl_phy_write(struct drm_i915_private *i915, i915_reg_t reg, int ln, u32 val)
61+{
62+ spin_lock(&i915->display.dkl.phy_lock);
63+
64+ dkl_phy_set_hip_idx(i915, reg, ln);
65+ intel_de_write(i915, reg, val);
66+
67+ spin_unlock(&i915->display.dkl.phy_lock);
68+}
69+
70+/**
71+ * intel_dkl_phy_rmw - read-modify-write a Dekel PHY register
72+ * @i915: i915 device instance
73+ * @reg: Dekel PHY register
74+ * @ln: lane instance of @reg
75+ * @clear: mask to clear
76+ * @set: mask to set
77+ *
78+ * Read the @reg Dekel PHY register, clearing then setting the @clear/@set bits in it, and writing
79+ * this value back to the register if the value differs from the read one.
80+ */
81+void
82+intel_dkl_phy_rmw(struct drm_i915_private *i915, i915_reg_t reg, int ln, u32 clear, u32 set)
83+{
84+ spin_lock(&i915->display.dkl.phy_lock);
85+
86+ dkl_phy_set_hip_idx(i915, reg, ln);
87+ intel_de_rmw(i915, reg, clear, set);
88+
89+ spin_unlock(&i915->display.dkl.phy_lock);
90+}
91+
92+/**
93+ * intel_dkl_phy_posting_read - do a posting read from a Dekel PHY register
94+ * @i915: i915 device instance
95+ * @reg: Dekel PHY register
96+ * @ln: lane instance of @reg
97+ *
98+ * Read the @reg Dekel PHY register without returning the read value.
99+ */
100+void
101+intel_dkl_phy_posting_read(struct drm_i915_private *i915, i915_reg_t reg, int ln)
102+{
103+ spin_lock(&i915->display.dkl.phy_lock);
104+
105+ dkl_phy_set_hip_idx(i915, reg, ln);
106+ intel_de_posting_read(i915, reg);
107+
108+ spin_unlock(&i915->display.dkl.phy_lock);
109+}
drivers/gpu/drm/i915/display/intel_dkl_phy.h+24−0
@@ -0,0 +1,24 @@
1+/* SPDX-License-Identifier: MIT */
2+/*
3+ * Copyright © 2022 Intel Corporation
4+ */
5+
6+#ifndef __INTEL_DKL_PHY_H__
7+#define __INTEL_DKL_PHY_H__
8+
9+#include <linux/types.h>
10+
11+#include "i915_reg_defs.h"
12+
13+struct drm_i915_private;
14+
15+u32
16+intel_dkl_phy_read(struct drm_i915_private *i915, i915_reg_t reg, int ln);
17+void
18+intel_dkl_phy_write(struct drm_i915_private *i915, i915_reg_t reg, int ln, u32 val);
19+void
20+intel_dkl_phy_rmw(struct drm_i915_private *i915, i915_reg_t reg, int ln, u32 clear, u32 set);
21+void
22+intel_dkl_phy_posting_read(struct drm_i915_private *i915, i915_reg_t reg, int ln);
23+
24+#endif /* __INTEL_DKL_PHY_H__ */
drivers/gpu/drm/i915/display/intel_dp.c+1−1
@@ -5276,7 +5276,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, · 5275 unmodified lines
52765276 encoder->devdata, IS_ERR(edid) ? NULL : edid);
52775277
52785278 intel_panel_add_edid_fixed_modes(intel_connector,
5279− intel_connector->panel.vbt.drrs_type != DRRS_TYPE_NONE,
5279+ intel_connector->panel.vbt.drrs_type != DRRS_TYPE_NONE ||
52805280 intel_vrr_is_capable(intel_connector));
52815281
52825282 /* MSO requires information from the EDID */
drivers/gpu/drm/i915/display/intel_dpll_mgr.c+27−32
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525
2626 #include "intel_de.h"
2727 #include "intel_display_types.h"
28+#include "intel_dkl_phy.h"
2829 #include "intel_dpio_phy.h"
2930 #include "intel_dpll.h"
3031 #include "intel_dpll_mgr.h"
@@ -3508,15 +3509,12 @@ static bool dkl_pll_get_hw_state(struct drm_i915_private *dev_priv, · 3477 unmodified lines
35083509 * All registers read here have the same HIP_INDEX_REG even though
35093510 * they are on different building blocks
35103511 */
3511− intel_de_write(dev_priv, HIP_INDEX_REG(tc_port),
3512− HIP_INDEX_VAL(tc_port, 0x2));
3513−
3514− hw_state->mg_refclkin_ctl = intel_de_read(dev_priv,
3515− DKL_REFCLKIN_CTL(tc_port));
3512+ hw_state->mg_refclkin_ctl = intel_dkl_phy_read(dev_priv,
3513+ DKL_REFCLKIN_CTL(tc_port), 2);
35163514 hw_state->mg_refclkin_ctl &= MG_REFCLKIN_CTL_OD_2_MUX_MASK;
35173515
35183516 hw_state->mg_clktop2_hsclkctl =
3519− intel_de_read(dev_priv, DKL_CLKTOP2_HSCLKCTL(tc_port));
3517+ intel_dkl_phy_read(dev_priv, DKL_CLKTOP2_HSCLKCTL(tc_port), 2);
35203518 hw_state->mg_clktop2_hsclkctl &=
35213519 MG_CLKTOP2_HSCLKCTL_TLINEDRV_CLKSEL_MASK |
35223520 MG_CLKTOP2_HSCLKCTL_CORE_INPUTSEL_MASK |
@@ -3524,32 +3522,32 @@ static bool dkl_pll_get_hw_state(struct drm_i915_private *dev_priv, · 1 unmodified line
35243522 MG_CLKTOP2_HSCLKCTL_DSDIV_RATIO_MASK;
35253523
35263524 hw_state->mg_clktop2_coreclkctl1 =
3527− intel_de_read(dev_priv, DKL_CLKTOP2_CORECLKCTL1(tc_port));
3525+ intel_dkl_phy_read(dev_priv, DKL_CLKTOP2_CORECLKCTL1(tc_port), 2);
35283526 hw_state->mg_clktop2_coreclkctl1 &=
35293527 MG_CLKTOP2_CORECLKCTL1_A_DIVRATIO_MASK;
35303528
3531− hw_state->mg_pll_div0 = intel_de_read(dev_priv, DKL_PLL_DIV0(tc_port));
3529+ hw_state->mg_pll_div0 = intel_dkl_phy_read(dev_priv, DKL_PLL_DIV0(tc_port), 2);
35323530 val = DKL_PLL_DIV0_MASK;
35333531 if (dev_priv->display.vbt.override_afc_startup)
35343532 val |= DKL_PLL_DIV0_AFC_STARTUP_MASK;
35353533 hw_state->mg_pll_div0 &= val;
35363534
3537− hw_state->mg_pll_div1 = intel_de_read(dev_priv, DKL_PLL_DIV1(tc_port));
3535+ hw_state->mg_pll_div1 = intel_dkl_phy_read(dev_priv, DKL_PLL_DIV1(tc_port), 2);
35383536 hw_state->mg_pll_div1 &= (DKL_PLL_DIV1_IREF_TRIM_MASK |
35393537 DKL_PLL_DIV1_TDC_TARGET_CNT_MASK);
35403538
3541− hw_state->mg_pll_ssc = intel_de_read(dev_priv, DKL_PLL_SSC(tc_port));
3539+ hw_state->mg_pll_ssc = intel_dkl_phy_read(dev_priv, DKL_PLL_SSC(tc_port), 2);
35423540 hw_state->mg_pll_ssc &= (DKL_PLL_SSC_IREF_NDIV_RATIO_MASK |
35433541 DKL_PLL_SSC_STEP_LEN_MASK |
35443542 DKL_PLL_SSC_STEP_NUM_MASK |
35453543 DKL_PLL_SSC_EN);
35463544
3547− hw_state->mg_pll_bias = intel_de_read(dev_priv, DKL_PLL_BIAS(tc_port));
3545+ hw_state->mg_pll_bias = intel_dkl_phy_read(dev_priv, DKL_PLL_BIAS(tc_port), 2);
35483546 hw_state->mg_pll_bias &= (DKL_PLL_BIAS_FRAC_EN_H |
35493547 DKL_PLL_BIAS_FBDIV_FRAC_MASK);
35503548
35513549 hw_state->mg_pll_tdc_coldst_bias =
3552− intel_de_read(dev_priv, DKL_PLL_TDC_COLDST_BIAS(tc_port));
3550+ intel_dkl_phy_read(dev_priv, DKL_PLL_TDC_COLDST_BIAS(tc_port), 2);
35533551 hw_state->mg_pll_tdc_coldst_bias &= (DKL_PLL_TDC_SSC_STEP_SIZE_MASK |
35543552 DKL_PLL_TDC_FEED_FWD_GAIN_MASK);
35553553
@@ -3737,61 +3735,58 @@ static void dkl_pll_write(struct drm_i915_private *dev_priv, · 181 unmodified lines
37373735 * All registers programmed here have the same HIP_INDEX_REG even
37383736 * though on different building block
37393737 */
3740− intel_de_write(dev_priv, HIP_INDEX_REG(tc_port),
3741− HIP_INDEX_VAL(tc_port, 0x2));
3742−
37433738 /* All the registers are RMW */
3744− val = intel_de_read(dev_priv, DKL_REFCLKIN_CTL(tc_port));
3739+ val = intel_dkl_phy_read(dev_priv, DKL_REFCLKIN_CTL(tc_port), 2);
37453740 val &= ~MG_REFCLKIN_CTL_OD_2_MUX_MASK;
37463741 val |= hw_state->mg_refclkin_ctl;
3747− intel_de_write(dev_priv, DKL_REFCLKIN_CTL(tc_port), val);
3742+ intel_dkl_phy_write(dev_priv, DKL_REFCLKIN_CTL(tc_port), 2, val);
37483743
3749− val = intel_de_read(dev_priv, DKL_CLKTOP2_CORECLKCTL1(tc_port));
3744+ val = intel_dkl_phy_read(dev_priv, DKL_CLKTOP2_CORECLKCTL1(tc_port), 2);
37503745 val &= ~MG_CLKTOP2_CORECLKCTL1_A_DIVRATIO_MASK;
37513746 val |= hw_state->mg_clktop2_coreclkctl1;
3752− intel_de_write(dev_priv, DKL_CLKTOP2_CORECLKCTL1(tc_port), val);
3747+ intel_dkl_phy_write(dev_priv, DKL_CLKTOP2_CORECLKCTL1(tc_port), 2, val);
37533748
3754− val = intel_de_read(dev_priv, DKL_CLKTOP2_HSCLKCTL(tc_port));
3749+ val = intel_dkl_phy_read(dev_priv, DKL_CLKTOP2_HSCLKCTL(tc_port), 2);
37553750 val &= ~(MG_CLKTOP2_HSCLKCTL_TLINEDRV_CLKSEL_MASK |
37563751 MG_CLKTOP2_HSCLKCTL_CORE_INPUTSEL_MASK |
37573752 MG_CLKTOP2_HSCLKCTL_HSDIV_RATIO_MASK |
37583753 MG_CLKTOP2_HSCLKCTL_DSDIV_RATIO_MASK);
37593754 val |= hw_state->mg_clktop2_hsclkctl;
3760− intel_de_write(dev_priv, DKL_CLKTOP2_HSCLKCTL(tc_port), val);
3755+ intel_dkl_phy_write(dev_priv, DKL_CLKTOP2_HSCLKCTL(tc_port), 2, val);
37613756
37623757 val = DKL_PLL_DIV0_MASK;
37633758 if (dev_priv->display.vbt.override_afc_startup)
37643759 val |= DKL_PLL_DIV0_AFC_STARTUP_MASK;
3765− intel_de_rmw(dev_priv, DKL_PLL_DIV0(tc_port), val,
3766− hw_state->mg_pll_div0);
3760+ intel_dkl_phy_rmw(dev_priv, DKL_PLL_DIV0(tc_port), 2, val,
3761+ hw_state->mg_pll_div0);
37673762
3768− val = intel_de_read(dev_priv, DKL_PLL_DIV1(tc_port));
3763+ val = intel_dkl_phy_read(dev_priv, DKL_PLL_DIV1(tc_port), 2);
37693764 val &= ~(DKL_PLL_DIV1_IREF_TRIM_MASK |
37703765 DKL_PLL_DIV1_TDC_TARGET_CNT_MASK);
37713766 val |= hw_state->mg_pll_div1;
3772− intel_de_write(dev_priv, DKL_PLL_DIV1(tc_port), val);
3767+ intel_dkl_phy_write(dev_priv, DKL_PLL_DIV1(tc_port), 2, val);
37733768
3774− val = intel_de_read(dev_priv, DKL_PLL_SSC(tc_port));
3769+ val = intel_dkl_phy_read(dev_priv, DKL_PLL_SSC(tc_port), 2);
37753770 val &= ~(DKL_PLL_SSC_IREF_NDIV_RATIO_MASK |
37763771 DKL_PLL_SSC_STEP_LEN_MASK |
37773772 DKL_PLL_SSC_STEP_NUM_MASK |
37783773 DKL_PLL_SSC_EN);
37793774 val |= hw_state->mg_pll_ssc;
3780− intel_de_write(dev_priv, DKL_PLL_SSC(tc_port), val);
3775+ intel_dkl_phy_write(dev_priv, DKL_PLL_SSC(tc_port), 2, val);
37813776
3782− val = intel_de_read(dev_priv, DKL_PLL_BIAS(tc_port));
3777+ val = intel_dkl_phy_read(dev_priv, DKL_PLL_BIAS(tc_port), 2);
37833778 val &= ~(DKL_PLL_BIAS_FRAC_EN_H |
37843779 DKL_PLL_BIAS_FBDIV_FRAC_MASK);
37853780 val |= hw_state->mg_pll_bias;
3786− intel_de_write(dev_priv, DKL_PLL_BIAS(tc_port), val);
3781+ intel_dkl_phy_write(dev_priv, DKL_PLL_BIAS(tc_port), 2, val);
37873782
3788− val = intel_de_read(dev_priv, DKL_PLL_TDC_COLDST_BIAS(tc_port));
3783+ val = intel_dkl_phy_read(dev_priv, DKL_PLL_TDC_COLDST_BIAS(tc_port), 2);
37893784 val &= ~(DKL_PLL_TDC_SSC_STEP_SIZE_MASK |
37903785 DKL_PLL_TDC_FEED_FWD_GAIN_MASK);
37913786 val |= hw_state->mg_pll_tdc_coldst_bias;
3792− intel_de_write(dev_priv, DKL_PLL_TDC_COLDST_BIAS(tc_port), val);
3787+ intel_dkl_phy_write(dev_priv, DKL_PLL_TDC_COLDST_BIAS(tc_port), 2, val);
37933788
3794− intel_de_posting_read(dev_priv, DKL_PLL_TDC_COLDST_BIAS(tc_port));
3789+ intel_dkl_phy_posting_read(dev_priv, DKL_PLL_TDC_COLDST_BIAS(tc_port), 2);
37953790 }
37963791
37973792 static void icl_pll_power_enable(struct drm_i915_private *dev_priv,
drivers/gpu/drm/i915/display/intel_lvds.c+1−2
@@ -972,8 +972,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) · 971 unmodified lines
972972
973973 /* Try EDID first */
974974 intel_panel_add_edid_fixed_modes(intel_connector,
975− intel_connector->panel.vbt.drrs_type != DRRS_TYPE_NONE,
976− false);
975+ intel_connector->panel.vbt.drrs_type != DRRS_TYPE_NONE);
977976
978977 /* Failed to get EDID, what about VBT? */
979978 if (!intel_panel_preferred_fixed_mode(intel_connector))
drivers/gpu/drm/i915/display/intel_panel.c+2−2
@@ -254,10 +254,10 @@ static void intel_panel_destroy_probed_modes(struct intel_connector *connector) · 253 unmodified lines
254254 }
255255
256256 void intel_panel_add_edid_fixed_modes(struct intel_connector *connector,
257− bool has_drrs, bool has_vrr)
257+ bool use_alt_fixed_modes)
258258 {
259259 intel_panel_add_edid_preferred_mode(connector);
260− if (intel_panel_preferred_fixed_mode(connector) && (has_drrs || has_vrr))
260+ if (intel_panel_preferred_fixed_mode(connector) && use_alt_fixed_modes)
261261 intel_panel_add_edid_alt_fixed_modes(connector);
262262 intel_panel_destroy_probed_modes(connector);
263263 }
drivers/gpu/drm/i915/display/intel_panel.h+1−1
@@ -44,7 +44,7 @@ int intel_panel_fitting(struct intel_crtc_state *crtc_state, · 43 unmodified lines
4444 int intel_panel_compute_config(struct intel_connector *connector,
4545 struct drm_display_mode *adjusted_mode);
4646 void intel_panel_add_edid_fixed_modes(struct intel_connector *connector,
47− bool has_drrs, bool has_vrr);
47+ bool use_alt_fixed_modes);
4848 void intel_panel_add_vbt_lfp_fixed_mode(struct intel_connector *connector);
4949 void intel_panel_add_vbt_sdvo_fixed_mode(struct intel_connector *connector);
5050 void intel_panel_add_encoder_fixed_mode(struct intel_connector *connector,
drivers/gpu/drm/i915/display/intel_psr.c+4−1
@@ -2201,8 +2201,11 @@ static void _psr_invalidate_handle(struct intel_dp *intel_dp) · 2200 unmodified lines
22012201 if (intel_dp->psr.psr2_sel_fetch_enabled) {
22022202 u32 val;
22032203
2204− if (intel_dp->psr.psr2_sel_fetch_cff_enabled)
2204+ if (intel_dp->psr.psr2_sel_fetch_cff_enabled) {
2205+ /* Send one update otherwise lag is observed in screen */
2206+ intel_de_write(dev_priv, CURSURFLIVE(intel_dp->psr.pipe), 0);
22052207 return;
2208+ }
22062209
22072210 val = man_trk_ctl_enable_bit_get(dev_priv) |
22082211 man_trk_ctl_partial_frame_bit_get(dev_priv) |
drivers/gpu/drm/i915/display/intel_sdvo.c+39−25
@@ -2747,13 +2747,10 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) · 2746 unmodified lines
27472747 if (!intel_sdvo_connector)
27482748 return false;
27492749
2750− if (device == 0) {
2751− intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0;
2750+ if (device == 0)
27522751 intel_sdvo_connector->output_flag = SDVO_OUTPUT_TMDS0;
2753− } else if (device == 1) {
2754− intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1;
2752+ else if (device == 1)
27552753 intel_sdvo_connector->output_flag = SDVO_OUTPUT_TMDS1;
2756− }
27572754
27582755 intel_connector = &intel_sdvo_connector->base;
27592756 connector = &intel_connector->base;
@@ -2808,7 +2805,6 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type) · 48 unmodified lines
28082805 encoder->encoder_type = DRM_MODE_ENCODER_TVDAC;
28092806 connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO;
28102807
2811− intel_sdvo->controlled_output |= type;
28122808 intel_sdvo_connector->output_flag = type;
28132809
28142810 if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) {
@@ -2849,13 +2845,10 @@ intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device) · 34 unmodified lines
28492845 encoder->encoder_type = DRM_MODE_ENCODER_DAC;
28502846 connector->connector_type = DRM_MODE_CONNECTOR_VGA;
28512847
2852− if (device == 0) {
2853− intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0;
2848+ if (device == 0)
28542849 intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB0;
2855− } else if (device == 1) {
2856− intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1;
2850+ else if (device == 1)
28572851 intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB1;
2858− }
28592852
28602853 if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) {
28612854 kfree(intel_sdvo_connector);
@@ -2885,13 +2878,10 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device) · 23 unmodified lines
28852878 encoder->encoder_type = DRM_MODE_ENCODER_LVDS;
28862879 connector->connector_type = DRM_MODE_CONNECTOR_LVDS;
28872880
2888− if (device == 0) {
2889− intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0;
2881+ if (device == 0)
28902882 intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS0;
2891− } else if (device == 1) {
2892− intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1;
2883+ else if (device == 1)
28932884 intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS1;
2894− }
28952885
28962886 if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) {
28972887 kfree(intel_sdvo_connector);
@@ -2910,8 +2900,12 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device) · 12 unmodified lines
29102900 intel_panel_add_vbt_sdvo_fixed_mode(intel_connector);
29112901
29122902 if (!intel_panel_preferred_fixed_mode(intel_connector)) {
2903+ mutex_lock(&i915->drm.mode_config.mutex);
2904+
29132905 intel_ddc_get_modes(connector, &intel_sdvo->ddc);
2914− intel_panel_add_edid_fixed_modes(intel_connector, false, false);
2906+ intel_panel_add_edid_fixed_modes(intel_connector, false);
2907+
2908+ mutex_unlock(&i915->drm.mode_config.mutex);
29152909 }
29162910
29172911 intel_panel_init(intel_connector);
@@ -2926,16 +2920,39 @@ err: · 8 unmodified lines
29262920 return false;
29272921 }
29282922
2923+static u16 intel_sdvo_filter_output_flags(u16 flags)
2924+{
2925+ flags &= SDVO_OUTPUT_MASK;
2926+
2927+ /* SDVO requires XXX1 function may not exist unless it has XXX0 function.*/
2928+ if (!(flags & SDVO_OUTPUT_TMDS0))
2929+ flags &= ~SDVO_OUTPUT_TMDS1;
2930+
2931+ if (!(flags & SDVO_OUTPUT_RGB0))
2932+ flags &= ~SDVO_OUTPUT_RGB1;
2933+
2934+ if (!(flags & SDVO_OUTPUT_LVDS0))
2935+ flags &= ~SDVO_OUTPUT_LVDS1;
2936+
2937+ return flags;
2938+}
2939+
29292940 static bool
29302941 intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags)
29312942 {
2932− /* SDVO requires XXX1 function may not exist unless it has XXX0 function.*/
2943+ struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev);
2944+
2945+ flags = intel_sdvo_filter_output_flags(flags);
2946+
2947+ intel_sdvo->controlled_output = flags;
2948+
2949+ intel_sdvo_select_ddc_bus(i915, intel_sdvo);
29332950
29342951 if (flags & SDVO_OUTPUT_TMDS0)
29352952 if (!intel_sdvo_dvi_init(intel_sdvo, 0))
29362953 return false;
29372954
2938− if ((flags & SDVO_TMDS_MASK) == SDVO_TMDS_MASK)
2955+ if (flags & SDVO_OUTPUT_TMDS1)
29392956 if (!intel_sdvo_dvi_init(intel_sdvo, 1))
29402957 return false;
29412958
@@ -2956,7 +2973,7 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags) · 14 unmodified lines
29562973 if (!intel_sdvo_analog_init(intel_sdvo, 0))
29572974 return false;
29582975
2959− if ((flags & SDVO_RGB_MASK) == SDVO_RGB_MASK)
2976+ if (flags & SDVO_OUTPUT_RGB1)
29602977 if (!intel_sdvo_analog_init(intel_sdvo, 1))
29612978 return false;
29622979
@@ -2964,14 +2981,13 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags) · 1 unmodified line
29642981 if (!intel_sdvo_lvds_init(intel_sdvo, 0))
29652982 return false;
29662983
2967− if ((flags & SDVO_LVDS_MASK) == SDVO_LVDS_MASK)
2984+ if (flags & SDVO_OUTPUT_LVDS1)
29682985 if (!intel_sdvo_lvds_init(intel_sdvo, 1))
29692986 return false;
29702987
2971− if ((flags & SDVO_OUTPUT_MASK) == 0) {
2988+ if (flags == 0) {
29722989 unsigned char bytes[2];
29732990
2974− intel_sdvo->controlled_output = 0;
29752991 memcpy(bytes, &intel_sdvo->caps.output_flags, 2);
29762992 DRM_DEBUG_KMS("%s: Unknown SDVO output type (0x%02x%02x)\n",
29772993 SDVO_NAME(intel_sdvo),
@@ -3383,8 +3399,6 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv, · 405 unmodified lines
33833399 */
33843400 intel_sdvo->base.cloneable = 0;
33853401
3386− intel_sdvo_select_ddc_bus(dev_priv, intel_sdvo);
3387−
33883402 /* Set the input timing to the screen. Assume always input 0. */
33893403 if (!intel_sdvo_set_target_input(intel_sdvo))
33903404 goto err_output;
drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c+2−2
@@ -40,13 +40,13 @@ static struct sg_table *i915_gem_map_dma_buf(struct dma_buf_attachment *attachme · 39 unmodified lines
4040 goto err;
4141 }
4242
43− ret = sg_alloc_table(st, obj->mm.pages->nents, GFP_KERNEL);
43+ ret = sg_alloc_table(st, obj->mm.pages->orig_nents, GFP_KERNEL);
4444 if (ret)
4545 goto err_free;
4646
4747 src = obj->mm.pages->sgl;
4848 dst = st->sgl;
49− for (i = 0; i < obj->mm.pages->nents; i++) {
49+ for (i = 0; i < obj->mm.pages->orig_nents; i++) {
5050 sg_set_page(dst, sg_page(src), src->length, 0);
5151 dst = sg_next(dst);
5252 src = sg_next(src);
drivers/gpu/drm/i915/gem/i915_gem_internal.c+4−15
@@ -6,7 +6,6 @@ · 5 unmodified lines
66
77 #include <linux/scatterlist.h>
88 #include <linux/slab.h>
9−#include <linux/swiotlb.h>
109
1110 #include "i915_drv.h"
1211 #include "i915_gem.h"
@@ -38,22 +37,12 @@ static int i915_gem_object_get_pages_internal(struct drm_i915_gem_object *obj) · 25 unmodified lines
3837 struct scatterlist *sg;
3938 unsigned int sg_page_sizes;
4039 unsigned int npages;
41− int max_order;
40+ int max_order = MAX_ORDER;
41+ unsigned int max_segment;
4242 gfp_t gfp;
4343
44− max_order = MAX_ORDER;
45−#ifdef CONFIG_SWIOTLB
46− if (is_swiotlb_active(obj->base.dev->dev)) {
47− unsigned int max_segment;
48−
49− max_segment = swiotlb_max_segment();
50− if (max_segment) {
51− max_segment = max_t(unsigned int, max_segment,
52− PAGE_SIZE) >> PAGE_SHIFT;
53− max_order = min(max_order, ilog2(max_segment));
54− }
55− }
56−#endif
44+ max_segment = i915_sg_segment_size(i915->drm.dev) >> PAGE_SHIFT;
45+ max_order = min(max_order, get_order(max_segment));
5746
5847 gfp = GFP_KERNEL | __GFP_HIGHMEM | __GFP_RECLAIMABLE;
5948 if (IS_I965GM(i915) || IS_I965G(i915)) {
drivers/gpu/drm/i915/gem/i915_gem_shmem.c+3−3
@@ -194,7 +194,7 @@ static int shmem_get_pages(struct drm_i915_gem_object *obj) · 193 unmodified lines
194194 struct intel_memory_region *mem = obj->mm.region;
195195 struct address_space *mapping = obj->base.filp->f_mapping;
196196 const unsigned long page_count = obj->base.size / PAGE_SIZE;
197− unsigned int max_segment = i915_sg_segment_size();
197+ unsigned int max_segment = i915_sg_segment_size(i915->drm.dev);
198198 struct sg_table *st;
199199 struct sgt_iter sgt_iter;
200200 struct page *page;
@@ -369,14 +369,14 @@ __i915_gem_object_release_shmem(struct drm_i915_gem_object *obj, · 168 unmodified lines
369369
370370 __start_cpu_write(obj);
371371 /*
372− * On non-LLC platforms, force the flush-on-acquire if this is ever
372+ * On non-LLC igfx platforms, force the flush-on-acquire if this is ever
373373 * swapped-in. Our async flush path is not trust worthy enough yet(and
374374 * happens in the wrong order), and with some tricks it's conceivable
375375 * for userspace to change the cache-level to I915_CACHE_NONE after the
376376 * pages are swapped-in, and since execbuf binds the object before doing
377377 * the async flush, we have a race window.
378378 */
379− if (!HAS_LLC(i915))
379+ if (!HAS_LLC(i915) && !IS_DGFX(i915))
380380 obj->cache_dirty = true;
381381 }
382382
drivers/gpu/drm/i915/gem/i915_gem_ttm.c+9−5
@@ -189,7 +189,7 @@ static int i915_ttm_tt_shmem_populate(struct ttm_device *bdev, · 188 unmodified lines
189189 struct drm_i915_private *i915 = container_of(bdev, typeof(*i915), bdev);
190190 struct intel_memory_region *mr = i915->mm.regions[INTEL_MEMORY_SYSTEM];
191191 struct i915_ttm_tt *i915_tt = container_of(ttm, typeof(*i915_tt), ttm);
192− const unsigned int max_segment = i915_sg_segment_size();
192+ const unsigned int max_segment = i915_sg_segment_size(i915->drm.dev);
193193 const size_t size = (size_t)ttm->num_pages << PAGE_SHIFT;
194194 struct file *filp = i915_tt->filp;
195195 struct sgt_iter sgt_iter;
@@ -538,7 +538,7 @@ static struct i915_refct_sgt *i915_ttm_tt_get_st(struct ttm_tt *ttm) · 342 unmodified lines
538538 ret = sg_alloc_table_from_pages_segment(st,
539539 ttm->pages, ttm->num_pages,
540540 0, (unsigned long)ttm->num_pages << PAGE_SHIFT,
541− i915_sg_segment_size(), GFP_KERNEL);
541+ i915_sg_segment_size(i915_tt->dev), GFP_KERNEL);
542542 if (ret) {
543543 st->sgl = NULL;
544544 return ERR_PTR(ret);
@@ -612,6 +612,10 @@ static int i915_ttm_truncate(struct drm_i915_gem_object *obj) · 67 unmodified lines
612612
613613 WARN_ON_ONCE(obj->mm.madv == I915_MADV_WILLNEED);
614614
615+ err = ttm_bo_wait(bo, true, false);
616+ if (err)
617+ return err;
618+
615619 err = i915_ttm_move_notify(bo);
616620 if (err)
617621 return err;
@@ -1013,9 +1017,6 @@ static vm_fault_t vm_fault_ttm(struct vm_fault *vmf) · 395 unmodified lines
10131017 return VM_FAULT_SIGBUS;
10141018 }
10151019
1016− if (i915_ttm_cpu_maps_iomem(bo->resource))
1017− wakeref = intel_runtime_pm_get(&to_i915(obj->base.dev)->runtime_pm);
1018−
10191020 if (!i915_ttm_resource_mappable(bo->resource)) {
10201021 int err = -ENODEV;
10211022 int i;
@@ -1042,6 +1043,9 @@ static vm_fault_t vm_fault_ttm(struct vm_fault *vmf) · 20 unmodified lines
10421043 }
10431044 }
10441045
1046+ if (i915_ttm_cpu_maps_iomem(bo->resource))
1047+ wakeref = intel_runtime_pm_get(&to_i915(obj->base.dev)->runtime_pm);
1048+
10451049 if (drm_dev_enter(dev, &idx)) {
10461050 ret = ttm_bo_vm_fault_reserved(vmf, vmf->vma->vm_page_prot,
10471051 TTM_BO_VM_NUM_PREFAULT);
drivers/gpu/drm/i915/gem/i915_gem_userptr.c+4−3
@@ -129,7 +129,7 @@ static void i915_gem_object_userptr_drop_ref(struct drm_i915_gem_object *obj) · 128 unmodified lines
129129 static int i915_gem_userptr_get_pages(struct drm_i915_gem_object *obj)
130130 {
131131 const unsigned long num_pages = obj->base.size >> PAGE_SHIFT;
132− unsigned int max_segment = i915_sg_segment_size();
132+ unsigned int max_segment = i915_sg_segment_size(obj->base.dev->dev);
133133 struct sg_table *st;
134134 unsigned int sg_page_sizes;
135135 struct page **pvec;
@@ -428,9 +428,10 @@ probe_range(struct mm_struct *mm, unsigned long addr, unsigned long len) · 292 unmodified lines
428428 {
429429 VMA_ITERATOR(vmi, mm, addr);
430430 struct vm_area_struct *vma;
431+ unsigned long end = addr + len;
431432
432433 mmap_read_lock(mm);
433− for_each_vma_range(vmi, vma, addr + len) {
434+ for_each_vma_range(vmi, vma, end) {
434435 /* Check for holes, note that we also update the addr below */
435436 if (vma->vm_start > addr)
436437 break;
@@ -442,7 +443,7 @@ probe_range(struct mm_struct *mm, unsigned long addr, unsigned long len) · 5 unmodified lines
442443 }
443444 mmap_read_unlock(mm);
444445
445− if (vma)
446+ if (vma || addr < end)
446447 return -EFAULT;
447448 return 0;
448449 }
drivers/gpu/drm/i915/gt/intel_gt.c+12−2
@@ -625,8 +625,13 @@ int intel_gt_wait_for_idle(struct intel_gt *gt, long timeout) · 624 unmodified lines
625625 return -EINTR;
626626 }
627627
628− return timeout ? timeout : intel_uc_wait_for_idle(&gt->uc,
629− remaining_timeout);
628+ if (timeout)
629+ return timeout;
630+
631+ if (remaining_timeout < 0)
632+ remaining_timeout = 0;
633+
634+ return intel_uc_wait_for_idle(&gt->uc, remaining_timeout);
630635 }
631636
632637 int intel_gt_init(struct intel_gt *gt)
@@ -1017,6 +1022,11 @@ static void mmio_invalidate_full(struct intel_gt *gt) · 384 unmodified lines
10171022 if (!i915_mmio_reg_offset(rb.reg))
10181023 continue;
10191024
1025+ if (GRAPHICS_VER(i915) == 12 && (engine->class == VIDEO_DECODE_CLASS ||
1026+ engine->class == VIDEO_ENHANCEMENT_CLASS ||
1027+ engine->class == COMPUTE_CLASS))
1028+ rb.bit = _MASKED_BIT_ENABLE(rb.bit);
1029+
10201030 intel_uncore_write_fw(uncore, rb.reg, rb.bit);
10211031 awake |= engine->mask;
10221032 }
drivers/gpu/drm/i915/gt/intel_gt_requests.c+1−1
@@ -199,7 +199,7 @@ out_active: spin_lock(&timelines->lock); · 198 unmodified lines
199199 if (remaining_timeout)
200200 *remaining_timeout = timeout;
201201
202− return active_count ? timeout : 0;
202+ return active_count ? timeout ?: -ETIME : 0;
203203 }
204204
205205 static void retire_work_handler(struct work_struct *work)
drivers/gpu/drm/i915/gvt/kvmgt.c+3−5
@@ -664,8 +664,6 @@ static int intel_vgpu_open_device(struct vfio_device *vfio_dev) · 663 unmodified lines
664664 return -ESRCH;
665665 }
666666
667− kvm_get_kvm(vgpu->vfio_device.kvm);
668−
669667 if (__kvmgt_vgpu_exist(vgpu))
670668 return -EEXIST;
671669
@@ -676,6 +674,7 @@ static int intel_vgpu_open_device(struct vfio_device *vfio_dev) · 4 unmodified lines
676674
677675 vgpu->track_node.track_write = kvmgt_page_track_write;
678676 vgpu->track_node.track_flush_slot = kvmgt_page_track_flush_slot;
677+ kvm_get_kvm(vgpu->vfio_device.kvm);
679678 kvm_page_track_register_notifier(vgpu->vfio_device.kvm,
680679 &vgpu->track_node);
681680
@@ -715,15 +714,14 @@ static void intel_vgpu_close_device(struct vfio_device *vfio_dev) · 33 unmodified lines
715714
716715 kvm_page_track_unregister_notifier(vgpu->vfio_device.kvm,
717716 &vgpu->track_node);
717+ kvm_put_kvm(vgpu->vfio_device.kvm);
718+
718719 kvmgt_protect_table_destroy(vgpu);
719720 gvt_cache_destroy(vgpu);
720721
721722 intel_vgpu_release_msi_eventfd_ctx(vgpu);
722723
723724 vgpu->attached = false;
724−
725− if (vgpu->vfio_device.kvm)
726− kvm_put_kvm(vgpu->vfio_device.kvm);
727725 }
728726
729727 static u64 intel_vgpu_get_bar_addr(struct intel_vgpu *vgpu, int bar)
drivers/gpu/drm/i915/i915_driver.c+1−0
@@ -353,6 +353,7 @@ static int i915_driver_early_probe(struct drm_i915_private *dev_priv) · 352 unmodified lines
353353 mutex_init(&dev_priv->display.wm.wm_mutex);
354354 mutex_init(&dev_priv->display.pps.mutex);
355355 mutex_init(&dev_priv->display.hdcp.comp_mutex);
356+ spin_lock_init(&dev_priv->display.dkl.phy_lock);
356357
357358 i915_memcpy_init_early(dev_priv);
358359 intel_runtime_pm_init_early(&dev_priv->runtime_pm);
drivers/gpu/drm/i915/i915_reg.h+3−0
@@ -7420,6 +7420,9 @@ enum skl_power_gate { · 7419 unmodified lines
74207420 #define _DKL_PHY5_BASE 0x16C000
74217421 #define _DKL_PHY6_BASE 0x16D000
74227422
7423+#define DKL_REG_TC_PORT(__reg) \
7424+ (TC_PORT_1 + ((__reg).reg - _DKL_PHY1_BASE) / (_DKL_PHY2_BASE - _DKL_PHY1_BASE))
7425+
74237426 /* DEKEL PHY MMIO Address = Phy base + (internal address & ~index_mask) */
74247427 #define _DKL_PCS_DW5 0x14
74257428 #define DKL_PCS_DW5(tc_port) _MMIO(_PORT(tc_port, _DKL_PHY1_BASE, \
drivers/gpu/drm/i915/i915_scatterlist.h+21−13
@@ -9,7 +9,8 @@ · 8 unmodified lines
99
1010 #include <linux/pfn.h>
1111 #include <linux/scatterlist.h>
12−#include <linux/swiotlb.h>
12+#include <linux/dma-mapping.h>
13+#include <xen/xen.h>
1314
1415 #include "i915_gem.h"
1516
@@ -127,19 +128,26 @@ static inline unsigned int i915_sg_dma_sizes(struct scatterlist *sg) · 111 unmodified lines
127128 return page_sizes;
128129 }
129130
130−static inline unsigned int i915_sg_segment_size(void)
131+static inline unsigned int i915_sg_segment_size(struct device *dev)
131132 {
132− unsigned int size = swiotlb_max_segment();
133−
134− if (size == 0)
135− size = UINT_MAX;
136−
137− size = rounddown(size, PAGE_SIZE);
138− /* swiotlb_max_segment_size can return 1 byte when it means one page. */
139− if (size < PAGE_SIZE)
140− size = PAGE_SIZE;
141−
142− return size;
133+ size_t max = min_t(size_t, UINT_MAX, dma_max_mapping_size(dev));
134+
135+ /*
136+ * For Xen PV guests pages aren't contiguous in DMA (machine) address
137+ * space. The DMA API takes care of that both in dma_alloc_* (by
138+ * calling into the hypervisor to make the pages contiguous) and in
139+ * dma_map_* (by bounce buffering). But i915 abuses ignores the
140+ * coherency aspects of the DMA API and thus can't cope with bounce
141+ * buffering actually happening, so add a hack here to force small
142+ * allocations and mappings when running in PV mode on Xen.
143+ *
144+ * Note this will still break if bounce buffering is required for other
145+ * reasons, like confidential computing hypervisors or PCIe root ports
146+ * with addressing limitations.
147+ */
148+ if (xen_pv_domain())
149+ max = PAGE_SIZE;
150+ return round_down(max, PAGE_SIZE);
143151 }
144152
145153 bool i915_sg_trim(struct sg_table *orig_st);
drivers/gpu/drm/i915/intel_dram.c+1−2
@@ -471,8 +471,7 @@ static int xelpdp_get_dram_info(struct drm_i915_private *i915) · 470 unmodified lines
471471 u32 val = intel_uncore_read(&i915->uncore, MTL_MEM_SS_INFO_GLOBAL);
472472 struct dram_info *dram_info = &i915->dram_info;
473473
474− val = REG_FIELD_GET(MTL_DDR_TYPE_MASK, val);
475− switch (val) {
474+ switch (REG_FIELD_GET(MTL_DDR_TYPE_MASK, val)) {
476475 case 0:
477476 dram_info->type = INTEL_DRAM_DDR4;
478477 break;
drivers/gpu/drm/imx/Kconfig+0−1
@@ -4,7 +4,6 @@ config DRM_IMX · 3 unmodified lines
44 select DRM_KMS_HELPER
55 select VIDEOMODE_HELPERS
66 select DRM_GEM_DMA_HELPER
7− select DRM_KMS_HELPER
87 depends on DRM && (ARCH_MXC || ARCH_MULTIPLATFORM || COMPILE_TEST)
98 depends on IMX_IPUV3_CORE
109 help
drivers/gpu/drm/imx/imx-tve.c+3−2
@@ -218,8 +218,9 @@ static int imx_tve_connector_get_modes(struct drm_connector *connector) · 217 unmodified lines
218218 return ret;
219219 }
220220
221−static int imx_tve_connector_mode_valid(struct drm_connector *connector,
222− struct drm_display_mode *mode)
221+static enum drm_mode_status
222+imx_tve_connector_mode_valid(struct drm_connector *connector,
223+ struct drm_display_mode *mode)
223224 {
224225 struct imx_tve *tve = con_to_tve(connector);
225226 unsigned long rate;
drivers/gpu/drm/lima/lima_devfreq.c+9−6
@@ -112,11 +112,6 @@ int lima_devfreq_init(struct lima_device *ldev) · 111 unmodified lines
112112 unsigned long cur_freq;
113113 int ret;
114114 const char *regulator_names[] = { "mali", NULL };
115− const char *clk_names[] = { "core", NULL };
116− struct dev_pm_opp_config config = {
117− .regulator_names = regulator_names,
118− .clk_names = clk_names,
119− };
120115
121116 if (!device_property_present(dev, "operating-points-v2"))
122117 /* Optional, continue without devfreq */
@@ -124,7 +119,15 @@ int lima_devfreq_init(struct lima_device *ldev) · 1 unmodified line
124119
125120 spin_lock_init(&ldevfreq->lock);
126121
127− ret = devm_pm_opp_set_config(dev, &config);
122+ /*
123+ * clkname is set separately so it is not affected by the optional
124+ * regulator setting which may return error.
125+ */
126+ ret = devm_pm_opp_set_clkname(dev, "core");
127+ if (ret)
128+ return ret;
129+
130+ ret = devm_pm_opp_set_regulators(dev, regulator_names);
128131 if (ret) {
129132 /* Continue if the optional regulator is missing */
130133 if (ret != -ENODEV)
drivers/gpu/drm/panel/panel-simple.c+2−0
@@ -2500,6 +2500,7 @@ static const struct display_timing logictechno_lt161010_2nh_timing = { · 2499 unmodified lines
25002500 static const struct panel_desc logictechno_lt161010_2nh = {
25012501 .timings = &logictechno_lt161010_2nh_timing,
25022502 .num_timings = 1,
2503+ .bpc = 6,
25032504 .size = {
25042505 .width = 154,
25052506 .height = 86,
@@ -2529,6 +2530,7 @@ static const struct display_timing logictechno_lt170410_2whc_timing = { · 23 unmodified lines
25292530 static const struct panel_desc logictechno_lt170410_2whc = {
25302531 .timings = &logictechno_lt170410_2whc_timing,
25312532 .num_timings = 1,
2533+ .bpc = 8,
25322534 .size = {
25332535 .width = 217,
25342536 .height = 136,
drivers/gpu/drm/panfrost/panfrost_mmu.c+10−1
@@ -250,13 +250,22 @@ void panfrost_mmu_reset(struct panfrost_device *pfdev) · 249 unmodified lines
250250
251251 static size_t get_pgsize(u64 addr, size_t size, size_t *count)
252252 {
253+ /*
254+ * io-pgtable only operates on multiple pages within a single table
255+ * entry, so we need to split at boundaries of the table size, i.e.
256+ * the next block size up. The distance from address A to the next
257+ * boundary of block size B is logically B - A % B, but in unsigned
258+ * two's complement where B is a power of two we get the equivalence
259+ * B - A % B == (B - A) % B == (n * B - A) % B, and choose n = 0 :)
260+ */
253261 size_t blk_offset = -addr % SZ_2M;
254262
255263 if (blk_offset || size < SZ_2M) {
256264 *count = min_not_zero(blk_offset, size) / SZ_4K;
257265 return SZ_4K;
258266 }
259− *count = size / SZ_2M;
267+ blk_offset = -addr % SZ_1G ?: SZ_1G;
268+ *count = min(blk_offset, size) / SZ_2M;
260269 return SZ_2M;
261270 }
262271
drivers/gpu/drm/rcar-du/Kconfig+9−4
@@ -44,13 +44,18 @@ config DRM_RCAR_LVDS · 43 unmodified lines
4444 select OF_FLATTREE
4545 select OF_OVERLAY
4646
47−config DRM_RCAR_MIPI_DSI
48− tristate "R-Car DU MIPI DSI Encoder Support"
49− depends on DRM && DRM_BRIDGE && OF
50− select DRM_MIPI_DSI
47+config DRM_RCAR_USE_MIPI_DSI
48+ bool "R-Car DU MIPI DSI Encoder Support"
49+ depends on DRM_BRIDGE && OF
50+ default DRM_RCAR_DU
5151 help
5252 Enable support for the R-Car Display Unit embedded MIPI DSI encoders.
5353
54+config DRM_RCAR_MIPI_DSI
55+ def_tristate DRM_RCAR_DU
56+ depends on DRM_RCAR_USE_MIPI_DSI
57+ select DRM_MIPI_DSI
58+
5459 config DRM_RCAR_VSP
5560 bool "R-Car DU VSP Compositor Support" if ARM
5661 default y if ARM64
drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c+19−7
@@ -752,7 +752,7 @@ static void dw_mipi_dsi_rockchip_config(struct dw_mipi_dsi_rockchip *dsi) · 751 unmodified lines
752752 static void dw_mipi_dsi_rockchip_set_lcdsel(struct dw_mipi_dsi_rockchip *dsi,
753753 int mux)
754754 {
755− if (dsi->cdata->lcdsel_grf_reg < 0)
755+ if (dsi->cdata->lcdsel_grf_reg)
756756 regmap_write(dsi->grf_regmap, dsi->cdata->lcdsel_grf_reg,
757757 mux ? dsi->cdata->lcdsel_lit : dsi->cdata->lcdsel_big);
758758 }
@@ -1051,23 +1051,31 @@ static int dw_mipi_dsi_rockchip_host_attach(void *priv_data, · 292 unmodified lines
10511051 if (ret) {
10521052 DRM_DEV_ERROR(dsi->dev, "Failed to register component: %d\n",
10531053 ret);
1054− return ret;
1054+ goto out;
10551055 }
10561056
10571057 second = dw_mipi_dsi_rockchip_find_second(dsi);
1058− if (IS_ERR(second))
1059− return PTR_ERR(second);
1058+ if (IS_ERR(second)) {
1059+ ret = PTR_ERR(second);
1060+ goto out;
1061+ }
10601062 if (second) {
10611063 ret = component_add(second, &dw_mipi_dsi_rockchip_ops);
10621064 if (ret) {
10631065 DRM_DEV_ERROR(second,
10641066 "Failed to register component: %d\n",
10651067 ret);
1066− return ret;
1068+ goto out;
10671069 }
10681070 }
10691071
10701072 return 0;
1073+
1074+out:
1075+ mutex_lock(&dsi->usage_mutex);
1076+ dsi->usage_mode = DW_DSI_USAGE_IDLE;
1077+ mutex_unlock(&dsi->usage_mutex);
1078+ return ret;
10711079 }
10721080
10731081 static int dw_mipi_dsi_rockchip_host_detach(void *priv_data,
@@ -1635,7 +1643,6 @@ static const struct rockchip_dw_dsi_chip_data rk3399_chip_data[] = { · 561 unmodified lines
16351643 static const struct rockchip_dw_dsi_chip_data rk3568_chip_data[] = {
16361644 {
16371645 .reg = 0xfe060000,
1638− .lcdsel_grf_reg = -1,
16391646 .lanecfg1_grf_reg = RK3568_GRF_VO_CON2,
16401647 .lanecfg1 = HIWORD_UPDATE(0, RK3568_DSI0_SKEWCALHS |
16411648 RK3568_DSI0_FORCETXSTOPMODE |
@@ -1645,7 +1652,6 @@ static const struct rockchip_dw_dsi_chip_data rk3568_chip_data[] = { · 3 unmodified lines
16451652 },
16461653 {
16471654 .reg = 0xfe070000,
1648− .lcdsel_grf_reg = -1,
16491655 .lanecfg1_grf_reg = RK3568_GRF_VO_CON3,
16501656 .lanecfg1 = HIWORD_UPDATE(0, RK3568_DSI1_SKEWCALHS |
16511657 RK3568_DSI1_FORCETXSTOPMODE |
@@ -1681,5 +1687,11 @@ struct platform_driver dw_mipi_dsi_rockchip_driver = { · 29 unmodified lines
16811687 .of_match_table = dw_mipi_dsi_rockchip_dt_ids,
16821688 .pm = &dw_mipi_dsi_rockchip_pm_ops,
16831689 .name = "dw-mipi-dsi-rockchip",
1690+ /*
1691+ * For dual-DSI display, one DSI pokes at the other DSI's
1692+ * drvdata in dw_mipi_dsi_rockchip_find_second(). This is not
1693+ * safe for asynchronous probe.
1694+ */
1695+ .probe_type = PROBE_FORCE_SYNCHRONOUS,
16841696 },
16851697 };
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c+2−1
@@ -565,7 +565,8 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, · 564 unmodified lines
565565
566566 ret = rockchip_hdmi_parse_dt(hdmi);
567567 if (ret) {
568− DRM_DEV_ERROR(hdmi->dev, "Unable to parse OF data\n");
568+ if (ret != -EPROBE_DEFER)
569+ DRM_DEV_ERROR(hdmi->dev, "Unable to parse OF data\n");
569570 return ret;
570571 }
571572
drivers/gpu/drm/rockchip/rockchip_drm_gem.c+4−1
@@ -364,9 +364,12 @@ rockchip_gem_create_with_handle(struct drm_file *file_priv, · 363 unmodified lines
364364 {
365365 struct rockchip_gem_object *rk_obj;
366366 struct drm_gem_object *obj;
367+ bool is_framebuffer;
367368 int ret;
368369
369− rk_obj = rockchip_gem_create_object(drm, size, false);
370+ is_framebuffer = drm->fb_helper && file_priv == drm->fb_helper->client.file;
371+
372+ rk_obj = rockchip_gem_create_object(drm, size, is_framebuffer);
370373 if (IS_ERR(rk_obj))
371374 return ERR_CAST(rk_obj);
372375
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c+8−2
@@ -877,10 +877,14 @@ static void vop2_crtc_atomic_disable(struct drm_crtc *crtc, · 876 unmodified lines
877877 {
878878 struct vop2_video_port *vp = to_vop2_video_port(crtc);
879879 struct vop2 *vop2 = vp->vop2;
880+ struct drm_crtc_state *old_crtc_state;
880881 int ret;
881882
882883 vop2_lock(vop2);
883884
885+ old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc);
886+ drm_atomic_helper_disable_planes_on_crtc(old_crtc_state, false);
887+
884888 drm_crtc_vblank_off(crtc);
885889
886890 /*
@@ -996,13 +1000,15 @@ static int vop2_plane_atomic_check(struct drm_plane *plane, · 109 unmodified lines
9961000 static void vop2_plane_atomic_disable(struct drm_plane *plane,
9971001 struct drm_atomic_state *state)
9981002 {
999− struct drm_plane_state *old_pstate = drm_atomic_get_old_plane_state(state, plane);
1003+ struct drm_plane_state *old_pstate = NULL;
10001004 struct vop2_win *win = to_vop2_win(plane);
10011005 struct vop2 *vop2 = win->vop2;
10021006
10031007 drm_dbg(vop2->drm, "%s disable\n", win->data->name);
10041008
1005− if (!old_pstate->crtc)
1009+ if (state)
1010+ old_pstate = drm_atomic_get_old_plane_state(state, plane);
1011+ if (old_pstate && !old_pstate->crtc)
10061012 return;
10071013
10081014 vop2_win_disable(win);
drivers/gpu/drm/tegra/drm.c+4−0
@@ -1093,6 +1093,10 @@ static bool host1x_drm_wants_iommu(struct host1x_device *dev) · 1092 unmodified lines
10931093 struct host1x *host1x = dev_get_drvdata(dev->dev.parent);
10941094 struct iommu_domain *domain;
10951095
1096+ /* Our IOMMU usage policy doesn't currently play well with GART */
1097+ if (of_machine_is_compatible("nvidia,tegra20"))
1098+ return false;
1099+
10961100 /*
10971101 * If the Tegra DRM clients are backed by an IOMMU, push buffers are
10981102 * likely to be allocated beyond the 32-bit boundary if sufficient
drivers/gpu/drm/vc4/vc4_drv.c+6−1
@@ -476,7 +476,12 @@ static int __init vc4_drm_register(void) · 475 unmodified lines
476476 if (ret)
477477 return ret;
478478
479− return platform_driver_register(&vc4_platform_driver);
479+ ret = platform_driver_register(&vc4_platform_driver);
480+ if (ret)
481+ platform_unregister_drivers(component_drivers,
482+ ARRAY_SIZE(component_drivers));
483+
484+ return ret;
480485 }
481486
482487 static void __exit vc4_drm_unregister(void)
drivers/gpu/drm/vc4/vc4_hdmi.c+36−11
@@ -349,27 +349,40 @@ static int vc4_hdmi_reset_link(struct drm_connector *connector, · 348 unmodified lines
349349 if (!crtc_state->active)
350350 return 0;
351351
352− if (!vc4_hdmi_supports_scrambling(encoder))
352+ mutex_lock(&vc4_hdmi->mutex);
353+
354+ if (!vc4_hdmi_supports_scrambling(encoder)) {
355+ mutex_unlock(&vc4_hdmi->mutex);
353356 return 0;
357+ }
354358
355359 scrambling_needed = vc4_hdmi_mode_needs_scrambling(&vc4_hdmi->saved_adjusted_mode,
356360 vc4_hdmi->output_bpc,
357361 vc4_hdmi->output_format);
358− if (!scrambling_needed)
362+ if (!scrambling_needed) {
363+ mutex_unlock(&vc4_hdmi->mutex);
359364 return 0;
365+ }
360366
361367 if (conn_state->commit &&
362− !try_wait_for_completion(&conn_state->commit->hw_done))
368+ !try_wait_for_completion(&conn_state->commit->hw_done)) {
369+ mutex_unlock(&vc4_hdmi->mutex);
363370 return 0;
371+ }
364372
365373 ret = drm_scdc_readb(connector->ddc, SCDC_TMDS_CONFIG, &config);
366374 if (ret < 0) {
367375 drm_err(drm, "Failed to read TMDS config: %d\n", ret);
376+ mutex_unlock(&vc4_hdmi->mutex);
368377 return 0;
369378 }
370379
371− if (!!(config & SCDC_SCRAMBLING_ENABLE) == scrambling_needed)
380+ if (!!(config & SCDC_SCRAMBLING_ENABLE) == scrambling_needed) {
381+ mutex_unlock(&vc4_hdmi->mutex);
372382 return 0;
383+ }
384+
385+ mutex_unlock(&vc4_hdmi->mutex);
373386
374387 /*
375388 * HDMI 2.0 says that one should not send scrambled data
@@ -397,9 +410,8 @@ static void vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi, · 21 unmodified lines
397410 * .adap_enable, which leads to that funtion being called with
398411 * our mutex held.
399412 *
400− * A similar situation occurs with
401− * drm_atomic_helper_connector_hdmi_reset_link() that will call
402− * into our KMS hooks if the scrambling was enabled.
413+ * A similar situation occurs with vc4_hdmi_reset_link() that
414+ * will call into our KMS hooks if the scrambling was enabled.
403415 *
404416 * Concurrency isn't an issue at the moment since we don't share
405417 * any state with any of the other frameworks so we can ignore
@@ -3160,9 +3172,16 @@ static int vc4_hdmi_init_resources(struct drm_device *drm, · 2754 unmodified lines
31603172 DRM_ERROR("Failed to get HDMI state machine clock\n");
31613173 return PTR_ERR(vc4_hdmi->hsm_clock);
31623174 }
3175+
31633176 vc4_hdmi->audio_clock = vc4_hdmi->hsm_clock;
31643177 vc4_hdmi->cec_clock = vc4_hdmi->hsm_clock;
31653178
3179+ vc4_hdmi->hsm_rpm_clock = devm_clk_get(dev, "hdmi");
3180+ if (IS_ERR(vc4_hdmi->hsm_rpm_clock)) {
3181+ DRM_ERROR("Failed to get HDMI state machine clock\n");
3182+ return PTR_ERR(vc4_hdmi->hsm_rpm_clock);
3183+ }
3184+
31663185 return 0;
31673186 }
31683187
@@ -3245,6 +3264,12 @@ static int vc5_hdmi_init_resources(struct drm_device *drm, · 76 unmodified lines
32453264 return PTR_ERR(vc4_hdmi->hsm_clock);
32463265 }
32473266
3267+ vc4_hdmi->hsm_rpm_clock = devm_clk_get(dev, "hdmi");
3268+ if (IS_ERR(vc4_hdmi->hsm_rpm_clock)) {
3269+ DRM_ERROR("Failed to get HDMI state machine clock\n");
3270+ return PTR_ERR(vc4_hdmi->hsm_rpm_clock);
3271+ }
3272+
32483273 vc4_hdmi->pixel_bvb_clock = devm_clk_get(dev, "bvb");
32493274 if (IS_ERR(vc4_hdmi->pixel_bvb_clock)) {
32503275 DRM_ERROR("Failed to get pixel bvb clock\n");
@@ -3308,7 +3333,7 @@ static int vc4_hdmi_runtime_suspend(struct device *dev) · 57 unmodified lines
33083333 {
33093334 struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
33103335
3311− clk_disable_unprepare(vc4_hdmi->hsm_clock);
3336+ clk_disable_unprepare(vc4_hdmi->hsm_rpm_clock);
33123337
33133338 return 0;
33143339 }
@@ -3326,11 +3351,11 @@ static int vc4_hdmi_runtime_resume(struct device *dev) · 11 unmodified lines
33263351 * its frequency while the power domain is active so that it
33273352 * keeps its rate.
33283353 */
3329− ret = clk_set_min_rate(vc4_hdmi->hsm_clock, HSM_MIN_CLOCK_FREQ);
3354+ ret = clk_set_min_rate(vc4_hdmi->hsm_rpm_clock, HSM_MIN_CLOCK_FREQ);
33303355 if (ret)
33313356 return ret;
33323357
3333− ret = clk_prepare_enable(vc4_hdmi->hsm_clock);
3358+ ret = clk_prepare_enable(vc4_hdmi->hsm_rpm_clock);
33343359 if (ret)
33353360 return ret;
33363361
@@ -3343,7 +3368,7 @@ static int vc4_hdmi_runtime_resume(struct device *dev) · 6 unmodified lines
33433368 * case, it will lead to a silent CPU stall. Let's make sure we
33443369 * prevent such a case.
33453370 */
3346− rate = clk_get_rate(vc4_hdmi->hsm_clock);
3371+ rate = clk_get_rate(vc4_hdmi->hsm_rpm_clock);
33473372 if (!rate) {
33483373 ret = -EINVAL;
33493374 goto err_disable_clk;
drivers/gpu/drm/vc4/vc4_hdmi.h+1−0
@@ -172,6 +172,7 @@ struct vc4_hdmi { · 171 unmodified lines
172172 struct clk *cec_clock;
173173 struct clk *pixel_clock;
174174 struct clk *hsm_clock;
175+ struct clk *hsm_rpm_clock;
175176 struct clk *audio_clock;
176177 struct clk *pixel_bvb_clock;
177178
drivers/gpu/drm/vc4/vc4_kms.c+4−4
@@ -197,8 +197,8 @@ vc4_hvs_get_new_global_state(struct drm_atomic_state *state) · 196 unmodified lines
197197 struct drm_private_state *priv_state;
198198
199199 priv_state = drm_atomic_get_new_private_obj_state(state, &vc4->hvs_channels);
200− if (IS_ERR(priv_state))
201− return ERR_CAST(priv_state);
200+ if (!priv_state)
201+ return ERR_PTR(-EINVAL);
202202
203203 return to_vc4_hvs_state(priv_state);
204204 }
@@ -210,8 +210,8 @@ vc4_hvs_get_old_global_state(struct drm_atomic_state *state) · 5 unmodified lines
210210 struct drm_private_state *priv_state;
211211
212212 priv_state = drm_atomic_get_old_private_obj_state(state, &vc4->hvs_channels);
213− if (IS_ERR(priv_state))
214− return ERR_CAST(priv_state);
213+ if (!priv_state)
214+ return ERR_PTR(-EINVAL);
215215
216216 return to_vc4_hvs_state(priv_state);
217217 }
drivers/gpu/host1x/dev.c+4−0
@@ -292,6 +292,10 @@ static void host1x_setup_virtualization_tables(struct host1x *host) · 291 unmodified lines
292292
293293 static bool host1x_wants_iommu(struct host1x *host1x)
294294 {
295+ /* Our IOMMU usage policy doesn't currently play well with GART */
296+ if (of_machine_is_compatible("nvidia,tegra20"))
297+ return false;
298+
295299 /*
296300 * If we support addressing a maximum of 32 bits of physical memory
297301 * and if the host1x firewall is enabled, there's no need to enable
drivers/hid/hid-asus.c+1−3
@@ -219,14 +219,13 @@ static void asus_report_tool_width(struct asus_drvdata *drvdat) · 218 unmodified lines
219219 {
220220 struct input_mt *mt = drvdat->input->mt;
221221 struct input_mt_slot *oldest;
222− int oldid, count, i;
222+ int oldid, i;
223223
224224 if (drvdat->tp->contact_size < 5)
225225 return;
226226
227227 oldest = NULL;
228228 oldid = mt->trkid;
229− count = 0;
230229
231230 for (i = 0; i < mt->num_slots; ++i) {
232231 struct input_mt_slot *ps = &mt->slots[i];
@@ -238,7 +237,6 @@ static void asus_report_tool_width(struct asus_drvdata *drvdat) · 5 unmodified lines
238237 oldest = ps;
239238 oldid = id;
240239 }
241− count++;
242240 }
243241
244242 if (oldest) {
drivers/hid/hid-hyperv.c+1−1
@@ -499,7 +499,7 @@ static int mousevsc_probe(struct hv_device *device, · 498 unmodified lines
499499
500500 ret = hid_add_device(hid_dev);
501501 if (ret)
502− goto probe_err1;
502+ goto probe_err2;
503503
504504
505505 ret = hid_parse(hid_dev);
drivers/hid/wacom_wac.c+6−5
@@ -2520,11 +2520,12 @@ static void wacom_wac_pen_report(struct hid_device *hdev, · 2519 unmodified lines
25202520
25212521 if (!delay_pen_events(wacom_wac) && wacom_wac->tool[0]) {
25222522 int id = wacom_wac->id[0];
2523− if (wacom_wac->features.quirks & WACOM_QUIRK_PEN_BUTTON3 &&
2524− wacom_wac->hid_data.barrelswitch & wacom_wac->hid_data.barrelswitch2) {
2525− wacom_wac->hid_data.barrelswitch = 0;
2526− wacom_wac->hid_data.barrelswitch2 = 0;
2527− wacom_wac->hid_data.barrelswitch3 = 1;
2523+ if (wacom_wac->features.quirks & WACOM_QUIRK_PEN_BUTTON3) {
2524+ int sw_state = wacom_wac->hid_data.barrelswitch |
2525+ (wacom_wac->hid_data.barrelswitch2 << 1);
2526+ wacom_wac->hid_data.barrelswitch = sw_state == 1;
2527+ wacom_wac->hid_data.barrelswitch2 = sw_state == 2;
2528+ wacom_wac->hid_data.barrelswitch3 = sw_state == 3;
25282529 }
25292530 input_report_key(input, BTN_STYLUS, wacom_wac->hid_data.barrelswitch);
25302531 input_report_key(input, BTN_STYLUS2, wacom_wac->hid_data.barrelswitch2);
drivers/hv/channel_mgmt.c+5−1
@@ -533,13 +533,17 @@ static void vmbus_add_channel_work(struct work_struct *work) · 532 unmodified lines
533533 * Add the new device to the bus. This will kick off device-driver
534534 * binding which eventually invokes the device driver's AddDevice()
535535 * method.
536+ *
537+ * If vmbus_device_register() fails, the 'device_obj' is freed in
538+ * vmbus_device_release() as called by device_unregister() in the
539+ * error path of vmbus_device_register(). In the outside error
540+ * path, there's no need to free it.
536541 */
537542 ret = vmbus_device_register(newchannel->device_obj);
538543
539544 if (ret != 0) {
540545 pr_err("unable to add child device object (relid %d)\n",
541546 newchannel->offermsg.child_relid);
542− kfree(newchannel->device_obj);
543547 goto err_deq_chan;
544548 }
545549
drivers/hv/hv_balloon.c+1−1
@@ -905,7 +905,7 @@ static unsigned long handle_pg_range(unsigned long pg_start, · 904 unmodified lines
905905 * We have some residual hot add range
906906 * that needs to be hot added; hot add
907907 * it now. Hot add a multiple of
908− * of HA_CHUNK that fully covers the pages
908+ * HA_CHUNK that fully covers the pages
909909 * we have.
910910 */
911911 size = (has->end_pfn - has->ha_end_pfn);
drivers/hv/vmbus_drv.c+1−0
@@ -2082,6 +2082,7 @@ int vmbus_device_register(struct hv_device *child_device_obj) · 2081 unmodified lines
20822082 ret = device_register(&child_device_obj->device);
20832083 if (ret) {
20842084 pr_err("Unable to register child device\n");
2085+ put_device(&child_device_obj->device);
20852086 return ret;
20862087 }
20872088
drivers/hwmon/asus-ec-sensors.c+2−0
@@ -938,6 +938,8 @@ static int asus_ec_probe(struct platform_device *pdev) · 937 unmodified lines
938938 ec_data->nr_sensors = hweight_long(ec_data->board_info->sensors);
939939 ec_data->sensors = devm_kcalloc(dev, ec_data->nr_sensors,
940940 sizeof(struct ec_sensor), GFP_KERNEL);
941+ if (!ec_data->sensors)
942+ return -ENOMEM;
941943
942944 status = setup_lock_data(dev);
943945 if (status) {
drivers/hwmon/coretemp.c+8−1
@@ -242,10 +242,13 @@ static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) · 241 unmodified lines
242242 */
243243 if (host_bridge && host_bridge->vendor == PCI_VENDOR_ID_INTEL) {
244244 for (i = 0; i < ARRAY_SIZE(tjmax_pci_table); i++) {
245− if (host_bridge->device == tjmax_pci_table[i].device)
245+ if (host_bridge->device == tjmax_pci_table[i].device) {
246+ pci_dev_put(host_bridge);
246247 return tjmax_pci_table[i].tjmax;
248+ }
247249 }
248250 }
251+ pci_dev_put(host_bridge);
249252
250253 for (i = 0; i < ARRAY_SIZE(tjmax_table); i++) {
251254 if (strstr(c->x86_model_id, tjmax_table[i].id))
@@ -533,6 +536,10 @@ static void coretemp_remove_core(struct platform_data *pdata, int indx) · 281 unmodified lines
533536 {
534537 struct temp_data *tdata = pdata->core_data[indx];
535538
539+ /* if we errored on add then this is already gone */
540+ if (!tdata)
541+ return;
542+
536543 /* Remove the sysfs attributes */
537544 sysfs_remove_group(&pdata->hwmon_dev->kobj, &tdata->attr_group);
538545
drivers/hwmon/i5500_temp.c+1−1
@@ -117,7 +117,7 @@ static int i5500_temp_probe(struct pci_dev *pdev, · 116 unmodified lines
117117 u32 tstimer;
118118 s8 tsfsc;
119119
120− err = pci_enable_device(pdev);
120+ err = pcim_enable_device(pdev);
121121 if (err) {
122122 dev_err(&pdev->dev, "Failed to enable device\n");
123123 return err;
drivers/hwmon/ibmpex.c+1−0
@@ -502,6 +502,7 @@ static void ibmpex_register_bmc(int iface, struct device *dev) · 501 unmodified lines
502502 return;
503503
504504 out_register:
505+ list_del(&data->list);
505506 hwmon_device_unregister(data->hwmon_dev);
506507 out_user:
507508 ipmi_destroy_user(data->user);
drivers/hwmon/ina3221.c+2−2
@@ -228,7 +228,7 @@ static int ina3221_read_value(struct ina3221_data *ina, unsigned int reg, · 227 unmodified lines
228228 * Shunt Voltage Sum register has 14-bit value with 1-bit shift
229229 * Other Shunt Voltage registers have 12 bits with 3-bit shift
230230 */
231− if (reg == INA3221_SHUNT_SUM)
231+ if (reg == INA3221_SHUNT_SUM || reg == INA3221_CRIT_SUM)
232232 *val = sign_extend32(regval >> 1, 14);
233233 else
234234 *val = sign_extend32(regval >> 3, 12);
@@ -465,7 +465,7 @@ static int ina3221_write_curr(struct device *dev, u32 attr, · 230 unmodified lines
465465 * SHUNT_SUM: (1 / 40uV) << 1 = 1 / 20uV
466466 * SHUNT[1-3]: (1 / 40uV) << 3 = 1 / 5uV
467467 */
468− if (reg == INA3221_SHUNT_SUM)
468+ if (reg == INA3221_SHUNT_SUM || reg == INA3221_CRIT_SUM)
469469 regval = DIV_ROUND_CLOSEST(voltage_uv, 20) & 0xfffe;
470470 else
471471 regval = DIV_ROUND_CLOSEST(voltage_uv, 5) & 0xfff8;
drivers/hwmon/ltc2947-core.c+1−1
@@ -396,7 +396,7 @@ static int ltc2947_read_temp(struct device *dev, const u32 attr, long *val, · 395 unmodified lines
396396 return ret;
397397
398398 /* in milidegrees celcius, temp is given by: */
399− *val = (__val * 204) + 550;
399+ *val = (__val * 204) + 5500;
400400
401401 return 0;
402402 }
drivers/hwmon/pmbus/pmbus.h+0−1
@@ -467,7 +467,6 @@ extern const struct regulator_ops pmbus_regulator_ops; · 466 unmodified lines
467467 #define PMBUS_REGULATOR_STEP(_name, _id, _voltages, _step) \
468468 [_id] = { \
469469 .name = (_name # _id), \
470− .supply_name = "vin", \
471470 .id = (_id), \
472471 .of_match = of_match_ptr(_name # _id), \
473472 .regulators_node = of_match_ptr("regulators"), \
drivers/hwmon/scmi-hwmon.c+103−13
@@ -20,6 +20,11 @@ struct scmi_sensors { · 19 unmodified lines
2020 const struct scmi_sensor_info **info[hwmon_max];
2121 };
2222
23+struct scmi_thermal_sensor {
24+ const struct scmi_protocol_handle *ph;
25+ const struct scmi_sensor_info *info;
26+};
27+
2328 static inline u64 __pow10(u8 x)
2429 {
2530 u64 r = 1;
@@ -64,16 +69,14 @@ static int scmi_hwmon_scale(const struct scmi_sensor_info *sensor, u64 *value) · 38 unmodified lines
6469 return 0;
6570 }
6671
67−static int scmi_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
68− u32 attr, int channel, long *val)
72+static int scmi_hwmon_read_scaled_value(const struct scmi_protocol_handle *ph,
73+ const struct scmi_sensor_info *sensor,
74+ long *val)
6975 {
7076 int ret;
7177 u64 value;
72− const struct scmi_sensor_info *sensor;
73− struct scmi_sensors *scmi_sensors = dev_get_drvdata(dev);
7478
75− sensor = *(scmi_sensors->info[type] + channel);
76− ret = sensor_ops->reading_get(scmi_sensors->ph, sensor->id, &value);
79+ ret = sensor_ops->reading_get(ph, sensor->id, &value);
7780 if (ret)
7881 return ret;
7982
@@ -84,6 +87,17 @@ static int scmi_hwmon_read(struct device *dev, enum hwmon_sensor_types type, · 4 unmodified lines
8487 return ret;
8588 }
8689
90+static int scmi_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
91+ u32 attr, int channel, long *val)
92+{
93+ const struct scmi_sensor_info *sensor;
94+ struct scmi_sensors *scmi_sensors = dev_get_drvdata(dev);
95+
96+ sensor = *(scmi_sensors->info[type] + channel);
97+
98+ return scmi_hwmon_read_scaled_value(scmi_sensors->ph, sensor, val);
99+}
100+
87101 static int
88102 scmi_hwmon_read_string(struct device *dev, enum hwmon_sensor_types type,
89103 u32 attr, int channel, const char **str)
@@ -122,6 +136,25 @@ static struct hwmon_chip_info scmi_chip_info = { · 32 unmodified lines
122136 .info = NULL,
123137 };
124138
139+static int scmi_hwmon_thermal_get_temp(struct thermal_zone_device *tz,
140+ int *temp)
141+{
142+ int ret;
143+ long value;
144+ struct scmi_thermal_sensor *th_sensor = tz->devdata;
145+
146+ ret = scmi_hwmon_read_scaled_value(th_sensor->ph, th_sensor->info,
147+ &value);
148+ if (!ret)
149+ *temp = value;
150+
151+ return ret;
152+}
153+
154+static const struct thermal_zone_device_ops scmi_hwmon_thermal_ops = {
155+ .get_temp = scmi_hwmon_thermal_get_temp,
156+};
157+
125158 static int scmi_hwmon_add_chan_info(struct hwmon_channel_info *scmi_hwmon_chan,
126159 struct device *dev, int num,
127160 enum hwmon_sensor_types type, u32 config)
@@ -149,7 +182,6 @@ static enum hwmon_sensor_types scmi_types[] = { · 21 unmodified lines
149182 };
150183
151184 static u32 hwmon_attributes[hwmon_max] = {
152− [hwmon_chip] = HWMON_C_REGISTER_TZ,
153185 [hwmon_temp] = HWMON_T_INPUT | HWMON_T_LABEL,
154186 [hwmon_in] = HWMON_I_INPUT | HWMON_I_LABEL,
155187 [hwmon_curr] = HWMON_C_INPUT | HWMON_C_LABEL,
@@ -157,6 +189,43 @@ static u32 hwmon_attributes[hwmon_max] = { · 1 unmodified line
157189 [hwmon_energy] = HWMON_E_INPUT | HWMON_E_LABEL,
158190 };
159191
192+static int scmi_thermal_sensor_register(struct device *dev,
193+ const struct scmi_protocol_handle *ph,
194+ const struct scmi_sensor_info *sensor)
195+{
196+ struct scmi_thermal_sensor *th_sensor;
197+ struct thermal_zone_device *tzd;
198+
199+ th_sensor = devm_kzalloc(dev, sizeof(*th_sensor), GFP_KERNEL);
200+ if (!th_sensor)
201+ return -ENOMEM;
202+
203+ th_sensor->ph = ph;
204+ th_sensor->info = sensor;
205+
206+ /*
207+ * Try to register a temperature sensor with the Thermal Framework:
208+ * skip sensors not defined as part of any thermal zone (-ENODEV) but
209+ * report any other errors related to misconfigured zones/sensors.
210+ */
211+ tzd = devm_thermal_of_zone_register(dev, th_sensor->info->id, th_sensor,
212+ &scmi_hwmon_thermal_ops);
213+ if (IS_ERR(tzd)) {
214+ devm_kfree(dev, th_sensor);
215+
216+ if (PTR_ERR(tzd) != -ENODEV)
217+ return PTR_ERR(tzd);
218+
219+ dev_dbg(dev, "Sensor '%s' not attached to any thermal zone.\n",
220+ sensor->name);
221+ } else {
222+ dev_dbg(dev, "Sensor '%s' attached to thermal zone ID:%d\n",
223+ sensor->name, tzd->id);
224+ }
225+
226+ return 0;
227+}
228+
160229 static int scmi_hwmon_probe(struct scmi_device *sdev)
161230 {
162231 int i, idx;
@@ -164,7 +233,7 @@ static int scmi_hwmon_probe(struct scmi_device *sdev) · 1 unmodified line
164233 enum hwmon_sensor_types type;
165234 struct scmi_sensors *scmi_sensors;
166235 const struct scmi_sensor_info *sensor;
167− int nr_count[hwmon_max] = {0}, nr_types = 0;
236+ int nr_count[hwmon_max] = {0}, nr_types = 0, nr_count_temp = 0;
168237 const struct hwmon_chip_info *chip_info;
169238 struct device *hwdev, *dev = &sdev->dev;
170239 struct hwmon_channel_info *scmi_hwmon_chan;
@@ -208,10 +277,8 @@ static int scmi_hwmon_probe(struct scmi_device *sdev) · 37 unmodified lines
208277 }
209278 }
210279
211− if (nr_count[hwmon_temp]) {
212− nr_count[hwmon_chip]++;
213− nr_types++;
214− }
280+ if (nr_count[hwmon_temp])
281+ nr_count_temp = nr_count[hwmon_temp];
215282
216283 scmi_hwmon_chan = devm_kcalloc(dev, nr_types, sizeof(*scmi_hwmon_chan),
217284 GFP_KERNEL);
@@ -262,8 +329,31 @@ static int scmi_hwmon_probe(struct scmi_device *sdev) · 44 unmodified lines
262329 hwdev = devm_hwmon_device_register_with_info(dev, "scmi_sensors",
263330 scmi_sensors, chip_info,
264331 NULL);
332+ if (IS_ERR(hwdev))
333+ return PTR_ERR(hwdev);
265334
266− return PTR_ERR_OR_ZERO(hwdev);
335+ for (i = 0; i < nr_count_temp; i++) {
336+ int ret;
337+
338+ sensor = *(scmi_sensors->info[hwmon_temp] + i);
339+ if (!sensor)
340+ continue;
341+
342+ /*
343+ * Warn on any misconfiguration related to thermal zones but
344+ * bail out of probing only on memory errors.
345+ */
346+ ret = scmi_thermal_sensor_register(dev, ph, sensor);
347+ if (ret) {
348+ if (ret == -ENOMEM)
349+ return ret;
350+ dev_warn(dev,
351+ "Thermal zone misconfigured for %s. err=%d\n",
352+ sensor->name, ret);
353+ }
354+ }
355+
356+ return 0;
267357 }
268358
269359 static const struct scmi_device_id scmi_id_table[] = {
drivers/hwspinlock/qcom_hwspinlock.c+32−10
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 struct qcom_hwspinlock_of_data {
2323 u32 offset;
2424 u32 stride;
25+ const struct regmap_config *regmap_config;
2526 };
2627
2728 static int qcom_hwspinlock_trylock(struct hwspinlock *lock)
@@ -73,15 +74,42 @@ static const struct qcom_hwspinlock_of_data of_sfpb_mutex = { · 45 unmodified lines
7374 .stride = 0x4,
7475 };
7576
76−/* All modern platform has offset 0 and stride of 4k */
77+static const struct regmap_config tcsr_msm8226_mutex_config = {
78+ .reg_bits = 32,
79+ .reg_stride = 4,
80+ .val_bits = 32,
81+ .max_register = 0x1000,
82+ .fast_io = true,
83+};
84+
85+static const struct qcom_hwspinlock_of_data of_msm8226_tcsr_mutex = {
86+ .offset = 0,
87+ .stride = 0x80,
88+ .regmap_config = &tcsr_msm8226_mutex_config,
89+};
90+
91+static const struct regmap_config tcsr_mutex_config = {
92+ .reg_bits = 32,
93+ .reg_stride = 4,
94+ .val_bits = 32,
95+ .max_register = 0x20000,
96+ .fast_io = true,
97+};
98+
7799 static const struct qcom_hwspinlock_of_data of_tcsr_mutex = {
78100 .offset = 0,
79101 .stride = 0x1000,
102+ .regmap_config = &tcsr_mutex_config,
80103 };
81104
82105 static const struct of_device_id qcom_hwspinlock_of_match[] = {
83106 { .compatible = "qcom,sfpb-mutex", .data = &of_sfpb_mutex },
84107 { .compatible = "qcom,tcsr-mutex", .data = &of_tcsr_mutex },
108+ { .compatible = "qcom,apq8084-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
109+ { .compatible = "qcom,ipq6018-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
110+ { .compatible = "qcom,msm8226-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
111+ { .compatible = "qcom,msm8974-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
112+ { .compatible = "qcom,msm8994-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
85113 { }
86114 };
87115 MODULE_DEVICE_TABLE(of, qcom_hwspinlock_of_match);
@@ -117,14 +145,6 @@ static struct regmap *qcom_hwspinlock_probe_syscon(struct platform_device *pdev, · 29 unmodified lines
117145 return regmap;
118146 }
119147
120−static const struct regmap_config tcsr_mutex_config = {
121− .reg_bits = 32,
122− .reg_stride = 4,
123− .val_bits = 32,
124− .max_register = 0x40000,
125− .fast_io = true,
126−};
127−
128148 static struct regmap *qcom_hwspinlock_probe_mmio(struct platform_device *pdev,
129149 u32 *offset, u32 *stride)
130150 {
@@ -133,6 +153,8 @@ static struct regmap *qcom_hwspinlock_probe_mmio(struct platform_device *pdev, · 2 unmodified lines
133153 void __iomem *base;
134154
135155 data = of_device_get_match_data(dev);
156+ if (!data->regmap_config)
157+ return ERR_PTR(-EINVAL);
136158
137159 *offset = data->offset;
138160 *stride = data->stride;
@@ -141,7 +163,7 @@ static struct regmap *qcom_hwspinlock_probe_mmio(struct platform_device *pdev, · 2 unmodified lines
141163 if (IS_ERR(base))
142164 return ERR_CAST(base);
143165
144− return devm_regmap_init_mmio(dev, base, &tcsr_mutex_config);
166+ return devm_regmap_init_mmio(dev, base, data->regmap_config);
145167 }
146168
147169 static int qcom_hwspinlock_probe(struct platform_device *pdev)
drivers/i2c/busses/i2c-cadence.c+8−3
@@ -852,7 +852,8 @@ static int cdns_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, · 851 unmodified lines
852852 CDNS_I2C_POLL_US, CDNS_I2C_TIMEOUT_US);
853853 if (ret) {
854854 ret = -EAGAIN;
855− i2c_recover_bus(adap);
855+ if (id->adap.bus_recovery_info)
856+ i2c_recover_bus(adap);
856857 goto out;
857858 }
858859
@@ -1263,8 +1264,13 @@ static int cdns_i2c_probe(struct platform_device *pdev) · 404 unmodified lines
12631264
12641265 id->rinfo.pinctrl = devm_pinctrl_get(&pdev->dev);
12651266 if (IS_ERR(id->rinfo.pinctrl)) {
1267+ int err = PTR_ERR(id->rinfo.pinctrl);
1268+
12661269 dev_info(&pdev->dev, "can't get pinctrl, bus recovery not supported\n");
1267− return PTR_ERR(id->rinfo.pinctrl);
1270+ if (err != -ENODEV)
1271+ return err;
1272+ } else {
1273+ id->adap.bus_recovery_info = &id->rinfo;
12681274 }
12691275
12701276 id->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &r_mem);
@@ -1283,7 +1289,6 @@ static int cdns_i2c_probe(struct platform_device *pdev) · 12 unmodified lines
12831289 id->adap.retries = 3; /* Default retry value. */
12841290 id->adap.algo_data = id;
12851291 id->adap.dev.parent = &pdev->dev;
1286− id->adap.bus_recovery_info = &id->rinfo;
12871292 init_completion(&id->xfer_done);
12881293 snprintf(id->adap.name, sizeof(id->adap.name),
12891294 "Cadence I2C at %08lx", (unsigned long)r_mem->start);
drivers/i2c/busses/i2c-i801.c+1−0
@@ -1243,6 +1243,7 @@ static const struct { · 1242 unmodified lines
12431243 */
12441244 { "Latitude 5480", 0x29 },
12451245 { "Vostro V131", 0x1d },
1246+ { "Vostro 5568", 0x29 },
12461247 };
12471248
12481249 static void register_dell_lis3lv02d_i2c_device(struct i801_priv *priv)
drivers/i2c/busses/i2c-imx.c+4−2
@@ -1132,7 +1132,8 @@ static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs, · 1131 unmodified lines
11321132 int i, result;
11331133 unsigned int temp;
11341134 int block_data = msgs->flags & I2C_M_RECV_LEN;
1135− int use_dma = i2c_imx->dma && msgs->len >= DMA_THRESHOLD && !block_data;
1135+ int use_dma = i2c_imx->dma && msgs->flags & I2C_M_DMA_SAFE &&
1136+ msgs->len >= DMA_THRESHOLD && !block_data;
11361137
11371138 dev_dbg(&i2c_imx->adapter.dev,
11381139 "<%s> write slave address: addr=0x%x\n",
@@ -1298,7 +1299,8 @@ static int i2c_imx_xfer_common(struct i2c_adapter *adapter, · 159 unmodified lines
12981299 result = i2c_imx_read(i2c_imx, &msgs[i], is_lastmsg, atomic);
12991300 } else {
13001301 if (!atomic &&
1301− i2c_imx->dma && msgs[i].len >= DMA_THRESHOLD)
1302+ i2c_imx->dma && msgs[i].len >= DMA_THRESHOLD &&
1303+ msgs[i].flags & I2C_M_DMA_SAFE)
13021304 result = i2c_imx_dma_write(i2c_imx, &msgs[i]);
13031305 else
13041306 result = i2c_imx_write(i2c_imx, &msgs[i], atomic);
drivers/i2c/busses/i2c-npcm7xx.c+10−1
@@ -2393,8 +2393,17 @@ static struct platform_driver npcm_i2c_bus_driver = { · 2392 unmodified lines
23932393
23942394 static int __init npcm_i2c_init(void)
23952395 {
2396+ int ret;
2397+
23962398 npcm_i2c_debugfs_dir = debugfs_create_dir("npcm_i2c", NULL);
2397− return platform_driver_register(&npcm_i2c_bus_driver);
2399+
2400+ ret = platform_driver_register(&npcm_i2c_bus_driver);
2401+ if (ret) {
2402+ debugfs_remove_recursive(npcm_i2c_debugfs_dir);
2403+ return ret;
2404+ }
2405+
2406+ return 0;
23982407 }
23992408 module_init(npcm_i2c_init);
24002409
drivers/i2c/busses/i2c-piix4.c+1−0
@@ -1080,6 +1080,7 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id) · 1079 unmodified lines
10801080 "", &piix4_main_adapters[0]);
10811081 if (retval < 0)
10821082 return retval;
1083+ piix4_adapter_count = 1;
10831084 }
10841085
10851086 /* Check for auxiliary SMBus on some AMD chipsets */
drivers/i2c/busses/i2c-qcom-geni.c+0−1
@@ -626,7 +626,6 @@ static int geni_i2c_gpi_xfer(struct geni_i2c_dev *gi2c, struct i2c_msg msgs[], i · 625 unmodified lines
626626 dev_err(gi2c->se.dev, "I2C timeout gpi flags:%d addr:0x%x\n",
627627 gi2c->cur->flags, gi2c->cur->addr);
628628 gi2c->err = -ETIMEDOUT;
629− goto err;
630629 }
631630
632631 if (gi2c->err) {
drivers/i2c/busses/i2c-tegra.c+10−6
@@ -284,6 +284,7 @@ struct tegra_i2c_dev { · 283 unmodified lines
284284 struct dma_chan *tx_dma_chan;
285285 struct dma_chan *rx_dma_chan;
286286 unsigned int dma_buf_size;
287+ struct device *dma_dev;
287288 dma_addr_t dma_phys;
288289 void *dma_buf;
289290
@@ -420,7 +421,7 @@ static int tegra_i2c_dma_submit(struct tegra_i2c_dev *i2c_dev, size_t len) · 130 unmodified lines
420421 static void tegra_i2c_release_dma(struct tegra_i2c_dev *i2c_dev)
421422 {
422423 if (i2c_dev->dma_buf) {
423− dma_free_coherent(i2c_dev->dev, i2c_dev->dma_buf_size,
424+ dma_free_coherent(i2c_dev->dma_dev, i2c_dev->dma_buf_size,
424425 i2c_dev->dma_buf, i2c_dev->dma_phys);
425426 i2c_dev->dma_buf = NULL;
426427 }
@@ -472,10 +473,13 @@ static int tegra_i2c_init_dma(struct tegra_i2c_dev *i2c_dev) · 45 unmodified lines
472473
473474 i2c_dev->tx_dma_chan = chan;
474475
476+ WARN_ON(i2c_dev->tx_dma_chan->device != i2c_dev->rx_dma_chan->device);
477+ i2c_dev->dma_dev = chan->device->dev;
478+
475479 i2c_dev->dma_buf_size = i2c_dev->hw->quirks->max_write_len +
476480 I2C_PACKET_HEADER_SIZE;
477481
478− dma_buf = dma_alloc_coherent(i2c_dev->dev, i2c_dev->dma_buf_size,
482+ dma_buf = dma_alloc_coherent(i2c_dev->dma_dev, i2c_dev->dma_buf_size,
479483 &dma_phys, GFP_KERNEL | __GFP_NOWARN);
480484 if (!dma_buf) {
481485 dev_err(i2c_dev->dev, "failed to allocate DMA buffer\n");
@@ -1272,7 +1276,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, · 790 unmodified lines
12721276
12731277 if (i2c_dev->dma_mode) {
12741278 if (i2c_dev->msg_read) {
1275− dma_sync_single_for_device(i2c_dev->dev,
1279+ dma_sync_single_for_device(i2c_dev->dma_dev,
12761280 i2c_dev->dma_phys,
12771281 xfer_size, DMA_FROM_DEVICE);
12781282
@@ -1280,7 +1284,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, · 1 unmodified line
12801284 if (err)
12811285 return err;
12821286 } else {
1283− dma_sync_single_for_cpu(i2c_dev->dev,
1287+ dma_sync_single_for_cpu(i2c_dev->dma_dev,
12841288 i2c_dev->dma_phys,
12851289 xfer_size, DMA_TO_DEVICE);
12861290 }
@@ -1293,7 +1297,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, · 6 unmodified lines
12931297 memcpy(i2c_dev->dma_buf + I2C_PACKET_HEADER_SIZE,
12941298 msg->buf, msg->len);
12951299
1296− dma_sync_single_for_device(i2c_dev->dev,
1300+ dma_sync_single_for_device(i2c_dev->dma_dev,
12971301 i2c_dev->dma_phys,
12981302 xfer_size, DMA_TO_DEVICE);
12991303
@@ -1344,7 +1348,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, · 44 unmodified lines
13441348 }
13451349
13461350 if (i2c_dev->msg_read && i2c_dev->msg_err == I2C_ERR_NONE) {
1347− dma_sync_single_for_cpu(i2c_dev->dev,
1351+ dma_sync_single_for_cpu(i2c_dev->dma_dev,
13481352 i2c_dev->dma_phys,
13491353 xfer_size, DMA_FROM_DEVICE);
13501354
drivers/i2c/i2c-core-base.c+5−4
@@ -467,6 +467,7 @@ static int i2c_device_probe(struct device *dev) · 466 unmodified lines
467467 {
468468 struct i2c_client *client = i2c_verify_client(dev);
469469 struct i2c_driver *driver;
470+ bool do_power_on;
470471 int status;
471472
472473 if (!client)
@@ -545,8 +546,8 @@ static int i2c_device_probe(struct device *dev) · 72 unmodified lines
545546 if (status < 0)
546547 goto err_clear_wakeup_irq;
547548
548− status = dev_pm_domain_attach(&client->dev,
549− !i2c_acpi_waive_d0_probe(dev));
549+ do_power_on = !i2c_acpi_waive_d0_probe(dev);
550+ status = dev_pm_domain_attach(&client->dev, do_power_on);
550551 if (status)
551552 goto err_clear_wakeup_irq;
552553
@@ -585,7 +586,7 @@ static int i2c_device_probe(struct device *dev) · 32 unmodified lines
585586 err_release_driver_resources:
586587 devres_release_group(&client->dev, client->devres_group_id);
587588 err_detach_pm_domain:
588− dev_pm_domain_detach(&client->dev, !i2c_acpi_waive_d0_probe(dev));
589+ dev_pm_domain_detach(&client->dev, do_power_on);
589590 err_clear_wakeup_irq:
590591 dev_pm_clear_wake_irq(&client->dev);
591592 device_init_wakeup(&client->dev, false);
@@ -610,7 +611,7 @@ static void i2c_device_remove(struct device *dev) · 18 unmodified lines
610611
611612 devres_release_group(&client->dev, client->devres_group_id);
612613
613− dev_pm_domain_detach(&client->dev, !i2c_acpi_waive_d0_probe(dev));
614+ dev_pm_domain_detach(&client->dev, true);
614615
615616 dev_pm_clear_wake_irq(&client->dev);
616617 device_init_wakeup(&client->dev, false);
drivers/iio/accel/bma400_core.c+15−13
@@ -805,8 +805,10 @@ static int bma400_get_steps_reg(struct bma400_data *data, int *val) · 804 unmodified lines
805805
806806 ret = regmap_bulk_read(data->regmap, BMA400_STEP_CNT0_REG,
807807 steps_raw, BMA400_STEP_RAW_LEN);
808− if (ret)
808+ if (ret) {
809+ kfree(steps_raw);
809810 return ret;
811+ }
810812 *val = get_unaligned_le24(steps_raw);
811813 kfree(steps_raw);
812814 return IIO_VAL_INT;
@@ -869,18 +871,6 @@ static int bma400_init(struct bma400_data *data) · 56 unmodified lines
869871 unsigned int val;
870872 int ret;
871873
872− /* Try to read chip_id register. It must return 0x90. */
873− ret = regmap_read(data->regmap, BMA400_CHIP_ID_REG, &val);
874− if (ret) {
875− dev_err(data->dev, "Failed to read chip id register\n");
876− return ret;
877− }
878−
879− if (val != BMA400_ID_REG_VAL) {
880− dev_err(data->dev, "Chip ID mismatch\n");
881− return -ENODEV;
882− }
883−
884874 data->regulators[BMA400_VDD_REGULATOR].supply = "vdd";
885875 data->regulators[BMA400_VDDIO_REGULATOR].supply = "vddio";
886876 ret = devm_regulator_bulk_get(data->dev,
@@ -906,6 +896,18 @@ static int bma400_init(struct bma400_data *data) · 19 unmodified lines
906896 if (ret)
907897 return ret;
908898
899+ /* Try to read chip_id register. It must return 0x90. */
900+ ret = regmap_read(data->regmap, BMA400_CHIP_ID_REG, &val);
901+ if (ret) {
902+ dev_err(data->dev, "Failed to read chip id register\n");
903+ return ret;
904+ }
905+
906+ if (val != BMA400_ID_REG_VAL) {
907+ dev_err(data->dev, "Chip ID mismatch\n");
908+ return -ENODEV;
909+ }
910+
909911 ret = bma400_get_power_mode(data);
910912 if (ret) {
911913 dev_err(data->dev, "Failed to get the initial power-mode\n");
drivers/iio/adc/aspeed_adc.c+5−6
@@ -202,6 +202,8 @@ static int aspeed_adc_set_trim_data(struct iio_dev *indio_dev) · 201 unmodified lines
202202 ((scu_otp) &
203203 (data->model_data->trim_locate->field)) >>
204204 __ffs(data->model_data->trim_locate->field);
205+ if (!trimming_val)
206+ trimming_val = 0x8;
205207 }
206208 dev_dbg(data->dev,
207209 "trimming val = %d, offset = %08x, fields = %08x\n",
@@ -563,12 +565,9 @@ static int aspeed_adc_probe(struct platform_device *pdev) · 355 unmodified lines
563565 if (ret)
564566 return ret;
565567
566− if (of_find_property(data->dev->of_node, "aspeed,trim-data-valid",
567− NULL)) {
568− ret = aspeed_adc_set_trim_data(indio_dev);
569− if (ret)
570− return ret;
571− }
568+ ret = aspeed_adc_set_trim_data(indio_dev);
569+ if (ret)
570+ return ret;
572571
573572 if (of_find_property(data->dev->of_node, "aspeed,battery-sensing",
574573 NULL)) {
drivers/iio/adc/at91-sama5d2_adc.c+2−4
@@ -2307,11 +2307,9 @@ static int at91_adc_temp_sensor_init(struct at91_adc_state *st, · 2306 unmodified lines
23072307 clb->p6 = buf[AT91_ADC_TS_CLB_IDX_P6];
23082308
23092309 /*
2310− * We prepare here the conversion to milli and also add constant
2311− * factor (5 degrees Celsius) to p1 here to avoid doing it on
2312− * hotpath.
2310+ * We prepare here the conversion to milli to avoid doing it on hotpath.
23132311 */
2314− clb->p1 = clb->p1 * 1000 + 5000;
2312+ clb->p1 = clb->p1 * 1000;
23152313
23162314 free_buf:
23172315 kfree(buf);
drivers/iio/adc/at91_adc.c+3−1
@@ -634,8 +634,10 @@ static struct iio_trigger *at91_adc_allocate_trigger(struct iio_dev *idev, · 633 unmodified lines
634634 trig->ops = &at91_adc_trigger_ops;
635635
636636 ret = iio_trigger_register(trig);
637− if (ret)
637+ if (ret) {
638+ iio_trigger_free(trig);
638639 return NULL;
640+ }
639641
640642 return trig;
641643 }
drivers/iio/adc/mp2629_adc.c+3−2
@@ -57,7 +57,8 @@ static struct iio_map mp2629_adc_maps[] = { · 56 unmodified lines
5757 MP2629_MAP(SYSTEM_VOLT, "system-volt"),
5858 MP2629_MAP(INPUT_VOLT, "input-volt"),
5959 MP2629_MAP(BATT_CURRENT, "batt-current"),
60− MP2629_MAP(INPUT_CURRENT, "input-current")
60+ MP2629_MAP(INPUT_CURRENT, "input-current"),
61+ { }
6162 };
6263
6364 static int mp2629_read_raw(struct iio_dev *indio_dev,
@@ -74,7 +75,7 @@ static int mp2629_read_raw(struct iio_dev *indio_dev, · 10 unmodified lines
7475 if (ret)
7576 return ret;
7677
77− if (chan->address == MP2629_INPUT_VOLT)
78+ if (chan->channel == MP2629_INPUT_VOLT)
7879 rval &= GENMASK(6, 0);
7980 *val = rval;
8081 return IIO_VAL_INT;
drivers/iio/health/afe4403.c+3−2
@@ -245,14 +245,14 @@ static int afe4403_read_raw(struct iio_dev *indio_dev, · 244 unmodified lines
245245 int *val, int *val2, long mask)
246246 {
247247 struct afe4403_data *afe = iio_priv(indio_dev);
248− unsigned int reg = afe4403_channel_values[chan->address];
249− unsigned int field = afe4403_channel_leds[chan->address];
248+ unsigned int reg, field;
250249 int ret;
251250
252251 switch (chan->type) {
253252 case IIO_INTENSITY:
254253 switch (mask) {
255254 case IIO_CHAN_INFO_RAW:
255+ reg = afe4403_channel_values[chan->address];
256256 ret = afe4403_read(afe, reg, val);
257257 if (ret)
258258 return ret;
@@ -262,6 +262,7 @@ static int afe4403_read_raw(struct iio_dev *indio_dev, · 3 unmodified lines
262262 case IIO_CURRENT:
263263 switch (mask) {
264264 case IIO_CHAN_INFO_RAW:
265+ field = afe4403_channel_leds[chan->address];
265266 ret = regmap_field_read(afe->fields[field], val);
266267 if (ret)
267268 return ret;
drivers/iio/health/afe4404.c+7−5
@@ -250,20 +250,20 @@ static int afe4404_read_raw(struct iio_dev *indio_dev, · 249 unmodified lines
250250 int *val, int *val2, long mask)
251251 {
252252 struct afe4404_data *afe = iio_priv(indio_dev);
253− unsigned int value_reg = afe4404_channel_values[chan->address];
254− unsigned int led_field = afe4404_channel_leds[chan->address];
255− unsigned int offdac_field = afe4404_channel_offdacs[chan->address];
253+ unsigned int value_reg, led_field, offdac_field;
256254 int ret;
257255
258256 switch (chan->type) {
259257 case IIO_INTENSITY:
260258 switch (mask) {
261259 case IIO_CHAN_INFO_RAW:
260+ value_reg = afe4404_channel_values[chan->address];
262261 ret = regmap_read(afe->regmap, value_reg, val);
263262 if (ret)
264263 return ret;
265264 return IIO_VAL_INT;
266265 case IIO_CHAN_INFO_OFFSET:
266+ offdac_field = afe4404_channel_offdacs[chan->address];
267267 ret = regmap_field_read(afe->fields[offdac_field], val);
268268 if (ret)
269269 return ret;
@@ -273,6 +273,7 @@ static int afe4404_read_raw(struct iio_dev *indio_dev, · 3 unmodified lines
273273 case IIO_CURRENT:
274274 switch (mask) {
275275 case IIO_CHAN_INFO_RAW:
276+ led_field = afe4404_channel_leds[chan->address];
276277 ret = regmap_field_read(afe->fields[led_field], val);
277278 if (ret)
278279 return ret;
@@ -295,19 +296,20 @@ static int afe4404_write_raw(struct iio_dev *indio_dev, · 16 unmodified lines
295296 int val, int val2, long mask)
296297 {
297298 struct afe4404_data *afe = iio_priv(indio_dev);
298− unsigned int led_field = afe4404_channel_leds[chan->address];
299− unsigned int offdac_field = afe4404_channel_offdacs[chan->address];
299+ unsigned int led_field, offdac_field;
300300
301301 switch (chan->type) {
302302 case IIO_INTENSITY:
303303 switch (mask) {
304304 case IIO_CHAN_INFO_OFFSET:
305+ offdac_field = afe4404_channel_offdacs[chan->address];
305306 return regmap_field_write(afe->fields[offdac_field], val);
306307 }
307308 break;
308309 case IIO_CURRENT:
309310 switch (mask) {
310311 case IIO_CHAN_INFO_RAW:
312+ led_field = afe4404_channel_leds[chan->address];
311313 return regmap_field_write(afe->fields[led_field], val);
312314 }
313315 break;
drivers/iio/imu/bno055/bno055.c+1−1
@@ -632,7 +632,7 @@ static int bno055_set_regmask(struct bno055_priv *priv, int val, int val2, · 631 unmodified lines
632632 return -EINVAL;
633633 }
634634 delta = abs(tbl_val - req_val);
635− if (delta < best_delta || first) {
635+ if (first || delta < best_delta) {
636636 best_delta = delta;
637637 hwval = i;
638638 first = false;
drivers/iio/industrialio-sw-trigger.c+5−1
@@ -58,8 +58,12 @@ int iio_register_sw_trigger_type(struct iio_sw_trigger_type *t) · 57 unmodified lines
5858
5959 t->group = configfs_register_default_group(iio_triggers_group, t->name,
6060 &iio_trigger_type_group_type);
61− if (IS_ERR(t->group))
61+ if (IS_ERR(t->group)) {
62+ mutex_lock(&iio_trigger_types_lock);
63+ list_del(&t->list);
64+ mutex_unlock(&iio_trigger_types_lock);
6265 ret = PTR_ERR(t->group);
66+ }
6367
6468 return ret;
6569 }
drivers/iio/light/Kconfig+2−0
@@ -293,6 +293,8 @@ config RPR0521 · 292 unmodified lines
293293 tristate "ROHM RPR0521 ALS and proximity sensor driver"
294294 depends on I2C
295295 select REGMAP_I2C
296+ select IIO_BUFFER
297+ select IIO_TRIGGERED_BUFFER
296298 help
297299 Say Y here if you want to build support for ROHM's RPR0521
298300 ambient light and proximity sensor device.
drivers/iio/light/apds9960.c+6−6
@@ -54,9 +54,6 @@ · 53 unmodified lines
5454 #define APDS9960_REG_CONTROL_PGAIN_MASK_SHIFT 2
5555
5656 #define APDS9960_REG_CONFIG_2 0x90
57−#define APDS9960_REG_CONFIG_2_GGAIN_MASK 0x60
58−#define APDS9960_REG_CONFIG_2_GGAIN_MASK_SHIFT 5
59−
6057 #define APDS9960_REG_ID 0x92
6158
6259 #define APDS9960_REG_STATUS 0x93
@@ -77,6 +74,9 @@ · 14 unmodified lines
7774 #define APDS9960_REG_GCONF_1_GFIFO_THRES_MASK_SHIFT 6
7875
7976 #define APDS9960_REG_GCONF_2 0xa3
77+#define APDS9960_REG_GCONF_2_GGAIN_MASK 0x60
78+#define APDS9960_REG_GCONF_2_GGAIN_MASK_SHIFT 5
79+
8080 #define APDS9960_REG_GOFFSET_U 0xa4
8181 #define APDS9960_REG_GOFFSET_D 0xa5
8282 #define APDS9960_REG_GPULSE 0xa6
@@ -396,9 +396,9 @@ static int apds9960_set_pxs_gain(struct apds9960_data *data, int val) · 313 unmodified lines
396396 }
397397
398398 ret = regmap_update_bits(data->regmap,
399− APDS9960_REG_CONFIG_2,
400− APDS9960_REG_CONFIG_2_GGAIN_MASK,
401− idx << APDS9960_REG_CONFIG_2_GGAIN_MASK_SHIFT);
399+ APDS9960_REG_GCONF_2,
400+ APDS9960_REG_GCONF_2_GGAIN_MASK,
401+ idx << APDS9960_REG_GCONF_2_GGAIN_MASK_SHIFT);
402402 if (!ret)
403403 data->pxs_gain = idx;
404404 mutex_unlock(&data->lock);
drivers/iio/pressure/ms5611.h+4−8
@@ -25,13 +25,6 @@ enum { · 24 unmodified lines
2525 MS5607,
2626 };
2727
28−struct ms5611_chip_info {
29− u16 prom[MS5611_PROM_WORDS_NB];
30−
31− int (*temp_and_pressure_compensate)(struct ms5611_chip_info *chip_info,
32− s32 *temp, s32 *pressure);
33−};
34−
3528 /*
3629 * OverSampling Rate descriptor.
3730 * Warning: cmd MUST be kept aligned on a word boundary (see
@@ -50,12 +43,15 @@ struct ms5611_state { · 12 unmodified lines
5043 const struct ms5611_osr *pressure_osr;
5144 const struct ms5611_osr *temp_osr;
5245
46+ u16 prom[MS5611_PROM_WORDS_NB];
47+
5348 int (*reset)(struct ms5611_state *st);
5449 int (*read_prom_word)(struct ms5611_state *st, int index, u16 *word);
5550 int (*read_adc_temp_and_pressure)(struct ms5611_state *st,
5651 s32 *temp, s32 *pressure);
5752
58− struct ms5611_chip_info *chip_info;
53+ int (*compensate_temp_and_pressure)(struct ms5611_state *st, s32 *temp,
54+ s32 *pressure);
5955 struct regulator *vdd;
6056 };
6157
drivers/iio/pressure/ms5611_core.c+27−24
@@ -85,7 +85,7 @@ static int ms5611_read_prom(struct iio_dev *indio_dev) · 84 unmodified lines
8585 struct ms5611_state *st = iio_priv(indio_dev);
8686
8787 for (i = 0; i < MS5611_PROM_WORDS_NB; i++) {
88− ret = st->read_prom_word(st, i, &st->chip_info->prom[i]);
88+ ret = st->read_prom_word(st, i, &st->prom[i]);
8989 if (ret < 0) {
9090 dev_err(&indio_dev->dev,
9191 "failed to read prom at %d\n", i);
@@ -93,7 +93,7 @@ static int ms5611_read_prom(struct iio_dev *indio_dev) · 1 unmodified line
9393 }
9494 }
9595
96− if (!ms5611_prom_is_valid(st->chip_info->prom, MS5611_PROM_WORDS_NB)) {
96+ if (!ms5611_prom_is_valid(st->prom, MS5611_PROM_WORDS_NB)) {
9797 dev_err(&indio_dev->dev, "PROM integrity check failed\n");
9898 return -ENODEV;
9999 }
@@ -114,21 +114,20 @@ static int ms5611_read_temp_and_pressure(struct iio_dev *indio_dev, · 14 unmodified lines
114114 return ret;
115115 }
116116
117− return st->chip_info->temp_and_pressure_compensate(st->chip_info,
118− temp, pressure);
117+ return st->compensate_temp_and_pressure(st, temp, pressure);
119118 }
120119
121−static int ms5611_temp_and_pressure_compensate(struct ms5611_chip_info *chip_info,
120+static int ms5611_temp_and_pressure_compensate(struct ms5611_state *st,
122121 s32 *temp, s32 *pressure)
123122 {
124123 s32 t = *temp, p = *pressure;
125124 s64 off, sens, dt;
126125
127− dt = t - (chip_info->prom[5] << 8);
128− off = ((s64)chip_info->prom[2] << 16) + ((chip_info->prom[4] * dt) >> 7);
129− sens = ((s64)chip_info->prom[1] << 15) + ((chip_info->prom[3] * dt) >> 8);
126+ dt = t - (st->prom[5] << 8);
127+ off = ((s64)st->prom[2] << 16) + ((st->prom[4] * dt) >> 7);
128+ sens = ((s64)st->prom[1] << 15) + ((st->prom[3] * dt) >> 8);
130129
131− t = 2000 + ((chip_info->prom[6] * dt) >> 23);
130+ t = 2000 + ((st->prom[6] * dt) >> 23);
132131 if (t < 2000) {
133132 s64 off2, sens2, t2;
134133
@@ -154,17 +153,17 @@ static int ms5611_temp_and_pressure_compensate(struct ms5611_chip_info *chip_inf · 19 unmodified lines
154153 return 0;
155154 }
156155
157−static int ms5607_temp_and_pressure_compensate(struct ms5611_chip_info *chip_info,
156+static int ms5607_temp_and_pressure_compensate(struct ms5611_state *st,
158157 s32 *temp, s32 *pressure)
159158 {
160159 s32 t = *temp, p = *pressure;
161160 s64 off, sens, dt;
162161
163− dt = t - (chip_info->prom[5] << 8);
164− off = ((s64)chip_info->prom[2] << 17) + ((chip_info->prom[4] * dt) >> 6);
165− sens = ((s64)chip_info->prom[1] << 16) + ((chip_info->prom[3] * dt) >> 7);
162+ dt = t - (st->prom[5] << 8);
163+ off = ((s64)st->prom[2] << 17) + ((st->prom[4] * dt) >> 6);
164+ sens = ((s64)st->prom[1] << 16) + ((st->prom[3] * dt) >> 7);
166165
167− t = 2000 + ((chip_info->prom[6] * dt) >> 23);
166+ t = 2000 + ((st->prom[6] * dt) >> 23);
168167 if (t < 2000) {
169168 s64 off2, sens2, t2, tmp;
170169
@@ -342,15 +341,6 @@ static int ms5611_write_raw(struct iio_dev *indio_dev, · 171 unmodified lines
342341
343342 static const unsigned long ms5611_scan_masks[] = {0x3, 0};
344343
345−static struct ms5611_chip_info chip_info_tbl[] = {
346− [MS5611] = {
347− .temp_and_pressure_compensate = ms5611_temp_and_pressure_compensate,
348− },
349− [MS5607] = {
350− .temp_and_pressure_compensate = ms5607_temp_and_pressure_compensate,
351− }
352−};
353−
354344 static const struct iio_chan_spec ms5611_channels[] = {
355345 {
356346 .type = IIO_PRESSURE,
@@ -433,7 +423,20 @@ int ms5611_probe(struct iio_dev *indio_dev, struct device *dev, · 76 unmodified lines
433423 struct ms5611_state *st = iio_priv(indio_dev);
434424
435425 mutex_init(&st->lock);
436− st->chip_info = &chip_info_tbl[type];
426+
427+ switch (type) {
428+ case MS5611:
429+ st->compensate_temp_and_pressure =
430+ ms5611_temp_and_pressure_compensate;
431+ break;
432+ case MS5607:
433+ st->compensate_temp_and_pressure =
434+ ms5607_temp_and_pressure_compensate;
435+ break;
436+ default:
437+ return -EINVAL;
438+ }
439+
437440 st->temp_osr =
438441 &ms5611_avail_temp_osr[ARRAY_SIZE(ms5611_avail_temp_osr) - 1];
439442 st->pressure_osr =
drivers/iio/pressure/ms5611_spi.c+1−1
@@ -91,7 +91,7 @@ static int ms5611_spi_probe(struct spi_device *spi) · 90 unmodified lines
9191 spi_set_drvdata(spi, indio_dev);
9292
9393 spi->mode = SPI_MODE_0;
94− spi->max_speed_hz = 20000000;
94+ spi->max_speed_hz = min(spi->max_speed_hz, 20000000U);
9595 spi->bits_per_word = 8;
9696 ret = spi_setup(spi);
9797 if (ret < 0)
drivers/iio/trigger/iio-trig-sysfs.c+5−1
@@ -203,9 +203,13 @@ static int iio_sysfs_trigger_remove(int id) · 202 unmodified lines
203203
204204 static int __init iio_sysfs_trig_init(void)
205205 {
206+ int ret;
206207 device_initialize(&iio_sysfs_trig_dev);
207208 dev_set_name(&iio_sysfs_trig_dev, "iio_sysfs_trigger");
208− return device_add(&iio_sysfs_trig_dev);
209+ ret = device_add(&iio_sysfs_trig_dev);
210+ if (ret)
211+ put_device(&iio_sysfs_trig_dev);
212+ return ret;
209213 }
210214 module_init(iio_sysfs_trig_init);
211215
drivers/infiniband/core/cma.c+1−1
@@ -1556,7 +1556,7 @@ static bool validate_ipv4_net_dev(struct net_device *net_dev, · 1555 unmodified lines
15561556 return false;
15571557
15581558 memset(&fl4, 0, sizeof(fl4));
1559− fl4.flowi4_iif = net_dev->ifindex;
1559+ fl4.flowi4_oif = net_dev->ifindex;
15601560 fl4.daddr = daddr;
15611561 fl4.saddr = saddr;
15621562
drivers/infiniband/core/device.c+9−1
@@ -2817,10 +2817,18 @@ static int __init ib_core_init(void) · 2816 unmodified lines
28172817
28182818 nldev_init();
28192819 rdma_nl_register(RDMA_NL_LS, ibnl_ls_cb_table);
2820− roce_gid_mgmt_init();
2820+ ret = roce_gid_mgmt_init();
2821+ if (ret) {
2822+ pr_warn("Couldn't init RoCE GID management\n");
2823+ goto err_parent;
2824+ }
28212825
28222826 return 0;
28232827
2828+err_parent:
2829+ rdma_nl_unregister(RDMA_NL_LS);
2830+ nldev_exit();
2831+ unregister_pernet_device(&rdma_dev_net_ops);
28242832 err_compat:
28252833 unregister_blocking_lsm_notifier(&ibdev_lsm_nb);
28262834 err_sa:
drivers/infiniband/core/nldev.c+1−1
@@ -2567,7 +2567,7 @@ void __init nldev_init(void) · 2566 unmodified lines
25672567 rdma_nl_register(RDMA_NL_NLDEV, nldev_cb_table);
25682568 }
25692569
2570−void __exit nldev_exit(void)
2570+void nldev_exit(void)
25712571 {
25722572 rdma_nl_unregister(RDMA_NL_NLDEV);
25732573 }
drivers/infiniband/hw/efa/efa_main.c+3−1
@@ -1,6 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
22 /*
3− * Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All rights reserved.
3+ * Copyright 2018-2022 Amazon.com, Inc. or its affiliates. All rights reserved.
44 */
55
66 #include <linux/module.h>
@@ -14,10 +14,12 @@ · 7 unmodified lines
1414
1515 #define PCI_DEV_ID_EFA0_VF 0xefa0
1616 #define PCI_DEV_ID_EFA1_VF 0xefa1
17+#define PCI_DEV_ID_EFA2_VF 0xefa2
1718
1819 static const struct pci_device_id efa_pci_tbl[] = {
1920 { PCI_VDEVICE(AMAZON, PCI_DEV_ID_EFA0_VF) },
2021 { PCI_VDEVICE(AMAZON, PCI_DEV_ID_EFA1_VF) },
22+ { PCI_VDEVICE(AMAZON, PCI_DEV_ID_EFA2_VF) },
2123 { }
2224 };
2325
drivers/infiniband/hw/hfi1/pio.c+1−2
@@ -913,8 +913,7 @@ void sc_disable(struct send_context *sc) · 912 unmodified lines
913913 spin_unlock(&sc->release_lock);
914914
915915 write_seqlock(&sc->waitlock);
916− if (!list_empty(&sc->piowait))
917− list_move(&sc->piowait, &wake_list);
916+ list_splice_init(&sc->piowait, &wake_list);
918917 write_sequnlock(&sc->waitlock);
919918 while (!list_empty(&wake_list)) {
920919 struct iowait *wait;
drivers/infiniband/hw/hns/hns_roce_hw_v2.c+4−11
@@ -118,7 +118,6 @@ static const u32 hns_roce_op_code[] = { · 117 unmodified lines
118118 HR_OPC_MAP(ATOMIC_CMP_AND_SWP, ATOM_CMP_AND_SWAP),
119119 HR_OPC_MAP(ATOMIC_FETCH_AND_ADD, ATOM_FETCH_AND_ADD),
120120 HR_OPC_MAP(SEND_WITH_INV, SEND_WITH_INV),
121− HR_OPC_MAP(LOCAL_INV, LOCAL_INV),
122121 HR_OPC_MAP(MASKED_ATOMIC_CMP_AND_SWP, ATOM_MSK_CMP_AND_SWAP),
123122 HR_OPC_MAP(MASKED_ATOMIC_FETCH_AND_ADD, ATOM_MSK_FETCH_AND_ADD),
124123 HR_OPC_MAP(REG_MR, FAST_REG_PMR),
@@ -558,9 +557,6 @@ static int set_rc_opcode(struct hns_roce_dev *hr_dev, · 433 unmodified lines
558557 else
559558 ret = -EOPNOTSUPP;
560559 break;
561− case IB_WR_LOCAL_INV:
562− hr_reg_enable(rc_sq_wqe, RC_SEND_WQE_SO);
563− fallthrough;
564560 case IB_WR_SEND_WITH_INV:
565561 rc_sq_wqe->inv_key = cpu_to_le32(wr->ex.invalidate_rkey);
566562 break;
@@ -2921,8 +2917,12 @@ static int free_mr_modify_qp(struct hns_roce_dev *hr_dev) · 2354 unmodified lines
29212917
29222918 static int free_mr_init(struct hns_roce_dev *hr_dev)
29232919 {
2920+ struct hns_roce_v2_priv *priv = hr_dev->priv;
2921+ struct hns_roce_v2_free_mr *free_mr = &priv->free_mr;
29242922 int ret;
29252923
2924+ mutex_init(&free_mr->mutex);
2925+
29262926 ret = free_mr_alloc_res(hr_dev);
29272927 if (ret)
29282928 return ret;
@@ -3339,7 +3339,6 @@ static int hns_roce_v2_write_mtpt(struct hns_roce_dev *hr_dev, · 410 unmodified lines
33393339
33403340 hr_reg_write(mpt_entry, MPT_ST, V2_MPT_ST_VALID);
33413341 hr_reg_write(mpt_entry, MPT_PD, mr->pd);
3342− hr_reg_enable(mpt_entry, MPT_L_INV_EN);
33433342
33443343 hr_reg_write_bool(mpt_entry, MPT_BIND_EN,
33453344 mr->access & IB_ACCESS_MW_BIND);
@@ -3430,7 +3429,6 @@ static int hns_roce_v2_frmr_write_mtpt(struct hns_roce_dev *hr_dev, · 84 unmodified lines
34303429
34313430 hr_reg_enable(mpt_entry, MPT_RA_EN);
34323431 hr_reg_enable(mpt_entry, MPT_R_INV_EN);
3433− hr_reg_enable(mpt_entry, MPT_L_INV_EN);
34343432
34353433 hr_reg_enable(mpt_entry, MPT_FRE);
34363434 hr_reg_clear(mpt_entry, MPT_MR_MW);
@@ -3462,7 +3460,6 @@ static int hns_roce_v2_mw_write_mtpt(void *mb_buf, struct hns_roce_mw *mw) · 25 unmodified lines
34623460 hr_reg_write(mpt_entry, MPT_PD, mw->pdn);
34633461
34643462 hr_reg_enable(mpt_entry, MPT_R_INV_EN);
3465− hr_reg_enable(mpt_entry, MPT_L_INV_EN);
34663463 hr_reg_enable(mpt_entry, MPT_LW_EN);
34673464
34683465 hr_reg_enable(mpt_entry, MPT_MR_MW);
@@ -3911,7 +3908,6 @@ static const u32 wc_send_op_map[] = { · 442 unmodified lines
39113908 HR_WC_OP_MAP(RDMA_READ, RDMA_READ),
39123909 HR_WC_OP_MAP(RDMA_WRITE, RDMA_WRITE),
39133910 HR_WC_OP_MAP(RDMA_WRITE_WITH_IMM, RDMA_WRITE),
3914− HR_WC_OP_MAP(LOCAL_INV, LOCAL_INV),
39153911 HR_WC_OP_MAP(ATOM_CMP_AND_SWAP, COMP_SWAP),
39163912 HR_WC_OP_MAP(ATOM_FETCH_AND_ADD, FETCH_ADD),
39173913 HR_WC_OP_MAP(ATOM_MSK_CMP_AND_SWAP, MASKED_COMP_SWAP),
@@ -3961,9 +3957,6 @@ static void fill_send_wc(struct ib_wc *wc, struct hns_roce_v2_cqe *cqe) · 43 unmodified lines
39613957 case HNS_ROCE_V2_WQE_OP_RDMA_WRITE_WITH_IMM:
39623958 wc->wc_flags |= IB_WC_WITH_IMM;
39633959 break;
3964− case HNS_ROCE_V2_WQE_OP_LOCAL_INV:
3965− wc->wc_flags |= IB_WC_WITH_INVALIDATE;
3966− break;
39673960 case HNS_ROCE_V2_WQE_OP_ATOM_CMP_AND_SWAP:
39683961 case HNS_ROCE_V2_WQE_OP_ATOM_FETCH_AND_ADD:
39693962 case HNS_ROCE_V2_WQE_OP_ATOM_MSK_CMP_AND_SWAP:
drivers/infiniband/hw/hns/hns_roce_hw_v2.h+0−2
@@ -179,7 +179,6 @@ enum { · 178 unmodified lines
179179 HNS_ROCE_V2_WQE_OP_ATOM_MSK_CMP_AND_SWAP = 0x8,
180180 HNS_ROCE_V2_WQE_OP_ATOM_MSK_FETCH_AND_ADD = 0x9,
181181 HNS_ROCE_V2_WQE_OP_FAST_REG_PMR = 0xa,
182− HNS_ROCE_V2_WQE_OP_LOCAL_INV = 0xb,
183182 HNS_ROCE_V2_WQE_OP_BIND_MW = 0xc,
184183 HNS_ROCE_V2_WQE_OP_MASK = 0x1f,
185184 };
@@ -920,7 +919,6 @@ struct hns_roce_v2_rc_send_wqe { · 734 unmodified lines
920919 #define RC_SEND_WQE_OWNER RC_SEND_WQE_FIELD_LOC(7, 7)
921920 #define RC_SEND_WQE_CQE RC_SEND_WQE_FIELD_LOC(8, 8)
922921 #define RC_SEND_WQE_FENCE RC_SEND_WQE_FIELD_LOC(9, 9)
923−#define RC_SEND_WQE_SO RC_SEND_WQE_FIELD_LOC(10, 10)
924922 #define RC_SEND_WQE_SE RC_SEND_WQE_FIELD_LOC(11, 11)
925923 #define RC_SEND_WQE_INLINE RC_SEND_WQE_FIELD_LOC(12, 12)
926924 #define RC_SEND_WQE_WQE_INDEX RC_SEND_WQE_FIELD_LOC(30, 15)
drivers/infiniband/hw/qedr/main.c+8−1
@@ -344,6 +344,10 @@ static int qedr_alloc_resources(struct qedr_dev *dev) · 343 unmodified lines
344344 if (IS_IWARP(dev)) {
345345 xa_init(&dev->qps);
346346 dev->iwarp_wq = create_singlethread_workqueue("qedr_iwarpq");
347+ if (!dev->iwarp_wq) {
348+ rc = -ENOMEM;
349+ goto err1;
350+ }
347351 }
348352
349353 /* Allocate Status blocks for CNQ */
@@ -351,7 +355,7 @@ static int qedr_alloc_resources(struct qedr_dev *dev) · 1 unmodified line
351355 GFP_KERNEL);
352356 if (!dev->sb_array) {
353357 rc = -ENOMEM;
354− goto err1;
358+ goto err_destroy_wq;
355359 }
356360
357361 dev->cnq_array = kcalloc(dev->num_cnq,
@@ -402,6 +406,9 @@ err3: · 44 unmodified lines
402406 kfree(dev->cnq_array);
403407 err2:
404408 kfree(dev->sb_array);
409+err_destroy_wq:
410+ if (IS_IWARP(dev))
411+ destroy_workqueue(dev->iwarp_wq);
405412 err1:
406413 kfree(dev->sgid_tbl);
407414 return rc;
drivers/infiniband/sw/rxe/rxe_resp.c+3−1
@@ -879,8 +879,10 @@ static enum resp_states read_reply(struct rxe_qp *qp, · 878 unmodified lines
879879
880880 skb = prepare_ack_packet(qp, &ack_pkt, opcode, payload,
881881 res->cur_psn, AETH_ACK_UNLIMITED);
882− if (!skb)
882+ if (!skb) {
883+ rxe_put(mr);
883884 return RESPST_ERR_RNR;
885+ }
884886
885887 err = rxe_mr_copy(mr, res->read.va, payload_addr(&ack_pkt),
886888 payload, RXE_FROM_MR_OBJ);
drivers/input/joystick/iforce/iforce-main.c+4−4
@@ -273,22 +273,22 @@ int iforce_init_device(struct device *parent, u16 bustype, · 272 unmodified lines
273273 * Get device info.
274274 */
275275
276− if (!iforce_get_id_packet(iforce, 'M', buf, &len) || len < 3)
276+ if (!iforce_get_id_packet(iforce, 'M', buf, &len) && len >= 3)
277277 input_dev->id.vendor = get_unaligned_le16(buf + 1);
278278 else
279279 dev_warn(&iforce->dev->dev, "Device does not respond to id packet M\n");
280280
281− if (!iforce_get_id_packet(iforce, 'P', buf, &len) || len < 3)
281+ if (!iforce_get_id_packet(iforce, 'P', buf, &len) && len >= 3)
282282 input_dev->id.product = get_unaligned_le16(buf + 1);
283283 else
284284 dev_warn(&iforce->dev->dev, "Device does not respond to id packet P\n");
285285
286− if (!iforce_get_id_packet(iforce, 'B', buf, &len) || len < 3)
286+ if (!iforce_get_id_packet(iforce, 'B', buf, &len) && len >= 3)
287287 iforce->device_memory.end = get_unaligned_le16(buf + 1);
288288 else
289289 dev_warn(&iforce->dev->dev, "Device does not respond to id packet B\n");
290290
291− if (!iforce_get_id_packet(iforce, 'N', buf, &len) || len < 2)
291+ if (!iforce_get_id_packet(iforce, 'N', buf, &len) && len >= 2)
292292 ff_effects = buf[1];
293293 else
294294 dev_warn(&iforce->dev->dev, "Device does not respond to id packet N\n");
drivers/input/misc/soc_button_array.c+13−1
@@ -18,6 +18,10 @@ · 17 unmodified lines
1818 #include <linux/gpio.h>
1919 #include <linux/platform_device.h>
2020
21+static bool use_low_level_irq;
22+module_param(use_low_level_irq, bool, 0444);
23+MODULE_PARM_DESC(use_low_level_irq, "Use low-level triggered IRQ instead of edge triggered");
24+
2125 struct soc_button_info {
2226 const char *name;
2327 int acpi_index;
@@ -73,6 +77,13 @@ static const struct dmi_system_id dmi_use_low_level_irq[] = { · 49 unmodified lines
7377 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire SW5-012"),
7478 },
7579 },
80+ {
81+ /* Acer Switch V 10 SW5-017, same issue as Acer Switch 10 SW5-012. */
82+ .matches = {
83+ DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
84+ DMI_MATCH(DMI_PRODUCT_NAME, "SW5-017"),
85+ },
86+ },
7687 {
7788 /*
7889 * Acer One S1003. _LID method messes with power-button GPIO
@@ -164,7 +175,8 @@ soc_button_device_create(struct platform_device *pdev, · 85 unmodified lines
164175 }
165176
166177 /* See dmi_use_low_level_irq[] comment */
167− if (!autorepeat && dmi_check_system(dmi_use_low_level_irq)) {
178+ if (!autorepeat && (use_low_level_irq ||
179+ dmi_check_system(dmi_use_low_level_irq))) {
168180 irq_set_irq_type(irq, IRQ_TYPE_LEVEL_LOW);
169181 gpio_keys[n_buttons].irq = irq;
170182 gpio_keys[n_buttons].gpio = -ENOENT;
drivers/input/mouse/synaptics.c+1−0
@@ -192,6 +192,7 @@ static const char * const smbus_pnp_ids[] = { · 191 unmodified lines
192192 "SYN3221", /* HP 15-ay000 */
193193 "SYN323d", /* HP Spectre X360 13-w013dx */
194194 "SYN3257", /* HP Envy 13-ad105ng */
195+ "SYN3286", /* HP Laptop 15-da3001TU */
195196 NULL
196197 };
197198
drivers/input/serio/i8042-acpipnpio.h+4−4
@@ -115,18 +115,18 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = { · 114 unmodified lines
115115 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_NEVER)
116116 },
117117 {
118− /* ASUS ZenBook UX425UA */
118+ /* ASUS ZenBook UX425UA/QA */
119119 .matches = {
120120 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
121− DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX425UA"),
121+ DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX425"),
122122 },
123123 .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER)
124124 },
125125 {
126− /* ASUS ZenBook UM325UA */
126+ /* ASUS ZenBook UM325UA/QA */
127127 .matches = {
128128 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
129− DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX325UA_UM325UA"),
129+ DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX325"),
130130 },
131131 .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER)
132132 },
drivers/input/serio/i8042.c+0−4
@@ -1543,8 +1543,6 @@ static int i8042_probe(struct platform_device *dev) · 1542 unmodified lines
15431543 {
15441544 int error;
15451545
1546− i8042_platform_device = dev;
1547−
15481546 if (i8042_reset == I8042_RESET_ALWAYS) {
15491547 error = i8042_controller_selftest();
15501548 if (error)
@@ -1582,7 +1580,6 @@ static int i8042_probe(struct platform_device *dev) · 31 unmodified lines
15821580 i8042_free_aux_ports(); /* in case KBD failed but AUX not */
15831581 i8042_free_irqs();
15841582 i8042_controller_reset(false);
1585− i8042_platform_device = NULL;
15861583
15871584 return error;
15881585 }
@@ -1592,7 +1589,6 @@ static int i8042_remove(struct platform_device *dev) · 3 unmodified lines
15921589 i8042_unregister_ports();
15931590 i8042_free_irqs();
15941591 i8042_controller_reset(false);
1595− i8042_platform_device = NULL;
15961592
15971593 return 0;
15981594 }
drivers/input/touchscreen/goodix.c+11−0
@@ -1158,6 +1158,7 @@ static int goodix_configure_dev(struct goodix_ts_data *ts) · 1157 unmodified lines
11581158 input_set_abs_params(ts->input_dev, ABS_MT_WIDTH_MAJOR, 0, 255, 0, 0);
11591159 input_set_abs_params(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0);
11601160
1161+retry_read_config:
11611162 /* Read configuration and apply touchscreen parameters */
11621163 goodix_read_config(ts);
11631164
@@ -1165,6 +1166,16 @@ static int goodix_configure_dev(struct goodix_ts_data *ts) · 1 unmodified line
11651166 touchscreen_parse_properties(ts->input_dev, true, &ts->prop);
11661167
11671168 if (!ts->prop.max_x || !ts->prop.max_y || !ts->max_touch_num) {
1169+ if (!ts->reset_controller_at_probe &&
1170+ ts->irq_pin_access_method != IRQ_PIN_ACCESS_NONE) {
1171+ dev_info(&ts->client->dev, "Config not set, resetting controller\n");
1172+ /* Retry after a controller reset */
1173+ ts->reset_controller_at_probe = true;
1174+ error = goodix_reset(ts);
1175+ if (error)
1176+ return error;
1177+ goto retry_read_config;
1178+ }
11681179 dev_err(&ts->client->dev,
11691180 "Invalid config (%d, %d, %d), using defaults\n",
11701181 ts->prop.max_x, ts->prop.max_y, ts->max_touch_num);
drivers/input/touchscreen/raydium_i2c_ts.c+3−1
@@ -211,12 +211,14 @@ static int raydium_i2c_send(struct i2c_client *client, · 210 unmodified lines
211211
212212 error = raydium_i2c_xfer(client, addr, xfer, ARRAY_SIZE(xfer));
213213 if (likely(!error))
214− return 0;
214+ goto out;
215215
216216 msleep(RM_RETRY_DELAY_MS);
217217 } while (++tries < RM_MAX_RETRIES);
218218
219219 dev_err(&client->dev, "%s failed: %d\n", __func__, error);
220+out:
221+ kfree(tx_buf);
220222 return error;
221223 }
222224
drivers/iommu/intel/dmar.c+1−0
@@ -820,6 +820,7 @@ int __init dmar_dev_scope_init(void) · 819 unmodified lines
820820 info = dmar_alloc_pci_notify_info(dev,
821821 BUS_NOTIFY_ADD_DEVICE);
822822 if (!info) {
823+ pci_dev_put(dev);
823824 return dmar_dev_scope_status;
824825 } else {
825826 dmar_pci_bus_add_dev(info);
drivers/iommu/intel/iommu.c+73−8
@@ -959,11 +959,9 @@ static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain, · 958 unmodified lines
959959
960960 domain_flush_cache(domain, tmp_page, VTD_PAGE_SIZE);
961961 pteval = ((uint64_t)virt_to_dma_pfn(tmp_page) << VTD_PAGE_SHIFT) | DMA_PTE_READ | DMA_PTE_WRITE;
962− if (domain_use_first_level(domain)) {
963− pteval |= DMA_FL_PTE_XD | DMA_FL_PTE_US;
964− if (iommu_is_dma_domain(&domain->domain))
965− pteval |= DMA_FL_PTE_ACCESS;
966− }
962+ if (domain_use_first_level(domain))
963+ pteval |= DMA_FL_PTE_XD | DMA_FL_PTE_US | DMA_FL_PTE_ACCESS;
964+
967965 if (cmpxchg64(&pte->val, 0ULL, pteval))
968966 /* Someone else set it while we were thinking; use theirs. */
969967 free_pgtable_page(tmp_page);
@@ -1398,6 +1396,24 @@ static void domain_update_iotlb(struct dmar_domain *domain) · 428 unmodified lines
13981396 spin_unlock_irqrestore(&domain->lock, flags);
13991397 }
14001398
1399+/*
1400+ * The extra devTLB flush quirk impacts those QAT devices with PCI device
1401+ * IDs ranging from 0x4940 to 0x4943. It is exempted from risky_device()
1402+ * check because it applies only to the built-in QAT devices and it doesn't
1403+ * grant additional privileges.
1404+ */
1405+#define BUGGY_QAT_DEVID_MASK 0x494c
1406+static bool dev_needs_extra_dtlb_flush(struct pci_dev *pdev)
1407+{
1408+ if (pdev->vendor != PCI_VENDOR_ID_INTEL)
1409+ return false;
1410+
1411+ if ((pdev->device & 0xfffc) != BUGGY_QAT_DEVID_MASK)
1412+ return false;
1413+
1414+ return true;
1415+}
1416+
14011417 static void iommu_enable_pci_caps(struct device_domain_info *info)
14021418 {
14031419 struct pci_dev *pdev;
@@ -1480,6 +1496,7 @@ static void __iommu_flush_dev_iotlb(struct device_domain_info *info, · 76 unmodified lines
14801496 qdep = info->ats_qdep;
14811497 qi_flush_dev_iotlb(info->iommu, sid, info->pfsid,
14821498 qdep, addr, mask);
1499+ quirk_extra_dev_tlb_flush(info, addr, mask, PASID_RID2PASID, qdep);
14831500 }
14841501
14851502 static void iommu_flush_dev_iotlb(struct dmar_domain *domain,
@@ -3856,8 +3873,10 @@ static inline bool has_external_pci(void) · 2370 unmodified lines
38563873 struct pci_dev *pdev = NULL;
38573874
38583875 for_each_pci_dev(pdev)
3859− if (pdev->external_facing)
3876+ if (pdev->external_facing) {
3877+ pci_dev_put(pdev);
38603878 return true;
3879+ }
38613880
38623881 return false;
38633882 }
@@ -4492,9 +4511,10 @@ static struct iommu_device *intel_iommu_probe_device(struct device *dev) · 628 unmodified lines
44924511 if (dev_is_pci(dev)) {
44934512 if (ecap_dev_iotlb_support(iommu->ecap) &&
44944513 pci_ats_supported(pdev) &&
4495− dmar_ats_supported(pdev, iommu))
4514+ dmar_ats_supported(pdev, iommu)) {
44964515 info->ats_supported = 1;
4497−
4516+ info->dtlb_extra_inval = dev_needs_extra_dtlb_flush(pdev);
4517+ }
44984518 if (sm_supported(iommu)) {
44994519 if (pasid_supported(iommu)) {
45004520 int features = pci_pasid_features(pdev);
@@ -4933,3 +4953,48 @@ static void __init check_tylersburg_isoch(void) · 432 unmodified lines
49334953 pr_warn("Recommended TLB entries for ISOCH unit is 16; your BIOS set %d\n",
49344954 vtisochctrl);
49354955 }
4956+
4957+/*
4958+ * Here we deal with a device TLB defect where device may inadvertently issue ATS
4959+ * invalidation completion before posted writes initiated with translated address
4960+ * that utilized translations matching the invalidation address range, violating
4961+ * the invalidation completion ordering.
4962+ * Therefore, any use cases that cannot guarantee DMA is stopped before unmap is
4963+ * vulnerable to this defect. In other words, any dTLB invalidation initiated not
4964+ * under the control of the trusted/privileged host device driver must use this
4965+ * quirk.
4966+ * Device TLBs are invalidated under the following six conditions:
4967+ * 1. Device driver does DMA API unmap IOVA
4968+ * 2. Device driver unbind a PASID from a process, sva_unbind_device()
4969+ * 3. PASID is torn down, after PASID cache is flushed. e.g. process
4970+ * exit_mmap() due to crash
4971+ * 4. Under SVA usage, called by mmu_notifier.invalidate_range() where
4972+ * VM has to free pages that were unmapped
4973+ * 5. Userspace driver unmaps a DMA buffer
4974+ * 6. Cache invalidation in vSVA usage (upcoming)
4975+ *
4976+ * For #1 and #2, device drivers are responsible for stopping DMA traffic
4977+ * before unmap/unbind. For #3, iommu driver gets mmu_notifier to
4978+ * invalidate TLB the same way as normal user unmap which will use this quirk.
4979+ * The dTLB invalidation after PASID cache flush does not need this quirk.
4980+ *
4981+ * As a reminder, #6 will *NEED* this quirk as we enable nested translation.
4982+ */
4983+void quirk_extra_dev_tlb_flush(struct device_domain_info *info,
4984+ unsigned long address, unsigned long mask,
4985+ u32 pasid, u16 qdep)
4986+{
4987+ u16 sid;
4988+
4989+ if (likely(!info->dtlb_extra_inval))
4990+ return;
4991+
4992+ sid = PCI_DEVID(info->bus, info->devfn);
4993+ if (pasid == PASID_RID2PASID) {
4994+ qi_flush_dev_iotlb(info->iommu, sid, info->pfsid,
4995+ qdep, address, mask);
4996+ } else {
4997+ qi_flush_dev_iotlb_pasid(info->iommu, sid, info->pfsid,
4998+ pasid, qdep, address, mask);
4999+ }
5000+}
drivers/iommu/intel/iommu.h+4−0
@@ -623,6 +623,7 @@ struct device_domain_info { · 622 unmodified lines
623623 u8 pri_enabled:1;
624624 u8 ats_supported:1;
625625 u8 ats_enabled:1;
626+ u8 dtlb_extra_inval:1; /* Quirk for devices need extra flush */
626627 u8 ats_qdep;
627628 struct device *dev; /* it's NULL for PCIe-to-PCI bridge */
628629 struct intel_iommu *iommu; /* IOMMU used by this device */
@@ -728,6 +729,9 @@ void qi_flush_piotlb(struct intel_iommu *iommu, u16 did, u32 pasid, u64 addr, · 99 unmodified lines
728729 void qi_flush_dev_iotlb_pasid(struct intel_iommu *iommu, u16 sid, u16 pfsid,
729730 u32 pasid, u16 qdep, u64 addr,
730731 unsigned int size_order);
732+void quirk_extra_dev_tlb_flush(struct device_domain_info *info,
733+ unsigned long address, unsigned long pages,
734+ u32 pasid, u16 qdep);
731735 void qi_flush_pasid_cache(struct intel_iommu *iommu, u16 did, u64 granu,
732736 u32 pasid);
733737
drivers/iommu/intel/pasid.c+3−2
@@ -642,7 +642,7 @@ int intel_pasid_setup_second_level(struct intel_iommu *iommu, · 641 unmodified lines
642642 * Since it is a second level only translation setup, we should
643643 * set SRE bit as well (addresses are expected to be GPAs).
644644 */
645− if (pasid != PASID_RID2PASID)
645+ if (pasid != PASID_RID2PASID && ecap_srs(iommu->ecap))
646646 pasid_set_sre(pte);
647647 pasid_set_present(pte);
648648 spin_unlock(&iommu->lock);
@@ -685,7 +685,8 @@ int intel_pasid_setup_pass_through(struct intel_iommu *iommu, · 36 unmodified lines
685685 * We should set SRE bit as well since the addresses are expected
686686 * to be GPAs.
687687 */
688− pasid_set_sre(pte);
688+ if (ecap_srs(iommu->ecap))
689+ pasid_set_sre(pte);
689690 pasid_set_present(pte);
690691 spin_unlock(&iommu->lock);
691692
drivers/iommu/intel/svm.c+13−6
@@ -184,10 +184,13 @@ static void __flush_svm_range_dev(struct intel_svm *svm, · 183 unmodified lines
184184 return;
185185
186186 qi_flush_piotlb(sdev->iommu, sdev->did, svm->pasid, address, pages, ih);
187− if (info->ats_enabled)
187+ if (info->ats_enabled) {
188188 qi_flush_dev_iotlb_pasid(sdev->iommu, sdev->sid, info->pfsid,
189189 svm->pasid, sdev->qdep, address,
190190 order_base_2(pages));
191+ quirk_extra_dev_tlb_flush(info, address, order_base_2(pages),
192+ svm->pasid, sdev->qdep);
193+ }
191194 }
192195
193196 static void intel_flush_svm_range_dev(struct intel_svm *svm,
@@ -745,12 +748,16 @@ bad_req: · 551 unmodified lines
745748 * If prq is to be handled outside iommu driver via receiver of
746749 * the fault notifiers, we skip the page response here.
747750 */
748− if (!pdev || intel_svm_prq_report(iommu, &pdev->dev, req))
749− handle_bad_prq_event(iommu, req, QI_RESP_INVALID);
751+ if (!pdev)
752+ goto bad_req;
750753
751− trace_prq_report(iommu, &pdev->dev, req->qw_0, req->qw_1,
752− req->priv_data[0], req->priv_data[1],
753− iommu->prq_seq_number++);
754+ if (intel_svm_prq_report(iommu, &pdev->dev, req))
755+ handle_bad_prq_event(iommu, req, QI_RESP_INVALID);
756+ else
757+ trace_prq_report(iommu, &pdev->dev, req->qw_0, req->qw_1,
758+ req->priv_data[0], req->priv_data[1],
759+ iommu->prq_seq_number++);
760+ pci_dev_put(pdev);
754761 prq_advance:
755762 head = (head + sizeof(*req)) & PRQ_RING_MASK;
756763 }
drivers/isdn/hardware/mISDN/netjet.c+1−1
@@ -956,7 +956,7 @@ nj_release(struct tiger_hw *card) · 955 unmodified lines
956956 }
957957 if (card->irq > 0)
958958 free_irq(card->irq, card);
959− if (card->isac.dch.dev.dev.class)
959+ if (device_is_registered(&card->isac.dch.dev.dev))
960960 mISDN_unregister_device(&card->isac.dch.dev);
961961
962962 for (i = 0; i < 2; i++) {
drivers/isdn/mISDN/core.c+4−3
@@ -222,7 +222,7 @@ mISDN_register_device(struct mISDNdevice *dev, · 221 unmodified lines
222222
223223 err = get_free_devid();
224224 if (err < 0)
225− goto error1;
225+ return err;
226226 dev->id = err;
227227
228228 device_initialize(&dev->dev);
@@ -233,11 +233,12 @@ mISDN_register_device(struct mISDNdevice *dev, · 4 unmodified lines
233233 if (debug & DEBUG_CORE)
234234 printk(KERN_DEBUG "mISDN_register %s %d\n",
235235 dev_name(&dev->dev), dev->id);
236+ dev->dev.class = &mISDN_class;
237+
236238 err = create_stack(dev);
237239 if (err)
238240 goto error1;
239241
240− dev->dev.class = &mISDN_class;
241242 dev->dev.platform_data = dev;
242243 dev->dev.parent = parent;
243244 dev_set_drvdata(&dev->dev, dev);
@@ -249,8 +250,8 @@ mISDN_register_device(struct mISDNdevice *dev, · 5 unmodified lines
249250
250251 error3:
251252 delete_stack(dev);
252− return err;
253253 error1:
254+ put_device(&dev->dev);
254255 return err;
255256
256257 }
drivers/isdn/mISDN/dsp_pipeline.c+2−1
@@ -77,6 +77,7 @@ int mISDN_dsp_element_register(struct mISDN_dsp_element *elem) · 76 unmodified lines
7777 if (!entry)
7878 return -ENOMEM;
7979
80+ INIT_LIST_HEAD(&entry->list);
8081 entry->elem = elem;
8182
8283 entry->dev.class = elements_class;
@@ -107,7 +108,7 @@ err2: · 24 unmodified lines
107108 device_unregister(&entry->dev);
108109 return ret;
109110 err1:
110− kfree(entry);
111+ put_device(&entry->dev);
111112 return ret;
112113 }
113114 EXPORT_SYMBOL(mISDN_dsp_element_register);
drivers/md/dm-bufio.c+2−0
@@ -1858,6 +1858,8 @@ bad: · 1857 unmodified lines
18581858 dm_io_client_destroy(c->dm_io);
18591859 bad_dm_io:
18601860 mutex_destroy(&c->lock);
1861+ if (c->no_sleep)
1862+ static_branch_dec(&no_sleep_enabled);
18611863 kfree(c);
18621864 bad_client:
18631865 return ERR_PTR(r);
drivers/md/dm-crypt.c+1−0
@@ -3630,6 +3630,7 @@ static void crypt_io_hints(struct dm_target *ti, struct queue_limits *limits) · 3629 unmodified lines
36303630 limits->physical_block_size =
36313631 max_t(unsigned, limits->physical_block_size, cc->sector_size);
36323632 limits->io_min = max_t(unsigned, limits->io_min, cc->sector_size);
3633+ limits->dma_alignment = limits->logical_block_size - 1;
36333634 }
36343635
36353636 static struct target_type crypt_target = {
drivers/md/dm-integrity.c+15−6
@@ -263,6 +263,7 @@ struct dm_integrity_c { · 262 unmodified lines
263263
264264 struct completion crypto_backoff;
265265
266+ bool wrote_to_journal;
266267 bool journal_uptodate;
267268 bool just_formatted;
268269 bool recalculate_flag;
@@ -2375,6 +2376,8 @@ static void integrity_commit(struct work_struct *w) · 2106 unmodified lines
23752376 if (!commit_sections)
23762377 goto release_flush_bios;
23772378
2379+ ic->wrote_to_journal = true;
2380+
23782381 i = commit_start;
23792382 for (n = 0; n < commit_sections; n++) {
23802383 for (j = 0; j < ic->journal_section_entries; j++) {
@@ -2591,10 +2594,6 @@ static void integrity_writer(struct work_struct *w) · 210 unmodified lines
25912594
25922595 unsigned prev_free_sectors;
25932596
2594− /* the following test is not needed, but it tests the replay code */
2595− if (unlikely(dm_post_suspending(ic->ti)) && !ic->meta_dev)
2596− return;
2597−
25982597 spin_lock_irq(&ic->endio_wait.lock);
25992598 write_start = ic->committed_section;
26002599 write_sections = ic->n_committed_sections;
@@ -3101,10 +3100,17 @@ static void dm_integrity_postsuspend(struct dm_target *ti) · 500 unmodified lines
31013100 drain_workqueue(ic->commit_wq);
31023101
31033102 if (ic->mode == 'J') {
3104− if (ic->meta_dev)
3105− queue_work(ic->writer_wq, &ic->writer_work);
3103+ queue_work(ic->writer_wq, &ic->writer_work);
31063104 drain_workqueue(ic->writer_wq);
31073105 dm_integrity_flush_buffers(ic, true);
3106+ if (ic->wrote_to_journal) {
3107+ init_journal(ic, ic->free_section,
3108+ ic->journal_sections - ic->free_section, ic->commit_seq);
3109+ if (ic->free_section) {
3110+ init_journal(ic, 0, ic->free_section,
3111+ next_commit_seq(ic->commit_seq));
3112+ }
3113+ }
31083114 }
31093115
31103116 if (ic->mode == 'B') {
@@ -3132,6 +3138,8 @@ static void dm_integrity_resume(struct dm_target *ti) · 21 unmodified lines
31323138
31333139 DEBUG_print("resume\n");
31343140
3141+ ic->wrote_to_journal = false;
3142+
31353143 if (ic->provided_data_sectors != old_provided_data_sectors) {
31363144 if (ic->provided_data_sectors > old_provided_data_sectors &&
31373145 ic->mode == 'B' &&
@@ -3370,6 +3378,7 @@ static void dm_integrity_io_hints(struct dm_target *ti, struct queue_limits *lim · 232 unmodified lines
33703378 limits->logical_block_size = ic->sectors_per_block << SECTOR_SHIFT;
33713379 limits->physical_block_size = ic->sectors_per_block << SECTOR_SHIFT;
33723380 blk_limits_io_min(limits, ic->sectors_per_block << SECTOR_SHIFT);
3381+ limits->dma_alignment = limits->logical_block_size - 1;
33733382 }
33743383 }
33753384
drivers/md/dm-ioctl.c+2−2
@@ -655,7 +655,7 @@ static void list_version_get_needed(struct target_type *tt, void *needed_param) · 654 unmodified lines
655655 size_t *needed = needed_param;
656656
657657 *needed += sizeof(struct dm_target_versions);
658− *needed += strlen(tt->name);
658+ *needed += strlen(tt->name) + 1;
659659 *needed += ALIGN_MASK;
660660 }
661661
@@ -720,7 +720,7 @@ static int __list_versions(struct dm_ioctl *param, size_t param_size, const char · 58 unmodified lines
720720 iter_info.old_vers = NULL;
721721 iter_info.vers = vers;
722722 iter_info.flags = 0;
723− iter_info.end = (char *)vers+len;
723+ iter_info.end = (char *)vers + needed;
724724
725725 /*
726726 * Now loop through filling out the names & versions.
drivers/md/dm-log-writes.c+1−0
@@ -875,6 +875,7 @@ static void log_writes_io_hints(struct dm_target *ti, struct queue_limits *limit · 874 unmodified lines
875875 limits->logical_block_size = bdev_logical_block_size(lc->dev->bdev);
876876 limits->physical_block_size = bdev_physical_block_size(lc->dev->bdev);
877877 limits->io_min = limits->physical_block_size;
878+ limits->dma_alignment = limits->logical_block_size - 1;
878879 }
879880
880881 #if IS_ENABLED(CONFIG_FS_DAX)
drivers/media/common/videobuf2/frame_vector.c+12−56
@@ -35,11 +35,7 @@ · 34 unmodified lines
3535 int get_vaddr_frames(unsigned long start, unsigned int nr_frames,
3636 struct frame_vector *vec)
3737 {
38− struct mm_struct *mm = current->mm;
39− struct vm_area_struct *vma;
40− int ret_pin_user_pages_fast = 0;
41− int ret = 0;
42− int err;
38+ int ret;
4339
4440 if (nr_frames == 0)
4541 return 0;
@@ -52,57 +48,17 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames, · 6 unmodified lines
5248 ret = pin_user_pages_fast(start, nr_frames,
5349 FOLL_FORCE | FOLL_WRITE | FOLL_LONGTERM,
5450 (struct page **)(vec->ptrs));
55− if (ret > 0) {
56− vec->got_ref = true;
57− vec->is_pfns = false;
58− goto out_unlocked;
59− }
60− ret_pin_user_pages_fast = ret;
61−
62− mmap_read_lock(mm);
63− vec->got_ref = false;
64− vec->is_pfns = true;
65− ret = 0;
66− do {
67− unsigned long *nums = frame_vector_pfns(vec);
68−
69− vma = vma_lookup(mm, start);
70− if (!vma)
71− break;
72−
73− while (ret < nr_frames && start + PAGE_SIZE <= vma->vm_end) {
74− err = follow_pfn(vma, start, &nums[ret]);
75− if (err) {
76− if (ret)
77− goto out;
78− // If follow_pfn() returns -EINVAL, then this
79− // is not an IO mapping or a raw PFN mapping.
80− // In that case, return the original error from
81− // pin_user_pages_fast(). Otherwise this
82− // function would return -EINVAL when
83− // pin_user_pages_fast() returned -ENOMEM,
84− // which makes debugging hard.
85− if (err == -EINVAL && ret_pin_user_pages_fast)
86− ret = ret_pin_user_pages_fast;
87− else
88− ret = err;
89− goto out;
90− }
91− start += PAGE_SIZE;
92− ret++;
93− }
94− /* Bail out if VMA doesn't completely cover the tail page. */
95− if (start < vma->vm_end)
96− break;
97− } while (ret < nr_frames);
98−out:
99− mmap_read_unlock(mm);
100−out_unlocked:
101− if (!ret)
102− ret = -EFAULT;
103− if (ret > 0)
104− vec->nr_frames = ret;
105− return ret;
51+ vec->got_ref = true;
52+ vec->is_pfns = false;
53+ vec->nr_frames = ret;
54+
55+ if (likely(ret > 0))
56+ return ret;
57+
58+ /* This used to (racily) return non-refcounted pfns. Let people know */
59+ WARN_ONCE(1, "get_vaddr_frames() cannot follow VM_IO mapping");
60+ vec->nr_frames = 0;
61+ return ret ? ret : -EFAULT;
10662 }
10763 EXPORT_SYMBOL(get_vaddr_frames);
10864
drivers/misc/vmw_vmci/vmci_queue_pair.c+2−0
@@ -854,6 +854,7 @@ static int qp_notify_peer_local(bool attach, struct vmci_handle handle) · 853 unmodified lines
854854 u32 context_id = vmci_get_context_id();
855855 struct vmci_event_qp ev;
856856
857+ memset(&ev, 0, sizeof(ev));
857858 ev.msg.hdr.dst = vmci_make_handle(context_id, VMCI_EVENT_HANDLER);
858859 ev.msg.hdr.src = vmci_make_handle(VMCI_HYPERVISOR_CONTEXT_ID,
859860 VMCI_CONTEXT_RESOURCE_ID);
@@ -1467,6 +1468,7 @@ static int qp_notify_peer(bool attach, · 607 unmodified lines
14671468 * kernel.
14681469 */
14691470
1471+ memset(&ev, 0, sizeof(ev));
14701472 ev.msg.hdr.dst = vmci_make_handle(peer_id, VMCI_EVENT_HANDLER);
14711473 ev.msg.hdr.src = vmci_make_handle(VMCI_HYPERVISOR_CONTEXT_ID,
14721474 VMCI_CONTEXT_RESOURCE_ID);
drivers/mmc/core/core.c+14−3
@@ -1134,7 +1134,13 @@ u32 mmc_select_voltage(struct mmc_host *host, u32 ocr) · 1133 unmodified lines
11341134 mmc_power_cycle(host, ocr);
11351135 } else {
11361136 bit = fls(ocr) - 1;
1137− ocr &= 3 << bit;
1137+ /*
1138+ * The bit variable represents the highest voltage bit set in
1139+ * the OCR register.
1140+ * To keep a range of 2 values (e.g. 3.2V/3.3V and 3.3V/3.4V),
1141+ * we must shift the mask '3' with (bit - 1).
1142+ */
1143+ ocr &= 3 << (bit - 1);
11381144 if (bit != host->ios.vdd)
11391145 dev_warn(mmc_dev(host), "exceeding card's volts\n");
11401146 }
@@ -1478,6 +1484,11 @@ void mmc_init_erase(struct mmc_card *card) · 337 unmodified lines
14781484 card->pref_erase = 0;
14791485 }
14801486
1487+static bool is_trim_arg(unsigned int arg)
1488+{
1489+ return (arg & MMC_TRIM_OR_DISCARD_ARGS) && arg != MMC_DISCARD_ARG;
1490+}
1491+
14811492 static unsigned int mmc_mmc_erase_timeout(struct mmc_card *card,
14821493 unsigned int arg, unsigned int qty)
14831494 {
@@ -1760,7 +1771,7 @@ int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr, · 276 unmodified lines
17601771 !(card->ext_csd.sec_feature_support & EXT_CSD_SEC_ER_EN))
17611772 return -EOPNOTSUPP;
17621773
1763− if (mmc_card_mmc(card) && (arg & MMC_TRIM_ARGS) &&
1774+ if (mmc_card_mmc(card) && is_trim_arg(arg) &&
17641775 !(card->ext_csd.sec_feature_support & EXT_CSD_SEC_GB_CL_EN))
17651776 return -EOPNOTSUPP;
17661777
@@ -1790,7 +1801,7 @@ int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr, · 23 unmodified lines
17901801 * identified by the card->eg_boundary flag.
17911802 */
17921803 rem = card->erase_size - (from % card->erase_size);
1793− if ((arg & MMC_TRIM_ARGS) && (card->eg_boundary) && (nr > rem)) {
1804+ if ((arg & MMC_TRIM_OR_DISCARD_ARGS) && card->eg_boundary && nr > rem) {
17941805 err = mmc_do_erase(card, from, from + rem - 1, arg);
17951806 from += rem;
17961807 if ((err) || (to <= from))
drivers/mmc/core/mmc_test.c+2−1
@@ -3179,7 +3179,8 @@ static int __mmc_test_register_dbgfs_file(struct mmc_card *card, · 3178 unmodified lines
31793179 struct mmc_test_dbgfs_file *df;
31803180
31813181 if (card->debugfs_root)
3182− debugfs_create_file(name, mode, card->debugfs_root, card, fops);
3182+ file = debugfs_create_file(name, mode, card->debugfs_root,
3183+ card, fops);
31833184
31843185 df = kmalloc(sizeof(*df), GFP_KERNEL);
31853186 if (!df) {
drivers/mmc/host/mtk-sd.c+2−4
@@ -2588,13 +2588,11 @@ static int msdc_of_clock_parse(struct platform_device *pdev, · 2587 unmodified lines
25882588 return PTR_ERR(host->src_clk_cg);
25892589 }
25902590
2591− host->sys_clk_cg = devm_clk_get_optional(&pdev->dev, "sys_cg");
2591+ /* If present, always enable for this clock gate */
2592+ host->sys_clk_cg = devm_clk_get_optional_enabled(&pdev->dev, "sys_cg");
25922593 if (IS_ERR(host->sys_clk_cg))
25932594 host->sys_clk_cg = NULL;
25942595
2595− /* If present, always enable for this clock gate */
2596− clk_prepare_enable(host->sys_clk_cg);
2597−
25982596 host->bulk_clks[0].id = "pclk_cg";
25992597 host->bulk_clks[1].id = "axi_cg";
26002598 host->bulk_clks[2].id = "ahb_cg";
drivers/mmc/host/sdhci-brcmstb.c+2−1
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/bitops.h>
1313 #include <linux/delay.h>
1414
15+#include "sdhci-cqhci.h"
1516 #include "sdhci-pltfm.h"
1617 #include "cqhci.h"
1718
@@ -55,7 +56,7 @@ static void brcmstb_reset(struct sdhci_host *host, u8 mask) · 37 unmodified lines
5556 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
5657 struct sdhci_brcmstb_priv *priv = sdhci_pltfm_priv(pltfm_host);
5758
58− sdhci_reset(host, mask);
59+ sdhci_and_cqhci_reset(host, mask);
5960
6061 /* Reset will clear this, so re-enable it */
6162 if (priv->flags & BRCMSTB_PRIV_FLAGS_GATE_CLOCK)
drivers/mmc/host/sdhci-cqhci.h+24−0
@@ -0,0 +1,24 @@
1+/* SPDX-License-Identifier: GPL-2.0-only */
2+/*
3+ * Copyright 2022 The Chromium OS Authors
4+ *
5+ * Support that applies to the combination of SDHCI and CQHCI, while not
6+ * expressing a dependency between the two modules.
7+ */
8+
9+#ifndef __MMC_HOST_SDHCI_CQHCI_H__
10+#define __MMC_HOST_SDHCI_CQHCI_H__
11+
12+#include "cqhci.h"
13+#include "sdhci.h"
14+
15+static inline void sdhci_and_cqhci_reset(struct sdhci_host *host, u8 mask)
16+{
17+ if ((host->mmc->caps2 & MMC_CAP2_CQE) && (mask & SDHCI_RESET_ALL) &&
18+ host->mmc->cqe_private)
19+ cqhci_deactivate(host->mmc);
20+
21+ sdhci_reset(host, mask);
22+}
23+
24+#endif /* __MMC_HOST_SDHCI_CQHCI_H__ */
drivers/mmc/host/sdhci-esdhc-imx.c+5−4
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include <linux/of_device.h>
2626 #include <linux/pinctrl/consumer.h>
2727 #include <linux/pm_runtime.h>
28+#include "sdhci-cqhci.h"
2829 #include "sdhci-pltfm.h"
2930 #include "sdhci-esdhc.h"
3031 #include "cqhci.h"
@@ -1288,7 +1289,7 @@ static void esdhc_set_uhs_signaling(struct sdhci_host *host, unsigned timing) · 1257 unmodified lines
12881289
12891290 static void esdhc_reset(struct sdhci_host *host, u8 mask)
12901291 {
1291− sdhci_reset(host, mask);
1292+ sdhci_and_cqhci_reset(host, mask);
12921293
12931294 sdhci_writel(host, host->ier, SDHCI_INT_ENABLE);
12941295 sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE);
@@ -1511,7 +1512,7 @@ static void esdhc_cqe_enable(struct mmc_host *mmc) · 216 unmodified lines
15111512 * system resume back.
15121513 */
15131514 cqhci_writel(cq_host, 0, CQHCI_CTL);
1514− if (cqhci_readl(cq_host, CQHCI_CTL) && CQHCI_HALT)
1515+ if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT)
15151516 dev_err(mmc_dev(host->mmc),
15161517 "failed to exit halt state when enable CQE\n");
15171518
@@ -1671,14 +1672,14 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) · 153 unmodified lines
16711672 if (imx_data->socdata->flags & ESDHC_FLAG_ERR004536)
16721673 host->quirks |= SDHCI_QUIRK_BROKEN_ADMA;
16731674
1674− if (host->caps & MMC_CAP_8_BIT_DATA &&
1675+ if (host->mmc->caps & MMC_CAP_8_BIT_DATA &&
16751676 imx_data->socdata->flags & ESDHC_FLAG_HS400)
16761677 host->mmc->caps2 |= MMC_CAP2_HS400;
16771678
16781679 if (imx_data->socdata->flags & ESDHC_FLAG_BROKEN_AUTO_CMD23)
16791680 host->quirks2 |= SDHCI_QUIRK2_ACMD23_BROKEN;
16801681
1681− if (host->caps & MMC_CAP_8_BIT_DATA &&
1682+ if (host->mmc->caps & MMC_CAP_8_BIT_DATA &&
16821683 imx_data->socdata->flags & ESDHC_FLAG_HS400_ES) {
16831684 host->mmc->caps2 |= MMC_CAP2_HS400_ES;
16841685 host->mmc_host_ops.hs400_enhanced_strobe =
drivers/mmc/host/sdhci-of-arasan.c+2−1
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include <linux/firmware/xlnx-zynqmp.h>
2626
2727 #include "cqhci.h"
28+#include "sdhci-cqhci.h"
2829 #include "sdhci-pltfm.h"
2930
3031 #define SDHCI_ARASAN_VENDOR_REGISTER 0x78
@@ -366,7 +367,7 @@ static void sdhci_arasan_reset(struct sdhci_host *host, u8 mask) · 335 unmodified lines
366367 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
367368 struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host);
368369
369− sdhci_reset(host, mask);
370+ sdhci_and_cqhci_reset(host, mask);
370371
371372 if (sdhci_arasan->quirks & SDHCI_ARASAN_QUIRK_FORCE_CDTEST) {
372373 ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
drivers/mmc/host/sdhci-pci-core.c+2−0
@@ -1749,6 +1749,8 @@ static int amd_probe(struct sdhci_pci_chip *chip) · 1748 unmodified lines
17491749 }
17501750 }
17511751
1752+ pci_dev_put(smbus_dev);
1753+
17521754 if (gen == AMD_CHIPSET_BEFORE_ML || gen == AMD_CHIPSET_CZ)
17531755 chip->quirks2 |= SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD;
17541756
drivers/mmc/host/sdhci-pci-o2micro.c+7−0
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #define O2_SD_CAPS 0xE0
3333 #define O2_SD_ADMA1 0xE2
3434 #define O2_SD_ADMA2 0xE7
35+#define O2_SD_MISC_CTRL2 0xF0
3536 #define O2_SD_INF_MOD 0xF1
3637 #define O2_SD_MISC_CTRL4 0xFC
3738 #define O2_SD_MISC_CTRL 0x1C0
@@ -877,6 +878,12 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 839 unmodified lines
877878 /* Set Tuning Windows to 5 */
878879 pci_write_config_byte(chip->pdev,
879880 O2_SD_TUNING_CTRL, 0x55);
881+ //Adjust 1st and 2nd CD debounce time
882+ pci_read_config_dword(chip->pdev, O2_SD_MISC_CTRL2, &scratch_32);
883+ scratch_32 &= 0xFFE7FFFF;
884+ scratch_32 |= 0x00180000;
885+ pci_write_config_dword(chip->pdev, O2_SD_MISC_CTRL2, scratch_32);
886+ pci_write_config_dword(chip->pdev, O2_SD_DETECT_SETTING, 1);
880887 /* Lock WP */
881888 ret = pci_read_config_byte(chip->pdev,
882889 O2_SD_LOCK_WP, &scratch);
drivers/mmc/host/sdhci-sprd.c+3−1
@@ -470,7 +470,7 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios) · 469 unmodified lines
470470 }
471471
472472 if (IS_ERR(sprd_host->pinctrl))
473− return 0;
473+ goto reset;
474474
475475 switch (ios->signal_voltage) {
476476 case MMC_SIGNAL_VOLTAGE_180:
@@ -498,6 +498,8 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios) · 21 unmodified lines
498498
499499 /* Wait for 300 ~ 500 us for pin state stable */
500500 usleep_range(300, 500);
501+
502+reset:
501503 sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);
502504
503505 return 0;
drivers/mmc/host/sdhci-tegra.c+2−1
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828
2929 #include <soc/tegra/common.h>
3030
31+#include "sdhci-cqhci.h"
3132 #include "sdhci-pltfm.h"
3233 #include "cqhci.h"
3334
@@ -367,7 +368,7 @@ static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask) · 333 unmodified lines
367368 const struct sdhci_tegra_soc_data *soc_data = tegra_host->soc_data;
368369 u32 misc_ctrl, clk_ctrl, pad_ctrl;
369370
370− sdhci_reset(host, mask);
371+ sdhci_and_cqhci_reset(host, mask);
371372
372373 if (!(mask & SDHCI_RESET_ALL))
373374 return;
drivers/mmc/host/sdhci.c+54−7
@@ -373,6 +373,7 @@ static void sdhci_init(struct sdhci_host *host, int soft) · 372 unmodified lines
373373 if (soft) {
374374 /* force clock reconfiguration */
375375 host->clock = 0;
376+ host->reinit_uhs = true;
376377 mmc->ops->set_ios(mmc, &mmc->ios);
377378 }
378379 }
@@ -2293,11 +2294,46 @@ void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing) · 1914 unmodified lines
22932294 }
22942295 EXPORT_SYMBOL_GPL(sdhci_set_uhs_signaling);
22952296
2297+static bool sdhci_timing_has_preset(unsigned char timing)
2298+{
2299+ switch (timing) {
2300+ case MMC_TIMING_UHS_SDR12:
2301+ case MMC_TIMING_UHS_SDR25:
2302+ case MMC_TIMING_UHS_SDR50:
2303+ case MMC_TIMING_UHS_SDR104:
2304+ case MMC_TIMING_UHS_DDR50:
2305+ case MMC_TIMING_MMC_DDR52:
2306+ return true;
2307+ };
2308+ return false;
2309+}
2310+
2311+static bool sdhci_preset_needed(struct sdhci_host *host, unsigned char timing)
2312+{
2313+ return !(host->quirks2 & SDHCI_QUIRK2_PRESET_VALUE_BROKEN) &&
2314+ sdhci_timing_has_preset(timing);
2315+}
2316+
2317+static bool sdhci_presetable_values_change(struct sdhci_host *host, struct mmc_ios *ios)
2318+{
2319+ /*
2320+ * Preset Values are: Driver Strength, Clock Generator and SDCLK/RCLK
2321+ * Frequency. Check if preset values need to be enabled, or the Driver
2322+ * Strength needs updating. Note, clock changes are handled separately.
2323+ */
2324+ return !host->preset_enabled &&
2325+ (sdhci_preset_needed(host, ios->timing) || host->drv_type != ios->drv_type);
2326+}
2327+
22962328 void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
22972329 {
22982330 struct sdhci_host *host = mmc_priv(mmc);
2331+ bool reinit_uhs = host->reinit_uhs;
2332+ bool turning_on_clk = false;
22992333 u8 ctrl;
23002334
2335+ host->reinit_uhs = false;
2336+
23012337 if (ios->power_mode == MMC_POWER_UNDEFINED)
23022338 return;
23032339
@@ -2323,6 +2359,8 @@ void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) · 19 unmodified lines
23232359 sdhci_enable_preset_value(host, false);
23242360
23252361 if (!ios->clock || ios->clock != host->clock) {
2362+ turning_on_clk = ios->clock && !host->clock;
2363+
23262364 host->ops->set_clock(host, ios->clock);
23272365 host->clock = ios->clock;
23282366
@@ -2349,6 +2387,17 @@ void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) · 20 unmodified lines
23492387
23502388 host->ops->set_bus_width(host, ios->bus_width);
23512389
2390+ /*
2391+ * Special case to avoid multiple clock changes during voltage
2392+ * switching.
2393+ */
2394+ if (!reinit_uhs &&
2395+ turning_on_clk &&
2396+ host->timing == ios->timing &&
2397+ host->version >= SDHCI_SPEC_300 &&
2398+ !sdhci_presetable_values_change(host, ios))
2399+ return;
2400+
23522401 ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
23532402
23542403 if (!(host->quirks & SDHCI_QUIRK_NO_HISPD_BIT)) {
@@ -2392,6 +2441,7 @@ void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) · 37 unmodified lines
23922441 }
23932442
23942443 sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
2444+ host->drv_type = ios->drv_type;
23952445 } else {
23962446 /*
23972447 * According to SDHC Spec v3.00, if the Preset Value
@@ -2419,19 +2469,14 @@ void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) · 21 unmodified lines
24192469 host->ops->set_uhs_signaling(host, ios->timing);
24202470 host->timing = ios->timing;
24212471
2422− if (!(host->quirks2 & SDHCI_QUIRK2_PRESET_VALUE_BROKEN) &&
2423− ((ios->timing == MMC_TIMING_UHS_SDR12) ||
2424− (ios->timing == MMC_TIMING_UHS_SDR25) ||
2425− (ios->timing == MMC_TIMING_UHS_SDR50) ||
2426− (ios->timing == MMC_TIMING_UHS_SDR104) ||
2427− (ios->timing == MMC_TIMING_UHS_DDR50) ||
2428− (ios->timing == MMC_TIMING_MMC_DDR52))) {
2472+ if (sdhci_preset_needed(host, ios->timing)) {
24292473 u16 preset;
24302474
24312475 sdhci_enable_preset_value(host, true);
24322476 preset = sdhci_get_preset_value(host);
24332477 ios->drv_type = FIELD_GET(SDHCI_PRESET_DRV_MASK,
24342478 preset);
2479+ host->drv_type = ios->drv_type;
24352480 }
24362481
24372482 /* Re-enable SD Clock */
@@ -3768,6 +3813,7 @@ int sdhci_resume_host(struct sdhci_host *host) · 1330 unmodified lines
37683813 sdhci_init(host, 0);
37693814 host->pwr = 0;
37703815 host->clock = 0;
3816+ host->reinit_uhs = true;
37713817 mmc->ops->set_ios(mmc, &mmc->ios);
37723818 } else {
37733819 sdhci_init(host, (mmc->pm_flags & MMC_PM_KEEP_POWER));
@@ -3830,6 +3876,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset) · 56 unmodified lines
38303876 /* Force clock and power re-program */
38313877 host->pwr = 0;
38323878 host->clock = 0;
3879+ host->reinit_uhs = true;
38333880 mmc->ops->start_signal_voltage_switch(mmc, &mmc->ios);
38343881 mmc->ops->set_ios(mmc, &mmc->ios);
38353882
drivers/mmc/host/sdhci.h+2−0
@@ -524,6 +524,8 @@ struct sdhci_host { · 523 unmodified lines
524524
525525 unsigned int clock; /* Current clock (MHz) */
526526 u8 pwr; /* Current voltage */
527+ u8 drv_type; /* Current UHS-I driver type */
528+ bool reinit_uhs; /* Force UHS-related re-initialization */
527529
528530 bool runtime_suspended; /* Host is runtime suspended */
529531 bool bus_on; /* Bus power prevents runtime suspend */
drivers/mmc/host/sdhci_am654.c+4−3
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <linux/sys_soc.h>
1616
1717 #include "cqhci.h"
18+#include "sdhci-cqhci.h"
1819 #include "sdhci-pltfm.h"
1920
2021 /* CTL_CFG Registers */
@@ -378,7 +379,7 @@ static void sdhci_am654_reset(struct sdhci_host *host, u8 mask) · 357 unmodified lines
378379 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
379380 struct sdhci_am654_data *sdhci_am654 = sdhci_pltfm_priv(pltfm_host);
380381
381− sdhci_reset(host, mask);
382+ sdhci_and_cqhci_reset(host, mask);
382383
383384 if (sdhci_am654->quirks & SDHCI_AM654_QUIRK_FORCE_CDTEST) {
384385 ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
@@ -464,7 +465,7 @@ static struct sdhci_ops sdhci_am654_ops = { · 79 unmodified lines
464465 .set_clock = sdhci_am654_set_clock,
465466 .write_b = sdhci_am654_write_b,
466467 .irq = sdhci_am654_cqhci_irq,
467− .reset = sdhci_reset,
468+ .reset = sdhci_and_cqhci_reset,
468469 };
469470
470471 static const struct sdhci_pltfm_data sdhci_am654_pdata = {
@@ -494,7 +495,7 @@ static struct sdhci_ops sdhci_j721e_8bit_ops = { · 23 unmodified lines
494495 .set_clock = sdhci_am654_set_clock,
495496 .write_b = sdhci_am654_write_b,
496497 .irq = sdhci_am654_cqhci_irq,
497− .reset = sdhci_reset,
498+ .reset = sdhci_and_cqhci_reset,
498499 };
499500
500501 static const struct sdhci_pltfm_data sdhci_j721e_8bit_pdata = {
drivers/mtd/nand/onenand/Kconfig+1−0
@@ -26,6 +26,7 @@ config MTD_ONENAND_OMAP2 · 25 unmodified lines
2626 tristate "OneNAND on OMAP2/OMAP3 support"
2727 depends on ARCH_OMAP2 || ARCH_OMAP3 || (COMPILE_TEST && ARM)
2828 depends on OF || COMPILE_TEST
29+ depends on OMAP_GPMC
2930 help
3031 Support for a OneNAND flash device connected to an OMAP2/OMAP3 SoC
3132 via the GPMC memory controller.
drivers/mtd/nand/raw/nand_base.c+2−2
@@ -5834,7 +5834,7 @@ nand_match_ecc_req(struct nand_chip *chip, · 5833 unmodified lines
58345834 int req_step = requirements->step_size;
58355835 int req_strength = requirements->strength;
58365836 int req_corr, step_size, strength, nsteps, ecc_bytes, ecc_bytes_total;
5837− int best_step, best_strength, best_ecc_bytes;
5837+ int best_step = 0, best_strength = 0, best_ecc_bytes = 0;
58385838 int best_ecc_bytes_total = INT_MAX;
58395839 int i, j;
58405840
@@ -5915,7 +5915,7 @@ nand_maximize_ecc(struct nand_chip *chip, · 74 unmodified lines
59155915 int step_size, strength, nsteps, ecc_bytes, corr;
59165916 int best_corr = 0;
59175917 int best_step = 0;
5918− int best_strength, best_ecc_bytes;
5918+ int best_strength = 0, best_ecc_bytes = 0;
59195919 int i, j;
59205920
59215921 for (i = 0; i < caps->nstepinfos; i++) {
drivers/mtd/nand/raw/qcom_nandc.c+7−5
@@ -3167,16 +3167,18 @@ static int qcom_nand_host_init_and_register(struct qcom_nand_controller *nandc, · 3166 unmodified lines
31673167
31683168 ret = mtd_device_parse_register(mtd, probes, NULL, NULL, 0);
31693169 if (ret)
3170− nand_cleanup(chip);
3170+ goto err;
31713171
31723172 if (nandc->props->use_codeword_fixup) {
31733173 ret = qcom_nand_host_parse_boot_partitions(nandc, host, dn);
3174− if (ret) {
3175− nand_cleanup(chip);
3176− return ret;
3177− }
3174+ if (ret)
3175+ goto err;
31783176 }
31793177
3178+ return 0;
3179+
3180+err:
3181+ nand_cleanup(chip);
31803182 return ret;
31813183 }
31823184
drivers/net/arcnet/com20020_cs.c+9−2
@@ -113,6 +113,7 @@ static int com20020_probe(struct pcmcia_device *p_dev) · 112 unmodified lines
113113 struct com20020_dev *info;
114114 struct net_device *dev;
115115 struct arcnet_local *lp;
116+ int ret = -ENOMEM;
116117
117118 dev_dbg(&p_dev->dev, "com20020_attach()\n");
118119
@@ -142,12 +143,18 @@ static int com20020_probe(struct pcmcia_device *p_dev) · 23 unmodified lines
142143 info->dev = dev;
143144 p_dev->priv = info;
144145
145− return com20020_config(p_dev);
146+ ret = com20020_config(p_dev);
147+ if (ret)
148+ goto fail_config;
149+
150+ return 0;
146151
152+fail_config:
153+ free_arcdev(dev);
147154 fail_alloc_dev:
148155 kfree(info);
149156 fail_alloc_info:
150− return -ENOMEM;
157+ return ret;
151158 } /* com20020_attach */
152159
153160 static void com20020_detach(struct pcmcia_device *link)
drivers/net/bonding/bond_main.c+12−5
@@ -3231,16 +3231,23 @@ static int bond_na_rcv(const struct sk_buff *skb, struct bonding *bond, · 3230 unmodified lines
32313231 struct slave *slave)
32323232 {
32333233 struct slave *curr_active_slave, *curr_arp_slave;
3234− struct icmp6hdr *hdr = icmp6_hdr(skb);
32353234 struct in6_addr *saddr, *daddr;
3235+ struct {
3236+ struct ipv6hdr ip6;
3237+ struct icmp6hdr icmp6;
3238+ } *combined, _combined;
32363239
32373240 if (skb->pkt_type == PACKET_OTHERHOST ||
3238− skb->pkt_type == PACKET_LOOPBACK ||
3239− hdr->icmp6_type != NDISC_NEIGHBOUR_ADVERTISEMENT)
3241+ skb->pkt_type == PACKET_LOOPBACK)
3242+ goto out;
3243+
3244+ combined = skb_header_pointer(skb, 0, sizeof(_combined), &_combined);
3245+ if (!combined || combined->ip6.nexthdr != NEXTHDR_ICMP ||
3246+ combined->icmp6.icmp6_type != NDISC_NEIGHBOUR_ADVERTISEMENT)
32403247 goto out;
32413248
3242− saddr = &ipv6_hdr(skb)->saddr;
3243− daddr = &ipv6_hdr(skb)->daddr;
3249+ saddr = &combined->ip6.saddr;
3250+ daddr = &combined->ip6.saddr;
32443251
32453252 slave_dbg(bond->dev, slave->dev, "%s: %s/%d av %d sv %d sip %pI6c tip %pI6c\n",
32463253 __func__, slave->dev->name, bond_slave_state(slave),
drivers/net/can/at91_can.c+1−1
@@ -452,7 +452,7 @@ static netdev_tx_t at91_start_xmit(struct sk_buff *skb, struct net_device *dev) · 451 unmodified lines
452452 unsigned int mb, prio;
453453 u32 reg_mid, reg_mcr;
454454
455− if (can_dropped_invalid_skb(dev, skb))
455+ if (can_dev_dropped_skb(dev, skb))
456456 return NETDEV_TX_OK;
457457
458458 mb = get_tx_next_mb(priv);
drivers/net/can/c_can/c_can_main.c+1−1
@@ -457,7 +457,7 @@ static netdev_tx_t c_can_start_xmit(struct sk_buff *skb, · 456 unmodified lines
457457 struct c_can_tx_ring *tx_ring = &priv->tx;
458458 u32 idx, obj, cmd = IF_COMM_TX;
459459
460− if (can_dropped_invalid_skb(dev, skb))
460+ if (can_dev_dropped_skb(dev, skb))
461461 return NETDEV_TX_OK;
462462
463463 if (c_can_tx_busy(priv, tx_ring))
drivers/net/can/can327.c+4−2
@@ -263,8 +263,10 @@ static void can327_feed_frame_to_netdev(struct can327 *elm, struct sk_buff *skb) · 262 unmodified lines
263263 {
264264 lockdep_assert_held(&elm->lock);
265265
266− if (!netif_running(elm->dev))
266+ if (!netif_running(elm->dev)) {
267+ kfree_skb(skb);
267268 return;
269+ }
268270
269271 /* Queue for NAPI pickup.
270272 * rx-offload will update stats and LEDs for us.
@@ -813,7 +815,7 @@ static netdev_tx_t can327_netdev_start_xmit(struct sk_buff *skb, · 542 unmodified lines
813815 struct can327 *elm = netdev_priv(dev);
814816 struct can_frame *frame = (struct can_frame *)skb->data;
815817
816− if (can_dropped_invalid_skb(dev, skb))
818+ if (can_dev_dropped_skb(dev, skb))
817819 return NETDEV_TX_OK;
818820
819821 /* We shouldn't get here after a hardware fault:
drivers/net/can/cc770/cc770.c+1−1
@@ -429,7 +429,7 @@ static netdev_tx_t cc770_start_xmit(struct sk_buff *skb, struct net_device *dev) · 428 unmodified lines
429429 struct cc770_priv *priv = netdev_priv(dev);
430430 unsigned int mo = obj2msgobj(CC770_OBJ_TX);
431431
432− if (can_dropped_invalid_skb(dev, skb))
432+ if (can_dev_dropped_skb(dev, skb))
433433 return NETDEV_TX_OK;
434434
435435 netif_stop_queue(dev);
drivers/net/can/cc770/cc770_isa.c+6−4
@@ -264,22 +264,24 @@ static int cc770_isa_probe(struct platform_device *pdev) · 263 unmodified lines
264264 if (err) {
265265 dev_err(&pdev->dev,
266266 "couldn't register device (err=%d)\n", err);
267− goto exit_unmap;
267+ goto exit_free;
268268 }
269269
270270 dev_info(&pdev->dev, "device registered (reg_base=0x%p, irq=%d)\n",
271271 priv->reg_base, dev->irq);
272272 return 0;
273273
274− exit_unmap:
274+exit_free:
275+ free_cc770dev(dev);
276+exit_unmap:
275277 if (mem[idx])
276278 iounmap(base);
277− exit_release:
279+exit_release:
278280 if (mem[idx])
279281 release_mem_region(mem[idx], iosize);
280282 else
281283 release_region(port[idx], iosize);
282− exit:
284+exit:
283285 return err;
284286 }
285287
drivers/net/can/ctucanfd/ctucanfd_base.c+1−1
@@ -600,7 +600,7 @@ static netdev_tx_t ctucan_start_xmit(struct sk_buff *skb, struct net_device *nde · 599 unmodified lines
600600 bool ok;
601601 unsigned long flags;
602602
603− if (can_dropped_invalid_skb(ndev, skb))
603+ if (can_dev_dropped_skb(ndev, skb))
604604 return NETDEV_TX_OK;
605605
606606 if (unlikely(!CTU_CAN_FD_TXTNF(priv))) {
drivers/net/can/dev/skb.c+1−9
@@ -5,7 +5,6 @@ · 4 unmodified lines
55 */
66
77 #include <linux/can/dev.h>
8−#include <linux/can/netlink.h>
98 #include <linux/module.h>
109
1110 #define MOD_DESC "CAN device driver interface"
@@ -337,8 +336,6 @@ static bool can_skb_headroom_valid(struct net_device *dev, struct sk_buff *skb) · 325 unmodified lines
337336 /* Drop a given socketbuffer if it does not contain a valid CAN frame. */
338337 bool can_dropped_invalid_skb(struct net_device *dev, struct sk_buff *skb)
339338 {
340− struct can_priv *priv = netdev_priv(dev);
341−
342339 switch (ntohs(skb->protocol)) {
343340 case ETH_P_CAN:
344341 if (!can_is_can_skb(skb))
@@ -359,13 +356,8 @@ bool can_dropped_invalid_skb(struct net_device *dev, struct sk_buff *skb) · 14 unmodified lines
359356 goto inval_skb;
360357 }
361358
362− if (!can_skb_headroom_valid(dev, skb)) {
359+ if (!can_skb_headroom_valid(dev, skb))
363360 goto inval_skb;
364− } else if (priv->ctrlmode & CAN_CTRLMODE_LISTENONLY) {
365− netdev_info_once(dev,
366− "interface in listen only mode, dropping skb\n");
367− goto inval_skb;
368− }
369361
370362 return false;
371363
drivers/net/can/flexcan/flexcan-core.c+1−1
@@ -742,7 +742,7 @@ static netdev_tx_t flexcan_start_xmit(struct sk_buff *skb, struct net_device *de · 741 unmodified lines
742742 u32 ctrl = FLEXCAN_MB_CODE_TX_DATA | ((can_fd_len2dlc(cfd->len)) << 16);
743743 int i;
744744
745− if (can_dropped_invalid_skb(dev, skb))
745+ if (can_dev_dropped_skb(dev, skb))
746746 return NETDEV_TX_OK;
747747
748748 netif_stop_queue(dev);
drivers/net/can/grcan.c+1−1
@@ -1345,7 +1345,7 @@ static netdev_tx_t grcan_start_xmit(struct sk_buff *skb, · 1344 unmodified lines
13451345 unsigned long flags;
13461346 u32 oneshotmode = priv->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT;
13471347
1348− if (can_dropped_invalid_skb(dev, skb))
1348+ if (can_dev_dropped_skb(dev, skb))
13491349 return NETDEV_TX_OK;
13501350
13511351 /* Trying to transmit in silent mode will generate error interrupts, but
drivers/net/can/ifi_canfd/ifi_canfd.c+1−1
@@ -860,7 +860,7 @@ static netdev_tx_t ifi_canfd_start_xmit(struct sk_buff *skb, · 859 unmodified lines
860860 u32 txst, txid, txdlc;
861861 int i;
862862
863− if (can_dropped_invalid_skb(ndev, skb))
863+ if (can_dev_dropped_skb(ndev, skb))
864864 return NETDEV_TX_OK;
865865
866866 /* Check if the TX buffer is full */
drivers/net/can/janz-ican3.c+1−1
@@ -1693,7 +1693,7 @@ static netdev_tx_t ican3_xmit(struct sk_buff *skb, struct net_device *ndev) · 1692 unmodified lines
16931693 void __iomem *desc_addr;
16941694 unsigned long flags;
16951695
1696− if (can_dropped_invalid_skb(ndev, skb))
1696+ if (can_dev_dropped_skb(ndev, skb))
16971697 return NETDEV_TX_OK;
16981698
16991699 spin_lock_irqsave(&mod->lock, flags);
drivers/net/can/kvaser_pciefd.c+1−1
@@ -772,7 +772,7 @@ static netdev_tx_t kvaser_pciefd_start_xmit(struct sk_buff *skb, · 771 unmodified lines
772772 int nwords;
773773 u8 count;
774774
775− if (can_dropped_invalid_skb(netdev, skb))
775+ if (can_dev_dropped_skb(netdev, skb))
776776 return NETDEV_TX_OK;
777777
778778 nwords = kvaser_pciefd_prepare_tx_packet(&packet, can, skb);
drivers/net/can/m_can/m_can.c+2−2
@@ -1721,7 +1721,7 @@ static netdev_tx_t m_can_start_xmit(struct sk_buff *skb, · 1720 unmodified lines
17211721 {
17221722 struct m_can_classdev *cdev = netdev_priv(dev);
17231723
1724− if (can_dropped_invalid_skb(dev, skb))
1724+ if (can_dev_dropped_skb(dev, skb))
17251725 return NETDEV_TX_OK;
17261726
17271727 if (cdev->is_peripheral) {
@@ -1909,7 +1909,7 @@ int m_can_class_get_clocks(struct m_can_classdev *cdev) · 181 unmodified lines
19091909 cdev->hclk = devm_clk_get(cdev->dev, "hclk");
19101910 cdev->cclk = devm_clk_get(cdev->dev, "cclk");
19111911
1912− if (IS_ERR(cdev->cclk)) {
1912+ if (IS_ERR(cdev->hclk) || IS_ERR(cdev->cclk)) {
19131913 dev_err(cdev->dev, "no clock found\n");
19141914 ret = -ENODEV;
19151915 }
drivers/net/can/m_can/m_can_pci.c+6−3
@@ -120,7 +120,7 @@ static int m_can_pci_probe(struct pci_dev *pci, const struct pci_device_id *id) · 119 unmodified lines
120120
121121 ret = pci_alloc_irq_vectors(pci, 1, 1, PCI_IRQ_ALL_TYPES);
122122 if (ret < 0)
123− return ret;
123+ goto err_free_dev;
124124
125125 mcan_class->dev = &pci->dev;
126126 mcan_class->net->irq = pci_irq_vector(pci, 0);
@@ -132,7 +132,7 @@ static int m_can_pci_probe(struct pci_dev *pci, const struct pci_device_id *id) · 5 unmodified lines
132132
133133 ret = m_can_class_register(mcan_class);
134134 if (ret)
135− goto err;
135+ goto err_free_irq;
136136
137137 /* Enable interrupt control at CAN wrapper IP */
138138 writel(0x1, base + CTL_CSR_INT_CTL_OFFSET);
@@ -144,8 +144,10 @@ static int m_can_pci_probe(struct pci_dev *pci, const struct pci_device_id *id) · 5 unmodified lines
144144
145145 return 0;
146146
147−err:
147+err_free_irq:
148148 pci_free_irq_vectors(pci);
149+err_free_dev:
150+ m_can_class_free_dev(mcan_class->net);
149151 return ret;
150152 }
151153
@@ -161,6 +163,7 @@ static void m_can_pci_remove(struct pci_dev *pci) · 9 unmodified lines
161163 writel(0x0, priv->base + CTL_CSR_INT_CTL_OFFSET);
162164
163165 m_can_class_unregister(mcan_class);
166+ m_can_class_free_dev(mcan_class->net);
164167 pci_free_irq_vectors(pci);
165168 }
166169
drivers/net/can/mscan/mscan.c+1−1
@@ -191,7 +191,7 @@ static netdev_tx_t mscan_start_xmit(struct sk_buff *skb, struct net_device *dev) · 190 unmodified lines
191191 int i, rtr, buf_id;
192192 u32 can_id;
193193
194− if (can_dropped_invalid_skb(dev, skb))
194+ if (can_dev_dropped_skb(dev, skb))
195195 return NETDEV_TX_OK;
196196
197197 out_8(&regs->cantier, 0);
drivers/net/can/pch_can.c+1−1
@@ -882,7 +882,7 @@ static netdev_tx_t pch_xmit(struct sk_buff *skb, struct net_device *ndev) · 881 unmodified lines
882882 int i;
883883 u32 id2;
884884
885− if (can_dropped_invalid_skb(ndev, skb))
885+ if (can_dev_dropped_skb(ndev, skb))
886886 return NETDEV_TX_OK;
887887
888888 tx_obj_no = priv->tx_obj;
drivers/net/can/peak_canfd/peak_canfd.c+1−1
@@ -651,7 +651,7 @@ static netdev_tx_t peak_canfd_start_xmit(struct sk_buff *skb, · 650 unmodified lines
651651 int room_left;
652652 u8 len;
653653
654− if (can_dropped_invalid_skb(ndev, skb))
654+ if (can_dev_dropped_skb(ndev, skb))
655655 return NETDEV_TX_OK;
656656
657657 msg_size = ALIGN(sizeof(*msg) + cf->len, 4);
drivers/net/can/rcar/rcar_can.c+1−1
@@ -590,7 +590,7 @@ static netdev_tx_t rcar_can_start_xmit(struct sk_buff *skb, · 589 unmodified lines
590590 struct can_frame *cf = (struct can_frame *)skb->data;
591591 u32 data, i;
592592
593− if (can_dropped_invalid_skb(ndev, skb))
593+ if (can_dev_dropped_skb(ndev, skb))
594594 return NETDEV_TX_OK;
595595
596596 if (cf->can_id & CAN_EFF_FLAG) /* Extended frame format */
drivers/net/can/rcar/rcar_canfd.c+5−10
@@ -81,8 +81,7 @@ enum rcanfd_chip_id { · 80 unmodified lines
8181
8282 /* RSCFDnCFDGERFL / RSCFDnGERFL */
8383 #define RCANFD_GERFL_EEF0_7 GENMASK(23, 16)
84−#define RCANFD_GERFL_EEF1 BIT(17)
85−#define RCANFD_GERFL_EEF0 BIT(16)
84+#define RCANFD_GERFL_EEF(ch) BIT(16 + (ch))
8685 #define RCANFD_GERFL_CMPOF BIT(3) /* CAN FD only */
8786 #define RCANFD_GERFL_THLES BIT(2)
8887 #define RCANFD_GERFL_MES BIT(1)
@@ -90,7 +89,7 @@ enum rcanfd_chip_id { · 1 unmodified line
9089
9190 #define RCANFD_GERFL_ERR(gpriv, x) \
9291 ((x) & (reg_v3u(gpriv, RCANFD_GERFL_EEF0_7, \
93− RCANFD_GERFL_EEF0 | RCANFD_GERFL_EEF1) | \
92+ RCANFD_GERFL_EEF(0) | RCANFD_GERFL_EEF(1)) | \
9493 RCANFD_GERFL_MES | \
9594 ((gpriv)->fdmode ? RCANFD_GERFL_CMPOF : 0)))
9695
@@ -936,12 +935,8 @@ static void rcar_canfd_global_error(struct net_device *ndev) · 839 unmodified lines
936935 u32 ridx = ch + RCANFD_RFFIFO_IDX;
937936
938937 gerfl = rcar_canfd_read(priv->base, RCANFD_GERFL);
939− if ((gerfl & RCANFD_GERFL_EEF0) && (ch == 0)) {
940− netdev_dbg(ndev, "Ch0: ECC Error flag\n");
941− stats->tx_dropped++;
942− }
943− if ((gerfl & RCANFD_GERFL_EEF1) && (ch == 1)) {
944− netdev_dbg(ndev, "Ch1: ECC Error flag\n");
938+ if (gerfl & RCANFD_GERFL_EEF(ch)) {
939+ netdev_dbg(ndev, "Ch%u: ECC Error flag\n", ch);
945940 stats->tx_dropped++;
946941 }
947942 if (gerfl & RCANFD_GERFL_MES) {
@@ -1481,7 +1476,7 @@ static netdev_tx_t rcar_canfd_start_xmit(struct sk_buff *skb, · 533 unmodified lines
14811476 unsigned long flags;
14821477 u32 ch = priv->channel;
14831478
1484− if (can_dropped_invalid_skb(ndev, skb))
1479+ if (can_dev_dropped_skb(ndev, skb))
14851480 return NETDEV_TX_OK;
14861481
14871482 if (cf->can_id & CAN_EFF_FLAG) {
drivers/net/can/sja1000/sja1000.c+1−1
@@ -291,7 +291,7 @@ static netdev_tx_t sja1000_start_xmit(struct sk_buff *skb, · 290 unmodified lines
291291 u8 cmd_reg_val = 0x00;
292292 int i;
293293
294− if (can_dropped_invalid_skb(dev, skb))
294+ if (can_dev_dropped_skb(dev, skb))
295295 return NETDEV_TX_OK;
296296
297297 netif_stop_queue(dev);
drivers/net/can/sja1000/sja1000_isa.c+6−4
@@ -202,22 +202,24 @@ static int sja1000_isa_probe(struct platform_device *pdev) · 201 unmodified lines
202202 if (err) {
203203 dev_err(&pdev->dev, "registering %s failed (err=%d)\n",
204204 DRV_NAME, err);
205− goto exit_unmap;
205+ goto exit_free;
206206 }
207207
208208 dev_info(&pdev->dev, "%s device registered (reg_base=0x%p, irq=%d)\n",
209209 DRV_NAME, priv->reg_base, dev->irq);
210210 return 0;
211211
212− exit_unmap:
212+exit_free:
213+ free_sja1000dev(dev);
214+exit_unmap:
213215 if (mem[idx])
214216 iounmap(base);
215− exit_release:
217+exit_release:
216218 if (mem[idx])
217219 release_mem_region(mem[idx], iosize);
218220 else
219221 release_region(port[idx], iosize);
220− exit:
222+exit:
221223 return err;
222224 }
223225
drivers/net/can/slcan/slcan-core.c+1−1
@@ -594,7 +594,7 @@ static netdev_tx_t slcan_netdev_xmit(struct sk_buff *skb, · 593 unmodified lines
594594 {
595595 struct slcan *sl = netdev_priv(dev);
596596
597− if (can_dropped_invalid_skb(dev, skb))
597+ if (can_dev_dropped_skb(dev, skb))
598598 return NETDEV_TX_OK;
599599
600600 spin_lock(&sl->lock);
drivers/net/can/softing/softing_main.c+1−1
@@ -60,7 +60,7 @@ static netdev_tx_t softing_netdev_start_xmit(struct sk_buff *skb, · 59 unmodified lines
6060 struct can_frame *cf = (struct can_frame *)skb->data;
6161 uint8_t buf[DPRAM_TX_SIZE];
6262
63− if (can_dropped_invalid_skb(dev, skb))
63+ if (can_dev_dropped_skb(dev, skb))
6464 return NETDEV_TX_OK;
6565
6666 spin_lock(&card->spin);
drivers/net/can/spi/hi311x.c+1−1
@@ -373,7 +373,7 @@ static netdev_tx_t hi3110_hard_start_xmit(struct sk_buff *skb, · 372 unmodified lines
373373 return NETDEV_TX_BUSY;
374374 }
375375
376− if (can_dropped_invalid_skb(net, skb))
376+ if (can_dev_dropped_skb(net, skb))
377377 return NETDEV_TX_OK;
378378
379379 netif_stop_queue(net);
drivers/net/can/spi/mcp251x.c+1−1
@@ -789,7 +789,7 @@ static netdev_tx_t mcp251x_hard_start_xmit(struct sk_buff *skb, · 788 unmodified lines
789789 return NETDEV_TX_BUSY;
790790 }
791791
792− if (can_dropped_invalid_skb(net, skb))
792+ if (can_dev_dropped_skb(net, skb))
793793 return NETDEV_TX_OK;
794794
795795 netif_stop_queue(net);
drivers/net/can/spi/mcp251xfd/mcp251xfd-tx.c+1−1
@@ -172,7 +172,7 @@ netdev_tx_t mcp251xfd_start_xmit(struct sk_buff *skb, · 171 unmodified lines
172172 u8 tx_head;
173173 int err;
174174
175− if (can_dropped_invalid_skb(ndev, skb))
175+ if (can_dev_dropped_skb(ndev, skb))
176176 return NETDEV_TX_OK;
177177
178178 if (mcp251xfd_tx_busy(priv, tx_ring))
drivers/net/can/sun4i_can.c+1−1
@@ -429,7 +429,7 @@ static netdev_tx_t sun4ican_start_xmit(struct sk_buff *skb, struct net_device *d · 428 unmodified lines
429429 canid_t id;
430430 int i;
431431
432− if (can_dropped_invalid_skb(dev, skb))
432+ if (can_dev_dropped_skb(dev, skb))
433433 return NETDEV_TX_OK;
434434
435435 netif_stop_queue(dev);
drivers/net/can/ti_hecc.c+1−1
@@ -470,7 +470,7 @@ static netdev_tx_t ti_hecc_xmit(struct sk_buff *skb, struct net_device *ndev) · 469 unmodified lines
470470 u32 mbxno, mbx_mask, data;
471471 unsigned long flags;
472472
473− if (can_dropped_invalid_skb(ndev, skb))
473+ if (can_dev_dropped_skb(ndev, skb))
474474 return NETDEV_TX_OK;
475475
476476 mbxno = get_tx_head_mb(priv);
drivers/net/can/usb/ems_usb.c+1−1
@@ -747,7 +747,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne · 746 unmodified lines
747747 size_t size = CPC_HEADER_SIZE + CPC_MSG_HEADER_LEN
748748 + sizeof(struct cpc_can_msg);
749749
750− if (can_dropped_invalid_skb(netdev, skb))
750+ if (can_dev_dropped_skb(netdev, skb))
751751 return NETDEV_TX_OK;
752752
753753 /* create a URB, and a buffer for it, and copy the data to the URB */
drivers/net/can/usb/esd_usb.c+1−1
@@ -725,7 +725,7 @@ static netdev_tx_t esd_usb_start_xmit(struct sk_buff *skb, · 724 unmodified lines
725725 int ret = NETDEV_TX_OK;
726726 size_t size = sizeof(struct esd_usb_msg);
727727
728− if (can_dropped_invalid_skb(netdev, skb))
728+ if (can_dev_dropped_skb(netdev, skb))
729729 return NETDEV_TX_OK;
730730
731731 /* create a URB, and a buffer for it, and copy the data to the URB */
drivers/net/can/usb/etas_es58x/es58x_core.c+5−2
@@ -1913,7 +1913,7 @@ static netdev_tx_t es58x_start_xmit(struct sk_buff *skb, · 1912 unmodified lines
19131913 unsigned int frame_len;
19141914 int ret;
19151915
1916− if (can_dropped_invalid_skb(netdev, skb)) {
1916+ if (can_dev_dropped_skb(netdev, skb)) {
19171917 if (priv->tx_urb)
19181918 goto xmit_commit;
19191919 return NETDEV_TX_OK;
@@ -2091,8 +2091,11 @@ static int es58x_init_netdev(struct es58x_device *es58x_dev, int channel_idx) · 171 unmodified lines
20912091 netdev->dev_port = channel_idx;
20922092
20932093 ret = register_candev(netdev);
2094− if (ret)
2094+ if (ret) {
2095+ es58x_dev->netdev[channel_idx] = NULL;
2096+ free_candev(netdev);
20952097 return ret;
2098+ }
20962099
20972100 netdev_queue_set_dql_min_limit(netdev_get_tx_queue(netdev, 0),
20982101 es58x_dev->param->dql_min_limit);
drivers/net/can/usb/gs_usb.c+1−1
@@ -723,7 +723,7 @@ static netdev_tx_t gs_can_start_xmit(struct sk_buff *skb, · 722 unmodified lines
723723 unsigned int idx;
724724 struct gs_tx_context *txc;
725725
726− if (can_dropped_invalid_skb(netdev, skb))
726+ if (can_dev_dropped_skb(netdev, skb))
727727 return NETDEV_TX_OK;
728728
729729 /* find an empty context to keep track of transmission */
drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c+1−1
@@ -570,7 +570,7 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb, · 569 unmodified lines
570570 unsigned int i;
571571 unsigned long flags;
572572
573− if (can_dropped_invalid_skb(netdev, skb))
573+ if (can_dev_dropped_skb(netdev, skb))
574574 return NETDEV_TX_OK;
575575
576576 urb = usb_alloc_urb(0, GFP_ATOMIC);
drivers/net/can/usb/mcba_usb.c+8−4
@@ -47,6 +47,10 @@ · 46 unmodified lines
4747 #define MCBA_VER_REQ_USB 1
4848 #define MCBA_VER_REQ_CAN 2
4949
50+/* Drive the CAN_RES signal LOW "0" to activate R24 and R25 */
51+#define MCBA_VER_TERMINATION_ON 0
52+#define MCBA_VER_TERMINATION_OFF 1
53+
5054 #define MCBA_SIDL_EXID_MASK 0x8
5155 #define MCBA_DLC_MASK 0xf
5256 #define MCBA_DLC_RTR_MASK 0x40
@@ -311,7 +315,7 @@ static netdev_tx_t mcba_usb_start_xmit(struct sk_buff *skb, · 258 unmodified lines
311315 .cmd_id = MBCA_CMD_TRANSMIT_MESSAGE_EV
312316 };
313317
314− if (can_dropped_invalid_skb(netdev, skb))
318+ if (can_dev_dropped_skb(netdev, skb))
315319 return NETDEV_TX_OK;
316320
317321 ctx = mcba_usb_get_free_ctx(priv, cf);
@@ -463,7 +467,7 @@ static void mcba_usb_process_ka_usb(struct mcba_priv *priv, · 145 unmodified lines
463467 priv->usb_ka_first_pass = false;
464468 }
465469
466− if (msg->termination_state)
470+ if (msg->termination_state == MCBA_VER_TERMINATION_ON)
467471 priv->can.termination = MCBA_TERMINATION_ENABLED;
468472 else
469473 priv->can.termination = MCBA_TERMINATION_DISABLED;
@@ -785,9 +789,9 @@ static int mcba_set_termination(struct net_device *netdev, u16 term) · 315 unmodified lines
785789 };
786790
787791 if (term == MCBA_TERMINATION_ENABLED)
788− usb_msg.termination = 1;
792+ usb_msg.termination = MCBA_VER_TERMINATION_ON;
789793 else
790− usb_msg.termination = 0;
794+ usb_msg.termination = MCBA_VER_TERMINATION_OFF;
791795
792796 mcba_usb_xmit_cmd(priv, (struct mcba_usb_msg *)&usb_msg);
793797
drivers/net/can/usb/peak_usb/pcan_usb_core.c+1−1
@@ -351,7 +351,7 @@ static netdev_tx_t peak_usb_ndo_start_xmit(struct sk_buff *skb, · 350 unmodified lines
351351 int i, err;
352352 size_t size = dev->adapter->tx_buffer_size;
353353
354− if (can_dropped_invalid_skb(netdev, skb))
354+ if (can_dev_dropped_skb(netdev, skb))
355355 return NETDEV_TX_OK;
356356
357357 for (i = 0; i < PCAN_USB_MAX_TX_URBS; i++)
drivers/net/can/usb/ucan.c+1−1
@@ -1120,7 +1120,7 @@ static netdev_tx_t ucan_start_xmit(struct sk_buff *skb, · 1119 unmodified lines
11201120 struct can_frame *cf = (struct can_frame *)skb->data;
11211121
11221122 /* check skb */
1123− if (can_dropped_invalid_skb(netdev, skb))
1123+ if (can_dev_dropped_skb(netdev, skb))
11241124 return NETDEV_TX_OK;
11251125
11261126 /* allocate a context and slow down tx path, if fifo state is low */
drivers/net/can/usb/usb_8dev.c+1−1
@@ -602,7 +602,7 @@ static netdev_tx_t usb_8dev_start_xmit(struct sk_buff *skb, · 601 unmodified lines
602602 int i, err;
603603 size_t size = sizeof(struct usb_8dev_tx_msg);
604604
605− if (can_dropped_invalid_skb(netdev, skb))
605+ if (can_dev_dropped_skb(netdev, skb))
606606 return NETDEV_TX_OK;
607607
608608 /* create a URB, and a buffer for it, and copy the data to the URB */
drivers/net/can/xilinx_can.c+1−1
@@ -743,7 +743,7 @@ static netdev_tx_t xcan_start_xmit(struct sk_buff *skb, struct net_device *ndev) · 742 unmodified lines
743743 struct xcan_priv *priv = netdev_priv(ndev);
744744 int ret;
745745
746− if (can_dropped_invalid_skb(ndev, skb))
746+ if (can_dev_dropped_skb(ndev, skb))
747747 return NETDEV_TX_OK;
748748
749749 if (priv->devtype.flags & XCAN_FLAG_TX_MAILBOXES)
drivers/net/dsa/dsa_loop.c+18−7
@@ -376,6 +376,17 @@ static struct mdio_driver dsa_loop_drv = { · 375 unmodified lines
376376
377377 #define NUM_FIXED_PHYS (DSA_LOOP_NUM_PORTS - 2)
378378
379+static void dsa_loop_phydevs_unregister(void)
380+{
381+ unsigned int i;
382+
383+ for (i = 0; i < NUM_FIXED_PHYS; i++)
384+ if (!IS_ERR(phydevs[i])) {
385+ fixed_phy_unregister(phydevs[i]);
386+ phy_device_free(phydevs[i]);
387+ }
388+}
389+
379390 static int __init dsa_loop_init(void)
380391 {
381392 struct fixed_phy_status status = {
@@ -383,23 +394,23 @@ static int __init dsa_loop_init(void) · 1 unmodified line
383394 .speed = SPEED_100,
384395 .duplex = DUPLEX_FULL,
385396 };
386− unsigned int i;
397+ unsigned int i, ret;
387398
388399 for (i = 0; i < NUM_FIXED_PHYS; i++)
389400 phydevs[i] = fixed_phy_register(PHY_POLL, &status, NULL);
390401
391− return mdio_driver_register(&dsa_loop_drv);
402+ ret = mdio_driver_register(&dsa_loop_drv);
403+ if (ret)
404+ dsa_loop_phydevs_unregister();
405+
406+ return ret;
392407 }
393408 module_init(dsa_loop_init);
394409
395410 static void __exit dsa_loop_exit(void)
396411 {
397− unsigned int i;
398−
399412 mdio_driver_unregister(&dsa_loop_drv);
400− for (i = 0; i < NUM_FIXED_PHYS; i++)
401− if (!IS_ERR(phydevs[i]))
402− fixed_phy_unregister(phydevs[i]);
413+ dsa_loop_phydevs_unregister();
403414 }
404415 module_exit(dsa_loop_exit);
405416
drivers/net/dsa/lan9303-core.c+1−1
@@ -961,7 +961,7 @@ static const struct lan9303_mib_desc lan9303_mib[] = { · 960 unmodified lines
961961 { .offset = LAN9303_MAC_TX_BRDCST_CNT_0, .name = "TxBroad", },
962962 { .offset = LAN9303_MAC_TX_PAUSE_CNT_0, .name = "TxPause", },
963963 { .offset = LAN9303_MAC_TX_MULCST_CNT_0, .name = "TxMulti", },
964− { .offset = LAN9303_MAC_RX_UNDSZE_CNT_0, .name = "TxUnderRun", },
964+ { .offset = LAN9303_MAC_RX_UNDSZE_CNT_0, .name = "RxShort", },
965965 { .offset = LAN9303_MAC_TX_64_CNT_0, .name = "Tx64Byte", },
966966 { .offset = LAN9303_MAC_TX_127_CNT_0, .name = "Tx128Byte", },
967967 { .offset = LAN9303_MAC_TX_255_CNT_0, .name = "Tx256Byte", },
drivers/net/dsa/sja1105/sja1105_mdio.c+6−0
@@ -256,6 +256,9 @@ static int sja1105_base_tx_mdio_read(struct mii_bus *bus, int phy, int reg) · 255 unmodified lines
256256 u32 tmp;
257257 int rc;
258258
259+ if (reg & MII_ADDR_C45)
260+ return -EOPNOTSUPP;
261+
259262 rc = sja1105_xfer_u32(priv, SPI_READ, regs->mdio_100base_tx + reg,
260263 &tmp, NULL);
261264 if (rc < 0)
@@ -272,6 +275,9 @@ static int sja1105_base_tx_mdio_write(struct mii_bus *bus, int phy, int reg, · 10 unmodified lines
272275 const struct sja1105_regs *regs = priv->info->regs;
273276 u32 tmp = val;
274277
278+ if (reg & MII_ADDR_C45)
279+ return -EOPNOTSUPP;
280+
275281 return sja1105_xfer_u32(priv, SPI_WRITE, regs->mdio_100base_tx + reg,
276282 &tmp, NULL);
277283 }
drivers/net/ethernet/adi/adin1110.c+29−9
@@ -1512,16 +1512,15 @@ static struct notifier_block adin1110_switchdev_notifier = { · 1511 unmodified lines
15121512 .notifier_call = adin1110_switchdev_event,
15131513 };
15141514
1515−static void adin1110_unregister_notifiers(void *data)
1515+static void adin1110_unregister_notifiers(void)
15161516 {
15171517 unregister_switchdev_blocking_notifier(&adin1110_switchdev_blocking_notifier);
15181518 unregister_switchdev_notifier(&adin1110_switchdev_notifier);
15191519 unregister_netdevice_notifier(&adin1110_netdevice_nb);
15201520 }
15211521
1522−static int adin1110_setup_notifiers(struct adin1110_priv *priv)
1522+static int adin1110_setup_notifiers(void)
15231523 {
1524− struct device *dev = &priv->spidev->dev;
15251524 int ret;
15261525
15271526 ret = register_netdevice_notifier(&adin1110_netdevice_nb);
@@ -1536,13 +1535,14 @@ static int adin1110_setup_notifiers(struct adin1110_priv *priv) · 8 unmodified lines
15361535 if (ret < 0)
15371536 goto err_sdev;
15381537
1539− return devm_add_action_or_reset(dev, adin1110_unregister_notifiers, NULL);
1538+ return 0;
15401539
15411540 err_sdev:
15421541 unregister_switchdev_notifier(&adin1110_switchdev_notifier);
15431542
15441543 err_netdev:
15451544 unregister_netdevice_notifier(&adin1110_netdevice_nb);
1545+
15461546 return ret;
15471547 }
15481548
@@ -1613,10 +1613,6 @@ static int adin1110_probe_netdevs(struct adin1110_priv *priv) · 64 unmodified lines
16131613 if (ret < 0)
16141614 return ret;
16151615
1616− ret = adin1110_setup_notifiers(priv);
1617− if (ret < 0)
1618− return ret;
1619−
16201616 for (i = 0; i < priv->cfg->ports_nr; i++) {
16211617 ret = devm_register_netdev(dev, priv->ports[i]->netdev);
16221618 if (ret < 0) {
@@ -1693,7 +1689,31 @@ static struct spi_driver adin1110_driver = { · 70 unmodified lines
16931689 .probe = adin1110_probe,
16941690 .id_table = adin1110_spi_id,
16951691 };
1696−module_spi_driver(adin1110_driver);
1692+
1693+static int __init adin1110_driver_init(void)
1694+{
1695+ int ret;
1696+
1697+ ret = adin1110_setup_notifiers();
1698+ if (ret < 0)
1699+ return ret;
1700+
1701+ ret = spi_register_driver(&adin1110_driver);
1702+ if (ret < 0) {
1703+ adin1110_unregister_notifiers();
1704+ return ret;
1705+ }
1706+
1707+ return 0;
1708+}
1709+
1710+static void __exit adin1110_exit(void)
1711+{
1712+ adin1110_unregister_notifiers();
1713+ spi_unregister_driver(&adin1110_driver);
1714+}
1715+module_init(adin1110_driver_init);
1716+module_exit(adin1110_exit);
16971717
16981718 MODULE_DESCRIPTION("ADIN1110 Network driver");
16991719 MODULE_AUTHOR("Alexandru Tachici <alexandru.tachici@analog.com>");
drivers/net/ethernet/altera/altera_tse_main.c+1−0
@@ -990,6 +990,7 @@ static int tse_shutdown(struct net_device *dev) · 989 unmodified lines
990990 int ret;
991991
992992 phylink_stop(priv->phylink);
993+ phylink_disconnect_phy(priv->phylink);
993994 netif_stop_queue(dev);
994995 napi_disable(&priv->napi);
995996
drivers/net/ethernet/amazon/ena/ena_netdev.c+7−1
@@ -4543,13 +4543,19 @@ static struct pci_driver ena_pci_driver = { · 4542 unmodified lines
45434543
45444544 static int __init ena_init(void)
45454545 {
4546+ int ret;
4547+
45464548 ena_wq = create_singlethread_workqueue(DRV_MODULE_NAME);
45474549 if (!ena_wq) {
45484550 pr_err("Failed to create workqueue\n");
45494551 return -ENOMEM;
45504552 }
45514553
4552− return pci_register_driver(&ena_pci_driver);
4554+ ret = pci_register_driver(&ena_pci_driver);
4555+ if (ret)
4556+ destroy_workqueue(ena_wq);
4557+
4558+ return ret;
45534559 }
45544560
45554561 static void __exit ena_cleanup(void)
drivers/net/ethernet/apm/xgene/xgene_enet_main.c+3−1
@@ -1004,8 +1004,10 @@ static int xgene_enet_open(struct net_device *ndev) · 1003 unmodified lines
10041004
10051005 xgene_enet_napi_enable(pdata);
10061006 ret = xgene_enet_register_irq(ndev);
1007− if (ret)
1007+ if (ret) {
1008+ xgene_enet_napi_disable(pdata);
10081009 return ret;
1010+ }
10091011
10101012 if (ndev->phydev) {
10111013 phy_start(ndev->phydev);
drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c+3−2
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include "aq_ptp.h"
1414 #include "aq_filters.h"
1515 #include "aq_macsec.h"
16+#include "aq_main.h"
1617
1718 #include <linux/ptp_clock_kernel.h>
1819
@@ -858,7 +859,7 @@ static int aq_set_ringparam(struct net_device *ndev, · 839 unmodified lines
858859
859860 if (netif_running(ndev)) {
860861 ndev_running = true;
861− dev_close(ndev);
862+ aq_ndev_close(ndev);
862863 }
863864
864865 cfg->rxds = max(ring->rx_pending, hw_caps->rxds_min);
@@ -874,7 +875,7 @@ static int aq_set_ringparam(struct net_device *ndev, · 9 unmodified lines
874875 goto err_exit;
875876
876877 if (ndev_running)
877− err = dev_open(ndev, NULL);
878+ err = aq_ndev_open(ndev);
878879
879880 err_exit:
880881 return err;
drivers/net/ethernet/aquantia/atlantic/aq_macsec.c+2−0
@@ -570,6 +570,7 @@ static int aq_update_txsa(struct aq_nic_s *nic, const unsigned int sc_idx, · 569 unmodified lines
570570
571571 ret = aq_mss_set_egress_sakey_record(hw, &key_rec, sa_idx);
572572
573+ memzero_explicit(&key_rec, sizeof(key_rec));
573574 return ret;
574575 }
575576
@@ -899,6 +900,7 @@ static int aq_update_rxsa(struct aq_nic_s *nic, const unsigned int sc_idx, · 323 unmodified lines
899900
900901 ret = aq_mss_set_ingress_sakey_record(hw, &sa_key_record, sa_idx);
901902
903+ memzero_explicit(&sa_key_record, sizeof(sa_key_record));
902904 return ret;
903905 }
904906
drivers/net/ethernet/aquantia/atlantic/aq_main.c+2−2
@@ -58,7 +58,7 @@ struct net_device *aq_ndev_alloc(void) · 57 unmodified lines
5858 return ndev;
5959 }
6060
61−static int aq_ndev_open(struct net_device *ndev)
61+int aq_ndev_open(struct net_device *ndev)
6262 {
6363 struct aq_nic_s *aq_nic = netdev_priv(ndev);
6464 int err = 0;
@@ -88,7 +88,7 @@ err_exit: · 23 unmodified lines
8888 return err;
8989 }
9090
91−static int aq_ndev_close(struct net_device *ndev)
91+int aq_ndev_close(struct net_device *ndev)
9292 {
9393 struct aq_nic_s *aq_nic = netdev_priv(ndev);
9494 int err = 0;
drivers/net/ethernet/aquantia/atlantic/aq_main.h+2−0
@@ -16,5 +16,7 @@ DECLARE_STATIC_KEY_FALSE(aq_xdp_locking_key); · 15 unmodified lines
1616
1717 void aq_ndev_schedule_work(struct work_struct *work);
1818 struct net_device *aq_ndev_alloc(void);
19+int aq_ndev_open(struct net_device *ndev);
20+int aq_ndev_close(struct net_device *ndev);
1921
2022 #endif /* AQ_MAIN_H */
drivers/net/ethernet/aquantia/atlantic/macsec/macsec_api.c+11−7
@@ -757,6 +757,7 @@ set_ingress_sakey_record(struct aq_hw_s *hw, · 756 unmodified lines
757757 u16 table_index)
758758 {
759759 u16 packed_record[18];
760+ int ret;
760761
761762 if (table_index >= NUMROWS_INGRESSSAKEYRECORD)
762763 return -EINVAL;
@@ -789,9 +790,12 @@ set_ingress_sakey_record(struct aq_hw_s *hw, · 26 unmodified lines
789790
790791 packed_record[16] = rec->key_len & 0x3;
791792
792− return set_raw_ingress_record(hw, packed_record, 18, 2,
793− ROWOFFSET_INGRESSSAKEYRECORD +
794− table_index);
793+ ret = set_raw_ingress_record(hw, packed_record, 18, 2,
794+ ROWOFFSET_INGRESSSAKEYRECORD +
795+ table_index);
796+
797+ memzero_explicit(packed_record, sizeof(packed_record));
798+ return ret;
795799 }
796800
797801 int aq_mss_set_ingress_sakey_record(struct aq_hw_s *hw,
@@ -1739,14 +1743,14 @@ static int set_egress_sakey_record(struct aq_hw_s *hw, · 941 unmodified lines
17391743 ret = set_raw_egress_record(hw, packed_record, 8, 2,
17401744 ROWOFFSET_EGRESSSAKEYRECORD + table_index);
17411745 if (unlikely(ret))
1742− return ret;
1746+ goto clear_key;
17431747 ret = set_raw_egress_record(hw, packed_record + 8, 8, 2,
17441748 ROWOFFSET_EGRESSSAKEYRECORD + table_index -
17451749 32);
1746− if (unlikely(ret))
1747− return ret;
17481750
1749− return 0;
1751+clear_key:
1752+ memzero_explicit(packed_record, sizeof(packed_record));
1753+ return ret;
17501754 }
17511755
17521756 int aq_mss_set_egress_sakey_record(struct aq_hw_s *hw,
drivers/net/ethernet/atheros/ag71xx.c+2−1
@@ -1427,7 +1427,7 @@ static int ag71xx_open(struct net_device *ndev) · 1426 unmodified lines
14271427 if (ret) {
14281428 netif_err(ag, link, ndev, "phylink_of_phy_connect filed with err: %i\n",
14291429 ret);
1430− goto err;
1430+ return ret;
14311431 }
14321432
14331433 max_frame_len = ag71xx_max_frame_len(ndev->mtu);
@@ -1448,6 +1448,7 @@ static int ag71xx_open(struct net_device *ndev) · 14 unmodified lines
14481448
14491449 err:
14501450 ag71xx_rings_cleanup(ag);
1451+ phylink_disconnect_phy(ag->phylink);
14511452 return ret;
14521453 }
14531454
drivers/net/ethernet/broadcom/Kconfig+1−1
@@ -77,7 +77,7 @@ config BCMGENET · 76 unmodified lines
7777 select BCM7XXX_PHY
7878 select MDIO_BCM_UNIMAC
7979 select DIMLIB
80− select BROADCOM_PHY if ARCH_BCM2835
80+ select BROADCOM_PHY if (ARCH_BCM2835 && PTP_1588_CLOCK_OPTIONAL)
8181 help
8282 This driver supports the built-in Ethernet MACs found in the
8383 Broadcom BCM7xxx Set Top Box family chipset.
drivers/net/ethernet/broadcom/bgmac.c+0−1
@@ -1568,7 +1568,6 @@ void bgmac_enet_remove(struct bgmac *bgmac) · 1567 unmodified lines
15681568 phy_disconnect(bgmac->net_dev->phydev);
15691569 netif_napi_del(&bgmac->napi);
15701570 bgmac_dma_free(bgmac);
1571− free_netdev(bgmac->net_dev);
15721571 }
15731572 EXPORT_SYMBOL_GPL(bgmac_enet_remove);
15741573
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c+8−4
@@ -795,16 +795,20 @@ static void bnx2x_vf_enable_traffic(struct bnx2x *bp, struct bnx2x_virtf *vf) · 794 unmodified lines
795795
796796 static u8 bnx2x_vf_is_pcie_pending(struct bnx2x *bp, u8 abs_vfid)
797797 {
798− struct pci_dev *dev;
799798 struct bnx2x_virtf *vf = bnx2x_vf_by_abs_fid(bp, abs_vfid);
799+ struct pci_dev *dev;
800+ bool pending;
800801
801802 if (!vf)
802803 return false;
803804
804805 dev = pci_get_domain_bus_and_slot(vf->domain, vf->bus, vf->devfn);
805− if (dev)
806− return bnx2x_is_pcie_pending(dev);
807− return false;
806+ if (!dev)
807+ return false;
808+ pending = bnx2x_is_pcie_pending(dev);
809+ pci_dev_put(dev);
810+
811+ return pending;
808812 }
809813
810814 int bnx2x_vf_flr_clnup_epilog(struct bnx2x *bp, u8 abs_vfid)
drivers/net/ethernet/broadcom/bnxt/bnxt.c+54−10
@@ -9983,17 +9983,12 @@ static int bnxt_try_recover_fw(struct bnxt *bp) · 9982 unmodified lines
99839983 return -ENODEV;
99849984 }
99859985
9986−int bnxt_cancel_reservations(struct bnxt *bp, bool fw_reset)
9986+static void bnxt_clear_reservations(struct bnxt *bp, bool fw_reset)
99879987 {
99889988 struct bnxt_hw_resc *hw_resc = &bp->hw_resc;
9989− int rc;
99909989
99919990 if (!BNXT_NEW_RM(bp))
9992− return 0; /* no resource reservations required */
9993−
9994− rc = bnxt_hwrm_func_resc_qcaps(bp, true);
9995− if (rc)
9996− netdev_err(bp->dev, "resc_qcaps failed\n");
9991+ return; /* no resource reservations required */
99979992
99989993 hw_resc->resv_cp_rings = 0;
99999994 hw_resc->resv_stat_ctxs = 0;
@@ -10006,6 +10001,20 @@ int bnxt_cancel_reservations(struct bnxt *bp, bool fw_reset) · 6 unmodified lines
1000610001 bp->tx_nr_rings = 0;
1000710002 bp->rx_nr_rings = 0;
1000810003 }
10004+}
10005+
10006+int bnxt_cancel_reservations(struct bnxt *bp, bool fw_reset)
10007+{
10008+ int rc;
10009+
10010+ if (!BNXT_NEW_RM(bp))
10011+ return 0; /* no resource reservations required */
10012+
10013+ rc = bnxt_hwrm_func_resc_qcaps(bp, true);
10014+ if (rc)
10015+ netdev_err(bp->dev, "resc_qcaps failed\n");
10016+
10017+ bnxt_clear_reservations(bp, fw_reset);
1000910018
1001010019 return rc;
1001110020 }
@@ -12894,8 +12903,8 @@ static int bnxt_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb, · 2882 unmodified lines
1289412903 rcu_read_lock();
1289512904 hlist_for_each_entry_rcu(fltr, head, hash) {
1289612905 if (bnxt_fltr_match(fltr, new_fltr)) {
12906+ rc = fltr->sw_id;
1289712907 rcu_read_unlock();
12898− rc = 0;
1289912908 goto err_free;
1290012909 }
1290112910 }
@@ -13913,7 +13922,9 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev) · 1011 unmodified lines
1391313922 pci_ers_result_t result = PCI_ERS_RESULT_DISCONNECT;
1391413923 struct net_device *netdev = pci_get_drvdata(pdev);
1391513924 struct bnxt *bp = netdev_priv(netdev);
13916− int err = 0, off;
13925+ int retry = 0;
13926+ int err = 0;
13927+ int off;
1391713928
1391813929 netdev_info(bp->dev, "PCI Slot Reset\n");
1391913930
@@ -13941,11 +13952,36 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev) · 21 unmodified lines
1394113952 pci_restore_state(pdev);
1394213953 pci_save_state(pdev);
1394313954
13955+ bnxt_inv_fw_health_reg(bp);
13956+ bnxt_try_map_fw_health_reg(bp);
13957+
13958+ /* In some PCIe AER scenarios, firmware may take up to
13959+ * 10 seconds to become ready in the worst case.
13960+ */
13961+ do {
13962+ err = bnxt_try_recover_fw(bp);
13963+ if (!err)
13964+ break;
13965+ retry++;
13966+ } while (retry < BNXT_FW_SLOT_RESET_RETRY);
13967+
13968+ if (err) {
13969+ dev_err(&pdev->dev, "Firmware not ready\n");
13970+ goto reset_exit;
13971+ }
13972+
1394413973 err = bnxt_hwrm_func_reset(bp);
1394513974 if (!err)
1394613975 result = PCI_ERS_RESULT_RECOVERED;
13976+
13977+ bnxt_ulp_irq_stop(bp);
13978+ bnxt_clear_int_mode(bp);
13979+ err = bnxt_init_int_mode(bp);
13980+ bnxt_ulp_irq_restart(bp, err);
1394713981 }
1394813982
13983+reset_exit:
13984+ bnxt_clear_reservations(bp, true);
1394913985 rtnl_unlock();
1395013986
1395113987 return result;
@@ -14001,8 +14037,16 @@ static struct pci_driver bnxt_pci_driver = { · 49 unmodified lines
1400114037
1400214038 static int __init bnxt_init(void)
1400314039 {
14040+ int err;
14041+
1400414042 bnxt_debug_init();
14005− return pci_register_driver(&bnxt_pci_driver);
14043+ err = pci_register_driver(&bnxt_pci_driver);
14044+ if (err) {
14045+ bnxt_debug_exit();
14046+ return err;
14047+ }
14048+
14049+ return 0;
1400614050 }
1400714051

1 more lines aren’t shown here.

drivers/net/ethernet/broadcom/bnxt/bnxt.h+1−0

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

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c+1−1

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

drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c+2−1

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

drivers/net/ethernet/cavium/liquidio/lio_main.c+26−8

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

drivers/net/ethernet/cavium/thunder/thunder_bgx.c+3−1

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

drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c+1−0

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

drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c+1−1

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

drivers/net/ethernet/davicom/dm9051.c+3−1

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

drivers/net/ethernet/engleder/tsnep_main.c+56−1

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

drivers/net/ethernet/freescale/enetc/enetc.c+5−3

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

drivers/net/ethernet/freescale/enetc/enetc.h+1−0

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

drivers/net/ethernet/freescale/enetc/enetc_qos.c+13−8

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

drivers/net/ethernet/freescale/fec_main.c+8−18

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

drivers/net/ethernet/freescale/fman/mac.c+9−0

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

drivers/net/ethernet/hisilicon/hns3/hnae3.h+0−1

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

drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_rss.c+0−20

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

drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_rss.h+0−2

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

drivers/net/ethernet/hisilicon/hns3/hns3_enet.c+95−72

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

drivers/net/ethernet/hisilicon/hns3/hns3_enet.h+1−0

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

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c+12−7

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

drivers/net/ethernet/huawei/hinic/hinic_main.c+8−1

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

drivers/net/ethernet/ibm/ibmveth.c+2−1

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

drivers/net/ethernet/ibm/ibmveth.h+1−0

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

drivers/net/ethernet/ibm/ibmvnic.c+8−8

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

drivers/net/ethernet/intel/e100.c+1−4

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

drivers/net/ethernet/intel/fm10k/fm10k_main.c+9−1

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

drivers/net/ethernet/intel/i40e/i40e_main.c+10−1

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

drivers/net/ethernet/intel/iavf/iavf.h+0−1

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

drivers/net/ethernet/intel/iavf/iavf_main.c+31−19

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

drivers/net/ethernet/intel/iavf/iavf_virtchnl.c+2−0

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

drivers/net/ethernet/intel/ice/ice_base.c+1−1

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

drivers/net/ethernet/intel/ice/ice_lib.c+25−0

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

drivers/net/ethernet/intel/ice/ice_lib.h+1−0

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

drivers/net/ethernet/intel/ice/ice_main.c+6−6

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

drivers/net/ethernet/intel/ice/ice_ptp.c+10−10

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

drivers/net/ethernet/intel/ice/ice_vf_lib.c+4−1

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

drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c+9−1

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

drivers/net/ethernet/marvell/mv643xx_eth.c+1−0

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

drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c+6−2

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

drivers/net/ethernet/marvell/octeon_ep/octep_main.c+11−5

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

drivers/net/ethernet/marvell/octeontx2/Kconfig+1−0

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

drivers/net/ethernet/marvell/octeontx2/af/mcs.c+1−1

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

drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c+3−0

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

drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c+2−0

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

drivers/net/ethernet/marvell/octeontx2/af/rvu_sdp.c+5−2

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

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c+1−0

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

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h+1−1

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

drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c+105−30

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

drivers/net/ethernet/marvell/octeontx2/nic/otx2_struct.h+57−0

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

drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c+19−13

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

drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.h+1−0

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

drivers/net/ethernet/marvell/prestera/prestera_main.c+1−0

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

drivers/net/ethernet/marvell/prestera/prestera_router.c+1−1

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

drivers/net/ethernet/marvell/prestera/prestera_router_hw.c+2−2

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

drivers/net/ethernet/marvell/prestera/prestera_rxtx.c+6−1

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

drivers/net/ethernet/mediatek/mtk_eth_soc.c+11−6

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

drivers/net/ethernet/mediatek/mtk_ppe.c+17−2

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

drivers/net/ethernet/mediatek/mtk_ppe.h+1−0

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

drivers/net/ethernet/mediatek/mtk_star_emac.c+2−0

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

drivers/net/ethernet/mellanox/mlx4/qp.c+2−1

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

drivers/net/ethernet/mellanox/mlx5/core/cmd.c+35−27

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

drivers/net/ethernet/mellanox/mlx5/core/diag/cmd_tracepoint.h+45−0

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

drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c+1−1

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

drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c+31−0

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.c+32−60

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c+8−8

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.h+1−2

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

drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h+23−1

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

drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c+2−2

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

drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c+2−2

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

drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c+70−71

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

drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.h+4−2

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

drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c+11−6

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

drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c+0−18

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

drivers/net/ethernet/mellanox/mlx5/core/en_main.c+10−2

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

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c+14−13

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

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+12−19

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

drivers/net/ethernet/mellanox/mlx5/core/en_tx.c+5−0

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

drivers/net/ethernet/mellanox/mlx5/core/eswitch.c+11−6

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

drivers/net/ethernet/mellanox/mlx5/core/eswitch.h+8−0

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

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c+11−16

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

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c+10−6

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

drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c+9−3

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

drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c+7−5

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

drivers/net/ethernet/mellanox/mlx5/core/lag/lag.h+13−1

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

drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c+64−36

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

drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.h+0−1

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

drivers/net/ethernet/mellanox/mlx5/core/main.c+6−3

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

drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c+88−0

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

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c+4−1

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c+2−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c+3−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c+18−8

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

drivers/net/ethernet/microchip/lan966x/lan966x_main.c+2−2

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

drivers/net/ethernet/microchip/lan966x/lan966x_main.h+2−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_regs.h+15−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_vlan.c+6−0

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

drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c+3−0

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

drivers/net/ethernet/microchip/sparx5/sparx5_main.c+3−0

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

drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c+12−2

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

drivers/net/ethernet/microchip/sparx5/sparx5_tc.c+2−5

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

drivers/net/ethernet/neterion/s2io.c+20−9

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

drivers/net/ethernet/netronome/nfp/nfp_devlink.c+1−1

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

drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c+6−3

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

drivers/net/ethernet/ni/nixge.c+16−14

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

drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c+5−1

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

drivers/net/ethernet/pensando/ionic/ionic_main.c+7−1

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

drivers/net/ethernet/qlogic/qed/qed_mcp.c+12−12

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

drivers/net/ethernet/qlogic/qla3xxx.c+1−0

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c+2−2

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

drivers/net/ethernet/renesas/ravb_main.c+1−0

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

drivers/net/ethernet/sfc/ef100_netdev.c+1−0

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

drivers/net/ethernet/sfc/efx.c+6−2

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

drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c+9−2

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

drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c+33−13

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

drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c+3−5

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

drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c+2−0

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

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+13−2

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

drivers/net/ethernet/sunplus/spl2sw_driver.c+0−1

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

drivers/net/ethernet/ti/am65-cpsw-nuss.c+2−2

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

drivers/net/ethernet/ti/cpsw.c+2−0

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

drivers/net/ethernet/tundra/tsi108_eth.c+4−1

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

drivers/net/ethernet/xilinx/xilinx_emaclite.c+1−1

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

drivers/net/hamradio/bpqether.c+1−1

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

drivers/net/ipvlan/ipvlan.h+1−0

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

drivers/net/ipvlan/ipvlan_main.c+2−0

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

drivers/net/loopback.c+1−1

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

drivers/net/macsec.c+17−34

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

drivers/net/macvlan.c+5−3

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

drivers/net/mctp/mctp-i2c.c+32−15

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

drivers/net/mdio/fwnode_mdio.c+1−1

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

drivers/net/mhi_net.c+2−0

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

drivers/net/netdevsim/dev.c+1−0

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

drivers/net/ntb_netdev.c+8−1

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

drivers/net/phy/at803x.c+3−1

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

drivers/net/phy/dp83867.c+7−0

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

drivers/net/phy/marvell.c+9−7

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

drivers/net/phy/mdio_bus.c+1−1

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

drivers/net/phy/mscc/mscc_macsec.c+1−0

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

drivers/net/phy/phy_device.c+2−0

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

drivers/net/phy/phylink.c+16−6

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

drivers/net/thunderbolt.c+14−5

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

drivers/net/tun.c+18−7

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

drivers/net/usb/cdc_ncm.c+1−0

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

drivers/net/usb/qmi_wwan.c+2−0

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

drivers/net/usb/smsc95xx.c+42−4

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

drivers/net/virtio_net.c+1−2

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

drivers/net/wan/lapbether.c+2−1

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

drivers/net/wireless/ath/ath11k/qmi.h+1−1

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

drivers/net/wireless/ath/ath11k/reg.c+1−5

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c+4−0

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

drivers/net/wireless/cisco/airo.c+14−4

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

drivers/net/wireless/mac80211_hwsim.c+5−0

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

drivers/net/wireless/microchip/wilc1000/cfg80211.c+30−9

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

drivers/net/wireless/microchip/wilc1000/hif.c+16−5

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

drivers/net/wireless/ralink/rt2x00/rt2400pci.c+4−4

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

drivers/net/wireless/ralink/rt2x00/rt2400pci.h+1−1

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

drivers/net/wireless/ralink/rt2x00/rt2500pci.c+4−4

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

drivers/net/wireless/ralink/rt2x00/rt2500pci.h+1−1

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

drivers/net/wireless/ralink/rt2x00/rt2500usb.c+4−4

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

drivers/net/wireless/ralink/rt2x00/rt2500usb.h+1−1

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

drivers/net/wireless/ralink/rt2x00/rt2800lib.c+30−30

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

drivers/net/wireless/ralink/rt2x00/rt2800lib.h+4−4

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

drivers/net/wireless/ralink/rt2x00/rt2x00usb.c+3−3

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

drivers/net/wireless/ralink/rt2x00/rt61pci.c+2−2

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

drivers/net/wireless/ralink/rt2x00/rt61pci.h+1−1

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

drivers/net/wireless/ralink/rt2x00/rt73usb.c+2−2

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

drivers/net/wireless/ralink/rt2x00/rt73usb.h+1−1

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

drivers/net/wwan/Kconfig+1−1

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

drivers/net/wwan/iosm/iosm_ipc_coredump.c+1−0

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

drivers/net/wwan/iosm/iosm_ipc_devlink.c+1−0

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

drivers/net/wwan/iosm/iosm_ipc_imem_ops.c+8−0

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

drivers/net/wwan/iosm/iosm_ipc_mux.h+1−0

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

drivers/net/wwan/iosm/iosm_ipc_mux_codec.c+14−12

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

drivers/net/wwan/iosm/iosm_ipc_pcie.c+15−3

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

drivers/net/wwan/iosm/iosm_ipc_protocol.h+1−1

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

drivers/net/wwan/iosm/iosm_ipc_wwan.c+7−36

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

drivers/net/wwan/mhi_wwan_mbim.c+1−0

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

drivers/net/wwan/t7xx/t7xx_modem_ops.c+2−0

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

drivers/nfc/fdp/fdp.c+9−1

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

drivers/nfc/nfcmrvl/i2c.c+9−2

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

drivers/nfc/nxp-nci/core.c+11−4

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

drivers/nfc/s3fwrn5/core.c+7−2

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

drivers/nfc/st-nci/se.c+36−13

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

drivers/nvme/host/core.c+2−3

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

drivers/nvme/host/multipath.c+3−0

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

drivers/nvme/host/pci.c+6−2

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

drivers/nvme/target/auth.c+2−0

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

drivers/nvme/target/configfs.c+6−2

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

drivers/nvmem/lan9662-otpc.c+2−2

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

drivers/nvmem/rmem.c+2−2

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

drivers/nvmem/u-boot-env.c+1−1

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

drivers/of/property.c+3−1

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

drivers/parisc/iosapic.c+1−0

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

drivers/parisc/pdc_stable.c+17−17

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

drivers/parport/parport_pc.c+1−1

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

drivers/pci/controller/pci-hyperv.c+90−20

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

drivers/phy/qualcomm/phy-qcom-qmp-combo.c+1−1

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

drivers/phy/ralink/phy-mt7621-pci.c+2−1

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

drivers/phy/st/phy-stm32-usbphyc.c+2−0

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

drivers/phy/sunplus/phy-sunplus-usb2.c+2−2

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

drivers/phy/tegra/xusb.c+16−4

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

drivers/pinctrl/devicetree.c+2−0

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

drivers/pinctrl/intel/pinctrl-intel.c+26−1

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

drivers/pinctrl/mediatek/mtk-eint.c+35−8

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

drivers/pinctrl/mediatek/mtk-eint.h+6−0

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

drivers/pinctrl/mediatek/pinctrl-mt2701.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mt2712.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mt6765.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mt6779.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mt6795.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mt7622.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mt7623.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mt7629.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mt7986.c+2−0

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

drivers/pinctrl/mediatek/pinctrl-mt8127.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mt8135.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mt8167.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mt8173.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mt8183.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mt8186.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mt8188.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mt8192.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mt8195.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mt8365.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mt8516.c+1−0

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

drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c+3−0

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

drivers/pinctrl/pinctrl-rockchip.c+40−0

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

drivers/pinctrl/pinctrl-single.c+1−1

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

drivers/pinctrl/qcom/pinctrl-sc8280xp.c+2−2

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

drivers/platform/surface/aggregator/ssh_packet_layer.c+20−4

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

drivers/platform/surface/surface_aggregator_registry.c+37−0

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

drivers/platform/x86/acer-wmi.c+9−0

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

drivers/platform/x86/amd/pmc.c+1−2

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

drivers/platform/x86/asus-wmi.c+2−0

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

drivers/platform/x86/hp-wmi.c+13−2

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

drivers/platform/x86/ideapad-laptop.c+59−3

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

drivers/platform/x86/intel/hid.c+3−0

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

drivers/platform/x86/intel/pmc/pltdrv.c+9−0

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

drivers/platform/x86/intel/pmt/class.c+30−1

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

drivers/platform/x86/p2sb.c+6−9

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

drivers/platform/x86/thinkpad_acpi.c+8−0

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

drivers/platform/x86/touchscreen_dmi.c+25−0

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

drivers/power/supply/ab8500_btemp.c+8−1

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

drivers/power/supply/ip5xxx_power.c+1−1

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

drivers/power/supply/rk817_charger.c+6−8

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

drivers/regulator/core.c+6−2

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

drivers/regulator/rt5759-regulator.c+1−0

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

drivers/regulator/slg51000-regulator.c+2−0

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

drivers/regulator/twl6030-regulator.c+13−4

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

drivers/s390/block/dasd_devmap.c+1−1

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

drivers/s390/block/dasd_eckd.c+21−22

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

drivers/s390/block/dasd_ioctl.c+1−1

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

drivers/s390/block/dcssblk.c+1−0

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

drivers/s390/crypto/ap_bus.c+4−1

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

drivers/s390/crypto/zcrypt_msgtype6.c+15−6

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

drivers/s390/scsi/zfcp_fsf.c+1−1

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

drivers/scsi/ibmvscsi/ibmvfc.c+11−3

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

drivers/scsi/mpi3mr/mpi3mr_os.c+2−1

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

drivers/scsi/scsi_debug.c+12−1

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

drivers/scsi/scsi_transport_iscsi.c+16−15

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

drivers/scsi/scsi_transport_sas.c+9−4

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

drivers/scsi/storvsc_drv.c+34−35

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

drivers/siox/siox-core.c+2−0

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

drivers/slimbus/Kconfig+1−1

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

drivers/slimbus/stream.c+4−4

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

drivers/soc/imx/imx93-pd.c+15−2

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

drivers/soc/imx/soc-imx8m.c+11−0

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

drivers/soundwire/intel.c+1−0

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

drivers/soundwire/qcom.c+9−0

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

drivers/spi/spi-amd.c+1−1

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

drivers/spi/spi-dw-dma.c+3−0

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

drivers/spi/spi-imx.c+8−5

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

drivers/spi/spi-intel.c+4−4

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

drivers/spi/spi-meson-spicc.c+22−2

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

drivers/spi/spi-mt65xx.c+20−11

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

drivers/spi/spi-stm32.c+2−1

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

drivers/spi/spi-tegra210-quad.c+8−1

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

drivers/staging/rtl8192e/rtllib_softmac_wx.c+1−8

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

drivers/target/loopback/tcm_loop.c+2−1

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

drivers/tee/optee/device.c+1−1

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

drivers/tty/n_gsm.c+38−33

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

drivers/tty/serial/8250/8250_lpss.c+13−4

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

drivers/tty/serial/8250/8250_omap.c+30−22

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

drivers/tty/serial/8250/8250_parisc.crenamed from drivers/tty/serial/8250/8250_gsc.c+0−0

File renamed without changes.

drivers/tty/serial/8250/8250_port.c+5−2

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

drivers/tty/serial/8250/Kconfig+2−2

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

drivers/tty/serial/8250/Makefile+1−1

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

drivers/tty/serial/fsl_lpuart.c+49−27

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

drivers/tty/serial/imx.c+1−0

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

drivers/usb/cdns3/cdnsp-gadget.c+4−8

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

drivers/usb/cdns3/cdnsp-ring.c+12−5

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

drivers/usb/cdns3/host.c+28−28

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

drivers/usb/chipidea/otg_fsm.c+2−0

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

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

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

drivers/usb/dwc3/core.c+10−0

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

drivers/usb/dwc3/dwc3-exynos.c+1−10

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

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

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

drivers/usb/dwc3/host.c+0−10

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

drivers/usb/gadget/function/uvc_v4l2.c+21−51

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

drivers/usb/host/bcma-hcd.c+6−4

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

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

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

drivers/usb/typec/mux/intel_pmc_mux.c+13−2

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

drivers/usb/typec/tipd/core.c+3−3

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

drivers/vfio/pci/vfio_pci_core.c+5−5

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

drivers/vfio/vfio_main.c+21−5

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

drivers/video/fbdev/core/fbcon.c+1−1

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

drivers/virt/coco/sev-guest/sev-guest.c+70−14

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

drivers/watchdog/exar_wdt.c+3−1

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

drivers/watchdog/sp805_wdt.c+1−1

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

drivers/xen/pcpu.c+1−1

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

drivers/xen/platform-pci.c+7−3

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

drivers/xen/xen-pciback/conf_space_capability.c+6−3

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

fs/afs/fs_probe.c+2−2

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

fs/afs/server.c+1−1

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

fs/btrfs/backref.c+34−20

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

fs/btrfs/compression.c+8−6

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

fs/btrfs/ctree.c+46−6

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

fs/btrfs/ctree.h+11−5

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

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

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

fs/btrfs/disk-io.h+2−0

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

fs/btrfs/export.c+1−1

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

fs/btrfs/export.h+1−1

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

fs/btrfs/extent-tree.c+13−12

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

fs/btrfs/file.c+22−7

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

fs/btrfs/inode.c+12−4

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

fs/btrfs/ioctl.c+13−10

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

fs/btrfs/qgroup.c+1−8

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

fs/btrfs/raid56.c+11−7

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

fs/btrfs/scrub.c+1−8

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

fs/btrfs/send.c+36−12

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

fs/btrfs/super.c+16−0

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

fs/btrfs/sysfs.c+5−2

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

fs/btrfs/tests/btrfs-tests.c+1−1

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

fs/btrfs/tests/qgroup-tests.c+19−17

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

fs/btrfs/tree-log.c+55−4

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

fs/btrfs/volumes.c+40−11

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

fs/btrfs/volumes.h+2−2

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

fs/btrfs/zoned.c+45−4

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

fs/btrfs/zoned.h+11−0

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

fs/ceph/caps.c+12−36

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

fs/ceph/inode.c+1−1

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

fs/ceph/snap.c+2−1

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

fs/cifs/cifsfs.c+28−2

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

fs/cifs/connect.c+11−3

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

fs/cifs/inode.c+0−5

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

fs/cifs/ioctl.c+2−2

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

fs/cifs/misc.c+5−1

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

fs/cifs/sess.c+2−2

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

fs/cifs/smb2misc.c+45−36

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

fs/cifs/smb2ops.c+22−12

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

fs/cifs/smb2transport.c+12−7

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

fs/erofs/fscache.c+21−14

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

fs/erofs/internal.h+4−2

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

fs/erofs/super.c+22−17

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

fs/erofs/sysfs.c+4−4

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

fs/erofs/zdata.c+14−7

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

fs/ext4/extents.c+13−5

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

fs/ext4/fast_commit.c+3−2

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

fs/ext4/ioctl.c+1−2

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

fs/ext4/migrate.c+2−1

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

fs/ext4/namei.c+9−1

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

fs/ext4/resize.c+5−0

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

fs/ext4/super.c+1−1

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

fs/file.c+10−1

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

fs/fs-writeback.c+19−11

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

fs/fscache/volume.c+5−2

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

fs/fuse/file.c+20−21

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

fs/fuse/readdir.c+9−1

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

fs/hugetlbfs/inode.c+6−7

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

fs/kernfs/dir.c+12−2

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

fs/ksmbd/vfs.c+3−3

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

fs/namei.c+2−1

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

fs/netfs/buffered_read.c+13−7

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

fs/netfs/io.c+3−0

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

fs/nfs/client.c+2−2

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

fs/nfs/delegation.c+17−19

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

fs/nfs/dir.c+2−3

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

fs/nfs/dns_resolve.c+4−3

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

fs/nfs/dns_resolve.h+1−1

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

fs/nfs/fs_context.c+7−7

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

fs/nfs/internal.h+7−7

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

fs/nfs/mount_clnt.c+2−2

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

fs/nfs/namespace.c+1−1

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

fs/nfs/nfs3client.c+2−2

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

fs/nfs/nfs42proc.c+3−0

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

fs/nfs/nfs4_fs.h+1−1

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

fs/nfs/nfs4client.c+10−9

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

fs/nfs/nfs4namespace.c+8−8

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

fs/nfs/nfs4proc.c+6−4

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

fs/nfs/nfs4state.c+2−0

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

fs/nfs/pnfs_nfs.c+3−3

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

fs/nfs/super.c+2−3

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

fs/nfsd/filecache.c+3−3

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

fs/nfsd/nfs4state.c+1−0

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

fs/nfsd/trace.h+4−1

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

fs/nfsd/vfs.c+6−5

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

fs/nilfs2/dat.c+7−0

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

fs/nilfs2/segment.c+8−7

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

fs/nilfs2/sufile.c+8−0

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

fs/nilfs2/super.c+0−2

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

fs/nilfs2/the_nilfs.c+0−2

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

fs/proc/meminfo.c+1−1

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

fs/read_write.c+15−4

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

fs/udf/namei.c+1−1

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

fs/userfaultfd.c+3−0

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

fs/xfs/libxfs/xfs_ag.h+15−0

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

fs/xfs/libxfs/xfs_alloc.c+1−5

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

fs/xfs/libxfs/xfs_dir2_leaf.c+7−2

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

fs/xfs/libxfs/xfs_format.h+1−21

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

fs/xfs/libxfs/xfs_log_format.h+54−6

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

fs/xfs/libxfs/xfs_refcount.c+199−87

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

fs/xfs/libxfs/xfs_refcount.h+36−4

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

fs/xfs/libxfs/xfs_refcount_btree.c+12−3

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

fs/xfs/libxfs/xfs_rmap.c+2−7

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

fs/xfs/libxfs/xfs_trans_resv.c+2−2

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

fs/xfs/libxfs/xfs_types.h+30−0

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

fs/xfs/scrub/alloc.c+1−3

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

fs/xfs/scrub/ialloc.c+2−3

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

fs/xfs/scrub/refcount.c+30−42

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

fs/xfs/xfs_attr_item.c+33−34

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

fs/xfs/xfs_bmap_item.c+28−26

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

fs/xfs/xfs_error.c+7−2

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

fs/xfs/xfs_extfree_item.c+45−49

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

fs/xfs/xfs_extfree_item.h+16−0

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

fs/xfs/xfs_file.c+4−3

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

fs/xfs/xfs_inode.c+1−1

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

fs/xfs/xfs_log_recover.c+8−2

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

fs/xfs/xfs_ondisk.h+19−4

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

fs/xfs/xfs_refcount_item.c+30−27

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

fs/xfs/xfs_rmap_item.c+37−33

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

fs/xfs/xfs_super.c+4−8

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

fs/xfs/xfs_sysfs.h+6−1

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

fs/xfs/xfs_trace.h+39−9

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

fs/xfs/xfs_trans_ail.c+1−2

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

fs/zonefs/super.c+44−16

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

fs/zonefs/sysfs.c+0−5

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

fs/zonefs/zonefs.h+4−2

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

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

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

include/asm-generic/hyperv-tlfs.h+9−0

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

include/asm-generic/tlb.h+4−0

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

include/asm-generic/vmlinux.lds.h+1−1

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

include/linux/blkdev.h+8−8

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

include/linux/bpf.h+39−21

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

include/linux/can/dev.h+16−0

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

include/linux/can/platform/sja1000.h+1−1

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

include/linux/efi.h+2−1

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

include/linux/fault-inject.h+5−2

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

include/linux/fortify-string.h+9−4

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

include/linux/fs.h+8−0

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

include/linux/fscache.h+1−1

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

include/linux/gfp.h+16−2

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

include/linux/io_uring.h+3−0

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

include/linux/kvm_host.h+18−7

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

include/linux/maple_tree.h+7−0

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

include/linux/mlx5/driver.h+1−0

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

include/linux/mm.h+21−8

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

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

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

include/linux/pgtable.h+18−0

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

include/linux/ring_buffer.h+1−1

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

include/linux/skmsg.h+1−1

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

include/linux/slab.h+0−23

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

include/linux/trace.h+2−2

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

include/linux/vfio.h+1−0

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

include/net/inet_hashtables.h+2−1

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

include/net/ip.h+1−1

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

include/net/ipv6.h+1−1

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

include/net/neighbour.h+1−1

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

include/net/netlink.h+27−21

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

include/net/sctp/stream_sched.h+2−0

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

include/net/sock.h+8−1

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

include/soc/at91/sama7-ddr.h+4−1

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

include/sound/sof/dai.h+1−1

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

include/sound/sof/info.h+4−0

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

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

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

include/uapi/drm/panfrost_drm.h+1−1

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

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

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

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

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

include/uapi/linux/idxd.h+1−0

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

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

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

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

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

include/uapi/linux/ip.h+4−2

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

include/uapi/linux/ipv6.h+4−2

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

init/Kconfig+1−1

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

io_uring/filetable.c+0−2

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

io_uring/io_uring.c+9−3

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

io_uring/io_uring.h+9−4

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

io_uring/kbuf.c+2−0

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

io_uring/net.c+9−14

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

io_uring/poll.c+71−19

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

ipc/shm.c+25−9

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

kernel/bpf/bpf_local_storage.c+1−1

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

kernel/bpf/dispatcher.c+8−20

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

kernel/bpf/percpu_freelist.c+11−12

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

kernel/bpf/verifier.c+22−9

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

kernel/events/core.c+55−10

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

kernel/events/hw_breakpoint_test.c+2−2

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

kernel/gcov/clang.c+2−0

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

kernel/kprobes.c+11−2

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

kernel/rseq.c+17−2

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

kernel/sched/core.c+35−17

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

kernel/sched/cpufreq_schedutil.c+15−15

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

kernel/trace/fprobe.c+4−1

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

kernel/trace/ftrace.c+6−15

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

kernel/trace/kprobe_event_gen_test.c+39−27

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

kernel/trace/rethook.c+3−1

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

kernel/trace/ring_buffer.c+61−21

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

kernel/trace/synth_event_gen_test.c+6−10

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

kernel/trace/trace.c+17−6

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

kernel/trace/trace.h+1−0

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

kernel/trace/trace_dynevent.c+2−0

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

kernel/trace/trace_eprobe.c+6−2

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

kernel/trace/trace_events.c+11−2

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

kernel/trace/trace_events_hist.c+5−2

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

kernel/trace/trace_events_synth.c+2−5

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

kernel/trace/trace_events_user.c+3−1

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

kernel/trace/trace_osnoise.c+3−3

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

kernel/trace/trace_syscalls.c+0−2

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

lib/Kconfig.debug+14−2

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

lib/Kconfig.kmsan+1−0

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

lib/Makefile+1−0

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

lib/fault-inject.c+8−5

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

lib/maple_tree.c+40−18

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

lib/nlattr.c+15−26

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

lib/test_maple_tree.c+1193−36733

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

lib/vdso/Makefile+1−1

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

mm/compaction.c+11−11

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

mm/damon/dbgfs.c+7−0

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

mm/damon/sysfs.c+48−2

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

mm/failslab.c+10−2

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

mm/huge_memory.c+6−3

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

mm/hugetlb.c+23−12

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

mm/hugetlb_vmemmap.c+1−0

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

mm/kfence/report.c+9−4

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

mm/khugepaged.c+73−24

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

mm/kmsan/kmsan.h+2−0

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

mm/maccess.c+1−1

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

mm/madvise.c+3−3

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

mm/memcontrol.c+1−1

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

mm/memory-failure.c+4−1

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

mm/memory.c+13−14

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

mm/memremap.c+1−0

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

mm/migrate_device.c+6−2

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

mm/mmap.c+6−5

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

mm/mmu_gather.c+1−3

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

mm/page_alloc.c+5−2

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

mm/page_ext.c+1−1

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

mm/slab_common.c+4−20

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

mm/swapfile.c+4−4

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

mm/userfaultfd.c+1−1

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

mm/vmscan.c+59−23

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

net/9p/trans_fd.c+16−12

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

net/9p/trans_xen.c+9−0

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

net/bluetooth/hci_conn.c+12−6

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

net/bluetooth/iso.c+12−2

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

net/bluetooth/l2cap_core.c+73−13

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

net/bpf/test_run.c+1−0

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

net/bridge/br_netlink.c+1−1

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

net/bridge/br_sysfs_br.c+1−1

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

net/bridge/br_vlan.c+14−3

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

net/caif/chnl_net.c+0−3

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

net/can/af_can.c+2−1

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

net/can/isotp.c+38−33

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

net/can/j1939/main.c+3−0

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

net/core/flow_dissector.c+1−1

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

net/core/lwtunnel.c+3−1

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

net/core/neighbour.c+30−28

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

net/core/skbuff.c+19−17

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

net/core/skmsg.c+2−5

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

net/core/sock_map.c+4−3

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

net/dccp/ipv4.c+5−18

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

net/dccp/ipv6.c+5−19

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

net/dccp/proto.c+1−2

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

net/dsa/dsa2.c+20−3

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

net/dsa/dsa_priv.h+1−0

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

net/dsa/master.c+1−2

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

net/dsa/port.c+16−0

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

net/hsr/hsr_forward.c+3−2

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

net/ipv4/Kconfig+10−0

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

net/ipv4/af_inet.c+3−10

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

net/ipv4/esp4_offload.c+3−0

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

net/ipv4/fib_semantics.c+5−3

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

net/ipv4/fib_trie.c+4−2

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

net/ipv4/inet_hashtables.c+77−17

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

net/ipv4/ip_input.c+5−0

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

net/ipv4/netfilter/ipt_CLUSTERIP.c+2−2

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

net/ipv4/tcp.c+2−3

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

net/ipv4/tcp_bpf.c+7−5

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

net/ipv4/tcp_ipv4.c+5−16

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

net/ipv4/tcp_ulp.c+3−0

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

net/ipv4/udp_bpf.c+2−2

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

net/ipv6/addrlabel.c+1−0

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

net/ipv6/esp6_offload.c+3−0

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

net/ipv6/route.c+10−4

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

net/ipv6/tcp_ipv6.c+4−16

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

net/ipv6/udp.c+1−0

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

net/ipv6/xfrm6_policy.c+5−1

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

net/kcm/kcmsock.c+6−52

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

net/key/af_key.c+23−11

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

net/l2tp/l2tp_core.c+15−7

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

net/mac80211/airtime.c+3−0

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

net/mac80211/main.c+6−2

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

net/mac80211/mesh_pathtbl.c+1−1

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

net/mac80211/s1g.c+3−0

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

net/mac80211/tx.c+5−0

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

net/mctp/af_mctp.c+3−1

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

net/mctp/route.c+1−1

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

net/mptcp/protocol.c+6−7

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

net/mptcp/subflow.c+3−3

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

net/netfilter/ipset/ip_set_hash_gen.h+6−24

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

net/netfilter/ipset/ip_set_hash_ip.c+3−5

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

net/netfilter/ipvs/ip_vs_app.c+8−2

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

net/netfilter/ipvs/ip_vs_conn.c+23−7

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

net/netfilter/nf_conntrack_core.c+1−1

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

net/netfilter/nf_conntrack_netlink.c+14−10

This diff is large: its 81 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_flow_table_offload.c+4−0

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

net/netfilter/nf_nat_core.c+10−1

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

net/netfilter/nf_tables_api.c+11−6

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

net/netfilter/nfnetlink.c+1−0

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

net/netfilter/nft_ct.c+3−3

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

net/netfilter/nft_payload.c+3−3

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

net/netfilter/xt_connmark.c+10−8

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

net/nfc/nci/core.c+1−1

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

net/nfc/nci/data.c+3−1

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

net/openvswitch/conntrack.c+4−4

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

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

net/rose/rose_link.c+3−0

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

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

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

net/rxrpc/conn_client.c+23−15

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

net/sched/Kconfig+1−1

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

net/sched/act_connmark.c+2−2

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

net/sched/act_ct.c+4−4

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

net/sched/act_ctinfo.c+3−3

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

net/sched/sch_red.c+3−1

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

net/sctp/outqueue.c+8−5

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

net/sctp/stream.c+18−7

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

net/sctp/stream_sched.c+5−0

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

net/sctp/stream_sched_prio.c+19−0

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

net/sctp/stream_sched_rr.c+5−0

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

net/smc/af_smc.c+4−2

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

net/sunrpc/auth_gss/auth_gss.c+1−1

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

net/sunrpc/sysfs.c+10−2

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

net/tipc/crypto.c+3−0

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

net/tipc/discover.c+4−1

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

net/tipc/netlink_compat.c+1−1

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

net/tipc/topsrv.c+11−9

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

net/tls/tls_device_fallback.c+3−2

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

net/unix/unix_bpf.c+4−4

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

net/vmw_vsock/af_vsock.c+4−3

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

net/wireless/reg.c+9−3

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

net/wireless/scan.c+11−3

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

net/wireless/util.c+4−2

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

net/x25/x25_dev.c+1−1

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

net/xfrm/xfrm_device.c+14−1

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

net/xfrm/xfrm_replay.c+1−1

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

scripts/Makefile.modpost+1−1

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

scripts/Makefile.package+2−2

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

scripts/faddr2line+4−3

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

scripts/kconfig/menu.c+4−19

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

scripts/min-tool-version.sh+1−1

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

scripts/package/mkdebian+1−1

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

security/commoncap.c+4−2

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

sound/arm/pxa2xx-ac97-lib.c+3−1

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

sound/core/memalloc.c+8−7

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

sound/core/seq/seq_memory.c+7−4

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

sound/firewire/dice/dice-stream.c+7−5

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

sound/hda/hdac_sysfs.c+3−1

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

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

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

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

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

sound/pci/hda/patch_ca0132.c+1−0

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

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

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

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

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

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

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

sound/soc/codecs/hdac_hda.h+2−2

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

sound/soc/codecs/max98373-i2c.c+4−0

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

sound/soc/codecs/rt5514-spi.c+8−7

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

sound/soc/codecs/rt5677-spi.c+10−9

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

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

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

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

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

sound/soc/codecs/tas2764.c+6−13

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

sound/soc/codecs/tas2770.c+6−14

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

sound/soc/codecs/tas2780.c+6−13

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

sound/soc/codecs/tlv320adc3xxx.c+3−0

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

sound/soc/codecs/wm8962.c+8−0

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

sound/soc/fsl/fsl_asrc.c+1−1

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

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

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

sound/soc/fsl/fsl_micfil.c+19−0

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

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

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

sound/soc/intel/boards/bytcht_es8316.c+7−0

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

sound/soc/intel/boards/sof_es8336.c+46−14

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

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

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

sound/soc/soc-core.c+15−2

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

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

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

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

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

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

sound/soc/sof/ipc3-topology.c+10−5

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

sound/soc/sof/topology.c+10−10

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

sound/soc/stm/stm32_adfsdm.c+11−0

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

sound/soc/stm/stm32_i2s.c+1−1

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

sound/usb/card.c+20−9

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

sound/usb/endpoint.c+2−1

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

sound/usb/midi.c+1−3

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

sound/usb/quirks-table.h+4−0

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

sound/usb/quirks.c+6−41

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

sound/usb/usbaudio.h+3−0

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

tools/arch/x86/include/asm/msr-index.h+5−3

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

tools/bpf/bpftool/common.c+3−0

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

tools/iio/iio_generic_buffer.c+2−2

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

tools/include/nolibc/string.h+10−7

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

tools/include/uapi/linux/in.h+1−0

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

tools/include/uapi/linux/stddef.h+47−0

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

tools/kvm/kvm_stat/kvm_stat+83−15

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

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

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

tools/lib/bpf/libbpf_probes.c+1−1

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

tools/lib/bpf/ringbuf.c+20−6

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

tools/perf/.gitignore+1−0

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

tools/perf/tests/shell/test_brstack.sh+4−1

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

tools/perf/util/parse-branch-options.c+3−1

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

tools/perf/util/stat-display.c+4−2

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

tools/testing/cxl/test/cxl.c+280−21

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

tools/testing/radix-tree/.gitignore+1−0

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

tools/testing/radix-tree/Makefile+16−3

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

tools/testing/radix-tree/generated/autoconf.h+1−1

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

tools/testing/radix-tree/linux.c+4−0

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

tools/testing/radix-tree/maple.c+35770−0

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

tools/testing/selftests/bpf/map_tests/sk_storage_map.c+20−16

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

tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c+4−4

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

tools/testing/selftests/bpf/prog_tests/varlen.c+7−0

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

tools/testing/selftests/bpf/progs/test_varlen.c+5−0

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

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

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

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

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

tools/testing/selftests/bpf/verifier/ref_tracking.c+36−0

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

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

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

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

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

tools/testing/selftests/kvm/include/x86_64/processor.h+13−0

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

tools/testing/selftests/kvm/lib/x86_64/processor.c+0−13

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

tools/testing/selftests/kvm/x86_64/svm_nested_shutdown_test.c+67−0

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

tools/testing/selftests/kvm/x86_64/triple_fault_event_test.c+56−17

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

tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c+141−1

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

tools/testing/selftests/landlock/Makefile+4−3

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

tools/testing/selftests/net/fcnal-test.sh+7−4

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

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

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

tools/testing/selftests/net/io_uring_zerocopy_tx.sh+1−1

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

tools/testing/selftests/net/mptcp/mptcp_join.sh+3−3

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

tools/testing/selftests/net/mptcp/mptcp_sockopt.sh+5−4

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

tools/testing/selftests/net/mptcp/simult_flows.sh+3−2

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

tools/testing/selftests/net/pmtu.sh+6−4

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

tools/testing/selftests/net/udpgro.sh+7−5

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

tools/testing/selftests/net/udpgro_bench.sh+6−4

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

tools/testing/selftests/net/udpgro_frglist.sh+6−4

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

tools/testing/selftests/net/udpgro_fwd.sh+2−1

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

tools/testing/selftests/net/veth.sh+6−5

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

tools/testing/selftests/netfilter/rpath.sh+8−6

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

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

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

tools/testing/selftests/pidfd/pidfd_test.c+3−1

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

tools/testing/selftests/pidfd/pidfd_wait.c+11−1

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

tools/vm/slabinfo-gnuplot.sh+2−2

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

virt/kvm/kvm_main.c+51−17

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

virt/kvm/pfncache.c+52−17

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