History

Merge drm/drm-next into drm-xe-next

Bring changes from drm-misc-next that got merged in drm-next back to drm-xe so they can be used for additional features.

Lucas De Marchi committed 2 years ago

Commit fbb94402 parents 0f688c0 9ac4beb1429 files · +25588 −11642Browse files

Unified · Split

1429 files
  1. CREDITS +13 −0
  2. Documentation/ABI/testing/sysfs-class-net-queues +11 −11
  3. Documentation/ABI/testing/sysfs-platform-silicom +1 −0
  4. Documentation/accel/introduction.rst +2 −2
  5. Documentation/admin-guide/kernel-parameters.rst +0 −5
  6. Documentation/admin-guide/kernel-per-CPU-kthreads.rst +6 −10
  7. Documentation/dev-tools/kunit/usage.rst +17 −2
  8. Documentation/devicetree/bindings/display/bridge/fsl,imx8mp-hdmi-tx.yaml +102 −0
  9. Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml +1 −1
  10. Documentation/devicetree/bindings/display/imx/fsl,imx8mp-hdmi-pvi.yaml +84 −0
  11. Documentation/devicetree/bindings/display/panel/boe,th101mb31ig002-28a.yaml +58 −0
  12. Documentation/devicetree/bindings/display/panel/novatek,nt35510.yaml +3 −1
  13. Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml +66 −0
  14. Documentation/devicetree/bindings/display/panel/panel-lvds.yaml +2 −0
  15. Documentation/devicetree/bindings/display/panel/panel-simple.yaml +2 −0
  16. Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml +3 −0
  17. Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml +2 −1
  18. Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml +27 −6
  19. Documentation/devicetree/bindings/display/samsung/samsung,exynos-mixer.yaml +3 −3
  20. Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml +10 −10
  21. Documentation/devicetree/bindings/display/solomon,ssd132x.yaml +6 −6
  22. Documentation/devicetree/bindings/display/solomon,ssd133x.yaml +45 −0
  23. Documentation/devicetree/bindings/media/cnm,wave521c.yaml +2 −2
  24. Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-spdif.yaml +4 −1
  25. Documentation/filesystems/overlayfs.rst +13 −3
  26. Documentation/gpu/amdgpu/dgpu-asic-info-table.csv +2 −0
  27. Documentation/gpu/amdgpu/display/dcn-blocks.rst +78 −0
  28. Documentation/gpu/amdgpu/display/display-contributing.rst +168 −0
  29. Documentation/gpu/amdgpu/display/display-manager.rst +0 −3
  30. Documentation/gpu/amdgpu/display/index.rst +71 −7
  31. Documentation/gpu/drm-internals.rst +0 −12
  32. Documentation/gpu/introduction.rst +2 −0
  33. Documentation/gpu/rfc/index.rst +0 −4
  34. Documentation/gpu/rfc/xe.rst +0 −234
  35. Documentation/gpu/todo.rst +23 −0
  36. Documentation/netlink/specs/rt_link.yaml +10 −0
  37. Documentation/sphinx/templates/kernel-toc.html +3 −1
  38. Documentation/usb/gadget-testing.rst +11 −11
  39. MAINTAINERS +19 −19
  40. Makefile +12 −8
  41. arch/Kconfig +1 −0
  42. arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-bletchley.dts +2 −2
  43. arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts +2 −2
  44. arch/arm/boot/dts/aspeed/aspeed-bmc-opp-tacoma.dts +1 −1
  45. arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi +2 −2
  46. arch/arm/boot/dts/nxp/imx/imx6ull-phytec-tauri.dtsi +1 −1
  47. arch/arm/boot/dts/nxp/imx/imx7d-flex-concentrator.dts +1 −1
  48. arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi +1 −0
  49. arch/arm/boot/dts/ti/omap/am335x-moxa-uc-2100-common.dtsi +1 −1
  50. arch/arm64/Makefile +1 −1
  51. arch/arm64/boot/dts/exynos/google/gs101.dtsi +1 −1
  52. arch/arm64/boot/dts/freescale/imx8mm-phygate-tauri-l.dts +1 −1
  53. arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx.dtsi +1 −1
  54. arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx.dtsi +1 −1
  55. arch/arm64/boot/dts/freescale/imx8mp-beacon-kit.dts +1 −1
  56. arch/arm64/boot/dts/freescale/imx8mp-venice-gw72xx.dtsi +1 −1
  57. arch/arm64/boot/dts/freescale/imx8mp-venice-gw73xx.dtsi +1 −1
  58. arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +1 −1
  59. arch/arm64/boot/dts/freescale/imx8mq-kontron-pitx-imx8m.dts +1 −1
  60. arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +1 −1
  61. arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi +1 −1
  62. arch/arm64/boot/dts/rockchip/rk3399-gru-bob.dts +1 −1
  63. arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi +1 −1
  64. arch/arm64/include/asm/vdso.h +0 −3
  65. arch/arm64/kernel/Makefile +3 −3
  66. arch/arm64/kernel/vdso32/Makefile +0 −9
  67. arch/loongarch/include/asm/kvm_vcpu.h +2 −2
  68. arch/loongarch/kernel/smp.c +0 −1
  69. arch/loongarch/kvm/mmu.c +2 −2
  70. arch/loongarch/mm/tlb.c +10 −6
  71. arch/m68k/Makefile +2 −2
  72. arch/mips/alchemy/common/prom.c +1 −0
  73. arch/mips/alchemy/common/setup.c +1 −3
  74. arch/mips/bcm63xx/boards/board_bcm963xx.c +1 −1
  75. arch/mips/bcm63xx/dev-rng.c +1 −1
  76. arch/mips/bcm63xx/dev-uart.c +1 −0
  77. arch/mips/bcm63xx/dev-wdt.c +1 −1
  78. arch/mips/bcm63xx/irq.c +1 −1
  79. arch/mips/bcm63xx/setup.c +1 −1
  80. arch/mips/bcm63xx/timer.c +1 −1
  81. arch/mips/cobalt/setup.c +0 −3
  82. arch/mips/fw/arc/memory.c +1 −1
  83. arch/mips/include/asm/mach-au1x00/au1000.h +3 −0
  84. arch/mips/include/asm/mach-cobalt/cobalt.h +3 −0
  85. arch/mips/kernel/elf.c +6 −0
  86. arch/mips/kernel/traps.c +7 −1
  87. arch/mips/lantiq/prom.c +3 −4
  88. arch/mips/loongson64/init.c +3 −0
  89. arch/mips/loongson64/numa.c +2 −0
  90. arch/mips/sgi-ip27/Makefile +1 −1
  91. arch/mips/sgi-ip27/ip27-berr.c +3 −1
  92. arch/mips/sgi-ip27/ip27-common.h +2 −0
  93. arch/mips/sgi-ip27/ip27-hubio.c +0 −185
  94. arch/mips/sgi-ip27/ip27-irq.c +2 −0
  95. arch/mips/sgi-ip27/ip27-memory.c +1 −0
  96. arch/mips/sgi-ip27/ip27-nmi.c +8 −17
  97. arch/mips/sgi-ip30/ip30-console.c +1 −0
  98. arch/mips/sgi-ip30/ip30-setup.c +1 −0
  99. arch/mips/sgi-ip32/crime.c +4 −2
  100. arch/mips/sgi-ip32/ip32-berr.c +2 −0
  101. arch/mips/sgi-ip32/ip32-common.h +15 −0
  102. arch/mips/sgi-ip32/ip32-irq.c +2 −4
  103. arch/mips/sgi-ip32/ip32-memory.c +1 −0
  104. arch/mips/sgi-ip32/ip32-reset.c +2 −0
  105. arch/mips/sgi-ip32/ip32-setup.c +1 −2
  106. arch/parisc/Kconfig +0 −1
  107. arch/parisc/Makefile +2 −2
  108. arch/parisc/include/asm/assembly.h +1 −0
  109. arch/parisc/include/asm/extable.h +64 −0
  110. arch/parisc/include/asm/special_insns.h +4 −2
  111. arch/parisc/include/asm/uaccess.h +7 −41
  112. arch/parisc/kernel/cache.c +7 −3
  113. arch/parisc/kernel/drivers.c +4 −1
  114. arch/parisc/kernel/unaligned.c +22 −22
  115. arch/parisc/kernel/vmlinux.lds.S +1 −1
  116. arch/parisc/mm/fault.c +8 −3
  117. arch/powerpc/kernel/iommu.c +28 −9
  118. arch/powerpc/platforms/ps3/Kconfig +1 −0
  119. arch/riscv/boot/dts/sophgo/sg2042.dtsi +48 −32
  120. arch/riscv/net/bpf_jit_comp64.c +3 −2
  121. arch/um/Makefile +3 −1
  122. arch/x86/Makefile +5 −5
  123. arch/x86/include/asm/cpufeatures.h +1 −3
  124. arch/x86/include/asm/intel-family.h +2 −0
  125. arch/x86/include/asm/kmsan.h +16 −1
  126. arch/x86/include/asm/syscall_wrapper.h +21 −4
  127. arch/x86/kernel/alternative.c +1 −1
  128. arch/x86/kernel/cpu/amd.c +24 −4
  129. block/blk-core.c +10 −0
  130. block/blk-map.c +10 −3
  131. block/blk-mq.c +0 −10
  132. block/ioctl.c +0 −2
  133. block/partitions/core.c +5 −0
  134. drivers/accel/ivpu/ivpu_debugfs.c +16 −4
  135. drivers/accel/ivpu/ivpu_drv.c +71 −55
  136. drivers/accel/ivpu/ivpu_drv.h +3 −2
  137. drivers/accel/ivpu/ivpu_gem.c +52 −90
  138. drivers/accel/ivpu/ivpu_gem.h +1 −2
  139. drivers/accel/ivpu/ivpu_hw_37xx.c +4 −10
  140. drivers/accel/ivpu/ivpu_hw_40xx.c +23 −6
  141. drivers/accel/ivpu/ivpu_ipc.c +2 −4
  142. drivers/accel/ivpu/ivpu_job.c +73 −87
  143. drivers/accel/ivpu/ivpu_job.h +1 −2
  144. drivers/accel/ivpu/ivpu_mmu.c +15 −7
  145. drivers/accel/ivpu/ivpu_mmu.h +1 −0
  146. drivers/accel/ivpu/ivpu_mmu_context.c +9 −0
  147. drivers/accel/ivpu/ivpu_pm.c +35 −17
  148. drivers/accel/ivpu/ivpu_pm.h +4 −2
  149. drivers/accel/qaic/mhi_controller.c +2 −2
  150. drivers/accel/qaic/qaic.h +1 −2
  151. drivers/accel/qaic/qaic_data.c +26 −33
  152. drivers/accel/qaic/qaic_drv.c +89 −51
  153. drivers/android/binder.c +10 −0
  154. drivers/ata/ahci.c +33 −11
  155. drivers/ata/ahci.h +1 −0
  156. drivers/ata/libata-sata.c +1 −1
  157. drivers/block/aoe/aoeblk.c +4 −1
  158. drivers/block/rbd.c +19 −13
  159. drivers/cpufreq/amd-pstate.c +3 −4
  160. drivers/cpufreq/intel_pstate.c +34 −21
  161. drivers/crypto/caam/caamalg_qi2.c +5 −2
  162. drivers/crypto/caam/caamhash.c +5 −2
  163. drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c +1 −0
  164. drivers/cxl/core/region.c +2 −2
  165. drivers/cxl/pci.c +15 −11
  166. drivers/dma-buf/dma-fence.c +4 −4
  167. drivers/dma-buf/dma-resv.c +2 −2
  168. drivers/dma-buf/heaps/cma_heap.c +3 −4
  169. drivers/dma/at_hdmac.c +21 −11
  170. drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c +6 −4
  171. drivers/dma/fsl-qdma.c +12 −21
  172. drivers/dma/ti/edma.c +10 −0
  173. drivers/dma/ti/k3-udma.c +8 −2
  174. drivers/dpll/dpll_core.c +57 −11
  175. drivers/dpll/dpll_core.h +2 −2
  176. drivers/dpll/dpll_netlink.c +41 −16
  177. drivers/firewire/core-device.c +13 −5
  178. drivers/firmware/Kconfig +1 −0
  179. drivers/firmware/arm_ffa/driver.c +57 −28
  180. drivers/firmware/arm_scmi/clock.c +2 −3
  181. drivers/firmware/arm_scmi/common.h +1 −0
  182. drivers/firmware/arm_scmi/mailbox.c +14 −0
  183. drivers/firmware/arm_scmi/perf.c +18 −5
  184. drivers/firmware/arm_scmi/raw_mode.c +8 −4
  185. drivers/firmware/arm_scmi/shmem.c +7 −1
  186. drivers/firmware/sysfb.c +51 −2
  187. drivers/firmware/sysfb_simplefb.c +4 −1
  188. drivers/gpio/gpio-eic-sprd.c +28 −4
  189. drivers/gpio/gpiolib-acpi.c +14 −0
  190. drivers/gpu/drm/Kconfig +3 −16
  191. drivers/gpu/drm/amd/amdgpu/Makefile +1 −1
  192. drivers/gpu/drm/amd/amdgpu/amdgpu.h +10 −6
  193. drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c +879 −0
  194. drivers/gpu/drm/amd/amdgpu/amdgpu_aca.h +202 −0
  195. drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +24 −13
  196. drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h +14 −2
  197. drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c +1 −1
  198. drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +39 −20
  199. drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +16 −8
  200. drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +2 −1
  201. drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h +1 −1
  202. drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +3 −3
  203. drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c +1 −1
  204. drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +4 −4
  205. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +50 −30
  206. drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +8 −4
  207. drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +4 −0
  208. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +9 −3
  209. drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +8 −0
  210. drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +31 −4
  211. drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +4 −3
  212. drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +54 −1
  213. drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +4 −0
  214. drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c +3 −4
  215. drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +15 −2
  216. drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c +24 −9
  217. drivers/gpu/drm/amd/amdgpu/amdgpu_mca.h +1 −0
  218. drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +4 −4
  219. drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 −5
  220. drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +106 −80
  221. drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +5 −4
  222. drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c +1 −1
  223. drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +524 −129
  224. drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h +57 −3
  225. drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +12 −0
  226. drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +1 −1
  227. drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c +1 −1
  228. drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.h +1 −1
  229. drivers/gpu/drm/amd/amdgpu/amdgpu_seq64.c +38 −32
  230. drivers/gpu/drm/amd/amdgpu/amdgpu_seq64.h +4 −5
  231. drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 −9
  232. drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c +119 −36
  233. drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h +8 −2
  234. drivers/gpu/drm/amd/amdgpu/amdgpu_umr.h +2 −2
  235. drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c +1 −1
  236. drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +1 −1
  237. drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +20 −63
  238. drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +2 −5
  239. drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +1 −2
  240. drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +61 −8
  241. drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +13 −5
  242. drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +16 −1
  243. drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +70 −11
  244. drivers/gpu/drm/amd/amdgpu/atom.c +30 −11
  245. drivers/gpu/drm/amd/amdgpu/atom.h +1 −1
  246. drivers/gpu/drm/amd/amdgpu/atombios_crtc.c +14 −14
  247. drivers/gpu/drm/amd/amdgpu/atombios_dp.c +2 −2
  248. drivers/gpu/drm/amd/amdgpu/atombios_encoders.c +8 −8
  249. drivers/gpu/drm/amd/amdgpu/atombios_i2c.c +2 −2
  250. drivers/gpu/drm/amd/amdgpu/cik_ih.c +6 −0
  251. drivers/gpu/drm/amd/amdgpu/clearstate_gfx9.h +9 −18
  252. drivers/gpu/drm/amd/amdgpu/clearstate_si.h +8 −16
  253. drivers/gpu/drm/amd/amdgpu/cz_ih.c +5 −0
  254. drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +2 −0
  255. drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +2 −0
  256. drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +18 −4
  257. drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +18 −4
  258. drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +2 −4
  259. drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +14 −26
  260. drivers/gpu/drm/amd/amdgpu/gfx_v11_0_3.c +1 −1
  261. drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +2 −2
  262. drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +2 −2
  263. drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +9 −1
  264. drivers/gpu/drm/amd/amdgpu/gfx_v9_4.c +3 −2
  265. drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +90 −2
  266. drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +5 −4
  267. drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c +5 −4
  268. drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +5 −4
  269. drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +5 −4
  270. drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +5 −4
  271. drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +9 −14
  272. drivers/gpu/drm/amd/amdgpu/iceland_ih.c +5 −0
  273. drivers/gpu/drm/amd/amdgpu/ih_v6_0.c +6 −0
  274. drivers/gpu/drm/amd/amdgpu/ih_v6_1.c +7 −0
  275. drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c +4 −6
  276. drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c +0 −9
  277. drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c +0 −10
  278. drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c +87 −0
  279. drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c +2 −1
  280. drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c +24 −5
  281. drivers/gpu/drm/amd/amdgpu/mxgpu_nv.h +1 −0
  282. drivers/gpu/drm/amd/amdgpu/navi10_ih.c +7 −2
  283. drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c +6 −0
  284. drivers/gpu/drm/amd/amdgpu/psp_v13_0.c +27 −72
  285. drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c +6 −9
  286. drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +72 −0
  287. drivers/gpu/drm/amd/amdgpu/si_ih.c +6 −0
  288. drivers/gpu/drm/amd/amdgpu/soc15.c +22 −0
  289. drivers/gpu/drm/amd/amdgpu/ta_ras_if.h +36 −0
  290. drivers/gpu/drm/amd/amdgpu/tonga_ih.c +6 −0
  291. drivers/gpu/drm/amd/amdgpu/umc_v12_0.c +187 −75
  292. drivers/gpu/drm/amd/amdgpu/umc_v12_0.h +3 −0
  293. drivers/gpu/drm/amd/amdgpu/umc_v6_0.c +1 −1
  294. drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +0 −17
  295. drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c +0 −19
  296. drivers/gpu/drm/amd/amdgpu/vega10_ih.c +6 −0
  297. drivers/gpu/drm/amd/amdgpu/vega20_ih.c +6 −0
  298. drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h +7 −7
  299. drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx10.asm +1 −1
  300. drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx9.asm +1 −1
  301. drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +3 −1
  302. drivers/gpu/drm/amd/amdkfd/kfd_crat.c +91 −2
  303. drivers/gpu/drm/amd/amdkfd/kfd_crat.h +1 −0
  304. drivers/gpu/drm/amd/amdkfd/kfd_debug.c +3 −1
  305. drivers/gpu/drm/amd/amdkfd/kfd_events.c +5 −1
  306. drivers/gpu/drm/amd/amdkfd/kfd_int_process_v10.c +5 −2
  307. drivers/gpu/drm/amd/amdkfd/kfd_int_process_v11.c +5 −2
  308. drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c +5 −2
  309. drivers/gpu/drm/amd/amdkfd/kfd_migrate.c +1 −1
  310. drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c +1 −0
  311. drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c +1 −0
  312. drivers/gpu/drm/amd/amdkfd/kfd_priv.h +7 −2
  313. drivers/gpu/drm/amd/amdkfd/kfd_svm.c +6 −4
  314. drivers/gpu/drm/amd/amdkfd/kfd_topology.c +3 −0
  315. drivers/gpu/drm/amd/display/TODO +0 −110
  316. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +154 −22
  317. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +1 −0
  318. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +60 −12
  319. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +54 −1
  320. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c +4 −1
  321. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_replay.c +69 −50
  322. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_replay.h +3 −1
  323. drivers/gpu/drm/amd/display/dc/basics/conversion.c +34 −0
  324. drivers/gpu/drm/amd/display/dc/basics/conversion.h +4 −0
  325. drivers/gpu/drm/amd/display/dc/bios/command_table.c +1 −1
  326. drivers/gpu/drm/amd/display/dc/bios/command_table2.c +1 −1
  327. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +0 −2
  328. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c +0 −4
  329. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/dcn301_smu.c +0 −4
  330. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_smu.c +0 −4
  331. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c +0 −6
  332. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c +0 −4
  333. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_smu.c +0 −4
  334. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c +38 −4
  335. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr_smu_msg.h +1 −2
  336. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c +38 −34
  337. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_smu.c +15 −0
  338. drivers/gpu/drm/amd/display/dc/core/dc.c +60 −12
  339. drivers/gpu/drm/amd/display/dc/core/dc_resource.c +37 −17
  340. drivers/gpu/drm/amd/display/dc/core/dc_state.c +3 −0
  341. drivers/gpu/drm/amd/display/dc/core/dc_stream.c +18 −0
  342. drivers/gpu/drm/amd/display/dc/core/dc_surface.c +2 −0
  343. drivers/gpu/drm/amd/display/dc/dc.h +7 −4
  344. drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +22 −9
  345. drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1 −2
  346. drivers/gpu/drm/amd/display/dc/dc_types.h +5 −0
  347. drivers/gpu/drm/amd/display/dc/dce/dce_audio.c +280 −13
  348. drivers/gpu/drm/amd/display/dc/dce/dce_audio.h +2 −1
  349. drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c +2 −2
  350. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c +20 −0
  351. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.h +3 −1
  352. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +2 −1
  353. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h +3 −0
  354. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c +69 −1
  355. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.c +7 −0
  356. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dpp.c +17 −14
  357. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dpp.h +3 −0
  358. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dpp_cm.c +55 −0
  359. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c +23 −1
  360. drivers/gpu/drm/amd/display/dc/dcn201/dcn201_dpp.c +1 −0
  361. drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dpp.c +36 −2
  362. drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dpp.h +2 −0
  363. drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dpp_cm.c +54 −0
  364. drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c +105 −1
  365. drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.h +4 −0
  366. drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dio_link_encoder.c +2 −2
  367. drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dpp.c +1 −0
  368. drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_link_encoder.c +2 −2
  369. drivers/gpu/drm/amd/display/dc/dm_cp_psp.h +3 −0
  370. drivers/gpu/drm/amd/display/dc/dml/Makefile +3 −3
  371. drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c +8 −8
  372. drivers/gpu/drm/amd/display/dc/dml/dcn303/dcn303_fpu.c +11 −0
  373. drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +13 −6
  374. drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c +4 −4
  375. drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c +33 −8
  376. drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c +12 −21
  377. drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c +1 −1
  378. drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c +5 −0
  379. drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +58 −4
  380. drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.h +4 −0
  381. drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +75 −22
  382. drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c +118 −9
  383. drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.h +6 −0
  384. drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c +34 −29
  385. drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c +149 −18
  386. drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.h +3 −3
  387. drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_init.c +1 −1
  388. drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c +18 −2
  389. drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.h +4 −0
  390. drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_init.c +1 −1
  391. drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c +1 −1
  392. drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c +67 −9
  393. drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.h +2 −0
  394. drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_init.c +4 −1
  395. drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +27 −3
  396. drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h +3 −0
  397. drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c +1 −1
  398. drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c +1 −1
  399. drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h +3 −0
  400. drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h +7 −2
  401. drivers/gpu/drm/amd/display/dc/inc/core_types.h +4 −0
  402. drivers/gpu/drm/amd/display/dc/inc/hw/audio.h +2 −1
  403. drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h +6 −0
  404. drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h +6 −0
  405. drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h +39 −0
  406. drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h +12 −3
  407. drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h +180 −77
  408. drivers/gpu/drm/amd/display/dc/inc/hw/opp.h +16 −0
  409. drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h +0 −2
  410. drivers/gpu/drm/amd/display/dc/inc/resource.h +12 −12
  411. drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.h +10 −0
  412. drivers/gpu/drm/amd/display/dc/link/link_detection.c +18 −0
  413. drivers/gpu/drm/amd/display/dc/link/link_dpms.c +58 −0
  414. drivers/gpu/drm/amd/display/dc/link/link_validation.c +0 −2
  415. drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c +1 −1
  416. drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c +1 −4
  417. drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_fixed_vs_pe_retimer.c +12 −360
  418. drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_fixed_vs_pe_retimer.h +0 −5
  419. drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c +2 −2
  420. drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +1 −1
  421. drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c +11 −0
  422. drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c +1 −1
  423. drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c +0 −2
  424. drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c +15 −1
  425. drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c +1 −0
  426. drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c +6 −3
  427. drivers/gpu/drm/amd/display/dmub/dmub_srv.h +11 −5
  428. drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +57 −20
  429. drivers/gpu/drm/amd/display/dmub/src/dmub_dcn32.c +0 −2
  430. drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +55 −64
  431. drivers/gpu/drm/amd/display/include/audio_types.h +15 −0
  432. drivers/gpu/drm/amd/display/modules/power/power_helpers.c +5 −0
  433. drivers/gpu/drm/amd/display/modules/power/power_helpers.h +1 −0
  434. drivers/gpu/drm/amd/include/amd_shared.h +2 −0
  435. drivers/gpu/drm/amd/include/amdgpu_reg_state.h +1 −1
  436. drivers/gpu/drm/amd/include/arct_ip_offset.h +2 −4
  437. drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_1_6_offset.h +4 −0
  438. drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_1_6_sh_mask.h +10 −0
  439. drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_5_0_offset.h +24 −0
  440. drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_5_0_sh_mask.h +65 −0
  441. drivers/gpu/drm/amd/include/atom-bits.h +1 −1
  442. drivers/gpu/drm/amd/include/beige_goby_ip_offset.h +2 −4
  443. drivers/gpu/drm/amd/include/cgs_common.h +11 −12
  444. drivers/gpu/drm/amd/include/cyan_skillfish_ip_offset.h +2 −4
  445. drivers/gpu/drm/amd/include/dimgrey_cavefish_ip_offset.h +2 −4
  446. drivers/gpu/drm/amd/include/dm_pp_interface.h +4 −5
  447. drivers/gpu/drm/amd/include/kgd_pp_interface.h +2 −4
  448. drivers/gpu/drm/amd/include/navi12_ip_offset.h +2 −4
  449. drivers/gpu/drm/amd/include/navi14_ip_offset.h +2 −4
  450. drivers/gpu/drm/amd/include/pptable.h +3 −3
  451. drivers/gpu/drm/amd/include/renoir_ip_offset.h +2 −4
  452. drivers/gpu/drm/amd/include/sienna_cichlid_ip_offset.h +2 −4
  453. drivers/gpu/drm/amd/include/v10_structs.h +1 −2
  454. drivers/gpu/drm/amd/include/vangogh_ip_offset.h +2 −4
  455. drivers/gpu/drm/amd/include/vega10_ip_offset.h +2 −4
  456. drivers/gpu/drm/amd/include/vega20_ip_offset.h +38 −40
  457. drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c +21 −21
  458. drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomfwctrl.c +2 −2
  459. drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +6 −41
  460. drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +0 −1
  461. drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +12 −6
  462. drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c +1 −1
  463. drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +13 −7
  464. drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +54 −10
  465. drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +153 −15
  466. drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +53 −9
  467. drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c +1 −1
  468. drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +8 −1
  469. drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +10 −0
  470. drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +30 −17
  471. drivers/gpu/drm/bridge/analogix/anx7625.c +16 −21
  472. drivers/gpu/drm/bridge/analogix/anx7625.h +2 −0
  473. drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +15 −13
  474. drivers/gpu/drm/bridge/chrontel-ch7033.c +6 −6
  475. drivers/gpu/drm/bridge/display-connector.c +4 −4
  476. drivers/gpu/drm/bridge/imx/Kconfig +18 −0
  477. drivers/gpu/drm/bridge/imx/Makefile +2 −0
  478. drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pvi.c +207 −0
  479. drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c +154 −0
  480. drivers/gpu/drm/bridge/ite-it6505.c +12 −9
  481. drivers/gpu/drm/bridge/ite-it66121.c +8 −8
  482. drivers/gpu/drm/bridge/lontium-lt8912b.c +10 −10
  483. drivers/gpu/drm/bridge/lontium-lt9611.c +5 −4
  484. drivers/gpu/drm/bridge/lontium-lt9611uxc.c +10 −9
  485. drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c +9 −9
  486. drivers/gpu/drm/bridge/nxp-ptn3460.c +12 −10
  487. drivers/gpu/drm/bridge/parade-ps8640.c +23 −0
  488. drivers/gpu/drm/bridge/samsung-dsim.c +13 −37
  489. drivers/gpu/drm/bridge/sii902x.c +46 −34
  490. drivers/gpu/drm/bridge/simple-bridge.c +9 −8
  491. drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +26 −18
  492. drivers/gpu/drm/bridge/tc358767.c +148 −47
  493. drivers/gpu/drm/bridge/ti-sn65dsi86.c +4 −4
  494. drivers/gpu/drm/bridge/ti-tfp410.c +9 −9
  495. drivers/gpu/drm/ci/build.sh +1 −0
  496. drivers/gpu/drm/ci/gitlab-ci.yml +12 −2
  497. drivers/gpu/drm/ci/test.yml +25 −6
  498. drivers/gpu/drm/ci/testlist.txt +49 −0
  499. drivers/gpu/drm/ci/xfails/msm-apq8016-fails.txt +1 −2
  500. drivers/gpu/drm/ci/xfails/msm-sc7180-fails.txt +0 −30
  501. drivers/gpu/drm/ci/xfails/msm-sc7180-flakes.txt +0 −17
  502. drivers/gpu/drm/ci/xfails/msm-sc7180-skips.txt +0 −7
  503. drivers/gpu/drm/ci/xfails/msm-sc7180-trogdor-kingoftown-fails.txt +17 −0
  504. drivers/gpu/drm/ci/xfails/msm-sc7180-trogdor-lazor-limozeen-fails.txt +17 −0
  505. drivers/gpu/drm/ci/xfails/msm-sdm845-fails.txt +1 −4
  506. drivers/gpu/drm/ci/xfails/msm-sdm845-flakes.txt +19 −9
  507. drivers/gpu/drm/ci/xfails/msm-sdm845-skips.txt +6 −1
  508. drivers/gpu/drm/display/drm_dp_aux_bus.c +1 −1
  509. drivers/gpu/drm/display/drm_dp_helper.c +7 −10
  510. drivers/gpu/drm/display/drm_dp_mst_topology.c +16 −9
  511. drivers/gpu/drm/drm_bridge.c +9 −8
  512. drivers/gpu/drm/drm_bridge_connector.c +8 −8
  513. drivers/gpu/drm/drm_crtc.c +4 −4
  514. drivers/gpu/drm/drm_debugfs.c +0 −4
  515. drivers/gpu/drm/drm_edid.c +2 −23
  516. drivers/gpu/drm/drm_exec.c +1 −1
  517. drivers/gpu/drm/drm_gem_vram_helper.c +0 −2
  518. drivers/gpu/drm/drm_ioc32.c +2 −2
  519. drivers/gpu/drm/drm_managed.c +39 −0
  520. drivers/gpu/drm/drm_mipi_dsi.c +1 −1
  521. drivers/gpu/drm/drm_mode_config.c +1 −1
  522. drivers/gpu/drm/drm_modes.c +22 −0
  523. drivers/gpu/drm/drm_modeset_lock.c +1 −1
  524. drivers/gpu/drm/drm_panel_orientation_quirks.c +12 −0
  525. drivers/gpu/drm/drm_print.c +24 −5
  526. drivers/gpu/drm/drm_probe_helper.c +0 −36
  527. drivers/gpu/drm/exynos/exynos5433_drm_decon.c +2 −2
  528. drivers/gpu/drm/exynos/exynos_drm_fimd.c +3 −3
  529. drivers/gpu/drm/exynos/exynos_drm_gsc.c +1 −1
  530. drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h +0 −1
  531. drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c +1 −0
  532. drivers/gpu/drm/i915/Makefile +0 −1
  533. drivers/gpu/drm/i915/display/i9xx_plane.c +30 −0
  534. drivers/gpu/drm/i915/display/i9xx_plane.h +7 −0
  535. drivers/gpu/drm/i915/display/icl_dsi.c +1 −2
  536. drivers/gpu/drm/i915/display/intel_atomic_plane.c +3 −3
  537. drivers/gpu/drm/i915/display/intel_backlight.c +1 −1
  538. drivers/gpu/drm/i915/display/intel_bios.c +32 −4
  539. drivers/gpu/drm/i915/display/intel_bios.h +2 −3
  540. drivers/gpu/drm/i915/display/intel_cdclk.c +185 −190
  541. drivers/gpu/drm/i915/display/intel_crt.c +5 −0
  542. drivers/gpu/drm/i915/display/intel_crtc.c +8 −120
  543. drivers/gpu/drm/i915/display/intel_crtc_state_dump.c +2 −3
  544. drivers/gpu/drm/i915/display/intel_cursor.c +49 −14
  545. drivers/gpu/drm/i915/display/intel_cx0_phy.c +119 −110
  546. drivers/gpu/drm/i915/display/intel_cx0_phy_regs.h +55 −8
  547. drivers/gpu/drm/i915/display/intel_ddi.c +48 −19
  548. drivers/gpu/drm/i915/display/intel_display.c +73 −30
  549. drivers/gpu/drm/i915/display/intel_display_core.h +17 −1
  550. drivers/gpu/drm/i915/display/intel_display_debugfs.c +2 −24
  551. drivers/gpu/drm/i915/display/intel_display_debugfs_params.c +1 −0
  552. drivers/gpu/drm/i915/display/intel_display_device.c +1 −1
  553. drivers/gpu/drm/i915/display/intel_display_driver.c +156 −12
  554. drivers/gpu/drm/i915/display/intel_display_driver.h +6 −0
  555. drivers/gpu/drm/i915/display/intel_display_irq.c +5 −5
  556. drivers/gpu/drm/i915/display/intel_display_types.h +27 −11
  557. drivers/gpu/drm/i915/display/intel_dmc.c +1 −1
  558. drivers/gpu/drm/i915/display/intel_dp.c +104 −88
  559. drivers/gpu/drm/i915/display/intel_dp.h +3 −7
  560. drivers/gpu/drm/i915/display/intel_dp_aux.c +13 −16
  561. drivers/gpu/drm/i915/display/intel_dp_mst.c +4 −0
  562. drivers/gpu/drm/i915/display/intel_dpll_mgr.c +51 −32
  563. drivers/gpu/drm/i915/display/intel_dpll_mgr.h +12 −6
  564. drivers/gpu/drm/i915/display/intel_dsb.c +4 −0
  565. drivers/gpu/drm/i915/display/intel_dvo.c +5 −0
  566. drivers/gpu/drm/i915/display/intel_fbc.c +1 −12
  567. drivers/gpu/drm/i915/display/intel_fbdev_fb.c +3 −2
  568. drivers/gpu/drm/i915/display/intel_global_state.c +126 −11
  569. drivers/gpu/drm/i915/display/intel_global_state.h +8 −1
  570. drivers/gpu/drm/i915/display/intel_gmbus.c +1 −4
  571. drivers/gpu/drm/i915/display/intel_hdcp.c +42 −36
  572. drivers/gpu/drm/i915/display/intel_hdcp_gsc.c +1 −1
  573. drivers/gpu/drm/i915/display/intel_hdcp_regs.h +15 −13
  574. drivers/gpu/drm/i915/display/intel_hdmi.c +13 −3
  575. drivers/gpu/drm/i915/display/intel_hotplug.c +146 −19
  576. drivers/gpu/drm/i915/display/intel_hotplug.h +4 −0
  577. drivers/gpu/drm/i915/display/intel_hotplug_irq.c +2 −4
  578. drivers/gpu/drm/i915/display/intel_opregion.c +124 −52
  579. drivers/gpu/drm/i915/display/intel_opregion.h +21 −26
  580. drivers/gpu/drm/i915/display/intel_panel.c +4 −0
  581. drivers/gpu/drm/i915/display/intel_plane_initial.c +187 −68
  582. drivers/gpu/drm/i915/display/intel_plane_initial.h +2 −2
  583. drivers/gpu/drm/i915/display/intel_pps.c +1 −1
  584. drivers/gpu/drm/i915/display/intel_psr.c +168 −48
  585. drivers/gpu/drm/i915/display/intel_psr.h +0 −6
  586. drivers/gpu/drm/i915/display/intel_psr_regs.h +63 −0
  587. drivers/gpu/drm/i915/display/intel_sdvo.c +6 −0
  588. drivers/gpu/drm/i915/display/intel_tc.c +20 −20
  589. drivers/gpu/drm/i915/display/intel_tc.h +1 −1
  590. drivers/gpu/drm/i915/display/intel_tv.c +6 −1
  591. drivers/gpu/drm/i915/display/intel_vblank.c +130 −0
  592. drivers/gpu/drm/i915/display/intel_vblank.h +12 −0
  593. drivers/gpu/drm/i915/display/skl_universal_plane.c +28 −0
  594. drivers/gpu/drm/i915/display/skl_universal_plane.h +2 −0
  595. drivers/gpu/drm/i915/display/skl_watermark.c +30 −24
  596. drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +0 −8
  597. drivers/gpu/drm/i915/gem/i915_gem_pm.c +10 −0
  598. drivers/gpu/drm/i915/gem/i915_gem_region.c +1 −1
  599. drivers/gpu/drm/i915/gem/i915_gem_stolen.c +13 −12
  600. drivers/gpu/drm/i915/gem/i915_gem_ttm.c +22 −28
  601. drivers/gpu/drm/i915/gem/i915_gem_userptr.c +0 −42
  602. drivers/gpu/drm/i915/gem/i915_gem_userptr.h +0 −14
  603. drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c +9 −9
  604. drivers/gpu/drm/i915/gt/gen8_engine_cs.c +2 −2
  605. drivers/gpu/drm/i915/gt/intel_engine_cs.c +2 −1
  606. drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +5 −1
  607. drivers/gpu/drm/i915/gt/intel_ggtt.c +9 −1
  608. drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c +2 −16
  609. drivers/gpu/drm/i915/gt/intel_gtt.c +2 −1
  610. drivers/gpu/drm/i915/gt/intel_mocs.c +1 −1
  611. drivers/gpu/drm/i915/gt/intel_rc6.c +1 −1
  612. drivers/gpu/drm/i915/gt/intel_region_lmem.c +3 −11
  613. drivers/gpu/drm/i915/gt/intel_reset.c +2 −1
  614. drivers/gpu/drm/i915/gt/intel_workarounds.c +20 −10
  615. drivers/gpu/drm/i915/gt/selftest_context.c +2 −1
  616. drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c +5 −5
  617. drivers/gpu/drm/i915/gt/selftest_rc6.c +2 −2
  618. drivers/gpu/drm/i915/gt/selftest_tlb.c +2 −2
  619. drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +13 −8
  620. drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c +5 −5
  621. drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +120 −6
  622. drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h +2 −0
  623. drivers/gpu/drm/i915/gt/uc/intel_huc.c +58 −6
  624. drivers/gpu/drm/i915/gt/uc/intel_uc.c +3 −1
  625. drivers/gpu/drm/i915/gvt/kvmgt.c +1 −1
  626. drivers/gpu/drm/i915/i915_debugfs.c +1 −1
  627. drivers/gpu/drm/i915/i915_driver.c +22 −6
  628. drivers/gpu/drm/i915/i915_drv.h +0 −8
  629. drivers/gpu/drm/i915/i915_gem.c +0 −5
  630. drivers/gpu/drm/i915/i915_gpu_error.c +1 −1
  631. drivers/gpu/drm/i915/i915_perf.c +1 −1
  632. drivers/gpu/drm/i915/i915_query.c +34 −1
  633. drivers/gpu/drm/i915/i915_reg.h +15 −3
  634. drivers/gpu/drm/i915/i915_syncmap.c +8 −11
  635. drivers/gpu/drm/i915/i915_utils.c +17 −0
  636. drivers/gpu/drm/i915/i915_utils.h +2 −0
  637. drivers/gpu/drm/i915/intel_memory_region.c +25 −8
  638. drivers/gpu/drm/i915/intel_memory_region.h +1 −2
  639. drivers/gpu/drm/i915/intel_region_ttm.c +4 −4
  640. drivers/gpu/drm/i915/intel_uncore.c +4 −1
  641. drivers/gpu/drm/i915/selftests/i915_active.c +4 −4
  642. drivers/gpu/drm/i915/selftests/intel_memory_region.c +2 −2
  643. drivers/gpu/drm/i915/soc/intel_pch.c +8 −8
  644. drivers/gpu/drm/i915/soc/intel_pch.h +1 −5
  645. drivers/gpu/drm/imx/dcss/dcss-blkctl.c +2 −11
  646. drivers/gpu/drm/imx/dcss/dcss-ctxld.c +3 −11
  647. drivers/gpu/drm/imx/dcss/dcss-dev.c +9 −10
  648. drivers/gpu/drm/imx/dcss/dcss-dev.h +0 −1
  649. drivers/gpu/drm/imx/dcss/dcss-dpr.c +3 −18
  650. drivers/gpu/drm/imx/dcss/dcss-drv.c +3 −9
  651. drivers/gpu/drm/imx/dcss/dcss-dtg.c +5 −21
  652. drivers/gpu/drm/imx/dcss/dcss-scaler.c +3 −18
  653. drivers/gpu/drm/imx/dcss/dcss-ss.c +3 −9
  654. drivers/gpu/drm/imx/ipuv3/imx-ldb.c +1 −1
  655. drivers/gpu/drm/ingenic/Kconfig +0 −1
  656. drivers/gpu/drm/lima/lima_ctx.c +1 −1
  657. drivers/gpu/drm/lima/lima_ctx.h +0 −1
  658. drivers/gpu/drm/lima/lima_gem.c +14 −9
  659. drivers/gpu/drm/lima/lima_gp.c +30 −9
  660. drivers/gpu/drm/lima/lima_l2_cache.c +4 −2
  661. drivers/gpu/drm/lima/lima_mmu.c +9 −9
  662. drivers/gpu/drm/lima/lima_pmu.c +2 −1
  663. drivers/gpu/drm/lima/lima_pp.c +29 −8
  664. drivers/gpu/drm/lima/lima_sched.c +31 −7
  665. drivers/gpu/drm/lima/lima_sched.h +1 −2
  666. drivers/gpu/drm/loongson/lsdc_drv.c +1 −1
  667. drivers/gpu/drm/loongson/lsdc_ttm.c +0 −2
  668. drivers/gpu/drm/mcde/Kconfig +0 −1
  669. drivers/gpu/drm/mediatek/mtk_dp.c +20 −11
  670. drivers/gpu/drm/mediatek/mtk_hdmi.c +17 −9
  671. drivers/gpu/drm/meson/meson_encoder_hdmi.c +16 −4
  672. drivers/gpu/drm/mgag200/mgag200_drv.c +4 −5
  673. drivers/gpu/drm/mgag200/mgag200_mode.c +10 −4
  674. drivers/gpu/drm/msm/dp/dp_display.c +1 −0
  675. drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +21 −12
  676. drivers/gpu/drm/nouveau/dispnv04/crtc.c +2 −2
  677. drivers/gpu/drm/nouveau/dispnv50/head.c +1 −0
  678. drivers/gpu/drm/nouveau/nouveau_bo.c +23 −36
  679. drivers/gpu/drm/nouveau/nouveau_bo.h +0 −1
  680. drivers/gpu/drm/nouveau/nouveau_connector.h +1 −1
  681. drivers/gpu/drm/nouveau/nouveau_fence.c +21 −27
  682. drivers/gpu/drm/nouveau/nouveau_fence.h +2 −4
  683. drivers/gpu/drm/nouveau/nouveau_ioc32.c +2 −2
  684. drivers/gpu/drm/nouveau/nouveau_svm.c +3 −7
  685. drivers/gpu/drm/nouveau/nvif/outp.c +1 −2
  686. drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c +1 −1
  687. drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c +1 −2
  688. drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c +68 −68
  689. drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c +1 −1
  690. drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c +2 −2
  691. drivers/gpu/drm/omapdrm/dss/hdmi4.c +15 −7
  692. drivers/gpu/drm/omapdrm/dss/hdmi5.c +6 −6
  693. drivers/gpu/drm/panel/Kconfig +123 −100
  694. drivers/gpu/drm/panel/Makefile +2 −0
  695. drivers/gpu/drm/panel/panel-boe-himax8279d.c +6 −12
  696. drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c +322 −0
  697. drivers/gpu/drm/panel/panel-edp.c +95 −2
  698. drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c +7 −16
  699. drivers/gpu/drm/panel/panel-novatek-nt35510.c +367 −57
  700. drivers/gpu/drm/panel/panel-novatek-nt36523.c +4 −4
  701. drivers/gpu/drm/panel/panel-novatek-nt36672e.c +643 −0
  702. drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c +1 −1
  703. drivers/gpu/drm/panel/panel-simple.c +48 −15
  704. drivers/gpu/drm/panel/panel-sitronix-st7703.c +104 −0
  705. drivers/gpu/drm/panel/panel-visionox-r66451.c +1 −0
  706. drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +1 −0
  707. drivers/gpu/drm/pl111/Kconfig +0 −1
  708. drivers/gpu/drm/qxl/qxl_object.c +0 −2
  709. drivers/gpu/drm/qxl/qxl_ttm.c +0 −2
  710. drivers/gpu/drm/radeon/atom-bits.h +1 −1
  711. drivers/gpu/drm/radeon/atom.c +33 −14
  712. drivers/gpu/drm/radeon/atom.h +2 −2
  713. drivers/gpu/drm/radeon/atombios_crtc.c +14 −14
  714. drivers/gpu/drm/radeon/atombios_dp.c +2 −2
  715. drivers/gpu/drm/radeon/atombios_encoders.c +19 −19
  716. drivers/gpu/drm/radeon/atombios_i2c.c +1 −1
  717. drivers/gpu/drm/radeon/btc_dpm.c +31 −59
  718. drivers/gpu/drm/radeon/ci_dpm.c +13 −18
  719. drivers/gpu/drm/radeon/ci_dpm.h +2 −4
  720. drivers/gpu/drm/radeon/clearstate_cayman.h +3 −6
  721. drivers/gpu/drm/radeon/clearstate_ci.h +1 −2
  722. drivers/gpu/drm/radeon/evergreen.c +8 −12
  723. drivers/gpu/drm/radeon/evergreen_cs.c +2 −2
  724. drivers/gpu/drm/radeon/evergreen_reg.h +5 −5
  725. drivers/gpu/drm/radeon/evergreen_smc.h +3 −6
  726. drivers/gpu/drm/radeon/kv_dpm.c +4 −5
  727. drivers/gpu/drm/radeon/kv_smc.c +1 −1
  728. drivers/gpu/drm/radeon/ni.c +9 −22
  729. drivers/gpu/drm/radeon/ni_dpm.c +0 −3
  730. drivers/gpu/drm/radeon/ni_dpm.h +4 −8
  731. drivers/gpu/drm/radeon/nislands_smc.h +17 −34
  732. drivers/gpu/drm/radeon/r100.c +1 −1
  733. drivers/gpu/drm/radeon/r300_reg.h +1 −1
  734. drivers/gpu/drm/radeon/r600.c +1 −2
  735. drivers/gpu/drm/radeon/r600_dpm.c +2 −4
  736. drivers/gpu/drm/radeon/r600_dpm.h +1 −2
  737. drivers/gpu/drm/radeon/radeon.h +2 −4
  738. drivers/gpu/drm/radeon/radeon_asic.c +4 −4
  739. drivers/gpu/drm/radeon/radeon_atombios.c +22 −22
  740. drivers/gpu/drm/radeon/radeon_atpx_handler.c +8 −4
  741. drivers/gpu/drm/radeon/radeon_audio.c +5 −6
  742. drivers/gpu/drm/radeon/radeon_audio.h +2 −4
  743. drivers/gpu/drm/radeon/radeon_mode.h +3 −6
  744. drivers/gpu/drm/radeon/radeon_object.c +0 −2
  745. drivers/gpu/drm/radeon/radeon_pm.c +2 −2
  746. drivers/gpu/drm/radeon/radeon_ttm.c +1 −7
  747. drivers/gpu/drm/radeon/radeon_uvd.c +0 −1
  748. drivers/gpu/drm/radeon/rs400.c +2 −2
  749. drivers/gpu/drm/radeon/rs600.c +1 −2
  750. drivers/gpu/drm/radeon/rv515.c +1 −2
  751. drivers/gpu/drm/radeon/rv6xx_dpm.h +1 −2
  752. drivers/gpu/drm/radeon/rv770_dpm.c +2 −2
  753. drivers/gpu/drm/radeon/rv770_smc.h +9 −18
  754. drivers/gpu/drm/radeon/si.c +22 −41
  755. drivers/gpu/drm/radeon/si_dpm.c +44 −88
  756. drivers/gpu/drm/radeon/si_dpm.h +7 −14
  757. drivers/gpu/drm/radeon/smu7.h +2 −4
  758. drivers/gpu/drm/radeon/smu7_discrete.h +17 −34
  759. drivers/gpu/drm/radeon/smu7_fusion.h +16 −26
  760. drivers/gpu/drm/radeon/sumo_dpm.c +8 −10
  761. drivers/gpu/drm/radeon/trinity_dpm.c +9 −13
  762. drivers/gpu/drm/radeon/trinity_dpm.h +1 −2
  763. drivers/gpu/drm/radeon/uvd_v1_0.c +1 −1
  764. drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +3 −0
  765. drivers/gpu/drm/rockchip/inno_hdmi.c +342 −207
  766. drivers/gpu/drm/rockchip/inno_hdmi.h +0 −5
  767. drivers/gpu/drm/rockchip/rockchip_lvds.c +1 −2
  768. drivers/gpu/drm/rockchip/rockchip_vop_reg.c +12 −1
  769. drivers/gpu/drm/rockchip/rockchip_vop_reg.h +3 −0
  770. drivers/gpu/drm/scheduler/sched_main.c +13 −13
  771. drivers/gpu/drm/solomon/ssd130x-spi.c +7 −0
  772. drivers/gpu/drm/solomon/ssd130x.c +370 −0
  773. drivers/gpu/drm/solomon/ssd130x.h +4 −1
  774. drivers/gpu/drm/tegra/dpaux.c +10 −4
  775. drivers/gpu/drm/tegra/drm.c +2 −1
  776. drivers/gpu/drm/tegra/drm.h +1 −1
  777. drivers/gpu/drm/tegra/dsi.c +39 −20
  778. drivers/gpu/drm/tegra/hdmi.c +14 −7
  779. drivers/gpu/drm/tegra/output.c +13 −4
  780. drivers/gpu/drm/tegra/rgb.c +13 −5
  781. drivers/gpu/drm/tegra/sor.c +1 −0
  782. drivers/gpu/drm/tests/drm_managed_test.c +61 −16
  783. drivers/gpu/drm/tests/drm_mm_test.c +4 −1
  784. drivers/gpu/drm/tilcdc/tilcdc_drv.c +4 −15
  785. drivers/gpu/drm/ttm/tests/Makefile +3 −0
  786. drivers/gpu/drm/ttm/tests/ttm_bo_test.c +622 −0
  787. drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c +47 −1
  788. drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h +3 −0
  789. drivers/gpu/drm/ttm/tests/ttm_pool_test.c +1 −2
  790. drivers/gpu/drm/ttm/tests/ttm_resource_test.c +335 −0
  791. drivers/gpu/drm/ttm/tests/ttm_tt_test.c +295 −0
  792. drivers/gpu/drm/ttm/ttm_bo.c +19 −11
  793. drivers/gpu/drm/ttm/ttm_bo_util.c +11 −2
  794. drivers/gpu/drm/ttm/ttm_device.c +16 −5
  795. drivers/gpu/drm/ttm/ttm_resource.c +19 −57
  796. drivers/gpu/drm/ttm/ttm_tt.c +15 −0
  797. drivers/gpu/drm/tve200/Kconfig +0 −1
  798. drivers/gpu/drm/v3d/v3d_debugfs.c +15 −0
  799. drivers/gpu/drm/v3d/v3d_submit.c +28 −7
  800. drivers/gpu/drm/vc4/vc4_hdmi.c +1 −0
  801. drivers/gpu/drm/vc4/vc4_plane.c +5 −5
  802. drivers/gpu/drm/virtio/virtgpu_drv.c +1 −0
  803. drivers/gpu/drm/virtio/virtgpu_submit.c +3 −3
  804. drivers/gpu/drm/vkms/Kconfig +15 −0
  805. drivers/gpu/drm/vkms/vkms_composer.c +10 −4
  806. drivers/gpu/drm/vmwgfx/ttm_object.c +3 −3
  807. drivers/gpu/drm/vmwgfx/ttm_object.h +1 −2
  808. drivers/gpu/drm/vmwgfx/vmwgfx_bo.c +24 −9
  809. drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +0 −1
  810. drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +15 −5
  811. drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c +4 −1
  812. drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +104 −196
  813. drivers/gpu/drm/vmwgfx/vmwgfx_kms.h +3 −3
  814. drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +3 −2
  815. drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +3 −2
  816. drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +15 −6
  817. drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +6 −12
  818. drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +0 −32
  819. drivers/gpu/drm/xe/display/xe_plane_initial.c +40 −27
  820. drivers/gpu/drm/xe/xe_bo.c +15 −18
  821. drivers/gpu/drm/xe/xe_gt.c +1 −1
  822. drivers/gpu/drm/xe/xe_gt_topology.c +3 −1
  823. drivers/gpu/drm/xe/xe_guc_submit.c +2 −1
  824. drivers/gpu/drm/xe/xe_reg_sr.c +1 −1
  825. drivers/gpu/drm/xlnx/zynqmp_disp.c +1 −1
  826. drivers/gpu/drm/xlnx/zynqmp_dp.c +15 −7
  827. drivers/gpu/host1x/bus.c +1 −1
  828. drivers/gpu/host1x/bus.h +1 −1
  829. drivers/hid/bpf/hid_bpf_dispatch.c +74 −27
  830. drivers/hid/bpf/hid_bpf_dispatch.h +2 −2
  831. drivers/hid/bpf/hid_bpf_jmp_table.c +20 −20
  832. drivers/hid/hid-ids.h +3 −0
  833. drivers/hid/hid-logitech-hidpp.c +2 −0
  834. drivers/hid/hid-nvidia-shield.c +4 −0
  835. drivers/hid/hid-steam.c +18 −18
  836. drivers/hid/hidraw.c +5 −2
  837. drivers/hid/i2c-hid/i2c-hid-core.c +5 −1
  838. drivers/hid/i2c-hid/i2c-hid-of.c +1 −0
  839. drivers/hwmon/gigabyte_waterforce.c +1 −1
  840. drivers/hwmon/pmbus/mp2975.c +16 −0
  841. drivers/input/joystick/xpad.c +2 −0
  842. drivers/input/keyboard/atkbd.c +9 −5
  843. drivers/input/mouse/bcm5974.c +20 −0
  844. drivers/input/serio/i8042-acpipnpio.h +14 −0
  845. drivers/input/touchscreen/goodix.c +2 −1
  846. drivers/iommu/iommu.c +13 −5
  847. drivers/md/dm-core.h +2 −0
  848. drivers/md/dm-crypt.c +2 −36
  849. drivers/md/dm-ioctl.c +2 −1
  850. drivers/md/dm-stats.c +9 −0
  851. drivers/md/dm-table.c +7 −2
  852. drivers/md/dm-verity-target.c +2 −24
  853. drivers/md/dm-verity.h +0 −1
  854. drivers/md/dm-writecache.c +4 −4
  855. drivers/md/raid1.c +1 −1
  856. drivers/media/common/videobuf2/videobuf2-core.c +1 −1
  857. drivers/media/common/videobuf2/videobuf2-v4l2.c +26 −29
  858. drivers/media/i2c/tc358743.c +4 −3
  859. drivers/media/platform/chips-media/wave5/wave5-vpu.c +1 −1
  860. drivers/misc/fastrpc.c +1 −1
  861. drivers/misc/open-dice.c +1 −1
  862. drivers/net/dsa/mt7530.c +1 −2
  863. drivers/net/dsa/mv88e6xxx/chip.c +1 −1
  864. drivers/net/dsa/qca/qca8k-8xxx.c +1 −2
  865. drivers/net/ethernet/8390/8390.c +1 −0
  866. drivers/net/ethernet/8390/8390p.c +1 −0
  867. drivers/net/ethernet/8390/apne.c +1 −0
  868. drivers/net/ethernet/8390/hydra.c +1 −0
  869. drivers/net/ethernet/8390/stnic.c +1 −0
  870. drivers/net/ethernet/8390/zorro8390.c +1 −0
  871. drivers/net/ethernet/amd/pds_core/adminq.c +48 −16
  872. drivers/net/ethernet/amd/pds_core/core.c +36 −10
  873. drivers/net/ethernet/amd/pds_core/core.h +1 −1
  874. drivers/net/ethernet/amd/pds_core/debugfs.c +4 −0
  875. drivers/net/ethernet/amd/pds_core/dev.c +8 −8
  876. drivers/net/ethernet/amd/pds_core/devlink.c +2 −1
  877. drivers/net/ethernet/amd/pds_core/fw.c +3 −0
  878. drivers/net/ethernet/amd/pds_core/main.c +22 −4
  879. drivers/net/ethernet/broadcom/bcm4908_enet.c +1 −0
  880. drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c +1 −0
  881. drivers/net/ethernet/broadcom/bgmac-bcma.c +1 −0
  882. drivers/net/ethernet/broadcom/bgmac-platform.c +1 −0
  883. drivers/net/ethernet/broadcom/bgmac.c +1 −0
  884. drivers/net/ethernet/broadcom/bnxt/bnxt.c +35 −14
  885. drivers/net/ethernet/broadcom/bnxt/bnxt.h +1 −0
  886. drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c +1 −1
  887. drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +4 −3
  888. drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c +1 −1
  889. drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c +1 −1
  890. drivers/net/ethernet/cavium/liquidio/lio_core.c +1 −0
  891. drivers/net/ethernet/cirrus/ep93xx_eth.c +1 −0
  892. drivers/net/ethernet/engleder/tsnep_main.c +15 −2
  893. drivers/net/ethernet/ezchip/nps_enet.c +1 −0
  894. drivers/net/ethernet/freescale/enetc/enetc.c +1 −0
  895. drivers/net/ethernet/freescale/fec_main.c +3 −0
  896. drivers/net/ethernet/freescale/fsl_pq_mdio.c +1 −0
  897. drivers/net/ethernet/google/gve/gve_rx.c +4 −4
  898. drivers/net/ethernet/intel/e1000e/e1000.h +20 −0
  899. drivers/net/ethernet/intel/e1000e/ptp.c +15 −7
  900. drivers/net/ethernet/intel/i40e/i40e_main.c +31 −16
  901. drivers/net/ethernet/intel/i40e/i40e_txrx.c +23 −26
  902. drivers/net/ethernet/intel/i40e/i40e_xsk.c +2 −2
  903. drivers/net/ethernet/intel/ice/ice_base.c +23 −14
  904. drivers/net/ethernet/intel/ice/ice_txrx.c +9 −10
  905. drivers/net/ethernet/intel/ice/ice_txrx.h +1 −0
  906. drivers/net/ethernet/intel/ice/ice_txrx_lib.h +22 −9
  907. drivers/net/ethernet/intel/ice/ice_xsk.c +2 −2
  908. drivers/net/ethernet/intel/idpf/idpf_lib.c +2 −0
  909. drivers/net/ethernet/intel/idpf/virtchnl2.h +1 −1
  910. drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c +2 −1
  911. drivers/net/ethernet/litex/litex_liteeth.c +1 −0
  912. drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +26 −1
  913. drivers/net/ethernet/marvell/octeontx2/af/mbox.c +1 −0
  914. drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c +0 −1
  915. drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +1 −2
  916. drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c +3 −4
  917. drivers/net/ethernet/mediatek/mtk_eth_soc.c +4 −1
  918. drivers/net/ethernet/mellanox/mlx5/core/cmd.c +3 −2
  919. drivers/net/ethernet/mellanox/mlx5/core/en.h +1 −1
  920. drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c +1 −0
  921. drivers/net/ethernet/mellanox/mlx5/core/en/params.c +2 −2
  922. drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c +1 −1
  923. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c +8 −2
  924. drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c +15 −11
  925. drivers/net/ethernet/mellanox/mlx5/core/en_common.c +13 −8
  926. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +1 −1
  927. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +3 −2
  928. drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_mcast.c +3 −0
  929. drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c +2 −0
  930. drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c +1 −1
  931. drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c +1 −1
  932. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c +12 −5
  933. drivers/net/ethernet/mellanox/mlx5/core/vport.c +21 −0
  934. drivers/net/ethernet/microchip/lan966x/lan966x_port.c +3 −2
  935. drivers/net/ethernet/netronome/nfp/flower/conntrack.c +43 −3
  936. drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +4 −0
  937. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +6 −0
  938. drivers/net/fjes/fjes_hw.c +30 −7
  939. drivers/net/hyperv/netvsc.c +4 −1
  940. drivers/net/hyperv/netvsc_drv.c +2 −2
  941. drivers/net/macsec.c +20 −5
  942. drivers/net/phy/mediatek-ge-soc.c +81 −66
  943. drivers/net/phy/micrel.c +11 −0
  944. drivers/net/tun.c +8 −2
  945. drivers/net/wireless/ath/ath11k/core.h +0 −4
  946. drivers/net/wireless/ath/ath11k/debugfs.c +10 −15
  947. drivers/net/wireless/ath/ath11k/debugfs.h +2 −10
  948. drivers/net/wireless/ath/ath11k/mac.c +1 −11
  949. drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +2 −2
  950. drivers/net/wireless/intersil/p54/fwio.c +1 −1
  951. drivers/net/xen-netback/netback.c +67 −39
  952. drivers/nvme/common/auth.c +1 −0
  953. drivers/nvme/common/keyring.c +1 −0
  954. drivers/nvme/host/apple.c +7 −6
  955. drivers/nvme/host/auth.c +9 −10
  956. drivers/nvme/host/constants.c +5 −5
  957. drivers/nvme/host/core.c +70 −15
  958. drivers/nvme/host/fabrics.c +12 −7
  959. drivers/nvme/host/fabrics.h +5 −3
  960. drivers/nvme/host/fc.c +14 −46
  961. drivers/nvme/host/multipath.c +8 −7
  962. drivers/nvme/host/nvme.h +43 −19
  963. drivers/nvme/host/pci.c +2 −1
  964. drivers/nvme/host/rdma.c +14 −9
  965. drivers/nvme/host/sysfs.c +61 −3
  966. drivers/nvme/host/tcp.c +6 −5
  967. drivers/nvme/target/core.c +3 −2
  968. drivers/nvme/target/discovery.c +1 −1
  969. drivers/nvme/target/fc.c +103 −83
  970. drivers/nvme/target/fcloop.c +4 −3
  971. drivers/nvme/target/loop.c +6 −3
  972. drivers/nvme/target/rdma.c +1 −0
  973. drivers/nvme/target/tcp.c +2 −0
  974. drivers/pci/bus.c +32 −17
  975. drivers/pci/controller/dwc/pcie-qcom.c +1 −1
  976. drivers/pci/pci.c +52 −26
  977. drivers/pci/pci.h +2 −2
  978. drivers/pci/pcie/aspm.c +9 −4
  979. drivers/phy/microchip/lan966x_serdes.c +2 −0
  980. drivers/phy/qualcomm/phy-qcom-qmp-usb.c +28 −2
  981. drivers/phy/renesas/phy-rcar-gen3-usb2.c +0 −4
  982. drivers/phy/ti/phy-omap-usb2.c +2 −2
  983. drivers/platform/mellanox/mlxbf-pmc.c +2 −2
  984. drivers/platform/mellanox/mlxbf-tmfifo.c +67 −0
  985. drivers/platform/x86/amd/pmf/Kconfig +1 −0
  986. drivers/platform/x86/amd/pmf/spc.c +36 −0
  987. drivers/platform/x86/amd/pmf/tee-if.c +3 −1
  988. drivers/platform/x86/intel/ifs/load.c +2 −1
  989. drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c +41 −41
  990. drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.h +16 −16
  991. drivers/platform/x86/intel/wmi/sbl-fw-update.c +2 −2
  992. drivers/platform/x86/p2sb.c +140 −42
  993. drivers/platform/x86/touchscreen_dmi.c +35 −0
  994. drivers/platform/x86/wmi.c +112 −69
  995. drivers/power/supply/qcom_battmgr.c +49 −60
  996. drivers/regulator/max5970-regulator.c +1 −1
  997. drivers/regulator/pwm-regulator.c +43 −0
  998. drivers/regulator/ti-abb-regulator.c +19 −3
  999. drivers/scsi/initio.c +1 −2
  1000. drivers/scsi/isci/request.c +1 −1
  1001. drivers/scsi/scsi_error.c +4 −4
  1002. drivers/scsi/scsi_lib.c +1 −1
  1003. drivers/scsi/scsi_priv.h +1 −1
  1004. drivers/scsi/storvsc_drv.c +7 −5
  1005. drivers/scsi/virtio_scsi.c +0 −2
  1006. drivers/soc/apple/mailbox.c +3 −3
  1007. drivers/spi/spi-bcm-qspi.c +2 −2
  1008. drivers/spi/spi-cadence.c +9 −8
  1009. drivers/spi/spi-cs42l43.c +4 −1
  1010. drivers/spi/spi-hisi-sfc-v3xx.c +5 −0
  1011. drivers/spi/spi-imx.c +2 −2
  1012. drivers/spi/spi-intel-pci.c +1 −1
  1013. drivers/spi/spi-sh-msiof.c +8 −8
  1014. drivers/spi/spi.c +4 −0
  1015. drivers/staging/sm750fb/Kconfig +0 −1
  1016. drivers/thermal/intel/intel_powerclamp.c +0 −32
  1017. drivers/tty/serial/8250/8250_pci1xxxx.c +2 −2
  1018. drivers/tty/serial/max310x.c +43 −10
  1019. drivers/tty/serial/serial_core.c +1 −1
  1020. drivers/usb/chipidea/ci.h +2 −0
  1021. drivers/usb/chipidea/core.c +24 −20
  1022. drivers/usb/common/ulpi.c +1 −1
  1023. drivers/usb/core/hub.c +32 −14
  1024. drivers/usb/dwc3/dwc3-pci.c +4 −0
  1025. drivers/usb/dwc3/gadget.c +2 −4
  1026. drivers/usb/dwc3/host.c +3 −1
  1027. drivers/usb/gadget/function/f_mass_storage.c +18 −2
  1028. drivers/usb/gadget/function/f_ncm.c +4 −4
  1029. drivers/usb/gadget/udc/pch_udc.c +0 −1
  1030. drivers/usb/host/xhci-mem.c +7 −7
  1031. drivers/usb/host/xhci-plat.c +3 −0
  1032. drivers/usb/host/xhci-ring.c +65 −15
  1033. drivers/usb/host/xhci.h +1 −0
  1034. drivers/usb/serial/cp210x.c +1 −0
  1035. drivers/usb/serial/option.c +1 −0
  1036. drivers/usb/serial/qcserial.c +2 −0
  1037. drivers/usb/typec/tcpm/tcpm.c +3 −3
  1038. drivers/usb/typec/ucsi/ucsi.c +2 −0
  1039. drivers/usb/typec/ucsi/ucsi_acpi.c +81 −7
  1040. drivers/video/Kconfig +5 −4
  1041. drivers/video/Makefile +5 −2
  1042. drivers/video/cmdline.c +2 −0
  1043. drivers/video/fbdev/Kconfig +0 −35
  1044. drivers/video/fbdev/core/Kconfig +1 −1
  1045. drivers/video/fbdev/core/fbcon.c +1 −2
  1046. drivers/video/fbdev/core/fbmem.c +0 −2
  1047. drivers/video/fbdev/efifb.c +77 −148
  1048. drivers/video/fbdev/geode/Kconfig +0 −3
  1049. drivers/video/fbdev/savage/savagefb_driver.c +3 −0
  1050. drivers/video/fbdev/simplefb.c +1 −1
  1051. drivers/video/fbdev/sis/sis_main.c +2 −0
  1052. drivers/video/fbdev/stifb.c +1 −1
  1053. drivers/video/fbdev/vesafb.c +47 −31
  1054. drivers/video/fbdev/vt8500lcdfb.c +0 −1
  1055. drivers/video/screen_info_generic.c +146 −0
  1056. drivers/video/screen_info_pci.c +136 −0
  1057. fs/afs/dir.c +22 −8
  1058. fs/afs/dynroot.c +0 −9
  1059. fs/afs/proc.c +3 −2
  1060. fs/bcachefs/alloc_background.c +1 −1
  1061. fs/bcachefs/btree_locking.c +2 −2
  1062. fs/bcachefs/debug.c +1 −1
  1063. fs/bcachefs/fs-io.c +1 −1
  1064. fs/bcachefs/fsck.c +12 −11
  1065. fs/bcachefs/journal.c +1 −1
  1066. fs/bcachefs/journal_io.c +2 −1
  1067. fs/bcachefs/str_hash.h +15 −7
  1068. fs/bcachefs/util.c +5 −5
  1069. fs/bcachefs/util.h +2 −2
  1070. fs/btrfs/compression.c +16 −7
  1071. fs/btrfs/compression.h +2 −2
  1072. fs/btrfs/extent-tree.c +39 −14
  1073. fs/btrfs/inode.c +13 −9
  1074. fs/btrfs/ioctl.c +7 −0
  1075. fs/btrfs/lzo.c +9 −25
  1076. fs/btrfs/ref-verify.c +4 −2
  1077. fs/btrfs/scrub.c +29 −7
  1078. fs/btrfs/send.c +2 −2
  1079. fs/btrfs/subpage.c +2 −1
  1080. fs/btrfs/super.c +8 −0
  1081. fs/btrfs/tree-checker.c +1 −1
  1082. fs/btrfs/volumes.c +0 −2
  1083. fs/btrfs/zlib.c +19 −54
  1084. fs/btrfs/zoned.c +2 −6
  1085. fs/cachefiles/ondemand.c +3 −0
  1086. fs/erofs/compress.h +2 −3
  1087. fs/erofs/decompressor.c +3 −2
  1088. fs/erofs/decompressor_deflate.c +13 −6
  1089. fs/erofs/decompressor_lzma.c +12 −5
  1090. fs/erofs/fscache.c +1 −1
  1091. fs/erofs/inode.c +1 −1
  1092. fs/erofs/utils.c +1 −1
  1093. fs/erofs/zdata.c +54 −44
  1094. fs/exec.c +31 −10
  1095. fs/exfat/inode.c +3 −4
  1096. fs/ext4/ext4.h +5 −3
  1097. fs/ext4/extents.c +78 −46
  1098. fs/ext4/file.c +1 −1
  1099. fs/ext4/indirect.c +1 −1
  1100. fs/ext4/inode.c +30 −60
  1101. fs/ext4/ioctl.c +1 −1
  1102. fs/ext4/mballoc.c +78 −62
  1103. fs/ext4/mballoc.h +0 −1
  1104. fs/ext4/move_extent.c +4 −6
  1105. fs/ext4/super.c +1 −1
  1106. fs/gfs2/dentry.c +9 −14
  1107. fs/gfs2/inode.c +4 −4
  1108. fs/hugetlbfs/inode.c +1 −1
  1109. fs/jfs/jfs_dmap.c +1 −7
  1110. fs/netfs/buffered_read.c +6 −6
  1111. fs/netfs/buffered_write.c +8 −7
  1112. fs/netfs/fscache_cache.c +2 −1
  1113. fs/netfs/io.c +1 −1
  1114. fs/netfs/misc.c +1 −1
  1115. fs/nfsd/nfs4state.c +15 −11
  1116. fs/overlayfs/namei.c +27 −16
  1117. fs/overlayfs/overlayfs.h +17 −6
  1118. fs/overlayfs/ovl_entry.h +3 −1
  1119. fs/overlayfs/readdir.c +4 −3
  1120. fs/overlayfs/super.c +15 −0
  1121. fs/overlayfs/util.c +31 −22
  1122. fs/smb/client/cached_dir.c +20 −4
  1123. fs/smb/client/cifsencrypt.c +1 −1
  1124. fs/smb/client/cifsfs.c +14 −3
  1125. fs/smb/client/cifsglob.h +17 −2
  1126. fs/smb/client/file.c +10 −9
  1127. fs/smb/client/inode.c +5 −3
  1128. fs/smb/client/readdir.c +1 −1
  1129. fs/smb/client/sess.c +6 −0
  1130. fs/smb/client/smb2inode.c +27 −6
  1131. fs/smb/client/smb2ops.c +127 −14
  1132. fs/smb/client/smb2pdu.c +256 −33
  1133. fs/smb/client/smb2proto.h +5 −0
  1134. fs/smb/client/smbencrypt.c +0 −7
  1135. fs/smb/client/transport.c +14 −4
  1136. fs/smb/server/ksmbd_netlink.h +2 −1
  1137. fs/smb/server/transport_ipc.c +2 −2
  1138. fs/smb/server/transport_tcp.c +2 −0
  1139. fs/tracefs/event_inode.c +162 −458
  1140. fs/tracefs/inode.c +22 −80
  1141. fs/tracefs/internal.h +19 −26
  1142. fs/xfs/libxfs/xfs_attr.c +3 −3
  1143. fs/xfs/libxfs/xfs_rtbitmap.c +0 −14
  1144. fs/xfs/libxfs/xfs_rtbitmap.h +0 −16
  1145. fs/xfs/libxfs/xfs_sb.c +14 −0
  1146. fs/xfs/libxfs/xfs_sb.h +2 −0
  1147. fs/xfs/libxfs/xfs_types.h +12 −0
  1148. fs/xfs/scrub/rtbitmap.c +1 −0
  1149. fs/xfs/scrub/rtsummary.c +1 −0
  1150. fs/xfs/xfs_super.c +17 −10
  1151. include/drm/display/drm_dp.h +1 −0
  1152. include/drm/display/drm_dp_helper.h +1 −2
  1153. include/drm/drm_atomic.h +59 −11
  1154. include/drm/drm_bridge.h +13 −12
  1155. include/drm/drm_edid.h +21 −25
  1156. include/drm/drm_exec.h +2 −2
  1157. include/drm/drm_fixed.h +1 −1
  1158. include/drm/drm_gpuvm.h +1 −1
  1159. include/drm/drm_managed.h +4 −0
  1160. include/drm/drm_modes.h +2 −0
  1161. include/drm/drm_print.h +119 −104
  1162. include/drm/drm_probe_helper.h +0 −1
  1163. include/drm/drm_rect.h +2 −2
  1164. include/drm/i915_pciids.h +3 −0
  1165. include/drm/ttm/ttm_placement.h +6 −4
  1166. include/drm/ttm/ttm_resource.h +2 −6
  1167. include/drm/ttm/ttm_tt.h +8 −1
  1168. include/linux/dmaengine.h +2 −1
  1169. include/linux/fb.h +0 −7
  1170. include/linux/hid_bpf.h +0 −11
  1171. include/linux/iosys-map.h +1 −1
  1172. include/linux/libata.h +1 −1
  1173. include/linux/lsm_hook_defs.h +2 −2
  1174. include/linux/mlx5/driver.h +1 −0
  1175. include/linux/mlx5/fs.h +1 −0
  1176. include/linux/mlx5/mlx5_ifc.h +8 −4
  1177. include/linux/mlx5/vport.h +1 −0
  1178. include/linux/mman.h +1 −0
  1179. include/linux/mmzone.h +3 −3
  1180. include/linux/netfilter/ipset/ip_set.h +4 −0
  1181. include/linux/nvme.h +2 −8
  1182. include/linux/pci.h +5 −0
  1183. include/linux/sched.h +1 −1
  1184. include/linux/screen_info.h +126 −0
  1185. include/linux/skmsg.h +0 −6
  1186. include/linux/spi/spi.h +1 −1
  1187. include/linux/syscalls.h +1 −0
  1188. include/linux/sysfb.h +4 −2
  1189. include/net/af_unix.h +14 −6
  1190. include/net/inet_connection_sock.h +8 −0
  1191. include/net/inet_sock.h +0 −5
  1192. include/net/ip.h +1 −1
  1193. include/net/llc_pdu.h +2 −4
  1194. include/net/netfilter/nf_tables.h +41 −10
  1195. include/net/sch_generic.h +4 −0
  1196. include/net/sock.h +17 −1
  1197. include/net/xdp_sock_drv.h +27 −0
  1198. include/sound/cs35l56.h +6 −1
  1199. include/sound/hdmi-codec.h +0 −1
  1200. include/trace/events/afs.h +25 −0
  1201. include/trace/events/ext4.h +4 −7
  1202. include/uapi/drm/amdgpu_drm.h +2 −0
  1203. include/uapi/drm/i915_drm.h +12 −0
  1204. include/uapi/drm/ivpu_accel.h +20 −5
  1205. include/uapi/drm/nouveau_drm.h +27 −29
  1206. include/uapi/drm/qaic_accel.h +1 −12
  1207. include/uapi/drm/vmwgfx_drm.h +4 −2
  1208. include/uapi/linux/btrfs.h +3 −0
  1209. include/uapi/linux/kfd_ioctl.h +2 −1
  1210. include/uapi/linux/serial.h +7 −6
  1211. include/uapi/linux/virtio_gpu.h +2 −0
  1212. include/video/cmdline.h +2 −6
  1213. init/Kconfig +12 −0
  1214. io_uring/io_uring.h +7 −1
  1215. io_uring/net.c +36 −14
  1216. io_uring/opdef.c +0 −1
  1217. io_uring/openclose.c +4 −0
  1218. io_uring/poll.c +28 −21
  1219. io_uring/poll.h +9 −0
  1220. io_uring/rw.c +9 −1
  1221. kernel/events/uprobes.c +1 −1
  1222. kernel/fork.c +1 −0
  1223. kernel/futex/core.c +12 −3
  1224. kernel/futex/pi.c +8 −3
  1225. kernel/irq/irqdesc.c +1 −1
  1226. kernel/rcu/tree.c +33 −1
  1227. kernel/rcu/tree_exp.h +1 −2
  1228. kernel/time/clocksource.c +24 −1
  1229. kernel/time/tick-sched.c +5 −0
  1230. kernel/trace/ring_buffer.c +1 −1
  1231. kernel/trace/trace_events_trigger.c +4 −2
  1232. kernel/trace/trace_osnoise.c +3 −3
  1233. kernel/trace/tracing_map.c +6 −1
  1234. lib/kunit/device.c +2 −2
  1235. lib/kunit/executor.c +4 −0
  1236. lib/kunit/kunit-test.c +1 −1
  1237. lib/kunit/test.c +11 −3
  1238. lib/stackdepot.c +263 −110
  1239. mm/huge_memory.c +14 −4
  1240. mm/memblock.c +3 −0
  1241. mm/memcontrol.c +25 −4
  1242. mm/memory-failure.c +1 −1
  1243. mm/memory.c +1 −1
  1244. mm/mmap.c +4 −2
  1245. mm/page-writeback.c +1 −1
  1246. mm/readahead.c +2 −2
  1247. mm/userfaultfd.c +13 −2
  1248. net/8021q/vlan_netlink.c +4 −0
  1249. net/batman-adv/multicast.c +3 −0
  1250. net/bridge/br_multicast.c +15 −5
  1251. net/bridge/br_private.h +2 −2
  1252. net/core/dev.c +9 −0
  1253. net/core/dev.h +3 −0
  1254. net/core/filter.c +38 −6
  1255. net/core/request_sock.c +0 −3
  1256. net/core/sock.c +9 −2
  1257. net/devlink/port.c +1 −1
  1258. net/hsr/hsr_device.c +2 −2
  1259. net/ipv4/af_inet.c +3 −0
  1260. net/ipv4/inet_connection_sock.c +4 −0
  1261. net/ipv4/ip_output.c +6 −6
  1262. net/ipv4/ip_sockglue.c +4 −2
  1263. net/ipv4/ipmr.c +1 −1
  1264. net/ipv4/raw.c +1 −1
  1265. net/ipv4/tcp.c +12 −1
  1266. net/ipv4/udp.c +1 −1
  1267. net/ipv6/addrconf_core.c +14 −7
  1268. net/ipv6/af_inet6.c +3 −0
  1269. net/ipv6/ip6_tunnel.c +18 −3
  1270. net/llc/af_llc.c +18 −8
  1271. net/llc/llc_core.c +0 −7
  1272. net/mac80211/Kconfig +0 −1
  1273. net/mac80211/sta_info.c +6 −1
  1274. net/mac80211/tx.c +1 −1
  1275. net/mptcp/protocol.c +0 −3
  1276. net/netfilter/ipset/ip_set_bitmap_gen.h +11 −3
  1277. net/netfilter/ipset/ip_set_core.c +28 −9
  1278. net/netfilter/ipset/ip_set_hash_gen.h +12 −3
  1279. net/netfilter/ipset/ip_set_list_set.c +10 −3
  1280. net/netfilter/nf_conntrack_proto_sctp.c +1 −1
  1281. net/netfilter/nf_conntrack_proto_tcp.c +6 −4
  1282. net/netfilter/nf_log.c +4 −3
  1283. net/netfilter/nf_tables_api.c +19 −15
  1284. net/netfilter/nft_chain_filter.c +9 −2
  1285. net/netfilter/nft_compat.c +12 −0
  1286. net/netfilter/nft_ct.c +24 −0
  1287. net/netfilter/nft_flow_offload.c +5 −0
  1288. net/netfilter/nft_limit.c +16 −7
  1289. net/netfilter/nft_nat.c +5 −0
  1290. net/netfilter/nft_rt.c +5 −0
  1291. net/netfilter/nft_socket.c +5 −0
  1292. net/netfilter/nft_synproxy.c +5 −2
  1293. net/netfilter/nft_tproxy.c +5 −0
  1294. net/netfilter/nft_tunnel.c +1 −0
  1295. net/netfilter/nft_xfrm.c +5 −0
  1296. net/netlink/af_netlink.c +1 −1
  1297. net/nfc/nci/core.c +4 −0
  1298. net/rds/af_rds.c +1 −1
  1299. net/sched/cls_api.c +8 −1
  1300. net/sched/cls_flower.c +23 −0
  1301. net/smc/smc_core.c +9 −3
  1302. net/smc/smc_diag.c +1 −1
  1303. net/sunrpc/svc.c +2 −2
  1304. net/sunrpc/svcsock.c +2 −2
  1305. net/unix/af_unix.c +6 −8
  1306. net/unix/diag.c +1 −1
  1307. net/wireless/Kconfig +0 −1
  1308. net/wireless/nl80211.c +1 −0
  1309. net/xdp/xsk.c +8 −4
  1310. net/xdp/xsk_buff_pool.c +1 −0
  1311. samples/cgroup/.gitignore +3 −0
  1312. scripts/Makefile.defconf +4 −4
  1313. scripts/Makefile.extrawarn +0 −2
  1314. scripts/kconfig/symbol.c +3 −1
  1315. scripts/mod/modpost.c +3 −12
  1316. scripts/mod/modpost.h +1 −5
  1317. scripts/package/kernel.spec +11 −11
  1318. security/apparmor/lsm.c +3 −1
  1319. security/keys/encrypted-keys/encrypted.c +0 −4
  1320. security/security.c +40 −5
  1321. security/tomoyo/tomoyo.c +2 −1
  1322. sound/core/pcm.c +4 −0
  1323. sound/pci/hda/cs35l41_hda_property.c +4 −0
  1324. sound/pci/hda/cs35l56_hda.c +77 −59
  1325. sound/pci/hda/hda_intel.c +4 −2
  1326. sound/pci/hda/patch_cs8409.c +1 −0
  1327. sound/pci/hda/patch_realtek.c +13 −3
  1328. sound/soc/amd/acp/acp-mach-common.c +14 −2
  1329. sound/soc/amd/acp/acp-sof-mach.c +4 −0
  1330. sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c +8 −0
  1331. sound/soc/amd/yc/acp6x-mach.c +7 −0
  1332. sound/soc/codecs/cs35l56-shared.c +122 −18
  1333. sound/soc/codecs/cs35l56.c +256 −45
  1334. sound/soc/codecs/cs35l56.h +2 −0
  1335. sound/soc/codecs/es8326.c +139 −47
  1336. sound/soc/codecs/es8326.h +2 −1
  1337. sound/soc/codecs/lpass-wsa-macro.c +0 −7
  1338. sound/soc/codecs/wcd9335.c +0 −4
  1339. sound/soc/codecs/wcd934x.c +0 −1
  1340. sound/soc/codecs/wcd938x.c +3 −5
  1341. sound/soc/codecs/wm_adsp.c +31 −42
  1342. sound/soc/codecs/wsa883x.c +5 −1
  1343. sound/soc/qcom/sc8280xp.c +7 −5
  1344. sound/soc/soc-core.c +4 −1
  1345. sound/soc/sunxi/sun4i-spdif.c +5 −0
  1346. sound/usb/clock.c +32 −2
  1347. sound/usb/format.c +20 −0
  1348. sound/usb/midi2.c +1 −1
  1349. sound/usb/quirks.c +22 −16
  1350. sound/virtio/virtio_card.c +0 −2
  1351. sound/virtio/virtio_ctl_msg.c +0 −2
  1352. sound/virtio/virtio_pcm_msg.c +0 −2
  1353. tools/arch/x86/include/asm/cpufeatures.h +7 −1
  1354. tools/arch/x86/include/asm/msr-index.h +8 −0
  1355. tools/arch/x86/include/uapi/asm/kvm.h +3 −0
  1356. tools/arch/x86/lib/memcpy_64.S +2 −2
  1357. tools/arch/x86/lib/memset_64.S +2 −2
  1358. tools/include/asm-generic/unaligned.h +12 −12
  1359. tools/include/uapi/asm-generic/unistd.h +14 −1
  1360. tools/include/uapi/drm/drm.h +71 −1
  1361. tools/include/uapi/drm/i915_drm.h +6 −6
  1362. tools/include/uapi/linux/fcntl.h +3 −0
  1363. tools/include/uapi/linux/kvm.h +50 −90
  1364. tools/include/uapi/linux/mount.h +70 −0
  1365. tools/include/uapi/linux/stat.h +1 −0
  1366. tools/perf/Documentation/perf-list.txt +4 −0
  1367. tools/perf/Makefile.perf +10 −0
  1368. tools/perf/builtin-list.c +129 −82
  1369. tools/perf/builtin-record.c +2 −2
  1370. tools/perf/builtin-top.c +1 −1
  1371. tools/perf/pmu-events/arch/x86/alderlake/adl-metrics.json +118 −136
  1372. tools/perf/pmu-events/arch/x86/alderlaken/adln-metrics.json +0 −4
  1373. tools/perf/pmu-events/arch/x86/sapphirerapids/spr-metrics.json +5 −20
  1374. tools/perf/tests/shell/daemon.sh +24 −10
  1375. tools/perf/tests/shell/list.sh +18 −3
  1376. tools/perf/tests/shell/script.sh +9 −3
  1377. tools/perf/trace/beauty/statx.c +1 −0
  1378. tools/perf/util/evlist.c +8 −1
  1379. tools/perf/util/hist.c +2 −2
  1380. tools/perf/util/include/linux/linkage.h +4 −0
  1381. tools/perf/util/metricgroup.c +1 −1
  1382. tools/perf/util/print-events.c +1 −1
  1383. tools/perf/util/synthetic-events.c +2 −2
  1384. tools/power/cpupower/bench/Makefile +1 −1
  1385. tools/testing/cxl/Kbuild +2 −0
  1386. tools/testing/cxl/test/Kbuild +2 −0
  1387. tools/testing/nvdimm/Kbuild +2 −0
  1388. tools/testing/selftests/drivers/net/bonding/bond_options.sh +4 −4
  1389. tools/testing/selftests/drivers/net/bonding/lag_lib.sh +11 −0
  1390. tools/testing/selftests/drivers/net/bonding/settings +1 −1
  1391. tools/testing/selftests/drivers/net/netdevsim/udp_tunnel_nic.sh +9 −0
  1392. tools/testing/selftests/drivers/net/team/config +3 −1
  1393. tools/testing/selftests/hid/tests/test_wacom_generic.py +4 −4
  1394. tools/testing/selftests/livepatch/functions.sh +17 −20
  1395. tools/testing/selftests/mm/charge_reserved_hugetlb.sh +1 −1
  1396. tools/testing/selftests/mm/ksm_tests.c +1 −1
  1397. tools/testing/selftests/mm/map_hugetlb.c +7 −0
  1398. tools/testing/selftests/mm/mremap_test.c +14 −13
  1399. tools/testing/selftests/mm/va_high_addr_switch.sh +6 −0
  1400. tools/testing/selftests/mm/write_hugetlb_memory.sh +1 −1
  1401. tools/testing/selftests/net/Makefile +5 −4
  1402. tools/testing/selftests/net/config +44 −0
  1403. tools/testing/selftests/net/forwarding/Makefile +1 −1
  1404. tools/testing/selftests/net/lib.sh +4 −1
  1405. tools/testing/selftests/net/mptcp/config +3 −0
  1406. tools/testing/selftests/net/mptcp/mptcp_join.sh +11 −16
  1407. tools/testing/selftests/net/mptcp/mptcp_lib.sh +1 −1
  1408. tools/testing/selftests/net/mptcp/settings +1 −1
  1409. tools/testing/selftests/net/mptcp/simult_flows.sh +4 −4
  1410. tools/testing/selftests/net/net_helper.sh +0 −0
  1411. tools/testing/selftests/net/pmtu.sh +9 −9
  1412. tools/testing/selftests/net/rps_default_mask.sh +5 −1
  1413. tools/testing/selftests/net/setup_loopback.sh +0 −0
  1414. tools/testing/selftests/net/setup_veth.sh +1 −1
  1415. tools/testing/selftests/net/so_incoming_cpu.c +50 −18
  1416. tools/testing/selftests/net/tcp_ao/config +10 −0
  1417. tools/testing/selftests/net/tcp_ao/key-management.c +26 −20
  1418. tools/testing/selftests/net/tcp_ao/lib/sock.c +8 −4
  1419. tools/testing/selftests/net/tcp_ao/rst.c +90 −48
  1420. tools/testing/selftests/net/tcp_ao/settings +1 −0
  1421. tools/testing/selftests/net/udpgro.sh +2 −2
  1422. tools/testing/selftests/net/udpgro_bench.sh +2 −2
  1423. tools/testing/selftests/net/udpgro_frglist.sh +3 −3
  1424. tools/testing/selftests/net/udpgro_fwd.sh +5 −3
  1425. tools/testing/selftests/net/veth.sh +2 −2
  1426. tools/testing/selftests/net/xdp_dummy.c +13 −0
  1427. tools/testing/selftests/rseq/basic_percpu_ops_test.c +12 −2
  1428. tools/testing/selftests/rseq/param_test.c +16 −6
  1429. tools/testing/selftests/seccomp/seccomp_benchmark.c +64 −40
CREDITS+13−0
@@ -2161,6 +2161,19 @@ N: Mike Kravetz · 2160 unmodified lines
21612161 E: mike.kravetz@oracle.com
21622162 D: Maintenance and development of the hugetlb subsystem
21632163
2164+N: Seth Jennings
2165+E: sjenning@redhat.com
2166+D: Creation and maintenance of zswap
2167+
2168+N: Dan Streetman
2169+E: ddstreet@ieee.org
2170+D: Maintenance and development of zswap
2171+D: Creation and maintenance of the zpool API
2172+
2173+N: Vitaly Wool
2174+E: vitaly.wool@konsulko.com
2175+D: Maintenance and development of zswap
2176+
21642177 N: Andreas S. Krebs
21652178 E: akrebs@altavista.net
21662179 D: CYPRESS CY82C693 chipset IDE, Digital's PC-Alpha 164SX boards
Documentation/ABI/testing/sysfs-class-net-queues+11−11
@@ -1,4 +1,4 @@
1−What: /sys/class/<iface>/queues/rx-<queue>/rps_cpus
1+What: /sys/class/net/<iface>/queues/rx-<queue>/rps_cpus
22 Date: March 2010
33 KernelVersion: 2.6.35
44 Contact: netdev@vger.kernel.org
@@ -8,7 +8,7 @@ Description: · 3 unmodified lines
88 network device queue. Possible values depend on the number
99 of available CPU(s) in the system.
1010
11−What: /sys/class/<iface>/queues/rx-<queue>/rps_flow_cnt
11+What: /sys/class/net/<iface>/queues/rx-<queue>/rps_flow_cnt
1212 Date: April 2010
1313 KernelVersion: 2.6.35
1414 Contact: netdev@vger.kernel.org
@@ -16,7 +16,7 @@ Description: · 1 unmodified line
1616 Number of Receive Packet Steering flows being currently
1717 processed by this particular network device receive queue.
1818
19−What: /sys/class/<iface>/queues/tx-<queue>/tx_timeout
19+What: /sys/class/net/<iface>/queues/tx-<queue>/tx_timeout
2020 Date: November 2011
2121 KernelVersion: 3.3
2222 Contact: netdev@vger.kernel.org
@@ -24,7 +24,7 @@ Description: · 1 unmodified line
2424 Indicates the number of transmit timeout events seen by this
2525 network interface transmit queue.
2626
27−What: /sys/class/<iface>/queues/tx-<queue>/tx_maxrate
27+What: /sys/class/net/<iface>/queues/tx-<queue>/tx_maxrate
2828 Date: March 2015
2929 KernelVersion: 4.1
3030 Contact: netdev@vger.kernel.org
@@ -32,7 +32,7 @@ Description: · 1 unmodified line
3232 A Mbps max-rate set for the queue, a value of zero means disabled,
3333 default is disabled.
3434
35−What: /sys/class/<iface>/queues/tx-<queue>/xps_cpus
35+What: /sys/class/net/<iface>/queues/tx-<queue>/xps_cpus
3636 Date: November 2010
3737 KernelVersion: 2.6.38
3838 Contact: netdev@vger.kernel.org
@@ -42,7 +42,7 @@ Description: · 3 unmodified lines
4242 network device transmit queue. Possible values depend on the
4343 number of available CPU(s) in the system.
4444
45−What: /sys/class/<iface>/queues/tx-<queue>/xps_rxqs
45+What: /sys/class/net/<iface>/queues/tx-<queue>/xps_rxqs
4646 Date: June 2018
4747 KernelVersion: 4.18.0
4848 Contact: netdev@vger.kernel.org
@@ -53,7 +53,7 @@ Description: · 4 unmodified lines
5353 number of available receive queue(s) in the network device.
5454 Default is disabled.
5555
56−What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/hold_time
56+What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/hold_time
5757 Date: November 2011
5858 KernelVersion: 3.3
5959 Contact: netdev@vger.kernel.org
@@ -62,7 +62,7 @@ Description: · 2 unmodified lines
6262 of this particular network device transmit queue.
6363 Default value is 1000.
6464
65−What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/inflight
65+What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/inflight
6666 Date: November 2011
6767 KernelVersion: 3.3
6868 Contact: netdev@vger.kernel.org
@@ -70,7 +70,7 @@ Description: · 1 unmodified line
7070 Indicates the number of bytes (objects) in flight on this
7171 network device transmit queue.
7272
73−What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/limit
73+What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/limit
7474 Date: November 2011
7575 KernelVersion: 3.3
7676 Contact: netdev@vger.kernel.org
@@ -79,7 +79,7 @@ Description: · 2 unmodified lines
7979 on this network device transmit queue. This value is clamped
8080 to be within the bounds defined by limit_max and limit_min.
8181
82−What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/limit_max
82+What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/limit_max
8383 Date: November 2011
8484 KernelVersion: 3.3
8585 Contact: netdev@vger.kernel.org
@@ -88,7 +88,7 @@ Description: · 2 unmodified lines
8888 queued on this network device transmit queue. See
8989 include/linux/dynamic_queue_limits.h for the default value.
9090
91−What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/limit_min
91+What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/limit_min
9292 Date: November 2011
9393 KernelVersion: 3.3
9494 Contact: netdev@vger.kernel.org
Documentation/ABI/testing/sysfs-platform-silicom+1−0
@@ -10,6 +10,7 @@ What: /sys/devices/platform/silicom-platform/power_cycle · 9 unmodified lines
1010 Date: November 2023
1111 KernelVersion: 6.7
1212 Contact: Henry Shi <henrys@silicom-usa.com>
13+Description:
1314 This file allow user to power cycle the platform.
1415 Default value is 0; when set to 1, it powers down
1516 the platform, waits 5 seconds, then powers on the
Documentation/accel/introduction.rst+2−2
@@ -101,8 +101,8 @@ External References · 100 unmodified lines
101101 email threads
102102 -------------
103103
104−* `Initial discussion on the New subsystem for acceleration devices <https://lkml.org/lkml/2022/7/31/83>`_ - Oded Gabbay (2022)
105−* `patch-set to add the new subsystem <https://lkml.org/lkml/2022/10/22/544>`_ - Oded Gabbay (2022)
104+* `Initial discussion on the New subsystem for acceleration devices <https://lore.kernel.org/lkml/CAFCwf11=9qpNAepL7NL+YAV_QO=Wv6pnWPhKHKAepK3fNn+2Dg@mail.gmail.com/>`_ - Oded Gabbay (2022)
105+* `patch-set to add the new subsystem <https://lore.kernel.org/lkml/20221022214622.18042-1-ogabbay@kernel.org/>`_ - Oded Gabbay (2022)
106106
107107 Conference talks
108108 ----------------
Documentation/admin-guide/kernel-parameters.rst+0−5
@@ -218,8 +218,3 @@ bytes respectively. Such letter suffixes can also be entirely omitted: · 217 unmodified lines
218218
219219 .. include:: kernel-parameters.txt
220220 :literal:
221−
222−Todo
223−----
224−
225− Add more DRM drivers.
Documentation/admin-guide/kernel-per-CPU-kthreads.rst+6−10
@@ -243,13 +243,9 @@ To reduce its OS jitter, do any of the following: · 242 unmodified lines
243243 3. Do any of the following needed to avoid jitter that your
244244 application cannot tolerate:
245245
246− a. Build your kernel with CONFIG_SLUB=y rather than
247− CONFIG_SLAB=y, thus avoiding the slab allocator's periodic
248− use of each CPU's workqueues to run its cache_reap()
249− function.
250− b. Avoid using oprofile, thus avoiding OS jitter from
246+ a. Avoid using oprofile, thus avoiding OS jitter from
251247 wq_sync_buffer().
252− c. Limit your CPU frequency so that a CPU-frequency
248+ b. Limit your CPU frequency so that a CPU-frequency
253249 governor is not required, possibly enlisting the aid of
254250 special heatsinks or other cooling technologies. If done
255251 correctly, and if you CPU architecture permits, you should
@@ -259,7 +255,7 @@ To reduce its OS jitter, do any of the following: · 3 unmodified lines
259255
260256 WARNING: Please check your CPU specifications to
261257 make sure that this is safe on your particular system.
262− d. As of v3.18, Christoph Lameter's on-demand vmstat workers
258+ c. As of v3.18, Christoph Lameter's on-demand vmstat workers
263259 commit prevents OS jitter due to vmstat_update() on
264260 CONFIG_SMP=y systems. Before v3.18, is not possible
265261 to entirely get rid of the OS jitter, but you can
@@ -274,7 +270,7 @@ To reduce its OS jitter, do any of the following: · 8 unmodified lines
274270 (based on an earlier one from Gilad Ben-Yossef) that
275271 reduces or even eliminates vmstat overhead for some
276272 workloads at https://lore.kernel.org/r/00000140e9dfd6bd-40db3d4f-c1be-434f-8132-7820f81bb586-000000@email.amazonses.com.
277− e. If running on high-end powerpc servers, build with
273+ d. If running on high-end powerpc servers, build with
278274 CONFIG_PPC_RTAS_DAEMON=n. This prevents the RTAS
279275 daemon from running on each CPU every second or so.
280276 (This will require editing Kconfig files and will defeat
@@ -282,12 +278,12 @@ To reduce its OS jitter, do any of the following: · 1 unmodified line
282278 due to the rtas_event_scan() function.
283279 WARNING: Please check your CPU specifications to
284280 make sure that this is safe on your particular system.
285− f. If running on Cell Processor, build your kernel with
281+ e. If running on Cell Processor, build your kernel with
286282 CBE_CPUFREQ_SPU_GOVERNOR=n to avoid OS jitter from
287283 spu_gov_work().
288284 WARNING: Please check your CPU specifications to
289285 make sure that this is safe on your particular system.
290− g. If running on PowerMAC, build your kernel with
286+ f. If running on PowerMAC, build your kernel with
291287 CONFIG_PMAC_RACKMETER=n to disable the CPU-meter,
292288 avoiding OS jitter from rackmeter_do_timer().
293289
Documentation/dev-tools/kunit/usage.rst+17−2
@@ -671,8 +671,23 @@ Testing Static Functions · 670 unmodified lines
671671 ------------------------
672672
673673 If we do not want to expose functions or variables for testing, one option is to
674−conditionally ``#include`` the test file at the end of your .c file. For
675−example:
674+conditionally export the used symbol. For example:
675+
676+.. code-block:: c
677+
678+ /* In my_file.c */
679+
680+ VISIBLE_IF_KUNIT int do_interesting_thing();
681+ EXPORT_SYMBOL_IF_KUNIT(do_interesting_thing);
682+
683+ /* In my_file.h */
684+
685+ #if IS_ENABLED(CONFIG_KUNIT)
686+ int do_interesting_thing(void);
687+ #endif
688+
689+Alternatively, you could conditionally ``#include`` the test file at the end of
690+your .c file. For example:
676691
677692 .. code-block:: c
678693
Documentation/devicetree/bindings/display/bridge/fsl,imx8mp-hdmi-tx.yaml+102−0
@@ -0,0 +1,102 @@
1+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/display/bridge/fsl,imx8mp-hdmi-tx.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: Freescale i.MX8MP DWC HDMI TX Encoder
8+
9+maintainers:
10+ - Lucas Stach <l.stach@pengutronix.de>
11+
12+description:
13+ The i.MX8MP HDMI transmitter is a Synopsys DesignWare
14+ HDMI 2.0a TX controller IP.
15+
16+allOf:
17+ - $ref: /schemas/display/bridge/synopsys,dw-hdmi.yaml#
18+
19+properties:
20+ compatible:
21+ enum:
22+ - fsl,imx8mp-hdmi-tx
23+
24+ reg-io-width:
25+ const: 1
26+
27+ clocks:
28+ maxItems: 4
29+
30+ clock-names:
31+ items:
32+ - const: iahb
33+ - const: isfr
34+ - const: cec
35+ - const: pix
36+
37+ power-domains:
38+ maxItems: 1
39+
40+ ports:
41+ $ref: /schemas/graph.yaml#/properties/ports
42+
43+ properties:
44+ port@0:
45+ $ref: /schemas/graph.yaml#/properties/port
46+ description: Parallel RGB input port
47+
48+ port@1:
49+ $ref: /schemas/graph.yaml#/properties/port
50+ description: HDMI output port
51+
52+ required:
53+ - port@0
54+ - port@1
55+
56+required:
57+ - compatible
58+ - reg
59+ - clocks
60+ - clock-names
61+ - interrupts
62+ - power-domains
63+ - ports
64+
65+unevaluatedProperties: false
66+
67+examples:
68+ - |
69+ #include <dt-bindings/clock/imx8mp-clock.h>
70+ #include <dt-bindings/interrupt-controller/irq.h>
71+ #include <dt-bindings/power/imx8mp-power.h>
72+
73+ hdmi@32fd8000 {
74+ compatible = "fsl,imx8mp-hdmi-tx";
75+ reg = <0x32fd8000 0x7eff>;
76+ interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
77+ clocks = <&clk IMX8MP_CLK_HDMI_APB>,
78+ <&clk IMX8MP_CLK_HDMI_REF_266M>,
79+ <&clk IMX8MP_CLK_32K>,
80+ <&hdmi_tx_phy>;
81+ clock-names = "iahb", "isfr", "cec", "pix";
82+ power-domains = <&hdmi_blk_ctrl IMX8MP_HDMIBLK_PD_HDMI_TX>;
83+ reg-io-width = <1>;
84+ ports {
85+ #address-cells = <1>;
86+ #size-cells = <0>;
87+ port@0 {
88+ reg = <0>;
89+
90+ hdmi_tx_from_pvi: endpoint {
91+ remote-endpoint = <&pvi_to_hdmi_tx>;
92+ };
93+ };
94+
95+ port@1 {
96+ reg = <1>;
97+ hdmi_tx_out: endpoint {
98+ remote-endpoint = <&hdmi0_con>;
99+ };
100+ };
101+ };
102+ };
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml+1−1
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines
77 title: SN65DSI86 DSI to eDP bridge chip
88
99 maintainers:
10− - Sandeep Panda <spanda@codeaurora.org>
10+ - Douglas Anderson <dianders@chromium.org>
1111
1212 description: |
1313 The Texas Instruments SN65DSI86 bridge takes MIPI DSI in and outputs eDP.
Documentation/devicetree/bindings/display/imx/fsl,imx8mp-hdmi-pvi.yaml+84−0
@@ -0,0 +1,84 @@
1+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/display/imx/fsl,imx8mp-hdmi-pvi.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: Freescale i.MX8MP HDMI Parallel Video Interface
8+
9+maintainers:
10+ - Lucas Stach <l.stach@pengutronix.de>
11+
12+description:
13+ The HDMI parallel video interface is a timing and sync generator block in the
14+ i.MX8MP SoC, that sits between the video source and the HDMI TX controller.
15+
16+properties:
17+ compatible:
18+ const: fsl,imx8mp-hdmi-pvi
19+
20+ reg:
21+ maxItems: 1
22+
23+ interrupts:
24+ maxItems: 1
25+
26+ power-domains:
27+ maxItems: 1
28+
29+ ports:
30+ $ref: /schemas/graph.yaml#/properties/ports
31+
32+ properties:
33+ port@0:
34+ $ref: /schemas/graph.yaml#/properties/port
35+ description: Input from the LCDIF controller.
36+
37+ port@1:
38+ $ref: /schemas/graph.yaml#/properties/port
39+ description: Output to the HDMI TX controller.
40+
41+ required:
42+ - port@0
43+ - port@1
44+
45+required:
46+ - compatible
47+ - reg
48+ - interrupts
49+ - power-domains
50+ - ports
51+
52+additionalProperties: false
53+
54+examples:
55+ - |
56+ #include <dt-bindings/interrupt-controller/irq.h>
57+ #include <dt-bindings/power/imx8mp-power.h>
58+
59+ display-bridge@32fc4000 {
60+ compatible = "fsl,imx8mp-hdmi-pvi";
61+ reg = <0x32fc4000 0x44>;
62+ interrupt-parent = <&irqsteer_hdmi>;
63+ interrupts = <12 IRQ_TYPE_LEVEL_HIGH>;
64+ power-domains = <&hdmi_blk_ctrl IMX8MP_HDMIBLK_PD_PVI>;
65+
66+ ports {
67+ #address-cells = <1>;
68+ #size-cells = <0>;
69+
70+ port@0 {
71+ reg = <0>;
72+ pvi_from_lcdif3: endpoint {
73+ remote-endpoint = <&lcdif3_to_pvi>;
74+ };
75+ };
76+
77+ port@1 {
78+ reg = <1>;
79+ pvi_to_hdmi_tx: endpoint {
80+ remote-endpoint = <&hdmi_tx_from_pvi>;
81+ };
82+ };
83+ };
84+ };
Documentation/devicetree/bindings/display/panel/boe,th101mb31ig002-28a.yaml+58−0
@@ -0,0 +1,58 @@
1+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/display/panel/boe,th101mb31ig002-28a.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: BOE TH101MB31IG002-28A WXGA DSI Display Panel
8+
9+maintainers:
10+ - Manuel Traut <manut@mecka.net>
11+
12+allOf:
13+ - $ref: panel-common.yaml#
14+
15+properties:
16+ compatible:
17+ enum:
18+ # BOE TH101MB31IG002-28A 10.1" WXGA TFT LCD panel
19+ - boe,th101mb31ig002-28a
20+
21+ reg: true
22+ backlight: true
23+ enable-gpios: true
24+ power-supply: true
25+ port: true
26+ rotation: true
27+
28+required:
29+ - compatible
30+ - reg
31+ - enable-gpios
32+ - power-supply
33+
34+additionalProperties: false
35+
36+examples:
37+ - |
38+ #include <dt-bindings/gpio/gpio.h>
39+
40+ dsi {
41+ #address-cells = <1>;
42+ #size-cells = <0>;
43+ panel@0 {
44+ compatible = "boe,th101mb31ig002-28a";
45+ reg = <0>;
46+ backlight = <&backlight_lcd0>;
47+ enable-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
48+ rotation = <90>;
49+ power-supply = <&vcc_3v3>;
50+ port {
51+ panel_in_dsi: endpoint {
52+ remote-endpoint = <&dsi_out_con>;
53+ };
54+ };
55+ };
56+ };
57+
58+...
Documentation/devicetree/bindings/display/panel/novatek,nt35510.yaml+3−1
@@ -15,7 +15,9 @@ allOf: · 14 unmodified lines
1515 properties:
1616 compatible:
1717 items:
18− - const: hydis,hva40wv1
18+ - enum:
19+ - frida,frd400b25025
20+ - hydis,hva40wv1
1921 - const: novatek,nt35510
2022 description: This indicates the panel manufacturer of the panel
2123 that is in turn using the NT35510 panel driver. The compatible
Documentation/devicetree/bindings/display/panel/novatek,nt36672e.yaml+66−0
@@ -0,0 +1,66 @@
1+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/display/panel/novatek,nt36672e.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: Novatek NT36672E LCD DSI Panel
8+
9+maintainers:
10+ - Ritesh Kumar <quic_riteshk@quicinc.com>
11+
12+allOf:
13+ - $ref: panel-common.yaml#
14+
15+properties:
16+ compatible:
17+ const: novatek,nt36672e
18+
19+ reg:
20+ maxItems: 1
21+ description: DSI virtual channel
22+
23+ vddi-supply: true
24+ avdd-supply: true
25+ avee-supply: true
26+ port: true
27+ reset-gpios: true
28+ backlight: true
29+
30+required:
31+ - compatible
32+ - reg
33+ - vddi-supply
34+ - avdd-supply
35+ - avee-supply
36+ - reset-gpios
37+ - port
38+
39+additionalProperties: false
40+
41+examples:
42+ - |
43+ #include <dt-bindings/gpio/gpio.h>
44+ dsi {
45+ #address-cells = <1>;
46+ #size-cells = <0>;
47+ panel@0 {
48+ compatible = "novatek,nt36672e";
49+ reg = <0>;
50+
51+ reset-gpios = <&tlmm 44 GPIO_ACTIVE_HIGH>;
52+
53+ vddi-supply = <&vreg_l8c_1p8>;
54+ avdd-supply = <&disp_avdd>;
55+ avee-supply = <&disp_avee>;
56+
57+ backlight = <&pwm_backlight>;
58+
59+ port {
60+ panel0_in: endpoint {
61+ remote-endpoint = <&dsi0_out>;
62+ };
63+ };
64+ };
65+ };
66+...
Documentation/devicetree/bindings/display/panel/panel-lvds.yaml+2−0
@@ -42,6 +42,8 @@ properties: · 41 unmodified lines
4242 - auo,b101ew05
4343 # Chunghwa Picture Tubes Ltd. 7" WXGA (800x1280) TFT LCD LVDS panel
4444 - chunghwa,claa070wp03xg
45+ # EDT ETML0700Z9NDHA 7.0" WSVGA (1024x600) color TFT LCD LVDS panel
46+ - edt,etml0700z9ndha
4547 # HannStar Display Corp. HSD101PWW2 10.1" WXGA (1280x800) LVDS panel
4648 - hannstar,hsd101pww2
4749 # Hydis Technologies 7" WXGA (800x1280) TFT LCD LVDS panel
Documentation/devicetree/bindings/display/panel/panel-simple.yaml+2−0
@@ -141,6 +141,8 @@ properties: · 140 unmodified lines
141141 - edt,etm0700g0edh6
142142 # Emerging Display Technology Corp. LVDS WSVGA TFT Display with capacitive touch
143143 - edt,etml0700y5dha
144+ # Emerging Display Technology Corp. 10.1" LVDS WXGA TFT Display with capacitive touch
145+ - edt,etml1010g3dra
144146 # Emerging Display Technology Corp. 5.7" VGA TFT LCD panel with
145147 # capacitive touch
146148 - edt,etmv570g2dhu
Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml+3−0
@@ -22,6 +22,8 @@ properties: · 21 unmodified lines
2222 enum:
2323 # Anberic RG353V-V2 5.0" 640x480 TFT LCD panel
2424 - anbernic,rg353v-panel-v2
25+ # Powkiddy RGB10MAX3 5.0" 720x1280 TFT LCD panel
26+ - powkiddy,rgb10max3-panel
2527 # Powkiddy RGB30 3.0" 720x720 TFT LCD panel
2628 - powkiddy,rgb30-panel
2729 # Rocktech JH057N00900 5.5" 720x1440 TFT LCD panel
@@ -43,6 +45,7 @@ properties: · 15 unmodified lines
4345 reset-gpios: true
4446
4547 backlight: true
48+ rotation: true
4649
4750 required:
4851 - compatible
Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml+2−1
@@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines
77 title: Visionox model RM69299 Panels
88
99 maintainers:
10− - Harigovindan P <harigovi@codeaurora.org>
10+ - Abhinav Kumar <quic_abhinavk@quicinc.com>
11+ - Jessica Zhang <quic_jesszhan@quicinc.com>
1112
1213 description: |
1314 This binding is for display panels using a Visionox RM692999 panel.
Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml+27−6
@@ -94,11 +94,14 @@ properties: · 93 unmodified lines
9494 - const: default
9595 - const: unwedge
9696
97+ power-domains:
98+ maxItems: 1
99+
97100 ports:
98101 $ref: /schemas/graph.yaml#/properties/ports
99102
100− patternProperties:
101− "^port(@0)?$":
103+ properties:
104+ port@0:
102105 $ref: /schemas/graph.yaml#/properties/port
103106 description: Input of the DWC HDMI TX
104107 properties:
@@ -108,11 +111,14 @@ properties: · 3 unmodified lines
108111 description: Connection to the VOPB
109112 endpoint@1:
110113 description: Connection to the VOPL
111− properties:
112114 port@1:
113115 $ref: /schemas/graph.yaml#/properties/port
114116 description: Output of the DWC HDMI TX
115117
118+ required:
119+ - port@0
120+ - port@1
121+
116122 rockchip,grf:
117123 $ref: /schemas/types.yaml#/definitions/phandle
118124 description:
@@ -135,19 +141,25 @@ examples: · 16 unmodified lines
135141 #include <dt-bindings/clock/rk3288-cru.h>
136142 #include <dt-bindings/interrupt-controller/arm-gic.h>
137143 #include <dt-bindings/interrupt-controller/irq.h>
144+ #include <dt-bindings/power/rk3288-power.h>
138145
139146 hdmi: hdmi@ff980000 {
140147 compatible = "rockchip,rk3288-dw-hdmi";
141148 reg = <0xff980000 0x20000>;
142149 reg-io-width = <4>;
143− ddc-i2c-bus = <&i2c5>;
144− rockchip,grf = <&grf>;
145150 interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
146151 clocks = <&cru PCLK_HDMI_CTRL>, <&cru SCLK_HDMI_HDCP>;
147152 clock-names = "iahb", "isfr";
153+ ddc-i2c-bus = <&i2c5>;
154+ power-domains = <&power RK3288_PD_VIO>;
155+ rockchip,grf = <&grf>;
148156
149157 ports {
150− port {
158+ #address-cells = <1>;
159+ #size-cells = <0>;
160+
161+ port@0 {
162+ reg = <0>;
151163 #address-cells = <1>;
152164 #size-cells = <0>;
153165
@@ -155,11 +167,20 @@ examples: · 1 unmodified line
155167 reg = <0>;
156168 remote-endpoint = <&vopb_out_hdmi>;
157169 };
170+
158171 hdmi_in_vopl: endpoint@1 {
159172 reg = <1>;
160173 remote-endpoint = <&vopl_out_hdmi>;
161174 };
162175 };
176+
177+ port@1 {
178+ reg = <1>;
179+
180+ hdmi_out_con: endpoint {
181+ remote-endpoint = <&hdmi_con_in>;
182+ };
183+ };
163184 };
164185 };
165186
Documentation/devicetree/bindings/display/samsung/samsung,exynos-mixer.yaml+3−3
@@ -85,7 +85,7 @@ allOf: · 84 unmodified lines
8585 clocks:
8686 minItems: 6
8787 maxItems: 6
88− regs:
88+ reg:
8989 minItems: 2
9090 maxItems: 2
9191
@@ -99,7 +99,7 @@ allOf: · 7 unmodified lines
9999 clocks:
100100 minItems: 4
101101 maxItems: 4
102− regs:
102+ reg:
103103 minItems: 2
104104 maxItems: 2
105105
@@ -116,7 +116,7 @@ allOf: · 10 unmodified lines
116116 clocks:
117117 minItems: 3
118118 maxItems: 3
119− regs:
119+ reg:
120120 minItems: 1
121121 maxItems: 1
122122
Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml+10−10
@@ -131,9 +131,9 @@ allOf: · 130 unmodified lines
131131 const: sinowealth,sh1106
132132 then:
133133 properties:
134− width:
134+ solomon,width:
135135 default: 132
136− height:
136+ solomon,height:
137137 default: 64
138138 solomon,dclk-div:
139139 default: 1
@@ -149,9 +149,9 @@ allOf: · 9 unmodified lines
149149 - solomon,ssd1305
150150 then:
151151 properties:
152− width:
152+ solomon,width:
153153 default: 132
154− height:
154+ solomon,height:
155155 default: 64
156156 solomon,dclk-div:
157157 default: 1
@@ -167,9 +167,9 @@ allOf: · 9 unmodified lines
167167 - solomon,ssd1306
168168 then:
169169 properties:
170− width:
170+ solomon,width:
171171 default: 128
172− height:
172+ solomon,height:
173173 default: 64
174174 solomon,dclk-div:
175175 default: 1
@@ -185,9 +185,9 @@ allOf: · 9 unmodified lines
185185 - solomon,ssd1307
186186 then:
187187 properties:
188− width:
188+ solomon,width:
189189 default: 128
190− height:
190+ solomon,height:
191191 default: 39
192192 solomon,dclk-div:
193193 default: 2
@@ -205,9 +205,9 @@ allOf: · 11 unmodified lines
205205 - solomon,ssd1309
206206 then:
207207 properties:
208− width:
208+ solomon,width:
209209 default: 128
210− height:
210+ solomon,height:
211211 default: 64
212212 solomon,dclk-div:
213213 default: 1
Documentation/devicetree/bindings/display/solomon,ssd132x.yaml+6−6
@@ -30,9 +30,9 @@ allOf: · 29 unmodified lines
3030 const: solomon,ssd1322
3131 then:
3232 properties:
33− width:
33+ solomon,width:
3434 default: 480
35− height:
35+ solomon,height:
3636 default: 128
3737
3838 - if:
@@ -42,9 +42,9 @@ allOf: · 3 unmodified lines
4242 const: solomon,ssd1325
4343 then:
4444 properties:
45− width:
45+ solomon,width:
4646 default: 128
47− height:
47+ solomon,height:
4848 default: 80
4949
5050 - if:
@@ -54,9 +54,9 @@ allOf: · 3 unmodified lines
5454 const: solomon,ssd1327
5555 then:
5656 properties:
57− width:
57+ solomon,width:
5858 default: 128
59− height:
59+ solomon,height:
6060 default: 128
6161
6262 unevaluatedProperties: false
Documentation/devicetree/bindings/display/solomon,ssd133x.yaml+45−0
@@ -0,0 +1,45 @@
1+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/display/solomon,ssd133x.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: Solomon SSD133x OLED Display Controllers
8+
9+maintainers:
10+ - Javier Martinez Canillas <javierm@redhat.com>
11+
12+allOf:
13+ - $ref: solomon,ssd-common.yaml#
14+
15+properties:
16+ compatible:
17+ enum:
18+ - solomon,ssd1331
19+
20+ solomon,width:
21+ default: 96
22+
23+ solomon,height:
24+ default: 64
25+
26+required:
27+ - compatible
28+ - reg
29+
30+unevaluatedProperties: false
31+
32+examples:
33+ - |
34+ spi {
35+ #address-cells = <1>;
36+ #size-cells = <0>;
37+
38+ oled@0 {
39+ compatible = "solomon,ssd1331";
40+ reg = <0x0>;
41+ reset-gpios = <&gpio2 7>;
42+ dc-gpios = <&gpio2 8>;
43+ spi-max-frequency = <10000000>;
44+ };
45+ };
Documentation/devicetree/bindings/media/cnm,wave521c.yaml+2−2
@@ -17,7 +17,7 @@ properties: · 16 unmodified lines
1717 compatible:
1818 items:
1919 - enum:
20− - ti,k3-j721s2-wave521c
20+ - ti,j721s2-wave521c
2121 - const: cnm,wave521c
2222
2323 reg:
@@ -53,7 +53,7 @@ additionalProperties: false · 29 unmodified lines
5353 examples:
5454 - |
5555 vpu: video-codec@12345678 {
56− compatible = "ti,k3-j721s2-wave521c", "cnm,wave521c";
56+ compatible = "ti,j721s2-wave521c", "cnm,wave521c";
5757 reg = <0x12345678 0x1000>;
5858 clocks = <&clks 42>;
5959 interrupts = <42>;
Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-spdif.yaml+4−1
@@ -22,6 +22,7 @@ properties: · 21 unmodified lines
2222 - const: allwinner,sun6i-a31-spdif
2323 - const: allwinner,sun8i-h3-spdif
2424 - const: allwinner,sun50i-h6-spdif
25+ - const: allwinner,sun50i-h616-spdif
2526 - items:
2627 - const: allwinner,sun8i-a83t-spdif
2728 - const: allwinner,sun8i-h3-spdif
@@ -62,6 +63,8 @@ allOf: · 34 unmodified lines
6263 enum:
6364 - allwinner,sun6i-a31-spdif
6465 - allwinner,sun8i-h3-spdif
66+ - allwinner,sun50i-h6-spdif
67+ - allwinner,sun50i-h616-spdif
6568
6669 then:
6770 required:
@@ -73,7 +76,7 @@ allOf: · 5 unmodified lines
7376 contains:
7477 enum:
7578 - allwinner,sun8i-h3-spdif
76− - allwinner,sun50i-h6-spdif
79+ - allwinner,sun50i-h616-spdif
7780
7881 then:
7982 properties:
Documentation/filesystems/overlayfs.rst+13−3
@@ -145,7 +145,9 @@ filesystem, an overlay filesystem needs to record in the upper filesystem · 144 unmodified lines
145145 that files have been removed. This is done using whiteouts and opaque
146146 directories (non-directories are always opaque).
147147
148−A whiteout is created as a character device with 0/0 device number.
148+A whiteout is created as a character device with 0/0 device number or
149+as a zero-size regular file with the xattr "trusted.overlay.whiteout".
150+
149151 When a whiteout is found in the upper level of a merged directory, any
150152 matching name in the lower level is ignored, and the whiteout itself
151153 is also hidden.
@@ -154,6 +156,13 @@ A directory is made opaque by setting the xattr "trusted.overlay.opaque" · 2 unmodified lines
154156 to "y". Where the upper filesystem contains an opaque directory, any
155157 directory in the lower filesystem with the same name is ignored.
156158
159+An opaque directory should not conntain any whiteouts, because they do not
160+serve any purpose. A merge directory containing regular files with the xattr
161+"trusted.overlay.whiteout", should be additionally marked by setting the xattr
162+"trusted.overlay.opaque" to "x" on the merge directory itself.
163+This is needed to avoid the overhead of checking the "trusted.overlay.whiteout"
164+on all entries during readdir in the common case.
165+
157166 readdir
158167 -------
159168
@@ -534,8 +543,9 @@ A lower dir with a regular whiteout will always be handled by the overlayfs · 374 unmodified lines
534543 mount, so to support storing an effective whiteout file in an overlayfs mount an
535544 alternative form of whiteout is supported. This form is a regular, zero-size
536545 file with the "overlay.whiteout" xattr set, inside a directory with the
537−"overlay.whiteouts" xattr set. Such whiteouts are never created by overlayfs,
538−but can be used by userspace tools (like containers) that generate lower layers.
546+"overlay.opaque" xattr set to "x" (see `whiteouts and opaque directories`_).
547+These alternative whiteouts are never created by overlayfs, but can be used by
548+userspace tools (like containers) that generate lower layers.
539549 These alternative whiteouts can be escaped using the standard xattr escape
540550 mechanism in order to properly nest to any depth.
541551
Documentation/gpu/amdgpu/dgpu-asic-info-table.csv+2−0
@@ -16,6 +16,7 @@ Radeon (RX|TM) (PRO|WX) Vega /MI25 /V320 /V340L /8200 /9100 /SSG MxGPU, VEGA10, · 15 unmodified lines
1616 AMD Radeon (Pro) VII /MI50 /MI60, VEGA20, DCE 12, 9.4.0, VCE 4.1.0 / UVD 7.2.0, 4.2.0
1717 MI100, ARCTURUS, *, 9.4.1, VCN 2.5.0, 4.2.2
1818 MI200, ALDEBARAN, *, 9.4.2, VCN 2.6.0, 4.4.0
19+MI300, AQUA_VANGARAM, *, 9.4.3, VCN 4.0.3, 4.4.2
1920 AMD Radeon (RX|Pro) 5600(M|XT) /5700 (M|XT|XTB) /W5700, NAVI10, DCN 2.0.0, 10.1.10, VCN 2.0.0, 5.0.0
2021 AMD Radeon (Pro) 5300 /5500XTB/5500(XT|M) /W5500M /W5500, NAVI14, DCN 2.0.0, 10.1.1, VCN 2.0.2, 5.0.2
2122 AMD Radeon RX 6800(XT) /6900(XT) /W6800, SIENNA_CICHLID, DCN 3.0.0, 10.3.0, VCN 3.0.0, 5.2.0
@@ -23,4 +24,5 @@ AMD Radeon RX 6700 XT / 6800M / 6700M, NAVY_FLOUNDER, DCN 3.0.0, 10.3.2, VCN 3.0 · 1 unmodified line
2324 AMD Radeon RX 6600(XT) /6600M /W6600 /W6600M, DIMGREY_CAVEFISH, DCN 3.0.2, 10.3.4, VCN 3.0.16, 5.2.4
2425 AMD Radeon RX 6500M /6300M /W6500M /W6300M, BEIGE_GOBY, DCN 3.0.3, 10.3.5, VCN 3.0.33, 5.2.5
2526 AMD Radeon RX 7900 XT /XTX, , DCN 3.2.0, 11.0.0, VCN 4.0.0, 6.0.0
27+AMD Radeon RX 7800 XT, , DCN 3.2.0, 11.0.3, VCN 4.0.0, 6.0.3
2628 AMD Radeon RX 7600M (XT) /7700S /7600S, , DCN 3.2.1, 11.0.2, VCN 4.0.4, 6.0.2
Documentation/gpu/amdgpu/display/dcn-blocks.rst+78−0
@@ -0,0 +1,78 @@
1+==========
2+DCN Blocks
3+==========
4+
5+In this section, you will find some extra details about some of the DCN blocks
6+and the code documentation when it is automatically generated.
7+
8+DCHUBBUB
9+--------
10+
11+.. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h
12+ :doc: overview
13+
14+.. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h
15+ :export:
16+
17+.. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h
18+ :internal:
19+
20+HUBP
21+----
22+
23+.. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h
24+ :doc: overview
25+
26+.. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h
27+ :export:
28+
29+.. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h
30+ :internal:
31+
32+DPP
33+---
34+
35+.. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h
36+ :doc: overview
37+
38+.. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h
39+ :export:
40+
41+.. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h
42+ :internal:
43+
44+MPC
45+---
46+
47+.. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h
48+ :doc: overview
49+
50+.. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h
51+ :export:
52+
53+.. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h
54+ :internal:
55+
56+OPP
57+---
58+
59+.. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/opp.h
60+ :doc: overview
61+
62+.. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/opp.h
63+ :export:
64+
65+.. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/opp.h
66+ :internal:
67+
68+DIO
69+---
70+
71+.. kernel-doc:: drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.h
72+ :doc: overview
73+
74+.. kernel-doc:: drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.h
75+ :export:
76+
77+.. kernel-doc:: drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.h
78+ :internal:
Documentation/gpu/amdgpu/display/display-contributing.rst+168−0
@@ -0,0 +1,168 @@
1+.. _display_todos:
2+
3+==============================
4+AMDGPU - Display Contributions
5+==============================
6+
7+First of all, if you are here, you probably want to give some technical
8+contribution to the display code, and for that, we say thank you :)
9+
10+This page summarizes some of the issues you can help with; keep in mind that
11+this is a static page, and it is always a good idea to try to reach developers
12+in the amdgfx or some of the maintainers. Finally, this page follows the DRM
13+way of creating a TODO list; for more information, check
14+'Documentation/gpu/todo.rst'.
15+
16+Gitlab issues
17+=============
18+
19+Users can report issues associated with AMD GPUs at:
20+
21+- https://gitlab.freedesktop.org/drm/amd
22+
23+Usually, we try to add a proper label to all new tickets to make it easy to
24+filter issues. If you can reproduce any problem, you could help by adding more
25+information or fixing the issue.
26+
27+Level: diverse
28+
29+IGT
30+===
31+
32+`IGT`_ provides many integration tests that can be run on your GPU. We always
33+want to pass a large set of tests to increase the test coverage in our CI. If
34+you wish to contribute to the display code but are unsure where a good place
35+is, we recommend you run all IGT tests and try to fix any failure you see in
36+your hardware. Keep in mind that this failure can be an IGT problem or a kernel
37+issue; it is necessary to analyze case-by-case.
38+
39+Level: diverse
40+
41+.. _IGT: https://gitlab.freedesktop.org/drm/igt-gpu-tools
42+
43+Compilation
44+===========
45+
46+Fix compilation warnings
47+------------------------
48+
49+Enable the W1 or W2 warning level in the kernel compilation and try to fix the
50+issues on the display side.
51+
52+Level: Starter
53+
54+Fix compilation issues when using um architecture
55+-------------------------------------------------
56+
57+Linux has a User-mode Linux (UML) feature, and the kernel can be compiled to
58+the **um** architecture. Compiling for **um** can bring multiple advantages
59+from the test perspective. We currently have some compilation issues in this
60+area that we need to fix.
61+
62+Level: Intermediate
63+
64+Code Refactor
65+=============
66+
67+Add prefix to DC functions to improve the debug with ftrace
68+-----------------------------------------------------------
69+
70+The Ftrace debug feature (check 'Documentation/trace/ftrace.rst') is a
71+fantastic way to check the code path when developers try to make sense of a
72+bug. Ftrace provides a filter mechanism that can be useful when the developer
73+has some hunch of which part of the code can cause the issue; for this reason,
74+if a set of functions has a proper prefix, it becomes easy to create a good
75+filter. Additionally, prefixes can improve stack trace readability.
76+
77+The DC code does not follow some prefix rules, which makes the Ftrace filter
78+more complicated and reduces the readability of the stack trace. If you want
79+something simple to start contributing to the display, you can make patches for
80+adding prefixes to DC functions. To create those prefixes, use part of the file
81+name as a prefix for all functions in the target file. Check the
82+'amdgpu_dm_crtc.c` and `amdgpu_dm_plane.c` for some references. However, we
83+strongly advise not to send huge patches changing these prefixes; otherwise, it
84+will be hard to review and test, which can generate second thoughts from
85+maintainers. Try small steps; in case of double, you can ask before you put in
86+effort. We recommend first looking at folders like dceXYZ, dcnXYZ, basics,
87+bios, core, clk_mgr, hwss, resource, and irq.
88+
89+Level: Starter
90+
91+Reduce code duplication
92+-----------------------
93+
94+AMD has an extensive portfolio with various dGPUs and APUs that amdgpu
95+supports. To maintain the new hardware release cadence, DCE/DCN was designed in
96+a modular design, making the bring-up for new hardware fast. Over the years,
97+amdgpu accumulated some technical debt in the code duplication area. For this
98+task, it would be a good idea to find a tool that can discover code duplication
99+(including patterns) and use it as guidance to reduce duplications.
100+
101+Level: Intermediate
102+
103+Make atomic_commit_[check|tail] more readable
104+---------------------------------------------
105+
106+The functions responsible for atomic commit and tail are intricate and
107+extensive. In particular `amdgpu_dm_atomic_commit_tail` is a long function and
108+could benefit from being split into smaller helpers. Improvements in this area
109+are more than welcome, but keep in mind that changes in this area will affect
110+all ASICs, meaning that refactoring requires a comprehensive verification; in
111+other words, this effort can take some time for validation.
112+
113+Level: Advanced
114+
115+Documentation
116+=============
117+
118+Expand kernel-doc
119+-----------------
120+
121+Many DC functions do not have a proper kernel-doc; understanding a function and
122+adding documentation is a great way to learn more about the amdgpu driver and
123+also leave an outstanding contribution to the entire community.
124+
125+Level: Starter
126+
127+Beyond AMDGPU
128+=============
129+
130+AMDGPU provides features that are not yet enabled in the userspace. This
131+section highlights some of the coolest display features, which could be enabled
132+with the userspace developer helper.
133+
134+Enable underlay
135+---------------
136+
137+AMD display has this feature called underlay (which you can read more about at
138+'Documentation/GPU/amdgpu/display/mpo-overview.rst') which is intended to
139+save power when playing a video. The basic idea is to put a video in the
140+underlay plane at the bottom and the desktop in the plane above it with a hole
141+in the video area. This feature is enabled in ChromeOS, and from our data
142+measurement, it can save power.
143+
144+Level: Unknown
145+
146+Adaptive Backlight Modulation (ABM)
147+-----------------------------------
148+
149+ABM is a feature that adjusts the display panel's backlight level and pixel
150+values depending on the displayed image. This power-saving feature can be very
151+useful when the system starts to run off battery; since this will impact the
152+display output fidelity, it would be good if this option was something that
153+users could turn on or off.
154+
155+Level: Unknown
156+
157+
158+HDR & Color management & VRR
159+----------------------------
160+
161+HDR, Color Management, and VRR are huge topics and it's hard to put these into
162+concise ToDos. If you are interested in this topic, we recommend checking some
163+blog posts from the community developers to better understand some of the
164+specific challenges and people working on the subject. If anyone wants to work
165+on some particular part, we can try to help with some basic guidance. Finally,
166+keep in mind that we already have some kernel-doc in place for those areas.
167+
168+Level: Unknown
Documentation/gpu/amdgpu/display/display-manager.rst+0−3
@@ -131,9 +131,6 @@ The DRM blend mode and its elements are then mapped by AMDGPU display manager · 130 unmodified lines
131131 (DM) to program the blending configuration of the Multiple Pipe/Plane Combined
132132 (MPC), as follows:
133133
134−.. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h
135− :doc: mpc-overview
136−
137134 .. kernel-doc:: drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h
138135 :functions: mpcc_blnd_cfg
139136
Documentation/gpu/amdgpu/display/index.rst+71−7
@@ -7,18 +7,80 @@ drm/amd/display - Display Core (DC) · 6 unmodified lines
77 AMD display engine is partially shared with other operating systems; for this
88 reason, our Display Core Driver is divided into two pieces:
99
10−1. **Display Core (DC)** contains the OS-agnostic components. Things like
10+#. **Display Core (DC)** contains the OS-agnostic components. Things like
1111 hardware programming and resource management are handled here.
12−2. **Display Manager (DM)** contains the OS-dependent components. Hooks to the
13− amdgpu base driver and DRM are implemented here.
12+#. **Display Manager (DM)** contains the OS-dependent components. Hooks to the
13+ amdgpu base driver and DRM are implemented here. For example, you can check
14+ display/amdgpu_dm/ folder.
15+
16+------------------
17+DC Code validation
18+------------------
19+
20+Maintaining the same code base across multiple OSes requires a lot of
21+synchronization effort between repositories and exhaustive validation. In the
22+DC case, we maintain a tree to centralize code from different parts. The shared
23+repository has integration tests with our Internal Linux CI farm, and we run a
24+comprehensive set of IGT tests in various AMD GPUs/APUs (mostly recent dGPUs
25+and APUs). Our CI also checks ARM64/32, PPC64/32, and x86_64/32 compilation
26+with DCN enabled and disabled.
27+
28+When we upstream a new feature or some patches, we pack them in a patchset with
29+the prefix **DC Patches for <DATE>**, which is created based on the latest
30+`amd-staging-drm-next <https://gitlab.freedesktop.org/agd5f/linux>`_. All of
31+those patches are under a DC version tested as follows:
32+
33+* Ensure that every patch compiles and the entire series pass our set of IGT
34+ test in different hardware.
35+* Prepare a branch with those patches for our validation team. If there is an
36+ error, a developer will debug as fast as possible; usually, a simple bisect
37+ in the series is enough to point to a bad change, and two possible actions
38+ emerge: fix the issue or drop the patch. If it is not an easy fix, the bad
39+ patch is dropped.
40+* Finally, developers wait a few days for community feedback before we merge
41+ the series.
42+
43+It is good to stress that the test phase is something that we take extremely
44+seriously, and we never merge anything that fails our validation. Follows an
45+overview of our test set:
46+
47+#. Manual test
48+ * Multiple Hotplugs with DP and HDMI.
49+ * Stress test with multiple display configuration changes via the user interface.
50+ * Validate VRR behaviour.
51+ * Check PSR.
52+ * Validate MPO when playing video.
53+ * Test more than two displays connected at the same time.
54+ * Check suspend/resume.
55+ * Validate FPO.
56+ * Check MST.
57+#. Automated test
58+ * IGT tests in a farm with GPUs and APUs that support DCN and DCE.
59+ * Compilation validation with the latest GCC and Clang from LTS distro.
60+ * Cross-compilation for PowerPC 64/32, ARM 64/32, and x86 32.
61+
62+In terms of test setup for CI and manual tests, we usually use:
63+
64+#. The latest Ubuntu LTS.
65+#. In terms of userspace, we only use fully updated open-source components
66+ provided by the distribution official package manager.
67+#. Regarding IGT, we use the latest code from the upstream.
68+#. Most of the manual tests are conducted in the GNome but we also use KDE.
69+
70+Notice that someone from our test team will always reply to the cover letter
71+with the test report.
72+
73+--------------
74+DC Information
75+--------------
1476
1577 The display pipe is responsible for "scanning out" a rendered frame from the
1678 GPU memory (also called VRAM, FrameBuffer, etc.) to a display. In other words,
1779 it would:
1880
19−1. Read frame information from memory;
20−2. Perform required transformation;
21−3. Send pixel data to sink devices.
81+#. Read frame information from memory;
82+#. Perform required transformation;
83+#. Send pixel data to sink devices.
2284
2385 If you want to learn more about our driver details, take a look at the below
2486 table of content:
@@ -26,7 +88,9 @@ table of content: · 1 unmodified line
2688 .. toctree::
2789
2890 display-manager.rst
29− dc-debug.rst
3091 dcn-overview.rst
92+ dcn-blocks.rst
3193 mpo-overview.rst
94+ dc-debug.rst
95+ display-contributing.rst
3296 dc-glossary.rst
Documentation/gpu/drm-internals.rst+0−12
@@ -153,18 +153,6 @@ Managed Resources · 152 unmodified lines
153153 .. kernel-doc:: include/drm/drm_managed.h
154154 :internal:
155155
156−Bus-specific Device Registration and PCI Support
157−------------------------------------------------
158−
159−A number of functions are provided to help with device registration. The
160−functions deal with PCI and platform devices respectively and are only
161−provided for historical reasons. These are all deprecated and shouldn't
162−be used in new drivers. Besides that there's a few helpers for pci
163−drivers.
164−
165−.. kernel-doc:: drivers/gpu/drm/drm_pci.c
166− :export:
167−
168156 Open/Close, File Operations and IOCTLs
169157 ======================================
170158
Documentation/gpu/introduction.rst+2−0
@@ -164,6 +164,8 @@ Conference talks · 163 unmodified lines
164164 Slides and articles
165165 -------------------
166166
167+* `The Linux graphics stack in a nutshell, part 1 <https://lwn.net/Articles/955376/>`_ - Thomas Zimmermann (2023)
168+* `The Linux graphics stack in a nutshell, part 2 <https://lwn.net/Articles/955708/>`_ - Thomas Zimmermann (2023)
167169 * `Understanding the Linux Graphics Stack <https://bootlin.com/doc/training/graphics/graphics-slides.pdf>`_ - Bootlin (2022)
168170 * `DRM KMS overview <https://wiki.st.com/stm32mpu/wiki/DRM_KMS_overview>`_ - STMicroelectronics (2021)
169171 * `Linux graphic stack <https://studiopixl.com/2017-05-13/linux-graphic-stack-an-overview>`_ - Nathan Gauër (2017)
Documentation/gpu/rfc/index.rst+0−4
@@ -31,7 +31,3 @@ host such documentation: · 30 unmodified lines
3131 .. toctree::
3232
3333 i915_vm_bind.rst
34−
35−.. toctree::
36−
37− xe.rst
Documentation/gpu/rfc/xe.rst+0−234
@@ -1,234 +0,0 @@
1−==========================
2−Xe – Merge Acceptance Plan
3−==========================
4−Xe is a new driver for Intel GPUs that supports both integrated and
5−discrete platforms starting with Tiger Lake (first Intel Xe Architecture).
6−
7−This document aims to establish a merge plan for the Xe, by writing down clear
8−pre-merge goals, in order to avoid unnecessary delays.
9−
10−Xe – Overview
11−=============
12−The main motivation of Xe is to have a fresh base to work from that is
13−unencumbered by older platforms, whilst also taking the opportunity to
14−rearchitect our driver to increase sharing across the drm subsystem, both
15−leveraging and allowing us to contribute more towards other shared components
16−like TTM and drm/scheduler.
17−
18−This is also an opportunity to start from the beginning with a clean uAPI that is
19−extensible by design and already aligned with the modern userspace needs. For
20−this reason, the memory model is solely based on GPU Virtual Address space
21−bind/unbind (‘VM_BIND’) of GEM buffer objects (BOs) and execution only supporting
22−explicit synchronization. With persistent mapping across the execution, the
23−userspace does not need to provide a list of all required mappings during each
24−submission.
25−
26−The new driver leverages a lot from i915. As for display, the intent is to share
27−the display code with the i915 driver so that there is maximum reuse there.
28−
29−As for the power management area, the goal is to have a much-simplified support
30−for the system suspend states (S-states), PCI device suspend states (D-states),
31−GPU/Render suspend states (R-states) and frequency management. It should leverage
32−as much as possible all the existent PCI-subsystem infrastructure (pm and
33−runtime_pm) and underlying firmware components such PCODE and GuC for the power
34−states and frequency decisions.
35−
36−Repository:
37−
38−https://gitlab.freedesktop.org/drm/xe/kernel (branch drm-xe-next)
39−
40−Xe – Platforms
41−==============
42−Currently, Xe is already functional and has experimental support for multiple
43−platforms starting from Tiger Lake, with initial support in userspace implemented
44−in Mesa (for Iris and Anv, our OpenGL and Vulkan drivers), as well as in NEO
45−(for OpenCL and Level0).
46−
47−During a transition period, platforms will be supported by both Xe and i915.
48−However, the force_probe mechanism existent in both drivers will allow only one
49−official and by-default probe at a given time.
50−
51−For instance, in order to probe a DG2 which PCI ID is 0x5690 by Xe instead of
52−i915, the following set of parameters need to be used:
53−
54−```
55−i915.force_probe=!5690 xe.force_probe=5690
56−```
57−
58−In both drivers, the ‘.require_force_probe’ protection forces the user to use the
59−force_probe parameter while the driver is under development. This protection is
60−only removed when the support for the platform and the uAPI are stable. Stability
61−which needs to be demonstrated by CI results.
62−
63−In order to avoid user space regressions, i915 will continue to support all the
64−current platforms that are already out of this protection. Xe support will be
65−forever experimental and dependent on the usage of force_probe for these
66−platforms.
67−
68−When the time comes for Xe, the protection will be lifted on Xe and kept in i915.
69−
70−Xe – Pre-Merge Goals - Work-in-Progress
71−=======================================
72−
73−Display integration with i915
74−-----------------------------
75−In order to share the display code with the i915 driver so that there is maximum
76−reuse, the i915/display/ code is built twice, once for i915.ko and then for
77−xe.ko. Currently, the i915/display code in Xe tree is polluted with many 'ifdefs'
78−depending on the build target. The goal is to refactor both Xe and i915/display
79−code simultaneously in order to get a clean result before they land upstream, so
80−that display can already be part of the initial pull request towards drm-next.
81−
82−However, display code should not gate the acceptance of Xe in upstream. Xe
83−patches will be refactored in a way that display code can be removed, if needed,
84−from the first pull request of Xe towards drm-next. The expectation is that when
85−both drivers are part of the drm-tip, the introduction of cleaner patches will be
86−easier and speed up.
87−
88−Xe – uAPI high level overview
89−=============================
90−
91−...Warning: To be done in follow up patches after/when/where the main consensus in various items are individually reached.
92−
93−Xe – Pre-Merge Goals - Completed
94−================================
95−
96−Drm_exec
97−--------
98−Helper to make dma_resv locking for a big number of buffers is getting removed in
99−the drm_exec series proposed in https://patchwork.freedesktop.org/patch/524376/
100−If that happens, Xe needs to change and incorporate the changes in the driver.
101−The goal is to engage with the Community to understand if the best approach is to
102−move that to the drivers that are using it or if we should keep the helpers in
103−place waiting for Xe to get merged.
104−
105−This item ties into the GPUVA, VM_BIND, and even long-running compute support.
106−
107−As a key measurable result, we need to have a community consensus documented in
108−this document and the Xe driver prepared for the changes, if necessary.
109−
110−Userptr integration and vm_bind
111−-------------------------------
112−Different drivers implement different ways of dealing with execution of userptr.
113−With multiple drivers currently introducing support to VM_BIND, the goal is to
114−aim for a DRM consensus on what’s the best way to have that support. To some
115−extent this is already getting addressed itself with the GPUVA where likely the
116−userptr will be a GPUVA with a NULL GEM call VM bind directly on the userptr.
117−However, there are more aspects around the rules for that and the usage of
118−mmu_notifiers, locking and other aspects.
119−
120−This task here has the goal of introducing a documentation of the basic rules.
121−
122−The documentation *needs* to first live in this document (API session below) and
123−then moved to another more specific document or at Xe level or at DRM level.
124−
125−Documentation should include:
126−
127− * The userptr part of the VM_BIND api.
128−
129− * Locking, including the page-faulting case.
130−
131− * O(1) complexity under VM_BIND.
132−
133−The document is now included in the drm documentation :doc:`here </gpu/drm-vm-bind-async>`.
134−
135−Some parts of userptr like mmu_notifiers should become GPUVA or DRM helpers when
136−the second driver supporting VM_BIND+userptr appears. Details to be defined when
137−the time comes.
138−
139−The DRM GPUVM helpers do not yet include the userptr parts, but discussions
140−about implementing them are ongoing.
141−
142−ASYNC VM_BIND
143−-------------
144−Although having a common DRM level IOCTL for VM_BIND is not a requirement to get
145−Xe merged, it is mandatory to have a consensus with other drivers and Mesa.
146−It needs to be clear how to handle async VM_BIND and interactions with userspace
147−memory fences. Ideally with helper support so people don't get it wrong in all
148−possible ways.
149−
150−As a key measurable result, the benefits of ASYNC VM_BIND and a discussion of
151−various flavors, error handling and sample API suggestions are documented in
152−:doc:`The ASYNC VM_BIND document </gpu/drm-vm-bind-async>`.
153−
154−Drm_scheduler
155−-------------
156−Xe primarily uses Firmware based scheduling (GuC FW). However, it will use
157−drm_scheduler as the scheduler ‘frontend’ for userspace submission in order to
158−resolve syncobj and dma-buf implicit sync dependencies. However, drm_scheduler is
159−not yet prepared to handle the 1-to-1 relationship between drm_gpu_scheduler and
160−drm_sched_entity.
161−
162−Deeper changes to drm_scheduler should *not* be required to get Xe accepted, but
163−some consensus needs to be reached between Xe and other community drivers that
164−could also benefit from this work, for coupling FW based/assisted submission such
165−as the ARM’s new Mali GPU driver, and others.
166−
167−As a key measurable result, the patch series introducing Xe itself shall not
168−depend on any other patch touching drm_scheduler itself that was not yet merged
169−through drm-misc. This, by itself, already includes the reach of an agreement for
170−uniform 1 to 1 relationship implementation / usage across drivers.
171−
172−Long running compute: minimal data structure/scaffolding
173−--------------------------------------------------------
174−The generic scheduler code needs to include the handling of endless compute
175−contexts, with the minimal scaffolding for preempt-ctx fences (probably on the
176−drm_sched_entity) and making sure drm_scheduler can cope with the lack of job
177−completion fence.
178−
179−The goal is to achieve a consensus ahead of Xe initial pull-request, ideally with
180−this minimal drm/scheduler work, if needed, merged to drm-misc in a way that any
181−drm driver, including Xe, could re-use and add their own individual needs on top
182−in a next stage. However, this should not block the initial merge.
183−
184−Dev_coredump
185−------------
186−
187−Xe needs to align with other drivers on the way that the error states are
188−dumped, avoiding a Xe only error_state solution. The goal is to use devcoredump
189−infrastructure to report error states, since it produces a standardized way
190−by exposing a virtual and temporary /sys/class/devcoredump device.
191−
192−As the key measurable result, Xe driver needs to provide GPU snapshots captured
193−at hang time through devcoredump, but without depending on any core modification
194−of devcoredump infrastructure itself.
195−
196−Later, when we are in-tree, the goal is to collaborate with devcoredump
197−infrastructure with overall possible improvements, like multiple file support
198−for better organization of the dumps, snapshot support, dmesg extra print,
199−and whatever may make sense and help the overall infrastructure.
200−
201−DRM_VM_BIND
202−-----------
203−Nouveau, and Xe are all implementing ‘VM_BIND’ and new ‘Exec’ uAPIs in order to
204−fulfill the needs of the modern uAPI. Xe merge should *not* be blocked on the
205−development of a common new drm_infrastructure. However, the Xe team needs to
206−engage with the community to explore the options of a common API.
207−
208−As a key measurable result, the DRM_VM_BIND needs to be documented in this file
209−below, or this entire block deleted if the consensus is for independent drivers
210−vm_bind ioctls.
211−
212−Although having a common DRM level IOCTL for VM_BIND is not a requirement to get
213−Xe merged, it is mandatory to enforce the overall locking scheme for all major
214−structs and list (so vm and vma). So, a consensus is needed, and possibly some
215−common helpers. If helpers are needed, they should be also documented in this
216−document.
217−
218−GPU VA
219−------
220−Two main goals of Xe are meeting together here:
221−
222−1) Have an uAPI that aligns with modern UMD needs.
223−
224−2) Early upstream engagement.
225−
226−RedHat engineers working on Nouveau proposed a new DRM feature to handle keeping
227−track of GPU virtual address mappings. This is still not merged upstream, but
228−this aligns very well with our goals and with our VM_BIND. The engagement with
229−upstream and the port of Xe towards GPUVA is already ongoing.
230−
231−As a key measurable result, Xe needs to be aligned with the GPU VA and working in
232−our tree. Missing Nouveau patches should *not* block Xe and any needed GPUVA
233−related patch should be independent and present on dri-devel or acked by
234−maintainers to go along with the first Xe pull request towards drm-next.
Documentation/gpu/todo.rst+23−0
@@ -120,6 +120,29 @@ Contact: Daniel Vetter, respective driver maintainers · 119 unmodified lines
120120
121121 Level: Advanced
122122
123+Rename drm_atomic_state
124+-----------------------
125+
126+The KMS framework uses two slightly different definitions for the ``state``
127+concept. For a given object (plane, CRTC, encoder, etc., so
128+``drm_$OBJECT_state``), the state is the entire state of that object. However,
129+at the device level, ``drm_atomic_state`` refers to a state update for a
130+limited number of objects.
131+
132+The state isn't the entire device state, but only the full state of some
133+objects in that device. This is confusing to newcomers, and
134+``drm_atomic_state`` should be renamed to something clearer like
135+``drm_atomic_commit``.
136+
137+In addition to renaming the structure itself, it would also imply renaming some
138+related functions (``drm_atomic_state_alloc``, ``drm_atomic_state_get``,
139+``drm_atomic_state_put``, ``drm_atomic_state_init``,
140+``__drm_atomic_state_free``, etc.).
141+
142+Contact: Maxime Ripard <mripard@kernel.org>
143+
144+Level: Advanced
145+
123146 Fallout from atomic KMS
124147 -----------------------
125148
Documentation/netlink/specs/rt_link.yaml+10−0
@@ -942,6 +942,10 @@ attribute-sets: · 941 unmodified lines
942942 -
943943 name: gro-ipv4-max-size
944944 type: u32
945+ -
946+ name: dpll-pin
947+ type: nest
948+ nested-attributes: link-dpll-pin-attrs
945949 -
946950 name: af-spec-attrs
947951 attributes:
@@ -1627,6 +1631,12 @@ attribute-sets: · 679 unmodified lines
16271631 -
16281632 name: used
16291633 type: u8
1634+ -
1635+ name: link-dpll-pin-attrs
1636+ attributes:
1637+ -
1638+ name: id
1639+ type: u32
16301640
16311641 sub-messages:
16321642 -
Documentation/sphinx/templates/kernel-toc.html+3−1
@@ -12,5 +12,7 @@ · 11 unmodified lines
1212 <script type="text/javascript"> <!--
1313 var sbar = document.getElementsByClassName("sphinxsidebar")[0];
1414 let currents = document.getElementsByClassName("current")
15− sbar.scrollTop = currents[currents.length - 1].offsetTop;
15+ if (currents.length) {
16+ sbar.scrollTop = currents[currents.length - 1].offsetTop;
17+ }
1618 --> </script>
Documentation/usb/gadget-testing.rst+11−11
@@ -448,17 +448,17 @@ Function-specific configfs interface · 447 unmodified lines
448448 The function name to use when creating the function directory is "ncm".
449449 The NCM function provides these attributes in its function directory:
450450
451− =============== ==================================================
452− ifname network device interface name associated with this
453− function instance
454− qmult queue length multiplier for high and super speed
455− host_addr MAC address of host's end of this
456− Ethernet over USB link
457− dev_addr MAC address of device's end of this
458− Ethernet over USB link
459− max_segment_size Segment size required for P2P connections. This
460− will set MTU to (max_segment_size - 14 bytes)
461− =============== ==================================================
451+ ======================= ==================================================
452+ ifname network device interface name associated with this
453+ function instance
454+ qmult queue length multiplier for high and super speed
455+ host_addr MAC address of host's end of this
456+ Ethernet over USB link
457+ dev_addr MAC address of device's end of this
458+ Ethernet over USB link
459+ max_segment_size Segment size required for P2P connections. This
460+ will set MTU to 14 bytes
461+ ======================= ==================================================
462462
463463 and after creating the functions/ncm.<instance name> they contain default
464464 values: qmult is 5, dev_addr and host_addr are randomly selected.
MAINTAINERS+19−19
@@ -3168,10 +3168,10 @@ F: drivers/hwmon/asus-ec-sensors.c · 3167 unmodified lines
31683168
31693169 ASUS NOTEBOOKS AND EEEPC ACPI/WMI EXTRAS DRIVERS
31703170 M: Corentin Chary <corentin.chary@gmail.com>
3171−L: acpi4asus-user@lists.sourceforge.net
3171+M: Luke D. Jones <luke@ljones.dev>
31723172 L: platform-driver-x86@vger.kernel.org
31733173 S: Maintained
3174−W: http://acpi4asus.sf.net
3174+W: https://asus-linux.org/
31753175 F: drivers/platform/x86/asus*.c
31763176 F: drivers/platform/x86/eeepc*.c
31773177
@@ -4547,7 +4547,7 @@ F: drivers/net/ieee802154/ca8210.c · 1369 unmodified lines
45474547
45484548 CACHEFILES: FS-CACHE BACKEND FOR CACHING ON MOUNTED FILESYSTEMS
45494549 M: David Howells <dhowells@redhat.com>
4550−L: linux-cachefs@redhat.com (moderated for non-subscribers)
4550+L: netfs@lists.linux.dev
45514551 S: Supported
45524552 F: Documentation/filesystems/caching/cachefiles.rst
45534553 F: fs/cachefiles/
@@ -5958,7 +5958,6 @@ S: Maintained · 1404 unmodified lines
59585958 F: drivers/platform/x86/dell/dell-wmi-descriptor.c
59595959
59605960 DELL WMI HARDWARE PRIVACY SUPPORT
5961−M: Perry Yuan <Perry.Yuan@dell.com>
59625961 L: Dell.Client.Kernel@dell.com
59635962 L: platform-driver-x86@vger.kernel.org
59645963 S: Maintained
@@ -7309,6 +7308,7 @@ F: drivers/gpu/drm/xlnx/ · 1344 unmodified lines
73097308
73107309 DRM GPU SCHEDULER
73117310 M: Luben Tuikov <ltuikov89@gmail.com>
7311+M: Matthew Brost <matthew.brost@intel.com>
73127312 L: dri-devel@lists.freedesktop.org
73137313 S: Maintained
73147314 T: git git://anongit.freedesktop.org/drm/drm-misc
@@ -7955,12 +7955,13 @@ L: rust-for-linux@vger.kernel.org · 640 unmodified lines
79557955 S: Maintained
79567956 F: rust/kernel/net/phy.rs
79577957
7958−EXEC & BINFMT API
7958+EXEC & BINFMT API, ELF
79597959 R: Eric Biederman <ebiederm@xmission.com>
79607960 R: Kees Cook <keescook@chromium.org>
79617961 L: linux-mm@kvack.org
79627962 S: Supported
79637963 T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/execve
7964+F: Documentation/userspace-api/ELF.rst
79647965 F: fs/*binfmt_*.c
79657966 F: fs/exec.c
79667967 F: include/linux/binfmts.h
@@ -8223,7 +8224,8 @@ F: include/linux/iomap.h · 256 unmodified lines
82238224
82248225 FILESYSTEMS [NETFS LIBRARY]
82258226 M: David Howells <dhowells@redhat.com>
8226−L: linux-cachefs@redhat.com (moderated for non-subscribers)
8227+R: Jeff Layton <jlayton@kernel.org>
8228+L: netfs@lists.linux.dev
82278229 L: linux-fsdevel@vger.kernel.org
82288230 S: Supported
82298231 F: Documentation/filesystems/caching/
@@ -10090,7 +10092,7 @@ L: linux-i2c@vger.kernel.org · 1860 unmodified lines
1009010092 S: Maintained
1009110093 W: https://i2c.wiki.kernel.org/
1009210094 Q: https://patchwork.ozlabs.org/project/linux-i2c/list/
10093−T: git git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git
10095+T: git git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git
1009410096 F: Documentation/devicetree/bindings/i2c/
1009510097 F: drivers/i2c/algos/
1009610098 F: drivers/i2c/busses/
@@ -10282,7 +10284,7 @@ F: drivers/scsi/ibmvscsi/ibmvscsi* · 185 unmodified lines
1028210284 F: include/scsi/viosrp.h
1028310285
1028410286 IBM Power Virtual SCSI Device Target Driver
10285−M: Michael Cyr <mikecyr@linux.ibm.com>
10287+M: Tyrel Datwyler <tyreld@linux.ibm.com>
1028610288 L: linux-scsi@vger.kernel.org
1028710289 L: target-devel@vger.kernel.org
1028810290 S: Supported
@@ -10466,7 +10468,6 @@ F: drivers/media/rc/img-ir/ · 177 unmodified lines
1046610468
1046710469 IMGTEC POWERVR DRM DRIVER
1046810470 M: Frank Binns <frank.binns@imgtec.com>
10469−M: Donald Robson <donald.robson@imgtec.com>
1047010471 M: Matt Coster <matt.coster@imgtec.com>
1047110472 S: Supported
1047210473 T: git git://anongit.freedesktop.org/drm/drm-misc
@@ -11724,6 +11725,7 @@ F: fs/smb/server/ · 1251 unmodified lines
1172411725 KERNEL UNIT TESTING FRAMEWORK (KUnit)
1172511726 M: Brendan Higgins <brendanhiggins@google.com>
1172611727 M: David Gow <davidgow@google.com>
11728+R: Rae Moar <rmoar@google.com>
1172711729 L: linux-kselftest@vger.kernel.org
1172811730 L: kunit-dev@googlegroups.com
1172911731 S: Maintained
@@ -12902,6 +12904,8 @@ M: Alejandro Colomar <alx@kernel.org> · 1172 unmodified lines
1290212904 L: linux-man@vger.kernel.org
1290312905 S: Maintained
1290412906 W: http://www.kernel.org/doc/man-pages
12907+T: git git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git
12908+T: git git://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git
1290512909
1290612910 MANAGEMENT COMPONENT TRANSPORT PROTOCOL (MCTP)
1290712911 M: Jeremy Kerr <jk@codeconstruct.com.au>
@@ -15177,6 +15181,7 @@ F: Documentation/networking/net_cachelines/net_device.rst · 2269 unmodified lines
1517715181 F: drivers/connector/
1517815182 F: drivers/net/
1517915183 F: include/dt-bindings/net/
15184+F: include/linux/cn_proc.h
1518015185 F: include/linux/etherdevice.h
1518115186 F: include/linux/fcdevice.h
1518215187 F: include/linux/fddidevice.h
@@ -15184,6 +15189,7 @@ F: include/linux/hippidevice.h · 1 unmodified line
1518415189 F: include/linux/if_*
1518515190 F: include/linux/inetdevice.h
1518615191 F: include/linux/netdevice.h
15192+F: include/uapi/linux/cn_proc.h
1518715193 F: include/uapi/linux/if_*
1518815194 F: include/uapi/linux/netdevice.h
1518915195 X: drivers/net/wireless/
@@ -16856,9 +16862,8 @@ F: Documentation/devicetree/bindings/pci/xilinx-versal-cpm.yaml · 1666 unmodified lines
1685616862 F: drivers/pci/controller/pcie-xilinx-cpm.c
1685716863
1685816864 PCI ENDPOINT SUBSYSTEM
16859−M: Lorenzo Pieralisi <lpieralisi@kernel.org>
16865+M: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
1686016866 M: Krzysztof Wilczyński <kw@linux.com>
16861−R: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
1686216867 R: Kishon Vijay Abraham I <kishon@kernel.org>
1686316868 L: linux-pci@vger.kernel.org
1686416869 S: Supported
@@ -18081,7 +18086,6 @@ F: drivers/net/ethernet/qualcomm/emac/ · 1216 unmodified lines
1808118086
1808218087 QUALCOMM ETHQOS ETHERNET DRIVER
1808318088 M: Vinod Koul <vkoul@kernel.org>
18084−R: Bhupesh Sharma <bhupesh.sharma@linaro.org>
1808518089 L: netdev@vger.kernel.org
1808618090 L: linux-arm-msm@vger.kernel.org
1808718091 S: Maintained
@@ -20549,6 +20553,7 @@ F: Documentation/translations/sp_SP/ · 2461 unmodified lines
2054920553
2055020554 SPARC + UltraSPARC (sparc/sparc64)
2055120555 M: "David S. Miller" <davem@davemloft.net>
20556+M: Andreas Larsson <andreas@gaisler.com>
2055220557 L: sparclinux@vger.kernel.org
2055320558 S: Maintained
2055420559 Q: http://patchwork.ozlabs.org/project/sparclinux/list/
@@ -24339,13 +24344,6 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs.git · 3784 unmodified lines
2433924344 F: Documentation/filesystems/zonefs.rst
2434024345 F: fs/zonefs/
2434124346
24342−ZPOOL COMPRESSED PAGE STORAGE API
24343−M: Dan Streetman <ddstreet@ieee.org>
24344−L: linux-mm@kvack.org
24345−S: Maintained
24346−F: include/linux/zpool.h
24347−F: mm/zpool.c
24348−
2434924347 ZR36067 VIDEO FOR LINUX DRIVER
2435024348 M: Corentin Labbe <clabbe@baylibre.com>
2435124349 L: mjpeg-users@lists.sourceforge.net
@@ -24397,7 +24395,9 @@ M: Nhat Pham <nphamcs@gmail.com> · 45 unmodified lines
2439724395 L: linux-mm@kvack.org
2439824396 S: Maintained
2439924397 F: Documentation/admin-guide/mm/zswap.rst
24398+F: include/linux/zpool.h
2440024399 F: include/linux/zswap.h
24400+F: mm/zpool.c
2440124401 F: mm/zswap.c
2440224402
2440324403 THE REST
Makefile+12−8
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 6
33 PATCHLEVEL = 8
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc1
5+EXTRAVERSION = -rc3
66 NAME = Hurr durr I'ma ninja sloth
77
88 # *DOCUMENTATION*
@@ -294,15 +294,15 @@ may-sync-config := 1 · 285 unmodified lines
294294 single-build :=
295295
296296 ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
297− ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
297+ ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
298298 need-config :=
299− endif
299+ endif
300300 endif
301301
302302 ifneq ($(filter $(no-sync-config-targets), $(MAKECMDGOALS)),)
303− ifeq ($(filter-out $(no-sync-config-targets), $(MAKECMDGOALS)),)
303+ ifeq ($(filter-out $(no-sync-config-targets), $(MAKECMDGOALS)),)
304304 may-sync-config :=
305− endif
305+ endif
306306 endif
307307
308308 need-compiler := $(may-sync-config)
@@ -323,9 +323,9 @@ endif · 14 unmodified lines
323323 # We cannot build single targets and the others at the same time
324324 ifneq ($(filter $(single-targets), $(MAKECMDGOALS)),)
325325 single-build := 1
326− ifneq ($(filter-out $(single-targets), $(MAKECMDGOALS)),)
326+ ifneq ($(filter-out $(single-targets), $(MAKECMDGOALS)),)
327327 mixed-build := 1
328− endif
328+ endif
329329 endif
330330
331331 # For "make -j clean all", "make -j mrproper defconfig all", etc.
@@ -986,6 +986,10 @@ NOSTDINC_FLAGS += -nostdinc · 654 unmodified lines
986986 # perform bounds checking.
987987 KBUILD_CFLAGS += $(call cc-option, -fstrict-flex-arrays=3)
988988
989+#Currently, disable -Wstringop-overflow for GCC 11, globally.
990+KBUILD_CFLAGS-$(CONFIG_CC_NO_STRINGOP_OVERFLOW) += $(call cc-option, -Wno-stringop-overflow)
991+KBUILD_CFLAGS-$(CONFIG_CC_STRINGOP_OVERFLOW) += $(call cc-option, -Wstringop-overflow)
992+
989993 # disable invalid "can't wrap" optimizations for signed / pointers
990994 KBUILD_CFLAGS += -fno-strict-overflow
991995
@@ -1662,7 +1666,7 @@ help: · 670 unmodified lines
16621666 @echo ' (sparse by default)'
16631667 @echo ' make C=2 [targets] Force check of all c source with $$CHECK'
16641668 @echo ' make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections'
1665− @echo ' make W=n [targets] Enable extra build checks, n=1,2,3 where'
1669+ @echo ' make W=n [targets] Enable extra build checks, n=1,2,3,c,e where'
16661670 @echo ' 1: warnings which may be relevant and do not occur too often'
16671671 @echo ' 2: warnings which occur quite often but may still be relevant'
16681672 @echo ' 3: more obscure warnings, can most likely be ignored'
arch/Kconfig+1−0
@@ -673,6 +673,7 @@ config SHADOW_CALL_STACK · 672 unmodified lines
673673 bool "Shadow Call Stack"
674674 depends on ARCH_SUPPORTS_SHADOW_CALL_STACK
675675 depends on DYNAMIC_FTRACE_WITH_ARGS || DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER
676+ depends on MMU
676677 help
677678 This option enables the compiler's Shadow Call Stack, which
678679 uses a shadow stack to protect function return addresses from
arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-bletchley.dts+2−2
@@ -45,8 +45,8 @@ · 44 unmodified lines
4545 num-chipselects = <1>;
4646 cs-gpios = <&gpio0 ASPEED_GPIO(Z, 0) GPIO_ACTIVE_LOW>;
4747
48− tpmdev@0 {
49− compatible = "tcg,tpm_tis-spi";
48+ tpm@0 {
49+ compatible = "infineon,slb9670", "tcg,tpm_tis-spi";
5050 spi-max-frequency = <33000000>;
5151 reg = <0>;
5252 };
arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts+2−2
@@ -80,8 +80,8 @@ · 79 unmodified lines
8080 gpio-miso = <&gpio ASPEED_GPIO(R, 5) GPIO_ACTIVE_HIGH>;
8181 num-chipselects = <1>;
8282
83− tpmdev@0 {
84− compatible = "tcg,tpm_tis-spi";
83+ tpm@0 {
84+ compatible = "infineon,slb9670", "tcg,tpm_tis-spi";
8585 spi-max-frequency = <33000000>;
8686 reg = <0>;
8787 };
arch/arm/boot/dts/aspeed/aspeed-bmc-opp-tacoma.dts+1−1
@@ -456,7 +456,7 @@ · 455 unmodified lines
456456 status = "okay";
457457
458458 tpm: tpm@2e {
459− compatible = "tcg,tpm-tis-i2c";
459+ compatible = "nuvoton,npct75x", "tcg,tpm-tis-i2c";
460460 reg = <0x2e>;
461461 };
462462 };
arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi+2−2
@@ -35,8 +35,8 @@ · 34 unmodified lines
3535 gpio-mosi = <&gpio0 ASPEED_GPIO(X, 4) GPIO_ACTIVE_HIGH>;
3636 gpio-miso = <&gpio0 ASPEED_GPIO(X, 5) GPIO_ACTIVE_HIGH>;
3737
38− tpmdev@0 {
39− compatible = "tcg,tpm_tis-spi";
38+ tpm@0 {
39+ compatible = "infineon,slb9670", "tcg,tpm_tis-spi";
4040 spi-max-frequency = <33000000>;
4141 reg = <0>;
4242 };
arch/arm/boot/dts/nxp/imx/imx6ull-phytec-tauri.dtsi+1−1
@@ -116,7 +116,7 @@ · 115 unmodified lines
116116 tpm_tis: tpm@1 {
117117 pinctrl-names = "default";
118118 pinctrl-0 = <&pinctrl_tpm>;
119− compatible = "tcg,tpm_tis-spi";
119+ compatible = "infineon,slb9670", "tcg,tpm_tis-spi";
120120 reg = <1>;
121121 spi-max-frequency = <20000000>;
122122 interrupt-parent = <&gpio5>;
arch/arm/boot/dts/nxp/imx/imx7d-flex-concentrator.dts+1−1
@@ -130,7 +130,7 @@ · 129 unmodified lines
130130 * TCG specification - Section 6.4.1 Clocking:
131131 * TPM shall support a SPI clock frequency range of 10-24 MHz.
132132 */
133− st33htph: tpm-tis@0 {
133+ st33htph: tpm@0 {
134134 compatible = "st,st33htpm-spi", "tcg,tpm_tis-spi";
135135 reg = <0>;
136136 spi-max-frequency = <24000000>;
arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi+1−0
@@ -434,6 +434,7 @@ · 433 unmodified lines
434434 };
435435
436436 &fimd {
437+ samsung,invert-vclk;
437438 status = "okay";
438439 };
439440
arch/arm/boot/dts/ti/omap/am335x-moxa-uc-2100-common.dtsi+1−1
@@ -217,7 +217,7 @@ · 216 unmodified lines
217217 pinctrl-names = "default";
218218 pinctrl-0 = <&spi1_pins>;
219219
220− tpm_spi_tis@0 {
220+ tpm@0 {
221221 compatible = "tcg,tpm_tis-spi";
222222 reg = <0>;
223223 spi-max-frequency = <500000>;
arch/arm64/Makefile+1−1
@@ -195,7 +195,7 @@ vdso_prepare: prepare0 · 194 unmodified lines
195195 include/generated/vdso-offsets.h arch/arm64/kernel/vdso/vdso.so
196196 ifdef CONFIG_COMPAT_VDSO
197197 $(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso32 \
198− include/generated/vdso32-offsets.h arch/arm64/kernel/vdso32/vdso.so
198+ arch/arm64/kernel/vdso32/vdso.so
199199 endif
200200 endif
201201
arch/arm64/boot/dts/exynos/google/gs101.dtsi+1−1
@@ -289,7 +289,7 @@ · 288 unmodified lines
289289 #clock-cells = <1>;
290290 clocks = <&cmu_top CLK_DOUT_CMU_MISC_BUS>,
291291 <&cmu_top CLK_DOUT_CMU_MISC_SSS>;
292− clock-names = "dout_cmu_misc_bus", "dout_cmu_misc_sss";
292+ clock-names = "bus", "sss";
293293 };
294294
295295 watchdog_cl0: watchdog@10060000 {
arch/arm64/boot/dts/freescale/imx8mm-phygate-tauri-l.dts+1−1
@@ -120,7 +120,7 @@ · 119 unmodified lines
120120 };
121121
122122 tpm: tpm@1 {
123− compatible = "tcg,tpm_tis-spi";
123+ compatible = "infineon,slb9670", "tcg,tpm_tis-spi";
124124 interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
125125 interrupt-parent = <&gpio2>;
126126 pinctrl-names = "default";
arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx.dtsi+1−1
@@ -89,7 +89,7 @@ · 88 unmodified lines
8989 status = "okay";
9090
9191 tpm@1 {
92− compatible = "tcg,tpm_tis-spi";
92+ compatible = "atmel,attpm20p", "tcg,tpm_tis-spi";
9393 reg = <0x1>;
9494 spi-max-frequency = <36000000>;
9595 };
arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx.dtsi+1−1
@@ -109,7 +109,7 @@ · 108 unmodified lines
109109 status = "okay";
110110
111111 tpm@1 {
112− compatible = "tcg,tpm_tis-spi";
112+ compatible = "atmel,attpm20p", "tcg,tpm_tis-spi";
113113 reg = <0x1>;
114114 spi-max-frequency = <36000000>;
115115 };
arch/arm64/boot/dts/freescale/imx8mp-beacon-kit.dts+1−1
@@ -234,7 +234,7 @@ · 233 unmodified lines
234234 status = "okay";
235235
236236 tpm: tpm@0 {
237− compatible = "infineon,slb9670";
237+ compatible = "infineon,slb9670", "tcg,tpm_tis-spi";
238238 reg = <0>;
239239 pinctrl-names = "default";
240240 pinctrl-0 = <&pinctrl_tpm>;
arch/arm64/boot/dts/freescale/imx8mp-venice-gw72xx.dtsi+1−1
@@ -103,7 +103,7 @@ · 102 unmodified lines
103103 status = "okay";
104104
105105 tpm@1 {
106− compatible = "tcg,tpm_tis-spi";
106+ compatible = "atmel,attpm20p", "tcg,tpm_tis-spi";
107107 reg = <0x1>;
108108 spi-max-frequency = <36000000>;
109109 };
arch/arm64/boot/dts/freescale/imx8mp-venice-gw73xx.dtsi+1−1
@@ -115,7 +115,7 @@ · 114 unmodified lines
115115 status = "okay";
116116
117117 tpm@1 {
118− compatible = "tcg,tpm_tis-spi";
118+ compatible = "atmel,attpm20p", "tcg,tpm_tis-spi";
119119 reg = <0x1>;
120120 spi-max-frequency = <36000000>;
121121 };
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts+1−1
@@ -196,7 +196,7 @@ · 195 unmodified lines
196196 status = "okay";
197197
198198 tpm@0 {
199− compatible = "tcg,tpm_tis-spi";
199+ compatible = "atmel,attpm20p", "tcg,tpm_tis-spi";
200200 reg = <0x0>;
201201 spi-max-frequency = <36000000>;
202202 };
arch/arm64/boot/dts/freescale/imx8mq-kontron-pitx-imx8m.dts+1−1
@@ -65,7 +65,7 @@ · 64 unmodified lines
6565 status = "okay";
6666
6767 tpm@0 {
68− compatible = "infineon,slb9670";
68+ compatible = "infineon,slb9670", "tcg,tpm_tis-spi";
6969 reg = <0>;
7070 spi-max-frequency = <43000000>;
7171 };
arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi+1−1
@@ -888,7 +888,7 @@ · 887 unmodified lines
888888 status = "okay";
889889 cs-gpios = <&pio 86 GPIO_ACTIVE_LOW>;
890890
891− cr50@0 {
891+ tpm@0 {
892892 compatible = "google,cr50";
893893 reg = <0>;
894894 spi-max-frequency = <1000000>;
arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi+1−1
@@ -1402,7 +1402,7 @@ · 1401 unmodified lines
14021402 pinctrl-names = "default";
14031403 pinctrl-0 = <&spi5_pins>;
14041404
1405− cr50@0 {
1405+ tpm@0 {
14061406 compatible = "google,cr50";
14071407 reg = <0>;
14081408 interrupts-extended = <&pio 171 IRQ_TYPE_EDGE_RISING>;
arch/arm64/boot/dts/rockchip/rk3399-gru-bob.dts+1−1
@@ -70,7 +70,7 @@ · 69 unmodified lines
7070 &spi0 {
7171 status = "okay";
7272
73− cr50@0 {
73+ tpm@0 {
7474 compatible = "google,cr50";
7575 reg = <0>;
7676 interrupt-parent = <&gpio0>;
arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi+1−1
@@ -706,7 +706,7 @@ camera: &i2c7 { · 705 unmodified lines
706706 &spi2 {
707707 status = "okay";
708708
709− cr50@0 {
709+ tpm@0 {
710710 compatible = "google,cr50";
711711 reg = <0>;
712712 interrupt-parent = <&gpio1>;
arch/arm64/include/asm/vdso.h+0−3
@@ -17,9 +17,6 @@ · 16 unmodified lines
1717 #ifndef __ASSEMBLY__
1818
1919 #include <generated/vdso-offsets.h>
20−#ifdef CONFIG_COMPAT_VDSO
21−#include <generated/vdso32-offsets.h>
22−#endif
2320
2421 #define VDSO_SYMBOL(base, name) \
2522 ({ \
arch/arm64/kernel/Makefile+3−3
@@ -77,9 +77,9 @@ obj-$(CONFIG_UNWIND_PATCH_PAC_INTO_SCS) += patch-scs.o · 76 unmodified lines
7777 # We need to prevent the SCS patching code from patching itself. Using
7878 # -mbranch-protection=none here to avoid the patchable PAC opcodes from being
7979 # generated triggers an issue with full LTO on Clang, which stops emitting PAC
80−# instructions altogether. So instead, omit the unwind tables used by the
81−# patching code, so it will not be able to locate its own PAC instructions.
82−CFLAGS_patch-scs.o += -fno-asynchronous-unwind-tables -fno-unwind-tables
80+# instructions altogether. So disable LTO as well for the compilation unit.
81+CFLAGS_patch-scs.o += -mbranch-protection=none
82+CFLAGS_REMOVE_patch-scs.o += $(CC_FLAGS_LTO)
8383
8484 # Force dependency (vdso*-wrap.S includes vdso.so through incbin)
8585 $(obj)/vdso-wrap.o: $(obj)/vdso/vdso.so
arch/arm64/kernel/vdso32/Makefile+0−9
@@ -127,9 +127,6 @@ obj-vdso := $(c-obj-vdso) $(c-obj-vdso-gettimeofday) $(asm-obj-vdso) · 126 unmodified lines
127127 targets += vdso.lds
128128 CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
129129
130−include/generated/vdso32-offsets.h: $(obj)/vdso32.so.dbg FORCE
131− $(call if_changed,vdsosym)
132−
133130 # Strip rule for vdso.so
134131 $(obj)/vdso.so: OBJCOPYFLAGS := -S
135132 $(obj)/vdso.so: $(obj)/vdso32.so.dbg FORCE
@@ -166,9 +163,3 @@ quiet_cmd_vdsoas = AS32 $@ · 30 unmodified lines
166163
167164 quiet_cmd_vdsomunge = MUNGE $@
168165 cmd_vdsomunge = $(obj)/$(munge) $< $@
169−
170−# Generate vDSO offsets using helper script (borrowed from the 64-bit vDSO)
171−gen-vdsosym := $(srctree)/$(src)/../vdso/gen_vdso_offsets.sh
172−quiet_cmd_vdsosym = VDSOSYM $@
173−# The AArch64 nm should be able to read an AArch32 binary
174− cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@
arch/loongarch/include/asm/kvm_vcpu.h+2−2
@@ -60,7 +60,7 @@ int kvm_own_lsx(struct kvm_vcpu *vcpu); · 59 unmodified lines
6060 void kvm_save_lsx(struct loongarch_fpu *fpu);
6161 void kvm_restore_lsx(struct loongarch_fpu *fpu);
6262 #else
63−static inline int kvm_own_lsx(struct kvm_vcpu *vcpu) { }
63+static inline int kvm_own_lsx(struct kvm_vcpu *vcpu) { return -EINVAL; }
6464 static inline void kvm_save_lsx(struct loongarch_fpu *fpu) { }
6565 static inline void kvm_restore_lsx(struct loongarch_fpu *fpu) { }
6666 #endif
@@ -70,7 +70,7 @@ int kvm_own_lasx(struct kvm_vcpu *vcpu); · 3 unmodified lines
7070 void kvm_save_lasx(struct loongarch_fpu *fpu);
7171 void kvm_restore_lasx(struct loongarch_fpu *fpu);
7272 #else
73−static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { }
73+static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { return -EINVAL; }
7474 static inline void kvm_save_lasx(struct loongarch_fpu *fpu) { }
7575 static inline void kvm_restore_lasx(struct loongarch_fpu *fpu) { }
7676 #endif
arch/loongarch/kernel/smp.c+0−1
@@ -509,7 +509,6 @@ asmlinkage void start_secondary(void) · 508 unmodified lines
509509 sync_counter();
510510 cpu = raw_smp_processor_id();
511511 set_my_cpu_offset(per_cpu_offset(cpu));
512− rcutree_report_cpu_starting(cpu);
513512
514513 cpu_probe();
515514 constant_clockevent_init();
arch/loongarch/kvm/mmu.c+2−2
@@ -675,7 +675,7 @@ static bool fault_supports_huge_mapping(struct kvm_memory_slot *memslot, · 674 unmodified lines
675675 *
676676 * There are several ways to safely use this helper:
677677 *
678− * - Check mmu_invalidate_retry_hva() after grabbing the mapping level, before
678+ * - Check mmu_invalidate_retry_gfn() after grabbing the mapping level, before
679679 * consuming it. In this case, mmu_lock doesn't need to be held during the
680680 * lookup, but it does need to be held while checking the MMU notifier.
681681 *
@@ -855,7 +855,7 @@ retry: · 173 unmodified lines
855855
856856 /* Check if an invalidation has taken place since we got pfn */
857857 spin_lock(&kvm->mmu_lock);
858− if (mmu_invalidate_retry_hva(kvm, mmu_seq, hva)) {
858+ if (mmu_invalidate_retry_gfn(kvm, mmu_seq, gfn)) {
859859 /*
860860 * This can happen when mappings are changed asynchronously, but
861861 * also synchronously if a COW is triggered by
arch/loongarch/mm/tlb.c+10−6
@@ -284,12 +284,16 @@ static void setup_tlb_handler(int cpu) · 283 unmodified lines
284284 set_handler(EXCCODE_TLBNR * VECSIZE, handle_tlb_protect, VECSIZE);
285285 set_handler(EXCCODE_TLBNX * VECSIZE, handle_tlb_protect, VECSIZE);
286286 set_handler(EXCCODE_TLBPE * VECSIZE, handle_tlb_protect, VECSIZE);
287− }
287+ } else {
288+ int vec_sz __maybe_unused;
289+ void *addr __maybe_unused;
290+ struct page *page __maybe_unused;
291+
292+ /* Avoid lockdep warning */
293+ rcutree_report_cpu_starting(cpu);
294+
288295 #ifdef CONFIG_NUMA
289− else {
290− void *addr;
291− struct page *page;
292− const int vec_sz = sizeof(exception_handlers);
296+ vec_sz = sizeof(exception_handlers);
293297
294298 if (pcpu_handlers[cpu])
295299 return;
@@ -305,8 +309,8 @@ static void setup_tlb_handler(int cpu) · 9 unmodified lines
305309 csr_write64(pcpu_handlers[cpu], LOONGARCH_CSR_EENTRY);
306310 csr_write64(pcpu_handlers[cpu], LOONGARCH_CSR_MERRENTRY);
307311 csr_write64(pcpu_handlers[cpu] + 80*VECSIZE, LOONGARCH_CSR_TLBRENTRY);
308− }
309312 #endif
313+ }
310314 }
311315
312316 void tlb_init(int cpu)
arch/m68k/Makefile+2−2
@@ -15,10 +15,10 @@ · 14 unmodified lines
1515 KBUILD_DEFCONFIG := multi_defconfig
1616
1717 ifdef cross_compiling
18− ifeq ($(CROSS_COMPILE),)
18+ ifeq ($(CROSS_COMPILE),)
1919 CROSS_COMPILE := $(call cc-cross-prefix, \
2020 m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
21− endif
21+ endif
2222 endif
2323
2424 #
arch/mips/alchemy/common/prom.c+1−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
4040 #include <linux/string.h>
4141
4242 #include <asm/bootinfo.h>
43+#include <prom.h>
4344
4445 int prom_argc;
4546 char **prom_argv;
arch/mips/alchemy/common/setup.c+1−3
@@ -30,13 +30,11 @@ · 29 unmodified lines
3030 #include <linux/mm.h>
3131 #include <linux/dma-map-ops.h> /* for dma_default_coherent */
3232
33+#include <asm/bootinfo.h>
3334 #include <asm/mipsregs.h>
3435
3536 #include <au1000.h>
3637
37−extern void __init board_setup(void);
38−extern void __init alchemy_set_lpj(void);
39−
4038 static bool alchemy_dma_coherent(void)
4139 {
4240 switch (alchemy_get_cputype()) {
arch/mips/bcm63xx/boards/board_bcm963xx.c+1−1
@@ -702,7 +702,7 @@ static struct ssb_sprom bcm63xx_sprom = { · 701 unmodified lines
702702 .boardflags_hi = 0x0000,
703703 };
704704
705−int bcm63xx_get_fallback_sprom(struct ssb_bus *bus, struct ssb_sprom *out)
705+static int bcm63xx_get_fallback_sprom(struct ssb_bus *bus, struct ssb_sprom *out)
706706 {
707707 if (bus->bustype == SSB_BUSTYPE_PCI) {
708708 memcpy(out, &bcm63xx_sprom, sizeof(struct ssb_sprom));
arch/mips/bcm63xx/dev-rng.c+1−1
@@ -26,7 +26,7 @@ static struct platform_device bcm63xx_rng_device = { · 25 unmodified lines
2626 .resource = rng_resources,
2727 };
2828
29−int __init bcm63xx_rng_register(void)
29+static int __init bcm63xx_rng_register(void)
3030 {
3131 if (!BCMCPU_IS_6368())
3232 return -ENODEV;
arch/mips/bcm63xx/dev-uart.c+1−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/kernel.h>
1111 #include <linux/platform_device.h>
1212 #include <bcm63xx_cpu.h>
13+#include <bcm63xx_dev_uart.h>
1314
1415 static struct resource uart0_resources[] = {
1516 {
arch/mips/bcm63xx/dev-wdt.c+1−1
@@ -34,7 +34,7 @@ static struct platform_device bcm63xx_wdt_device = { · 33 unmodified lines
3434 },
3535 };
3636
37−int __init bcm63xx_wdt_register(void)
37+static int __init bcm63xx_wdt_register(void)
3838 {
3939 wdt_resources[0].start = bcm63xx_regset_address(RSET_WDT);
4040 wdt_resources[0].end = wdt_resources[0].start;
arch/mips/bcm63xx/irq.c+1−1
@@ -72,7 +72,7 @@ static inline int enable_irq_for_cpu(int cpu, struct irq_data *d, · 71 unmodified lines
7272 */
7373
7474 #define BUILD_IPIC_INTERNAL(width) \
75−void __dispatch_internal_##width(int cpu) \
75+static void __dispatch_internal_##width(int cpu) \
7676 { \
7777 u32 pending[width / 32]; \
7878 unsigned int src, tgt; \
arch/mips/bcm63xx/setup.c+1−1
@@ -159,7 +159,7 @@ void __init plat_mem_setup(void) · 158 unmodified lines
159159 board_setup();
160160 }
161161
162−int __init bcm63xx_register_devices(void)
162+static int __init bcm63xx_register_devices(void)
163163 {
164164 /* register gpiochip */
165165 bcm63xx_gpio_init();
arch/mips/bcm63xx/timer.c+1−1
@@ -178,7 +178,7 @@ int bcm63xx_timer_set(int id, int monotonic, unsigned int countdown_us) · 177 unmodified lines
178178
179179 EXPORT_SYMBOL(bcm63xx_timer_set);
180180
181−int bcm63xx_timer_init(void)
181+static int bcm63xx_timer_init(void)
182182 {
183183 int ret, irq;
184184 u32 reg;
arch/mips/cobalt/setup.c+0−3
@@ -23,9 +23,6 @@ · 22 unmodified lines
2323
2424 #include <cobalt.h>
2525
26−extern void cobalt_machine_restart(char *command);
27−extern void cobalt_machine_halt(void);
28−
2926 const char *get_system_type(void)
3027 {
3128 switch (cobalt_board_id) {
arch/mips/fw/arc/memory.c+1−1
@@ -37,7 +37,7 @@ static unsigned int nr_prom_mem __initdata; · 36 unmodified lines
3737 */
3838 #define ARC_PAGE_SHIFT 12
3939
40−struct linux_mdesc * __init ArcGetMemoryDescriptor(struct linux_mdesc *Current)
40+static struct linux_mdesc * __init ArcGetMemoryDescriptor(struct linux_mdesc *Current)
4141 {
4242 return (struct linux_mdesc *) ARC_CALL1(get_mdesc, Current);
4343 }
arch/mips/include/asm/mach-au1x00/au1000.h+3−0
@@ -597,6 +597,9 @@ · 596 unmodified lines
597597
598598 #include <asm/cpu.h>
599599
600+void alchemy_set_lpj(void);
601+void board_setup(void);
602+
600603 /* helpers to access the SYS_* registers */
601604 static inline unsigned long alchemy_rdsys(int regofs)
602605 {
arch/mips/include/asm/mach-cobalt/cobalt.h+3−0
@@ -19,4 +19,7 @@ extern int cobalt_board_id; · 18 unmodified lines
1919 #define COBALT_BRD_ID_QUBE2 0x5
2020 #define COBALT_BRD_ID_RAQ2 0x6
2121
22+void cobalt_machine_halt(void);
23+void cobalt_machine_restart(char *command);
24+
2225 #endif /* __ASM_COBALT_H */
arch/mips/kernel/elf.c+6−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111
1212 #include <asm/cpu-features.h>
1313 #include <asm/cpu-info.h>
14+#include <asm/fpu.h>
1415
1516 #ifdef CONFIG_MIPS_FP_SUPPORT
1617
@@ -309,6 +310,11 @@ void mips_set_personality_nan(struct arch_elf_state *state) · 292 unmodified lines
309310 struct cpuinfo_mips *c = &boot_cpu_data;
310311 struct task_struct *t = current;
311312
313+ /* Do this early so t->thread.fpu.fcr31 won't be clobbered in case
314+ * we are preempted before the lose_fpu(0) in start_thread.
315+ */
316+ lose_fpu(0);
317+
312318 t->thread.fpu.fcr31 = c->fpu_csr31;
313319 switch (state->nan_2008) {
314320 case 0:
arch/mips/kernel/traps.c+7−1
@@ -2007,7 +2007,13 @@ unsigned long vi_handlers[64]; · 2006 unmodified lines
20072007
20082008 void reserve_exception_space(phys_addr_t addr, unsigned long size)
20092009 {
2010− memblock_reserve(addr, size);
2010+ /*
2011+ * reserve exception space on CPUs other than CPU0
2012+ * is too late, since memblock is unavailable when APs
2013+ * up
2014+ */
2015+ if (smp_processor_id() == 0)
2016+ memblock_reserve(addr, size);
20112017 }
20122018
20132019 void __init *set_except_vector(int n, void *addr)
arch/mips/lantiq/prom.c+3−4
@@ -108,10 +108,9 @@ void __init prom_init(void) · 107 unmodified lines
108108 prom_init_cmdline();
109109
110110 #if defined(CONFIG_MIPS_MT_SMP)
111− if (cpu_has_mipsmt) {
112− lantiq_smp_ops = vsmp_smp_ops;
111+ lantiq_smp_ops = vsmp_smp_ops;
112+ if (cpu_has_mipsmt)
113113 lantiq_smp_ops.init_secondary = lantiq_init_secondary;
114− register_smp_ops(&lantiq_smp_ops);
115− }
114+ register_smp_ops(&lantiq_smp_ops);
116115 #endif
117116 }
arch/mips/loongson64/init.c+3−0
@@ -103,6 +103,9 @@ void __init szmem(unsigned int node) · 102 unmodified lines
103103 if (loongson_sysconf.vgabios_addr)
104104 memblock_reserve(virt_to_phys((void *)loongson_sysconf.vgabios_addr),
105105 SZ_256K);
106+ /* set nid for reserved memory */
107+ memblock_set_node((u64)node << 44, (u64)(node + 1) << 44,
108+ &memblock.reserved, node);
106109 }
107110
108111 #ifndef CONFIG_NUMA
arch/mips/loongson64/numa.c+2−0
@@ -132,6 +132,8 @@ static void __init node_mem_init(unsigned int node) · 131 unmodified lines
132132
133133 /* Reserve pfn range 0~node[0]->node_start_pfn */
134134 memblock_reserve(0, PAGE_SIZE * start_pfn);
135+ /* set nid for reserved memory on node 0 */
136+ memblock_set_node(0, 1ULL << 44, &memblock.reserved, 0);
135137 }
136138 }
137139
arch/mips/sgi-ip27/Makefile+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55
66 obj-y := ip27-berr.o ip27-irq.o ip27-init.o ip27-klconfig.o \
77 ip27-klnuma.o ip27-memory.o ip27-nmi.o ip27-reset.o ip27-timer.o \
8− ip27-hubio.o ip27-xtalk.o
8+ ip27-xtalk.o
99
1010 obj-$(CONFIG_EARLY_PRINTK) += ip27-console.o
1111 obj-$(CONFIG_SMP) += ip27-smp.o
arch/mips/sgi-ip27/ip27-berr.c+3−1
@@ -22,6 +22,8 @@ · 21 unmodified lines
2222 #include <asm/traps.h>
2323 #include <linux/uaccess.h>
2424
25+#include "ip27-common.h"
26+
2527 static void dump_hub_information(unsigned long errst0, unsigned long errst1)
2628 {
2729 static char *err_type[2][8] = {
@@ -57,7 +59,7 @@ static void dump_hub_information(unsigned long errst0, unsigned long errst1) · 29 unmodified lines
5759 [st0.pi_stat0_fmt.s0_err_type] ? : "invalid");
5860 }
5961
60−int ip27_be_handler(struct pt_regs *regs, int is_fixup)
62+static int ip27_be_handler(struct pt_regs *regs, int is_fixup)
6163 {
6264 unsigned long errst0, errst1;
6365 int data = regs->cp0_cause & 4;
arch/mips/sgi-ip27/ip27-common.h+2−0
@@ -10,6 +10,7 @@ extern void hub_rt_clock_event_init(void); · 9 unmodified lines
1010 extern void hub_rtc_init(nasid_t nasid);
1111 extern void install_cpu_nmi_handler(int slice);
1212 extern void install_ipi(void);
13+extern void ip27_be_init(void);
1314 extern void ip27_reboot_setup(void);
1415 extern const struct plat_smp_ops ip27_smp_ops;
1516 extern unsigned long node_getfirstfree(nasid_t nasid);
@@ -17,4 +18,5 @@ extern void per_cpu_init(void); · 1 unmodified line
1718 extern void replicate_kernel_text(void);
1819 extern void setup_replication_mask(void);
1920
21+
2022 #endif /* __IP27_COMMON_H */
arch/mips/sgi-ip27/ip27-hubio.c+0−185
@@ -1,185 +0,0 @@
1−// SPDX-License-Identifier: GPL-2.0-only
2−/*
3− * Copyright (C) 1992-1997, 2000-2003 Silicon Graphics, Inc.
4− * Copyright (C) 2004 Christoph Hellwig.
5− *
6− * Support functions for the HUB ASIC - mostly PIO mapping related.
7− */
8−
9−#include <linux/bitops.h>
10−#include <linux/string.h>
11−#include <linux/mmzone.h>
12−#include <asm/sn/addrs.h>
13−#include <asm/sn/arch.h>
14−#include <asm/sn/agent.h>
15−#include <asm/sn/io.h>
16−#include <asm/xtalk/xtalk.h>
17−
18−
19−static int force_fire_and_forget = 1;
20−
21−/**
22− * hub_pio_map - establish a HUB PIO mapping
23− *
24− * @nasid: nasid to perform PIO mapping on
25− * @widget: widget ID to perform PIO mapping for
26− * @xtalk_addr: xtalk_address that needs to be mapped
27− * @size: size of the PIO mapping
28− *
29− **/
30−unsigned long hub_pio_map(nasid_t nasid, xwidgetnum_t widget,
31− unsigned long xtalk_addr, size_t size)
32−{
33− unsigned i;
34−
35− /* use small-window mapping if possible */
36− if ((xtalk_addr % SWIN_SIZE) + size <= SWIN_SIZE)
37− return NODE_SWIN_BASE(nasid, widget) + (xtalk_addr % SWIN_SIZE);
38−
39− if ((xtalk_addr % BWIN_SIZE) + size > BWIN_SIZE) {
40− printk(KERN_WARNING "PIO mapping at hub %d widget %d addr 0x%lx"
41− " too big (%ld)\n",
42− nasid, widget, xtalk_addr, size);
43− return 0;
44− }
45−
46− xtalk_addr &= ~(BWIN_SIZE-1);
47− for (i = 0; i < HUB_NUM_BIG_WINDOW; i++) {
48− if (test_and_set_bit(i, hub_data(nasid)->h_bigwin_used))
49− continue;
50−
51− /*
52− * The code below does a PIO write to setup an ITTE entry.
53− *
54− * We need to prevent other CPUs from seeing our updated
55− * memory shadow of the ITTE (in the piomap) until the ITTE
56− * entry is actually set up; otherwise, another CPU might
57− * attempt a PIO prematurely.
58− *
59− * Also, the only way we can know that an entry has been
60− * received by the hub and can be used by future PIO reads/
61− * writes is by reading back the ITTE entry after writing it.
62− *
63− * For these two reasons, we PIO read back the ITTE entry
64− * after we write it.
65− */
66− IIO_ITTE_PUT(nasid, i, HUB_PIO_MAP_TO_MEM, widget, xtalk_addr);
67− __raw_readq(IIO_ITTE_GET(nasid, i));
68−
69− return NODE_BWIN_BASE(nasid, widget) + (xtalk_addr % BWIN_SIZE);
70− }
71−
72− printk(KERN_WARNING "unable to establish PIO mapping for at"
73− " hub %d widget %d addr 0x%lx\n",
74− nasid, widget, xtalk_addr);
75− return 0;
76−}
77−
78−
79−/*
80− * hub_setup_prb(nasid, prbnum, credits, conveyor)
81− *
82− * Put a PRB into fire-and-forget mode if conveyor isn't set. Otherwise,
83− * put it into conveyor belt mode with the specified number of credits.
84− */
85−static void hub_setup_prb(nasid_t nasid, int prbnum, int credits)
86−{
87− union iprb_u prb;
88− int prb_offset;
89−
90− /*
91− * Get the current register value.
92− */
93− prb_offset = IIO_IOPRB(prbnum);
94− prb.iprb_regval = REMOTE_HUB_L(nasid, prb_offset);
95−
96− /*
97− * Clear out some fields.
98− */
99− prb.iprb_ovflow = 1;
100− prb.iprb_bnakctr = 0;
101− prb.iprb_anakctr = 0;
102−
103− /*
104− * Enable or disable fire-and-forget mode.
105− */
106− prb.iprb_ff = force_fire_and_forget ? 1 : 0;
107−
108− /*
109− * Set the appropriate number of PIO credits for the widget.
110− */
111− prb.iprb_xtalkctr = credits;
112−
113− /*
114− * Store the new value to the register.
115− */
116− REMOTE_HUB_S(nasid, prb_offset, prb.iprb_regval);
117−}
118−
119−/**
120− * hub_set_piomode - set pio mode for a given hub
121− *
122− * @nasid: physical node ID for the hub in question
123− *
124− * Put the hub into either "PIO conveyor belt" mode or "fire-and-forget" mode.
125− * To do this, we have to make absolutely sure that no PIOs are in progress
126− * so we turn off access to all widgets for the duration of the function.
127− *
128− * XXX - This code should really check what kind of widget we're talking
129− * to. Bridges can only handle three requests, but XG will do more.
130− * How many can crossbow handle to widget 0? We're assuming 1.
131− *
132− * XXX - There is a bug in the crossbow that link reset PIOs do not
133− * return write responses. The easiest solution to this problem is to
134− * leave widget 0 (xbow) in fire-and-forget mode at all times. This
135− * only affects pio's to xbow registers, which should be rare.
136− **/
137−static void hub_set_piomode(nasid_t nasid)
138−{
139− u64 ii_iowa;
140− union hubii_wcr_u ii_wcr;
141− unsigned i;
142−
143− ii_iowa = REMOTE_HUB_L(nasid, IIO_OUTWIDGET_ACCESS);
144− REMOTE_HUB_S(nasid, IIO_OUTWIDGET_ACCESS, 0);
145−
146− ii_wcr.wcr_reg_value = REMOTE_HUB_L(nasid, IIO_WCR);
147−
148− if (ii_wcr.iwcr_dir_con) {
149− /*
150− * Assume a bridge here.
151− */
152− hub_setup_prb(nasid, 0, 3);
153− } else {
154− /*
155− * Assume a crossbow here.
156− */
157− hub_setup_prb(nasid, 0, 1);
158− }
159−
160− /*
161− * XXX - Here's where we should take the widget type into
162− * when account assigning credits.
163− */
164− for (i = HUB_WIDGET_ID_MIN; i <= HUB_WIDGET_ID_MAX; i++)
165− hub_setup_prb(nasid, i, 3);
166−
167− REMOTE_HUB_S(nasid, IIO_OUTWIDGET_ACCESS, ii_iowa);
168−}
169−
170−/*
171− * hub_pio_init - PIO-related hub initialization
172− *
173− * @hub: hubinfo structure for our hub
174− */
175−void hub_pio_init(nasid_t nasid)
176−{
177− unsigned i;
178−
179− /* initialize big window piomaps for this hub */
180− bitmap_zero(hub_data(nasid)->h_bigwin_used, HUB_NUM_BIG_WINDOW);
181− for (i = 0; i < HUB_NUM_BIG_WINDOW; i++)
182− IIO_ITTE_DISABLE(nasid, i);
183−
184− hub_set_piomode(nasid);
185−}
arch/mips/sgi-ip27/ip27-irq.c+2−0
@@ -23,6 +23,8 @@ · 22 unmodified lines
2323 #include <asm/sn/intr.h>
2424 #include <asm/sn/irq_alloc.h>
2525
26+#include "ip27-common.h"
27+
2628 struct hub_irq_data {
2729 u64 *irq_mask[2];
2830 cpuid_t cpu;
arch/mips/sgi-ip27/ip27-memory.c+1−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <asm/page.h>
2424 #include <asm/pgalloc.h>
2525 #include <asm/sections.h>
26+#include <asm/sgialib.h>
2627
2728 #include <asm/sn/arch.h>
2829 #include <asm/sn/agent.h>
arch/mips/sgi-ip27/ip27-nmi.c+8−17
@@ -11,6 +11,8 @@ · 10 unmodified lines
1111 #include <asm/sn/arch.h>
1212 #include <asm/sn/agent.h>
1313
14+#include "ip27-common.h"
15+
1416 #if 0
1517 #define NODE_NUM_CPUS(n) CNODE_NUM_CPUS(n)
1618 #else
@@ -23,16 +25,7 @@ · 6 unmodified lines
2325 typedef unsigned long machreg_t;
2426
2527 static arch_spinlock_t nmi_lock = __ARCH_SPIN_LOCK_UNLOCKED;
26−
27−/*
28− * Let's see what else we need to do here. Set up sp, gp?
29− */
30−void nmi_dump(void)
31−{
32− void cont_nmi_dump(void);
33−
34− cont_nmi_dump();
35−}
28+static void nmi_dump(void);
3629
3730 void install_cpu_nmi_handler(int slice)
3831 {
@@ -53,7 +46,7 @@ void install_cpu_nmi_handler(int slice) · 14 unmodified lines
5346 * into the eframe format for the node under consideration.
5447 */
5548
56−void nmi_cpu_eframe_save(nasid_t nasid, int slice)
49+static void nmi_cpu_eframe_save(nasid_t nasid, int slice)
5750 {
5851 struct reg_struct *nr;
5952 int i;
@@ -129,7 +122,7 @@ void nmi_cpu_eframe_save(nasid_t nasid, int slice) · 69 unmodified lines
129122 pr_emerg("\n");
130123 }
131124
132−void nmi_dump_hub_irq(nasid_t nasid, int slice)
125+static void nmi_dump_hub_irq(nasid_t nasid, int slice)
133126 {
134127 u64 mask0, mask1, pend0, pend1;
135128
@@ -153,7 +146,7 @@ void nmi_dump_hub_irq(nasid_t nasid, int slice) · 17 unmodified lines
153146 * Copy the cpu registers which have been saved in the IP27prom format
154147 * into the eframe format for the node under consideration.
155148 */
156−void nmi_node_eframe_save(nasid_t nasid)
149+static void nmi_node_eframe_save(nasid_t nasid)
157150 {
158151 int slice;
159152
@@ -170,8 +163,7 @@ void nmi_node_eframe_save(nasid_t nasid) · 10 unmodified lines
170163 /*
171164 * Save the nmi cpu registers for all cpus in the system.
172165 */
173−void
174−nmi_eframes_save(void)
166+static void nmi_eframes_save(void)
175167 {
176168 nasid_t nasid;
177169
@@ -179,8 +171,7 @@ nmi_eframes_save(void) · 1 unmodified line
179171 nmi_node_eframe_save(nasid);
180172 }
181173
182−void
183−cont_nmi_dump(void)
174+static void nmi_dump(void)
184175 {
185176 #ifndef REAL_NMI_SIGNAL
186177 static atomic_t nmied_cpus = ATOMIC_INIT(0);
arch/mips/sgi-ip30/ip30-console.c+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 #include <linux/io.h>
44
55 #include <asm/sn/ioc3.h>
6+#include <asm/setup.h>
67
78 static inline struct ioc3_uartregs *console_uart(void)
89 {
arch/mips/sgi-ip30/ip30-setup.c+1−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <linux/percpu.h>
1515 #include <linux/memblock.h>
1616
17+#include <asm/bootinfo.h>
1718 #include <asm/smp-ops.h>
1819 #include <asm/sgialib.h>
1920 #include <asm/time.h>
arch/mips/sgi-ip32/crime.c+4−2
@@ -18,6 +18,8 @@ · 17 unmodified lines
1818 #include <asm/ip32/crime.h>
1919 #include <asm/ip32/mace.h>
2020
21+#include "ip32-common.h"
22+
2123 struct sgi_crime __iomem *crime;
2224 struct sgi_mace __iomem *mace;
2325
@@ -39,7 +41,7 @@ void __init crime_init(void) · 15 unmodified lines
3941 id, rev, field, (unsigned long) CRIME_BASE);
4042 }
4143
42−irqreturn_t crime_memerr_intr(unsigned int irq, void *dev_id)
44+irqreturn_t crime_memerr_intr(int irq, void *dev_id)
4345 {
4446 unsigned long stat, addr;
4547 int fatal = 0;
@@ -90,7 +92,7 @@ irqreturn_t crime_memerr_intr(unsigned int irq, void *dev_id) · 44 unmodified lines
9092 return IRQ_HANDLED;
9193 }
9294
93−irqreturn_t crime_cpuerr_intr(unsigned int irq, void *dev_id)
95+irqreturn_t crime_cpuerr_intr(int irq, void *dev_id)
9496 {
9597 unsigned long stat = crime->cpu_error_stat & CRIME_CPU_ERROR_MASK;
9698 unsigned long addr = crime->cpu_error_addr & CRIME_CPU_ERROR_ADDR_MASK;
arch/mips/sgi-ip32/ip32-berr.c+2−0
@@ -18,6 +18,8 @@ · 17 unmodified lines
1818 #include <asm/ptrace.h>
1919 #include <asm/tlbdebug.h>
2020
21+#include "ip32-common.h"
22+
2123 static int ip32_be_handler(struct pt_regs *regs, int is_fixup)
2224 {
2325 int data = regs->cp0_cause & 4;
arch/mips/sgi-ip32/ip32-common.h+15−0
@@ -0,0 +1,15 @@
1+/* SPDX-License-Identifier: GPL-2.0-only */
2+
3+#ifndef __IP32_COMMON_H
4+#define __IP32_COMMON_H
5+
6+#include <linux/init.h>
7+#include <linux/interrupt.h>
8+
9+void __init crime_init(void);
10+irqreturn_t crime_memerr_intr(int irq, void *dev_id);
11+irqreturn_t crime_cpuerr_intr(int irq, void *dev_id);
12+void __init ip32_be_init(void);
13+void ip32_prepare_poweroff(void);
14+
15+#endif /* __IP32_COMMON_H */
arch/mips/sgi-ip32/ip32-irq.c+2−4
@@ -28,6 +28,8 @@ · 27 unmodified lines
2828 #include <asm/ip32/mace.h>
2929 #include <asm/ip32/ip32_ints.h>
3030
31+#include "ip32-common.h"
32+
3133 /* issue a PIO read to make sure no PIO writes are pending */
3234 static inline void flush_crime_bus(void)
3335 {
@@ -107,10 +109,6 @@ static inline void flush_mace_bus(void) · 73 unmodified lines
107109 * is quite different anyway.
108110 */
109111
110−/* Some initial interrupts to set up */
111−extern irqreturn_t crime_memerr_intr(int irq, void *dev_id);
112−extern irqreturn_t crime_cpuerr_intr(int irq, void *dev_id);
113−
114112 /*
115113 * This is for pure CRIME interrupts - ie not MACE. The advantage?
116114 * We get to split the register in half and do faster lookups.
arch/mips/sgi-ip32/ip32-memory.c+1−0
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <asm/ip32/crime.h>
1616 #include <asm/bootinfo.h>
1717 #include <asm/page.h>
18+#include <asm/sgialib.h>
1819
1920 extern void crime_init(void);
2021
arch/mips/sgi-ip32/ip32-reset.c+2−0
@@ -29,6 +29,8 @@ · 28 unmodified lines
2929 #include <asm/ip32/crime.h>
3030 #include <asm/ip32/ip32_ints.h>
3131
32+#include "ip32-common.h"
33+
3234 #define POWERDOWN_TIMEOUT 120
3335 /*
3436 * Blink frequency during reboot grace period and when panicked.
arch/mips/sgi-ip32/ip32-setup.c+1−2
@@ -26,8 +26,7 @@ · 25 unmodified lines
2626 #include <asm/ip32/mace.h>
2727 #include <asm/ip32/ip32_ints.h>
2828
29−extern void ip32_be_init(void);
30−extern void crime_init(void);
29+#include "ip32-common.h"
3130
3231 #ifdef CONFIG_SGI_O2MACE_ETH
3332 /*
arch/parisc/Kconfig+0−1
@@ -25,7 +25,6 @@ config PARISC · 24 unmodified lines
2525 select RTC_DRV_GENERIC
2626 select INIT_ALL_POSSIBLE
2727 select BUG
28− select BUILDTIME_TABLE_SORT
2928 select HAVE_KERNEL_UNCOMPRESSED
3029 select HAVE_PCI
3130 select HAVE_PERF_EVENTS
arch/parisc/Makefile+2−2
@@ -50,12 +50,12 @@ export CROSS32CC · 49 unmodified lines
5050
5151 # Set default cross compiler for kernel build
5252 ifdef cross_compiling
53− ifeq ($(CROSS_COMPILE),)
53+ ifeq ($(CROSS_COMPILE),)
5454 CC_SUFFIXES = linux linux-gnu unknown-linux-gnu suse-linux
5555 CROSS_COMPILE := $(call cc-cross-prefix, \
5656 $(foreach a,$(CC_ARCHES), \
5757 $(foreach s,$(CC_SUFFIXES),$(a)-$(s)-)))
58− endif
58+ endif
5959 endif
6060
6161 ifdef CONFIG_DYNAMIC_FTRACE
arch/parisc/include/asm/assembly.h+1−0
@@ -576,6 +576,7 @@ · 575 unmodified lines
576576 .section __ex_table,"aw" ! \
577577 .align 4 ! \
578578 .word (fault_addr - .), (except_addr - .) ! \
579+ or %r0,%r0,%r0 ! \
579580 .previous
580581
581582
arch/parisc/include/asm/extable.h+64−0
@@ -0,0 +1,64 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef __PARISC_EXTABLE_H
3+#define __PARISC_EXTABLE_H
4+
5+#include <asm/ptrace.h>
6+#include <linux/compiler.h>
7+
8+/*
9+ * The exception table consists of three addresses:
10+ *
11+ * - A relative address to the instruction that is allowed to fault.
12+ * - A relative address at which the program should continue (fixup routine)
13+ * - An asm statement which specifies which CPU register will
14+ * receive -EFAULT when an exception happens if the lowest bit in
15+ * the fixup address is set.
16+ *
17+ * Note: The register specified in the err_opcode instruction will be
18+ * modified at runtime if a fault happens. Register %r0 will be ignored.
19+ *
20+ * Since relative addresses are used, 32bit values are sufficient even on
21+ * 64bit kernel.
22+ */
23+
24+struct pt_regs;
25+int fixup_exception(struct pt_regs *regs);
26+
27+#define ARCH_HAS_RELATIVE_EXTABLE
28+struct exception_table_entry {
29+ int insn; /* relative address of insn that is allowed to fault. */
30+ int fixup; /* relative address of fixup routine */
31+ int err_opcode; /* sample opcode with register which holds error code */
32+};
33+
34+#define ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr, opcode )\
35+ ".section __ex_table,\"aw\"\n" \
36+ ".align 4\n" \
37+ ".word (" #fault_addr " - .), (" #except_addr " - .)\n" \
38+ opcode "\n" \
39+ ".previous\n"
40+
41+/*
42+ * ASM_EXCEPTIONTABLE_ENTRY_EFAULT() creates a special exception table entry
43+ * (with lowest bit set) for which the fault handler in fixup_exception() will
44+ * load -EFAULT on fault into the register specified by the err_opcode instruction,
45+ * and zeroes the target register in case of a read fault in get_user().
46+ */
47+#define ASM_EXCEPTIONTABLE_VAR(__err_var) \
48+ int __err_var = 0
49+#define ASM_EXCEPTIONTABLE_ENTRY_EFAULT( fault_addr, except_addr, register )\
50+ ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr + 1, "or %%r0,%%r0," register)
51+
52+static inline void swap_ex_entry_fixup(struct exception_table_entry *a,
53+ struct exception_table_entry *b,
54+ struct exception_table_entry tmp,
55+ int delta)
56+{
57+ a->fixup = b->fixup + delta;
58+ b->fixup = tmp.fixup - delta;
59+ a->err_opcode = b->err_opcode;
60+ b->err_opcode = tmp.err_opcode;
61+}
62+#define swap_ex_entry_fixup swap_ex_entry_fixup
63+
64+#endif
arch/parisc/include/asm/special_insns.h+4−2
@@ -8,7 +8,8 @@ · 7 unmodified lines
88 "copy %%r0,%0\n" \
99 "8:\tlpa %%r0(%1),%0\n" \
1010 "9:\n" \
11− ASM_EXCEPTIONTABLE_ENTRY(8b, 9b) \
11+ ASM_EXCEPTIONTABLE_ENTRY(8b, 9b, \
12+ "or %%r0,%%r0,%%r0") \
1213 : "=&r" (pa) \
1314 : "r" (va) \
1415 : "memory" \
@@ -22,7 +23,8 @@ · 7 unmodified lines
2223 "copy %%r0,%0\n" \
2324 "8:\tlpa %%r0(%%sr3,%1),%0\n" \
2425 "9:\n" \
25− ASM_EXCEPTIONTABLE_ENTRY(8b, 9b) \
26+ ASM_EXCEPTIONTABLE_ENTRY(8b, 9b, \
27+ "or %%r0,%%r0,%%r0") \
2628 : "=&r" (pa) \
2729 : "r" (va) \
2830 : "memory" \
arch/parisc/include/asm/uaccess.h+7−41
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 */
88 #include <asm/page.h>
99 #include <asm/cache.h>
10+#include <asm/extable.h>
1011
1112 #include <linux/bug.h>
1213 #include <linux/string.h>
@@ -26,37 +27,6 @@ · 13 unmodified lines
2627 #define STD_USER(sr, x, ptr) __put_user_asm(sr, "std", x, ptr)
2728 #endif
2829
29−/*
30− * The exception table contains two values: the first is the relative offset to
31− * the address of the instruction that is allowed to fault, and the second is
32− * the relative offset to the address of the fixup routine. Since relative
33− * addresses are used, 32bit values are sufficient even on 64bit kernel.
34− */
35−
36−#define ARCH_HAS_RELATIVE_EXTABLE
37−struct exception_table_entry {
38− int insn; /* relative address of insn that is allowed to fault. */
39− int fixup; /* relative address of fixup routine */
40−};
41−
42−#define ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr )\
43− ".section __ex_table,\"aw\"\n" \
44− ".align 4\n" \
45− ".word (" #fault_addr " - .), (" #except_addr " - .)\n\t" \
46− ".previous\n"
47−
48−/*
49− * ASM_EXCEPTIONTABLE_ENTRY_EFAULT() creates a special exception table entry
50− * (with lowest bit set) for which the fault handler in fixup_exception() will
51− * load -EFAULT into %r29 for a read or write fault, and zeroes the target
52− * register in case of a read fault in get_user().
53− */
54−#define ASM_EXCEPTIONTABLE_REG 29
55−#define ASM_EXCEPTIONTABLE_VAR(__variable) \
56− register long __variable __asm__ ("r29") = 0
57−#define ASM_EXCEPTIONTABLE_ENTRY_EFAULT( fault_addr, except_addr )\
58− ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr + 1)
59−
6030 #define __get_user_internal(sr, val, ptr) \
6131 ({ \
6232 ASM_EXCEPTIONTABLE_VAR(__gu_err); \
@@ -83,7 +53,7 @@ struct exception_table_entry { · 20 unmodified lines
8353 \
8454 __asm__("1: " ldx " 0(%%sr%2,%3),%0\n" \
8555 "9:\n" \
86− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b) \
56+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b, "%1") \
8757 : "=r"(__gu_val), "+r"(__gu_err) \
8858 : "i"(sr), "r"(ptr)); \
8959 \
@@ -115,8 +85,8 @@ struct exception_table_entry { · 25 unmodified lines
11585 "1: ldw 0(%%sr%2,%3),%0\n" \
11686 "2: ldw 4(%%sr%2,%3),%R0\n" \
11787 "9:\n" \
118− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b) \
119− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 9b) \
88+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b, "%1") \
89+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 9b, "%1") \
12090 : "=&r"(__gu_tmp.l), "+r"(__gu_err) \
12191 : "i"(sr), "r"(ptr)); \
12292 \
@@ -174,7 +144,7 @@ struct exception_table_entry { · 51 unmodified lines
174144 __asm__ __volatile__ ( \
175145 "1: " stx " %1,0(%%sr%2,%3)\n" \
176146 "9:\n" \
177− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b) \
147+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b, "%0") \
178148 : "+r"(__pu_err) \
179149 : "r"(x), "i"(sr), "r"(ptr))
180150
@@ -186,15 +156,14 @@ struct exception_table_entry { · 5 unmodified lines
186156 "1: stw %1,0(%%sr%2,%3)\n" \
187157 "2: stw %R1,4(%%sr%2,%3)\n" \
188158 "9:\n" \
189− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b) \
190− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 9b) \
159+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b, "%0") \
160+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 9b, "%0") \
191161 : "+r"(__pu_err) \
192162 : "r"(__val), "i"(sr), "r"(ptr)); \
193163 } while (0)
194164
195165 #endif /* !defined(CONFIG_64BIT) */
196166
197−
198167 /*
199168 * Complex access routines -- external declarations
200169 */
@@ -216,7 +185,4 @@ unsigned long __must_check raw_copy_from_user(void *dst, const void __user *src, · 15 unmodified lines
216185 #define INLINE_COPY_TO_USER
217186 #define INLINE_COPY_FROM_USER
218187
219−struct pt_regs;
220−int fixup_exception(struct pt_regs *regs);
221−
222188 #endif /* __PARISC_UACCESS_H */
arch/parisc/kernel/cache.c+7−3
@@ -58,7 +58,7 @@ int pa_serialize_tlb_flushes __ro_after_init; · 57 unmodified lines
5858
5959 struct pdc_cache_info cache_info __ro_after_init;
6060 #ifndef CONFIG_PA20
61−struct pdc_btlb_info btlb_info __ro_after_init;
61+struct pdc_btlb_info btlb_info;
6262 #endif
6363
6464 DEFINE_STATIC_KEY_TRUE(parisc_has_cache);
@@ -264,6 +264,10 @@ parisc_cache_init(void) · 199 unmodified lines
264264 icache_stride = CAFL_STRIDE(cache_info.ic_conf);
265265 #undef CAFL_STRIDE
266266
267+ /* stride needs to be non-zero, otherwise cache flushes will not work */
268+ WARN_ON(cache_info.dc_size && dcache_stride == 0);
269+ WARN_ON(cache_info.ic_size && icache_stride == 0);
270+
267271 if ((boot_cpu_data.pdc.capabilities & PDC_MODEL_NVA_MASK) ==
268272 PDC_MODEL_NVA_UNSUPPORTED) {
269273 printk(KERN_WARNING "parisc_cache_init: Only equivalent aliasing supported!\n");
@@ -850,7 +854,7 @@ SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, bytes, · 580 unmodified lines
850854 #endif
851855 " fic,m %3(%4,%0)\n"
852856 "2: sync\n"
853− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 2b)
857+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 2b, "%1")
854858 : "+r" (start), "+r" (error)
855859 : "r" (end), "r" (dcache_stride), "i" (SR_USER));
856860 }
@@ -865,7 +869,7 @@ SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, bytes, · 8 unmodified lines
865869 #endif
866870 " fdc,m %3(%4,%0)\n"
867871 "2: sync\n"
868− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 2b)
872+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 2b, "%1")
869873 : "+r" (start), "+r" (error)
870874 : "r" (end), "r" (icache_stride), "i" (SR_USER));
871875 }
arch/parisc/kernel/drivers.c+4−1
@@ -742,7 +742,7 @@ parse_tree_node(struct device *parent, int index, struct hardware_path *modpath) · 741 unmodified lines
742742 };
743743
744744 if (device_for_each_child(parent, &recurse_data, descend_children))
745− { /* nothing */ };
745+ { /* nothing */ }
746746
747747 return d.dev;
748748 }
@@ -1004,6 +1004,9 @@ static __init int qemu_print_iodc_data(struct device *lin_dev, void *data) · 255 unmodified lines
10041004
10051005 pr_info("\n");
10061006
1007+ /* Prevent hung task messages when printing on serial console */
1008+ cond_resched();
1009+
10071010 pr_info("#define HPA_%08lx_DESCRIPTION \"%s\"\n",
10081011 hpa, parisc_hardware_description(&dev->id));
10091012
arch/parisc/kernel/unaligned.c+22−22
@@ -120,8 +120,8 @@ static int emulate_ldh(struct pt_regs *regs, int toreg) · 119 unmodified lines
120120 "2: ldbs 1(%%sr1,%3), %0\n"
121121 " depw %2, 23, 24, %0\n"
122122 "3: \n"
123− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b)
124− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b)
123+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b, "%1")
124+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b, "%1")
125125 : "+r" (val), "+r" (ret), "=&r" (temp1)
126126 : "r" (saddr), "r" (regs->isr) );
127127
@@ -152,8 +152,8 @@ static int emulate_ldw(struct pt_regs *regs, int toreg, int flop) · 24 unmodified lines
152152 " mtctl %2,11\n"
153153 " vshd %0,%3,%0\n"
154154 "3: \n"
155− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b)
156− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b)
155+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b, "%1")
156+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b, "%1")
157157 : "+r" (val), "+r" (ret), "=&r" (temp1), "=&r" (temp2)
158158 : "r" (saddr), "r" (regs->isr) );
159159
@@ -189,8 +189,8 @@ static int emulate_ldd(struct pt_regs *regs, int toreg, int flop) · 29 unmodified lines
189189 " mtsar %%r19\n"
190190 " shrpd %0,%%r20,%%sar,%0\n"
191191 "3: \n"
192− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b)
193− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b)
192+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b, "%1")
193+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b, "%1")
194194 : "=r" (val), "+r" (ret)
195195 : "0" (val), "r" (saddr), "r" (regs->isr)
196196 : "r19", "r20" );
@@ -209,9 +209,9 @@ static int emulate_ldd(struct pt_regs *regs, int toreg, int flop) · 12 unmodified lines
209209 " vshd %0,%R0,%0\n"
210210 " vshd %R0,%4,%R0\n"
211211 "4: \n"
212− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 4b)
213− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 4b)
214− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(3b, 4b)
212+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 4b, "%1")
213+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 4b, "%1")
214+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(3b, 4b, "%1")
215215 : "+r" (val), "+r" (ret), "+r" (saddr), "=&r" (shift), "=&r" (temp1)
216216 : "r" (regs->isr) );
217217 }
@@ -244,8 +244,8 @@ static int emulate_sth(struct pt_regs *regs, int frreg) · 26 unmodified lines
244244 "1: stb %1, 0(%%sr1, %3)\n"
245245 "2: stb %2, 1(%%sr1, %3)\n"
246246 "3: \n"
247− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b)
248− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b)
247+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b, "%0")
248+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b, "%0")
249249 : "+r" (ret), "=&r" (temp1)
250250 : "r" (val), "r" (regs->ior), "r" (regs->isr) );
251251
@@ -285,8 +285,8 @@ static int emulate_stw(struct pt_regs *regs, int frreg, int flop) · 33 unmodified lines
285285 " stw %%r20,0(%%sr1,%2)\n"
286286 " stw %%r21,4(%%sr1,%2)\n"
287287 "3: \n"
288− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b)
289− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b)
288+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b, "%0")
289+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b, "%0")
290290 : "+r" (ret)
291291 : "r" (val), "r" (regs->ior), "r" (regs->isr)
292292 : "r19", "r20", "r21", "r22", "r1" );
@@ -329,10 +329,10 @@ static int emulate_std(struct pt_regs *regs, int frreg, int flop) · 36 unmodified lines
329329 "3: std %%r20,0(%%sr1,%2)\n"
330330 "4: std %%r21,8(%%sr1,%2)\n"
331331 "5: \n"
332− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 5b)
333− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 5b)
334− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(3b, 5b)
335− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(4b, 5b)
332+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 5b, "%0")
333+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 5b, "%0")
334+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(3b, 5b, "%0")
335+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(4b, 5b, "%0")
336336 : "+r" (ret)
337337 : "r" (val), "r" (regs->ior), "r" (regs->isr)
338338 : "r19", "r20", "r21", "r22", "r1" );
@@ -357,11 +357,11 @@ static int emulate_std(struct pt_regs *regs, int frreg, int flop) · 18 unmodified lines
357357 "4: stw %%r1,4(%%sr1,%2)\n"
358358 "5: stw %R1,8(%%sr1,%2)\n"
359359 "6: \n"
360− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 6b)
361− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 6b)
362− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(3b, 6b)
363− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(4b, 6b)
364− ASM_EXCEPTIONTABLE_ENTRY_EFAULT(5b, 6b)
360+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 6b, "%0")
361+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 6b, "%0")
362+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(3b, 6b, "%0")
363+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(4b, 6b, "%0")
364+ ASM_EXCEPTIONTABLE_ENTRY_EFAULT(5b, 6b, "%0")
365365 : "+r" (ret)
366366 : "r" (val), "r" (regs->ior), "r" (regs->isr)
367367 : "r19", "r20", "r21", "r1" );
arch/parisc/kernel/vmlinux.lds.S+1−1
@@ -127,7 +127,7 @@ SECTIONS · 126 unmodified lines
127127 }
128128 #endif
129129
130− RO_DATA(8)
130+ RO_DATA(PAGE_SIZE)
131131
132132 /* unwind info */
133133 . = ALIGN(4);
arch/parisc/mm/fault.c+8−3
@@ -150,11 +150,16 @@ int fixup_exception(struct pt_regs *regs) · 149 unmodified lines
150150 * Fix up get_user() and put_user().
151151 * ASM_EXCEPTIONTABLE_ENTRY_EFAULT() sets the least-significant
152152 * bit in the relative address of the fixup routine to indicate
153− * that gr[ASM_EXCEPTIONTABLE_REG] should be loaded with
154− * -EFAULT to report a userspace access error.
153+ * that the register encoded in the "or %r0,%r0,register"
154+ * opcode should be loaded with -EFAULT to report a userspace
155+ * access error.
155156 */
156157 if (fix->fixup & 1) {
157− regs->gr[ASM_EXCEPTIONTABLE_REG] = -EFAULT;
158+ int fault_error_reg = fix->err_opcode & 0x1f;
159+ if (!WARN_ON(!fault_error_reg))
160+ regs->gr[fault_error_reg] = -EFAULT;
161+ pr_debug("Unalignment fixup of register %d at %pS\n",
162+ fault_error_reg, (void*)regs->iaoq[0]);
158163
159164 /* zero target register for get_user() */
160165 if (parisc_acctyp(0, regs->iir) == VM_READ) {
arch/powerpc/kernel/iommu.c+28−9
@@ -1287,20 +1287,20 @@ spapr_tce_platform_iommu_attach_dev(struct iommu_domain *platform_domain, · 1286 unmodified lines
12871287 struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
12881288 struct iommu_group *grp = iommu_group_get(dev);
12891289 struct iommu_table_group *table_group;
1290− int ret = -EINVAL;
12911290
12921291 /* At first attach the ownership is already set */
12931292 if (!domain)
12941293 return 0;
12951294
1296− if (!grp)
1297− return -ENODEV;
1298−
12991295 table_group = iommu_group_get_iommudata(grp);
1300− ret = table_group->ops->take_ownership(table_group);
1296+ /*
1297+ * The domain being set to PLATFORM from earlier
1298+ * BLOCKED. The table_group ownership has to be released.
1299+ */
1300+ table_group->ops->release_ownership(table_group);
13011301 iommu_group_put(grp);
13021302
1303− return ret;
1303+ return 0;
13041304 }
13051305
13061306 static const struct iommu_domain_ops spapr_tce_platform_domain_ops = {
@@ -1312,13 +1312,32 @@ static struct iommu_domain spapr_tce_platform_domain = { · 5 unmodified lines
13121312 .ops = &spapr_tce_platform_domain_ops,
13131313 };
13141314
1315−static struct iommu_domain spapr_tce_blocked_domain = {
1316− .type = IOMMU_DOMAIN_BLOCKED,
1315+static int
1316+spapr_tce_blocked_iommu_attach_dev(struct iommu_domain *platform_domain,
1317+ struct device *dev)
1318+{
1319+ struct iommu_group *grp = iommu_group_get(dev);
1320+ struct iommu_table_group *table_group;
1321+ int ret = -EINVAL;
1322+
13171323 /*
13181324 * FIXME: SPAPR mixes blocked and platform behaviors, the blocked domain
13191325 * also sets the dma_api ops
13201326 */
1321− .ops = &spapr_tce_platform_domain_ops,
1327+ table_group = iommu_group_get_iommudata(grp);
1328+ ret = table_group->ops->take_ownership(table_group);
1329+ iommu_group_put(grp);
1330+
1331+ return ret;
1332+}
1333+
1334+static const struct iommu_domain_ops spapr_tce_blocked_domain_ops = {
1335+ .attach_dev = spapr_tce_blocked_iommu_attach_dev,
1336+};
1337+
1338+static struct iommu_domain spapr_tce_blocked_domain = {
1339+ .type = IOMMU_DOMAIN_BLOCKED,
1340+ .ops = &spapr_tce_blocked_domain_ops,
13221341 };
13231342
13241343 static bool spapr_tce_iommu_capable(struct device *dev, enum iommu_cap cap)
arch/powerpc/platforms/ps3/Kconfig+1−0
@@ -67,6 +67,7 @@ config PS3_VUART · 66 unmodified lines
6767 config PS3_PS3AV
6868 depends on PPC_PS3
6969 tristate "PS3 AV settings driver" if PS3_ADVANCED
70+ select VIDEO
7071 select PS3_VUART
7172 default y
7273 help
arch/riscv/boot/dts/sophgo/sg2042.dtsi+48−32
@@ -93,144 +93,160 @@ · 92 unmodified lines
9393 <&cpu63_intc 3>;
9494 };
9595
96− clint_mtimer0: timer@70ac000000 {
96+ clint_mtimer0: timer@70ac004000 {
9797 compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
98− reg = <0x00000070 0xac000000 0x00000000 0x00007ff8>;
98+ reg = <0x00000070 0xac004000 0x00000000 0x0000c000>;
99+ reg-names = "mtimecmp";
99100 interrupts-extended = <&cpu0_intc 7>,
100101 <&cpu1_intc 7>,
101102 <&cpu2_intc 7>,
102103 <&cpu3_intc 7>;
103104 };
104105
105− clint_mtimer1: timer@70ac010000 {
106+ clint_mtimer1: timer@70ac014000 {
106107 compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
107− reg = <0x00000070 0xac010000 0x00000000 0x00007ff8>;
108+ reg = <0x00000070 0xac014000 0x00000000 0x0000c000>;
109+ reg-names = "mtimecmp";
108110 interrupts-extended = <&cpu4_intc 7>,
109111 <&cpu5_intc 7>,
110112 <&cpu6_intc 7>,
111113 <&cpu7_intc 7>;
112114 };
113115
114− clint_mtimer2: timer@70ac020000 {
116+ clint_mtimer2: timer@70ac024000 {
115117 compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
116− reg = <0x00000070 0xac020000 0x00000000 0x00007ff8>;
118+ reg = <0x00000070 0xac024000 0x00000000 0x0000c000>;
119+ reg-names = "mtimecmp";
117120 interrupts-extended = <&cpu8_intc 7>,
118121 <&cpu9_intc 7>,
119122 <&cpu10_intc 7>,
120123 <&cpu11_intc 7>;
121124 };
122125
123− clint_mtimer3: timer@70ac030000 {
126+ clint_mtimer3: timer@70ac034000 {
124127 compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
125− reg = <0x00000070 0xac030000 0x00000000 0x00007ff8>;
128+ reg = <0x00000070 0xac034000 0x00000000 0x0000c000>;
129+ reg-names = "mtimecmp";
126130 interrupts-extended = <&cpu12_intc 7>,
127131 <&cpu13_intc 7>,
128132 <&cpu14_intc 7>,
129133 <&cpu15_intc 7>;
130134 };
131135
132− clint_mtimer4: timer@70ac040000 {
136+ clint_mtimer4: timer@70ac044000 {
133137 compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
134− reg = <0x00000070 0xac040000 0x00000000 0x00007ff8>;
138+ reg = <0x00000070 0xac044000 0x00000000 0x0000c000>;
139+ reg-names = "mtimecmp";
135140 interrupts-extended = <&cpu16_intc 7>,
136141 <&cpu17_intc 7>,
137142 <&cpu18_intc 7>,
138143 <&cpu19_intc 7>;
139144 };
140145
141− clint_mtimer5: timer@70ac050000 {
146+ clint_mtimer5: timer@70ac054000 {
142147 compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
143− reg = <0x00000070 0xac050000 0x00000000 0x00007ff8>;
148+ reg = <0x00000070 0xac054000 0x00000000 0x0000c000>;
149+ reg-names = "mtimecmp";
144150 interrupts-extended = <&cpu20_intc 7>,
145151 <&cpu21_intc 7>,
146152 <&cpu22_intc 7>,
147153 <&cpu23_intc 7>;
148154 };
149155
150− clint_mtimer6: timer@70ac060000 {
156+ clint_mtimer6: timer@70ac064000 {
151157 compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
152− reg = <0x00000070 0xac060000 0x00000000 0x00007ff8>;
158+ reg = <0x00000070 0xac064000 0x00000000 0x0000c000>;
159+ reg-names = "mtimecmp";
153160 interrupts-extended = <&cpu24_intc 7>,
154161 <&cpu25_intc 7>,
155162 <&cpu26_intc 7>,
156163 <&cpu27_intc 7>;
157164 };
158165
159− clint_mtimer7: timer@70ac070000 {
166+ clint_mtimer7: timer@70ac074000 {
160167 compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
161− reg = <0x00000070 0xac070000 0x00000000 0x00007ff8>;
168+ reg = <0x00000070 0xac074000 0x00000000 0x0000c000>;
169+ reg-names = "mtimecmp";
162170 interrupts-extended = <&cpu28_intc 7>,
163171 <&cpu29_intc 7>,
164172 <&cpu30_intc 7>,
165173 <&cpu31_intc 7>;
166174 };
167175
168− clint_mtimer8: timer@70ac080000 {
176+ clint_mtimer8: timer@70ac084000 {
169177 compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
170− reg = <0x00000070 0xac080000 0x00000000 0x00007ff8>;
178+ reg = <0x00000070 0xac084000 0x00000000 0x0000c000>;
179+ reg-names = "mtimecmp";
171180 interrupts-extended = <&cpu32_intc 7>,
172181 <&cpu33_intc 7>,
173182 <&cpu34_intc 7>,
174183 <&cpu35_intc 7>;
175184 };
176185
177− clint_mtimer9: timer@70ac090000 {
186+ clint_mtimer9: timer@70ac094000 {
178187 compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
179− reg = <0x00000070 0xac090000 0x00000000 0x00007ff8>;
188+ reg = <0x00000070 0xac094000 0x00000000 0x0000c000>;
189+ reg-names = "mtimecmp";
180190 interrupts-extended = <&cpu36_intc 7>,
181191 <&cpu37_intc 7>,
182192 <&cpu38_intc 7>,
183193 <&cpu39_intc 7>;
184194 };
185195
186− clint_mtimer10: timer@70ac0a0000 {
196+ clint_mtimer10: timer@70ac0a4000 {
187197 compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
188− reg = <0x00000070 0xac0a0000 0x00000000 0x00007ff8>;
198+ reg = <0x00000070 0xac0a4000 0x00000000 0x0000c000>;
199+ reg-names = "mtimecmp";
189200 interrupts-extended = <&cpu40_intc 7>,
190201 <&cpu41_intc 7>,
191202 <&cpu42_intc 7>,
192203 <&cpu43_intc 7>;
193204 };
194205
195− clint_mtimer11: timer@70ac0b0000 {
206+ clint_mtimer11: timer@70ac0b4000 {
196207 compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
197− reg = <0x00000070 0xac0b0000 0x00000000 0x00007ff8>;
208+ reg = <0x00000070 0xac0b4000 0x00000000 0x0000c000>;
209+ reg-names = "mtimecmp";
198210 interrupts-extended = <&cpu44_intc 7>,
199211 <&cpu45_intc 7>,
200212 <&cpu46_intc 7>,
201213 <&cpu47_intc 7>;
202214 };
203215
204− clint_mtimer12: timer@70ac0c0000 {
216+ clint_mtimer12: timer@70ac0c4000 {
205217 compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
206− reg = <0x00000070 0xac0c0000 0x00000000 0x00007ff8>;
218+ reg = <0x00000070 0xac0c4000 0x00000000 0x0000c000>;
219+ reg-names = "mtimecmp";
207220 interrupts-extended = <&cpu48_intc 7>,
208221 <&cpu49_intc 7>,
209222 <&cpu50_intc 7>,
210223 <&cpu51_intc 7>;
211224 };
212225
213− clint_mtimer13: timer@70ac0d0000 {
226+ clint_mtimer13: timer@70ac0d4000 {
214227 compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
215− reg = <0x00000070 0xac0d0000 0x00000000 0x00007ff8>;
228+ reg = <0x00000070 0xac0d4000 0x00000000 0x0000c000>;
229+ reg-names = "mtimecmp";
216230 interrupts-extended = <&cpu52_intc 7>,
217231 <&cpu53_intc 7>,
218232 <&cpu54_intc 7>,
219233 <&cpu55_intc 7>;
220234 };
221235
222− clint_mtimer14: timer@70ac0e0000 {
236+ clint_mtimer14: timer@70ac0e4000 {
223237 compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
224− reg = <0x00000070 0xac0e0000 0x00000000 0x00007ff8>;
238+ reg = <0x00000070 0xac0e4000 0x00000000 0x0000c000>;
239+ reg-names = "mtimecmp";
225240 interrupts-extended = <&cpu56_intc 7>,
226241 <&cpu57_intc 7>,
227242 <&cpu58_intc 7>,
228243 <&cpu59_intc 7>;
229244 };
230245
231− clint_mtimer15: timer@70ac0f0000 {
246+ clint_mtimer15: timer@70ac0f4000 {
232247 compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
233− reg = <0x00000070 0xac0f0000 0x00000000 0x00007ff8>;
248+ reg = <0x00000070 0xac0f4000 0x00000000 0x0000c000>;
249+ reg-names = "mtimecmp";
234250 interrupts-extended = <&cpu60_intc 7>,
235251 <&cpu61_intc 7>,
236252 <&cpu62_intc 7>,
arch/riscv/net/bpf_jit_comp64.c+3−2
@@ -795,6 +795,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, · 794 unmodified lines
795795 struct bpf_tramp_links *fentry = &tlinks[BPF_TRAMP_FENTRY];
796796 struct bpf_tramp_links *fexit = &tlinks[BPF_TRAMP_FEXIT];
797797 struct bpf_tramp_links *fmod_ret = &tlinks[BPF_TRAMP_MODIFY_RETURN];
798+ bool is_struct_ops = flags & BPF_TRAMP_F_INDIRECT;
798799 void *orig_call = func_addr;
799800 bool save_ret;
800801 u32 insn;
@@ -878,7 +879,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, · 77 unmodified lines
878879
879880 stack_size = round_up(stack_size, 16);
880881
881− if (func_addr) {
882+ if (!is_struct_ops) {
882883 /* For the trampoline called from function entry,
883884 * the frame of traced function and the frame of
884885 * trampoline need to be considered.
@@ -998,7 +999,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, · 113 unmodified lines
998999
9991000 emit_ld(RV_REG_S1, -sreg_off, RV_REG_FP, ctx);
10001001
1001− if (func_addr) {
1002+ if (!is_struct_ops) {
10021003 /* trampoline called from function entry */
10031004 emit_ld(RV_REG_T0, stack_size - 8, RV_REG_SP, ctx);
10041005 emit_ld(RV_REG_FP, stack_size - 16, RV_REG_SP, ctx);
arch/um/Makefile+3−1
@@ -115,7 +115,9 @@ archprepare: · 114 unmodified lines
115115 $(Q)$(MAKE) $(build)=$(HOST_DIR)/um include/generated/user_constants.h
116116
117117 LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
118−LINK-$(CONFIG_LD_SCRIPT_DYN) += $(call cc-option, -no-pie)
118+ifdef CONFIG_LD_SCRIPT_DYN
119+LINK-$(call gcc-min-version, 60100)$(CONFIG_CC_IS_CLANG) += -no-pie
120+endif
119121 LINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) += -Wl,-rpath,/lib
120122
121123 CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \
arch/x86/Makefile+5−5
@@ -112,13 +112,13 @@ ifeq ($(CONFIG_X86_32),y) · 111 unmodified lines
112112 # temporary until string.h is fixed
113113 KBUILD_CFLAGS += -ffreestanding
114114
115− ifeq ($(CONFIG_STACKPROTECTOR),y)
116− ifeq ($(CONFIG_SMP),y)
115+ ifeq ($(CONFIG_STACKPROTECTOR),y)
116+ ifeq ($(CONFIG_SMP),y)
117117 KBUILD_CFLAGS += -mstack-protector-guard-reg=fs -mstack-protector-guard-symbol=__stack_chk_guard
118− else
118+ else
119119 KBUILD_CFLAGS += -mstack-protector-guard=global
120− endif
121− endif
120+ endif
121+ endif
122122 else
123123 BITS := 64
124124 UTS_MACHINE := x86_64
arch/x86/include/asm/cpufeatures.h+1−3
@@ -81,10 +81,8 @@ · 80 unmodified lines
8181 #define X86_FEATURE_K6_MTRR ( 3*32+ 1) /* AMD K6 nonstandard MTRRs */
8282 #define X86_FEATURE_CYRIX_ARR ( 3*32+ 2) /* Cyrix ARRs (= MTRRs) */
8383 #define X86_FEATURE_CENTAUR_MCR ( 3*32+ 3) /* Centaur MCRs (= MTRRs) */
84−
85−/* CPU types for specific tunings: */
8684 #define X86_FEATURE_K8 ( 3*32+ 4) /* "" Opteron, Athlon64 */
87−/* FREE, was #define X86_FEATURE_K7 ( 3*32+ 5) "" Athlon */
85+#define X86_FEATURE_ZEN5 ( 3*32+ 5) /* "" CPU based on Zen5 microarchitecture */
8886 #define X86_FEATURE_P3 ( 3*32+ 6) /* "" P3 */
8987 #define X86_FEATURE_P4 ( 3*32+ 7) /* "" P4 */
9088 #define X86_FEATURE_CONSTANT_TSC ( 3*32+ 8) /* TSC ticks at a constant rate */
arch/x86/include/asm/intel-family.h+2−0
@@ -162,6 +162,8 @@ · 161 unmodified lines
162162 #define INTEL_FAM6_ATOM_CRESTMONT_X 0xAF /* Sierra Forest */
163163 #define INTEL_FAM6_ATOM_CRESTMONT 0xB6 /* Grand Ridge */
164164
165+#define INTEL_FAM6_ATOM_DARKMONT_X 0xDD /* Clearwater Forest */
166+
165167 /* Xeon Phi */
166168
167169 #define INTEL_FAM6_XEON_PHI_KNL 0x57 /* Knights Landing */
arch/x86/include/asm/kmsan.h+16−1
@@ -64,6 +64,7 @@ static inline bool kmsan_virt_addr_valid(void *addr) · 63 unmodified lines
6464 {
6565 unsigned long x = (unsigned long)addr;
6666 unsigned long y = x - __START_KERNEL_map;
67+ bool ret;
6768
6869 /* use the carry flag to determine if x was < __START_KERNEL_map */
6970 if (unlikely(x > y)) {
@@ -79,7 +80,21 @@ static inline bool kmsan_virt_addr_valid(void *addr) · 9 unmodified lines
7980 return false;
8081 }
8182
82− return pfn_valid(x >> PAGE_SHIFT);
83+ /*
84+ * pfn_valid() relies on RCU, and may call into the scheduler on exiting
85+ * the critical section. However, this would result in recursion with
86+ * KMSAN. Therefore, disable preemption here, and re-enable preemption
87+ * below while suppressing reschedules to avoid recursion.
88+ *
89+ * Note, this sacrifices occasionally breaking scheduling guarantees.
90+ * Although, a kernel compiled with KMSAN has already given up on any
91+ * performance guarantees due to being heavily instrumented.
92+ */
93+ preempt_disable();
94+ ret = pfn_valid(x >> PAGE_SHIFT);
95+ preempt_enable_no_resched();
96+
97+ return ret;
8398 }
8499
85100 #endif /* !MODULE */
arch/x86/include/asm/syscall_wrapper.h+21−4
@@ -58,12 +58,29 @@ extern long __ia32_sys_ni_syscall(const struct pt_regs *regs); · 57 unmodified lines
5858 ,,regs->di,,regs->si,,regs->dx \
5959 ,,regs->r10,,regs->r8,,regs->r9) \
6060
61+
62+/* SYSCALL_PT_ARGS is Adapted from s390x */
63+#define SYSCALL_PT_ARG6(m, t1, t2, t3, t4, t5, t6) \
64+ SYSCALL_PT_ARG5(m, t1, t2, t3, t4, t5), m(t6, (regs->bp))
65+#define SYSCALL_PT_ARG5(m, t1, t2, t3, t4, t5) \
66+ SYSCALL_PT_ARG4(m, t1, t2, t3, t4), m(t5, (regs->di))
67+#define SYSCALL_PT_ARG4(m, t1, t2, t3, t4) \
68+ SYSCALL_PT_ARG3(m, t1, t2, t3), m(t4, (regs->si))
69+#define SYSCALL_PT_ARG3(m, t1, t2, t3) \
70+ SYSCALL_PT_ARG2(m, t1, t2), m(t3, (regs->dx))
71+#define SYSCALL_PT_ARG2(m, t1, t2) \
72+ SYSCALL_PT_ARG1(m, t1), m(t2, (regs->cx))
73+#define SYSCALL_PT_ARG1(m, t1) m(t1, (regs->bx))
74+#define SYSCALL_PT_ARGS(x, ...) SYSCALL_PT_ARG##x(__VA_ARGS__)
75+
76+#define __SC_COMPAT_CAST(t, a) \
77+ (__typeof(__builtin_choose_expr(__TYPE_IS_L(t), 0, 0U))) \
78+ (unsigned int)a
79+
6180 /* Mapping of registers to parameters for syscalls on i386 */
6281 #define SC_IA32_REGS_TO_ARGS(x, ...) \
63− __MAP(x,__SC_ARGS \
64− ,,(unsigned int)regs->bx,,(unsigned int)regs->cx \
65− ,,(unsigned int)regs->dx,,(unsigned int)regs->si \
66− ,,(unsigned int)regs->di,,(unsigned int)regs->bp)
82+ SYSCALL_PT_ARGS(x, __SC_COMPAT_CAST, \
83+ __MAP(x, __SC_TYPE, __VA_ARGS__)) \
6784
6885 #define __SYS_STUB0(abi, name) \
6986 long __##abi##_##name(const struct pt_regs *regs); \
arch/x86/kernel/alternative.c+1−1
@@ -403,7 +403,7 @@ noinstr void BUG_func(void) · 402 unmodified lines
403403 {
404404 BUG();
405405 }
406−EXPORT_SYMBOL_GPL(BUG_func);
406+EXPORT_SYMBOL(BUG_func);
407407
408408 #define CALL_RIP_REL_OPCODE 0xff
409409 #define CALL_RIP_REL_MODRM 0x15
arch/x86/kernel/cpu/amd.c+24−4
@@ -538,7 +538,7 @@ static void bsp_init_amd(struct cpuinfo_x86 *c) · 537 unmodified lines
538538
539539 /* Figure out Zen generations: */
540540 switch (c->x86) {
541− case 0x17: {
541+ case 0x17:
542542 switch (c->x86_model) {
543543 case 0x00 ... 0x2f:
544544 case 0x50 ... 0x5f:
@@ -554,8 +554,8 @@ static void bsp_init_amd(struct cpuinfo_x86 *c) · 9 unmodified lines
554554 goto warn;
555555 }
556556 break;
557− }
558− case 0x19: {
557+
558+ case 0x19:
559559 switch (c->x86_model) {
560560 case 0x00 ... 0x0f:
561561 case 0x20 ... 0x5f:
@@ -569,7 +569,20 @@ static void bsp_init_amd(struct cpuinfo_x86 *c) · 7 unmodified lines
569569 goto warn;
570570 }
571571 break;
572− }
572+
573+ case 0x1a:
574+ switch (c->x86_model) {
575+ case 0x00 ... 0x0f:
576+ case 0x20 ... 0x2f:
577+ case 0x40 ... 0x4f:
578+ case 0x70 ... 0x7f:
579+ setup_force_cpu_cap(X86_FEATURE_ZEN5);
580+ break;
581+ default:
582+ goto warn;
583+ }
584+ break;
585+
573586 default:
574587 break;
575588 }
@@ -1039,6 +1052,11 @@ static void init_amd_zen4(struct cpuinfo_x86 *c) · 463 unmodified lines
10391052 msr_set_bit(MSR_ZEN4_BP_CFG, MSR_ZEN4_BP_CFG_SHARED_BTB_FIX_BIT);
10401053 }
10411054
1055+static void init_amd_zen5(struct cpuinfo_x86 *c)
1056+{
1057+ init_amd_zen_common();
1058+}
1059+
10421060 static void init_amd(struct cpuinfo_x86 *c)
10431061 {
10441062 u64 vm_cr;
@@ -1084,6 +1102,8 @@ static void init_amd(struct cpuinfo_x86 *c) · 39 unmodified lines
10841102 init_amd_zen3(c);
10851103 else if (boot_cpu_has(X86_FEATURE_ZEN4))
10861104 init_amd_zen4(c);
1105+ else if (boot_cpu_has(X86_FEATURE_ZEN5))
1106+ init_amd_zen5(c);
10871107
10881108 /*
10891109 * Enable workaround for FXSAVE leak on CPUs
block/blk-core.c+10−0
@@ -49,6 +49,7 @@ · 48 unmodified lines
4949 #include "blk-pm.h"
5050 #include "blk-cgroup.h"
5151 #include "blk-throttle.h"
52+#include "blk-ioprio.h"
5253
5354 struct dentry *blk_debugfs_root;
5455
@@ -833,6 +834,14 @@ end_io: · 778 unmodified lines
833834 }
834835 EXPORT_SYMBOL(submit_bio_noacct);
835836
837+static void bio_set_ioprio(struct bio *bio)
838+{
839+ /* Nobody set ioprio so far? Initialize it based on task's nice value */
840+ if (IOPRIO_PRIO_CLASS(bio->bi_ioprio) == IOPRIO_CLASS_NONE)
841+ bio->bi_ioprio = get_current_ioprio();
842+ blkcg_set_ioprio(bio);
843+}
844+
836845 /**
837846 * submit_bio - submit a bio to the block device layer for I/O
838847 * @bio: The &struct bio which describes the I/O
@@ -855,6 +864,7 @@ void submit_bio(struct bio *bio) · 16 unmodified lines
855864 count_vm_events(PGPGOUT, bio_sectors(bio));
856865 }
857866
867+ bio_set_ioprio(bio);
858868 submit_bio_noacct(bio);
859869 }
860870 EXPORT_SYMBOL(submit_bio);
block/blk-map.c+10−3
@@ -205,12 +205,19 @@ static int bio_copy_user_iov(struct request *rq, struct rq_map_data *map_data, · 204 unmodified lines
205205 /*
206206 * success
207207 */
208− if ((iov_iter_rw(iter) == WRITE &&
209− (!map_data || !map_data->null_mapped)) ||
210− (map_data && map_data->from_user)) {
208+ if (iov_iter_rw(iter) == WRITE &&
209+ (!map_data || !map_data->null_mapped)) {
211210 ret = bio_copy_from_iter(bio, iter);
212211 if (ret)
213212 goto cleanup;
213+ } else if (map_data && map_data->from_user) {
214+ struct iov_iter iter2 = *iter;
215+
216+ /* This is the copy-in part of SG_DXFER_TO_FROM_DEV. */
217+ iter2.data_source = ITER_SOURCE;
218+ ret = bio_copy_from_iter(bio, &iter2);
219+ if (ret)
220+ goto cleanup;
214221 } else {
215222 if (bmd->is_our_pages)
216223 zero_fill_bio(bio);
block/blk-mq.c+0−10
@@ -40,7 +40,6 @@ · 39 unmodified lines
4040 #include "blk-stat.h"
4141 #include "blk-mq-sched.h"
4242 #include "blk-rq-qos.h"
43−#include "blk-ioprio.h"
4443
4544 static DEFINE_PER_CPU(struct llist_head, blk_cpu_done);
4645 static DEFINE_PER_CPU(call_single_data_t, blk_cpu_csd);
@@ -2944,14 +2943,6 @@ static bool blk_mq_use_cached_rq(struct request *rq, struct blk_plug *plug, · 2897 unmodified lines
29442943 return true;
29452944 }
29462945
2947−static void bio_set_ioprio(struct bio *bio)
2948−{
2949− /* Nobody set ioprio so far? Initialize it based on task's nice value */
2950− if (IOPRIO_PRIO_CLASS(bio->bi_ioprio) == IOPRIO_CLASS_NONE)
2951− bio->bi_ioprio = get_current_ioprio();
2952− blkcg_set_ioprio(bio);
2953−}
2954−
29552946 /**
29562947 * blk_mq_submit_bio - Create and send a request to block device.
29572948 * @bio: Bio pointer.
@@ -2976,7 +2967,6 @@ void blk_mq_submit_bio(struct bio *bio) · 18 unmodified lines
29762967 blk_status_t ret;
29772968
29782969 bio = blk_queue_bounce(bio, q);
2979− bio_set_ioprio(bio);
29802970
29812971 if (plug) {
29822972 rq = rq_list_peek(&plug->cached_rq);
block/ioctl.c+0−2
@@ -20,8 +20,6 @@ static int blkpg_do_ioctl(struct block_device *bdev, · 19 unmodified lines
2020 struct blkpg_partition p;
2121 sector_t start, length;
2222
23− if (disk->flags & GENHD_FL_NO_PART)
24− return -EINVAL;
2523 if (!capable(CAP_SYS_ADMIN))
2624 return -EACCES;
2725 if (copy_from_user(&p, upart, sizeof(struct blkpg_partition)))
block/partitions/core.c+5−0
@@ -439,6 +439,11 @@ int bdev_add_partition(struct gendisk *disk, int partno, sector_t start, · 438 unmodified lines
439439 goto out;
440440 }
441441
442+ if (disk->flags & GENHD_FL_NO_PART) {
443+ ret = -EINVAL;
444+ goto out;
445+ }
446+
442447 if (partition_overlaps(disk, start, length, -1)) {
443448 ret = -EBUSY;
444449 goto out;
drivers/accel/ivpu/ivpu_debugfs.c+16−4
@@ -102,7 +102,7 @@ static int reset_pending_show(struct seq_file *s, void *v) · 101 unmodified lines
102102 {
103103 struct ivpu_device *vdev = seq_to_ivpu(s);
104104
105− seq_printf(s, "%d\n", atomic_read(&vdev->pm->in_reset));
105+ seq_printf(s, "%d\n", atomic_read(&vdev->pm->reset_pending));
106106 return 0;
107107 }
108108
@@ -130,7 +130,9 @@ dvfs_mode_fops_write(struct file *file, const char __user *user_buf, size_t size · 21 unmodified lines
130130
131131 fw->dvfs_mode = dvfs_mode;
132132
133− ivpu_pm_schedule_recovery(vdev);
133+ ret = pci_try_reset_function(to_pci_dev(vdev->drm.dev));
134+ if (ret)
135+ return ret;
134136
135137 return size;
136138 }
@@ -190,7 +192,10 @@ fw_profiling_freq_fops_write(struct file *file, const char __user *user_buf, · 53 unmodified lines
190192 return ret;
191193
192194 ivpu_hw_profiling_freq_drive(vdev, enable);
193− ivpu_pm_schedule_recovery(vdev);
195+
196+ ret = pci_try_reset_function(to_pci_dev(vdev->drm.dev));
197+ if (ret)
198+ return ret;
194199
195200 return size;
196201 }
@@ -301,11 +306,18 @@ static ssize_t · 104 unmodified lines
301306 ivpu_force_recovery_fn(struct file *file, const char __user *user_buf, size_t size, loff_t *pos)
302307 {
303308 struct ivpu_device *vdev = file->private_data;
309+ int ret;
304310
305311 if (!size)
306312 return -EINVAL;
307313
308− ivpu_pm_schedule_recovery(vdev);
314+ ret = ivpu_rpm_get(vdev);
315+ if (ret)
316+ return ret;
317+
318+ ivpu_pm_trigger_recovery(vdev, "debugfs");
319+ flush_work(&vdev->pm->recovery_work);
320+ ivpu_rpm_put(vdev);
309321 return size;
310322 }
311323
drivers/accel/ivpu/ivpu_drv.c+71−55
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 #include <linux/firmware.h>
77 #include <linux/module.h>
88 #include <linux/pci.h>
9+#include <linux/pm_runtime.h>
910
1011 #include <drm/drm_accel.h>
1112 #include <drm/drm_file.h>
@@ -17,6 +18,7 @@ · 5 unmodified lines
1718 #include "ivpu_debugfs.h"
1819 #include "ivpu_drv.h"
1920 #include "ivpu_fw.h"
21+#include "ivpu_fw_log.h"
2022 #include "ivpu_gem.h"
2123 #include "ivpu_hw.h"
2224 #include "ivpu_ipc.h"
@@ -65,22 +67,20 @@ struct ivpu_file_priv *ivpu_file_priv_get(struct ivpu_file_priv *file_priv) · 42 unmodified lines
6567 return file_priv;
6668 }
6769
68−struct ivpu_file_priv *ivpu_file_priv_get_by_ctx_id(struct ivpu_device *vdev, unsigned long id)
70+static void file_priv_unbind(struct ivpu_device *vdev, struct ivpu_file_priv *file_priv)
6971 {
70− struct ivpu_file_priv *file_priv;
71−
72− xa_lock_irq(&vdev->context_xa);
73− file_priv = xa_load(&vdev->context_xa, id);
74− /* file_priv may still be in context_xa during file_priv_release() */
75− if (file_priv && !kref_get_unless_zero(&file_priv->ref))
76− file_priv = NULL;
77− xa_unlock_irq(&vdev->context_xa);
78−
79− if (file_priv)
80− ivpu_dbg(vdev, KREF, "file_priv get by id: ctx %u refcount %u\n",
81− file_priv->ctx.id, kref_read(&file_priv->ref));
82−
83− return file_priv;
72+ mutex_lock(&file_priv->lock);
73+ if (file_priv->bound) {
74+ ivpu_dbg(vdev, FILE, "file_priv unbind: ctx %u\n", file_priv->ctx.id);
75+
76+ ivpu_cmdq_release_all_locked(file_priv);
77+ ivpu_jsm_context_release(vdev, file_priv->ctx.id);
78+ ivpu_bo_unbind_all_bos_from_context(vdev, &file_priv->ctx);
79+ ivpu_mmu_user_context_fini(vdev, &file_priv->ctx);
80+ file_priv->bound = false;
81+ drm_WARN_ON(&vdev->drm, !xa_erase_irq(&vdev->context_xa, file_priv->ctx.id));
82+ }
83+ mutex_unlock(&file_priv->lock);
8484 }
8585
8686 static void file_priv_release(struct kref *ref)
@@ -88,13 +88,15 @@ static void file_priv_release(struct kref *ref) · 1 unmodified line
8888 struct ivpu_file_priv *file_priv = container_of(ref, struct ivpu_file_priv, ref);
8989 struct ivpu_device *vdev = file_priv->vdev;
9090
91− ivpu_dbg(vdev, FILE, "file_priv release: ctx %u\n", file_priv->ctx.id);
91+ ivpu_dbg(vdev, FILE, "file_priv release: ctx %u bound %d\n",
92+ file_priv->ctx.id, (bool)file_priv->bound);
93+
94+ pm_runtime_get_sync(vdev->drm.dev);
95+ mutex_lock(&vdev->context_list_lock);
96+ file_priv_unbind(vdev, file_priv);
97+ mutex_unlock(&vdev->context_list_lock);
98+ pm_runtime_put_autosuspend(vdev->drm.dev);
9299
93− ivpu_cmdq_release_all(file_priv);
94− ivpu_jsm_context_release(vdev, file_priv->ctx.id);
95− ivpu_bo_remove_all_bos_from_context(vdev, &file_priv->ctx);
96− ivpu_mmu_user_context_fini(vdev, &file_priv->ctx);
97− drm_WARN_ON(&vdev->drm, xa_erase_irq(&vdev->context_xa, file_priv->ctx.id) != file_priv);
98100 mutex_destroy(&file_priv->lock);
99101 kfree(file_priv);
100102 }
@@ -176,9 +178,6 @@ static int ivpu_get_param_ioctl(struct drm_device *dev, void *data, struct drm_f · 75 unmodified lines
176178 case DRM_IVPU_PARAM_CONTEXT_BASE_ADDRESS:
177179 args->value = vdev->hw->ranges.user.start;
178180 break;
179− case DRM_IVPU_PARAM_CONTEXT_PRIORITY:
180− args->value = file_priv->priority;
181− break;
182181 case DRM_IVPU_PARAM_CONTEXT_ID:
183182 args->value = file_priv->ctx.id;
184183 break;
@@ -218,17 +217,10 @@ static int ivpu_get_param_ioctl(struct drm_device *dev, void *data, struct drm_f · 33 unmodified lines
218217
219218 static int ivpu_set_param_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
220219 {
221− struct ivpu_file_priv *file_priv = file->driver_priv;
222220 struct drm_ivpu_param *args = data;
223221 int ret = 0;
224222
225223 switch (args->param) {
226− case DRM_IVPU_PARAM_CONTEXT_PRIORITY:
227− if (args->value <= DRM_IVPU_CONTEXT_PRIORITY_REALTIME)
228− file_priv->priority = args->value;
229− else
230− ret = -EINVAL;
231− break;
232224 default:
233225 ret = -EINVAL;
234226 }
@@ -241,50 +233,53 @@ static int ivpu_open(struct drm_device *dev, struct drm_file *file) · 6 unmodified lines
241233 struct ivpu_device *vdev = to_ivpu_device(dev);
242234 struct ivpu_file_priv *file_priv;
243235 u32 ctx_id;
244− void *old;
245− int ret;
236+ int idx, ret;
246237
247− ret = xa_alloc_irq(&vdev->context_xa, &ctx_id, NULL, vdev->context_xa_limit, GFP_KERNEL);
248− if (ret) {
249− ivpu_err(vdev, "Failed to allocate context id: %d\n", ret);
250− return ret;
251− }
238+ if (!drm_dev_enter(dev, &idx))
239+ return -ENODEV;
252240
253241 file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL);
254242 if (!file_priv) {
255243 ret = -ENOMEM;
256− goto err_xa_erase;
244+ goto err_dev_exit;
257245 }
258246
259247 file_priv->vdev = vdev;
260− file_priv->priority = DRM_IVPU_CONTEXT_PRIORITY_NORMAL;
248+ file_priv->bound = true;
261249 kref_init(&file_priv->ref);
262250 mutex_init(&file_priv->lock);
263251
252+ mutex_lock(&vdev->context_list_lock);
253+
254+ ret = xa_alloc_irq(&vdev->context_xa, &ctx_id, file_priv,
255+ vdev->context_xa_limit, GFP_KERNEL);
256+ if (ret) {
257+ ivpu_err(vdev, "Failed to allocate context id: %d\n", ret);
258+ goto err_unlock;
259+ }
260+
264261 ret = ivpu_mmu_user_context_init(vdev, &file_priv->ctx, ctx_id);
265262 if (ret)
266− goto err_mutex_destroy;
263+ goto err_xa_erase;
267264
268− old = xa_store_irq(&vdev->context_xa, ctx_id, file_priv, GFP_KERNEL);
269− if (xa_is_err(old)) {
270− ret = xa_err(old);
271− ivpu_err(vdev, "Failed to store context %u: %d\n", ctx_id, ret);
272− goto err_ctx_fini;
273− }
265+ mutex_unlock(&vdev->context_list_lock);
266+ drm_dev_exit(idx);
267+
268+ file->driver_priv = file_priv;
274269
275270 ivpu_dbg(vdev, FILE, "file_priv create: ctx %u process %s pid %d\n",
276271 ctx_id, current->comm, task_pid_nr(current));
277272
278− file->driver_priv = file_priv;
279273 return 0;
280274
281−err_ctx_fini:
282− ivpu_mmu_user_context_fini(vdev, &file_priv->ctx);
283−err_mutex_destroy:
284− mutex_destroy(&file_priv->lock);
285− kfree(file_priv);
286275 err_xa_erase:
287276 xa_erase_irq(&vdev->context_xa, ctx_id);
277+err_unlock:
278+ mutex_unlock(&vdev->context_list_lock);
279+ mutex_destroy(&file_priv->lock);
280+ kfree(file_priv);
281+err_dev_exit:
282+ drm_dev_exit(idx);
288283 return ret;
289284 }
290285
@@ -340,8 +335,6 @@ static int ivpu_wait_for_ready(struct ivpu_device *vdev) · 49 unmodified lines
340335
341336 if (!ret)
342337 ivpu_dbg(vdev, PM, "VPU ready message received successfully\n");
343− else
344− ivpu_hw_diagnose_failure(vdev);
345338
346339 return ret;
347340 }
@@ -369,6 +362,9 @@ int ivpu_boot(struct ivpu_device *vdev) · 21 unmodified lines
369362 ret = ivpu_wait_for_ready(vdev);
370363 if (ret) {
371364 ivpu_err(vdev, "Failed to boot the firmware: %d\n", ret);
365+ ivpu_hw_diagnose_failure(vdev);
366+ ivpu_mmu_evtq_dump(vdev);
367+ ivpu_fw_log_dump(vdev);
372368 return ret;
373369 }
374370
@@ -540,6 +536,10 @@ static int ivpu_dev_init(struct ivpu_device *vdev) · 165 unmodified lines
540536 lockdep_set_class(&vdev->submitted_jobs_xa.xa_lock, &submitted_jobs_xa_lock_class_key);
541537 INIT_LIST_HEAD(&vdev->bo_list);
542538
539+ ret = drmm_mutex_init(&vdev->drm, &vdev->context_list_lock);
540+ if (ret)
541+ goto err_xa_destroy;
542+
543543 ret = drmm_mutex_init(&vdev->drm, &vdev->bo_list_lock);
544544 if (ret)
545545 goto err_xa_destroy;
@@ -611,14 +611,30 @@ err_xa_destroy: · 65 unmodified lines
611611 return ret;
612612 }
613613
614+static void ivpu_bo_unbind_all_user_contexts(struct ivpu_device *vdev)
615+{
616+ struct ivpu_file_priv *file_priv;
617+ unsigned long ctx_id;
618+
619+ mutex_lock(&vdev->context_list_lock);
620+
621+ xa_for_each(&vdev->context_xa, ctx_id, file_priv)
622+ file_priv_unbind(vdev, file_priv);
623+
624+ mutex_unlock(&vdev->context_list_lock);
625+}
626+
614627 static void ivpu_dev_fini(struct ivpu_device *vdev)
615628 {
616629 ivpu_pm_disable(vdev);
617630 ivpu_shutdown(vdev);
618631 if (IVPU_WA(d3hot_after_power_off))
619632 pci_set_power_state(to_pci_dev(vdev->drm.dev), PCI_D3hot);
633+
634+ ivpu_jobs_abort_all(vdev);
620635 ivpu_job_done_consumer_fini(vdev);
621636 ivpu_pm_cancel_recovery(vdev);
637+ ivpu_bo_unbind_all_user_contexts(vdev);
622638
623639 ivpu_ipc_fini(vdev);
624640 ivpu_fw_fini(vdev);
drivers/accel/ivpu/ivpu_drv.h+3−2
@@ -56,6 +56,7 @@ · 55 unmodified lines
5656 #define IVPU_DBG_JSM BIT(10)
5757 #define IVPU_DBG_KREF BIT(11)
5858 #define IVPU_DBG_RPM BIT(12)
59+#define IVPU_DBG_MMU_MAP BIT(13)
5960
6061 #define ivpu_err(vdev, fmt, ...) \
6162 drm_err(&(vdev)->drm, "%s(): " fmt, __func__, ##__VA_ARGS__)
@@ -114,6 +115,7 @@ struct ivpu_device { · 52 unmodified lines
114115
115116 struct ivpu_mmu_context gctx;
116117 struct ivpu_mmu_context rctx;
118+ struct mutex context_list_lock; /* Protects user context addition/removal */
117119 struct xarray context_xa;
118120 struct xa_limit context_xa_limit;
119121
@@ -145,8 +147,8 @@ struct ivpu_file_priv { · 25 unmodified lines
145147 struct mutex lock; /* Protects cmdq */
146148 struct ivpu_cmdq *cmdq[IVPU_NUM_ENGINES];
147149 struct ivpu_mmu_context ctx;
148− u32 priority;
149150 bool has_mmu_faults;
151+ bool bound;
150152 };
151153
152154 extern int ivpu_dbg_mask;
@@ -162,7 +164,6 @@ extern bool ivpu_disable_mmu_cont_pages; · 9 unmodified lines
162164 extern int ivpu_test_mode;
163165
164166 struct ivpu_file_priv *ivpu_file_priv_get(struct ivpu_file_priv *file_priv);
165−struct ivpu_file_priv *ivpu_file_priv_get_by_ctx_id(struct ivpu_device *vdev, unsigned long id);
166167 void ivpu_file_priv_put(struct ivpu_file_priv **link);
167168
168169 int ivpu_boot(struct ivpu_device *vdev);
drivers/accel/ivpu/ivpu_gem.c+52−90
@@ -24,14 +24,11 @@ static const struct drm_gem_object_funcs ivpu_gem_funcs; · 23 unmodified lines
2424
2525 static inline void ivpu_dbg_bo(struct ivpu_device *vdev, struct ivpu_bo *bo, const char *action)
2626 {
27− if (bo->ctx)
28− ivpu_dbg(vdev, BO, "%6s: size %zu has_pages %d dma_mapped %d handle %u ctx %d vpu_addr 0x%llx mmu_mapped %d\n",
29− action, ivpu_bo_size(bo), (bool)bo->base.pages, (bool)bo->base.sgt,
30− bo->handle, bo->ctx->id, bo->vpu_addr, bo->mmu_mapped);
31− else
32− ivpu_dbg(vdev, BO, "%6s: size %zu has_pages %d dma_mapped %d handle %u (not added to context)\n",
33− action, ivpu_bo_size(bo), (bool)bo->base.pages, (bool)bo->base.sgt,
34− bo->handle);
27+ ivpu_dbg(vdev, BO,
28+ "%6s: bo %8p vpu_addr %9llx size %8zu ctx %d has_pages %d dma_mapped %d mmu_mapped %d wc %d imported %d\n",
29+ action, bo, bo->vpu_addr, ivpu_bo_size(bo), bo->ctx ? bo->ctx->id : 0,
30+ (bool)bo->base.pages, (bool)bo->base.sgt, bo->mmu_mapped, bo->base.map_wc,
31+ (bool)bo->base.base.import_attach);
3532 }
3633
3734 /*
@@ -49,12 +46,7 @@ int __must_check ivpu_bo_pin(struct ivpu_bo *bo) · 11 unmodified lines
4946 mutex_lock(&bo->lock);
5047
5148 ivpu_dbg_bo(vdev, bo, "pin");
52−
53− if (!bo->ctx) {
54− ivpu_err(vdev, "vpu_addr not allocated for BO %d\n", bo->handle);
55− ret = -EINVAL;
56− goto unlock;
57− }
49+ drm_WARN_ON(&vdev->drm, !bo->ctx);
5850
5951 if (!bo->mmu_mapped) {
6052 struct sg_table *sgt = drm_gem_shmem_get_pages_sgt(&bo->base);
@@ -85,7 +77,10 @@ ivpu_bo_alloc_vpu_addr(struct ivpu_bo *bo, struct ivpu_mmu_context *ctx, · 24 unmodified lines
8577 const struct ivpu_addr_range *range)
8678 {
8779 struct ivpu_device *vdev = ivpu_bo_to_vdev(bo);
88− int ret;
80+ int idx, ret;
81+
82+ if (!drm_dev_enter(&vdev->drm, &idx))
83+ return -ENODEV;
8984
9085 mutex_lock(&bo->lock);
9186
@@ -101,6 +96,8 @@ ivpu_bo_alloc_vpu_addr(struct ivpu_bo *bo, struct ivpu_mmu_context *ctx, · 9 unmodified lines
10196
10297 mutex_unlock(&bo->lock);
10398
99+ drm_dev_exit(idx);
100+
104101 return ret;
105102 }
106103
@@ -108,11 +105,7 @@ static void ivpu_bo_unbind_locked(struct ivpu_bo *bo) · 1 unmodified line
108105 {
109106 struct ivpu_device *vdev = ivpu_bo_to_vdev(bo);
110107
111− lockdep_assert_held(&bo->lock);
112−
113− ivpu_dbg_bo(vdev, bo, "unbind");
114−
115− /* TODO: dma_unmap */
108+ lockdep_assert(lockdep_is_held(&bo->lock) || !kref_read(&bo->base.base.refcount));
116109
117110 if (bo->mmu_mapped) {
118111 drm_WARN_ON(&vdev->drm, !bo->ctx);
@@ -124,19 +117,23 @@ static void ivpu_bo_unbind_locked(struct ivpu_bo *bo) · 5 unmodified lines
124117
125118 if (bo->ctx) {
126119 ivpu_mmu_context_remove_node(bo->ctx, &bo->mm_node);
127− bo->vpu_addr = 0;
128120 bo->ctx = NULL;
129121 }
130−}
131122
132−static void ivpu_bo_unbind(struct ivpu_bo *bo)
133−{
134− mutex_lock(&bo->lock);
135− ivpu_bo_unbind_locked(bo);
136− mutex_unlock(&bo->lock);
123+ if (bo->base.base.import_attach)
124+ return;
125+
126+ dma_resv_lock(bo->base.base.resv, NULL);
127+ if (bo->base.sgt) {
128+ dma_unmap_sgtable(vdev->drm.dev, bo->base.sgt, DMA_BIDIRECTIONAL, 0);
129+ sg_free_table(bo->base.sgt);
130+ kfree(bo->base.sgt);
131+ bo->base.sgt = NULL;
132+ }
133+ dma_resv_unlock(bo->base.base.resv);
137134 }
138135
139−void ivpu_bo_remove_all_bos_from_context(struct ivpu_device *vdev, struct ivpu_mmu_context *ctx)
136+void ivpu_bo_unbind_all_bos_from_context(struct ivpu_device *vdev, struct ivpu_mmu_context *ctx)
140137 {
141138 struct ivpu_bo *bo;
142139
@@ -146,8 +143,10 @@ void ivpu_bo_remove_all_bos_from_context(struct ivpu_device *vdev, struct ivpu_m · 3 unmodified lines
146143 mutex_lock(&vdev->bo_list_lock);
147144 list_for_each_entry(bo, &vdev->bo_list, bo_list_node) {
148145 mutex_lock(&bo->lock);
149− if (bo->ctx == ctx)
146+ if (bo->ctx == ctx) {
147+ ivpu_dbg_bo(vdev, bo, "unbind");
150148 ivpu_bo_unbind_locked(bo);
149+ }
151150 mutex_unlock(&bo->lock);
152151 }
153152 mutex_unlock(&vdev->bo_list_lock);
@@ -199,9 +198,6 @@ ivpu_bo_create(struct ivpu_device *vdev, u64 size, u32 flags) · 45 unmodified lines
199198 list_add_tail(&bo->bo_list_node, &vdev->bo_list);
200199 mutex_unlock(&vdev->bo_list_lock);
201200
202− ivpu_dbg(vdev, BO, "create: vpu_addr 0x%llx size %zu flags 0x%x\n",
203− bo->vpu_addr, bo->base.base.size, flags);
204−
205201 return bo;
206202 }
207203
@@ -212,6 +208,12 @@ static int ivpu_bo_open(struct drm_gem_object *obj, struct drm_file *file) · 4 unmodified lines
212208 struct ivpu_bo *bo = to_ivpu_bo(obj);
213209 struct ivpu_addr_range *range;
214210
211+ if (bo->ctx) {
212+ ivpu_warn(vdev, "Can't add BO to ctx %u: already in ctx %u\n",
213+ file_priv->ctx.id, bo->ctx->id);
214+ return -EALREADY;
215+ }
216+
215217 if (bo->flags & DRM_IVPU_BO_SHAVE_MEM)
216218 range = &vdev->hw->ranges.shave;
217219 else if (bo->flags & DRM_IVPU_BO_DMA_MEM)
@@ -227,62 +229,24 @@ static void ivpu_bo_free(struct drm_gem_object *obj) · 9 unmodified lines
227229 struct ivpu_device *vdev = to_ivpu_device(obj->dev);
228230 struct ivpu_bo *bo = to_ivpu_bo(obj);
229231
232+ ivpu_dbg_bo(vdev, bo, "free");
233+
230234 mutex_lock(&vdev->bo_list_lock);
231235 list_del(&bo->bo_list_node);
232236 mutex_unlock(&vdev->bo_list_lock);
233237
234238 drm_WARN_ON(&vdev->drm, !dma_resv_test_signaled(obj->resv, DMA_RESV_USAGE_READ));
235239
236− ivpu_dbg_bo(vdev, bo, "free");
237−
238− ivpu_bo_unbind(bo);
240+ ivpu_bo_unbind_locked(bo);
239241 mutex_destroy(&bo->lock);
240242
241243 drm_WARN_ON(obj->dev, bo->base.pages_use_count > 1);
242244 drm_gem_shmem_free(&bo->base);
243245 }
244246
245−static const struct dma_buf_ops ivpu_bo_dmabuf_ops = {
246− .cache_sgt_mapping = true,
247− .attach = drm_gem_map_attach,
248− .detach = drm_gem_map_detach,
249− .map_dma_buf = drm_gem_map_dma_buf,
250− .unmap_dma_buf = drm_gem_unmap_dma_buf,
251− .release = drm_gem_dmabuf_release,
252− .mmap = drm_gem_dmabuf_mmap,
253− .vmap = drm_gem_dmabuf_vmap,
254− .vunmap = drm_gem_dmabuf_vunmap,
255−};
256−
257−static struct dma_buf *ivpu_bo_export(struct drm_gem_object *obj, int flags)
258−{
259− struct drm_device *dev = obj->dev;
260− struct dma_buf_export_info exp_info = {
261− .exp_name = KBUILD_MODNAME,
262− .owner = dev->driver->fops->owner,
263− .ops = &ivpu_bo_dmabuf_ops,
264− .size = obj->size,
265− .flags = flags,
266− .priv = obj,
267− .resv = obj->resv,
268− };
269− void *sgt;
270−
271− /*
272− * Make sure that pages are allocated and dma-mapped before exporting the bo.
273− * DMA-mapping is required if the bo will be imported to the same device.
274− */
275− sgt = drm_gem_shmem_get_pages_sgt(to_drm_gem_shmem_obj(obj));
276− if (IS_ERR(sgt))
277− return sgt;
278−
279− return drm_gem_dmabuf_export(dev, &exp_info);
280−}
281−
282247 static const struct drm_gem_object_funcs ivpu_gem_funcs = {
283248 .free = ivpu_bo_free,
284249 .open = ivpu_bo_open,
285− .export = ivpu_bo_export,
286250 .print_info = drm_gem_shmem_object_print_info,
287251 .pin = drm_gem_shmem_object_pin,
288252 .unpin = drm_gem_shmem_object_unpin,
@@ -315,11 +279,9 @@ int ivpu_bo_create_ioctl(struct drm_device *dev, void *data, struct drm_file *fi · 26 unmodified lines
315279 return PTR_ERR(bo);
316280 }
317281
318− ret = drm_gem_handle_create(file, &bo->base.base, &bo->handle);
319− if (!ret) {
282+ ret = drm_gem_handle_create(file, &bo->base.base, &args->handle);
283+ if (!ret)
320284 args->vpu_addr = bo->vpu_addr;
321− args->handle = bo->handle;
322− }
323285
324286 drm_gem_object_put(&bo->base.base);
325287
@@ -361,7 +323,9 @@ ivpu_bo_alloc_internal(struct ivpu_device *vdev, u64 vpu_addr, u64 size, u32 fla · 35 unmodified lines
361323 if (ret)
362324 goto err_put;
363325
326+ dma_resv_lock(bo->base.base.resv, NULL);
364327 ret = drm_gem_shmem_vmap(&bo->base, &map);
328+ dma_resv_unlock(bo->base.base.resv);
365329 if (ret)
366330 goto err_put;
367331
@@ -376,7 +340,10 @@ void ivpu_bo_free_internal(struct ivpu_bo *bo) · 8 unmodified lines
376340 {
377341 struct iosys_map map = IOSYS_MAP_INIT_VADDR(bo->base.vaddr);
378342
343+ dma_resv_lock(bo->base.base.resv, NULL);
379344 drm_gem_shmem_vunmap(&bo->base, &map);
345+ dma_resv_unlock(bo->base.base.resv);
346+
380347 drm_gem_object_put(&bo->base.base);
381348 }
382349
@@ -432,19 +399,11 @@ int ivpu_bo_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *file · 49 unmodified lines
432399
433400 static void ivpu_bo_print_info(struct ivpu_bo *bo, struct drm_printer *p)
434401 {
435− unsigned long dma_refcount = 0;
436−
437402 mutex_lock(&bo->lock);
438403
439− if (bo->base.base.dma_buf && bo->base.base.dma_buf->file)
440− dma_refcount = atomic_long_read(&bo->base.base.dma_buf->file->f_count);
441−
442− drm_printf(p, "%-3u %-6d 0x%-12llx %-10lu 0x%-8x %-4u %-8lu",
443− bo->ctx->id, bo->handle, bo->vpu_addr, bo->base.base.size,
444− bo->flags, kref_read(&bo->base.base.refcount), dma_refcount);
445−
446− if (bo->base.base.import_attach)
447− drm_printf(p, " imported");
404+ drm_printf(p, "%-9p %-3u 0x%-12llx %-10lu 0x%-8x %-4u",
405+ bo, bo->ctx->id, bo->vpu_addr, bo->base.base.size,
406+ bo->flags, kref_read(&bo->base.base.refcount));
448407
449408 if (bo->base.pages)
450409 drm_printf(p, " has_pages");
@@ -452,6 +411,9 @@ static void ivpu_bo_print_info(struct ivpu_bo *bo, struct drm_printer *p) · 1 unmodified line
452411 if (bo->mmu_mapped)
453412 drm_printf(p, " mmu_mapped");
454413
414+ if (bo->base.base.import_attach)
415+ drm_printf(p, " imported");
416+
455417 drm_printf(p, "\n");
456418
457419 mutex_unlock(&bo->lock);
@@ -462,8 +424,8 @@ void ivpu_bo_list(struct drm_device *dev, struct drm_printer *p) · 4 unmodified lines
462424 struct ivpu_device *vdev = to_ivpu_device(dev);
463425 struct ivpu_bo *bo;
464426
465− drm_printf(p, "%-3s %-6s %-14s %-10s %-10s %-4s %-8s %s\n",
466− "ctx", "handle", "vpu_addr", "size", "flags", "refs", "dma_refs", "attribs");
427+ drm_printf(p, "%-9s %-3s %-14s %-10s %-10s %-4s %s\n",
428+ "bo", "ctx", "vpu_addr", "size", "flags", "refs", "attribs");
467429
468430 mutex_lock(&vdev->bo_list_lock);
469431 list_for_each_entry(bo, &vdev->bo_list, bo_list_node)
drivers/accel/ivpu/ivpu_gem.h+1−2
@@ -19,14 +19,13 @@ struct ivpu_bo { · 18 unmodified lines
1919
2020 struct mutex lock; /* Protects: ctx, mmu_mapped, vpu_addr */
2121 u64 vpu_addr;
22− u32 handle;
2322 u32 flags;
2423 u32 job_status; /* Valid only for command buffer */
2524 bool mmu_mapped;
2625 };
2726
2827 int ivpu_bo_pin(struct ivpu_bo *bo);
29−void ivpu_bo_remove_all_bos_from_context(struct ivpu_device *vdev, struct ivpu_mmu_context *ctx);
28+void ivpu_bo_unbind_all_bos_from_context(struct ivpu_device *vdev, struct ivpu_mmu_context *ctx);
3029
3130 struct drm_gem_object *ivpu_gem_create_object(struct drm_device *dev, size_t size);
3231 struct ivpu_bo *ivpu_bo_alloc_internal(struct ivpu_device *vdev, u64 vpu_addr, u64 size, u32 flags);
drivers/accel/ivpu/ivpu_hw_37xx.c+4−10
@@ -875,24 +875,18 @@ static void ivpu_hw_37xx_irq_disable(struct ivpu_device *vdev) · 874 unmodified lines
875875
876876 static void ivpu_hw_37xx_irq_wdt_nce_handler(struct ivpu_device *vdev)
877877 {
878− ivpu_err_ratelimited(vdev, "WDT NCE irq\n");
879−
880− ivpu_pm_schedule_recovery(vdev);
878+ ivpu_pm_trigger_recovery(vdev, "WDT NCE IRQ");
881879 }
882880
883881 static void ivpu_hw_37xx_irq_wdt_mss_handler(struct ivpu_device *vdev)
884882 {
885− ivpu_err_ratelimited(vdev, "WDT MSS irq\n");
886−
887883 ivpu_hw_wdt_disable(vdev);
888− ivpu_pm_schedule_recovery(vdev);
884+ ivpu_pm_trigger_recovery(vdev, "WDT MSS IRQ");
889885 }
890886
891887 static void ivpu_hw_37xx_irq_noc_firewall_handler(struct ivpu_device *vdev)
892888 {
893− ivpu_err_ratelimited(vdev, "NOC Firewall irq\n");
894−
895− ivpu_pm_schedule_recovery(vdev);
889+ ivpu_pm_trigger_recovery(vdev, "NOC Firewall IRQ");
896890 }
897891
898892 /* Handler for IRQs from VPU core (irqV) */
@@ -970,7 +964,7 @@ static bool ivpu_hw_37xx_irqb_handler(struct ivpu_device *vdev, int irq) · 71 unmodified lines
970964 REGB_WR32(VPU_37XX_BUTTRESS_INTERRUPT_STAT, status);
971965
972966 if (schedule_recovery)
973− ivpu_pm_schedule_recovery(vdev);
967+ ivpu_pm_trigger_recovery(vdev, "Buttress IRQ");
974968
975969 return true;
976970 }
drivers/accel/ivpu/ivpu_hw_40xx.c+23−6
@@ -746,7 +746,7 @@ static int ivpu_hw_40xx_info_init(struct ivpu_device *vdev) · 745 unmodified lines
746746 return 0;
747747 }
748748
749−static int ivpu_hw_40xx_reset(struct ivpu_device *vdev)
749+static int ivpu_hw_40xx_ip_reset(struct ivpu_device *vdev)
750750 {
751751 int ret;
752752 u32 val;
@@ -768,6 +768,23 @@ static int ivpu_hw_40xx_reset(struct ivpu_device *vdev) · 15 unmodified lines
768768 return ret;
769769 }
770770
771+static int ivpu_hw_40xx_reset(struct ivpu_device *vdev)
772+{
773+ int ret = 0;
774+
775+ if (ivpu_hw_40xx_ip_reset(vdev)) {
776+ ivpu_err(vdev, "Failed to reset VPU IP\n");
777+ ret = -EIO;
778+ }
779+
780+ if (ivpu_pll_disable(vdev)) {
781+ ivpu_err(vdev, "Failed to disable PLL\n");
782+ ret = -EIO;
783+ }
784+
785+ return ret;
786+}
787+
771788 static int ivpu_hw_40xx_d0i3_enable(struct ivpu_device *vdev)
772789 {
773790 int ret;
@@ -913,7 +930,7 @@ static int ivpu_hw_40xx_power_down(struct ivpu_device *vdev) · 139 unmodified lines
913930
914931 ivpu_hw_40xx_save_d0i3_entry_timestamp(vdev);
915932
916− if (!ivpu_hw_40xx_is_idle(vdev) && ivpu_hw_40xx_reset(vdev))
933+ if (!ivpu_hw_40xx_is_idle(vdev) && ivpu_hw_40xx_ip_reset(vdev))
917934 ivpu_warn(vdev, "Failed to reset the VPU\n");
918935
919936 if (ivpu_pll_disable(vdev)) {
@@ -1032,18 +1049,18 @@ static void ivpu_hw_40xx_irq_disable(struct ivpu_device *vdev) · 112 unmodified lines
10321049 static void ivpu_hw_40xx_irq_wdt_nce_handler(struct ivpu_device *vdev)
10331050 {
10341051 /* TODO: For LNN hang consider engine reset instead of full recovery */
1035− ivpu_pm_schedule_recovery(vdev);
1052+ ivpu_pm_trigger_recovery(vdev, "WDT NCE IRQ");
10361053 }
10371054
10381055 static void ivpu_hw_40xx_irq_wdt_mss_handler(struct ivpu_device *vdev)
10391056 {
10401057 ivpu_hw_wdt_disable(vdev);
1041− ivpu_pm_schedule_recovery(vdev);
1058+ ivpu_pm_trigger_recovery(vdev, "WDT MSS IRQ");
10421059 }
10431060
10441061 static void ivpu_hw_40xx_irq_noc_firewall_handler(struct ivpu_device *vdev)
10451062 {
1046− ivpu_pm_schedule_recovery(vdev);
1063+ ivpu_pm_trigger_recovery(vdev, "NOC Firewall IRQ");
10471064 }
10481065
10491066 /* Handler for IRQs from VPU core (irqV) */
@@ -1137,7 +1154,7 @@ static bool ivpu_hw_40xx_irqb_handler(struct ivpu_device *vdev, int irq) · 87 unmodified lines
11371154 REGB_WR32(VPU_40XX_BUTTRESS_INTERRUPT_STAT, status);
11381155
11391156 if (schedule_recovery)
1140− ivpu_pm_schedule_recovery(vdev);
1157+ ivpu_pm_trigger_recovery(vdev, "Buttress IRQ");
11411158
11421159 return true;
11431160 }
drivers/accel/ivpu/ivpu_ipc.c+2−4
@@ -343,10 +343,8 @@ int ivpu_ipc_send_receive_active(struct ivpu_device *vdev, struct vpu_jsm_msg *r · 342 unmodified lines
343343 hb_ret = ivpu_ipc_send_receive_internal(vdev, &hb_req, VPU_JSM_MSG_QUERY_ENGINE_HB_DONE,
344344 &hb_resp, VPU_IPC_CHAN_ASYNC_CMD,
345345 vdev->timeout.jsm);
346− if (hb_ret == -ETIMEDOUT) {
347− ivpu_hw_diagnose_failure(vdev);
348− ivpu_pm_schedule_recovery(vdev);
349− }
346+ if (hb_ret == -ETIMEDOUT)
347+ ivpu_pm_trigger_recovery(vdev, "IPC timeout");
350348
351349 return ret;
352350 }
drivers/accel/ivpu/ivpu_job.c+73−87
@@ -112,22 +112,20 @@ static void ivpu_cmdq_release_locked(struct ivpu_file_priv *file_priv, u16 engin · 111 unmodified lines
112112 }
113113 }
114114
115−void ivpu_cmdq_release_all(struct ivpu_file_priv *file_priv)
115+void ivpu_cmdq_release_all_locked(struct ivpu_file_priv *file_priv)
116116 {
117117 int i;
118118
119− mutex_lock(&file_priv->lock);
119+ lockdep_assert_held(&file_priv->lock);
120120
121121 for (i = 0; i < IVPU_NUM_ENGINES; i++)
122122 ivpu_cmdq_release_locked(file_priv, i);
123−
124− mutex_unlock(&file_priv->lock);
125123 }
126124
127125 /*
128126 * Mark the doorbell as unregistered and reset job queue pointers.
129127 * This function needs to be called when the VPU hardware is restarted
130− * and FW looses job queue state. The next time job queue is used it
128+ * and FW loses job queue state. The next time job queue is used it
131129 * will be registered again.
132130 */
133131 static void ivpu_cmdq_reset_locked(struct ivpu_file_priv *file_priv, u16 engine)
@@ -161,15 +159,13 @@ void ivpu_cmdq_reset_all_contexts(struct ivpu_device *vdev) · 27 unmodified lines
161159 struct ivpu_file_priv *file_priv;
162160 unsigned long ctx_id;
163161
164− xa_for_each(&vdev->context_xa, ctx_id, file_priv) {
165− file_priv = ivpu_file_priv_get_by_ctx_id(vdev, ctx_id);
166− if (!file_priv)
167− continue;
162+ mutex_lock(&vdev->context_list_lock);
168163
164+ xa_for_each(&vdev->context_xa, ctx_id, file_priv)
169165 ivpu_cmdq_reset_all(file_priv);
170166
171− ivpu_file_priv_put(&file_priv);
172− }
167+ mutex_unlock(&vdev->context_list_lock);
168+
173169 }
174170
175171 static int ivpu_cmdq_push_job(struct ivpu_cmdq *cmdq, struct ivpu_job *job)
@@ -243,60 +239,32 @@ static struct dma_fence *ivpu_fence_create(struct ivpu_device *vdev) · 67 unmodified lines
243239 return &fence->base;
244240 }
245241
246−static void job_get(struct ivpu_job *job, struct ivpu_job **link)
242+static void ivpu_job_destroy(struct ivpu_job *job)
247243 {
248244 struct ivpu_device *vdev = job->vdev;
249−
250− kref_get(&job->ref);
251− *link = job;
252−
253− ivpu_dbg(vdev, KREF, "Job get: id %u refcount %u\n", job->job_id, kref_read(&job->ref));
254−}
255−
256−static void job_release(struct kref *ref)
257−{
258− struct ivpu_job *job = container_of(ref, struct ivpu_job, ref);
259− struct ivpu_device *vdev = job->vdev;
260245 u32 i;
261246
247+ ivpu_dbg(vdev, JOB, "Job destroyed: id %3u ctx %2d engine %d",
248+ job->job_id, job->file_priv->ctx.id, job->engine_idx);
249+
262250 for (i = 0; i < job->bo_count; i++)
263251 if (job->bos[i])
264252 drm_gem_object_put(&job->bos[i]->base.base);
265253
266254 dma_fence_put(job->done_fence);
267255 ivpu_file_priv_put(&job->file_priv);
268−
269− ivpu_dbg(vdev, KREF, "Job released: id %u\n", job->job_id);
270256 kfree(job);
271−
272− /* Allow the VPU to get suspended, must be called after ivpu_file_priv_put() */
273− ivpu_rpm_put(vdev);
274−}
275−
276−static void job_put(struct ivpu_job *job)
277−{
278− struct ivpu_device *vdev = job->vdev;
279−
280− ivpu_dbg(vdev, KREF, "Job put: id %u refcount %u\n", job->job_id, kref_read(&job->ref));
281− kref_put(&job->ref, job_release);
282257 }
283258
284259 static struct ivpu_job *
285−ivpu_create_job(struct ivpu_file_priv *file_priv, u32 engine_idx, u32 bo_count)
260+ivpu_job_create(struct ivpu_file_priv *file_priv, u32 engine_idx, u32 bo_count)
286261 {
287262 struct ivpu_device *vdev = file_priv->vdev;
288263 struct ivpu_job *job;
289− int ret;
290−
291− ret = ivpu_rpm_get(vdev);
292− if (ret < 0)
293− return NULL;
294264
295265 job = kzalloc(struct_size(job, bos, bo_count), GFP_KERNEL);
296266 if (!job)
297− goto err_rpm_put;
298−
299− kref_init(&job->ref);
267+ return NULL;
300268
301269 job->vdev = vdev;
302270 job->engine_idx = engine_idx;
@@ -310,17 +278,14 @@ ivpu_create_job(struct ivpu_file_priv *file_priv, u32 engine_idx, u32 bo_count) · 7 unmodified lines
310278 job->file_priv = ivpu_file_priv_get(file_priv);
311279
312280 ivpu_dbg(vdev, JOB, "Job created: ctx %2d engine %d", file_priv->ctx.id, job->engine_idx);
313−
314281 return job;
315282
316283 err_free_job:
317284 kfree(job);
318−err_rpm_put:
319− ivpu_rpm_put(vdev);
320285 return NULL;
321286 }
322287
323−static int ivpu_job_done(struct ivpu_device *vdev, u32 job_id, u32 job_status)
288+static int ivpu_job_signal_and_destroy(struct ivpu_device *vdev, u32 job_id, u32 job_status)
324289 {
325290 struct ivpu_job *job;
326291
@@ -337,9 +302,10 @@ static int ivpu_job_done(struct ivpu_device *vdev, u32 job_id, u32 job_status) · 10 unmodified lines
337302 ivpu_dbg(vdev, JOB, "Job complete: id %3u ctx %2d engine %d status 0x%x\n",
338303 job->job_id, job->file_priv->ctx.id, job->engine_idx, job_status);
339304
305+ ivpu_job_destroy(job);
340306 ivpu_stop_job_timeout_detection(vdev);
341307
342− job_put(job);
308+ ivpu_rpm_put(vdev);
343309 return 0;
344310 }
345311
@@ -349,10 +315,10 @@ void ivpu_jobs_abort_all(struct ivpu_device *vdev) · 3 unmodified lines
349315 unsigned long id;
350316
351317 xa_for_each(&vdev->submitted_jobs_xa, id, job)
352− ivpu_job_done(vdev, id, VPU_JSM_STATUS_ABORTED);
318+ ivpu_job_signal_and_destroy(vdev, id, VPU_JSM_STATUS_ABORTED);
353319 }
354320
355−static int ivpu_direct_job_submission(struct ivpu_job *job)
321+static int ivpu_job_submit(struct ivpu_job *job)
356322 {
357323 struct ivpu_file_priv *file_priv = job->file_priv;
358324 struct ivpu_device *vdev = job->vdev;
@@ -360,53 +326,65 @@ static int ivpu_direct_job_submission(struct ivpu_job *job) · 1 unmodified line
360326 struct ivpu_cmdq *cmdq;
361327 int ret;
362328
329+ ret = ivpu_rpm_get(vdev);
330+ if (ret < 0)
331+ return ret;
332+
363333 mutex_lock(&file_priv->lock);
364334
365335 cmdq = ivpu_cmdq_acquire(job->file_priv, job->engine_idx);
366336 if (!cmdq) {
367− ivpu_warn(vdev, "Failed get job queue, ctx %d engine %d\n",
368− file_priv->ctx.id, job->engine_idx);
337+ ivpu_warn_ratelimited(vdev, "Failed get job queue, ctx %d engine %d\n",
338+ file_priv->ctx.id, job->engine_idx);
369339 ret = -EINVAL;
370− goto err_unlock;
340+ goto err_unlock_file_priv;
371341 }
372342
373343 job_id_range.min = FIELD_PREP(JOB_ID_CONTEXT_MASK, (file_priv->ctx.id - 1));
374344 job_id_range.max = job_id_range.min | JOB_ID_JOB_MASK;
375345
376− job_get(job, &job);
377− ret = xa_alloc(&vdev->submitted_jobs_xa, &job->job_id, job, job_id_range, GFP_KERNEL);
346+ xa_lock(&vdev->submitted_jobs_xa);
347+ ret = __xa_alloc(&vdev->submitted_jobs_xa, &job->job_id, job, job_id_range, GFP_KERNEL);
378348 if (ret) {
379− ivpu_warn_ratelimited(vdev, "Failed to allocate job id: %d\n", ret);
380− goto err_job_put;
349+ ivpu_dbg(vdev, JOB, "Too many active jobs in ctx %d\n",
350+ file_priv->ctx.id);
351+ ret = -EBUSY;
352+ goto err_unlock_submitted_jobs_xa;
381353 }
382354
383355 ret = ivpu_cmdq_push_job(cmdq, job);
384356 if (ret)
385− goto err_xa_erase;
357+ goto err_erase_xa;
386358
387359 ivpu_start_job_timeout_detection(vdev);
388360
389− ivpu_dbg(vdev, JOB, "Job submitted: id %3u addr 0x%llx ctx %2d engine %d next %d\n",
390− job->job_id, job->cmd_buf_vpu_addr, file_priv->ctx.id,
391− job->engine_idx, cmdq->jobq->header.tail);
392−
393− if (ivpu_test_mode & IVPU_TEST_MODE_NULL_HW) {
394− ivpu_job_done(vdev, job->job_id, VPU_JSM_STATUS_SUCCESS);
361+ if (unlikely(ivpu_test_mode & IVPU_TEST_MODE_NULL_HW)) {
395362 cmdq->jobq->header.head = cmdq->jobq->header.tail;
396363 wmb(); /* Flush WC buffer for jobq header */
397364 } else {
398365 ivpu_cmdq_ring_db(vdev, cmdq);
399366 }
400367
368+ ivpu_dbg(vdev, JOB, "Job submitted: id %3u ctx %2d engine %d addr 0x%llx next %d\n",
369+ job->job_id, file_priv->ctx.id, job->engine_idx,
370+ job->cmd_buf_vpu_addr, cmdq->jobq->header.tail);
371+
372+ xa_unlock(&vdev->submitted_jobs_xa);
373+
401374 mutex_unlock(&file_priv->lock);
375+
376+ if (unlikely(ivpu_test_mode & IVPU_TEST_MODE_NULL_HW))
377+ ivpu_job_signal_and_destroy(vdev, job->job_id, VPU_JSM_STATUS_SUCCESS);
378+
402379 return 0;
403380
404−err_xa_erase:
405− xa_erase(&vdev->submitted_jobs_xa, job->job_id);
406−err_job_put:
407− job_put(job);
408−err_unlock:
381+err_erase_xa:
382+ __xa_erase(&vdev->submitted_jobs_xa, job->job_id);
383+err_unlock_submitted_jobs_xa:
384+ xa_unlock(&vdev->submitted_jobs_xa);
385+err_unlock_file_priv:
409386 mutex_unlock(&file_priv->lock);
387+ ivpu_rpm_put(vdev);
410388 return ret;
411389 }
412390
@@ -488,6 +466,9 @@ int ivpu_submit_ioctl(struct drm_device *dev, void *data, struct drm_file *file) · 75 unmodified lines
488466 if (params->engine > DRM_IVPU_ENGINE_COPY)
489467 return -EINVAL;
490468
469+ if (params->priority > DRM_IVPU_JOB_PRIORITY_REALTIME)
470+ return -EINVAL;
471+
491472 if (params->buffer_count == 0 || params->buffer_count > JOB_MAX_BUFFER_COUNT)
492473 return -EINVAL;
493474
@@ -509,44 +490,49 @@ int ivpu_submit_ioctl(struct drm_device *dev, void *data, struct drm_file *file) · 15 unmodified lines
509490 params->buffer_count * sizeof(u32));
510491 if (ret) {
511492 ret = -EFAULT;
512− goto free_handles;
493+ goto err_free_handles;
513494 }
514495
515496 if (!drm_dev_enter(&vdev->drm, &idx)) {
516497 ret = -ENODEV;
517− goto free_handles;
498+ goto err_free_handles;
518499 }
519500
520501 ivpu_dbg(vdev, JOB, "Submit ioctl: ctx %u buf_count %u\n",
521502 file_priv->ctx.id, params->buffer_count);
522503
523− job = ivpu_create_job(file_priv, params->engine, params->buffer_count);
504+ job = ivpu_job_create(file_priv, params->engine, params->buffer_count);
524505 if (!job) {
525506 ivpu_err(vdev, "Failed to create job\n");
526507 ret = -ENOMEM;
527− goto dev_exit;
508+ goto err_exit_dev;
528509 }
529510
530511 ret = ivpu_job_prepare_bos_for_submit(file, job, buf_handles, params->buffer_count,
531512 params->commands_offset);
532513 if (ret) {
533− ivpu_err(vdev, "Failed to prepare job, ret %d\n", ret);
534− goto job_put;
514+ ivpu_err(vdev, "Failed to prepare job: %d\n", ret);
515+ goto err_destroy_job;
535516 }
536517
537− ret = ivpu_direct_job_submission(job);
538− if (ret) {
539− dma_fence_signal(job->done_fence);
540− ivpu_err(vdev, "Failed to submit job to the HW, ret %d\n", ret);
541− }
518+ down_read(&vdev->pm->reset_lock);
519+ ret = ivpu_job_submit(job);
520+ up_read(&vdev->pm->reset_lock);
521+ if (ret)
522+ goto err_signal_fence;
542523
543−job_put:
544− job_put(job);
545−dev_exit:
546524 drm_dev_exit(idx);
547−free_handles:
548525 kfree(buf_handles);
526+ return ret;
549527
528+err_signal_fence:
529+ dma_fence_signal(job->done_fence);
530+err_destroy_job:
531+ ivpu_job_destroy(job);
532+err_exit_dev:
533+ drm_dev_exit(idx);
534+err_free_handles:
535+ kfree(buf_handles);
550536 return ret;
551537 }
552538
@@ -568,7 +554,7 @@ ivpu_job_done_callback(struct ivpu_device *vdev, struct ivpu_ipc_hdr *ipc_hdr, · 15 unmodified lines
568554 }
569555
570556 payload = (struct vpu_ipc_msg_payload_job_done *)&jsm_msg->payload;
571− ret = ivpu_job_done(vdev, payload->job_id, payload->job_status);
557+ ret = ivpu_job_signal_and_destroy(vdev, payload->job_id, payload->job_status);
572558 if (!ret && !xa_empty(&vdev->submitted_jobs_xa))
573559 ivpu_start_job_timeout_detection(vdev);
574560 }
drivers/accel/ivpu/ivpu_job.h+1−2
@@ -43,7 +43,6 @@ struct ivpu_cmdq { · 42 unmodified lines
4343 will update the job status
4444 */
4545 struct ivpu_job {
46− struct kref ref;
4746 struct ivpu_device *vdev;
4847 struct ivpu_file_priv *file_priv;
4948 struct dma_fence *done_fence;
@@ -56,7 +55,7 @@ struct ivpu_job { · 6 unmodified lines
5655
5756 int ivpu_submit_ioctl(struct drm_device *dev, void *data, struct drm_file *file);
5857
59−void ivpu_cmdq_release_all(struct ivpu_file_priv *file_priv);
58+void ivpu_cmdq_release_all_locked(struct ivpu_file_priv *file_priv);
6059 void ivpu_cmdq_reset_all_contexts(struct ivpu_device *vdev);
6160
6261 void ivpu_job_done_consumer_init(struct ivpu_device *vdev);
drivers/accel/ivpu/ivpu_mmu.c+15−7
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 #include <linux/highmem.h>
88
99 #include "ivpu_drv.h"
10+#include "ivpu_hw.h"
1011 #include "ivpu_hw_reg_io.h"
1112 #include "ivpu_mmu.h"
1213 #include "ivpu_mmu_context.h"
@@ -518,6 +519,7 @@ static int ivpu_mmu_cmdq_sync(struct ivpu_device *vdev) · 505 unmodified lines
518519
519520 ivpu_err(vdev, "Timed out waiting for MMU consumer: %d, error: %s\n", ret,
520521 ivpu_mmu_cmdq_err_to_str(err));
522+ ivpu_hw_diagnose_failure(vdev);
521523 }
522524
523525 return ret;
@@ -885,7 +887,6 @@ static u32 *ivpu_mmu_get_event(struct ivpu_device *vdev) · 361 unmodified lines
885887
886888 void ivpu_mmu_irq_evtq_handler(struct ivpu_device *vdev)
887889 {
888− bool schedule_recovery = false;
889890 u32 *event;
890891 u32 ssid;
891892
@@ -895,14 +896,21 @@ void ivpu_mmu_irq_evtq_handler(struct ivpu_device *vdev) · 3 unmodified lines
895896 ivpu_mmu_dump_event(vdev, event);
896897
897898 ssid = FIELD_GET(IVPU_MMU_EVT_SSID_MASK, event[0]);
898− if (ssid == IVPU_GLOBAL_CONTEXT_MMU_SSID)
899− schedule_recovery = true;
900− else
901− ivpu_mmu_user_context_mark_invalid(vdev, ssid);
899+ if (ssid == IVPU_GLOBAL_CONTEXT_MMU_SSID) {
900+ ivpu_pm_trigger_recovery(vdev, "MMU event");
901+ return;
902+ }
903+
904+ ivpu_mmu_user_context_mark_invalid(vdev, ssid);
902905 }
906+}
903907
904− if (schedule_recovery)
905− ivpu_pm_schedule_recovery(vdev);
908+void ivpu_mmu_evtq_dump(struct ivpu_device *vdev)
909+{
910+ u32 *event;
911+
912+ while ((event = ivpu_mmu_get_event(vdev)) != NULL)
913+ ivpu_mmu_dump_event(vdev, event);
906914 }
907915
908916 void ivpu_mmu_irq_gerr_handler(struct ivpu_device *vdev)
drivers/accel/ivpu/ivpu_mmu.h+1−0
@@ -46,5 +46,6 @@ int ivpu_mmu_invalidate_tlb(struct ivpu_device *vdev, u16 ssid); · 45 unmodified lines
4646
4747 void ivpu_mmu_irq_evtq_handler(struct ivpu_device *vdev);
4848 void ivpu_mmu_irq_gerr_handler(struct ivpu_device *vdev);
49+void ivpu_mmu_evtq_dump(struct ivpu_device *vdev);
4950
5051 #endif /* __IVPU_MMU_H__ */
drivers/accel/ivpu/ivpu_mmu_context.c+9−0
@@ -355,6 +355,9 @@ ivpu_mmu_context_map_sgt(struct ivpu_device *vdev, struct ivpu_mmu_context *ctx, · 354 unmodified lines
355355 dma_addr_t dma_addr = sg_dma_address(sg) - sg->offset;
356356 size_t size = sg_dma_len(sg) + sg->offset;
357357
358+ ivpu_dbg(vdev, MMU_MAP, "Map ctx: %u dma_addr: 0x%llx vpu_addr: 0x%llx size: %lu\n",
359+ ctx->id, dma_addr, vpu_addr, size);
360+
358361 ret = ivpu_mmu_context_map_pages(vdev, ctx, vpu_addr, dma_addr, size, prot);
359362 if (ret) {
360363 ivpu_err(vdev, "Failed to map context pages\n");
@@ -366,6 +369,7 @@ ivpu_mmu_context_map_sgt(struct ivpu_device *vdev, struct ivpu_mmu_context *ctx, · 5 unmodified lines
366369
367370 /* Ensure page table modifications are flushed from wc buffers to memory */
368371 wmb();
372+
369373 mutex_unlock(&ctx->lock);
370374
371375 ret = ivpu_mmu_invalidate_tlb(vdev, ctx->id);
@@ -388,14 +392,19 @@ ivpu_mmu_context_unmap_sgt(struct ivpu_device *vdev, struct ivpu_mmu_context *ct · 16 unmodified lines
388392 mutex_lock(&ctx->lock);
389393
390394 for_each_sgtable_dma_sg(sgt, sg, i) {
395+ dma_addr_t dma_addr = sg_dma_address(sg) - sg->offset;
391396 size_t size = sg_dma_len(sg) + sg->offset;
392397
398+ ivpu_dbg(vdev, MMU_MAP, "Unmap ctx: %u dma_addr: 0x%llx vpu_addr: 0x%llx size: %lu\n",
399+ ctx->id, dma_addr, vpu_addr, size);
400+
393401 ivpu_mmu_context_unmap_pages(ctx, vpu_addr, size);
394402 vpu_addr += size;
395403 }
396404
397405 /* Ensure page table modifications are flushed from wc buffers to memory */
398406 wmb();
407+
399408 mutex_unlock(&ctx->lock);
400409
401410 ret = ivpu_mmu_invalidate_tlb(vdev, ctx->id);
drivers/accel/ivpu/ivpu_pm.c+35−17
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include "ivpu_drv.h"
1414 #include "ivpu_hw.h"
1515 #include "ivpu_fw.h"
16+#include "ivpu_fw_log.h"
1617 #include "ivpu_ipc.h"
1718 #include "ivpu_job.h"
1819 #include "ivpu_jsm_msg.h"
@@ -111,6 +112,14 @@ static void ivpu_pm_recovery_work(struct work_struct *work) · 92 unmodified lines
111112 char *evt[2] = {"IVPU_PM_EVENT=IVPU_RECOVER", NULL};
112113 int ret;
113114
115+ ivpu_err(vdev, "Recovering the VPU (reset #%d)\n", atomic_read(&vdev->pm->reset_counter));
116+
117+ ret = pm_runtime_resume_and_get(vdev->drm.dev);
118+ if (ret)
119+ ivpu_err(vdev, "Failed to resume VPU: %d\n", ret);
120+
121+ ivpu_fw_log_dump(vdev);
122+
114123 retry:
115124 ret = pci_try_reset_function(to_pci_dev(vdev->drm.dev));
116125 if (ret == -EAGAIN && !drm_dev_is_unplugged(&vdev->drm)) {
@@ -122,11 +131,13 @@ retry: · 5 unmodified lines
122131 ivpu_err(vdev, "Failed to reset VPU: %d\n", ret);
123132
124133 kobject_uevent_env(&vdev->drm.dev->kobj, KOBJ_CHANGE, evt);
134+ pm_runtime_mark_last_busy(vdev->drm.dev);
135+ pm_runtime_put_autosuspend(vdev->drm.dev);
125136 }
126137
127−void ivpu_pm_schedule_recovery(struct ivpu_device *vdev)
138+void ivpu_pm_trigger_recovery(struct ivpu_device *vdev, const char *reason)
128139 {
129− struct ivpu_pm_info *pm = vdev->pm;
140+ ivpu_err(vdev, "Recovery triggered by %s\n", reason);
130141
131142 if (ivpu_disable_recovery) {
132143 ivpu_err(vdev, "Recovery not available when disable_recovery param is set\n");
@@ -138,10 +149,11 @@ void ivpu_pm_schedule_recovery(struct ivpu_device *vdev) · 5 unmodified lines
138149 return;
139150 }
140151
141− /* Schedule recovery if it's not in progress */
142− if (atomic_cmpxchg(&pm->in_reset, 0, 1) == 0) {
143− ivpu_hw_irq_disable(vdev);
144− queue_work(system_long_wq, &pm->recovery_work);
152+ /* Trigger recovery if it's not in progress */
153+ if (atomic_cmpxchg(&vdev->pm->reset_pending, 0, 1) == 0) {
154+ ivpu_hw_diagnose_failure(vdev);
155+ ivpu_hw_irq_disable(vdev); /* Disable IRQ early to protect from IRQ storm */
156+ queue_work(system_long_wq, &vdev->pm->recovery_work);
145157 }
146158 }
147159
@@ -149,12 +161,8 @@ static void ivpu_job_timeout_work(struct work_struct *work) · 1 unmodified line
149161 {
150162 struct ivpu_pm_info *pm = container_of(work, struct ivpu_pm_info, job_timeout_work.work);
151163 struct ivpu_device *vdev = pm->vdev;
152− unsigned long timeout_ms = ivpu_tdr_timeout_ms ? ivpu_tdr_timeout_ms : vdev->timeout.tdr;
153164
154− ivpu_err(vdev, "TDR detected, timeout %lu ms", timeout_ms);
155− ivpu_hw_diagnose_failure(vdev);
156−
157− ivpu_pm_schedule_recovery(vdev);
165+ ivpu_pm_trigger_recovery(vdev, "TDR");
158166 }
159167
160168 void ivpu_start_job_timeout_detection(struct ivpu_device *vdev)
@@ -227,6 +235,9 @@ int ivpu_pm_runtime_suspend_cb(struct device *dev) · 66 unmodified lines
227235 bool hw_is_idle = true;
228236 int ret;
229237
238+ drm_WARN_ON(&vdev->drm, !xa_empty(&vdev->submitted_jobs_xa));
239+ drm_WARN_ON(&vdev->drm, work_pending(&vdev->pm->recovery_work));
240+
230241 ivpu_dbg(vdev, PM, "Runtime suspend..\n");
231242
232243 if (!ivpu_hw_is_idle(vdev) && vdev->pm->suspend_reschedule_counter) {
@@ -247,7 +258,8 @@ int ivpu_pm_runtime_suspend_cb(struct device *dev) · 14 unmodified lines
247258 ivpu_err(vdev, "Failed to set suspend VPU: %d\n", ret);
248259
249260 if (!hw_is_idle) {
250− ivpu_warn(vdev, "VPU failed to enter idle, force suspended.\n");
261+ ivpu_err(vdev, "VPU failed to enter idle, force suspended.\n");
262+ ivpu_fw_log_dump(vdev);
251263 ivpu_pm_prepare_cold_boot(vdev);
252264 } else {
253265 ivpu_pm_prepare_warm_boot(vdev);
@@ -308,11 +320,12 @@ void ivpu_pm_reset_prepare_cb(struct pci_dev *pdev) · 54 unmodified lines
308320 {
309321 struct ivpu_device *vdev = pci_get_drvdata(pdev);
310322
311− pm_runtime_get_sync(vdev->drm.dev);
312−
313323 ivpu_dbg(vdev, PM, "Pre-reset..\n");
314324 atomic_inc(&vdev->pm->reset_counter);
315− atomic_set(&vdev->pm->in_reset, 1);
325+ atomic_set(&vdev->pm->reset_pending, 1);
326+
327+ pm_runtime_get_sync(vdev->drm.dev);
328+ down_write(&vdev->pm->reset_lock);
316329 ivpu_prepare_for_reset(vdev);
317330 ivpu_hw_reset(vdev);
318331 ivpu_pm_prepare_cold_boot(vdev);
@@ -329,9 +342,11 @@ void ivpu_pm_reset_done_cb(struct pci_dev *pdev) · 10 unmodified lines
329342 ret = ivpu_resume(vdev);
330343 if (ret)
331344 ivpu_err(vdev, "Failed to set RESUME state: %d\n", ret);
332− atomic_set(&vdev->pm->in_reset, 0);
345+ up_write(&vdev->pm->reset_lock);
346+ atomic_set(&vdev->pm->reset_pending, 0);
333347 ivpu_dbg(vdev, PM, "Post-reset done.\n");
334348
349+ pm_runtime_mark_last_busy(vdev->drm.dev);
335350 pm_runtime_put_autosuspend(vdev->drm.dev);
336351 }
337352
@@ -344,7 +359,10 @@ void ivpu_pm_init(struct ivpu_device *vdev) · 6 unmodified lines
344359 pm->vdev = vdev;
345360 pm->suspend_reschedule_counter = PM_RESCHEDULE_LIMIT;
346361
347− atomic_set(&pm->in_reset, 0);
362+ init_rwsem(&pm->reset_lock);
363+ atomic_set(&pm->reset_pending, 0);
364+ atomic_set(&pm->reset_counter, 0);
365+
348366 INIT_WORK(&pm->recovery_work, ivpu_pm_recovery_work);
349367 INIT_DELAYED_WORK(&pm->job_timeout_work, ivpu_job_timeout_work);
350368
drivers/accel/ivpu/ivpu_pm.h+4−2
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 #ifndef __IVPU_PM_H__
77 #define __IVPU_PM_H__
88
9+#include <linux/rwsem.h>
910 #include <linux/types.h>
1011
1112 struct ivpu_device;
@@ -14,8 +15,9 @@ struct ivpu_pm_info { · 2 unmodified lines
1415 struct ivpu_device *vdev;
1516 struct delayed_work job_timeout_work;
1617 struct work_struct recovery_work;
17− atomic_t in_reset;
18+ struct rw_semaphore reset_lock;
1819 atomic_t reset_counter;
20+ atomic_t reset_pending;
1921 bool is_warmboot;
2022 u32 suspend_reschedule_counter;
2123 };
@@ -37,7 +39,7 @@ int __must_check ivpu_rpm_get(struct ivpu_device *vdev); · 15 unmodified lines
3739 int __must_check ivpu_rpm_get_if_active(struct ivpu_device *vdev);
3840 void ivpu_rpm_put(struct ivpu_device *vdev);
3941
40−void ivpu_pm_schedule_recovery(struct ivpu_device *vdev);
42+void ivpu_pm_trigger_recovery(struct ivpu_device *vdev, const char *reason);
4143 void ivpu_start_job_timeout_detection(struct ivpu_device *vdev);
4244 void ivpu_stop_job_timeout_detection(struct ivpu_device *vdev);
4345
drivers/accel/qaic/mhi_controller.c+2−2
@@ -358,8 +358,8 @@ static struct mhi_channel_config aic100_channels[] = { · 357 unmodified lines
358358 .wake_capable = false,
359359 },
360360 {
361− .num = 21,
362361 .name = "QAIC_TIMESYNC",
362+ .num = 21,
363363 .num_elements = 32,
364364 .local_elements = 0,
365365 .event_ring = 0,
@@ -390,8 +390,8 @@ static struct mhi_channel_config aic100_channels[] = { · 24 unmodified lines
390390 .wake_capable = false,
391391 },
392392 {
393− .num = 23,
394393 .name = "QAIC_TIMESYNC_PERIODIC",
394+ .num = 23,
395395 .num_elements = 32,
396396 .local_elements = 0,
397397 .event_ring = 0,
drivers/accel/qaic/qaic.h+1−2
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 #define to_qaic_drm_device(dev) container_of(dev, struct qaic_drm_device, drm)
3131 #define to_drm(qddev) (&(qddev)->drm)
3232 #define to_accel_kdev(qddev) (to_drm(qddev)->accel->kdev) /* Return Linux device of accel node */
33+#define to_qaic_device(dev) (to_qaic_drm_device((dev))->qdev)
3334
3435 enum __packed dev_states {
3536 /* Device is offline or will be very soon */
@@ -191,8 +192,6 @@ struct qaic_bo { · 155 unmodified lines
191192 u32 nr_slice;
192193 /* Number of slice that have been transferred by DMA engine */
193194 u32 nr_slice_xfer_done;
194− /* true = BO is queued for execution, true = BO is not queued */
195− bool queued;
196195 /*
197196 * If true then user has attached slicing information to this BO by
198197 * calling DRM_IOCTL_QAIC_ATTACH_SLICE_BO ioctl.
drivers/accel/qaic/qaic_data.c+26−33
@@ -141,6 +141,11 @@ struct dbc_rsp { · 140 unmodified lines
141141 __le16 status;
142142 } __packed;
143143
144+static inline bool bo_queued(struct qaic_bo *bo)
145+{
146+ return !list_empty(&bo->xfer_list);
147+}
148+
144149 inline int get_dbc_req_elem_size(void)
145150 {
146151 return sizeof(struct dbc_req);
@@ -569,6 +574,9 @@ static void qaic_free_sgt(struct sg_table *sgt) · 422 unmodified lines
569574 {
570575 struct scatterlist *sg;
571576
577+ if (!sgt)
578+ return;
579+
572580 for (sg = sgt->sgl; sg; sg = sg_next(sg))
573581 if (sg_page(sg))
574582 __free_pages(sg_page(sg), get_order(sg->length));
@@ -648,6 +656,7 @@ static void qaic_init_bo(struct qaic_bo *bo, bool reinit) · 73 unmodified lines
648656 }
649657 complete_all(&bo->xfer_done);
650658 INIT_LIST_HEAD(&bo->slices);
659+ INIT_LIST_HEAD(&bo->xfer_list);
651660 }
652661
653662 static struct qaic_bo *qaic_alloc_init_bo(void)
@@ -709,9 +718,13 @@ int qaic_create_bo_ioctl(struct drm_device *dev, void *data, struct drm_file *fi · 55 unmodified lines
709718 if (ret)
710719 goto free_bo;
711720
721+ ret = drm_gem_create_mmap_offset(obj);
722+ if (ret)
723+ goto free_bo;
724+
712725 ret = drm_gem_handle_create(file_priv, obj, &args->handle);
713726 if (ret)
714− goto free_sgt;
727+ goto free_bo;
715728
716729 bo->handle = args->handle;
717730 drm_gem_object_put(obj);
@@ -720,10 +733,8 @@ int qaic_create_bo_ioctl(struct drm_device *dev, void *data, struct drm_file *fi · 2 unmodified lines
720733
721734 return 0;
722735
723−free_sgt:
724− qaic_free_sgt(bo->sgt);
725736 free_bo:
726− kfree(bo);
737+ drm_gem_object_put(obj);
727738 unlock_dev_srcu:
728739 srcu_read_unlock(&qdev->dev_lock, qdev_rcu_id);
729740 unlock_usr_srcu:
@@ -738,7 +749,7 @@ int qaic_mmap_bo_ioctl(struct drm_device *dev, void *data, struct drm_file *file · 8 unmodified lines
738749 struct drm_gem_object *obj;
739750 struct qaic_device *qdev;
740751 struct qaic_user *usr;
741− int ret;
752+ int ret = 0;
742753
743754 usr = file_priv->driver_priv;
744755 usr_rcu_id = srcu_read_lock(&usr->qddev_lock);
@@ -760,9 +771,7 @@ int qaic_mmap_bo_ioctl(struct drm_device *dev, void *data, struct drm_file *file · 15 unmodified lines
760771 goto unlock_dev_srcu;
761772 }
762773
763− ret = drm_gem_create_mmap_offset(obj);
764− if (ret == 0)
765− args->offset = drm_vma_node_offset_addr(&obj->vma_node);
774+ args->offset = drm_vma_node_offset_addr(&obj->vma_node);
766775
767776 drm_gem_object_put(obj);
768777
@@ -828,9 +837,6 @@ static int qaic_prepare_import_bo(struct qaic_bo *bo, struct qaic_attach_slice_h · 59 unmodified lines
828837 struct sg_table *sgt;
829838 int ret;
830839
831− if (obj->import_attach->dmabuf->size < hdr->size)
832− return -EINVAL;
833−
834840 sgt = dma_buf_map_attachment(obj->import_attach, hdr->dir);
835841 if (IS_ERR(sgt)) {
836842 ret = PTR_ERR(sgt);
@@ -847,9 +853,6 @@ static int qaic_prepare_export_bo(struct qaic_device *qdev, struct qaic_bo *bo, · 10 unmodified lines
847853 {
848854 int ret;
849855
850− if (bo->base.size < hdr->size)
851− return -EINVAL;
852−
853856 ret = dma_map_sgtable(&qdev->pdev->dev, bo->sgt, hdr->dir, 0);
854857 if (ret)
855858 return -EFAULT;
@@ -950,9 +953,6 @@ int qaic_attach_slice_bo_ioctl(struct drm_device *dev, void *data, struct drm_fi · 94 unmodified lines
950953 if (arg_size / args->hdr.count != sizeof(*slice_ent))
951954 return -EINVAL;
952955
953− if (args->hdr.size == 0)
954− return -EINVAL;
955−
956956 if (!(args->hdr.dir == DMA_TO_DEVICE || args->hdr.dir == DMA_FROM_DEVICE))
957957 return -EINVAL;
958958
@@ -992,16 +992,16 @@ int qaic_attach_slice_bo_ioctl(struct drm_device *dev, void *data, struct drm_fi · 33 unmodified lines
992992 goto free_slice_ent;
993993 }
994994
995− ret = qaic_validate_req(qdev, slice_ent, args->hdr.count, args->hdr.size);
996− if (ret)
997− goto free_slice_ent;
998−
999995 obj = drm_gem_object_lookup(file_priv, args->hdr.handle);
1000996 if (!obj) {
1001997 ret = -ENOENT;
1002998 goto free_slice_ent;
1003999 }
10041000
1001+ ret = qaic_validate_req(qdev, slice_ent, args->hdr.count, obj->size);
1002+ if (ret)
1003+ goto put_bo;
1004+
10051005 bo = to_qaic_bo(obj);
10061006 ret = mutex_lock_interruptible(&bo->lock);
10071007 if (ret)
@@ -1173,7 +1173,6 @@ static int send_bo_list_to_device(struct qaic_device *qdev, struct drm_file *fil · 165 unmodified lines
11731173 struct bo_slice *slice;
11741174 unsigned long flags;
11751175 struct qaic_bo *bo;
1176− bool queued;
11771176 int i, j;
11781177 int ret;
11791178
@@ -1205,9 +1204,7 @@ static int send_bo_list_to_device(struct qaic_device *qdev, struct drm_file *fil · 25 unmodified lines
12051204 }
12061205
12071206 spin_lock_irqsave(&dbc->xfer_lock, flags);
1208− queued = bo->queued;
1209− bo->queued = true;
1210− if (queued) {
1207+ if (bo_queued(bo)) {
12111208 spin_unlock_irqrestore(&dbc->xfer_lock, flags);
12121209 ret = -EINVAL;
12131210 goto unlock_bo;
@@ -1230,7 +1227,6 @@ static int send_bo_list_to_device(struct qaic_device *qdev, struct drm_file *fil · 16 unmodified lines
12301227 else
12311228 ret = copy_exec_reqs(qdev, slice, dbc->id, head, tail);
12321229 if (ret) {
1233− bo->queued = false;
12341230 spin_unlock_irqrestore(&dbc->xfer_lock, flags);
12351231 goto unlock_bo;
12361232 }
@@ -1253,8 +1249,7 @@ failed_to_send_bo: · 16 unmodified lines
12531249 spin_lock_irqsave(&dbc->xfer_lock, flags);
12541250 bo = list_last_entry(&dbc->xfer_list, struct qaic_bo, xfer_list);
12551251 obj = &bo->base;
1256− bo->queued = false;
1257− list_del(&bo->xfer_list);
1252+ list_del_init(&bo->xfer_list);
12581253 spin_unlock_irqrestore(&dbc->xfer_lock, flags);
12591254 dma_sync_sgtable_for_cpu(&qdev->pdev->dev, bo->sgt, bo->dir);
12601255 drm_gem_object_put(obj);
@@ -1615,8 +1610,7 @@ read_fifo: · 354 unmodified lines
16151610 */
16161611 dma_sync_sgtable_for_cpu(&qdev->pdev->dev, bo->sgt, bo->dir);
16171612 bo->nr_slice_xfer_done = 0;
1618− bo->queued = false;
1619− list_del(&bo->xfer_list);
1613+ list_del_init(&bo->xfer_list);
16201614 bo->perf_stats.req_processed_ts = ktime_get_ns();
16211615 complete_all(&bo->xfer_done);
16221616 drm_gem_object_put(&bo->base);
@@ -1875,7 +1869,7 @@ int qaic_detach_slice_bo_ioctl(struct drm_device *dev, void *data, struct drm_fi · 252 unmodified lines
18751869
18761870 /* Check if BO is committed to H/W for DMA */
18771871 spin_lock_irqsave(&dbc->xfer_lock, flags);
1878− if (bo->queued) {
1872+ if (bo_queued(bo)) {
18791873 spin_unlock_irqrestore(&dbc->xfer_lock, flags);
18801874 ret = -EBUSY;
18811875 goto unlock_ch_srcu;
@@ -1905,8 +1899,7 @@ static void empty_xfer_list(struct qaic_device *qdev, struct dma_bridge_chan *db · 23 unmodified lines
19051899 spin_lock_irqsave(&dbc->xfer_lock, flags);
19061900 while (!list_empty(&dbc->xfer_list)) {
19071901 bo = list_first_entry(&dbc->xfer_list, typeof(*bo), xfer_list);
1908− bo->queued = false;
1909− list_del(&bo->xfer_list);
1902+ list_del_init(&bo->xfer_list);
19101903 spin_unlock_irqrestore(&dbc->xfer_lock, flags);
19111904 bo->nr_slice_xfer_done = 0;
19121905 bo->req_id = 0;
drivers/accel/qaic/qaic_drv.c+89−51
@@ -44,6 +44,53 @@ MODULE_PARM_DESC(datapath_polling, "Operate the datapath in polling mode"); · 43 unmodified lines
4444 static bool link_up;
4545 static DEFINE_IDA(qaic_usrs);
4646
47+static void qaicm_wq_release(struct drm_device *dev, void *res)
48+{
49+ struct workqueue_struct *wq = res;
50+
51+ destroy_workqueue(wq);
52+}
53+
54+static struct workqueue_struct *qaicm_wq_init(struct drm_device *dev, const char *fmt)
55+{
56+ struct workqueue_struct *wq;
57+ int ret;
58+
59+ wq = alloc_workqueue(fmt, WQ_UNBOUND, 0);
60+ if (!wq)
61+ return ERR_PTR(-ENOMEM);
62+ ret = drmm_add_action_or_reset(dev, qaicm_wq_release, wq);
63+ if (ret)
64+ return ERR_PTR(ret);
65+
66+ return wq;
67+}
68+
69+static void qaicm_srcu_release(struct drm_device *dev, void *res)
70+{
71+ struct srcu_struct *lock = res;
72+
73+ cleanup_srcu_struct(lock);
74+}
75+
76+static int qaicm_srcu_init(struct drm_device *dev, struct srcu_struct *lock)
77+{
78+ int ret;
79+
80+ ret = init_srcu_struct(lock);
81+ if (ret)
82+ return ret;
83+
84+ return drmm_add_action_or_reset(dev, qaicm_srcu_release, lock);
85+}
86+
87+static void qaicm_pci_release(struct drm_device *dev, void *res)
88+{
89+ struct qaic_device *qdev = to_qaic_device(dev);
90+
91+ pci_set_drvdata(qdev->pdev, NULL);
92+}
93+
4794 static void free_usr(struct kref *kref)
4895 {
4996 struct qaic_user *usr = container_of(kref, struct qaic_user, ref_count);
@@ -299,74 +346,73 @@ void qaic_dev_reset_clean_local_state(struct qaic_device *qdev) · 249 unmodified lines
299346 release_dbc(qdev, i);
300347 }
301348
302−static void cleanup_qdev(struct qaic_device *qdev)
303−{
304− int i;
305−
306− for (i = 0; i < qdev->num_dbc; ++i)
307− cleanup_srcu_struct(&qdev->dbc[i].ch_lock);
308− cleanup_srcu_struct(&qdev->dev_lock);
309− pci_set_drvdata(qdev->pdev, NULL);
310− destroy_workqueue(qdev->cntl_wq);
311− destroy_workqueue(qdev->qts_wq);
312−}
313−
314349 static struct qaic_device *create_qdev(struct pci_dev *pdev, const struct pci_device_id *id)
315350 {
351+ struct device *dev = &pdev->dev;
316352 struct qaic_drm_device *qddev;
317353 struct qaic_device *qdev;
318− int i;
354+ struct drm_device *drm;
355+ int i, ret;
319356
320− qdev = devm_kzalloc(&pdev->dev, sizeof(*qdev), GFP_KERNEL);
357+ qdev = devm_kzalloc(dev, sizeof(*qdev), GFP_KERNEL);
321358 if (!qdev)
322359 return NULL;
323360
324361 qdev->dev_state = QAIC_OFFLINE;
325362 if (id->device == PCI_DEV_AIC100) {
326363 qdev->num_dbc = 16;
327− qdev->dbc = devm_kcalloc(&pdev->dev, qdev->num_dbc, sizeof(*qdev->dbc), GFP_KERNEL);
364+ qdev->dbc = devm_kcalloc(dev, qdev->num_dbc, sizeof(*qdev->dbc), GFP_KERNEL);
328365 if (!qdev->dbc)
329366 return NULL;
330367 }
331368
332− qdev->cntl_wq = alloc_workqueue("qaic_cntl", WQ_UNBOUND, 0);
333− if (!qdev->cntl_wq)
369+ qddev = devm_drm_dev_alloc(&pdev->dev, &qaic_accel_driver, struct qaic_drm_device, drm);
370+ if (IS_ERR(qddev))
371+ return NULL;
372+
373+ drm = to_drm(qddev);
374+ pci_set_drvdata(pdev, qdev);
375+
376+ ret = drmm_mutex_init(drm, &qddev->users_mutex);
377+ if (ret)
378+ return NULL;
379+ ret = drmm_add_action_or_reset(drm, qaicm_pci_release, NULL);
380+ if (ret)
381+ return NULL;
382+ ret = drmm_mutex_init(drm, &qdev->cntl_mutex);
383+ if (ret)
334384 return NULL;
335385
336− qdev->qts_wq = alloc_workqueue("qaic_ts", WQ_UNBOUND, 0);
337− if (!qdev->qts_wq) {
338− destroy_workqueue(qdev->cntl_wq);
386+ qdev->cntl_wq = qaicm_wq_init(drm, "qaic_cntl");
387+ if (IS_ERR(qdev->cntl_wq))
388+ return NULL;
389+ qdev->qts_wq = qaicm_wq_init(drm, "qaic_ts");
390+ if (IS_ERR(qdev->qts_wq))
339391 return NULL;
340− }
341392
342− pci_set_drvdata(pdev, qdev);
393+ ret = qaicm_srcu_init(drm, &qdev->dev_lock);
394+ if (ret)
395+ return NULL;
396+
397+ qdev->qddev = qddev;
343398 qdev->pdev = pdev;
399+ qddev->qdev = qdev;
344400
345− mutex_init(&qdev->cntl_mutex);
346401 INIT_LIST_HEAD(&qdev->cntl_xfer_list);
347− init_srcu_struct(&qdev->dev_lock);
402+ INIT_LIST_HEAD(&qddev->users);
348403
349404 for (i = 0; i < qdev->num_dbc; ++i) {
350405 spin_lock_init(&qdev->dbc[i].xfer_lock);
351406 qdev->dbc[i].qdev = qdev;
352407 qdev->dbc[i].id = i;
353408 INIT_LIST_HEAD(&qdev->dbc[i].xfer_list);
354− init_srcu_struct(&qdev->dbc[i].ch_lock);
409+ ret = qaicm_srcu_init(drm, &qdev->dbc[i].ch_lock);
410+ if (ret)
411+ return NULL;
355412 init_waitqueue_head(&qdev->dbc[i].dbc_release);
356413 INIT_LIST_HEAD(&qdev->dbc[i].bo_lists);
357414 }
358415
359− qddev = devm_drm_dev_alloc(&pdev->dev, &qaic_accel_driver, struct qaic_drm_device, drm);
360− if (IS_ERR(qddev)) {
361− cleanup_qdev(qdev);
362− return NULL;
363− }
364−
365− drmm_mutex_init(to_drm(qddev), &qddev->users_mutex);
366− INIT_LIST_HEAD(&qddev->users);
367− qddev->qdev = qdev;
368− qdev->qddev = qddev;
369−
370416 return qdev;
371417 }
372418
@@ -472,35 +518,28 @@ static int qaic_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 99 unmodified lines
472518
473519 ret = init_pci(qdev, pdev);
474520 if (ret)
475− goto cleanup_qdev;
521+ return ret;
476522
477523 for (i = 0; i < qdev->num_dbc; ++i)
478524 qdev->dbc[i].dbc_base = qdev->bar_2 + QAIC_DBC_OFF(i);
479525
480526 mhi_irq = init_msi(qdev, pdev);
481− if (mhi_irq < 0) {
482− ret = mhi_irq;
483− goto cleanup_qdev;
484− }
527+ if (mhi_irq < 0)
528+ return mhi_irq;
485529
486530 ret = qaic_create_drm_device(qdev, QAIC_NO_PARTITION);
487531 if (ret)
488− goto cleanup_qdev;
532+ return ret;
489533
490534 qdev->mhi_cntrl = qaic_mhi_register_controller(pdev, qdev->bar_0, mhi_irq,
491535 qdev->single_msi);
492536 if (IS_ERR(qdev->mhi_cntrl)) {
493537 ret = PTR_ERR(qdev->mhi_cntrl);
494− goto cleanup_drm_dev;
538+ qaic_destroy_drm_device(qdev, QAIC_NO_PARTITION);
539+ return ret;
495540 }
496541
497542 return 0;
498−
499−cleanup_drm_dev:
500− qaic_destroy_drm_device(qdev, QAIC_NO_PARTITION);
501−cleanup_qdev:
502− cleanup_qdev(qdev);
503− return ret;
504543 }
505544
506545 static void qaic_pci_remove(struct pci_dev *pdev)
@@ -511,9 +550,8 @@ static void qaic_pci_remove(struct pci_dev *pdev) · 4 unmodified lines
511550 return;
512551
513552 qaic_dev_reset_clean_local_state(qdev);
514− qaic_destroy_drm_device(qdev, QAIC_NO_PARTITION);
515553 qaic_mhi_free_controller(qdev->mhi_cntrl, link_up);
516− cleanup_qdev(qdev);
554+ qaic_destroy_drm_device(qdev, QAIC_NO_PARTITION);
517555 }
518556
519557 static void qaic_pci_shutdown(struct pci_dev *pdev)
drivers/android/binder.c+10−0
@@ -478,6 +478,16 @@ binder_enqueue_thread_work_ilocked(struct binder_thread *thread, · 477 unmodified lines
478478 {
479479 WARN_ON(!list_empty(&thread->waiting_thread_node));
480480 binder_enqueue_work_ilocked(work, &thread->todo);
481+
482+ /* (e)poll-based threads require an explicit wakeup signal when
483+ * queuing their own work; they rely on these events to consume
484+ * messages without I/O block. Without it, threads risk waiting
485+ * indefinitely without handling the work.
486+ */
487+ if (thread->looper & BINDER_LOOPER_STATE_POLL &&
488+ thread->pid == current->pid && !thread->process_todo)
489+ wake_up_interruptible_sync(&thread->wait);
490+
481491 thread->process_todo = true;
482492 }
483493
drivers/ata/ahci.c+33−11
@@ -48,6 +48,7 @@ enum { · 47 unmodified lines
4848 enum board_ids {
4949 /* board IDs by feature in alphabetical order */
5050 board_ahci,
51+ board_ahci_43bit_dma,
5152 board_ahci_ign_iferr,
5253 board_ahci_low_power,
5354 board_ahci_no_debounce_delay,
@@ -128,6 +129,13 @@ static const struct ata_port_info ahci_port_info[] = { · 74 unmodified lines
128129 .udma_mask = ATA_UDMA6,
129130 .port_ops = &ahci_ops,
130131 },
132+ [board_ahci_43bit_dma] = {
133+ AHCI_HFLAGS (AHCI_HFLAG_43BIT_ONLY),
134+ .flags = AHCI_FLAG_COMMON,
135+ .pio_mask = ATA_PIO4,
136+ .udma_mask = ATA_UDMA6,
137+ .port_ops = &ahci_ops,
138+ },
131139 [board_ahci_ign_iferr] = {
132140 AHCI_HFLAGS (AHCI_HFLAG_IGN_IRQ_IF_ERR),
133141 .flags = AHCI_FLAG_COMMON,
@@ -597,14 +605,14 @@ static const struct pci_device_id ahci_pci_tbl[] = { · 463 unmodified lines
597605 { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */
598606 { PCI_VDEVICE(PROMISE, 0x3781), board_ahci }, /* FastTrak TX8660 ahci-mode */
599607
600− /* Asmedia */
601− { PCI_VDEVICE(ASMEDIA, 0x0601), board_ahci }, /* ASM1060 */
602− { PCI_VDEVICE(ASMEDIA, 0x0602), board_ahci }, /* ASM1060 */
603− { PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci }, /* ASM1061 */
604− { PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci }, /* ASM1062 */
605− { PCI_VDEVICE(ASMEDIA, 0x0621), board_ahci }, /* ASM1061R */
606− { PCI_VDEVICE(ASMEDIA, 0x0622), board_ahci }, /* ASM1062R */
607− { PCI_VDEVICE(ASMEDIA, 0x0624), board_ahci }, /* ASM1062+JMB575 */
608+ /* ASMedia */
609+ { PCI_VDEVICE(ASMEDIA, 0x0601), board_ahci_43bit_dma }, /* ASM1060 */
610+ { PCI_VDEVICE(ASMEDIA, 0x0602), board_ahci_43bit_dma }, /* ASM1060 */
611+ { PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci_43bit_dma }, /* ASM1061 */
612+ { PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci_43bit_dma }, /* ASM1061/1062 */
613+ { PCI_VDEVICE(ASMEDIA, 0x0621), board_ahci_43bit_dma }, /* ASM1061R */
614+ { PCI_VDEVICE(ASMEDIA, 0x0622), board_ahci_43bit_dma }, /* ASM1062R */
615+ { PCI_VDEVICE(ASMEDIA, 0x0624), board_ahci_43bit_dma }, /* ASM1062+JMB575 */
608616 { PCI_VDEVICE(ASMEDIA, 0x1062), board_ahci }, /* ASM1062A */
609617 { PCI_VDEVICE(ASMEDIA, 0x1064), board_ahci }, /* ASM1064 */
610618 { PCI_VDEVICE(ASMEDIA, 0x1164), board_ahci }, /* ASM1164 */
@@ -663,6 +671,11 @@ MODULE_PARM_DESC(mobile_lpm_policy, "Default LPM policy for mobile chipsets"); · 52 unmodified lines
663671 static void ahci_pci_save_initial_config(struct pci_dev *pdev,
664672 struct ahci_host_priv *hpriv)
665673 {
674+ if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && pdev->device == 0x1166) {
675+ dev_info(&pdev->dev, "ASM1166 has only six ports\n");
676+ hpriv->saved_port_map = 0x3f;
677+ }
678+
666679 if (pdev->vendor == PCI_VENDOR_ID_JMICRON && pdev->device == 0x2361) {
667680 dev_info(&pdev->dev, "JMB361 has only one port\n");
668681 hpriv->saved_port_map = 1;
@@ -949,11 +962,20 @@ static int ahci_pci_device_resume(struct device *dev) · 280 unmodified lines
949962
950963 #endif /* CONFIG_PM */
951964
952−static int ahci_configure_dma_masks(struct pci_dev *pdev, int using_dac)
965+static int ahci_configure_dma_masks(struct pci_dev *pdev,
966+ struct ahci_host_priv *hpriv)
953967 {
954− const int dma_bits = using_dac ? 64 : 32;
968+ int dma_bits;
955969 int rc;
956970
971+ if (hpriv->cap & HOST_CAP_64) {
972+ dma_bits = 64;
973+ if (hpriv->flags & AHCI_HFLAG_43BIT_ONLY)
974+ dma_bits = 43;
975+ } else {
976+ dma_bits = 32;
977+ }
978+
957979 /*
958980 * If the device fixup already set the dma_mask to some non-standard
959981 * value, don't extend it here. This happens on STA2X11, for example.
@@ -1926,7 +1948,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 966 unmodified lines
19261948 ahci_gtf_filter_workaround(host);
19271949
19281950 /* initialize adapter */
1929− rc = ahci_configure_dma_masks(pdev, hpriv->cap & HOST_CAP_64);
1951+ rc = ahci_configure_dma_masks(pdev, hpriv);
19301952 if (rc)
19311953 return rc;
19321954
drivers/ata/ahci.h+1−0
@@ -247,6 +247,7 @@ enum { · 246 unmodified lines
247247 AHCI_HFLAG_SUSPEND_PHYS = BIT(26), /* handle PHYs during
248248 suspend/resume */
249249 AHCI_HFLAG_NO_SXS = BIT(28), /* SXS not supported */
250+ AHCI_HFLAG_43BIT_ONLY = BIT(29), /* 43bit DMA addr limit */
250251
251252 /* ap->flags bits */
252253
drivers/ata/libata-sata.c+1−1
@@ -784,7 +784,7 @@ bool sata_lpm_ignore_phy_events(struct ata_link *link) · 783 unmodified lines
784784 EXPORT_SYMBOL_GPL(sata_lpm_ignore_phy_events);
785785
786786 static const char *ata_lpm_policy_names[] = {
787− [ATA_LPM_UNKNOWN] = "max_performance",
787+ [ATA_LPM_UNKNOWN] = "keep_firmware_settings",
788788 [ATA_LPM_MAX_POWER] = "max_performance",
789789 [ATA_LPM_MED_POWER] = "medium_power",
790790 [ATA_LPM_MED_POWER_WITH_DIPM] = "med_power_with_dipm",
drivers/block/aoe/aoeblk.c+4−1
@@ -333,6 +333,7 @@ aoeblk_gdalloc(void *vp) · 332 unmodified lines
333333 struct gendisk *gd;
334334 mempool_t *mp;
335335 struct blk_mq_tag_set *set;
336+ sector_t ssize;
336337 ulong flags;
337338 int late = 0;
338339 int err;
@@ -396,7 +397,7 @@ aoeblk_gdalloc(void *vp) · 57 unmodified lines
396397 gd->minors = AOE_PARTITIONS;
397398 gd->fops = &aoe_bdops;
398399 gd->private_data = d;
399− set_capacity(gd, d->ssize);
400+ ssize = d->ssize;
400401 snprintf(gd->disk_name, sizeof gd->disk_name, "etherd/e%ld.%d",
401402 d->aoemajor, d->aoeminor);
402403
@@ -405,6 +406,8 @@ aoeblk_gdalloc(void *vp) · 2 unmodified lines
405406
406407 spin_unlock_irqrestore(&d->lock, flags);
407408
409+ set_capacity(gd, ssize);
410+
408411 err = device_add_disk(NULL, gd, aoe_attr_groups);
409412 if (err)
410413 goto out_disk_cleanup;
drivers/block/rbd.c+19−13
@@ -3452,14 +3452,15 @@ static bool rbd_lock_add_request(struct rbd_img_request *img_req) · 3451 unmodified lines
34523452 static void rbd_lock_del_request(struct rbd_img_request *img_req)
34533453 {
34543454 struct rbd_device *rbd_dev = img_req->rbd_dev;
3455− bool need_wakeup;
3455+ bool need_wakeup = false;
34563456
34573457 lockdep_assert_held(&rbd_dev->lock_rwsem);
34583458 spin_lock(&rbd_dev->lock_lists_lock);
3459− rbd_assert(!list_empty(&img_req->lock_item));
3460− list_del_init(&img_req->lock_item);
3461− need_wakeup = (rbd_dev->lock_state == RBD_LOCK_STATE_RELEASING &&
3462− list_empty(&rbd_dev->running_list));
3459+ if (!list_empty(&img_req->lock_item)) {
3460+ list_del_init(&img_req->lock_item);
3461+ need_wakeup = (rbd_dev->lock_state == RBD_LOCK_STATE_RELEASING &&
3462+ list_empty(&rbd_dev->running_list));
3463+ }
34633464 spin_unlock(&rbd_dev->lock_lists_lock);
34643465 if (need_wakeup)
34653466 complete(&rbd_dev->releasing_wait);
@@ -3842,14 +3843,19 @@ static void wake_lock_waiters(struct rbd_device *rbd_dev, int result) · 376 unmodified lines
38423843 return;
38433844 }
38443845
3845− list_for_each_entry(img_req, &rbd_dev->acquiring_list, lock_item) {
3846+ while (!list_empty(&rbd_dev->acquiring_list)) {
3847+ img_req = list_first_entry(&rbd_dev->acquiring_list,
3848+ struct rbd_img_request, lock_item);
38463849 mutex_lock(&img_req->state_mutex);
38473850 rbd_assert(img_req->state == RBD_IMG_EXCLUSIVE_LOCK);
3851+ if (!result)
3852+ list_move_tail(&img_req->lock_item,
3853+ &rbd_dev->running_list);
3854+ else
3855+ list_del_init(&img_req->lock_item);
38483856 rbd_img_schedule(img_req, result);
38493857 mutex_unlock(&img_req->state_mutex);
38503858 }
3851−
3852− list_splice_tail_init(&rbd_dev->acquiring_list, &rbd_dev->running_list);
38533859 }
38543860
38553861 static bool locker_equal(const struct ceph_locker *lhs,
@@ -5326,7 +5332,7 @@ static void rbd_dev_release(struct device *dev) · 1470 unmodified lines
53265332
53275333 if (need_put) {
53285334 destroy_workqueue(rbd_dev->task_wq);
5329− ida_simple_remove(&rbd_dev_id_ida, rbd_dev->dev_id);
5335+ ida_free(&rbd_dev_id_ida, rbd_dev->dev_id);
53305336 }
53315337
53325338 rbd_dev_free(rbd_dev);
@@ -5402,9 +5408,9 @@ static struct rbd_device *rbd_dev_create(struct rbd_client *rbdc, · 69 unmodified lines
54025408 return NULL;
54035409
54045410 /* get an id and fill in device name */
5405− rbd_dev->dev_id = ida_simple_get(&rbd_dev_id_ida, 0,
5406− minor_to_rbd_dev_id(1 << MINORBITS),
5407− GFP_KERNEL);
5411+ rbd_dev->dev_id = ida_alloc_max(&rbd_dev_id_ida,
5412+ minor_to_rbd_dev_id(1 << MINORBITS) - 1,
5413+ GFP_KERNEL);
54085414 if (rbd_dev->dev_id < 0)
54095415 goto fail_rbd_dev;
54105416
@@ -5425,7 +5431,7 @@ static struct rbd_device *rbd_dev_create(struct rbd_client *rbdc, · 14 unmodified lines
54255431 return rbd_dev;
54265432
54275433 fail_dev_id:
5428− ida_simple_remove(&rbd_dev_id_ida, rbd_dev->dev_id);
5434+ ida_free(&rbd_dev_id_ida, rbd_dev->dev_id);
54295435 fail_rbd_dev:
54305436 rbd_dev_free(rbd_dev);
54315437 return NULL;
drivers/cpufreq/amd-pstate.c+3−4
@@ -1232,14 +1232,13 @@ static void amd_pstate_epp_update_limit(struct cpufreq_policy *policy) · 1231 unmodified lines
12321232 max_limit_perf = div_u64(policy->max * cpudata->highest_perf, cpudata->max_freq);
12331233 min_limit_perf = div_u64(policy->min * cpudata->highest_perf, cpudata->max_freq);
12341234
1235+ WRITE_ONCE(cpudata->max_limit_perf, max_limit_perf);
1236+ WRITE_ONCE(cpudata->min_limit_perf, min_limit_perf);
1237+
12351238 max_perf = clamp_t(unsigned long, max_perf, cpudata->min_limit_perf,
12361239 cpudata->max_limit_perf);
12371240 min_perf = clamp_t(unsigned long, min_perf, cpudata->min_limit_perf,
12381241 cpudata->max_limit_perf);
1239−
1240− WRITE_ONCE(cpudata->max_limit_perf, max_limit_perf);
1241− WRITE_ONCE(cpudata->min_limit_perf, min_limit_perf);
1242−
12431242 value = READ_ONCE(cpudata->cppc_req_cached);
12441243
12451244 if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE)
drivers/cpufreq/intel_pstate.c+34−21
@@ -529,6 +529,30 @@ static int intel_pstate_cppc_get_scaling(int cpu) · 528 unmodified lines
529529 }
530530 #endif /* CONFIG_ACPI_CPPC_LIB */
531531
532+static int intel_pstate_freq_to_hwp_rel(struct cpudata *cpu, int freq,
533+ unsigned int relation)
534+{
535+ if (freq == cpu->pstate.turbo_freq)
536+ return cpu->pstate.turbo_pstate;
537+
538+ if (freq == cpu->pstate.max_freq)
539+ return cpu->pstate.max_pstate;
540+
541+ switch (relation) {
542+ case CPUFREQ_RELATION_H:
543+ return freq / cpu->pstate.scaling;
544+ case CPUFREQ_RELATION_C:
545+ return DIV_ROUND_CLOSEST(freq, cpu->pstate.scaling);
546+ }
547+
548+ return DIV_ROUND_UP(freq, cpu->pstate.scaling);
549+}
550+
551+static int intel_pstate_freq_to_hwp(struct cpudata *cpu, int freq)
552+{
553+ return intel_pstate_freq_to_hwp_rel(cpu, freq, CPUFREQ_RELATION_L);
554+}
555+
532556 /**
533557 * intel_pstate_hybrid_hwp_adjust - Calibrate HWP performance levels.
534558 * @cpu: Target CPU.
@@ -546,6 +570,7 @@ static void intel_pstate_hybrid_hwp_adjust(struct cpudata *cpu) · 11 unmodified lines
546570 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling;
547571 int perf_ctl_turbo = pstate_funcs.get_turbo(cpu->cpu);
548572 int scaling = cpu->pstate.scaling;
573+ int freq;
549574
550575 pr_debug("CPU%d: perf_ctl_max_phys = %d\n", cpu->cpu, perf_ctl_max_phys);
551576 pr_debug("CPU%d: perf_ctl_turbo = %d\n", cpu->cpu, perf_ctl_turbo);
@@ -559,16 +584,16 @@ static void intel_pstate_hybrid_hwp_adjust(struct cpudata *cpu) · 7 unmodified lines
559584 cpu->pstate.max_freq = rounddown(cpu->pstate.max_pstate * scaling,
560585 perf_ctl_scaling);
561586
562− cpu->pstate.max_pstate_physical =
563− DIV_ROUND_UP(perf_ctl_max_phys * perf_ctl_scaling,
564− scaling);
587+ freq = perf_ctl_max_phys * perf_ctl_scaling;
588+ cpu->pstate.max_pstate_physical = intel_pstate_freq_to_hwp(cpu, freq);
565589
566− cpu->pstate.min_freq = cpu->pstate.min_pstate * perf_ctl_scaling;
590+ freq = cpu->pstate.min_pstate * perf_ctl_scaling;
591+ cpu->pstate.min_freq = freq;
567592 /*
568593 * Cast the min P-state value retrieved via pstate_funcs.get_min() to
569594 * the effective range of HWP performance levels.
570595 */
571− cpu->pstate.min_pstate = DIV_ROUND_UP(cpu->pstate.min_freq, scaling);
596+ cpu->pstate.min_pstate = intel_pstate_freq_to_hwp(cpu, freq);
572597 }
573598
574599 static inline void update_turbo_state(void)
@@ -2528,13 +2553,12 @@ static void intel_pstate_update_perf_limits(struct cpudata *cpu, · 1953 unmodified lines
25282553 * abstract values to represent performance rather than pure ratios.
25292554 */
25302555 if (hwp_active && cpu->pstate.scaling != perf_ctl_scaling) {
2531− int scaling = cpu->pstate.scaling;
25322556 int freq;
25332557
25342558 freq = max_policy_perf * perf_ctl_scaling;
2535− max_policy_perf = DIV_ROUND_UP(freq, scaling);
2559+ max_policy_perf = intel_pstate_freq_to_hwp(cpu, freq);
25362560 freq = min_policy_perf * perf_ctl_scaling;
2537− min_policy_perf = DIV_ROUND_UP(freq, scaling);
2561+ min_policy_perf = intel_pstate_freq_to_hwp(cpu, freq);
25382562 }
25392563
25402564 pr_debug("cpu:%d min_policy_perf:%d max_policy_perf:%d\n",
@@ -2908,18 +2932,7 @@ static int intel_cpufreq_target(struct cpufreq_policy *policy, · 367 unmodified lines
29082932
29092933 cpufreq_freq_transition_begin(policy, &freqs);
29102934
2911− switch (relation) {
2912− case CPUFREQ_RELATION_L:
2913− target_pstate = DIV_ROUND_UP(freqs.new, cpu->pstate.scaling);
2914− break;
2915− case CPUFREQ_RELATION_H:
2916− target_pstate = freqs.new / cpu->pstate.scaling;
2917− break;
2918− default:
2919− target_pstate = DIV_ROUND_CLOSEST(freqs.new, cpu->pstate.scaling);
2920− break;
2921− }
2922−
2935+ target_pstate = intel_pstate_freq_to_hwp_rel(cpu, freqs.new, relation);
29232936 target_pstate = intel_cpufreq_update_pstate(policy, target_pstate, false);
29242937
29252938 freqs.new = target_pstate * cpu->pstate.scaling;
@@ -2937,7 +2950,7 @@ static unsigned int intel_cpufreq_fast_switch(struct cpufreq_policy *policy, · 11 unmodified lines
29372950
29382951 update_turbo_state();
29392952
2940− target_pstate = DIV_ROUND_UP(target_freq, cpu->pstate.scaling);
2953+ target_pstate = intel_pstate_freq_to_hwp(cpu, target_freq);
29412954
29422955 target_pstate = intel_cpufreq_update_pstate(policy, target_pstate, true);
29432956
drivers/crypto/caam/caamalg_qi2.c+5−2
@@ -4545,6 +4545,7 @@ struct caam_hash_alg { · 4544 unmodified lines
45454545 struct list_head entry;
45464546 struct device *dev;
45474547 int alg_type;
4548+ bool is_hmac;
45484549 struct ahash_alg ahash_alg;
45494550 };
45504551
@@ -4571,7 +4572,7 @@ static int caam_hash_cra_init(struct crypto_tfm *tfm) · 20 unmodified lines
45714572
45724573 ctx->dev = caam_hash->dev;
45734574
4574− if (alg->setkey) {
4575+ if (caam_hash->is_hmac) {
45754576 ctx->adata.key_dma = dma_map_single_attrs(ctx->dev, ctx->key,
45764577 ARRAY_SIZE(ctx->key),
45774578 DMA_TO_DEVICE,
@@ -4611,7 +4612,7 @@ static int caam_hash_cra_init(struct crypto_tfm *tfm) · 33 unmodified lines
46114612 * For keyed hash algorithms shared descriptors
46124613 * will be created later in setkey() callback
46134614 */
4614− return alg->setkey ? 0 : ahash_set_sh_desc(ahash);
4615+ return caam_hash->is_hmac ? 0 : ahash_set_sh_desc(ahash);
46154616 }
46164617
46174618 static void caam_hash_cra_exit(struct crypto_tfm *tfm)
@@ -4646,12 +4647,14 @@ static struct caam_hash_alg *caam_hash_alloc(struct device *dev, · 28 unmodified lines
46464647 template->hmac_name);
46474648 snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s",
46484649 template->hmac_driver_name);
4650+ t_alg->is_hmac = true;
46494651 } else {
46504652 snprintf(alg->cra_name, CRYPTO_MAX_ALG_NAME, "%s",
46514653 template->name);
46524654 snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s",
46534655 template->driver_name);
46544656 t_alg->ahash_alg.setkey = NULL;
4657+ t_alg->is_hmac = false;
46554658 }
46564659 alg->cra_module = THIS_MODULE;
46574660 alg->cra_init = caam_hash_cra_init;
drivers/crypto/caam/caamhash.c+5−2
@@ -1753,6 +1753,7 @@ static struct caam_hash_template driver_hash[] = { · 1752 unmodified lines
17531753 struct caam_hash_alg {
17541754 struct list_head entry;
17551755 int alg_type;
1756+ bool is_hmac;
17561757 struct ahash_engine_alg ahash_alg;
17571758 };
17581759
@@ -1804,7 +1805,7 @@ static int caam_hash_cra_init(struct crypto_tfm *tfm) · 45 unmodified lines
18041805 } else {
18051806 if (priv->era >= 6) {
18061807 ctx->dir = DMA_BIDIRECTIONAL;
1807− ctx->key_dir = alg->setkey ? DMA_TO_DEVICE : DMA_NONE;
1808+ ctx->key_dir = caam_hash->is_hmac ? DMA_TO_DEVICE : DMA_NONE;
18081809 } else {
18091810 ctx->dir = DMA_TO_DEVICE;
18101811 ctx->key_dir = DMA_NONE;
@@ -1862,7 +1863,7 @@ static int caam_hash_cra_init(struct crypto_tfm *tfm) · 51 unmodified lines
18621863 * For keyed hash algorithms shared descriptors
18631864 * will be created later in setkey() callback
18641865 */
1865− return alg->setkey ? 0 : ahash_set_sh_desc(ahash);
1866+ return caam_hash->is_hmac ? 0 : ahash_set_sh_desc(ahash);
18661867 }
18671868
18681869 static void caam_hash_cra_exit(struct crypto_tfm *tfm)
@@ -1915,12 +1916,14 @@ caam_hash_alloc(struct caam_hash_template *template, · 46 unmodified lines
19151916 template->hmac_name);
19161917 snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s",
19171918 template->hmac_driver_name);
1919+ t_alg->is_hmac = true;
19181920 } else {
19191921 snprintf(alg->cra_name, CRYPTO_MAX_ALG_NAME, "%s",
19201922 template->name);
19211923 snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s",
19221924 template->driver_name);
19231925 halg->setkey = NULL;
1926+ t_alg->is_hmac = false;
19241927 }
19251928 alg->cra_module = THIS_MODULE;
19261929 alg->cra_init = caam_hash_cra_init;
drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c+1−0
@@ -463,6 +463,7 @@ void adf_init_hw_data_4xxx(struct adf_hw_device_data *hw_data, u32 dev_id) · 462 unmodified lines
463463 hw_data->fw_name = ADF_402XX_FW;
464464 hw_data->fw_mmp_name = ADF_402XX_MMP;
465465 hw_data->uof_get_name = uof_get_name_402xx;
466+ hw_data->get_ena_thd_mask = get_ena_thd_mask;
466467 break;
467468 case ADF_401XX_PCI_DEVICE_ID:
468469 hw_data->fw_name = ADF_4XXX_FW;
drivers/cxl/core/region.c+2−2
@@ -525,7 +525,7 @@ static int alloc_hpa(struct cxl_region *cxlr, resource_size_t size) · 524 unmodified lines
525525 struct cxl_root_decoder *cxlrd = to_cxl_root_decoder(cxlr->dev.parent);
526526 struct cxl_region_params *p = &cxlr->params;
527527 struct resource *res;
528− u32 remainder = 0;
528+ u64 remainder = 0;
529529
530530 lockdep_assert_held_write(&cxl_region_rwsem);
531531
@@ -545,7 +545,7 @@ static int alloc_hpa(struct cxl_region *cxlr, resource_size_t size) · 13 unmodified lines
545545 (cxlr->mode == CXL_DECODER_PMEM && uuid_is_null(&p->uuid)))
546546 return -ENXIO;
547547
548− div_u64_rem(size, SZ_256M * p->interleave_ways, &remainder);
548+ div64_u64_rem(size, (u64)SZ_256M * p->interleave_ways, &remainder);
549549 if (remainder)
550550 return -EINVAL;
551551
drivers/cxl/pci.c+15−11
@@ -382,7 +382,7 @@ static int cxl_pci_mbox_send(struct cxl_memdev_state *mds, · 381 unmodified lines
382382 return rc;
383383 }
384384
385−static int cxl_pci_setup_mailbox(struct cxl_memdev_state *mds)
385+static int cxl_pci_setup_mailbox(struct cxl_memdev_state *mds, bool irq_avail)
386386 {
387387 struct cxl_dev_state *cxlds = &mds->cxlds;
388388 const int cap = readl(cxlds->regs.mbox + CXLDEV_MBOX_CAPS_OFFSET);
@@ -441,7 +441,7 @@ static int cxl_pci_setup_mailbox(struct cxl_memdev_state *mds) · 52 unmodified lines
441441 INIT_DELAYED_WORK(&mds->security.poll_dwork, cxl_mbox_sanitize_work);
442442
443443 /* background command interrupts are optional */
444− if (!(cap & CXLDEV_MBOX_CAP_BG_CMD_IRQ))
444+ if (!(cap & CXLDEV_MBOX_CAP_BG_CMD_IRQ) || !irq_avail)
445445 return 0;
446446
447447 msgnum = FIELD_GET(CXLDEV_MBOX_CAP_IRQ_MSGNUM_MASK, cap);
@@ -588,7 +588,7 @@ static int cxl_mem_alloc_event_buf(struct cxl_memdev_state *mds) · 140 unmodified lines
588588 return devm_add_action_or_reset(mds->cxlds.dev, free_event_buf, buf);
589589 }
590590
591−static int cxl_alloc_irq_vectors(struct pci_dev *pdev)
591+static bool cxl_alloc_irq_vectors(struct pci_dev *pdev)
592592 {
593593 int nvecs;
594594
@@ -605,9 +605,9 @@ static int cxl_alloc_irq_vectors(struct pci_dev *pdev) · 10 unmodified lines
605605 PCI_IRQ_MSIX | PCI_IRQ_MSI);
606606 if (nvecs < 1) {
607607 dev_dbg(&pdev->dev, "Failed to alloc irq vectors: %d\n", nvecs);
608− return -ENXIO;
608+ return false;
609609 }
610− return 0;
610+ return true;
611611 }
612612
613613 static irqreturn_t cxl_event_thread(int irq, void *id)
@@ -743,7 +743,7 @@ static bool cxl_event_int_is_fw(u8 setting) · 129 unmodified lines
743743 }
744744
745745 static int cxl_event_config(struct pci_host_bridge *host_bridge,
746− struct cxl_memdev_state *mds)
746+ struct cxl_memdev_state *mds, bool irq_avail)
747747 {
748748 struct cxl_event_interrupt_policy policy;
749749 int rc;
@@ -755,6 +755,11 @@ static int cxl_event_config(struct pci_host_bridge *host_bridge, · 5 unmodified lines
755755 if (!host_bridge->native_cxl_error)
756756 return 0;
757757
758+ if (!irq_avail) {
759+ dev_info(mds->cxlds.dev, "No interrupt support, disable event processing.\n");
760+ return 0;
761+ }
762+
758763 rc = cxl_mem_alloc_event_buf(mds);
759764 if (rc)
760765 return rc;
@@ -789,6 +794,7 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 28 unmodified lines
789794 struct cxl_register_map map;
790795 struct cxl_memdev *cxlmd;
791796 int i, rc, pmu_count;
797+ bool irq_avail;
792798
793799 /*
794800 * Double check the anonymous union trickery in struct cxl_regs
@@ -846,11 +852,9 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 51 unmodified lines
846852 else
847853 dev_warn(&pdev->dev, "Media not active (%d)\n", rc);
848854
849− rc = cxl_alloc_irq_vectors(pdev);
850− if (rc)
851− return rc;
855+ irq_avail = cxl_alloc_irq_vectors(pdev);
852856
853− rc = cxl_pci_setup_mailbox(mds);
857+ rc = cxl_pci_setup_mailbox(mds, irq_avail);
854858 if (rc)
855859 return rc;
856860
@@ -909,7 +913,7 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 52 unmodified lines
909913 }
910914 }
911915
912− rc = cxl_event_config(host_bridge, mds);
916+ rc = cxl_event_config(host_bridge, mds, irq_avail);
913917 if (rc)
914918 return rc;
915919
drivers/dma-buf/dma-fence.c+4−4
@@ -102,7 +102,7 @@ static atomic64_t dma_fence_context_counter = ATOMIC64_INIT(1); · 101 unmodified lines
102102 *
103103 * * Drivers are allowed to call dma_fence_wait() from their &mmu_notifier
104104 * respectively &mmu_interval_notifier callbacks. This means any code required
105− * for fence completeion cannot allocate memory with GFP_NOFS or GFP_NOIO.
105+ * for fence completion cannot allocate memory with GFP_NOFS or GFP_NOIO.
106106 * Only GFP_ATOMIC is permissible, which might fail.
107107 *
108108 * Note that only GPU drivers have a reasonable excuse for both requiring
@@ -522,7 +522,7 @@ dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout) · 413 unmodified lines
522522 EXPORT_SYMBOL(dma_fence_wait_timeout);
523523
524524 /**
525− * dma_fence_release - default relese function for fences
525+ * dma_fence_release - default release function for fences
526526 * @kref: &dma_fence.recfount
527527 *
528528 * This is the default release functions for &dma_fence. Drivers shouldn't call
@@ -974,8 +974,8 @@ void dma_fence_set_deadline(struct dma_fence *fence, ktime_t deadline) · 445 unmodified lines
974974 EXPORT_SYMBOL(dma_fence_set_deadline);
975975
976976 /**
977− * dma_fence_describe - Dump fence describtion into seq_file
978− * @fence: the 6fence to describe
977+ * dma_fence_describe - Dump fence description into seq_file
978+ * @fence: the fence to describe
979979 * @seq: the seq_file to put the textual description into
980980 *
981981 * Dump a textual description of the fence and it's state into the seq_file.
drivers/dma-buf/dma-resv.c+2−2
@@ -405,7 +405,7 @@ static void dma_resv_iter_walk_unlocked(struct dma_resv_iter *cursor) · 404 unmodified lines
405405 *
406406 * Beware that the iterator can be restarted. Code which accumulates statistics
407407 * or similar needs to check for this with dma_resv_iter_is_restarted(). For
408− * this reason prefer the locked dma_resv_iter_first() whenver possible.
408+ * this reason prefer the locked dma_resv_iter_first() whenever possible.
409409 *
410410 * Returns the first fence from an unlocked dma_resv obj.
411411 */
@@ -428,7 +428,7 @@ EXPORT_SYMBOL(dma_resv_iter_first_unlocked); · 16 unmodified lines
428428 *
429429 * Beware that the iterator can be restarted. Code which accumulates statistics
430430 * or similar needs to check for this with dma_resv_iter_is_restarted(). For
431− * this reason prefer the locked dma_resv_iter_next() whenver possible.
431+ * this reason prefer the locked dma_resv_iter_next() whenever possible.
432432 *
433433 * Returns the next fence from an unlocked dma_resv obj.
434434 */
drivers/dma-buf/heaps/cma_heap.c+3−4
@@ -168,10 +168,7 @@ static vm_fault_t cma_heap_vm_fault(struct vm_fault *vmf) · 167 unmodified lines
168168 if (vmf->pgoff > buffer->pagecount)
169169 return VM_FAULT_SIGBUS;
170170
171− vmf->page = buffer->pages[vmf->pgoff];
172− get_page(vmf->page);
173−
174− return 0;
171+ return vmf_insert_pfn(vma, vmf->address, page_to_pfn(buffer->pages[vmf->pgoff]));
175172 }
176173
177174 static const struct vm_operations_struct dma_heap_vm_ops = {
@@ -185,6 +182,8 @@ static int cma_heap_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma) · 7 unmodified lines
185182 if ((vma->vm_flags & (VM_SHARED | VM_MAYSHARE)) == 0)
186183 return -EINVAL;
187184
185+ vm_flags_set(vma, VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP);
186+
188187 vma->vm_ops = &dma_heap_vm_ops;
189188 vma->vm_private_data = buffer;
190189
drivers/dma/at_hdmac.c+21−11
@@ -222,8 +222,14 @@ struct atdma_sg { · 221 unmodified lines
222222 * @vd: pointer to the virtual dma descriptor.
223223 * @atchan: pointer to the atmel dma channel.
224224 * @total_len: total transaction byte count
225− * @sg_len: number of sg entries.
225+ * @sglen: number of sg entries.
226226 * @sg: array of sgs.
227+ * @boundary: number of transfers to perform before the automatic address increment operation
228+ * @dst_hole: value to add to the destination address when the boundary has been reached
229+ * @src_hole: value to add to the source address when the boundary has been reached
230+ * @memset_buffer: buffer used for the memset operation
231+ * @memset_paddr: physical address of the buffer used for the memset operation
232+ * @memset_vaddr: virtual address of the buffer used for the memset operation
227233 */
228234 struct at_desc {
229235 struct virt_dma_desc vd;
@@ -245,7 +251,10 @@ struct at_desc { · 15 unmodified lines
245251 /*-- Channels --------------------------------------------------------*/
246252
247253 /**
248− * atc_status - information bits stored in channel status flag
254+ * enum atc_status - information bits stored in channel status flag
255+ *
256+ * @ATC_IS_PAUSED: If channel is pauses
257+ * @ATC_IS_CYCLIC: If channel is cyclic
249258 *
250259 * Manipulated with atomic operations.
251260 */
@@ -282,7 +291,6 @@ struct at_dma_chan { · 30 unmodified lines
282291 u32 save_cfg;
283292 u32 save_dscr;
284293 struct dma_slave_config dma_sconfig;
285− bool cyclic;
286294 struct at_desc *desc;
287295 };
288296
@@ -328,12 +336,12 @@ static inline u8 convert_buswidth(enum dma_slave_buswidth addr_width) · 39 unmodified lines
328336 /**
329337 * struct at_dma - internal representation of an Atmel HDMA Controller
330338 * @dma_device: dmaengine dma_device object members
331− * @atdma_devtype: identifier of DMA controller compatibility
332− * @ch_regs: memory mapped register base
339+ * @regs: memory mapped register base
333340 * @clk: dma controller clock
334341 * @save_imr: interrupt mask register that is saved on suspend/resume cycle
335342 * @all_chan_mask: all channels availlable in a mask
336343 * @lli_pool: hw lli table
344+ * @memset_pool: hw memset pool
337345 * @chan: channels table to store at_dma_chan structures
338346 */
339347 struct at_dma {
@@ -626,6 +634,9 @@ static inline u32 atc_calc_bytes_left(u32 current_len, u32 ctrla) · 286 unmodified lines
626634
627635 /**
628636 * atc_get_llis_residue - Get residue for a hardware linked list transfer
637+ * @atchan: pointer to an atmel hdmac channel.
638+ * @desc: pointer to the descriptor for which the residue is calculated.
639+ * @residue: residue to be set to dma_tx_state.
629640 *
630641 * Calculate the residue by removing the length of the Linked List Item (LLI)
631642 * already transferred from the total length. To get the current LLI we can use
@@ -661,10 +672,8 @@ static inline u32 atc_calc_bytes_left(u32 current_len, u32 ctrla) · 29 unmodified lines
661672 * two DSCR values are different, we read again the CTRLA then the DSCR till two
662673 * consecutive read values from DSCR are equal or till the maximum trials is
663674 * reach. This algorithm is very unlikely not to find a stable value for DSCR.
664− * @atchan: pointer to an atmel hdmac channel.
665− * @desc: pointer to the descriptor for which the residue is calculated.
666− * @residue: residue to be set to dma_tx_state.
667− * Returns 0 on success, -errno otherwise.
675+ *
676+ * Returns: %0 on success, -errno otherwise.
668677 */
669678 static int atc_get_llis_residue(struct at_dma_chan *atchan,
670679 struct at_desc *desc, u32 *residue)
@@ -731,7 +740,8 @@ static int atc_get_llis_residue(struct at_dma_chan *atchan, · 60 unmodified lines
731740 * @chan: DMA channel
732741 * @cookie: transaction identifier to check status of
733742 * @residue: residue to be updated.
734− * Return 0 on success, -errono otherwise.
743+ *
744+ * Return: %0 on success, -errno otherwise.
735745 */
736746 static int atc_get_residue(struct dma_chan *chan, dma_cookie_t cookie,
737747 u32 *residue)
@@ -1710,7 +1720,7 @@ static void atc_issue_pending(struct dma_chan *chan) · 972 unmodified lines
17101720 * atc_alloc_chan_resources - allocate resources for DMA channel
17111721 * @chan: allocate descriptor resources for this channel
17121722 *
1713− * return - the number of allocated descriptors
1723+ * Return: the number of allocated descriptors
17141724 */
17151725 static int atc_alloc_chan_resources(struct dma_chan *chan)
17161726 {
drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c+6−4
@@ -38,15 +38,17 @@ static int dpaa2_qdma_alloc_chan_resources(struct dma_chan *chan) · 37 unmodified lines
3838 if (!dpaa2_chan->fd_pool)
3939 goto err;
4040
41− dpaa2_chan->fl_pool = dma_pool_create("fl_pool", dev,
42− sizeof(struct dpaa2_fl_entry),
43− sizeof(struct dpaa2_fl_entry), 0);
41+ dpaa2_chan->fl_pool =
42+ dma_pool_create("fl_pool", dev,
43+ sizeof(struct dpaa2_fl_entry) * 3,
44+ sizeof(struct dpaa2_fl_entry), 0);
45+
4446 if (!dpaa2_chan->fl_pool)
4547 goto err_fd;
4648
4749 dpaa2_chan->sdd_pool =
4850 dma_pool_create("sdd_pool", dev,
49− sizeof(struct dpaa2_qdma_sd_d),
51+ sizeof(struct dpaa2_qdma_sd_d) * 2,
5052 sizeof(struct dpaa2_qdma_sd_d), 0);
5153 if (!dpaa2_chan->sdd_pool)
5254 goto err_fl;
drivers/dma/fsl-qdma.c+12−21
@@ -514,11 +514,11 @@ static struct fsl_qdma_queue · 513 unmodified lines
514514 queue_temp = queue_head + i + (j * queue_num);
515515
516516 queue_temp->cq =
517− dma_alloc_coherent(&pdev->dev,
518− sizeof(struct fsl_qdma_format) *
519− queue_size[i],
520− &queue_temp->bus_addr,
521− GFP_KERNEL);
517+ dmam_alloc_coherent(&pdev->dev,
518+ sizeof(struct fsl_qdma_format) *
519+ queue_size[i],
520+ &queue_temp->bus_addr,
521+ GFP_KERNEL);
522522 if (!queue_temp->cq)
523523 return NULL;
524524 queue_temp->block_base = fsl_qdma->block_base +
@@ -563,15 +563,14 @@ static struct fsl_qdma_queue · 38 unmodified lines
563563 /*
564564 * Buffer for queue command
565565 */
566− status_head->cq = dma_alloc_coherent(&pdev->dev,
567− sizeof(struct fsl_qdma_format) *
568− status_size,
569− &status_head->bus_addr,
570− GFP_KERNEL);
571− if (!status_head->cq) {
572− devm_kfree(&pdev->dev, status_head);
566+ status_head->cq = dmam_alloc_coherent(&pdev->dev,
567+ sizeof(struct fsl_qdma_format) *
568+ status_size,
569+ &status_head->bus_addr,
570+ GFP_KERNEL);
571+ if (!status_head->cq)
573572 return NULL;
574− }
573+
575574 status_head->n_cq = status_size;
576575 status_head->virt_head = status_head->cq;
577576 status_head->virt_tail = status_head->cq;
@@ -1268,8 +1267,6 @@ static void fsl_qdma_cleanup_vchan(struct dma_device *dmadev) · 690 unmodified lines
12681267
12691268 static void fsl_qdma_remove(struct platform_device *pdev)
12701269 {
1271− int i;
1272− struct fsl_qdma_queue *status;
12731270 struct device_node *np = pdev->dev.of_node;
12741271 struct fsl_qdma_engine *fsl_qdma = platform_get_drvdata(pdev);
12751272
@@ -1277,12 +1274,6 @@ static void fsl_qdma_remove(struct platform_device *pdev) · 1 unmodified line
12771274 fsl_qdma_cleanup_vchan(&fsl_qdma->dma_dev);
12781275 of_dma_controller_free(np);
12791276 dma_async_device_unregister(&fsl_qdma->dma_dev);
1280−
1281− for (i = 0; i < fsl_qdma->block_number; i++) {
1282− status = fsl_qdma->status[i];
1283− dma_free_coherent(&pdev->dev, sizeof(struct fsl_qdma_format) *
1284− status->n_cq, status->cq, status->bus_addr);
1285− }
12861277 }
12871278
12881279 static const struct of_device_id fsl_qdma_dt_ids[] = {
drivers/dma/ti/edma.c+10−0
@@ -2404,6 +2404,11 @@ static int edma_probe(struct platform_device *pdev) · 2403 unmodified lines
24042404 if (irq > 0) {
24052405 irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s_ccint",
24062406 dev_name(dev));
2407+ if (!irq_name) {
2408+ ret = -ENOMEM;
2409+ goto err_disable_pm;
2410+ }
2411+
24072412 ret = devm_request_irq(dev, irq, dma_irq_handler, 0, irq_name,
24082413 ecc);
24092414 if (ret) {
@@ -2420,6 +2425,11 @@ static int edma_probe(struct platform_device *pdev) · 10 unmodified lines
24202425 if (irq > 0) {
24212426 irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s_ccerrint",
24222427 dev_name(dev));
2428+ if (!irq_name) {
2429+ ret = -ENOMEM;
2430+ goto err_disable_pm;
2431+ }
2432+
24232433 ret = devm_request_irq(dev, irq, dma_ccerr_handler, 0, irq_name,
24242434 ecc);
24252435 if (ret) {
drivers/dma/ti/k3-udma.c+8−2
@@ -3968,6 +3968,7 @@ static void udma_desc_pre_callback(struct virt_dma_chan *vc, · 3967 unmodified lines
39683968 {
39693969 struct udma_chan *uc = to_udma_chan(&vc->chan);
39703970 struct udma_desc *d;
3971+ u8 status;
39713972
39723973 if (!vd)
39733974 return;
@@ -3977,12 +3978,12 @@ static void udma_desc_pre_callback(struct virt_dma_chan *vc, · 3 unmodified lines
39773978 if (d->metadata_size)
39783979 udma_fetch_epib(uc, d);
39793980
3980− /* Provide residue information for the client */
39813981 if (result) {
39823982 void *desc_vaddr = udma_curr_cppi5_desc_vaddr(d, d->desc_idx);
39833983
39843984 if (cppi5_desc_get_type(desc_vaddr) ==
39853985 CPPI5_INFO0_DESC_TYPE_VAL_HOST) {
3986+ /* Provide residue information for the client */
39863987 result->residue = d->residue -
39873988 cppi5_hdesc_get_pktlen(desc_vaddr);
39883989 if (result->residue)
@@ -3991,7 +3992,12 @@ static void udma_desc_pre_callback(struct virt_dma_chan *vc, · 2 unmodified lines
39913992 result->result = DMA_TRANS_NOERROR;
39923993 } else {
39933994 result->residue = 0;
3994− result->result = DMA_TRANS_NOERROR;
3995+ /* Propagate TR Response errors to the client */
3996+ status = d->hwdesc[0].tr_resp_base->status;
3997+ if (status)
3998+ result->result = DMA_TRANS_ABORTED;
3999+ else
4000+ result->result = DMA_TRANS_NOERROR;
39954001 }
39964002 }
39974003 }
drivers/dpll/dpll_core.c+57−11
@@ -29,8 +29,6 @@ static u32 dpll_pin_xa_id; · 28 unmodified lines
2929 WARN_ON_ONCE(!xa_get_mark(&dpll_device_xa, (d)->id, DPLL_REGISTERED))
3030 #define ASSERT_DPLL_NOT_REGISTERED(d) \
3131 WARN_ON_ONCE(xa_get_mark(&dpll_device_xa, (d)->id, DPLL_REGISTERED))
32−#define ASSERT_PIN_REGISTERED(p) \
33− WARN_ON_ONCE(!xa_get_mark(&dpll_pin_xa, (p)->id, DPLL_REGISTERED))
3432
3533 struct dpll_device_registration {
3634 struct list_head list;
@@ -425,6 +423,53 @@ void dpll_device_unregister(struct dpll_device *dpll, · 388 unmodified lines
425423 }
426424 EXPORT_SYMBOL_GPL(dpll_device_unregister);
427425
426+static void dpll_pin_prop_free(struct dpll_pin_properties *prop)
427+{
428+ kfree(prop->package_label);
429+ kfree(prop->panel_label);
430+ kfree(prop->board_label);
431+ kfree(prop->freq_supported);
432+}
433+
434+static int dpll_pin_prop_dup(const struct dpll_pin_properties *src,
435+ struct dpll_pin_properties *dst)
436+{
437+ memcpy(dst, src, sizeof(*dst));
438+ if (src->freq_supported && src->freq_supported_num) {
439+ size_t freq_size = src->freq_supported_num *
440+ sizeof(*src->freq_supported);
441+ dst->freq_supported = kmemdup(src->freq_supported,
442+ freq_size, GFP_KERNEL);
443+ if (!src->freq_supported)
444+ return -ENOMEM;
445+ }
446+ if (src->board_label) {
447+ dst->board_label = kstrdup(src->board_label, GFP_KERNEL);
448+ if (!dst->board_label)
449+ goto err_board_label;
450+ }
451+ if (src->panel_label) {
452+ dst->panel_label = kstrdup(src->panel_label, GFP_KERNEL);
453+ if (!dst->panel_label)
454+ goto err_panel_label;
455+ }
456+ if (src->package_label) {
457+ dst->package_label = kstrdup(src->package_label, GFP_KERNEL);
458+ if (!dst->package_label)
459+ goto err_package_label;
460+ }
461+
462+ return 0;
463+
464+err_package_label:
465+ kfree(dst->panel_label);
466+err_panel_label:
467+ kfree(dst->board_label);
468+err_board_label:
469+ kfree(dst->freq_supported);
470+ return -ENOMEM;
471+}
472+
428473 static struct dpll_pin *
429474 dpll_pin_alloc(u64 clock_id, u32 pin_idx, struct module *module,
430475 const struct dpll_pin_properties *prop)
@@ -441,20 +486,24 @@ dpll_pin_alloc(u64 clock_id, u32 pin_idx, struct module *module, · 10 unmodified lines
441486 if (WARN_ON(prop->type < DPLL_PIN_TYPE_MUX ||
442487 prop->type > DPLL_PIN_TYPE_MAX)) {
443488 ret = -EINVAL;
444− goto err;
489+ goto err_pin_prop;
445490 }
446− pin->prop = prop;
491+ ret = dpll_pin_prop_dup(prop, &pin->prop);
492+ if (ret)
493+ goto err_pin_prop;
447494 refcount_set(&pin->refcount, 1);
448495 xa_init_flags(&pin->dpll_refs, XA_FLAGS_ALLOC);
449496 xa_init_flags(&pin->parent_refs, XA_FLAGS_ALLOC);
450497 ret = xa_alloc_cyclic(&dpll_pin_xa, &pin->id, pin, xa_limit_32b,
451498 &dpll_pin_xa_id, GFP_KERNEL);
452499 if (ret)
453− goto err;
500+ goto err_xa_alloc;
454501 return pin;
455−err:
502+err_xa_alloc:
456503 xa_destroy(&pin->dpll_refs);
457504 xa_destroy(&pin->parent_refs);
505+ dpll_pin_prop_free(&pin->prop);
506+err_pin_prop:
458507 kfree(pin);
459508 return ERR_PTR(ret);
460509 }
@@ -514,6 +563,7 @@ void dpll_pin_put(struct dpll_pin *pin) · 53 unmodified lines
514563 xa_destroy(&pin->dpll_refs);
515564 xa_destroy(&pin->parent_refs);
516565 xa_erase(&dpll_pin_xa, pin->id);
566+ dpll_pin_prop_free(&pin->prop);
517567 kfree(pin);
518568 }
519569 mutex_unlock(&dpll_lock);
@@ -564,8 +614,6 @@ dpll_pin_register(struct dpll_device *dpll, struct dpll_pin *pin, · 44 unmodified lines
564614 WARN_ON(!ops->state_on_dpll_get) ||
565615 WARN_ON(!ops->direction_get))
566616 return -EINVAL;
567− if (ASSERT_DPLL_REGISTERED(dpll))
568− return -EINVAL;
569617
570618 mutex_lock(&dpll_lock);
571619 if (WARN_ON(!(dpll->module == pin->module &&
@@ -636,15 +684,13 @@ int dpll_pin_on_pin_register(struct dpll_pin *parent, struct dpll_pin *pin, · 64 unmodified lines
636684 unsigned long i, stop;
637685 int ret;
638686
639− if (WARN_ON(parent->prop->type != DPLL_PIN_TYPE_MUX))
687+ if (WARN_ON(parent->prop.type != DPLL_PIN_TYPE_MUX))
640688 return -EINVAL;
641689
642690 if (WARN_ON(!ops) ||
643691 WARN_ON(!ops->state_on_pin_get) ||
644692 WARN_ON(!ops->direction_get))
645693 return -EINVAL;
646− if (ASSERT_PIN_REGISTERED(parent))
647− return -EINVAL;
648694
649695 mutex_lock(&dpll_lock);
650696 ret = dpll_xa_ref_pin_add(&pin->parent_refs, parent, ops, priv);
drivers/dpll/dpll_core.h+2−2
@@ -44,7 +44,7 @@ struct dpll_device { · 43 unmodified lines
4444 * @module: module of creator
4545 * @dpll_refs: hold referencees to dplls pin was registered with
4646 * @parent_refs: hold references to parent pins pin was registered with
47− * @prop: pointer to pin properties given by registerer
47+ * @prop: pin properties copied from the registerer
4848 * @rclk_dev_name: holds name of device when pin can recover clock from it
4949 * @refcount: refcount
5050 **/
@@ -55,7 +55,7 @@ struct dpll_pin { · 4 unmodified lines
5555 struct module *module;
5656 struct xarray dpll_refs;
5757 struct xarray parent_refs;
58− const struct dpll_pin_properties *prop;
58+ struct dpll_pin_properties prop;
5959 refcount_t refcount;
6060 };
6161
drivers/dpll/dpll_netlink.c+41−16
@@ -303,17 +303,17 @@ dpll_msg_add_pin_freq(struct sk_buff *msg, struct dpll_pin *pin, · 302 unmodified lines
303303 if (nla_put_64bit(msg, DPLL_A_PIN_FREQUENCY, sizeof(freq), &freq,
304304 DPLL_A_PIN_PAD))
305305 return -EMSGSIZE;
306− for (fs = 0; fs < pin->prop->freq_supported_num; fs++) {
306+ for (fs = 0; fs < pin->prop.freq_supported_num; fs++) {
307307 nest = nla_nest_start(msg, DPLL_A_PIN_FREQUENCY_SUPPORTED);
308308 if (!nest)
309309 return -EMSGSIZE;
310− freq = pin->prop->freq_supported[fs].min;
310+ freq = pin->prop.freq_supported[fs].min;
311311 if (nla_put_64bit(msg, DPLL_A_PIN_FREQUENCY_MIN, sizeof(freq),
312312 &freq, DPLL_A_PIN_PAD)) {
313313 nla_nest_cancel(msg, nest);
314314 return -EMSGSIZE;
315315 }
316− freq = pin->prop->freq_supported[fs].max;
316+ freq = pin->prop.freq_supported[fs].max;
317317 if (nla_put_64bit(msg, DPLL_A_PIN_FREQUENCY_MAX, sizeof(freq),
318318 &freq, DPLL_A_PIN_PAD)) {
319319 nla_nest_cancel(msg, nest);
@@ -329,9 +329,9 @@ static bool dpll_pin_is_freq_supported(struct dpll_pin *pin, u32 freq) · 9 unmodified lines
329329 {
330330 int fs;
331331
332− for (fs = 0; fs < pin->prop->freq_supported_num; fs++)
333− if (freq >= pin->prop->freq_supported[fs].min &&
334− freq <= pin->prop->freq_supported[fs].max)
332+ for (fs = 0; fs < pin->prop.freq_supported_num; fs++)
333+ if (freq >= pin->prop.freq_supported[fs].min &&
334+ freq <= pin->prop.freq_supported[fs].max)
335335 return true;
336336 return false;
337337 }
@@ -421,7 +421,7 @@ static int · 83 unmodified lines
421421 dpll_cmd_pin_get_one(struct sk_buff *msg, struct dpll_pin *pin,
422422 struct netlink_ext_ack *extack)
423423 {
424− const struct dpll_pin_properties *prop = pin->prop;
424+ const struct dpll_pin_properties *prop = &pin->prop;
425425 struct dpll_pin_ref *ref;
426426 int ret;
427427
@@ -553,6 +553,24 @@ __dpll_device_change_ntf(struct dpll_device *dpll) · 125 unmodified lines
553553 return dpll_device_event_send(DPLL_CMD_DEVICE_CHANGE_NTF, dpll);
554554 }
555555
556+static bool dpll_pin_available(struct dpll_pin *pin)
557+{
558+ struct dpll_pin_ref *par_ref;
559+ unsigned long i;
560+
561+ if (!xa_get_mark(&dpll_pin_xa, pin->id, DPLL_REGISTERED))
562+ return false;
563+ xa_for_each(&pin->parent_refs, i, par_ref)
564+ if (xa_get_mark(&dpll_pin_xa, par_ref->pin->id,
565+ DPLL_REGISTERED))
566+ return true;
567+ xa_for_each(&pin->dpll_refs, i, par_ref)
568+ if (xa_get_mark(&dpll_device_xa, par_ref->dpll->id,
569+ DPLL_REGISTERED))
570+ return true;
571+ return false;
572+}
573+
556574 /**
557575 * dpll_device_change_ntf - notify that the dpll device has been changed
558576 * @dpll: registered dpll pointer
@@ -579,7 +597,7 @@ dpll_pin_event_send(enum dpll_cmd event, struct dpll_pin *pin) · 20 unmodified lines
579597 int ret = -ENOMEM;
580598 void *hdr;
581599
582− if (WARN_ON(!xa_get_mark(&dpll_pin_xa, pin->id, DPLL_REGISTERED)))
600+ if (!dpll_pin_available(pin))
583601 return -ENODEV;
584602
585603 msg = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
@@ -717,7 +735,7 @@ dpll_pin_on_pin_state_set(struct dpll_pin *pin, u32 parent_idx, · 131 unmodified lines
717735 int ret;
718736
719737 if (!(DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE &
720− pin->prop->capabilities)) {
738+ pin->prop.capabilities)) {
721739 NL_SET_ERR_MSG(extack, "state changing is not allowed");
722740 return -EOPNOTSUPP;
723741 }
@@ -753,7 +771,7 @@ dpll_pin_state_set(struct dpll_device *dpll, struct dpll_pin *pin, · 29 unmodified lines
753771 int ret;
754772
755773 if (!(DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE &
756− pin->prop->capabilities)) {
774+ pin->prop.capabilities)) {
757775 NL_SET_ERR_MSG(extack, "state changing is not allowed");
758776 return -EOPNOTSUPP;
759777 }
@@ -780,7 +798,7 @@ dpll_pin_prio_set(struct dpll_device *dpll, struct dpll_pin *pin, · 20 unmodified lines
780798 int ret;
781799
782800 if (!(DPLL_PIN_CAPABILITIES_PRIORITY_CAN_CHANGE &
783− pin->prop->capabilities)) {
801+ pin->prop.capabilities)) {
784802 NL_SET_ERR_MSG(extack, "prio changing is not allowed");
785803 return -EOPNOTSUPP;
786804 }
@@ -808,7 +826,7 @@ dpll_pin_direction_set(struct dpll_pin *pin, struct dpll_device *dpll, · 21 unmodified lines
808826 int ret;
809827
810828 if (!(DPLL_PIN_CAPABILITIES_DIRECTION_CAN_CHANGE &
811− pin->prop->capabilities)) {
829+ pin->prop.capabilities)) {
812830 NL_SET_ERR_MSG(extack, "direction changing is not allowed");
813831 return -EOPNOTSUPP;
814832 }
@@ -838,8 +856,8 @@ dpll_pin_phase_adj_set(struct dpll_pin *pin, struct nlattr *phase_adj_attr, · 23 unmodified lines
838856 int ret;
839857
840858 phase_adj = nla_get_s32(phase_adj_attr);
841− if (phase_adj > pin->prop->phase_range.max ||
842− phase_adj < pin->prop->phase_range.min) {
859+ if (phase_adj > pin->prop.phase_range.max ||
860+ phase_adj < pin->prop.phase_range.min) {
843861 NL_SET_ERR_MSG_ATTR(extack, phase_adj_attr,
844862 "phase adjust value not supported");
845863 return -EINVAL;
@@ -1023,7 +1041,7 @@ dpll_pin_find(u64 clock_id, struct nlattr *mod_name_attr, · 177 unmodified lines
10231041 unsigned long i;
10241042
10251043 xa_for_each_marked(&dpll_pin_xa, i, pin, DPLL_REGISTERED) {
1026− prop = pin->prop;
1044+ prop = &pin->prop;
10271045 cid_match = clock_id ? pin->clock_id == clock_id : true;
10281046 mod_match = mod_name_attr && module_name(pin->module) ?
10291047 !nla_strcmp(mod_name_attr,
@@ -1130,6 +1148,10 @@ int dpll_nl_pin_id_get_doit(struct sk_buff *skb, struct genl_info *info) · 100 unmodified lines
11301148 }
11311149 pin = dpll_pin_find_from_nlattr(info);
11321150 if (!IS_ERR(pin)) {
1151+ if (!dpll_pin_available(pin)) {
1152+ nlmsg_free(msg);
1153+ return -ENODEV;
1154+ }
11331155 ret = dpll_msg_add_pin_handle(msg, pin);
11341156 if (ret) {
11351157 nlmsg_free(msg);
@@ -1179,6 +1201,8 @@ int dpll_nl_pin_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb) · 43 unmodified lines
11791201
11801202 xa_for_each_marked_start(&dpll_pin_xa, i, pin, DPLL_REGISTERED,
11811203 ctx->idx) {
1204+ if (!dpll_pin_available(pin))
1205+ continue;
11821206 hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).portid,
11831207 cb->nlh->nlmsg_seq,
11841208 &dpll_nl_family, NLM_F_MULTI,
@@ -1441,7 +1465,8 @@ int dpll_pin_pre_doit(const struct genl_split_ops *ops, struct sk_buff *skb, · 256 unmodified lines
14411465 }
14421466 info->user_ptr[0] = xa_load(&dpll_pin_xa,
14431467 nla_get_u32(info->attrs[DPLL_A_PIN_ID]));
1444− if (!info->user_ptr[0]) {
1468+ if (!info->user_ptr[0] ||
1469+ !dpll_pin_available(info->user_ptr[0])) {
14451470 NL_SET_ERR_MSG(info->extack, "pin not found");
14461471 ret = -ENODEV;
14471472 goto unlock_dev;
drivers/firewire/core-device.c+13−5
@@ -118,10 +118,9 @@ static int textual_leaf_to_string(const u32 *block, char *buf, size_t size) · 117 unmodified lines
118118 * @buf: where to put the string
119119 * @size: size of @buf, in bytes
120120 *
121− * The string is taken from a minimal ASCII text descriptor leaf after
122− * the immediate entry with @key. The string is zero-terminated.
123− * An overlong string is silently truncated such that it and the
124− * zero byte fit into @size.
121+ * The string is taken from a minimal ASCII text descriptor leaf just after the entry with the
122+ * @key. The string is zero-terminated. An overlong string is silently truncated such that it
123+ * and the zero byte fit into @size.
125124 *
126125 * Returns strlen(buf) or a negative error code.
127126 */
@@ -368,8 +367,17 @@ static ssize_t show_text_leaf(struct device *dev, · 240 unmodified lines
368367 for (i = 0; i < ARRAY_SIZE(directories) && !!directories[i]; ++i) {
369368 int result = fw_csr_string(directories[i], attr->key, buf, bufsize);
370369 // Detected.
371− if (result >= 0)
370+ if (result >= 0) {
372371 ret = result;
372+ } else if (i == 0 && attr->key == CSR_VENDOR) {
373+ // Sony DVMC-DA1 has configuration ROM such that the descriptor leaf entry
374+ // in the root directory follows to the directory entry for vendor ID
375+ // instead of the immediate value for vendor ID.
376+ result = fw_csr_string(directories[i], CSR_DIRECTORY | attr->key, buf,
377+ bufsize);
378+ if (result >= 0)
379+ ret = result;
380+ }
373381 }
374382
375383 if (ret >= 0) {
drivers/firmware/Kconfig+1−0
@@ -182,6 +182,7 @@ config MTK_ADSP_IPC · 181 unmodified lines
182182 config SYSFB
183183 bool
184184 select BOOT_VESA_SUPPORT
185+ select SCREEN_INFO
185186
186187 config SYSFB_SIMPLEFB
187188 bool "Mark VGA/VBE/EFI FB as generic system framebuffer"
drivers/firmware/arm_ffa/driver.c+57−28
@@ -107,12 +107,12 @@ struct ffa_drv_info { · 106 unmodified lines
107107 struct work_struct notif_pcpu_work;
108108 struct work_struct irq_work;
109109 struct xarray partition_info;
110− unsigned int partition_count;
111110 DECLARE_HASHTABLE(notifier_hash, ilog2(FFA_MAX_NOTIFICATIONS));
112111 struct mutex notify_lock; /* lock to protect notifier hashtable */
113112 };
114113
115114 static struct ffa_drv_info *drv_info;
115+static void ffa_partitions_cleanup(void);
116116
117117 /*
118118 * The driver must be able to support all the versions from the earliest
@@ -733,6 +733,11 @@ static void __do_sched_recv_cb(u16 part_id, u16 vcpu, bool is_per_vcpu) · 614 unmodified lines
733733 void *cb_data;
734734
735735 partition = xa_load(&drv_info->partition_info, part_id);
736+ if (!partition) {
737+ pr_err("%s: Invalid partition ID 0x%x\n", __func__, part_id);
738+ return;
739+ }
740+
736741 read_lock(&partition->rw_lock);
737742 callback = partition->callback;
738743 cb_data = partition->cb_data;
@@ -915,6 +920,11 @@ static int ffa_sched_recv_cb_update(u16 part_id, ffa_sched_recv_cb callback, · 176 unmodified lines
915920 return -EOPNOTSUPP;
916921
917922 partition = xa_load(&drv_info->partition_info, part_id);
923+ if (!partition) {
924+ pr_err("%s: Invalid partition ID 0x%x\n", __func__, part_id);
925+ return -EINVAL;
926+ }
927+
918928 write_lock(&partition->rw_lock);
919929
920930 cb_valid = !!partition->callback;
@@ -1186,9 +1196,9 @@ void ffa_device_match_uuid(struct ffa_device *ffa_dev, const uuid_t *uuid) · 265 unmodified lines
11861196 kfree(pbuf);
11871197 }
11881198
1189−static void ffa_setup_partitions(void)
1199+static int ffa_setup_partitions(void)
11901200 {
1191− int count, idx;
1201+ int count, idx, ret;
11921202 uuid_t uuid;
11931203 struct ffa_device *ffa_dev;
11941204 struct ffa_dev_part_info *info;
@@ -1197,7 +1207,7 @@ static void ffa_setup_partitions(void) · 2 unmodified lines
11971207 count = ffa_partition_probe(&uuid_null, &pbuf);
11981208 if (count <= 0) {
11991209 pr_info("%s: No partitions found, error %d\n", __func__, count);
1200− return;
1210+ return -EINVAL;
12011211 }
12021212
12031213 xa_init(&drv_info->partition_info);
@@ -1226,40 +1236,53 @@ static void ffa_setup_partitions(void) · 22 unmodified lines
12261236 ffa_device_unregister(ffa_dev);
12271237 continue;
12281238 }
1229− xa_store(&drv_info->partition_info, tpbuf->id, info, GFP_KERNEL);
1239+ rwlock_init(&info->rw_lock);
1240+ ret = xa_insert(&drv_info->partition_info, tpbuf->id,
1241+ info, GFP_KERNEL);
1242+ if (ret) {
1243+ pr_err("%s: failed to save partition ID 0x%x - ret:%d\n",
1244+ __func__, tpbuf->id, ret);
1245+ ffa_device_unregister(ffa_dev);
1246+ kfree(info);
1247+ }
12301248 }
1231− drv_info->partition_count = count;
12321249
12331250 kfree(pbuf);
12341251
12351252 /* Allocate for the host */
12361253 info = kzalloc(sizeof(*info), GFP_KERNEL);
1237− if (!info)
1238− return;
1239− xa_store(&drv_info->partition_info, drv_info->vm_id, info, GFP_KERNEL);
1240− drv_info->partition_count++;
1254+ if (!info) {
1255+ pr_err("%s: failed to alloc Host partition ID 0x%x. Abort.\n",
1256+ __func__, drv_info->vm_id);
1257+ /* Already registered devices are freed on bus_exit */
1258+ ffa_partitions_cleanup();
1259+ return -ENOMEM;
1260+ }
1261+
1262+ rwlock_init(&info->rw_lock);
1263+ ret = xa_insert(&drv_info->partition_info, drv_info->vm_id,
1264+ info, GFP_KERNEL);
1265+ if (ret) {
1266+ pr_err("%s: failed to save Host partition ID 0x%x - ret:%d. Abort.\n",
1267+ __func__, drv_info->vm_id, ret);
1268+ kfree(info);
1269+ /* Already registered devices are freed on bus_exit */
1270+ ffa_partitions_cleanup();
1271+ }
1272+
1273+ return ret;
12411274 }
12421275
12431276 static void ffa_partitions_cleanup(void)
12441277 {
1245− struct ffa_dev_part_info **info;
1246− int idx, count = drv_info->partition_count;
1247−
1248− if (!count)
1249− return;
1250−
1251− info = kcalloc(count, sizeof(*info), GFP_KERNEL);
1252− if (!info)
1253− return;
1254−
1255− xa_extract(&drv_info->partition_info, (void **)info, 0, VM_ID_MASK,
1256− count, XA_PRESENT);
1278+ struct ffa_dev_part_info *info;
1279+ unsigned long idx;
12571280
1258− for (idx = 0; idx < count; idx++)
1259− kfree(info[idx]);
1260− kfree(info);
1281+ xa_for_each(&drv_info->partition_info, idx, info) {
1282+ xa_erase(&drv_info->partition_info, idx);
1283+ kfree(info);
1284+ }
12611285
1262− drv_info->partition_count = 0;
12631286 xa_destroy(&drv_info->partition_info);
12641287 }
12651288
@@ -1508,7 +1531,11 @@ static int __init ffa_init(void) · 242 unmodified lines
15081531
15091532 ffa_notifications_setup();
15101533
1511− ffa_setup_partitions();
1534+ ret = ffa_setup_partitions();
1535+ if (ret) {
1536+ pr_err("failed to setup partitions\n");
1537+ goto cleanup_notifs;
1538+ }
15121539
15131540 ret = ffa_sched_recv_cb_update(drv_info->vm_id, ffa_self_notif_handle,
15141541 drv_info, true);
@@ -1516,6 +1543,9 @@ static int __init ffa_init(void) · 1 unmodified line
15161543 pr_info("Failed to register driver sched callback %d\n", ret);
15171544
15181545 return 0;
1546+
1547+cleanup_notifs:
1548+ ffa_notifications_cleanup();
15191549 free_pages:
15201550 if (drv_info->tx_buffer)
15211551 free_pages_exact(drv_info->tx_buffer, RXTX_BUFFER_SIZE);
@@ -1535,7 +1565,6 @@ static void __exit ffa_exit(void) · 13 unmodified lines
15351565 ffa_rxtx_unmap(drv_info->vm_id);
15361566 free_pages_exact(drv_info->tx_buffer, RXTX_BUFFER_SIZE);
15371567 free_pages_exact(drv_info->rx_buffer, RXTX_BUFFER_SIZE);
1538− xa_destroy(&drv_info->partition_info);
15391568 kfree(drv_info);
15401569 arm_ffa_bus_exit();
15411570 }
drivers/firmware/arm_scmi/clock.c+2−3
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 #include "notify.h"
1414
1515 /* Updated only after ALL the mandatory features for that version are merged */
16−#define SCMI_PROTOCOL_SUPPORTED_VERSION 0x20001
16+#define SCMI_PROTOCOL_SUPPORTED_VERSION 0x20000
1717
1818 enum scmi_clock_protocol_cmd {
1919 CLOCK_ATTRIBUTES = 0x3,
@@ -954,8 +954,7 @@ static int scmi_clock_protocol_init(const struct scmi_protocol_handle *ph) · 934 unmodified lines
954954 scmi_clock_describe_rates_get(ph, clkid, clk);
955955 }
956956
957− if (PROTOCOL_REV_MAJOR(version) >= 0x2 &&
958− PROTOCOL_REV_MINOR(version) >= 0x1) {
957+ if (PROTOCOL_REV_MAJOR(version) >= 0x3) {
959958 cinfo->clock_config_set = scmi_clock_config_set_v2;
960959 cinfo->clock_config_get = scmi_clock_config_get_v2;
961960 } else {
drivers/firmware/arm_scmi/common.h+1−0
@@ -314,6 +314,7 @@ void shmem_fetch_notification(struct scmi_shared_mem __iomem *shmem, · 313 unmodified lines
314314 void shmem_clear_channel(struct scmi_shared_mem __iomem *shmem);
315315 bool shmem_poll_done(struct scmi_shared_mem __iomem *shmem,
316316 struct scmi_xfer *xfer);
317+bool shmem_channel_free(struct scmi_shared_mem __iomem *shmem);
317318
318319 /* declarations for message passing transports */
319320 struct scmi_msg_payld;
drivers/firmware/arm_scmi/mailbox.c+14−0
@@ -45,6 +45,20 @@ static void rx_callback(struct mbox_client *cl, void *m) · 44 unmodified lines
4545 {
4646 struct scmi_mailbox *smbox = client_to_scmi_mailbox(cl);
4747
48+ /*
49+ * An A2P IRQ is NOT valid when received while the platform still has
50+ * the ownership of the channel, because the platform at first releases
51+ * the SMT channel and then sends the completion interrupt.
52+ *
53+ * This addresses a possible race condition in which a spurious IRQ from
54+ * a previous timed-out reply which arrived late could be wrongly
55+ * associated with the next pending transaction.
56+ */
57+ if (cl->knows_txdone && !shmem_channel_free(smbox->shmem)) {
58+ dev_warn(smbox->cinfo->dev, "Ignoring spurious A2P IRQ !\n");
59+ return;
60+ }
61+
4862 scmi_rx_callback(smbox->cinfo, shmem_read_header(smbox->shmem), NULL);
4963 }
5064
drivers/firmware/arm_scmi/perf.c+18−5
@@ -350,8 +350,8 @@ process_response_opp(struct scmi_opp *opp, unsigned int loop_idx, · 349 unmodified lines
350350 }
351351
352352 static inline void
353−process_response_opp_v4(struct perf_dom_info *dom, struct scmi_opp *opp,
354− unsigned int loop_idx,
353+process_response_opp_v4(struct device *dev, struct perf_dom_info *dom,
354+ struct scmi_opp *opp, unsigned int loop_idx,
355355 const struct scmi_msg_resp_perf_describe_levels_v4 *r)
356356 {
357357 opp->perf = le32_to_cpu(r->opp[loop_idx].perf_val);
@@ -362,10 +362,23 @@ process_response_opp_v4(struct perf_dom_info *dom, struct scmi_opp *opp, · 4 unmodified lines
362362 /* Note that PERF v4 reports always five 32-bit words */
363363 opp->indicative_freq = le32_to_cpu(r->opp[loop_idx].indicative_freq);
364364 if (dom->level_indexing_mode) {
365+ int ret;
366+
365367 opp->level_index = le32_to_cpu(r->opp[loop_idx].level_index);
366368
367− xa_store(&dom->opps_by_idx, opp->level_index, opp, GFP_KERNEL);
368− xa_store(&dom->opps_by_lvl, opp->perf, opp, GFP_KERNEL);
369+ ret = xa_insert(&dom->opps_by_idx, opp->level_index, opp,
370+ GFP_KERNEL);
371+ if (ret)
372+ dev_warn(dev,
373+ "Failed to add opps_by_idx at %d - ret:%d\n",
374+ opp->level_index, ret);
375+
376+ ret = xa_insert(&dom->opps_by_lvl, opp->perf, opp, GFP_KERNEL);
377+ if (ret)
378+ dev_warn(dev,
379+ "Failed to add opps_by_lvl at %d - ret:%d\n",
380+ opp->perf, ret);
381+
369382 hash_add(dom->opps_by_freq, &opp->hash, opp->indicative_freq);
370383 }
371384 }
@@ -382,7 +395,7 @@ iter_perf_levels_process_response(const struct scmi_protocol_handle *ph, · 10 unmodified lines
382395 if (PROTOCOL_REV_MAJOR(p->version) <= 0x3)
383396 process_response_opp(opp, st->loop_idx, response);
384397 else
385− process_response_opp_v4(p->perf_dom, opp, st->loop_idx,
398+ process_response_opp_v4(ph->dev, p->perf_dom, opp, st->loop_idx,
386399 response);
387400 p->perf_dom->opp_count++;
388401
drivers/firmware/arm_scmi/raw_mode.c+8−4
@@ -1111,7 +1111,6 @@ static int scmi_raw_mode_setup(struct scmi_raw_mode_info *raw, · 1110 unmodified lines
11111111 int i;
11121112
11131113 for (i = 0; i < num_chans; i++) {
1114− void *xret;
11151114 struct scmi_raw_queue *q;
11161115
11171116 q = scmi_raw_queue_init(raw);
@@ -1120,13 +1119,12 @@ static int scmi_raw_mode_setup(struct scmi_raw_mode_info *raw, · 2 unmodified lines
11201119 goto err_xa;
11211120 }
11221121
1123− xret = xa_store(&raw->chans_q, channels[i], q,
1122+ ret = xa_insert(&raw->chans_q, channels[i], q,
11241123 GFP_KERNEL);
1125− if (xa_err(xret)) {
1124+ if (ret) {
11261125 dev_err(dev,
11271126 "Fail to allocate Raw queue 0x%02X\n",
11281127 channels[i]);
1129− ret = xa_err(xret);
11301128 goto err_xa;
11311129 }
11321130 }
@@ -1322,6 +1320,12 @@ void scmi_raw_message_report(void *r, struct scmi_xfer *xfer, · 189 unmodified lines
13221320 dev = raw->handle->dev;
13231321 q = scmi_raw_queue_select(raw, idx,
13241322 SCMI_XFER_IS_CHAN_SET(xfer) ? chan_id : 0);
1323+ if (!q) {
1324+ dev_warn(dev,
1325+ "RAW[%d] - NO queue for chan 0x%X. Dropping report.\n",
1326+ idx, chan_id);
1327+ return;
1328+ }
13251329
13261330 /*
13271331 * Grab the msg_q_lock upfront to avoid a possible race between
drivers/firmware/arm_scmi/shmem.c+7−1
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 #include <linux/processor.h>
1111 #include <linux/types.h>
1212
13−#include <asm-generic/bug.h>
13+#include <linux/bug.h>
1414
1515 #include "common.h"
1616
@@ -122,3 +122,9 @@ bool shmem_poll_done(struct scmi_shared_mem __iomem *shmem, · 105 unmodified lines
122122 (SCMI_SHMEM_CHAN_STAT_CHANNEL_ERROR |
123123 SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE);
124124 }
125+
126+bool shmem_channel_free(struct scmi_shared_mem __iomem *shmem)
127+{
128+ return (ioread32(&shmem->channel_status) &
129+ SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE);
130+}
drivers/firmware/sysfb.c+51−2
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include <linux/init.h>
3030 #include <linux/kernel.h>
3131 #include <linux/mm.h>
32+#include <linux/pci.h>
3233 #include <linux/platform_data/simplefb.h>
3334 #include <linux/platform_device.h>
3435 #include <linux/screen_info.h>
@@ -69,24 +70,70 @@ void sysfb_disable(void) · 34 unmodified lines
6970 }
7071 EXPORT_SYMBOL_GPL(sysfb_disable);
7172
73+#if defined(CONFIG_PCI)
74+static __init bool sysfb_pci_dev_is_enabled(struct pci_dev *pdev)
75+{
76+ /*
77+ * TODO: Try to integrate this code into the PCI subsystem
78+ */
79+ int ret;
80+ u16 command;
81+
82+ ret = pci_read_config_word(pdev, PCI_COMMAND, &command);
83+ if (ret != PCIBIOS_SUCCESSFUL)
84+ return false;
85+ if (!(command & PCI_COMMAND_MEMORY))
86+ return false;
87+ return true;
88+}
89+#else
90+static __init bool sysfb_pci_dev_is_enabled(struct pci_dev *pdev)
91+{
92+ return false;
93+}
94+#endif
95+
96+static __init struct device *sysfb_parent_dev(const struct screen_info *si)
97+{
98+ struct pci_dev *pdev;
99+
100+ pdev = screen_info_pci_dev(si);
101+ if (IS_ERR(pdev)) {
102+ return ERR_CAST(pdev);
103+ } else if (pdev) {
104+ if (!sysfb_pci_dev_is_enabled(pdev))
105+ return ERR_PTR(-ENODEV);
106+ return &pdev->dev;
107+ }
108+
109+ return NULL;
110+}
111+
72112 static __init int sysfb_init(void)
73113 {
74114 struct screen_info *si = &screen_info;
115+ struct device *parent;
75116 struct simplefb_platform_data mode;
76117 const char *name;
77118 bool compatible;
78119 int ret = 0;
79120
121+ screen_info_apply_fixups();
122+
80123 mutex_lock(&disable_lock);
81124 if (disabled)
82125 goto unlock_mutex;
83126
84127 sysfb_apply_efi_quirks();
85128
129+ parent = sysfb_parent_dev(si);
130+ if (IS_ERR(parent))
131+ goto unlock_mutex;
132+
86133 /* try to create a simple-framebuffer device */
87134 compatible = sysfb_parse_mode(si, &mode);
88135 if (compatible) {
89− pd = sysfb_create_simplefb(si, &mode);
136+ pd = sysfb_create_simplefb(si, &mode, parent);
90137 if (!IS_ERR(pd))
91138 goto unlock_mutex;
92139 }
@@ -109,6 +156,8 @@ static __init int sysfb_init(void) · 16 unmodified lines
109156 goto unlock_mutex;
110157 }
111158
159+ pd->dev.parent = parent;
160+
112161 sysfb_set_efifb_fwnode(pd);
113162
114163 ret = platform_device_add_data(pd, si, sizeof(*si));
@@ -128,4 +177,4 @@ unlock_mutex: · 13 unmodified lines
128177 }
129178
130179 /* must execute after PCI subsystem for EFI quirks */
131−subsys_initcall_sync(sysfb_init);
180+device_initcall(sysfb_init);
drivers/firmware/sysfb_simplefb.c+4−1
@@ -91,7 +91,8 @@ __init bool sysfb_parse_mode(const struct screen_info *si, · 90 unmodified lines
9191 }
9292
9393 __init struct platform_device *sysfb_create_simplefb(const struct screen_info *si,
94− const struct simplefb_platform_data *mode)
94+ const struct simplefb_platform_data *mode,
95+ struct device *parent)
9596 {
9697 struct platform_device *pd;
9798 struct resource res;
@@ -143,6 +144,8 @@ __init struct platform_device *sysfb_create_simplefb(const struct screen_info *s · 45 unmodified lines
143144 if (!pd)
144145 return ERR_PTR(-ENOMEM);
145146
147+ pd->dev.parent = parent;
148+
146149 sysfb_set_efifb_fwnode(pd);
147150
148151 ret = platform_device_add_resources(pd, &res, 1);
drivers/gpio/gpio-eic-sprd.c+28−4
@@ -330,20 +330,27 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type) · 329 unmodified lines
330330 switch (flow_type) {
331331 case IRQ_TYPE_LEVEL_HIGH:
332332 sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IEV, 1);
333+ sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IC, 1);
333334 break;
334335 case IRQ_TYPE_LEVEL_LOW:
335336 sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IEV, 0);
337+ sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IC, 1);
336338 break;
337339 case IRQ_TYPE_EDGE_RISING:
338340 case IRQ_TYPE_EDGE_FALLING:
339341 case IRQ_TYPE_EDGE_BOTH:
340342 state = sprd_eic_get(chip, offset);
341− if (state)
343+ if (state) {
342344 sprd_eic_update(chip, offset,
343345 SPRD_EIC_DBNC_IEV, 0);
344− else
346+ sprd_eic_update(chip, offset,
347+ SPRD_EIC_DBNC_IC, 1);
348+ } else {
345349 sprd_eic_update(chip, offset,
346350 SPRD_EIC_DBNC_IEV, 1);
351+ sprd_eic_update(chip, offset,
352+ SPRD_EIC_DBNC_IC, 1);
353+ }
347354 break;
348355 default:
349356 return -ENOTSUPP;
@@ -355,20 +362,27 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type) · 5 unmodified lines
355362 switch (flow_type) {
356363 case IRQ_TYPE_LEVEL_HIGH:
357364 sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTPOL, 0);
365+ sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTCLR, 1);
358366 break;
359367 case IRQ_TYPE_LEVEL_LOW:
360368 sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTPOL, 1);
369+ sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTCLR, 1);
361370 break;
362371 case IRQ_TYPE_EDGE_RISING:
363372 case IRQ_TYPE_EDGE_FALLING:
364373 case IRQ_TYPE_EDGE_BOTH:
365374 state = sprd_eic_get(chip, offset);
366− if (state)
375+ if (state) {
367376 sprd_eic_update(chip, offset,
368377 SPRD_EIC_LATCH_INTPOL, 0);
369− else
378+ sprd_eic_update(chip, offset,
379+ SPRD_EIC_LATCH_INTCLR, 1);
380+ } else {
370381 sprd_eic_update(chip, offset,
371382 SPRD_EIC_LATCH_INTPOL, 1);
383+ sprd_eic_update(chip, offset,
384+ SPRD_EIC_LATCH_INTCLR, 1);
385+ }
372386 break;
373387 default:
374388 return -ENOTSUPP;
@@ -382,29 +396,34 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type) · 7 unmodified lines
382396 sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
383397 sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
384398 sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 1);
399+ sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
385400 irq_set_handler_locked(data, handle_edge_irq);
386401 break;
387402 case IRQ_TYPE_EDGE_FALLING:
388403 sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
389404 sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
390405 sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 0);
406+ sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
391407 irq_set_handler_locked(data, handle_edge_irq);
392408 break;
393409 case IRQ_TYPE_EDGE_BOTH:
394410 sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
395411 sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 1);
412+ sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
396413 irq_set_handler_locked(data, handle_edge_irq);
397414 break;
398415 case IRQ_TYPE_LEVEL_HIGH:
399416 sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
400417 sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 1);
401418 sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 1);
419+ sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
402420 irq_set_handler_locked(data, handle_level_irq);
403421 break;
404422 case IRQ_TYPE_LEVEL_LOW:
405423 sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
406424 sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 1);
407425 sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 0);
426+ sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
408427 irq_set_handler_locked(data, handle_level_irq);
409428 break;
410429 default:
@@ -417,29 +436,34 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type) · 6 unmodified lines
417436 sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
418437 sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0);
419438 sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 1);
439+ sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
420440 irq_set_handler_locked(data, handle_edge_irq);
421441 break;
422442 case IRQ_TYPE_EDGE_FALLING:
423443 sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
424444 sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0);
425445 sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 0);
446+ sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
426447 irq_set_handler_locked(data, handle_edge_irq);
427448 break;
428449 case IRQ_TYPE_EDGE_BOTH:
429450 sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0);
430451 sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 1);
452+ sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
431453 irq_set_handler_locked(data, handle_edge_irq);
432454 break;
433455 case IRQ_TYPE_LEVEL_HIGH:
434456 sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
435457 sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 1);
436458 sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 1);
459+ sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
437460 irq_set_handler_locked(data, handle_level_irq);
438461 break;
439462 case IRQ_TYPE_LEVEL_LOW:
440463 sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
441464 sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 1);
442465 sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 0);
466+ sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
443467 irq_set_handler_locked(data, handle_level_irq);
444468 break;
445469 default:
drivers/gpio/gpiolib-acpi.c+14−0
@@ -1651,6 +1651,20 @@ static const struct dmi_system_id gpiolib_acpi_quirks[] __initconst = { · 1650 unmodified lines
16511651 .ignore_interrupt = "INT33FC:00@3",
16521652 },
16531653 },
1654+ {
1655+ /*
1656+ * Spurious wakeups from TP_ATTN# pin
1657+ * Found in BIOS 0.35
1658+ * https://gitlab.freedesktop.org/drm/amd/-/issues/3073
1659+ */
1660+ .matches = {
1661+ DMI_MATCH(DMI_SYS_VENDOR, "GPD"),
1662+ DMI_MATCH(DMI_PRODUCT_NAME, "G1619-04"),
1663+ },
1664+ .driver_data = &(struct acpi_gpiolib_dmi_quirk) {
1665+ .ignore_wake = "PNP0C50:00@8",
1666+ },
1667+ },
16541668 {} /* Terminating entry */
16551669 };
16561670
drivers/gpu/drm/Kconfig+3−16
@@ -19,8 +19,7 @@ menuconfig DRM · 18 unmodified lines
1919 # gallium uses SYS_kcmp for os_same_file_description() to de-duplicate
2020 # device and dmabuf fd. Let's make sure that is available for our userspace.
2121 select KCMP
22− select VIDEO_CMDLINE
23− select VIDEO_NOMODESET
22+ select VIDEO
2423 help
2524 Kernel-level support for the Direct Rendering Infrastructure (DRI)
2625 introduced in XFree86 4.0. If you say Y here, you need to select
@@ -42,7 +41,7 @@ config DRM_MIPI_DSI · 15 unmodified lines
4241 config DRM_DEBUG_MM
4342 bool "Insert extra checks and debug info into the DRM range managers"
4443 default n
45− depends on DRM=y
44+ depends on DRM
4645 depends on STACKTRACE_SUPPORT
4746 select STACKDEPOT
4847 help
@@ -289,19 +288,7 @@ config DRM_VGEM · 240 unmodified lines
289288 as used by Mesa's software renderer for enhanced performance.
290289 If M is selected the module will be called vgem.
291290
292−config DRM_VKMS
293− tristate "Virtual KMS (EXPERIMENTAL)"
294− depends on DRM && MMU
295− select DRM_KMS_HELPER
296− select DRM_GEM_SHMEM_HELPER
297− select CRC32
298− default n
299− help
300− Virtual Kernel Mode-Setting (VKMS) is used for testing or for
301− running GPU in a headless machines. Choose this option to get
302− a VKMS.
303−
304− If M is selected the module will be called vkms.
291+source "drivers/gpu/drm/vkms/Kconfig"
305292
306293 source "drivers/gpu/drm/exynos/Kconfig"
307294
drivers/gpu/drm/amd/amdgpu/Makefile+1−1
@@ -80,7 +80,7 @@ amdgpu-y += amdgpu_device.o amdgpu_doorbell_mgr.o amdgpu_kms.o \ · 79 unmodified lines
8080 amdgpu_umc.o smu_v11_0_i2c.o amdgpu_fru_eeprom.o amdgpu_rap.o \
8181 amdgpu_fw_attestation.o amdgpu_securedisplay.o \
8282 amdgpu_eeprom.o amdgpu_mca.o amdgpu_psp_ta.o amdgpu_lsdma.o \
83− amdgpu_ring_mux.o amdgpu_xcp.o amdgpu_seq64.o
83+ amdgpu_ring_mux.o amdgpu_xcp.o amdgpu_seq64.o amdgpu_aca.o
8484
8585 amdgpu-$(CONFIG_PROC_FS) += amdgpu_fdinfo.o
8686
drivers/gpu/drm/amd/amdgpu/amdgpu.h+10−6
@@ -107,6 +107,7 @@ · 106 unmodified lines
107107 #include "amdgpu_smuio.h"
108108 #include "amdgpu_fdinfo.h"
109109 #include "amdgpu_mca.h"
110+#include "amdgpu_aca.h"
110111 #include "amdgpu_ras.h"
111112 #include "amdgpu_xcp.h"
112113 #include "amdgpu_seq64.h"
@@ -114,14 +115,12 @@ · 1 unmodified line
114115
115116 #define MAX_GPU_INSTANCE 64
116117
117−struct amdgpu_gpu_instance
118−{
118+struct amdgpu_gpu_instance {
119119 struct amdgpu_device *adev;
120120 int mgpu_fan_enabled;
121121 };
122122
123−struct amdgpu_mgpu_info
124−{
123+struct amdgpu_mgpu_info {
125124 struct amdgpu_gpu_instance gpu_ins[MAX_GPU_INSTANCE];
126125 struct mutex mutex;
127126 uint32_t num_gpu;
@@ -140,8 +139,7 @@ enum amdgpu_ss { · 12 unmodified lines
140139 AMDGPU_SS_DRV_UNLOAD
141140 };
142141
143−struct amdgpu_watchdog_timer
144−{
142+struct amdgpu_watchdog_timer {
145143 bool timeout_fatal_disable;
146144 uint32_t period; /* maxCycles = (1 << period), the number of cycles before a timeout */
147145 };
@@ -1045,6 +1043,9 @@ struct amdgpu_device { · 897 unmodified lines
10451043 /* MCA */
10461044 struct amdgpu_mca mca;
10471045
1046+ /* ACA */
1047+ struct amdgpu_aca aca;
1048+
10481049 struct amdgpu_ip_block ip_blocks[AMDGPU_MAX_IP_NUM];
10491050 uint32_t harvest_ip_mask;
10501051 int num_ip_blocks;
@@ -1078,6 +1079,8 @@ struct amdgpu_device { · 27 unmodified lines
10781079 bool in_s3;
10791080 bool in_s4;
10801081 bool in_s0ix;
1082+ /* indicate amdgpu suspension status */
1083+ bool suspend_complete;
10811084
10821085 enum pp_mp1_state mp1_state;
10831086 struct amdgpu_doorbell_index doorbell_index;
@@ -1329,6 +1332,7 @@ int emu_soc_asic_init(struct amdgpu_device *adev); · 245 unmodified lines
13291332 #define WREG32_FIELD_OFFSET(reg, offset, field, val) \
13301333 WREG32(mm##reg + offset, (RREG32(mm##reg + offset) & ~REG_FIELD_MASK(reg, field)) | (val) << REG_FIELD_SHIFT(reg, field))
13311334
1335+#define AMDGPU_GET_REG_FIELD(x, h, l) (((x) & GENMASK_ULL(h, l)) >> (l))
13321336 /*
13331337 * BIOS helpers.
13341338 */
drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c+879−0
@@ -0,0 +1,879 @@
1+/*
2+ * Copyright 2023 Advanced Micro Devices, Inc.
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a
5+ * copy of this software and associated documentation files (the "Software"),
6+ * to deal in the Software without restriction, including without limitation
7+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+ * and/or sell copies of the Software, and to permit persons to whom the
9+ * Software is furnished to do so, subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included in
12+ * all copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+ * OTHER DEALINGS IN THE SOFTWARE.
21+ *
22+ */
23+
24+#include <linux/list.h>
25+#include "amdgpu.h"
26+#include "amdgpu_aca.h"
27+#include "amdgpu_ras.h"
28+
29+#define ACA_BANK_HWID(type, hwid, mcatype) [ACA_HWIP_TYPE_##type] = {hwid, mcatype}
30+
31+typedef int bank_handler_t(struct aca_handle *handle, struct aca_bank *bank, enum aca_error_type type, void *data);
32+
33+struct aca_banks {
34+ int nr_banks;
35+ struct list_head list;
36+};
37+
38+struct aca_hwip {
39+ int hwid;
40+ int mcatype;
41+};
42+
43+static struct aca_hwip aca_hwid_mcatypes[ACA_HWIP_TYPE_COUNT] = {
44+ ACA_BANK_HWID(SMU, 0x01, 0x01),
45+ ACA_BANK_HWID(PCS_XGMI, 0x50, 0x00),
46+ ACA_BANK_HWID(UMC, 0x96, 0x00),
47+};
48+
49+static void aca_banks_init(struct aca_banks *banks)
50+{
51+ if (!banks)
52+ return;
53+
54+ memset(banks, 0, sizeof(*banks));
55+ INIT_LIST_HEAD(&banks->list);
56+}
57+
58+static int aca_banks_add_bank(struct aca_banks *banks, struct aca_bank *bank)
59+{
60+ struct aca_bank_node *node;
61+
62+ if (!bank)
63+ return -EINVAL;
64+
65+ node = kvzalloc(sizeof(*node), GFP_KERNEL);
66+ if (!node)
67+ return -ENOMEM;
68+
69+ memcpy(&node->bank, bank, sizeof(*bank));
70+
71+ INIT_LIST_HEAD(&node->node);
72+ list_add_tail(&node->node, &banks->list);
73+
74+ banks->nr_banks++;
75+
76+ return 0;
77+}
78+
79+static void aca_banks_release(struct aca_banks *banks)
80+{
81+ struct aca_bank_node *node, *tmp;
82+
83+ list_for_each_entry_safe(node, tmp, &banks->list, node) {
84+ list_del(&node->node);
85+ kvfree(node);
86+ }
87+}
88+
89+static int aca_smu_get_valid_aca_count(struct amdgpu_device *adev, enum aca_error_type type, u32 *count)
90+{
91+ struct amdgpu_aca *aca = &adev->aca;
92+ const struct aca_smu_funcs *smu_funcs = aca->smu_funcs;
93+
94+ if (!count)
95+ return -EINVAL;
96+
97+ if (!smu_funcs || !smu_funcs->get_valid_aca_count)
98+ return -EOPNOTSUPP;
99+
100+ return smu_funcs->get_valid_aca_count(adev, type, count);
101+}
102+
103+static struct aca_regs_dump {
104+ const char *name;
105+ int reg_idx;
106+} aca_regs[] = {
107+ {"CONTROL", ACA_REG_IDX_CTL},
108+ {"STATUS", ACA_REG_IDX_STATUS},
109+ {"ADDR", ACA_REG_IDX_ADDR},
110+ {"MISC", ACA_REG_IDX_MISC0},
111+ {"CONFIG", ACA_REG_IDX_CONFG},
112+ {"IPID", ACA_REG_IDX_IPID},
113+ {"SYND", ACA_REG_IDX_SYND},
114+ {"DESTAT", ACA_REG_IDX_DESTAT},
115+ {"DEADDR", ACA_REG_IDX_DEADDR},
116+ {"CONTROL_MASK", ACA_REG_IDX_CTL_MASK},
117+};
118+
119+static void aca_smu_bank_dump(struct amdgpu_device *adev, int idx, int total, struct aca_bank *bank)
120+{
121+ int i;
122+
123+ dev_info(adev->dev, HW_ERR "Accelerator Check Architecture events logged\n");
124+ /* plus 1 for output format, e.g: ACA[08/08]: xxxx */
125+ for (i = 0; i < ARRAY_SIZE(aca_regs); i++)
126+ dev_info(adev->dev, HW_ERR "ACA[%02d/%02d].%s=0x%016llx\n",
127+ idx + 1, total, aca_regs[i].name, bank->regs[aca_regs[i].reg_idx]);
128+}
129+
130+static int aca_smu_get_valid_aca_banks(struct amdgpu_device *adev, enum aca_error_type type,
131+ int start, int count,
132+ struct aca_banks *banks)
133+{
134+ struct amdgpu_aca *aca = &adev->aca;
135+ const struct aca_smu_funcs *smu_funcs = aca->smu_funcs;
136+ struct aca_bank bank;
137+ int i, max_count, ret;
138+
139+ if (!count)
140+ return 0;
141+
142+ if (!smu_funcs || !smu_funcs->get_valid_aca_bank)
143+ return -EOPNOTSUPP;
144+
145+ switch (type) {
146+ case ACA_ERROR_TYPE_UE:
147+ max_count = smu_funcs->max_ue_bank_count;
148+ break;
149+ case ACA_ERROR_TYPE_CE:
150+ max_count = smu_funcs->max_ce_bank_count;
151+ break;
152+ case ACA_ERROR_TYPE_DEFERRED:
153+ default:
154+ return -EINVAL;
155+ }
156+
157+ if (start + count >= max_count)
158+ return -EINVAL;
159+
160+ count = min_t(int, count, max_count);
161+ for (i = 0; i < count; i++) {
162+ memset(&bank, 0, sizeof(bank));
163+ ret = smu_funcs->get_valid_aca_bank(adev, type, start + i, &bank);
164+ if (ret)
165+ return ret;
166+
167+ aca_smu_bank_dump(adev, i, count, &bank);
168+
169+ ret = aca_banks_add_bank(banks, &bank);
170+ if (ret)
171+ return ret;
172+ }
173+
174+ return 0;
175+}
176+
177+static bool aca_bank_hwip_is_matched(struct aca_bank *bank, enum aca_hwip_type type)
178+{
179+
180+ struct aca_hwip *hwip;
181+ int hwid, mcatype;
182+ u64 ipid;
183+
184+ if (!bank || type == ACA_HWIP_TYPE_UNKNOW)
185+ return false;
186+
187+ hwip = &aca_hwid_mcatypes[type];
188+ if (!hwip->hwid)
189+ return false;
190+
191+ ipid = bank->regs[ACA_REG_IDX_IPID];
192+ hwid = ACA_REG__IPID__HARDWAREID(ipid);
193+ mcatype = ACA_REG__IPID__MCATYPE(ipid);
194+
195+ return hwip->hwid == hwid && hwip->mcatype == mcatype;
196+}
197+
198+static bool aca_bank_is_valid(struct aca_handle *handle, struct aca_bank *bank, enum aca_error_type type)
199+{
200+ const struct aca_bank_ops *bank_ops = handle->bank_ops;
201+
202+ if (!aca_bank_hwip_is_matched(bank, handle->hwip))
203+ return false;
204+
205+ if (!bank_ops->aca_bank_is_valid)
206+ return true;
207+
208+ return bank_ops->aca_bank_is_valid(handle, bank, type, handle->data);
209+}
210+
211+static struct aca_bank_error *new_bank_error(struct aca_error *aerr, struct aca_bank_info *info)
212+{
213+ struct aca_bank_error *bank_error;
214+
215+ bank_error = kvzalloc(sizeof(*bank_error), GFP_KERNEL);
216+ if (!bank_error)
217+ return NULL;
218+
219+ INIT_LIST_HEAD(&bank_error->node);
220+ memcpy(&bank_error->info, info, sizeof(*info));
221+
222+ mutex_lock(&aerr->lock);
223+ list_add_tail(&bank_error->node, &aerr->list);
224+ mutex_unlock(&aerr->lock);
225+
226+ return bank_error;
227+}
228+
229+static struct aca_bank_error *find_bank_error(struct aca_error *aerr, struct aca_bank_info *info)
230+{
231+ struct aca_bank_error *bank_error = NULL;
232+ struct aca_bank_info *tmp_info;
233+ bool found = false;
234+
235+ mutex_lock(&aerr->lock);
236+ list_for_each_entry(bank_error, &aerr->list, node) {
237+ tmp_info = &bank_error->info;
238+ if (tmp_info->socket_id == info->socket_id &&
239+ tmp_info->die_id == info->die_id) {
240+ found = true;
241+ goto out_unlock;
242+ }
243+ }
244+
245+out_unlock:
246+ mutex_unlock(&aerr->lock);
247+
248+ return found ? bank_error : NULL;
249+}
250+
251+static void aca_bank_error_remove(struct aca_error *aerr, struct aca_bank_error *bank_error)
252+{
253+ if (!aerr || !bank_error)
254+ return;
255+
256+ list_del(&bank_error->node);
257+ aerr->nr_errors--;
258+
259+ kvfree(bank_error);
260+}
261+
262+static struct aca_bank_error *get_bank_error(struct aca_error *aerr, struct aca_bank_info *info)
263+{
264+ struct aca_bank_error *bank_error;
265+
266+ if (!aerr || !info)
267+ return NULL;
268+
269+ bank_error = find_bank_error(aerr, info);
270+ if (bank_error)
271+ return bank_error;
272+
273+ return new_bank_error(aerr, info);
274+}
275+
276+static int aca_log_errors(struct aca_handle *handle, enum aca_error_type type,
277+ struct aca_bank_report *report)
278+{
279+ struct aca_error_cache *error_cache = &handle->error_cache;
280+ struct aca_bank_error *bank_error;
281+ struct aca_error *aerr;
282+
283+ if (!handle || !report)
284+ return -EINVAL;
285+
286+ if (!report->count[type])
287+ return 0;
288+
289+ aerr = &error_cache->errors[type];
290+ bank_error = get_bank_error(aerr, &report->info);
291+ if (!bank_error)
292+ return -ENOMEM;
293+
294+ bank_error->count[type] += report->count[type];
295+
296+ return 0;
297+}
298+
299+static int aca_generate_bank_report(struct aca_handle *handle, struct aca_bank *bank,
300+ enum aca_error_type type, struct aca_bank_report *report)
301+{
302+ const struct aca_bank_ops *bank_ops = handle->bank_ops;
303+
304+ if (!bank || !report)
305+ return -EINVAL;
306+
307+ if (!bank_ops->aca_bank_generate_report)
308+ return -EOPNOTSUPP;
309+
310+ memset(report, 0, sizeof(*report));
311+ return bank_ops->aca_bank_generate_report(handle, bank, type,
312+ report, handle->data);
313+}
314+
315+static int handler_aca_log_bank_error(struct aca_handle *handle, struct aca_bank *bank,
316+ enum aca_error_type type, void *data)
317+{
318+ struct aca_bank_report report;
319+ int ret;
320+
321+ ret = aca_generate_bank_report(handle, bank, type, &report);
322+ if (ret)
323+ return ret;
324+
325+ if (!report.count[type])
326+ return 0;
327+
328+ ret = aca_log_errors(handle, type, &report);
329+ if (ret)
330+ return ret;
331+
332+ return 0;
333+}
334+
335+static int aca_dispatch_bank(struct aca_handle_manager *mgr, struct aca_bank *bank,
336+ enum aca_error_type type, bank_handler_t handler, void *data)
337+{
338+ struct aca_handle *handle;
339+ int ret;
340+
341+ if (list_empty(&mgr->list))
342+ return 0;
343+
344+ list_for_each_entry(handle, &mgr->list, node) {
345+ if (!aca_bank_is_valid(handle, bank, type))
346+ continue;
347+
348+ ret = handler(handle, bank, type, data);
349+ if (ret)
350+ return ret;
351+ }
352+
353+ return 0;
354+}
355+
356+static int aca_dispatch_banks(struct aca_handle_manager *mgr, struct aca_banks *banks,
357+ enum aca_error_type type, bank_handler_t handler, void *data)
358+{
359+ struct aca_bank_node *node;
360+ struct aca_bank *bank;
361+ int ret;
362+
363+ if (!mgr || !banks)
364+ return -EINVAL;
365+
366+ /* pre check to avoid unnecessary operations */
367+ if (list_empty(&mgr->list) || list_empty(&banks->list))
368+ return 0;
369+
370+ list_for_each_entry(node, &banks->list, node) {
371+ bank = &node->bank;
372+
373+ ret = aca_dispatch_bank(mgr, bank, type, handler, data);
374+ if (ret)
375+ return ret;
376+ }
377+
378+ return 0;
379+}
380+
381+static int aca_banks_update(struct amdgpu_device *adev, enum aca_error_type type,
382+ bank_handler_t handler, void *data)
383+{
384+ struct amdgpu_aca *aca = &adev->aca;
385+ struct aca_banks banks;
386+ u32 count = 0;
387+ int ret;
388+
389+ if (list_empty(&aca->mgr.list))
390+ return 0;
391+
392+ /* NOTE: pmfw is only support UE and CE */
393+ if (type == ACA_ERROR_TYPE_DEFERRED)
394+ type = ACA_ERROR_TYPE_CE;
395+
396+ ret = aca_smu_get_valid_aca_count(adev, type, &count);
397+ if (ret)
398+ return ret;
399+
400+ if (!count)
401+ return 0;
402+
403+ aca_banks_init(&banks);
404+
405+ ret = aca_smu_get_valid_aca_banks(adev, type, 0, count, &banks);
406+ if (ret)
407+ goto err_release_banks;
408+
409+ if (list_empty(&banks.list)) {
410+ ret = 0;
411+ goto err_release_banks;
412+ }
413+
414+ ret = aca_dispatch_banks(&aca->mgr, &banks, type,
415+ handler, data);
416+ if (ret)
417+ goto err_release_banks;
418+
419+err_release_banks:
420+ aca_banks_release(&banks);
421+
422+ return ret;
423+}
424+
425+static int aca_log_aca_error_data(struct aca_bank_error *bank_error, enum aca_error_type type, struct ras_err_data *err_data)
426+{
427+ struct aca_bank_info *info;
428+ struct amdgpu_smuio_mcm_config_info mcm_info;
429+ u64 count;
430+
431+ if (type >= ACA_ERROR_TYPE_COUNT)
432+ return -EINVAL;
433+
434+ count = bank_error->count[type];
435+ if (!count)
436+ return 0;
437+
438+ info = &bank_error->info;
439+ mcm_info.die_id = info->die_id;
440+ mcm_info.socket_id = info->socket_id;
441+
442+ switch (type) {
443+ case ACA_ERROR_TYPE_UE:
444+ amdgpu_ras_error_statistic_ue_count(err_data, &mcm_info, NULL, count);
445+ break;
446+ case ACA_ERROR_TYPE_CE:
447+ amdgpu_ras_error_statistic_ce_count(err_data, &mcm_info, NULL, count);
448+ break;
449+ case ACA_ERROR_TYPE_DEFERRED:
450+ default:
451+ break;
452+ }
453+
454+ return 0;
455+}
456+
457+static int aca_log_aca_error(struct aca_handle *handle, enum aca_error_type type, struct ras_err_data *err_data)
458+{
459+ struct aca_error_cache *error_cache = &handle->error_cache;
460+ struct aca_error *aerr = &error_cache->errors[type];
461+ struct aca_bank_error *bank_error, *tmp;
462+
463+ mutex_lock(&aerr->lock);
464+
465+ if (list_empty(&aerr->list))
466+ goto out_unlock;
467+
468+ list_for_each_entry_safe(bank_error, tmp, &aerr->list, node) {
469+ aca_log_aca_error_data(bank_error, type, err_data);
470+ aca_bank_error_remove(aerr, bank_error);
471+ }
472+
473+out_unlock:
474+ mutex_unlock(&aerr->lock);
475+
476+ return 0;
477+}
478+
479+static int __aca_get_error_data(struct amdgpu_device *adev, struct aca_handle *handle, enum aca_error_type type,
480+ struct ras_err_data *err_data)
481+{
482+ int ret;
483+
484+ /* udpate aca bank to aca source error_cache first */
485+ ret = aca_banks_update(adev, type, handler_aca_log_bank_error, NULL);
486+ if (ret)
487+ return ret;
488+
489+ return aca_log_aca_error(handle, type, err_data);
490+}
491+
492+static bool aca_handle_is_valid(struct aca_handle *handle)
493+{
494+ if (!handle->mask || !list_empty(&handle->node))
495+ return false;
496+
497+ return true;
498+}
499+
500+int amdgpu_aca_get_error_data(struct amdgpu_device *adev, struct aca_handle *handle,
501+ enum aca_error_type type, void *data)
502+{
503+ struct ras_err_data *err_data = (struct ras_err_data *)data;
504+
505+ if (!handle || !err_data)
506+ return -EINVAL;
507+
508+ if (aca_handle_is_valid(handle))
509+ return -EOPNOTSUPP;
510+
511+ if (!(BIT(type) & handle->mask))
512+ return 0;
513+
514+ return __aca_get_error_data(adev, handle, type, err_data);
515+}
516+
517+static void aca_error_init(struct aca_error *aerr, enum aca_error_type type)
518+{
519+ mutex_init(&aerr->lock);
520+ INIT_LIST_HEAD(&aerr->list);
521+ aerr->type = type;
522+ aerr->nr_errors = 0;
523+}
524+
525+static void aca_init_error_cache(struct aca_handle *handle)
526+{
527+ struct aca_error_cache *error_cache = &handle->error_cache;
528+ int type;
529+
530+ for (type = ACA_ERROR_TYPE_UE; type < ACA_ERROR_TYPE_COUNT; type++)
531+ aca_error_init(&error_cache->errors[type], type);
532+}
533+
534+static void aca_error_fini(struct aca_error *aerr)
535+{
536+ struct aca_bank_error *bank_error, *tmp;
537+
538+ mutex_lock(&aerr->lock);
539+ list_for_each_entry_safe(bank_error, tmp, &aerr->list, node)
540+ aca_bank_error_remove(aerr, bank_error);
541+
542+ mutex_destroy(&aerr->lock);
543+}
544+
545+static void aca_fini_error_cache(struct aca_handle *handle)
546+{
547+ struct aca_error_cache *error_cache = &handle->error_cache;
548+ int type;
549+
550+ for (type = ACA_ERROR_TYPE_UE; type < ACA_ERROR_TYPE_COUNT; type++)
551+ aca_error_fini(&error_cache->errors[type]);
552+}
553+
554+static int add_aca_handle(struct amdgpu_device *adev, struct aca_handle_manager *mgr, struct aca_handle *handle,
555+ const char *name, const struct aca_info *ras_info, void *data)
556+{
557+ memset(handle, 0, sizeof(*handle));
558+
559+ handle->adev = adev;
560+ handle->mgr = mgr;
561+ handle->name = name;
562+ handle->hwip = ras_info->hwip;
563+ handle->mask = ras_info->mask;
564+ handle->bank_ops = ras_info->bank_ops;
565+ handle->data = data;
566+ aca_init_error_cache(handle);
567+
568+ INIT_LIST_HEAD(&handle->node);
569+ list_add_tail(&handle->node, &mgr->list);
570+ mgr->nr_handles++;
571+
572+ return 0;
573+}
574+
575+static ssize_t aca_sysfs_read(struct device *dev,
576+ struct device_attribute *attr, char *buf)
577+{
578+ struct aca_handle *handle = container_of(attr, struct aca_handle, aca_attr);
579+
580+ /* NOTE: the aca cache will be auto cleared once read,
581+ * So the driver should unify the query entry point, forward request to ras query interface directly */
582+ return amdgpu_ras_aca_sysfs_read(dev, attr, handle, buf, handle->data);
583+}
584+
585+static int add_aca_sysfs(struct amdgpu_device *adev, struct aca_handle *handle)
586+{
587+ struct device_attribute *aca_attr = &handle->aca_attr;
588+
589+ snprintf(handle->attr_name, sizeof(handle->attr_name) - 1, "aca_%s", handle->name);
590+ aca_attr->show = aca_sysfs_read;
591+ aca_attr->attr.name = handle->attr_name;
592+ aca_attr->attr.mode = S_IRUGO;
593+ sysfs_attr_init(&aca_attr->attr);
594+
595+ return sysfs_add_file_to_group(&adev->dev->kobj,
596+ &aca_attr->attr,
597+ "ras");
598+}
599+
600+int amdgpu_aca_add_handle(struct amdgpu_device *adev, struct aca_handle *handle,
601+ const char *name, const struct aca_info *ras_info, void *data)
602+{
603+ struct amdgpu_aca *aca = &adev->aca;
604+ int ret;
605+
606+ if (!amdgpu_aca_is_enabled(adev))
607+ return 0;
608+
609+ ret = add_aca_handle(adev, &aca->mgr, handle, name, ras_info, data);
610+ if (ret)
611+ return ret;
612+
613+ return add_aca_sysfs(adev, handle);
614+}
615+
616+static void remove_aca_handle(struct aca_handle *handle)
617+{
618+ struct aca_handle_manager *mgr = handle->mgr;
619+
620+ aca_fini_error_cache(handle);
621+ list_del(&handle->node);
622+ mgr->nr_handles--;
623+}
624+
625+static void remove_aca_sysfs(struct aca_handle *handle)
626+{
627+ struct amdgpu_device *adev = handle->adev;
628+ struct device_attribute *aca_attr = &handle->aca_attr;
629+
630+ if (adev->dev->kobj.sd)
631+ sysfs_remove_file_from_group(&adev->dev->kobj,
632+ &aca_attr->attr,
633+ "ras");
634+}
635+
636+void amdgpu_aca_remove_handle(struct aca_handle *handle)
637+{
638+ if (!handle || list_empty(&handle->node))
639+ return;
640+
641+ remove_aca_sysfs(handle);
642+ remove_aca_handle(handle);
643+}
644+
645+static int aca_manager_init(struct aca_handle_manager *mgr)
646+{
647+ INIT_LIST_HEAD(&mgr->list);
648+ mgr->nr_handles = 0;
649+
650+ return 0;
651+}
652+
653+static void aca_manager_fini(struct aca_handle_manager *mgr)
654+{
655+ struct aca_handle *handle, *tmp;
656+
657+ list_for_each_entry_safe(handle, tmp, &mgr->list, node)
658+ amdgpu_aca_remove_handle(handle);
659+}
660+
661+bool amdgpu_aca_is_enabled(struct amdgpu_device *adev)
662+{
663+ return adev->aca.is_enabled;
664+}
665+
666+int amdgpu_aca_init(struct amdgpu_device *adev)
667+{
668+ struct amdgpu_aca *aca = &adev->aca;
669+ int ret;
670+
671+ ret = aca_manager_init(&aca->mgr);
672+ if (ret)
673+ return ret;
674+
675+ return 0;
676+}
677+
678+void amdgpu_aca_fini(struct amdgpu_device *adev)
679+{
680+ struct amdgpu_aca *aca = &adev->aca;
681+
682+ aca_manager_fini(&aca->mgr);
683+}
684+
685+int amdgpu_aca_reset(struct amdgpu_device *adev)
686+{
687+ amdgpu_aca_fini(adev);
688+
689+ return amdgpu_aca_init(adev);
690+}
691+
692+void amdgpu_aca_set_smu_funcs(struct amdgpu_device *adev, const struct aca_smu_funcs *smu_funcs)
693+{
694+ struct amdgpu_aca *aca = &adev->aca;
695+
696+ WARN_ON(aca->smu_funcs);
697+ aca->smu_funcs = smu_funcs;
698+}
699+
700+int aca_bank_info_decode(struct aca_bank *bank, struct aca_bank_info *info)
701+{
702+ u64 ipid;
703+ u32 instidhi, instidlo;
704+
705+ if (!bank || !info)
706+ return -EINVAL;
707+
708+ ipid = bank->regs[ACA_REG_IDX_IPID];
709+ info->hwid = ACA_REG__IPID__HARDWAREID(ipid);
710+ info->mcatype = ACA_REG__IPID__MCATYPE(ipid);
711+ /*
712+ * Unfied DieID Format: SAASS. A:AID, S:Socket.
713+ * Unfied DieID[4:4] = InstanceId[0:0]
714+ * Unfied DieID[0:3] = InstanceIdHi[0:3]
715+ */
716+ instidhi = ACA_REG__IPID__INSTANCEIDHI(ipid);
717+ instidlo = ACA_REG__IPID__INSTANCEIDLO(ipid);
718+ info->die_id = ((instidhi >> 2) & 0x03);
719+ info->socket_id = ((instidlo & 0x1) << 2) | (instidhi & 0x03);
720+
721+ return 0;
722+}
723+
724+static int aca_bank_get_error_code(struct amdgpu_device *adev, struct aca_bank *bank)
725+{
726+ int error_code;
727+
728+ switch (amdgpu_ip_version(adev, MP1_HWIP, 0)) {
729+ case IP_VERSION(13, 0, 6):
730+ if (!(adev->flags & AMD_IS_APU) && adev->pm.fw_version >= 0x00555600) {
731+ error_code = ACA_REG__SYND__ERRORINFORMATION(bank->regs[ACA_REG_IDX_SYND]);
732+ return error_code & 0xff;
733+ }
734+ break;
735+ default:
736+ break;
737+ }
738+
739+ /* NOTE: the true error code is encoded in status.errorcode[0:7] */
740+ error_code = ACA_REG__STATUS__ERRORCODE(bank->regs[ACA_REG_IDX_STATUS]);
741+
742+ return error_code & 0xff;
743+}
744+
745+int aca_bank_check_error_codes(struct amdgpu_device *adev, struct aca_bank *bank, int *err_codes, int size)
746+{
747+ int i, error_code;
748+
749+ if (!bank || !err_codes)
750+ return -EINVAL;
751+
752+ error_code = aca_bank_get_error_code(adev, bank);
753+ for (i = 0; i < size; i++) {
754+ if (err_codes[i] == error_code)
755+ return 0;
756+ }
757+
758+ return -EINVAL;
759+}
760+
761+int amdgpu_aca_smu_set_debug_mode(struct amdgpu_device *adev, bool en)
762+{
763+ struct amdgpu_aca *aca = &adev->aca;
764+ const struct aca_smu_funcs *smu_funcs = aca->smu_funcs;
765+
766+ if (!smu_funcs || !smu_funcs->set_debug_mode)
767+ return -EOPNOTSUPP;
768+
769+ return smu_funcs->set_debug_mode(adev, en);
770+}
771+
772+#if defined(CONFIG_DEBUG_FS)
773+static int amdgpu_aca_smu_debug_mode_set(void *data, u64 val)
774+{
775+ struct amdgpu_device *adev = (struct amdgpu_device *)data;
776+ int ret;
777+
778+ ret = amdgpu_ras_set_aca_debug_mode(adev, val ? true : false);
779+ if (ret)
780+ return ret;
781+
782+ dev_info(adev->dev, "amdgpu set smu aca debug mode %s success\n", val ? "on" : "off");
783+
784+ return 0;
785+}
786+
787+static void aca_dump_entry(struct seq_file *m, struct aca_bank *bank, enum aca_error_type type, int idx)
788+{
789+ struct aca_bank_info info;
790+ int i, ret;
791+
792+ ret = aca_bank_info_decode(bank, &info);
793+ if (ret)
794+ return;
795+
796+ seq_printf(m, "aca entry[%d].type: %s\n", idx, type == ACA_ERROR_TYPE_UE ? "UE" : "CE");
797+ seq_printf(m, "aca entry[%d].info: socketid:%d aid:%d hwid:0x%03x mcatype:0x%04x\n",
798+ idx, info.socket_id, info.die_id, info.hwid, info.mcatype);
799+
800+ for (i = 0; i < ARRAY_SIZE(aca_regs); i++)
801+ seq_printf(m, "aca entry[%d].regs[%d]: 0x%016llx\n", idx, aca_regs[i].reg_idx, bank->regs[aca_regs[i].reg_idx]);
802+}
803+
804+struct aca_dump_context {
805+ struct seq_file *m;
806+ int idx;
807+};
808+
809+static int handler_aca_bank_dump(struct aca_handle *handle, struct aca_bank *bank,
810+ enum aca_error_type type, void *data)
811+{
812+ struct aca_dump_context *ctx = (struct aca_dump_context *)data;
813+
814+ aca_dump_entry(ctx->m, bank, type, ctx->idx++);
815+
816+ return handler_aca_log_bank_error(handle, bank, type, NULL);
817+}
818+
819+static int aca_dump_show(struct seq_file *m, enum aca_error_type type)
820+{
821+ struct amdgpu_device *adev = (struct amdgpu_device *)m->private;
822+ struct aca_dump_context context = {
823+ .m = m,
824+ .idx = 0,
825+ };
826+
827+ return aca_banks_update(adev, type, handler_aca_bank_dump, (void *)&context);
828+}
829+
830+static int aca_dump_ce_show(struct seq_file *m, void *unused)
831+{
832+ return aca_dump_show(m, ACA_ERROR_TYPE_CE);
833+}
834+
835+static int aca_dump_ce_open(struct inode *inode, struct file *file)
836+{
837+ return single_open(file, aca_dump_ce_show, inode->i_private);
838+}
839+
840+static const struct file_operations aca_ce_dump_debug_fops = {
841+ .owner = THIS_MODULE,
842+ .open = aca_dump_ce_open,
843+ .read = seq_read,
844+ .llseek = seq_lseek,
845+ .release = single_release,
846+};
847+
848+static int aca_dump_ue_show(struct seq_file *m, void *unused)
849+{
850+ return aca_dump_show(m, ACA_ERROR_TYPE_UE);
851+}
852+
853+static int aca_dump_ue_open(struct inode *inode, struct file *file)
854+{
855+ return single_open(file, aca_dump_ue_show, inode->i_private);
856+}
857+
858+static const struct file_operations aca_ue_dump_debug_fops = {
859+ .owner = THIS_MODULE,
860+ .open = aca_dump_ue_open,
861+ .read = seq_read,
862+ .llseek = seq_lseek,
863+ .release = single_release,
864+};
865+
866+DEFINE_DEBUGFS_ATTRIBUTE(aca_debug_mode_fops, NULL, amdgpu_aca_smu_debug_mode_set, "%llu\n");
867+#endif
868+
869+void amdgpu_aca_smu_debugfs_init(struct amdgpu_device *adev, struct dentry *root)
870+{
871+#if defined(CONFIG_DEBUG_FS)
872+ if (!root || adev->ip_versions[MP1_HWIP][0] != IP_VERSION(13, 0, 6))
873+ return;
874+
875+ debugfs_create_file("aca_debug_mode", 0200, root, adev, &aca_debug_mode_fops);
876+ debugfs_create_file("aca_ue_dump", 0400, root, adev, &aca_ue_dump_debug_fops);
877+ debugfs_create_file("aca_ce_dump", 0400, root, adev, &aca_ce_dump_debug_fops);
878+#endif
879+}
drivers/gpu/drm/amd/amdgpu/amdgpu_aca.h+202−0
@@ -0,0 +1,202 @@
1+/*
2+ * Copyright 2023 Advanced Micro Devices, Inc.
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a
5+ * copy of this software and associated documentation files (the "Software"),
6+ * to deal in the Software without restriction, including without limitation
7+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+ * and/or sell copies of the Software, and to permit persons to whom the
9+ * Software is furnished to do so, subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included in
12+ * all copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+ * OTHER DEALINGS IN THE SOFTWARE.
21+ *
22+ */
23+
24+#ifndef __AMDGPU_ACA_H__
25+#define __AMDGPU_ACA_H__
26+
27+#include <linux/list.h>
28+
29+#define ACA_MAX_REGS_COUNT (16)
30+
31+#define ACA_REG_FIELD(x, h, l) (((x) & GENMASK_ULL(h, l)) >> l)
32+#define ACA_REG__STATUS__VAL(x) ACA_REG_FIELD(x, 63, 63)
33+#define ACA_REG__STATUS__OVERFLOW(x) ACA_REG_FIELD(x, 62, 62)
34+#define ACA_REG__STATUS__UC(x) ACA_REG_FIELD(x, 61, 61)
35+#define ACA_REG__STATUS__EN(x) ACA_REG_FIELD(x, 60, 60)
36+#define ACA_REG__STATUS__MISCV(x) ACA_REG_FIELD(x, 59, 59)
37+#define ACA_REG__STATUS__ADDRV(x) ACA_REG_FIELD(x, 58, 58)
38+#define ACA_REG__STATUS__PCC(x) ACA_REG_FIELD(x, 57, 57)
39+#define ACA_REG__STATUS__ERRCOREIDVAL(x) ACA_REG_FIELD(x, 56, 56)
40+#define ACA_REG__STATUS__TCC(x) ACA_REG_FIELD(x, 55, 55)
41+#define ACA_REG__STATUS__SYNDV(x) ACA_REG_FIELD(x, 53, 53)
42+#define ACA_REG__STATUS__CECC(x) ACA_REG_FIELD(x, 46, 46)
43+#define ACA_REG__STATUS__UECC(x) ACA_REG_FIELD(x, 45, 45)
44+#define ACA_REG__STATUS__DEFERRED(x) ACA_REG_FIELD(x, 44, 44)
45+#define ACA_REG__STATUS__POISON(x) ACA_REG_FIELD(x, 43, 43)
46+#define ACA_REG__STATUS__SCRUB(x) ACA_REG_FIELD(x, 40, 40)
47+#define ACA_REG__STATUS__ERRCOREID(x) ACA_REG_FIELD(x, 37, 32)
48+#define ACA_REG__STATUS__ADDRLSB(x) ACA_REG_FIELD(x, 29, 24)
49+#define ACA_REG__STATUS__ERRORCODEEXT(x) ACA_REG_FIELD(x, 21, 16)
50+#define ACA_REG__STATUS__ERRORCODE(x) ACA_REG_FIELD(x, 15, 0)
51+
52+#define ACA_REG__IPID__MCATYPE(x) ACA_REG_FIELD(x, 63, 48)
53+#define ACA_REG__IPID__INSTANCEIDHI(x) ACA_REG_FIELD(x, 47, 44)
54+#define ACA_REG__IPID__HARDWAREID(x) ACA_REG_FIELD(x, 43, 32)
55+#define ACA_REG__IPID__INSTANCEIDLO(x) ACA_REG_FIELD(x, 31, 0)
56+
57+#define ACA_REG__MISC0__VALID(x) ACA_REG_FIELD(x, 63, 63)
58+#define ACA_REG__MISC0__OVRFLW(x) ACA_REG_FIELD(x, 48, 48)
59+#define ACA_REG__MISC0__ERRCNT(x) ACA_REG_FIELD(x, 43, 32)
60+
61+#define ACA_REG__SYND__ERRORINFORMATION(x) ACA_REG_FIELD(x, 17, 0)
62+
63+/* NOTE: The following codes refers to the smu header file */
64+#define ACA_EXTERROR_CODE_CE 0x3a
65+#define ACA_EXTERROR_CODE_FAULT 0x3b
66+
67+#define ACA_ERROR_UE_MASK BIT_MASK(ACA_ERROR_TYPE_UE)
68+#define ACA_ERROR_CE_MASK BIT_MASK(ACA_ERROR_TYPE_CE)
69+#define ACA_ERROR_DEFERRED_MASK BIT_MASK(ACA_ERROR_TYPE_DEFERRED)
70+
71+enum aca_reg_idx {
72+ ACA_REG_IDX_CTL = 0,
73+ ACA_REG_IDX_STATUS = 1,
74+ ACA_REG_IDX_ADDR = 2,
75+ ACA_REG_IDX_MISC0 = 3,
76+ ACA_REG_IDX_CONFG = 4,
77+ ACA_REG_IDX_IPID = 5,
78+ ACA_REG_IDX_SYND = 6,
79+ ACA_REG_IDX_DESTAT = 8,
80+ ACA_REG_IDX_DEADDR = 9,
81+ ACA_REG_IDX_CTL_MASK = 10,
82+ ACA_REG_IDX_COUNT = 16,
83+};
84+
85+enum aca_hwip_type {
86+ ACA_HWIP_TYPE_UNKNOW = -1,
87+ ACA_HWIP_TYPE_PSP = 0,
88+ ACA_HWIP_TYPE_UMC,
89+ ACA_HWIP_TYPE_SMU,
90+ ACA_HWIP_TYPE_PCS_XGMI,
91+ ACA_HWIP_TYPE_COUNT,
92+};
93+
94+enum aca_error_type {
95+ ACA_ERROR_TYPE_INVALID = -1,
96+ ACA_ERROR_TYPE_UE = 0,
97+ ACA_ERROR_TYPE_CE,
98+ ACA_ERROR_TYPE_DEFERRED,
99+ ACA_ERROR_TYPE_COUNT
100+};
101+
102+struct aca_bank {
103+ u64 regs[ACA_MAX_REGS_COUNT];
104+};
105+
106+struct aca_bank_node {
107+ struct aca_bank bank;
108+ struct list_head node;
109+};
110+
111+struct aca_bank_info {
112+ int die_id;
113+ int socket_id;
114+ int hwid;
115+ int mcatype;
116+};
117+
118+struct aca_bank_report {
119+ struct aca_bank_info info;
120+ u64 count[ACA_ERROR_TYPE_COUNT];
121+};
122+
123+struct aca_bank_error {
124+ struct list_head node;
125+ struct aca_bank_info info;
126+ u64 count[ACA_ERROR_TYPE_COUNT];
127+};
128+
129+struct aca_error {
130+ struct list_head list;
131+ struct mutex lock;
132+ enum aca_error_type type;
133+ int nr_errors;
134+};
135+
136+struct aca_handle_manager {
137+ struct list_head list;
138+ int nr_handles;
139+};
140+
141+struct aca_error_cache {
142+ struct aca_error errors[ACA_ERROR_TYPE_COUNT];
143+};
144+
145+struct aca_handle {
146+ struct list_head node;
147+ enum aca_hwip_type hwip;
148+ struct amdgpu_device *adev;
149+ struct aca_handle_manager *mgr;
150+ struct aca_error_cache error_cache;
151+ const struct aca_bank_ops *bank_ops;
152+ struct device_attribute aca_attr;
153+ char attr_name[64];
154+ const char *name;
155+ u32 mask;
156+ void *data;
157+};
158+
159+struct aca_bank_ops {
160+ int (*aca_bank_generate_report)(struct aca_handle *handle, struct aca_bank *bank, enum aca_error_type type,
161+ struct aca_bank_report *report, void *data);
162+ bool (*aca_bank_is_valid)(struct aca_handle *handle, struct aca_bank *bank, enum aca_error_type type,
163+ void *data);
164+};
165+
166+struct aca_smu_funcs {
167+ int max_ue_bank_count;
168+ int max_ce_bank_count;
169+ int (*set_debug_mode)(struct amdgpu_device *adev, bool enable);
170+ int (*get_valid_aca_count)(struct amdgpu_device *adev, enum aca_error_type type, u32 *count);
171+ int (*get_valid_aca_bank)(struct amdgpu_device *adev, enum aca_error_type type, int idx, struct aca_bank *bank);
172+};
173+
174+struct amdgpu_aca {
175+ struct aca_handle_manager mgr;
176+ const struct aca_smu_funcs *smu_funcs;
177+ bool is_enabled;
178+};
179+
180+struct aca_info {
181+ enum aca_hwip_type hwip;
182+ const struct aca_bank_ops *bank_ops;
183+ u32 mask;
184+};
185+
186+int amdgpu_aca_init(struct amdgpu_device *adev);
187+void amdgpu_aca_fini(struct amdgpu_device *adev);
188+int amdgpu_aca_reset(struct amdgpu_device *adev);
189+void amdgpu_aca_set_smu_funcs(struct amdgpu_device *adev, const struct aca_smu_funcs *smu_funcs);
190+bool amdgpu_aca_is_enabled(struct amdgpu_device *adev);
191+
192+int aca_bank_info_decode(struct aca_bank *bank, struct aca_bank_info *info);
193+int aca_bank_check_error_codes(struct amdgpu_device *adev, struct aca_bank *bank, int *err_codes, int size);
194+
195+int amdgpu_aca_add_handle(struct amdgpu_device *adev, struct aca_handle *handle,
196+ const char *name, const struct aca_info *aca_info, void *data);
197+void amdgpu_aca_remove_handle(struct aca_handle *handle);
198+int amdgpu_aca_get_error_data(struct amdgpu_device *adev, struct aca_handle *handle,
199+ enum aca_error_type type, void *data);
200+int amdgpu_aca_smu_set_debug_mode(struct amdgpu_device *adev, bool en);
201+void amdgpu_aca_smu_debugfs_init(struct amdgpu_device *adev, struct dentry *root);
202+#endif
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c+24−13
@@ -141,11 +141,31 @@ static void amdgpu_amdkfd_reset_work(struct work_struct *work) · 140 unmodified lines
141141 static const struct drm_client_funcs kfd_client_funcs = {
142142 .unregister = drm_client_release,
143143 };
144+
145+int amdgpu_amdkfd_drm_client_create(struct amdgpu_device *adev)
146+{
147+ int ret;
148+
149+ if (!adev->kfd.init_complete)
150+ return 0;
151+
152+ ret = drm_client_init(&adev->ddev, &adev->kfd.client, "kfd",
153+ &kfd_client_funcs);
154+ if (ret) {
155+ dev_err(adev->dev, "Failed to init DRM client: %d\n",
156+ ret);
157+ return ret;
158+ }
159+
160+ drm_client_register(&adev->kfd.client);
161+
162+ return 0;
163+}
164+
144165 void amdgpu_amdkfd_device_init(struct amdgpu_device *adev)
145166 {
146167 int i;
147168 int last_valid_bit;
148− int ret;
149169
150170 amdgpu_amdkfd_gpuvm_init_mem_limits();
151171
@@ -164,12 +184,6 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *adev) · 12 unmodified lines
164184 .enable_mes = adev->enable_mes,
165185 };
166186
167− ret = drm_client_init(&adev->ddev, &adev->kfd.client, "kfd", &kfd_client_funcs);
168− if (ret) {
169− dev_err(adev->dev, "Failed to init DRM client: %d\n", ret);
170− return;
171− }
172−
173187 /* this is going to have a few of the MSBs set that we need to
174188 * clear
175189 */
@@ -208,10 +222,6 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *adev) · 32 unmodified lines
208222
209223 adev->kfd.init_complete = kgd2kfd_device_init(adev->kfd.dev,
210224 &gpu_resources);
211− if (adev->kfd.init_complete)
212− drm_client_register(&adev->kfd.client);
213− else
214− drm_client_release(&adev->kfd.client);
215225
216226 amdgpu_amdkfd_total_mem_size += adev->gmc.real_vram_size;
217227
@@ -732,9 +742,10 @@ void amdgpu_amdkfd_debug_mem_fence(struct amdgpu_device *adev) · 514 unmodified lines
732742 amdgpu_device_flush_hdp(adev, NULL);
733743 }
734744
735−void amdgpu_amdkfd_ras_poison_consumption_handler(struct amdgpu_device *adev, bool reset)
745+void amdgpu_amdkfd_ras_poison_consumption_handler(struct amdgpu_device *adev,
746+ enum amdgpu_ras_block block, bool reset)
736747 {
737− amdgpu_umc_poison_handler(adev, reset);
748+ amdgpu_umc_poison_handler(adev, block, reset);
738749 }
739750
740751 int amdgpu_amdkfd_send_close_event_drain_irq(struct amdgpu_device *adev,
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h+14−2
@@ -182,6 +182,8 @@ int amdgpu_queue_mask_bit_to_set_resource_bit(struct amdgpu_device *adev, · 181 unmodified lines
182182 struct amdgpu_amdkfd_fence *amdgpu_amdkfd_fence_create(u64 context,
183183 struct mm_struct *mm,
184184 struct svm_range_bo *svm_bo);
185+
186+int amdgpu_amdkfd_drm_client_create(struct amdgpu_device *adev);
185187 #if defined(CONFIG_DEBUG_FS)
186188 int kfd_debugfs_kfd_mem_limits(struct seq_file *m, void *data);
187189 #endif
@@ -191,6 +193,9 @@ struct amdgpu_amdkfd_fence *to_amdgpu_amdkfd_fence(struct dma_fence *f); · 3 unmodified lines
191193 int amdgpu_amdkfd_remove_fence_on_pt_pd_bos(struct amdgpu_bo *bo);
192194 int amdgpu_amdkfd_evict_userptr(struct mmu_interval_notifier *mni,
193195 unsigned long cur_seq, struct kgd_mem *mem);
196+int amdgpu_amdkfd_bo_validate_and_fence(struct amdgpu_bo *bo,
197+ uint32_t domain,
198+ struct dma_fence *fence);
194199 #else
195200 static inline
196201 bool amdkfd_fence_check_mm(struct dma_fence *f, struct mm_struct *mm)
@@ -216,6 +221,13 @@ int amdgpu_amdkfd_evict_userptr(struct mmu_interval_notifier *mni, · 19 unmodified lines
216221 {
217222 return 0;
218223 }
224+static inline
225+int amdgpu_amdkfd_bo_validate_and_fence(struct amdgpu_bo *bo,
226+ uint32_t domain,
227+ struct dma_fence *fence)
228+{
229+ return 0;
230+}
219231 #endif
220232 /* Shared API */
221233 int amdgpu_amdkfd_alloc_gtt_mem(struct amdgpu_device *adev, size_t size,
@@ -301,7 +313,7 @@ int amdgpu_amdkfd_gpuvm_map_memory_to_gpu(struct amdgpu_device *adev, · 79 unmodified lines
301313 struct kgd_mem *mem, void *drm_priv);
302314 int amdgpu_amdkfd_gpuvm_unmap_memory_from_gpu(
303315 struct amdgpu_device *adev, struct kgd_mem *mem, void *drm_priv);
304−void amdgpu_amdkfd_gpuvm_dmaunmap_mem(struct kgd_mem *mem, void *drm_priv);
316+int amdgpu_amdkfd_gpuvm_dmaunmap_mem(struct kgd_mem *mem, void *drm_priv);
305317 int amdgpu_amdkfd_gpuvm_sync_memory(
306318 struct amdgpu_device *adev, struct kgd_mem *mem, bool intr);
307319 int amdgpu_amdkfd_gpuvm_map_gtt_bo_to_kernel(struct kgd_mem *mem,
@@ -324,7 +336,7 @@ void amdgpu_amdkfd_debug_mem_fence(struct amdgpu_device *adev); · 16 unmodified lines
324336 int amdgpu_amdkfd_get_tile_config(struct amdgpu_device *adev,
325337 struct tile_config *config);
326338 void amdgpu_amdkfd_ras_poison_consumption_handler(struct amdgpu_device *adev,
327− bool reset);
339+ enum amdgpu_ras_block block, bool reset);
328340 bool amdgpu_amdkfd_bo_mapped_to_dev(struct amdgpu_device *adev, struct kgd_mem *mem);
329341 void amdgpu_amdkfd_block_mmu_notifications(void *p);
330342 int amdgpu_amdkfd_criu_resume(void *p);
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c+1−1
@@ -290,7 +290,7 @@ static int suspend_resume_compute_scheduler(struct amdgpu_device *adev, bool sus · 289 unmodified lines
290290 for (i = 0; i < adev->gfx.num_compute_rings; i++) {
291291 struct amdgpu_ring *ring = &adev->gfx.compute_ring[i];
292292
293− if (!(ring && drm_sched_wqueue_ready(&ring->sched)))
293+ if (!amdgpu_ring_sched_ready(ring))
294294 continue;
295295
296296 /* stop secheduler and drain ring. */
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c+39−20
@@ -426,9 +426,9 @@ validate_fail: · 425 unmodified lines
426426 return ret;
427427 }
428428
429−static int amdgpu_amdkfd_bo_validate_and_fence(struct amdgpu_bo *bo,
430− uint32_t domain,
431− struct dma_fence *fence)
429+int amdgpu_amdkfd_bo_validate_and_fence(struct amdgpu_bo *bo,
430+ uint32_t domain,
431+ struct dma_fence *fence)
432432 {
433433 int ret = amdgpu_bo_reserve(bo, false);
434434
@@ -464,13 +464,15 @@ static int amdgpu_amdkfd_validate_vm_bo(void *_unused, struct amdgpu_bo *bo) · 29 unmodified lines
464464 * again. Page directories are only updated after updating page
465465 * tables.
466466 */
467−static int vm_validate_pt_pd_bos(struct amdgpu_vm *vm)
467+static int vm_validate_pt_pd_bos(struct amdgpu_vm *vm,
468+ struct ww_acquire_ctx *ticket)
468469 {
469470 struct amdgpu_bo *pd = vm->root.bo;
470471 struct amdgpu_device *adev = amdgpu_ttm_adev(pd->tbo.bdev);
471472 int ret;
472473
473− ret = amdgpu_vm_validate_pt_bos(adev, vm, amdgpu_amdkfd_validate_vm_bo, NULL);
474+ ret = amdgpu_vm_validate(adev, vm, ticket,
475+ amdgpu_amdkfd_validate_vm_bo, NULL);
474476 if (ret) {
475477 pr_err("failed to validate PT BOs\n");
476478 return ret;
@@ -1310,14 +1312,15 @@ update_gpuvm_pte_failed: · 833 unmodified lines
13101312 return ret;
13111313 }
13121314
1313−static int process_validate_vms(struct amdkfd_process_info *process_info)
1315+static int process_validate_vms(struct amdkfd_process_info *process_info,
1316+ struct ww_acquire_ctx *ticket)
13141317 {
13151318 struct amdgpu_vm *peer_vm;
13161319 int ret;
13171320
13181321 list_for_each_entry(peer_vm, &process_info->vm_list_head,
13191322 vm_list_node) {
1320− ret = vm_validate_pt_pd_bos(peer_vm);
1323+ ret = vm_validate_pt_pd_bos(peer_vm, ticket);
13211324 if (ret)
13221325 return ret;
13231326 }
@@ -1402,7 +1405,7 @@ static int init_kfd_vm(struct amdgpu_vm *vm, void **process_info, · 78 unmodified lines
14021405 ret = amdgpu_bo_reserve(vm->root.bo, true);
14031406 if (ret)
14041407 goto reserve_pd_fail;
1405− ret = vm_validate_pt_pd_bos(vm);
1408+ ret = vm_validate_pt_pd_bos(vm, NULL);
14061409 if (ret) {
14071410 pr_err("validate_pt_pd_bos() failed\n");
14081411 goto validate_pd_fail;
@@ -2043,7 +2046,7 @@ int amdgpu_amdkfd_gpuvm_map_memory_to_gpu( · 634 unmodified lines
20432046 bo->tbo.resource->mem_type == TTM_PL_SYSTEM)
20442047 is_invalid_userptr = true;
20452048
2046− ret = vm_validate_pt_pd_bos(avm);
2049+ ret = vm_validate_pt_pd_bos(avm, NULL);
20472050 if (unlikely(ret))
20482051 goto out_unreserve;
20492052
@@ -2085,21 +2088,35 @@ out: · 35 unmodified lines
20852088 return ret;
20862089 }
20872090
2088−void amdgpu_amdkfd_gpuvm_dmaunmap_mem(struct kgd_mem *mem, void *drm_priv)
2091+int amdgpu_amdkfd_gpuvm_dmaunmap_mem(struct kgd_mem *mem, void *drm_priv)
20892092 {
20902093 struct kfd_mem_attachment *entry;
20912094 struct amdgpu_vm *vm;
2095+ int ret;
20922096
20932097 vm = drm_priv_to_vm(drm_priv);
20942098
20952099 mutex_lock(&mem->lock);
20962100
2101+ ret = amdgpu_bo_reserve(mem->bo, true);
2102+ if (ret)
2103+ goto out;
2104+
20972105 list_for_each_entry(entry, &mem->attachments, list) {
2098− if (entry->bo_va->base.vm == vm)
2099− kfd_mem_dmaunmap_attachment(mem, entry);
2106+ if (entry->bo_va->base.vm != vm)
2107+ continue;
2108+ if (entry->bo_va->base.bo->tbo.ttm &&
2109+ !entry->bo_va->base.bo->tbo.ttm->sg)
2110+ continue;
2111+
2112+ kfd_mem_dmaunmap_attachment(mem, entry);
21002113 }
21012114
2115+ amdgpu_bo_unreserve(mem->bo);
2116+out:
21022117 mutex_unlock(&mem->lock);
2118+
2119+ return ret;
21032120 }
21042121
21052122 int amdgpu_amdkfd_gpuvm_unmap_memory_from_gpu(
@@ -2122,7 +2139,7 @@ int amdgpu_amdkfd_gpuvm_unmap_memory_from_gpu( · 16 unmodified lines
21222139 goto unreserve_out;
21232140 }
21242141
2125− ret = vm_validate_pt_pd_bos(avm);
2142+ ret = vm_validate_pt_pd_bos(avm, NULL);
21262143 if (unlikely(ret))
21272144 goto unreserve_out;
21282145
@@ -2620,7 +2637,7 @@ static int validate_invalid_user_pages(struct amdkfd_process_info *process_info) · 491 unmodified lines
26202637 }
26212638 }
26222639
2623− ret = process_validate_vms(process_info);
2640+ ret = process_validate_vms(process_info, NULL);
26242641 if (ret)
26252642 goto unreserve_out;
26262643
@@ -2880,11 +2897,6 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence __rcu * · 253 unmodified lines
28802897
28812898 amdgpu_sync_create(&sync_obj);
28822899
2883− /* Validate PDs and PTs */
2884− ret = process_validate_vms(process_info);
2885− if (ret)
2886− goto validate_map_fail;
2887−
28882900 /* Validate BOs and map them to GPUVM (update VM page tables). */
28892901 list_for_each_entry(mem, &process_info->kfd_bo_list,
28902902 validate_list) {
@@ -2935,6 +2947,13 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence __rcu * · 44 unmodified lines
29352947 if (failed_size)
29362948 pr_debug("0x%lx/0x%lx in system\n", failed_size, total_size);
29372949
2950+ /* Validate PDs, PTs and evicted DMABuf imports last. Otherwise BO
2951+ * validations above would invalidate DMABuf imports again.
2952+ */
2953+ ret = process_validate_vms(process_info, &exec.ticket);
2954+ if (ret)
2955+ goto validate_map_fail;
2956+
29382957 /* Update mappings not managed by KFD */
29392958 list_for_each_entry(peer_vm, &process_info->vm_list_head,
29402959 vm_list_node) {
@@ -3006,7 +3025,7 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence __rcu * · 65 unmodified lines
30063025 &process_info->eviction_fence->base,
30073026 DMA_RESV_USAGE_BOOKKEEP);
30083027 }
3009− /* Attach eviction fence to PD / PT BOs */
3028+ /* Attach eviction fence to PD / PT BOs and DMABuf imports */
30103029 list_for_each_entry(peer_vm, &process_info->vm_list_head,
30113030 vm_list_node) {
30123031 struct amdgpu_bo *bo = peer_vm->root.bo;
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c+16−8
@@ -1018,7 +1018,8 @@ int amdgpu_atombios_get_clock_dividers(struct amdgpu_device *adev, · 1017 unmodified lines
10181018 if (clock_type == COMPUTE_ENGINE_PLL_PARAM) {
10191019 args.v3.ulClockParams = cpu_to_le32((clock_type << 24) | clock);
10201020
1021− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
1021+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args,
1022+ sizeof(args));
10221023
10231024 dividers->post_div = args.v3.ucPostDiv;
10241025 dividers->enable_post_div = (args.v3.ucCntlFlag &
@@ -1038,7 +1039,8 @@ int amdgpu_atombios_get_clock_dividers(struct amdgpu_device *adev, · 13 unmodified lines
10381039 if (strobe_mode)
10391040 args.v5.ucInputFlag = ATOM_PLL_INPUT_FLAG_PLL_STROBE_MODE_EN;
10401041
1041− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
1042+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args,
1043+ sizeof(args));
10421044
10431045 dividers->post_div = args.v5.ucPostDiv;
10441046 dividers->enable_post_div = (args.v5.ucCntlFlag &
@@ -1056,7 +1058,8 @@ int amdgpu_atombios_get_clock_dividers(struct amdgpu_device *adev, · 11 unmodified lines
10561058 /* fusion */
10571059 args.v4.ulClock = cpu_to_le32(clock); /* 10 khz */
10581060
1059− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
1061+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args,
1062+ sizeof(args));
10601063
10611064 dividers->post_divider = dividers->post_div = args.v4.ucPostDiv;
10621065 dividers->real_clock = le32_to_cpu(args.v4.ulClock);
@@ -1067,7 +1070,8 @@ int amdgpu_atombios_get_clock_dividers(struct amdgpu_device *adev, · 4 unmodified lines
10671070 args.v6_in.ulClock.ulComputeClockFlag = clock_type;
10681071 args.v6_in.ulClock.ulClockFreq = cpu_to_le32(clock); /* 10 khz */
10691072
1070− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
1073+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args,
1074+ sizeof(args));
10711075
10721076 dividers->whole_fb_div = le16_to_cpu(args.v6_out.ulFbDiv.usFbDiv);
10731077 dividers->frac_fb_div = le16_to_cpu(args.v6_out.ulFbDiv.usFbDivFrac);
@@ -1109,7 +1113,8 @@ int amdgpu_atombios_get_memory_pll_dividers(struct amdgpu_device *adev, · 35 unmodified lines
11091113 if (strobe_mode)
11101114 args.ucInputFlag |= MPLL_INPUT_FLAG_STROBE_MODE_EN;
11111115
1112− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
1116+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args,
1117+ sizeof(args));
11131118
11141119 mpll_param->clkfrac = le16_to_cpu(args.ulFbDiv.usFbDivFrac);
11151120 mpll_param->clkf = le16_to_cpu(args.ulFbDiv.usFbDiv);
@@ -1151,7 +1156,8 @@ void amdgpu_atombios_set_engine_dram_timings(struct amdgpu_device *adev, · 35 unmodified lines
11511156 if (mem_clock)
11521157 args.sReserved.ulClock = cpu_to_le32(mem_clock & SET_CLOCK_FREQ_MASK);
11531158
1154− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
1159+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args,
1160+ sizeof(args));
11551161 }
11561162
11571163 void amdgpu_atombios_get_default_voltages(struct amdgpu_device *adev,
@@ -1205,7 +1211,8 @@ int amdgpu_atombios_get_max_vddc(struct amdgpu_device *adev, u8 voltage_type, · 47 unmodified lines
12051211 args.v2.ucVoltageMode = 0;
12061212 args.v2.usVoltageLevel = 0;
12071213
1208− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
1214+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args,
1215+ sizeof(args));
12091216
12101217 *voltage = le16_to_cpu(args.v2.usVoltageLevel);
12111218 break;
@@ -1214,7 +1221,8 @@ int amdgpu_atombios_get_max_vddc(struct amdgpu_device *adev, u8 voltage_type, · 2 unmodified lines
12141221 args.v3.ucVoltageMode = ATOM_GET_VOLTAGE_LEVEL;
12151222 args.v3.usVoltageLevel = cpu_to_le16(voltage_id);
12161223
1217− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
1224+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args,
1225+ sizeof(args));
12181226
12191227 *voltage = le16_to_cpu(args.v3.usVoltageLevel);
12201228 break;
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c+2−1
@@ -941,5 +941,6 @@ int amdgpu_atomfirmware_asic_init(struct amdgpu_device *adev, bool fb_reset) · 940 unmodified lines
941941 return -EINVAL;
942942 }
943943
944− return amdgpu_atom_execute_table(ctx, ATOM_CMD_INIT, (uint32_t *)&asic_init_ps_v2_1);
944+ return amdgpu_atom_execute_table(ctx, ATOM_CMD_INIT, (uint32_t *)&asic_init_ps_v2_1,
945+ sizeof(asic_init_ps_v2_1));
945946 }
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h+1−1
@@ -36,7 +36,7 @@ int amdgpu_atomfirmware_get_clock_info(struct amdgpu_device *adev); · 35 unmodified lines
3636 int amdgpu_atomfirmware_get_gfx_info(struct amdgpu_device *adev);
3737 bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev);
3838 bool amdgpu_atomfirmware_sram_ecc_supported(struct amdgpu_device *adev);
39−bool amdgpu_atomfirmware_ras_rom_addr(struct amdgpu_device *adev, uint8_t* i2c_address);
39+bool amdgpu_atomfirmware_ras_rom_addr(struct amdgpu_device *adev, uint8_t *i2c_address);
4040 bool amdgpu_atomfirmware_mem_training_supported(struct amdgpu_device *adev);
4141 bool amdgpu_atomfirmware_dynamic_boot_config_supported(struct amdgpu_device *adev);
4242 int amdgpu_atomfirmware_get_fw_reserved_fb_size(struct amdgpu_device *adev);
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c+3−3
@@ -952,10 +952,10 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p, · 951 unmodified lines
952952 p->bytes_moved = 0;
953953 p->bytes_moved_vis = 0;
954954
955− r = amdgpu_vm_validate_pt_bos(p->adev, &fpriv->vm,
956− amdgpu_cs_bo_validate, p);
955+ r = amdgpu_vm_validate(p->adev, &fpriv->vm, NULL,
956+ amdgpu_cs_bo_validate, p);
957957 if (r) {
958− DRM_ERROR("amdgpu_vm_validate_pt_bos() failed.\n");
958+ DRM_ERROR("amdgpu_vm_validate() failed.\n");
959959 goto out_free_user_pages;
960960 }
961961
drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c+1−1
@@ -30,7 +30,7 @@ uint64_t amdgpu_csa_vaddr(struct amdgpu_device *adev) · 29 unmodified lines
3030 {
3131 uint64_t addr = adev->vm_manager.max_pfn << AMDGPU_GPU_PAGE_SHIFT;
3232
33− addr -= AMDGPU_VA_RESERVED_SIZE;
33+ addr -= AMDGPU_VA_RESERVED_CSA_SIZE;
3434 addr = amdgpu_gmc_sign_extend(addr);
3535
3636 return addr;
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c+4−4
@@ -1678,7 +1678,7 @@ static int amdgpu_debugfs_test_ib_show(struct seq_file *m, void *unused) · 1677 unmodified lines
16781678 for (i = 0; i < AMDGPU_MAX_RINGS; i++) {
16791679 struct amdgpu_ring *ring = adev->rings[i];
16801680
1681− if (!ring || !drm_sched_wqueue_ready(&ring->sched))
1681+ if (!amdgpu_ring_sched_ready(ring))
16821682 continue;
16831683 drm_sched_wqueue_stop(&ring->sched);
16841684 }
@@ -1694,7 +1694,7 @@ static int amdgpu_debugfs_test_ib_show(struct seq_file *m, void *unused) · 9 unmodified lines
16941694 for (i = 0; i < AMDGPU_MAX_RINGS; i++) {
16951695 struct amdgpu_ring *ring = adev->rings[i];
16961696
1697− if (!ring || !drm_sched_wqueue_ready(&ring->sched))
1697+ if (!amdgpu_ring_sched_ready(ring))
16981698 continue;
16991699 drm_sched_wqueue_start(&ring->sched);
17001700 }
@@ -1916,8 +1916,8 @@ static int amdgpu_debugfs_ib_preempt(void *data, u64 val) · 215 unmodified lines
19161916
19171917 ring = adev->rings[val];
19181918
1919− if (!ring || !ring->funcs->preempt_ib ||
1920− !drm_sched_wqueue_ready(&ring->sched))
1919+ if (!amdgpu_ring_sched_ready(ring) ||
1920+ !ring->funcs->preempt_ib)
19211921 return -EINVAL;
19221922
19231923 /* the last preemption failed */
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+50−30
@@ -96,6 +96,9 @@ MODULE_FIRMWARE("amdgpu/navi12_gpu_info.bin"); · 95 unmodified lines
9696 #define AMDGPU_RESUME_MS 2000
9797 #define AMDGPU_MAX_RETRY_LIMIT 2
9898 #define AMDGPU_RETRY_SRIOV_RESET(r) ((r) == -EBUSY || (r) == -ETIMEDOUT || (r) == -EINVAL)
99+#define AMDGPU_PCIE_INDEX_FALLBACK (0x38 >> 2)
100+#define AMDGPU_PCIE_INDEX_HI_FALLBACK (0x44 >> 2)
101+#define AMDGPU_PCIE_DATA_FALLBACK (0x3C >> 2)
99102
100103 static const struct drm_driver amdgpu_kms_driver;
101104
@@ -781,12 +784,22 @@ u32 amdgpu_device_indirect_rreg_ext(struct amdgpu_device *adev, · 679 unmodified lines
781784 void __iomem *pcie_index_hi_offset;
782785 void __iomem *pcie_data_offset;
783786
784− pcie_index = adev->nbio.funcs->get_pcie_index_offset(adev);
785− pcie_data = adev->nbio.funcs->get_pcie_data_offset(adev);
786− if ((reg_addr >> 32) && (adev->nbio.funcs->get_pcie_index_hi_offset))
787− pcie_index_hi = adev->nbio.funcs->get_pcie_index_hi_offset(adev);
788− else
787+ if (unlikely(!adev->nbio.funcs)) {
788+ pcie_index = AMDGPU_PCIE_INDEX_FALLBACK;
789+ pcie_data = AMDGPU_PCIE_DATA_FALLBACK;
790+ } else {
791+ pcie_index = adev->nbio.funcs->get_pcie_index_offset(adev);
792+ pcie_data = adev->nbio.funcs->get_pcie_data_offset(adev);
793+ }
794+
795+ if (reg_addr >> 32) {
796+ if (unlikely(!adev->nbio.funcs))
797+ pcie_index_hi = AMDGPU_PCIE_INDEX_HI_FALLBACK;
798+ else
799+ pcie_index_hi = adev->nbio.funcs->get_pcie_index_hi_offset(adev);
800+ } else {
789801 pcie_index_hi = 0;
802+ }
790803
791804 spin_lock_irqsave(&adev->pcie_idx_lock, flags);
792805 pcie_index_offset = (void __iomem *)adev->rmmio + pcie_index * 4;
@@ -1218,8 +1231,6 @@ static int amdgpu_device_asic_init(struct amdgpu_device *adev) · 425 unmodified lines
12181231 amdgpu_ip_version(adev, GC_HWIP, 0) >= IP_VERSION(11, 0, 0)) {
12191232 amdgpu_psp_wait_for_bootloader(adev);
12201233 ret = amdgpu_atomfirmware_asic_init(adev, true);
1221− /* TODO: check the return val and stop device initialization if boot fails */
1222− amdgpu_psp_query_boot_status(adev);
12231234 return ret;
12241235 } else {
12251236 return amdgpu_atom_asic_init(adev->mode_info.atom_context);
@@ -1442,6 +1453,10 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev) · 216 unmodified lines
14421453 if (amdgpu_sriov_vf(adev))
14431454 return 0;
14441455
1456+ /* PCI_EXT_CAP_ID_VNDR extended capability is located at 0x100 */
1457+ if (!pci_find_ext_capability(adev->pdev, PCI_EXT_CAP_ID_VNDR))
1458+ DRM_WARN("System can't access extended configuration space,please check!!\n");
1459+
14451460 /* skip if the bios has already enabled large BAR */
14461461 if (adev->gmc.real_vram_size &&
14471462 (pci_resource_len(adev->pdev, 0) >= adev->gmc.real_vram_size))
@@ -4121,23 +4136,13 @@ int amdgpu_device_init(struct amdgpu_device *adev, · 2673 unmodified lines
41214136 }
41224137 }
41234138 } else {
4124− switch (amdgpu_ip_version(adev, MP1_HWIP, 0)) {
4125− case IP_VERSION(13, 0, 0):
4126− case IP_VERSION(13, 0, 7):
4127− case IP_VERSION(13, 0, 10):
4128− r = psp_gpu_reset(adev);
4129− break;
4130− default:
4131− tmp = amdgpu_reset_method;
4132− /* It should do a default reset when loading or reloading the driver,
4133− * regardless of the module parameter reset_method.
4134− */
4135− amdgpu_reset_method = AMD_RESET_METHOD_NONE;
4136− r = amdgpu_asic_reset(adev);
4137− amdgpu_reset_method = tmp;
4138− break;
4139− }
4140−
4139+ tmp = amdgpu_reset_method;
4140+ /* It should do a default reset when loading or reloading the driver,
4141+ * regardless of the module parameter reset_method.
4142+ */
4143+ amdgpu_reset_method = AMD_RESET_METHOD_NONE;
4144+ r = amdgpu_asic_reset(adev);
4145+ amdgpu_reset_method = tmp;
41414146 if (r) {
41424147 dev_err(adev->dev, "asic reset on init failed\n");
41434148 goto failed;
@@ -5031,7 +5036,7 @@ bool amdgpu_device_has_job_running(struct amdgpu_device *adev) · 887 unmodified lines
50315036 for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
50325037 struct amdgpu_ring *ring = adev->rings[i];
50335038
5034− if (!ring || !drm_sched_wqueue_ready(&ring->sched))
5039+ if (!amdgpu_ring_sched_ready(ring))
50355040 continue;
50365041
50375042 spin_lock(&ring->sched.job_list_lock);
@@ -5170,7 +5175,7 @@ int amdgpu_device_pre_asic_reset(struct amdgpu_device *adev, · 132 unmodified lines
51705175 for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
51715176 struct amdgpu_ring *ring = adev->rings[i];
51725177
5173− if (!ring || !drm_sched_wqueue_ready(&ring->sched))
5178+ if (!amdgpu_ring_sched_ready(ring))
51745179 continue;
51755180
51765181 /* Clear job fence from fence drv to avoid force_completion
@@ -5637,7 +5642,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev, · 460 unmodified lines
56375642 for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
56385643 struct amdgpu_ring *ring = tmp_adev->rings[i];
56395644
5640− if (!ring || !drm_sched_wqueue_ready(&ring->sched))
5645+ if (!amdgpu_ring_sched_ready(ring))
56415646 continue;
56425647
56435648 drm_sched_stop(&ring->sched, job ? &job->base : NULL);
@@ -5690,6 +5695,7 @@ retry: /* Rest of adevs pre asic reset from XGMI hive. */ · 46 unmodified lines
56905695 /* Aldebaran and gfx_11_0_3 support ras in SRIOV, so need resume ras during reset */
56915696 if (amdgpu_ip_version(adev, GC_HWIP, 0) ==
56925697 IP_VERSION(9, 4, 2) ||
5698+ amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 3) ||
56935699 amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(11, 0, 3))
56945700 amdgpu_ras_resume(adev);
56955701 } else {
@@ -5706,7 +5712,7 @@ skip_hw_reset: · 10 unmodified lines
57065712 for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
57075713 struct amdgpu_ring *ring = tmp_adev->rings[i];
57085714
5709− if (!ring || !drm_sched_wqueue_ready(&ring->sched))
5715+ if (!amdgpu_ring_sched_ready(ring))
57105716 continue;
57115717
57125718 drm_sched_start(&ring->sched, true);
@@ -6061,7 +6067,7 @@ pci_ers_result_t amdgpu_pci_error_detected(struct pci_dev *pdev, pci_channel_sta · 348 unmodified lines
60616067 for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
60626068 struct amdgpu_ring *ring = adev->rings[i];
60636069
6064− if (!ring || !drm_sched_wqueue_ready(&ring->sched))
6070+ if (!amdgpu_ring_sched_ready(ring))
60656071 continue;
60666072
60676073 drm_sched_stop(&ring->sched, NULL);
@@ -6111,6 +6117,20 @@ pci_ers_result_t amdgpu_pci_slot_reset(struct pci_dev *pdev) · 43 unmodified lines
61116117 struct amdgpu_reset_context reset_context;
61126118 u32 memsize;
61136119 struct list_head device_list;
6120+ struct amdgpu_hive_info *hive;
6121+ int hive_ras_recovery = 0;
6122+ struct amdgpu_ras *ras;
6123+
6124+ /* PCI error slot reset should be skipped During RAS recovery */
6125+ hive = amdgpu_get_xgmi_hive(adev);
6126+ if (hive) {
6127+ hive_ras_recovery = atomic_read(&hive->ras_recovery);
6128+ amdgpu_put_xgmi_hive(hive);
6129+ }
6130+ ras = amdgpu_ras_get_context(adev);
6131+ if ((amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 3)) &&
6132+ ras && (atomic_read(&ras->in_recovery) || hive_ras_recovery))
6133+ return PCI_ERS_RESULT_RECOVERED;
61146134
61156135 DRM_INFO("PCI error: slot reset callback!!\n");
61166136
@@ -6189,7 +6209,7 @@ void amdgpu_pci_resume(struct pci_dev *pdev) · 72 unmodified lines
61896209 for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
61906210 struct amdgpu_ring *ring = adev->rings[i];
61916211
6192− if (!ring || !drm_sched_wqueue_ready(&ring->sched))
6212+ if (!amdgpu_ring_sched_ready(ring))
61936213 continue;
61946214
61956215 drm_sched_start(&ring->sched, true);
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c+8−4
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 #include "amdgpu_discovery.h"
2828 #include "soc15_hw_ip.h"
2929 #include "discovery.h"
30+#include "amdgpu_ras.h"
3031
3132 #include "soc15.h"
3233 #include "gfx_v9_0.h"
@@ -98,6 +99,7 @@ · 65 unmodified lines
9899 #define FIRMWARE_IP_DISCOVERY "amdgpu/ip_discovery.bin"
99100 MODULE_FIRMWARE(FIRMWARE_IP_DISCOVERY);
100101
102+#define mmIP_DISCOVERY_VERSION 0x16A00
101103 #define mmRCC_CONFIG_MEMSIZE 0xde3
102104 #define mmMP0_SMN_C2PMSG_33 0x16061
103105 #define mmMM_INDEX 0x0
@@ -518,7 +520,9 @@ static int amdgpu_discovery_init(struct amdgpu_device *adev) · 414 unmodified lines
518520 out:
519521 kfree(adev->mman.discovery_bin);
520522 adev->mman.discovery_bin = NULL;
521−
523+ if ((amdgpu_discovery != 2) &&
524+ (RREG32(mmIP_DISCOVERY_VERSION) == 4))
525+ amdgpu_ras_query_boot_status(adev, 4);
522526 return r;
523527 }
524528
@@ -1278,11 +1282,10 @@ static int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev) · 753 unmodified lines
12781282 * 0b10 : encode is disabled
12791283 * 0b01 : decode is disabled
12801284 */
1281− adev->vcn.vcn_config[adev->vcn.num_vcn_inst] =
1282− ip->revision & 0xc0;
1283− ip->revision &= ~0xc0;
12841285 if (adev->vcn.num_vcn_inst <
12851286 AMDGPU_MAX_VCN_INSTANCES) {
1287+ adev->vcn.vcn_config[adev->vcn.num_vcn_inst] =
1288+ ip->revision & 0xc0;
12861289 adev->vcn.num_vcn_inst++;
12871290 adev->vcn.inst_mask |=
12881291 (1U << ip->instance_number);
@@ -1293,6 +1296,7 @@ static int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev) · 4 unmodified lines
12931296 adev->vcn.num_vcn_inst + 1,
12941297 AMDGPU_MAX_VCN_INSTANCES);
12951298 }
1299+ ip->revision &= ~0xc0;
12961300 }
12971301 if (le16_to_cpu(ip->hw_id) == SDMA0_HWID ||
12981302 le16_to_cpu(ip->hw_id) == SDMA1_HWID ||
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c+4−0
@@ -377,6 +377,10 @@ amdgpu_dma_buf_move_notify(struct dma_buf_attachment *attach) · 376 unmodified lines
377377 struct amdgpu_vm_bo_base *bo_base;
378378 int r;
379379
380+ /* FIXME: This should be after the "if", but needs a fix to make sure
381+ * DMABuf imports are initialized in the right VM list.
382+ */
383+ amdgpu_vm_bo_invalidate(adev, bo, false);
380384 if (!bo->tbo.resource || bo->tbo.resource->mem_type == TTM_PL_SYSTEM)
381385 return;
382386
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c+9−3
@@ -366,7 +366,7 @@ module_param_named(aspm, amdgpu_aspm, int, 0444); · 365 unmodified lines
366366 * Setting the value to 0 disables this functionality.
367367 * Setting the value to -2 is auto enabled with power down when displays are attached.
368368 */
369−MODULE_PARM_DESC(runpm, "PX runtime pm (2 = force enable with BAMACO, 1 = force enable with BACO, 0 = disable, -1 = auto, -2 = autowith displays)");
369+MODULE_PARM_DESC(runpm, "PX runtime pm (2 = force enable with BAMACO, 1 = force enable with BACO, 0 = disable, -1 = auto, -2 = auto with displays)");
370370 module_param_named(runpm, amdgpu_runtime_pm, int, 0444);
371371
372372 /**
@@ -593,7 +593,7 @@ module_param_named(timeout_period, amdgpu_watchdog_timer.period, uint, 0644); · 220 unmodified lines
593593 #ifdef CONFIG_DRM_AMDGPU_SI
594594
595595 #if IS_ENABLED(CONFIG_DRM_RADEON) || IS_ENABLED(CONFIG_DRM_RADEON_MODULE)
596−int amdgpu_si_support = 0;
596+int amdgpu_si_support;
597597 MODULE_PARM_DESC(si_support, "SI support (1 = enabled, 0 = disabled (default))");
598598 #else
599599 int amdgpu_si_support = 1;
@@ -612,7 +612,7 @@ module_param_named(si_support, amdgpu_si_support, int, 0444); · 12 unmodified lines
612612 #ifdef CONFIG_DRM_AMDGPU_CIK
613613
614614 #if IS_ENABLED(CONFIG_DRM_RADEON) || IS_ENABLED(CONFIG_DRM_RADEON_MODULE)
615−int amdgpu_cik_support = 0;
615+int amdgpu_cik_support;
616616 MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled, 0 = disabled (default))");
617617 #else
618618 int amdgpu_cik_support = 1;
@@ -2255,6 +2255,10 @@ retry_init: · 1636 unmodified lines
22552255 if (ret)
22562256 goto err_pci;
22572257
2258+ ret = amdgpu_amdkfd_drm_client_create(adev);
2259+ if (ret)
2260+ goto err_pci;
2261+
22582262 /*
22592263 * 1. don't init fbdev on hw without DCE
22602264 * 2. don't init fbdev if there are no connectors
@@ -2472,6 +2476,7 @@ static int amdgpu_pmops_suspend(struct device *dev) · 211 unmodified lines
24722476 struct drm_device *drm_dev = dev_get_drvdata(dev);
24732477 struct amdgpu_device *adev = drm_to_adev(drm_dev);
24742478
2479+ adev->suspend_complete = false;
24752480 if (amdgpu_acpi_is_s0ix_active(adev))
24762481 adev->in_s0ix = true;
24772482 else if (amdgpu_acpi_is_s3_active(adev))
@@ -2486,6 +2491,7 @@ static int amdgpu_pmops_suspend_noirq(struct device *dev) · 8 unmodified lines
24862491 struct drm_device *drm_dev = dev_get_drvdata(dev);
24872492 struct amdgpu_device *adev = drm_to_adev(drm_dev);
24882493
2494+ adev->suspend_complete = true;
24892495 if (amdgpu_acpi_should_gpu_reset(adev))
24902496 return amdgpu_asic_reset(adev);
24912497
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c+8−0
@@ -121,6 +121,7 @@ int amdgpu_gart_table_ram_alloc(struct amdgpu_device *adev) · 120 unmodified lines
121121 struct amdgpu_bo_param bp;
122122 dma_addr_t dma_addr;
123123 struct page *p;
124+ unsigned long x;
124125 int ret;
125126
126127 if (adev->gart.bo != NULL)
@@ -130,6 +131,10 @@ int amdgpu_gart_table_ram_alloc(struct amdgpu_device *adev) · 3 unmodified lines
130131 if (!p)
131132 return -ENOMEM;
132133
134+ /* assign pages to this device */
135+ for (x = 0; x < (1UL << order); x++)
136+ p[x].mapping = adev->mman.bdev.dev_mapping;
137+
133138 /* If the hardware does not support UTCL2 snooping of the CPU caches
134139 * then set_memory_wc() could be used as a workaround to mark the pages
135140 * as write combine memory.
@@ -223,6 +228,7 @@ void amdgpu_gart_table_ram_free(struct amdgpu_device *adev) · 87 unmodified lines
223228 unsigned int order = get_order(adev->gart.table_size);
224229 struct sg_table *sg = adev->gart.bo->tbo.sg;
225230 struct page *p;
231+ unsigned long x;
226232 int ret;
227233
228234 ret = amdgpu_bo_reserve(adev->gart.bo, false);
@@ -234,6 +240,8 @@ void amdgpu_gart_table_ram_free(struct amdgpu_device *adev) · 5 unmodified lines
234240 sg_free_table(sg);
235241 kfree(sg);
236242 p = virt_to_page(adev->gart.ptr);
243+ for (x = 0; x < (1UL << order); x++)
244+ p[x].mapping = NULL;
237245 __free_pages(p, order);
238246
239247 adev->gart.ptr = NULL;
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c+31−4
@@ -187,7 +187,34 @@ static int amdgpu_gem_object_open(struct drm_gem_object *obj, · 186 unmodified lines
187187 else
188188 ++bo_va->ref_count;
189189 amdgpu_bo_unreserve(abo);
190− return 0;
190+
191+ /* Validate and add eviction fence to DMABuf imports with dynamic
192+ * attachment in compute VMs. Re-validation will be done by
193+ * amdgpu_vm_validate. Fences are on the reservation shared with the
194+ * export, which is currently required to be validated and fenced
195+ * already by amdgpu_amdkfd_gpuvm_restore_process_bos.
196+ *
197+ * Nested locking below for the case that a GEM object is opened in
198+ * kfd_mem_export_dmabuf. Since the lock below is only taken for imports,
199+ * but not for export, this is a different lock class that cannot lead to
200+ * circular lock dependencies.
201+ */
202+ if (!vm->is_compute_context || !vm->process_info)
203+ return 0;
204+ if (!obj->import_attach ||
205+ !dma_buf_is_dynamic(obj->import_attach->dmabuf))
206+ return 0;
207+ mutex_lock_nested(&vm->process_info->lock, 1);
208+ if (!WARN_ON(!vm->process_info->eviction_fence)) {
209+ r = amdgpu_amdkfd_bo_validate_and_fence(abo, AMDGPU_GEM_DOMAIN_GTT,
210+ &vm->process_info->eviction_fence->base);
211+ if (r)
212+ dev_warn(adev->dev, "%d: validate_and_fence failed: %d\n",
213+ vm->task_info.pid, r);
214+ }
215+ mutex_unlock(&vm->process_info->lock);
216+
217+ return r;
191218 }
192219
193220 static void amdgpu_gem_object_close(struct drm_gem_object *obj,
@@ -682,10 +709,10 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data, · 488 unmodified lines
682709 uint64_t vm_size;
683710 int r = 0;
684711
685− if (args->va_address < AMDGPU_VA_RESERVED_SIZE) {
712+ if (args->va_address < AMDGPU_VA_RESERVED_BOTTOM) {
686713 dev_dbg(dev->dev,
687714 "va_address 0x%llx is in reserved area 0x%llx\n",
688− args->va_address, AMDGPU_VA_RESERVED_SIZE);
715+ args->va_address, AMDGPU_VA_RESERVED_BOTTOM);
689716 return -EINVAL;
690717 }
691718
@@ -701,7 +728,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data, · 9 unmodified lines
701728 args->va_address &= AMDGPU_GMC_HOLE_MASK;
702729
703730 vm_size = adev->vm_manager.max_pfn * AMDGPU_GPU_PAGE_SIZE;
704− vm_size -= AMDGPU_VA_RESERVED_SIZE;
731+ vm_size -= AMDGPU_VA_RESERVED_TOP;
705732 if (args->va_address + args->map_size > vm_size) {
706733 dev_dbg(dev->dev,
707734 "va_address 0x%llx is in top reserved area 0x%llx\n",
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c+4−3
@@ -329,7 +329,8 @@ int amdgpu_gfx_kiq_init_ring(struct amdgpu_device *adev, · 328 unmodified lines
329329
330330 ring->eop_gpu_addr = kiq->eop_gpu_addr;
331331 ring->no_scheduler = true;
332− sprintf(ring->name, "kiq_%d.%d.%d.%d", xcc_id, ring->me, ring->pipe, ring->queue);
332+ snprintf(ring->name, sizeof(ring->name), "kiq_%d.%d.%d.%d",
333+ xcc_id, ring->me, ring->pipe, ring->queue);
333334 r = amdgpu_ring_init(adev, ring, 1024, irq, AMDGPU_CP_KIQ_IRQ_DRIVER0,
334335 AMDGPU_RING_PRIO_DEFAULT, NULL);
335336 if (r)
@@ -642,8 +643,8 @@ int amdgpu_gfx_enable_kcq(struct amdgpu_device *adev, int xcc_id) · 306 unmodified lines
642643 kiq->pmf->kiq_set_resources(kiq_ring, queue_mask);
643644 for (i = 0; i < adev->gfx.num_compute_rings; i++) {
644645 j = i + xcc_id * adev->gfx.num_compute_rings;
645− kiq->pmf->kiq_map_queues(kiq_ring,
646− &adev->gfx.compute_ring[j]);
646+ kiq->pmf->kiq_map_queues(kiq_ring,
647+ &adev->gfx.compute_ring[j]);
647648 }
648649
649650 r = amdgpu_ring_test_helper(kiq_ring);
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c+54−1
@@ -52,7 +52,7 @@ int amdgpu_gmc_pdb0_alloc(struct amdgpu_device *adev) · 51 unmodified lines
5252 struct amdgpu_bo_param bp;
5353 u64 vram_size = adev->gmc.xgmi.node_segment_size * adev->gmc.xgmi.num_physical_nodes;
5454 uint32_t pde0_page_shift = adev->gmc.vmid0_page_table_block_size + 21;
55− uint32_t npdes = (vram_size + (1ULL << pde0_page_shift) -1) >> pde0_page_shift;
55+ uint32_t npdes = (vram_size + (1ULL << pde0_page_shift) - 1) >> pde0_page_shift;
5656
5757 memset(&bp, 0, sizeof(bp));
5858 bp.size = PAGE_ALIGN((npdes + 1) * 8);
@@ -746,6 +746,59 @@ error_unlock_reset: · 687 unmodified lines
746746 return r;
747747 }
748748
749+void amdgpu_gmc_fw_reg_write_reg_wait(struct amdgpu_device *adev,
750+ uint32_t reg0, uint32_t reg1,
751+ uint32_t ref, uint32_t mask,
752+ uint32_t xcc_inst)
753+{
754+ struct amdgpu_kiq *kiq = &adev->gfx.kiq[xcc_inst];
755+ struct amdgpu_ring *ring = &kiq->ring;
756+ signed long r, cnt = 0;
757+ unsigned long flags;
758+ uint32_t seq;
759+
760+ if (adev->mes.ring.sched.ready) {
761+ amdgpu_mes_reg_write_reg_wait(adev, reg0, reg1,
762+ ref, mask);
763+ return;
764+ }
765+
766+ spin_lock_irqsave(&kiq->ring_lock, flags);
767+ amdgpu_ring_alloc(ring, 32);
768+ amdgpu_ring_emit_reg_write_reg_wait(ring, reg0, reg1,
769+ ref, mask);
770+ r = amdgpu_fence_emit_polling(ring, &seq, MAX_KIQ_REG_WAIT);
771+ if (r)
772+ goto failed_undo;
773+
774+ amdgpu_ring_commit(ring);
775+ spin_unlock_irqrestore(&kiq->ring_lock, flags);
776+
777+ r = amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT);
778+
779+ /* don't wait anymore for IRQ context */
780+ if (r < 1 && in_interrupt())
781+ goto failed_kiq;
782+
783+ might_sleep();
784+ while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) {
785+
786+ msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);
787+ r = amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT);
788+ }
789+
790+ if (cnt > MAX_KIQ_REG_TRY)
791+ goto failed_kiq;
792+
793+ return;
794+
795+failed_undo:
796+ amdgpu_ring_undo(ring);
797+ spin_unlock_irqrestore(&kiq->ring_lock, flags);
798+failed_kiq:
799+ dev_err(adev->dev, "failed to write reg %x wait reg %x\n", reg0, reg1);
800+}
801+
749802 /**
750803 * amdgpu_gmc_tmz_set -- check and set if a device supports TMZ
751804 * @adev: amdgpu_device pointer
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h+4−0
@@ -417,6 +417,10 @@ void amdgpu_gmc_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid, · 416 unmodified lines
417417 int amdgpu_gmc_flush_gpu_tlb_pasid(struct amdgpu_device *adev, uint16_t pasid,
418418 uint32_t flush_type, bool all_hub,
419419 uint32_t inst);
420+void amdgpu_gmc_fw_reg_write_reg_wait(struct amdgpu_device *adev,
421+ uint32_t reg0, uint32_t reg1,
422+ uint32_t ref, uint32_t mask,
423+ uint32_t xcc_inst);
420424
421425 extern void amdgpu_gmc_tmz_set(struct amdgpu_device *adev);
422426 extern void amdgpu_gmc_noretry_set(struct amdgpu_device *adev);
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c+3−4
@@ -62,9 +62,8 @@ int amdgpu_pasid_alloc(unsigned int bits) · 61 unmodified lines
6262 int pasid = -EINVAL;
6363
6464 for (bits = min(bits, 31U); bits > 0; bits--) {
65− pasid = ida_simple_get(&amdgpu_pasid_ida,
66− 1U << (bits - 1), 1U << bits,
67− GFP_KERNEL);
65+ pasid = ida_alloc_range(&amdgpu_pasid_ida, 1U << (bits - 1),
66+ (1U << bits) - 1, GFP_KERNEL);
6867 if (pasid != -ENOSPC)
6968 break;
7069 }
@@ -82,7 +81,7 @@ int amdgpu_pasid_alloc(unsigned int bits) · 11 unmodified lines
8281 void amdgpu_pasid_free(u32 pasid)
8382 {
8483 trace_amdgpu_pasid_freed(pasid);
85− ida_simple_remove(&amdgpu_pasid_ida, pasid);
84+ ida_free(&amdgpu_pasid_ida, pasid);
8685 }
8786
8887 static void amdgpu_pasid_free_cb(struct dma_fence *fence,
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c+15−2
@@ -894,14 +894,14 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) · 893 unmodified lines
894894 dev_info->ids_flags |= AMDGPU_IDS_FLAGS_CONFORMANT_TRUNC_COORD;
895895
896896 vm_size = adev->vm_manager.max_pfn * AMDGPU_GPU_PAGE_SIZE;
897− vm_size -= AMDGPU_VA_RESERVED_SIZE;
897+ vm_size -= AMDGPU_VA_RESERVED_TOP;
898898
899899 /* Older VCE FW versions are buggy and can handle only 40bits */
900900 if (adev->vce.fw_version &&
901901 adev->vce.fw_version < AMDGPU_VCE_FW_53_45)
902902 vm_size = min(vm_size, 1ULL << 40);
903903
904− dev_info->virtual_address_offset = AMDGPU_VA_RESERVED_SIZE;
904+ dev_info->virtual_address_offset = AMDGPU_VA_RESERVED_BOTTOM;
905905 dev_info->virtual_address_max =
906906 min(vm_size, AMDGPU_GMC_HOLE_START);
907907
@@ -1114,6 +1114,15 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) · 206 unmodified lines
11141114 }
11151115 ui32 >>= 8;
11161116 break;
1117+ case AMDGPU_INFO_SENSOR_GPU_INPUT_POWER:
1118+ /* get input GPU power */
1119+ if (amdgpu_dpm_read_sensor(adev,
1120+ AMDGPU_PP_SENSOR_GPU_INPUT_POWER,
1121+ (void *)&ui32, &ui32_size)) {
1122+ return -EINVAL;
1123+ }
1124+ ui32 >>= 8;
1125+ break;
11171126 case AMDGPU_INFO_SENSOR_VDDNB:
11181127 /* get VDDNB in millivolts */
11191128 if (amdgpu_dpm_read_sensor(adev,
@@ -1370,6 +1379,10 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) · 250 unmodified lines
13701379 goto error_vm;
13711380 }
13721381
1382+ r = amdgpu_seq64_map(adev, &fpriv->vm, &fpriv->seq64_va);
1383+ if (r)
1384+ goto error_vm;
1385+
13731386 mutex_init(&fpriv->bo_list_lock);
13741387 idr_init_base(&fpriv->bo_list_handles, 1);
13751388
drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c+24−9
@@ -27,6 +27,16 @@ · 26 unmodified lines
2727 #include "umc/umc_6_7_0_offset.h"
2828 #include "umc/umc_6_7_0_sh_mask.h"
2929
30+static bool amdgpu_mca_is_deferred_error(struct amdgpu_device *adev,
31+ uint64_t mc_status)
32+{
33+ if (adev->umc.ras->check_ecc_err_status)
34+ return adev->umc.ras->check_ecc_err_status(adev,
35+ AMDGPU_MCA_ERROR_TYPE_DE, &mc_status);
36+
37+ return false;
38+}
39+
3040 void amdgpu_mca_query_correctable_error_count(struct amdgpu_device *adev,
3141 uint64_t mc_status_addr,
3242 unsigned long *error_count)
@@ -202,16 +212,16 @@ int amdgpu_mca_smu_set_debug_mode(struct amdgpu_device *adev, bool enable) · 169 unmodified lines
202212
203213 static void amdgpu_mca_smu_mca_bank_dump(struct amdgpu_device *adev, int idx, struct mca_bank_entry *entry)
204214 {
205− dev_info(adev->dev, "[Hardware error] Accelerator Check Architecture events logged\n");
206− dev_info(adev->dev, "[Hardware error] aca entry[%02d].STATUS=0x%016llx\n",
215+ dev_info(adev->dev, HW_ERR "Accelerator Check Architecture events logged\n");
216+ dev_info(adev->dev, HW_ERR "aca entry[%02d].STATUS=0x%016llx\n",
207217 idx, entry->regs[MCA_REG_IDX_STATUS]);
208− dev_info(adev->dev, "[Hardware error] aca entry[%02d].ADDR=0x%016llx\n",
218+ dev_info(adev->dev, HW_ERR "aca entry[%02d].ADDR=0x%016llx\n",
209219 idx, entry->regs[MCA_REG_IDX_ADDR]);
210− dev_info(adev->dev, "[Hardware error] aca entry[%02d].MISC0=0x%016llx\n",
220+ dev_info(adev->dev, HW_ERR "aca entry[%02d].MISC0=0x%016llx\n",
211221 idx, entry->regs[MCA_REG_IDX_MISC0]);
212− dev_info(adev->dev, "[Hardware error] aca entry[%02d].IPID=0x%016llx\n",
222+ dev_info(adev->dev, HW_ERR "aca entry[%02d].IPID=0x%016llx\n",
213223 idx, entry->regs[MCA_REG_IDX_IPID]);
214− dev_info(adev->dev, "[Hardware error] aca entry[%02d].SYND=0x%016llx\n",
224+ dev_info(adev->dev, HW_ERR "aca entry[%02d].SYND=0x%016llx\n",
215225 idx, entry->regs[MCA_REG_IDX_SYND]);
216226 }
217227
@@ -256,9 +266,14 @@ int amdgpu_mca_smu_log_ras_error(struct amdgpu_device *adev, enum amdgpu_ras_blo · 38 unmodified lines
256266 if (type == AMDGPU_MCA_ERROR_TYPE_UE)
257267 amdgpu_ras_error_statistic_ue_count(err_data,
258268 &mcm_info, &err_addr, (uint64_t)count);
259− else
260− amdgpu_ras_error_statistic_ce_count(err_data,
261− &mcm_info, &err_addr, (uint64_t)count);
269+ else {
270+ if (amdgpu_mca_is_deferred_error(adev, entry->regs[MCA_REG_IDX_STATUS]))
271+ amdgpu_ras_error_statistic_de_count(err_data,
272+ &mcm_info, &err_addr, (uint64_t)count);
273+ else
274+ amdgpu_ras_error_statistic_ce_count(err_data,
275+ &mcm_info, &err_addr, (uint64_t)count);
276+ }
262277 }
263278
264279 out_mca_release:
drivers/gpu/drm/amd/amdgpu/amdgpu_mca.h+1−0
@@ -65,6 +65,7 @@ enum amdgpu_mca_ip { · 64 unmodified lines
6565 enum amdgpu_mca_error_type {
6666 AMDGPU_MCA_ERROR_TYPE_UE = 0,
6767 AMDGPU_MCA_ERROR_TYPE_CE,
68+ AMDGPU_MCA_ERROR_TYPE_DE,
6869 };
6970
7071 struct amdgpu_mca_ras_block {
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c+4−4
@@ -1398,7 +1398,7 @@ int amdgpu_mes_self_test(struct amdgpu_device *adev) · 1397 unmodified lines
13981398 goto error_fini;
13991399 }
14001400
1401− ctx_data.meta_data_gpu_addr = AMDGPU_VA_RESERVED_SIZE;
1401+ ctx_data.meta_data_gpu_addr = AMDGPU_VA_RESERVED_BOTTOM;
14021402 r = amdgpu_mes_ctx_map_meta_data(adev, vm, &ctx_data);
14031403 if (r) {
14041404 DRM_ERROR("failed to map ctx meta data\n");
@@ -1565,9 +1565,9 @@ void amdgpu_debugfs_mes_event_log_init(struct amdgpu_device *adev) · 160 unmodified lines
15651565 #if defined(CONFIG_DEBUG_FS)
15661566 struct drm_minor *minor = adev_to_drm(adev)->primary;
15671567 struct dentry *root = minor->debugfs_root;
1568−
1569− debugfs_create_file("amdgpu_mes_event_log", 0444, root,
1570− adev, &amdgpu_debugfs_mes_event_log_fops);
1568+ if (adev->enable_mes)
1569+ debugfs_create_file("amdgpu_mes_event_log", 0444, root,
1570+ adev, &amdgpu_debugfs_mes_event_log_fops);
15711571
15721572 #endif
15731573 }
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c+1−5
@@ -220,9 +220,6 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain) · 219 unmodified lines
220220
221221 placement->num_placement = c;
222222 placement->placement = places;
223−
224− placement->num_busy_placement = c;
225− placement->busy_placement = places;
226223 }
227224
228225 /**
@@ -1397,8 +1394,7 @@ vm_fault_t amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo) · 1168 unmodified lines
13971394 AMDGPU_GEM_DOMAIN_GTT);
13981395
13991396 /* Avoid costly evictions; only set GTT as a busy placement */
1400− abo->placement.num_busy_placement = 1;
1401− abo->placement.busy_placement = &abo->placements[1];
1397+ abo->placements[0].flags |= TTM_PL_FLAG_DESIRED;
14021398
14031399 r = ttm_bo_validate(bo, &abo->placement, &ctx);
14041400 if (unlikely(r == -EBUSY || r == -ERESTARTSYS))
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c+106−80
@@ -291,21 +291,22 @@ static int psp_memory_training_init(struct psp_context *psp) · 290 unmodified lines
291291 struct psp_memory_training_context *ctx = &psp->mem_train_ctx;
292292
293293 if (ctx->init != PSP_MEM_TRAIN_RESERVE_SUCCESS) {
294− DRM_DEBUG("memory training is not supported!\n");
294+ dev_dbg(psp->adev->dev, "memory training is not supported!\n");
295295 return 0;
296296 }
297297
298298 ctx->sys_cache = kzalloc(ctx->train_data_size, GFP_KERNEL);
299299 if (ctx->sys_cache == NULL) {
300− DRM_ERROR("alloc mem_train_ctx.sys_cache failed!\n");
300+ dev_err(psp->adev->dev, "alloc mem_train_ctx.sys_cache failed!\n");
301301 ret = -ENOMEM;
302302 goto Err_out;
303303 }
304304
305− DRM_DEBUG("train_data_size:%llx,p2c_train_data_offset:%llx,c2p_train_data_offset:%llx.\n",
306− ctx->train_data_size,
307− ctx->p2c_train_data_offset,
308− ctx->c2p_train_data_offset);
305+ dev_dbg(psp->adev->dev,
306+ "train_data_size:%llx,p2c_train_data_offset:%llx,c2p_train_data_offset:%llx.\n",
307+ ctx->train_data_size,
308+ ctx->p2c_train_data_offset,
309+ ctx->c2p_train_data_offset);
309310 ctx->init = PSP_MEM_TRAIN_INIT_SUCCESS;
310311 return 0;
311312
@@ -407,7 +408,7 @@ static int psp_sw_init(void *handle) · 95 unmodified lines
407408
408409 psp->cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);
409410 if (!psp->cmd) {
410− DRM_ERROR("Failed to allocate memory to command buffer!\n");
411+ dev_err(adev->dev, "Failed to allocate memory to command buffer!\n");
411412 ret = -ENOMEM;
412413 }
413414
@@ -454,13 +455,13 @@ static int psp_sw_init(void *handle) · 40 unmodified lines
454455 if (mem_training_ctx->enable_mem_training) {
455456 ret = psp_memory_training_init(psp);
456457 if (ret) {
457− DRM_ERROR("Failed to initialize memory training!\n");
458+ dev_err(adev->dev, "Failed to initialize memory training!\n");
458459 return ret;
459460 }
460461
461462 ret = psp_mem_training(psp, PSP_MEM_TRAIN_COLD_BOOT);
462463 if (ret) {
463− DRM_ERROR("Failed to process memory training!\n");
464+ dev_err(adev->dev, "Failed to process memory training!\n");
464465 return ret;
465466 }
466467 }
@@ -675,9 +676,11 @@ psp_cmd_submit_buf(struct psp_context *psp, · 208 unmodified lines
675676 */
676677 if (!skip_unsupport && (psp->cmd_buf_mem->resp.status || !timeout) && !ras_intr) {
677678 if (ucode)
678− DRM_WARN("failed to load ucode %s(0x%X) ",
679− amdgpu_ucode_name(ucode->ucode_id), ucode->ucode_id);
680− DRM_WARN("psp gfx command %s(0x%X) failed and response status is (0x%X)\n",
679+ dev_warn(psp->adev->dev,
680+ "failed to load ucode %s(0x%X) ",
681+ amdgpu_ucode_name(ucode->ucode_id), ucode->ucode_id);
682+ dev_warn(psp->adev->dev,
683+ "psp gfx command %s(0x%X) failed and response status is (0x%X)\n",
681684 psp_gfx_cmd_name(psp->cmd_buf_mem->cmd_id), psp->cmd_buf_mem->cmd_id,
682685 psp->cmd_buf_mem->resp.status);
683686 /* If any firmware (including CAP) load fails under SRIOV, it should
@@ -807,7 +810,7 @@ static int psp_tmr_init(struct psp_context *psp) · 123 unmodified lines
807810 psp->fw_pri_buf) {
808811 ret = psp_load_toc(psp, &tmr_size);
809812 if (ret) {
810− DRM_ERROR("Failed to load toc\n");
813+ dev_err(psp->adev->dev, "Failed to load toc\n");
811814 return ret;
812815 }
813816 }
@@ -855,7 +858,7 @@ static int psp_tmr_load(struct psp_context *psp) · 41 unmodified lines
855858
856859 psp_prep_tmr_cmd_buf(psp, cmd, psp->tmr_mc_addr, psp->tmr_bo);
857860 if (psp->tmr_bo)
858− DRM_INFO("reserve 0x%lx from 0x%llx for PSP TMR\n",
861+ dev_info(psp->adev->dev, "reserve 0x%lx from 0x%llx for PSP TMR\n",
859862 amdgpu_bo_size(psp->tmr_bo), psp->tmr_mc_addr);
860863
861864 ret = psp_cmd_submit_buf(psp, NULL, cmd,
@@ -1113,7 +1116,7 @@ int psp_reg_program(struct psp_context *psp, enum psp_reg_prog_id reg, · 251 unmodified lines
11131116 psp_prep_reg_prog_cmd_buf(cmd, reg, value);
11141117 ret = psp_cmd_submit_buf(psp, NULL, cmd, psp->fence_buf_mc_addr);
11151118 if (ret)
1116− DRM_ERROR("PSP failed to program reg id %d", reg);
1119+ dev_err(psp->adev->dev, "PSP failed to program reg id %d\n", reg);
11171120
11181121 release_psp_cmd_buf(psp);
11191122
@@ -1526,22 +1529,22 @@ static void psp_ras_ta_check_status(struct psp_context *psp) · 406 unmodified lines
15261529 switch (ras_cmd->ras_status) {
15271530 case TA_RAS_STATUS__ERROR_UNSUPPORTED_IP:
15281531 dev_warn(psp->adev->dev,
1529− "RAS WARNING: cmd failed due to unsupported ip\n");
1532+ "RAS WARNING: cmd failed due to unsupported ip\n");
15301533 break;
15311534 case TA_RAS_STATUS__ERROR_UNSUPPORTED_ERROR_INJ:
15321535 dev_warn(psp->adev->dev,
1533− "RAS WARNING: cmd failed due to unsupported error injection\n");
1536+ "RAS WARNING: cmd failed due to unsupported error injection\n");
15341537 break;
15351538 case TA_RAS_STATUS__SUCCESS:
15361539 break;
15371540 case TA_RAS_STATUS__TEE_ERROR_ACCESS_DENIED:
15381541 if (ras_cmd->cmd_id == TA_RAS_COMMAND__TRIGGER_ERROR)
15391542 dev_warn(psp->adev->dev,
1540− "RAS WARNING: Inject error to critical region is not allowed\n");
1543+ "RAS WARNING: Inject error to critical region is not allowed\n");
15411544 break;
15421545 default:
15431546 dev_warn(psp->adev->dev,
1544− "RAS WARNING: ras status = 0x%X\n", ras_cmd->ras_status);
1547+ "RAS WARNING: ras status = 0x%X\n", ras_cmd->ras_status);
15451548 break;
15461549 }
15471550 }
@@ -1565,7 +1568,7 @@ int psp_ras_invoke(struct psp_context *psp, uint32_t ta_cmd_id) · 17 unmodified lines
15651568 return ret;
15661569
15671570 if (ras_cmd->if_version > RAS_TA_HOST_IF_VER) {
1568− DRM_WARN("RAS: Unsupported Interface");
1571+ dev_warn(psp->adev->dev, "RAS: Unsupported Interface\n");
15691572 return -EINVAL;
15701573 }
15711574
@@ -1715,7 +1718,7 @@ int psp_ras_initialize(struct psp_context *psp) · 143 unmodified lines
17151718 psp->ras_context.context.initialized = true;
17161719 else {
17171720 if (ras_cmd->ras_status)
1718− dev_warn(psp->adev->dev, "RAS Init Status: 0x%X\n", ras_cmd->ras_status);
1721+ dev_warn(adev->dev, "RAS Init Status: 0x%X\n", ras_cmd->ras_status);
17191722
17201723 /* fail to load RAS TA */
17211724 psp->ras_context.context.initialized = false;
@@ -1779,6 +1782,31 @@ int psp_ras_trigger_error(struct psp_context *psp, · 57 unmodified lines
17791782
17801783 return 0;
17811784 }
1785+
1786+int psp_ras_query_address(struct psp_context *psp,
1787+ struct ta_ras_query_address_input *addr_in,
1788+ struct ta_ras_query_address_output *addr_out)
1789+{
1790+ struct ta_ras_shared_memory *ras_cmd;
1791+ int ret;
1792+
1793+ if (!psp->ras_context.context.initialized)
1794+ return -EINVAL;
1795+
1796+ ras_cmd = (struct ta_ras_shared_memory *)psp->ras_context.context.mem_context.shared_buf;
1797+ memset(ras_cmd, 0, sizeof(struct ta_ras_shared_memory));
1798+
1799+ ras_cmd->cmd_id = TA_RAS_COMMAND__QUERY_ADDRESS;
1800+ ras_cmd->ras_in_message.address = *addr_in;
1801+
1802+ ret = psp_ras_invoke(psp, ras_cmd->cmd_id);
1803+ if (ret || ras_cmd->ras_status || psp->cmd_buf_mem->resp.status)
1804+ return -EINVAL;
1805+
1806+ *addr_out = ras_cmd->ras_out_message.address;
1807+
1808+ return 0;
1809+}
17821810 // ras end
17831811
17841812 // HDCP start
@@ -2125,19 +2153,14 @@ int amdgpu_psp_wait_for_bootloader(struct amdgpu_device *adev) · 340 unmodified lines
21252153 return ret;
21262154 }
21272155
2128−int amdgpu_psp_query_boot_status(struct amdgpu_device *adev)
2156+bool amdgpu_psp_get_ras_capability(struct psp_context *psp)
21292157 {
2130− struct psp_context *psp = &adev->psp;
2131− int ret = 0;
2132−
2133− if (amdgpu_sriov_vf(adev) || (adev->flags & AMD_IS_APU))
2134− return 0;
2135−
21362158 if (psp->funcs &&
2137− psp->funcs->query_boot_status)
2138− ret = psp->funcs->query_boot_status(psp);
2139−
2140− return ret;
2159+ psp->funcs->get_ras_capability) {
2160+ return psp->funcs->get_ras_capability(psp);
2161+ } else {
2162+ return false;
2163+ }
21412164 }
21422165
21432166 static int psp_hw_start(struct psp_context *psp)
@@ -2150,7 +2173,7 @@ static int psp_hw_start(struct psp_context *psp) · 6 unmodified lines
21502173 (psp->funcs->bootloader_load_kdb != NULL)) {
21512174 ret = psp_bootloader_load_kdb(psp);
21522175 if (ret) {
2153− DRM_ERROR("PSP load kdb failed!\n");
2176+ dev_err(adev->dev, "PSP load kdb failed!\n");
21542177 return ret;
21552178 }
21562179 }
@@ -2159,7 +2182,7 @@ static int psp_hw_start(struct psp_context *psp) · 2 unmodified lines
21592182 (psp->funcs->bootloader_load_spl != NULL)) {
21602183 ret = psp_bootloader_load_spl(psp);
21612184 if (ret) {
2162− DRM_ERROR("PSP load spl failed!\n");
2185+ dev_err(adev->dev, "PSP load spl failed!\n");
21632186 return ret;
21642187 }
21652188 }
@@ -2168,7 +2191,7 @@ static int psp_hw_start(struct psp_context *psp) · 2 unmodified lines
21682191 (psp->funcs->bootloader_load_sysdrv != NULL)) {
21692192 ret = psp_bootloader_load_sysdrv(psp);
21702193 if (ret) {
2171− DRM_ERROR("PSP load sys drv failed!\n");
2194+ dev_err(adev->dev, "PSP load sys drv failed!\n");
21722195 return ret;
21732196 }
21742197 }
@@ -2177,7 +2200,7 @@ static int psp_hw_start(struct psp_context *psp) · 2 unmodified lines
21772200 (psp->funcs->bootloader_load_soc_drv != NULL)) {
21782201 ret = psp_bootloader_load_soc_drv(psp);
21792202 if (ret) {
2180− DRM_ERROR("PSP load soc drv failed!\n");
2203+ dev_err(adev->dev, "PSP load soc drv failed!\n");
21812204 return ret;
21822205 }
21832206 }
@@ -2186,7 +2209,7 @@ static int psp_hw_start(struct psp_context *psp) · 2 unmodified lines
21862209 (psp->funcs->bootloader_load_intf_drv != NULL)) {
21872210 ret = psp_bootloader_load_intf_drv(psp);
21882211 if (ret) {
2189− DRM_ERROR("PSP load intf drv failed!\n");
2212+ dev_err(adev->dev, "PSP load intf drv failed!\n");
21902213 return ret;
21912214 }
21922215 }
@@ -2195,7 +2218,7 @@ static int psp_hw_start(struct psp_context *psp) · 2 unmodified lines
21952218 (psp->funcs->bootloader_load_dbg_drv != NULL)) {
21962219 ret = psp_bootloader_load_dbg_drv(psp);
21972220 if (ret) {
2198− DRM_ERROR("PSP load dbg drv failed!\n");
2221+ dev_err(adev->dev, "PSP load dbg drv failed!\n");
21992222 return ret;
22002223 }
22012224 }
@@ -2204,7 +2227,7 @@ static int psp_hw_start(struct psp_context *psp) · 2 unmodified lines
22042227 (psp->funcs->bootloader_load_ras_drv != NULL)) {
22052228 ret = psp_bootloader_load_ras_drv(psp);
22062229 if (ret) {
2207− DRM_ERROR("PSP load ras_drv failed!\n");
2230+ dev_err(adev->dev, "PSP load ras_drv failed!\n");
22082231 return ret;
22092232 }
22102233 }
@@ -2213,7 +2236,7 @@ static int psp_hw_start(struct psp_context *psp) · 2 unmodified lines
22132236 (psp->funcs->bootloader_load_sos != NULL)) {
22142237 ret = psp_bootloader_load_sos(psp);
22152238 if (ret) {
2216− DRM_ERROR("PSP load sos failed!\n");
2239+ dev_err(adev->dev, "PSP load sos failed!\n");
22172240 return ret;
22182241 }
22192242 }
@@ -2221,7 +2244,7 @@ static int psp_hw_start(struct psp_context *psp) · 1 unmodified line
22212244
22222245 ret = psp_ring_create(psp, PSP_RING_TYPE__KM);
22232246 if (ret) {
2224− DRM_ERROR("PSP create ring failed!\n");
2247+ dev_err(adev->dev, "PSP create ring failed!\n");
22252248 return ret;
22262249 }
22272250
@@ -2231,7 +2254,7 @@ static int psp_hw_start(struct psp_context *psp) · 3 unmodified lines
22312254 if (!psp_boottime_tmr(psp)) {
22322255 ret = psp_tmr_init(psp);
22332256 if (ret) {
2234− DRM_ERROR("PSP tmr init failed!\n");
2257+ dev_err(adev->dev, "PSP tmr init failed!\n");
22352258 return ret;
22362259 }
22372260 }
@@ -2250,7 +2273,7 @@ skip_pin_bo: · 12 unmodified lines
22502273
22512274 ret = psp_tmr_load(psp);
22522275 if (ret) {
2253− DRM_ERROR("PSP load tmr failed!\n");
2276+ dev_err(adev->dev, "PSP load tmr failed!\n");
22542277 return ret;
22552278 }
22562279
@@ -2518,7 +2541,8 @@ static void psp_print_fw_hdr(struct psp_context *psp, · 261 unmodified lines
25182541 }
25192542 }
25202543
2521−static int psp_prep_load_ip_fw_cmd_buf(struct amdgpu_firmware_info *ucode,
2544+static int psp_prep_load_ip_fw_cmd_buf(struct psp_context *psp,
2545+ struct amdgpu_firmware_info *ucode,
25222546 struct psp_gfx_cmd_resp *cmd)
25232547 {
25242548 int ret;
@@ -2531,7 +2555,7 @@ static int psp_prep_load_ip_fw_cmd_buf(struct amdgpu_firmware_info *ucode, · 6 unmodified lines
25312555
25322556 ret = psp_get_fw_type(ucode, &cmd->cmd.cmd_load_ip_fw.fw_type);
25332557 if (ret)
2534− DRM_ERROR("Unknown firmware type\n");
2558+ dev_err(psp->adev->dev, "Unknown firmware type\n");
25352559
25362560 return ret;
25372561 }
@@ -2542,7 +2566,7 @@ int psp_execute_ip_fw_load(struct psp_context *psp, · 4 unmodified lines
25422566 int ret = 0;
25432567 struct psp_gfx_cmd_resp *cmd = acquire_psp_cmd_buf(psp);
25442568
2545− ret = psp_prep_load_ip_fw_cmd_buf(ucode, cmd);
2569+ ret = psp_prep_load_ip_fw_cmd_buf(psp, ucode, cmd);
25462570 if (!ret) {
25472571 ret = psp_cmd_submit_buf(psp, ucode, cmd,
25482572 psp->fence_buf_mc_addr);
@@ -2601,13 +2625,13 @@ static int psp_load_smu_fw(struct psp_context *psp) · 52 unmodified lines
26012625 amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(11, 0, 2)))) {
26022626 ret = amdgpu_dpm_set_mp1_state(adev, PP_MP1_STATE_UNLOAD);
26032627 if (ret)
2604− DRM_WARN("Failed to set MP1 state prepare for reload\n");
2628+ dev_err(adev->dev, "Failed to set MP1 state prepare for reload\n");
26052629 }
26062630
26072631 ret = psp_execute_ip_fw_load(psp, ucode);
26082632
26092633 if (ret)
2610− DRM_ERROR("PSP load smu failed!\n");
2634+ dev_err(adev->dev, "PSP load smu failed!\n");
26112635
26122636 return ret;
26132637 }
@@ -2712,7 +2736,7 @@ static int psp_load_non_psp_fw(struct psp_context *psp) · 98 unmodified lines
27122736 adev->virt.autoload_ucode_id : AMDGPU_UCODE_ID_RLC_G)) {
27132737 ret = psp_rlc_autoload_start(psp);
27142738 if (ret) {
2715− DRM_ERROR("Failed to start rlc autoload\n");
2739+ dev_err(adev->dev, "Failed to start rlc autoload\n");
27162740 return ret;
27172741 }
27182742 }
@@ -2734,7 +2758,7 @@ static int psp_load_fw(struct amdgpu_device *adev) · 15 unmodified lines
27342758
27352759 ret = psp_ring_init(psp, PSP_RING_TYPE__KM);
27362760 if (ret) {
2737− DRM_ERROR("PSP ring init failed!\n");
2761+ dev_err(adev->dev, "PSP ring init failed!\n");
27382762 goto failed;
27392763 }
27402764 }
@@ -2749,13 +2773,13 @@ static int psp_load_fw(struct amdgpu_device *adev) · 8 unmodified lines
27492773
27502774 ret = psp_asd_initialize(psp);
27512775 if (ret) {
2752− DRM_ERROR("PSP load asd failed!\n");
2776+ dev_err(adev->dev, "PSP load asd failed!\n");
27532777 goto failed1;
27542778 }
27552779
27562780 ret = psp_rl_load(adev);
27572781 if (ret) {
2758− DRM_ERROR("PSP load RL failed!\n");
2782+ dev_err(adev->dev, "PSP load RL failed!\n");
27592783 goto failed1;
27602784 }
27612785
@@ -2775,7 +2799,7 @@ static int psp_load_fw(struct amdgpu_device *adev) · 13 unmodified lines
27752799 ret = psp_ras_initialize(psp);
27762800 if (ret)
27772801 dev_err(psp->adev->dev,
2778− "RAS: Failed to initialize RAS\n");
2802+ "RAS: Failed to initialize RAS\n");
27792803
27802804 ret = psp_hdcp_initialize(psp);
27812805 if (ret)
@@ -2828,7 +2852,7 @@ static int psp_hw_init(void *handle) · 46 unmodified lines
28282852
28292853 ret = psp_load_fw(adev);
28302854 if (ret) {
2831− DRM_ERROR("PSP firmware loading failed\n");
2855+ dev_err(adev->dev, "PSP firmware loading failed\n");
28322856 goto failed;
28332857 }
28342858
@@ -2875,7 +2899,7 @@ static int psp_suspend(void *handle) · 40 unmodified lines
28752899 psp->xgmi_context.context.initialized) {
28762900 ret = psp_xgmi_terminate(psp);
28772901 if (ret) {
2878− DRM_ERROR("Failed to terminate xgmi ta\n");
2902+ dev_err(adev->dev, "Failed to terminate xgmi ta\n");
28792903 goto out;
28802904 }
28812905 }
@@ -2883,46 +2907,46 @@ static int psp_suspend(void *handle) · 1 unmodified line
28832907 if (psp->ta_fw) {
28842908 ret = psp_ras_terminate(psp);
28852909 if (ret) {
2886− DRM_ERROR("Failed to terminate ras ta\n");
2910+ dev_err(adev->dev, "Failed to terminate ras ta\n");
28872911 goto out;
28882912 }
28892913 ret = psp_hdcp_terminate(psp);
28902914 if (ret) {
2891− DRM_ERROR("Failed to terminate hdcp ta\n");
2915+ dev_err(adev->dev, "Failed to terminate hdcp ta\n");
28922916 goto out;
28932917 }
28942918 ret = psp_dtm_terminate(psp);
28952919 if (ret) {
2896− DRM_ERROR("Failed to terminate dtm ta\n");
2920+ dev_err(adev->dev, "Failed to terminate dtm ta\n");
28972921 goto out;
28982922 }
28992923 ret = psp_rap_terminate(psp);
29002924 if (ret) {
2901− DRM_ERROR("Failed to terminate rap ta\n");
2925+ dev_err(adev->dev, "Failed to terminate rap ta\n");
29022926 goto out;
29032927 }
29042928 ret = psp_securedisplay_terminate(psp);
29052929 if (ret) {
2906− DRM_ERROR("Failed to terminate securedisplay ta\n");
2930+ dev_err(adev->dev, "Failed to terminate securedisplay ta\n");
29072931 goto out;
29082932 }
29092933 }
29102934
29112935 ret = psp_asd_terminate(psp);
29122936 if (ret) {
2913− DRM_ERROR("Failed to terminate asd\n");
2937+ dev_err(adev->dev, "Failed to terminate asd\n");
29142938 goto out;
29152939 }
29162940
29172941 ret = psp_tmr_terminate(psp);
29182942 if (ret) {
2919− DRM_ERROR("Failed to terminate tmr\n");
2943+ dev_err(adev->dev, "Failed to terminate tmr\n");
29202944 goto out;
29212945 }
29222946
29232947 ret = psp_ring_stop(psp, PSP_RING_TYPE__KM);
29242948 if (ret)
2925− DRM_ERROR("PSP ring stop failed\n");
2949+ dev_err(adev->dev, "PSP ring stop failed\n");
29262950
29272951 out:
29282952 return ret;
@@ -2934,12 +2958,12 @@ static int psp_resume(void *handle) · 5 unmodified lines
29342958 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
29352959 struct psp_context *psp = &adev->psp;
29362960
2937− DRM_INFO("PSP is resuming...\n");
2961+ dev_info(adev->dev, "PSP is resuming...\n");
29382962
29392963 if (psp->mem_train_ctx.enable_mem_training) {
29402964 ret = psp_mem_training(psp, PSP_MEM_TRAIN_RESUME);
29412965 if (ret) {
2942− DRM_ERROR("Failed to process memory training!\n");
2966+ dev_err(adev->dev, "Failed to process memory training!\n");
29432967 return ret;
29442968 }
29452969 }
@@ -2956,7 +2980,7 @@ static int psp_resume(void *handle) · 10 unmodified lines
29562980
29572981 ret = psp_asd_initialize(psp);
29582982 if (ret) {
2959− DRM_ERROR("PSP load asd failed!\n");
2983+ dev_err(adev->dev, "PSP load asd failed!\n");
29602984 goto failed;
29612985 }
29622986
@@ -2980,7 +3004,7 @@ static int psp_resume(void *handle) · 17 unmodified lines
29803004 ret = psp_ras_initialize(psp);
29813005 if (ret)
29823006 dev_err(psp->adev->dev,
2983− "RAS: Failed to initialize RAS\n");
3007+ "RAS: Failed to initialize RAS\n");
29843008
29853009 ret = psp_hdcp_initialize(psp);
29863010 if (ret)
@@ -3008,7 +3032,7 @@ static int psp_resume(void *handle) · 21 unmodified lines
30083032 return 0;
30093033
30103034 failed:
3011− DRM_ERROR("PSP resume failed\n");
3035+ dev_err(adev->dev, "PSP resume failed\n");
30123036 mutex_unlock(&adev->firmware.mutex);
30133037 return ret;
30143038 }
@@ -3069,9 +3093,11 @@ int psp_ring_cmd_submit(struct psp_context *psp, · 54 unmodified lines
30693093 write_frame = ring_buffer_start + (psp_write_ptr_reg / rb_frame_size_dw);
30703094 /* Check invalid write_frame ptr address */
30713095 if ((write_frame < ring_buffer_start) || (ring_buffer_end < write_frame)) {
3072− DRM_ERROR("ring_buffer_start = %p; ring_buffer_end = %p; write_frame = %p\n",
3073− ring_buffer_start, ring_buffer_end, write_frame);
3074− DRM_ERROR("write_frame is pointing to address out of bounds\n");
3096+ dev_err(adev->dev,
3097+ "ring_buffer_start = %p; ring_buffer_end = %p; write_frame = %p\n",
3098+ ring_buffer_start, ring_buffer_end, write_frame);
3099+ dev_err(adev->dev,
3100+ "write_frame is pointing to address out of bounds\n");
30753101 return -EINVAL;
30763102 }
30773103
@@ -3597,7 +3623,7 @@ static ssize_t psp_usbc_pd_fw_sysfs_read(struct device *dev, · 519 unmodified lines
35973623 int ret;
35983624
35993625 if (!adev->ip_blocks[AMD_IP_BLOCK_TYPE_PSP].status.late_initialized) {
3600− DRM_INFO("PSP block is not ready yet.");
3626+ dev_info(adev->dev, "PSP block is not ready yet\n.");
36013627 return -EBUSY;
36023628 }
36033629
@@ -3606,7 +3632,7 @@ static ssize_t psp_usbc_pd_fw_sysfs_read(struct device *dev, · 2 unmodified lines
36063632 mutex_unlock(&adev->psp.mutex);
36073633
36083634 if (ret) {
3609− DRM_ERROR("Failed to read USBC PD FW, err = %d", ret);
3635+ dev_err(adev->dev, "Failed to read USBC PD FW, err = %d\n", ret);
36103636 return ret;
36113637 }
36123638
@@ -3628,7 +3654,7 @@ static ssize_t psp_usbc_pd_fw_sysfs_write(struct device *dev, · 15 unmodified lines
36283654 void *fw_pri_cpu_addr;
36293655
36303656 if (!adev->ip_blocks[AMD_IP_BLOCK_TYPE_PSP].status.late_initialized) {
3631− DRM_INFO("PSP block is not ready yet.");
3657+ dev_err(adev->dev, "PSP block is not ready yet.");
36323658 return -EBUSY;
36333659 }
36343660
@@ -3661,7 +3687,7 @@ rel_buf: · 26 unmodified lines
36613687 release_firmware(usbc_pd_fw);
36623688 fail:
36633689 if (ret) {
3664− DRM_ERROR("Failed to load USBC PD FW, err = %d", ret);
3690+ dev_err(adev->dev, "Failed to load USBC PD FW, err = %d", ret);
36653691 count = ret;
36663692 }
36673693
@@ -3708,7 +3734,7 @@ static ssize_t amdgpu_psp_vbflash_write(struct file *filp, struct kobject *kobj, · 40 unmodified lines
37083734
37093735 /* Safeguard against memory drain */
37103736 if (adev->psp.vbflash_image_size > AMD_VBIOS_FILE_MAX_SIZE_B) {
3711− dev_err(adev->dev, "File size cannot exceed %u", AMD_VBIOS_FILE_MAX_SIZE_B);
3737+ dev_err(adev->dev, "File size cannot exceed %u\n", AMD_VBIOS_FILE_MAX_SIZE_B);
37123738 kvfree(adev->psp.vbflash_tmp_buf);
37133739 adev->psp.vbflash_tmp_buf = NULL;
37143740 adev->psp.vbflash_image_size = 0;
@@ -3727,7 +3753,7 @@ static ssize_t amdgpu_psp_vbflash_write(struct file *filp, struct kobject *kobj, · 12 unmodified lines
37273753 adev->psp.vbflash_image_size += count;
37283754 mutex_unlock(&adev->psp.mutex);
37293755
3730− dev_dbg(adev->dev, "IFWI staged for update");
3756+ dev_dbg(adev->dev, "IFWI staged for update\n");
37313757
37323758 return count;
37333759 }
@@ -3747,7 +3773,7 @@ static ssize_t amdgpu_psp_vbflash_read(struct file *filp, struct kobject *kobj, · 13 unmodified lines
37473773 if (adev->psp.vbflash_image_size == 0)
37483774 return -EINVAL;
37493775
3750− dev_dbg(adev->dev, "PSP IFWI flash process initiated");
3776+ dev_dbg(adev->dev, "PSP IFWI flash process initiated\n");
37513777
37523778 ret = amdgpu_bo_create_kernel(adev, adev->psp.vbflash_image_size,
37533779 AMDGPU_GPU_PAGE_SIZE,
@@ -3772,11 +3798,11 @@ rel_buf: · 18 unmodified lines
37723798 adev->psp.vbflash_image_size = 0;
37733799
37743800 if (ret) {
3775− dev_err(adev->dev, "Failed to load IFWI, err = %d", ret);
3801+ dev_err(adev->dev, "Failed to load IFWI, err = %d\n", ret);
37763802 return ret;
37773803 }
37783804
3779− dev_dbg(adev->dev, "PSP IFWI flash process done");
3805+ dev_dbg(adev->dev, "PSP IFWI flash process done\n");
37803806 return 0;
37813807 }
37823808
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h+5−4
@@ -134,7 +134,7 @@ struct psp_funcs { · 133 unmodified lines
134134 int (*update_spirom)(struct psp_context *psp, uint64_t fw_pri_mc_addr);
135135 int (*vbflash_stat)(struct psp_context *psp);
136136 int (*fatal_error_recovery_quirk)(struct psp_context *psp);
137− int (*query_boot_status)(struct psp_context *psp);
137+ bool (*get_ras_capability)(struct psp_context *psp);
138138 };
139139
140140 struct ta_funcs {
@@ -502,6 +502,9 @@ int psp_ras_enable_features(struct psp_context *psp, · 361 unmodified lines
502502 int psp_ras_trigger_error(struct psp_context *psp,
503503 struct ta_ras_trigger_error_input *info, uint32_t instance_mask);
504504 int psp_ras_terminate(struct psp_context *psp);
505+int psp_ras_query_address(struct psp_context *psp,
506+ struct ta_ras_query_address_input *addr_in,
507+ struct ta_ras_query_address_output *addr_out);
505508
506509 int psp_hdcp_invoke(struct psp_context *psp, uint32_t ta_cmd_id);
507510 int psp_dtm_invoke(struct psp_context *psp, uint32_t ta_cmd_id);
@@ -538,7 +541,5 @@ int psp_spatial_partition(struct psp_context *psp, int mode); · 30 unmodified lines
538541 int is_psp_fw_valid(struct psp_bin_desc bin);
539542
540543 int amdgpu_psp_wait_for_bootloader(struct amdgpu_device *adev);
541−
542−int amdgpu_psp_query_boot_status(struct amdgpu_device *adev);
543−
544+bool amdgpu_psp_get_ras_capability(struct psp_context *psp);
544545 #endif
drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c+1−1
@@ -362,7 +362,7 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size · 361 unmodified lines
362362 }
363363 }
364364
365− if (copy_to_user((char *)buf, context->mem_context.shared_buf, shared_buf_len))
365+ if (copy_to_user((char *)&buf[copy_pos], context->mem_context.shared_buf, shared_buf_len))
366366 ret = -EFAULT;
367367
368368 err_free_shared_buf:
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c+524−129
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939 #include "nbio_v7_9.h"
4040 #include "atom.h"
4141 #include "amdgpu_reset.h"
42+#include "amdgpu_psp.h"
4243
4344 #ifdef CONFIG_X86_MCE_AMD
4445 #include <asm/mce.h>
@@ -73,6 +74,8 @@ const char *ras_block_string[] = { · 28 unmodified lines
7374 "mca",
7475 "vcn",
7576 "jpeg",
77+ "ih",
78+ "mpio",
7679 };
7780
7881 const char *ras_mca_block_string[] = {
@@ -94,7 +97,8 @@ const char *get_ras_block_str(struct ras_common_if *ras_block) · 15 unmodified lines
9497 if (!ras_block)
9598 return "NULL";
9699
97− if (ras_block->block >= AMDGPU_RAS_BLOCK_COUNT)
100+ if (ras_block->block >= AMDGPU_RAS_BLOCK_COUNT ||
101+ ras_block->block >= ARRAY_SIZE(ras_block_string))
98102 return "OUT OF RANGE";
99103
100104 if (ras_block->block == AMDGPU_RAS_BLOCK__MCA)
@@ -116,6 +120,8 @@ const char *get_ras_block_str(struct ras_common_if *ras_block) · 15 unmodified lines
116120 /* typical ECC bad page rate is 1 bad page per 100MB VRAM */
117121 #define RAS_BAD_PAGE_COVER (100 * 1024 * 1024ULL)
118122
123+#define MAX_UMC_POISON_POLLING_TIME_ASYNC 100 //ms
124+
119125 enum amdgpu_ras_retire_page_reservation {
120126 AMDGPU_RAS_RETIRE_PAGE_RESERVED,
121127 AMDGPU_RAS_RETIRE_PAGE_PENDING,
@@ -628,8 +634,12 @@ static ssize_t amdgpu_ras_sysfs_read(struct device *dev, · 506 unmodified lines
628634 dev_warn(obj->adev->dev, "Failed to reset error counter and error status");
629635 }
630636
631− return sysfs_emit(buf, "%s: %lu\n%s: %lu\n", "ue", info.ue_count,
632− "ce", info.ce_count);
637+ if (info.head.block == AMDGPU_RAS_BLOCK__UMC)
638+ return sysfs_emit(buf, "%s: %lu\n%s: %lu\n%s: %lu\n", "ue", info.ue_count,
639+ "ce", info.ce_count, "de", info.de_count);
640+ else
641+ return sysfs_emit(buf, "%s: %lu\n%s: %lu\n", "ue", info.ue_count,
642+ "ce", info.ce_count);
633643 }
634644
635645 /* obj begin */
@@ -1036,7 +1046,8 @@ static void amdgpu_ras_error_print_error_data(struct amdgpu_device *adev, · 400 unmodified lines
10361046 struct ras_manager *ras_mgr,
10371047 struct ras_err_data *err_data,
10381048 const char *blk_name,
1039− bool is_ue)
1049+ bool is_ue,
1050+ bool is_de)
10401051 {
10411052 struct amdgpu_smuio_mcm_config_info *mcm_info;
10421053 struct ras_err_node *err_node;
@@ -1065,25 +1076,50 @@ static void amdgpu_ras_error_print_error_data(struct amdgpu_device *adev, · 22 unmodified lines
10651076 }
10661077
10671078 } else {
1068− for_each_ras_error(err_node, err_data) {
1069− err_info = &err_node->err_info;
1070− mcm_info = &err_info->mcm_info;
1071− if (err_info->ce_count) {
1079+ if (is_de) {
1080+ for_each_ras_error(err_node, err_data) {
1081+ err_info = &err_node->err_info;
1082+ mcm_info = &err_info->mcm_info;
1083+ if (err_info->de_count) {
1084+ dev_info(adev->dev, "socket: %d, die: %d, "
1085+ "%lld new deferred hardware errors detected in %s block\n",
1086+ mcm_info->socket_id,
1087+ mcm_info->die_id,
1088+ err_info->de_count,
1089+ blk_name);
1090+ }
1091+ }
1092+
1093+ for_each_ras_error(err_node, &ras_mgr->err_data) {
1094+ err_info = &err_node->err_info;
1095+ mcm_info = &err_info->mcm_info;
10721096 dev_info(adev->dev, "socket: %d, die: %d, "
1073− "%lld new correctable hardware errors detected in %s block\n",
1074− mcm_info->socket_id,
1075− mcm_info->die_id,
1076− err_info->ce_count,
1077− blk_name);
1097+ "%lld deferred hardware errors detected in total in %s block\n",
1098+ mcm_info->socket_id, mcm_info->die_id,
1099+ err_info->de_count, blk_name);
1100+ }
1101+ } else {
1102+ for_each_ras_error(err_node, err_data) {
1103+ err_info = &err_node->err_info;
1104+ mcm_info = &err_info->mcm_info;
1105+ if (err_info->ce_count) {
1106+ dev_info(adev->dev, "socket: %d, die: %d, "
1107+ "%lld new correctable hardware errors detected in %s block\n",
1108+ mcm_info->socket_id,
1109+ mcm_info->die_id,
1110+ err_info->ce_count,
1111+ blk_name);
1112+ }
10781113 }
1079− }
10801114
1081− for_each_ras_error(err_node, &ras_mgr->err_data) {
1082− err_info = &err_node->err_info;
1083− mcm_info = &err_info->mcm_info;
1084− dev_info(adev->dev, "socket: %d, die: %d, "
1085− "%lld correctable hardware errors detected in total in %s block\n",
1086− mcm_info->socket_id, mcm_info->die_id, err_info->ce_count, blk_name);
1115+ for_each_ras_error(err_node, &ras_mgr->err_data) {
1116+ err_info = &err_node->err_info;
1117+ mcm_info = &err_info->mcm_info;
1118+ dev_info(adev->dev, "socket: %d, die: %d, "
1119+ "%lld correctable hardware errors detected in total in %s block\n",
1120+ mcm_info->socket_id, mcm_info->die_id,
1121+ err_info->ce_count, blk_name);
1122+ }
10871123 }
10881124 }
10891125 }
@@ -1102,7 +1138,8 @@ static void amdgpu_ras_error_generate_report(struct amdgpu_device *adev, · 12 unmodified lines
11021138
11031139 if (err_data->ce_count) {
11041140 if (err_data_has_source_info(err_data)) {
1105− amdgpu_ras_error_print_error_data(adev, ras_mgr, err_data, blk_name, false);
1141+ amdgpu_ras_error_print_error_data(adev, ras_mgr, err_data,
1142+ blk_name, false, false);
11061143 } else if (!adev->aid_mask &&
11071144 adev->smuio.funcs &&
11081145 adev->smuio.funcs->get_socket_id &&
@@ -1124,7 +1161,8 @@ static void amdgpu_ras_error_generate_report(struct amdgpu_device *adev, · 15 unmodified lines
11241161
11251162 if (err_data->ue_count) {
11261163 if (err_data_has_source_info(err_data)) {
1127− amdgpu_ras_error_print_error_data(adev, ras_mgr, err_data, blk_name, true);
1164+ amdgpu_ras_error_print_error_data(adev, ras_mgr, err_data,
1165+ blk_name, true, false);
11281166 } else if (!adev->aid_mask &&
11291167 adev->smuio.funcs &&
11301168 adev->smuio.funcs->get_socket_id &&
@@ -1144,6 +1182,28 @@ static void amdgpu_ras_error_generate_report(struct amdgpu_device *adev, · 13 unmodified lines
11441182 }
11451183 }
11461184
1185+ if (err_data->de_count) {
1186+ if (err_data_has_source_info(err_data)) {
1187+ amdgpu_ras_error_print_error_data(adev, ras_mgr, err_data,
1188+ blk_name, false, true);
1189+ } else if (!adev->aid_mask &&
1190+ adev->smuio.funcs &&
1191+ adev->smuio.funcs->get_socket_id &&
1192+ adev->smuio.funcs->get_die_id) {
1193+ dev_info(adev->dev, "socket: %d, die: %d "
1194+ "%ld deferred hardware errors "
1195+ "detected in %s block\n",
1196+ adev->smuio.funcs->get_socket_id(adev),
1197+ adev->smuio.funcs->get_die_id(adev),
1198+ ras_mgr->err_data.de_count,
1199+ blk_name);
1200+ } else {
1201+ dev_info(adev->dev, "%ld deferred hardware errors "
1202+ "detected in %s block\n",
1203+ ras_mgr->err_data.de_count,
1204+ blk_name);
1205+ }
1206+ }
11471207 }
11481208
11491209 static void amdgpu_rasmgr_error_data_statistic_update(struct ras_manager *obj, struct ras_err_data *err_data)
@@ -1154,7 +1214,8 @@ static void amdgpu_rasmgr_error_data_statistic_update(struct ras_manager *obj, s · 4 unmodified lines
11541214 if (err_data_has_source_info(err_data)) {
11551215 for_each_ras_error(err_node, err_data) {
11561216 err_info = &err_node->err_info;
1157−
1217+ amdgpu_ras_error_statistic_de_count(&obj->err_data,
1218+ &err_info->mcm_info, NULL, err_info->de_count);
11581219 amdgpu_ras_error_statistic_ce_count(&obj->err_data,
11591220 &err_info->mcm_info, NULL, err_info->ce_count);
11601221 amdgpu_ras_error_statistic_ue_count(&obj->err_data,
@@ -1164,9 +1225,72 @@ static void amdgpu_rasmgr_error_data_statistic_update(struct ras_manager *obj, s · 3 unmodified lines
11641225 /* for legacy asic path which doesn't has error source info */
11651226 obj->err_data.ue_count += err_data->ue_count;
11661227 obj->err_data.ce_count += err_data->ce_count;
1228+ obj->err_data.de_count += err_data->de_count;
11671229 }
11681230 }
11691231
1232+static struct ras_manager *get_ras_manager(struct amdgpu_device *adev, enum amdgpu_ras_block blk)
1233+{
1234+ struct ras_common_if head;
1235+
1236+ memset(&head, 0, sizeof(head));
1237+ head.block = blk;
1238+
1239+ return amdgpu_ras_find_obj(adev, &head);
1240+}
1241+
1242+int amdgpu_ras_bind_aca(struct amdgpu_device *adev, enum amdgpu_ras_block blk,
1243+ const struct aca_info *aca_info, void *data)
1244+{
1245+ struct ras_manager *obj;
1246+
1247+ obj = get_ras_manager(adev, blk);
1248+ if (!obj)
1249+ return -EINVAL;
1250+
1251+ return amdgpu_aca_add_handle(adev, &obj->aca_handle, ras_block_str(blk), aca_info, data);
1252+}
1253+
1254+int amdgpu_ras_unbind_aca(struct amdgpu_device *adev, enum amdgpu_ras_block blk)
1255+{
1256+ struct ras_manager *obj;
1257+
1258+ obj = get_ras_manager(adev, blk);
1259+ if (!obj)
1260+ return -EINVAL;
1261+
1262+ amdgpu_aca_remove_handle(&obj->aca_handle);
1263+
1264+ return 0;
1265+}
1266+
1267+static int amdgpu_aca_log_ras_error_data(struct amdgpu_device *adev, enum amdgpu_ras_block blk,
1268+ enum aca_error_type type, struct ras_err_data *err_data)
1269+{
1270+ struct ras_manager *obj;
1271+
1272+ obj = get_ras_manager(adev, blk);
1273+ if (!obj)
1274+ return -EINVAL;
1275+
1276+ return amdgpu_aca_get_error_data(adev, &obj->aca_handle, type, err_data);
1277+}
1278+
1279+ssize_t amdgpu_ras_aca_sysfs_read(struct device *dev, struct device_attribute *attr,
1280+ struct aca_handle *handle, char *buf, void *data)
1281+{
1282+ struct ras_manager *obj = container_of(handle, struct ras_manager, aca_handle);
1283+ struct ras_query_if info = {
1284+ .head = obj->head,
1285+ };
1286+
1287+ if (amdgpu_ras_query_error_status(obj->adev, &info))
1288+ return -EINVAL;
1289+
1290+ return sysfs_emit(buf, "%s: %lu\n%s: %lu\n", "ue", info.ue_count,
1291+ "ce", info.ce_count);
1292+}
1293+
11701294 static int amdgpu_ras_query_error_status_helper(struct amdgpu_device *adev,
11711295 struct ras_query_if *info,
11721296 struct ras_err_data *err_data,
@@ -1174,6 +1298,7 @@ static int amdgpu_ras_query_error_status_helper(struct amdgpu_device *adev, · 1 unmodified line
11741298 {
11751299 enum amdgpu_ras_block blk = info ? info->head.block : AMDGPU_RAS_BLOCK_COUNT;
11761300 struct amdgpu_ras_block_object *block_obj = NULL;
1301+ int ret;
11771302
11781303 if (blk == AMDGPU_RAS_BLOCK_COUNT)
11791304 return -EINVAL;
@@ -1203,9 +1328,19 @@ static int amdgpu_ras_query_error_status_helper(struct amdgpu_device *adev, · 23 unmodified lines
12031328 }
12041329 }
12051330 } else {
1206− /* FIXME: add code to check return value later */
1207− amdgpu_mca_smu_log_ras_error(adev, blk, AMDGPU_MCA_ERROR_TYPE_UE, err_data);
1208− amdgpu_mca_smu_log_ras_error(adev, blk, AMDGPU_MCA_ERROR_TYPE_CE, err_data);
1331+ if (amdgpu_aca_is_enabled(adev)) {
1332+ ret = amdgpu_aca_log_ras_error_data(adev, blk, ACA_ERROR_TYPE_UE, err_data);
1333+ if (ret)
1334+ return ret;
1335+
1336+ ret = amdgpu_aca_log_ras_error_data(adev, blk, ACA_ERROR_TYPE_CE, err_data);
1337+ if (ret)
1338+ return ret;
1339+ } else {
1340+ /* FIXME: add code to check return value later */
1341+ amdgpu_mca_smu_log_ras_error(adev, blk, AMDGPU_MCA_ERROR_TYPE_UE, err_data);
1342+ amdgpu_mca_smu_log_ras_error(adev, blk, AMDGPU_MCA_ERROR_TYPE_CE, err_data);
1343+ }
12091344 }
12101345
12111346 return 0;
@@ -1239,6 +1374,7 @@ int amdgpu_ras_query_error_status(struct amdgpu_device *adev, struct ras_query_i · 27 unmodified lines
12391374
12401375 info->ue_count = obj->err_data.ue_count;
12411376 info->ce_count = obj->err_data.ce_count;
1377+ info->de_count = obj->err_data.de_count;
12421378
12431379 amdgpu_ras_error_generate_report(adev, info, &err_data);
12441380
@@ -1254,6 +1390,7 @@ int amdgpu_ras_reset_error_count(struct amdgpu_device *adev, · 9 unmodified lines
12541390 struct amdgpu_ras_block_object *block_obj = amdgpu_ras_get_ras_block(adev, block, 0);
12551391 struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
12561392 const struct amdgpu_mca_smu_funcs *mca_funcs = adev->mca.mca_funcs;
1393+ const struct aca_smu_funcs *smu_funcs = adev->aca.smu_funcs;
12571394 struct amdgpu_hive_info *hive;
12581395 int hive_ras_recovery = 0;
12591396
@@ -1264,7 +1401,7 @@ int amdgpu_ras_reset_error_count(struct amdgpu_device *adev, · 4 unmodified lines
12641401 }
12651402
12661403 if (!amdgpu_ras_is_supported(adev, block) ||
1267− !amdgpu_ras_get_mca_debug_mode(adev))
1404+ !amdgpu_ras_get_aca_debug_mode(adev))
12681405 return -EOPNOTSUPP;
12691406
12701407 hive = amdgpu_get_xgmi_hive(adev);
@@ -1276,7 +1413,8 @@ int amdgpu_ras_reset_error_count(struct amdgpu_device *adev, · 5 unmodified lines
12761413 /* skip ras error reset in gpu reset */
12771414 if ((amdgpu_in_reset(adev) || atomic_read(&ras->in_recovery) ||
12781415 hive_ras_recovery) &&
1279− mca_funcs && mca_funcs->mca_set_debug_mode)
1416+ ((smu_funcs && smu_funcs->set_debug_mode) ||
1417+ (mca_funcs && mca_funcs->mca_set_debug_mode)))
12801418 return -EOPNOTSUPP;
12811419
12821420 if (block_obj->hw_ops->reset_ras_error_count)
@@ -1772,7 +1910,10 @@ void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev) · 489 unmodified lines
17721910 }
17731911 }
17741912
1775− amdgpu_mca_smu_debugfs_init(adev, dir);
1913+ if (amdgpu_aca_is_enabled(adev))
1914+ amdgpu_aca_smu_debugfs_init(adev, dir);
1915+ else
1916+ amdgpu_mca_smu_debugfs_init(adev, dir);
17761917 }
17771918
17781919 /* debugfs end */
@@ -1900,7 +2041,7 @@ static void amdgpu_ras_interrupt_poison_consumption_handler(struct ras_manager * · 121 unmodified lines
19002041 }
19012042 }
19022043
1903− amdgpu_umc_poison_handler(adev, false);
2044+ amdgpu_umc_poison_handler(adev, obj->head.block, false);
19042045
19052046 if (block_obj->hw_ops && block_obj->hw_ops->handle_poison_consumption)
19062047 poison_stat = block_obj->hw_ops->handle_poison_consumption(adev);
@@ -1951,6 +2092,7 @@ static void amdgpu_ras_interrupt_umc_handler(struct ras_manager *obj, · 44 unmodified lines
19512092 */
19522093 obj->err_data.ue_count += err_data.ue_count;
19532094 obj->err_data.ce_count += err_data.ce_count;
2095+ obj->err_data.de_count += err_data.de_count;
19542096 }
19552097
19562098 amdgpu_ras_error_data_fini(&err_data);
@@ -2520,6 +2662,32 @@ static void amdgpu_ras_validate_threshold(struct amdgpu_device *adev, · 563 unmodified lines
25202662 }
25212663 }
25222664
2665+static int amdgpu_ras_page_retirement_thread(void *param)
2666+{
2667+ struct amdgpu_device *adev = (struct amdgpu_device *)param;
2668+ struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
2669+
2670+ while (!kthread_should_stop()) {
2671+
2672+ wait_event_interruptible(con->page_retirement_wq,
2673+ kthread_should_stop() ||
2674+ atomic_read(&con->page_retirement_req_cnt));
2675+
2676+ if (kthread_should_stop())
2677+ break;
2678+
2679+ dev_info(adev->dev, "Start processing page retirement. request:%d\n",
2680+ atomic_read(&con->page_retirement_req_cnt));
2681+
2682+ atomic_dec(&con->page_retirement_req_cnt);
2683+
2684+ amdgpu_umc_bad_page_polling_timeout(adev,
2685+ false, MAX_UMC_POISON_POLLING_TIME_ASYNC);
2686+ }
2687+
2688+ return 0;
2689+}
2690+
25232691 int amdgpu_ras_recovery_init(struct amdgpu_device *adev)
25242692 {
25252693 struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
@@ -2583,6 +2751,16 @@ int amdgpu_ras_recovery_init(struct amdgpu_device *adev) · 57 unmodified lines
25832751 }
25842752 }
25852753
2754+ mutex_init(&con->page_retirement_lock);
2755+ init_waitqueue_head(&con->page_retirement_wq);
2756+ atomic_set(&con->page_retirement_req_cnt, 0);
2757+ con->page_retirement_thread =
2758+ kthread_run(amdgpu_ras_page_retirement_thread, adev, "umc_page_retirement");
2759+ if (IS_ERR(con->page_retirement_thread)) {
2760+ con->page_retirement_thread = NULL;
2761+ dev_warn(adev->dev, "Failed to create umc_page_retirement thread!!!\n");
2762+ }
2763+
25862764 #ifdef CONFIG_X86_MCE_AMD
25872765 if ((adev->asic_type == CHIP_ALDEBARAN) &&
25882766 (adev->gmc.xgmi.connected_to_cpu))
@@ -2618,6 +2796,11 @@ static int amdgpu_ras_recovery_fini(struct amdgpu_device *adev) · 29 unmodified lines
26182796 if (!data)
26192797 return 0;
26202798
2799+ if (con->page_retirement_thread)
2800+ kthread_stop(con->page_retirement_thread);
2801+
2802+ atomic_set(&con->page_retirement_req_cnt, 0);
2803+
26212804 cancel_work_sync(&con->recovery_work);
26222805
26232806 mutex_lock(&con->recovery_lock);
@@ -2679,6 +2862,87 @@ static void amdgpu_ras_get_quirks(struct amdgpu_device *adev) · 55 unmodified lines
26792862 adev->ras_hw_enabled |= (1 << AMDGPU_RAS_BLOCK__GFX);
26802863 }
26812864
2865+/* Query ras capablity via atomfirmware interface */
2866+static void amdgpu_ras_query_ras_capablity_from_vbios(struct amdgpu_device *adev)
2867+{
2868+ /* mem_ecc cap */
2869+ if (amdgpu_atomfirmware_mem_ecc_supported(adev)) {
2870+ dev_info(adev->dev, "MEM ECC is active.\n");
2871+ adev->ras_hw_enabled |= (1 << AMDGPU_RAS_BLOCK__UMC |
2872+ 1 << AMDGPU_RAS_BLOCK__DF);
2873+ } else {
2874+ dev_info(adev->dev, "MEM ECC is not presented.\n");
2875+ }
2876+
2877+ /* sram_ecc cap */
2878+ if (amdgpu_atomfirmware_sram_ecc_supported(adev)) {
2879+ dev_info(adev->dev, "SRAM ECC is active.\n");
2880+ if (!amdgpu_sriov_vf(adev))
2881+ adev->ras_hw_enabled |= ~(1 << AMDGPU_RAS_BLOCK__UMC |
2882+ 1 << AMDGPU_RAS_BLOCK__DF);
2883+ else
2884+ adev->ras_hw_enabled |= (1 << AMDGPU_RAS_BLOCK__PCIE_BIF |
2885+ 1 << AMDGPU_RAS_BLOCK__SDMA |
2886+ 1 << AMDGPU_RAS_BLOCK__GFX);
2887+
2888+ /*
2889+ * VCN/JPEG RAS can be supported on both bare metal and
2890+ * SRIOV environment
2891+ */
2892+ if (amdgpu_ip_version(adev, VCN_HWIP, 0) == IP_VERSION(2, 6, 0) ||
2893+ amdgpu_ip_version(adev, VCN_HWIP, 0) == IP_VERSION(4, 0, 0) ||
2894+ amdgpu_ip_version(adev, VCN_HWIP, 0) == IP_VERSION(4, 0, 3))
2895+ adev->ras_hw_enabled |= (1 << AMDGPU_RAS_BLOCK__VCN |
2896+ 1 << AMDGPU_RAS_BLOCK__JPEG);
2897+ else
2898+ adev->ras_hw_enabled &= ~(1 << AMDGPU_RAS_BLOCK__VCN |
2899+ 1 << AMDGPU_RAS_BLOCK__JPEG);
2900+
2901+ /*
2902+ * XGMI RAS is not supported if xgmi num physical nodes
2903+ * is zero
2904+ */
2905+ if (!adev->gmc.xgmi.num_physical_nodes)
2906+ adev->ras_hw_enabled &= ~(1 << AMDGPU_RAS_BLOCK__XGMI_WAFL);
2907+ } else {
2908+ dev_info(adev->dev, "SRAM ECC is not presented.\n");
2909+ }
2910+}
2911+
2912+/* Query poison mode from umc/df IP callbacks */
2913+static void amdgpu_ras_query_poison_mode(struct amdgpu_device *adev)
2914+{
2915+ struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
2916+ bool df_poison, umc_poison;
2917+
2918+ /* poison setting is useless on SRIOV guest */
2919+ if (amdgpu_sriov_vf(adev) || !con)
2920+ return;
2921+
2922+ /* Init poison supported flag, the default value is false */
2923+ if (adev->gmc.xgmi.connected_to_cpu ||
2924+ adev->gmc.is_app_apu) {
2925+ /* enabled by default when GPU is connected to CPU */
2926+ con->poison_supported = true;
2927+ } else if (adev->df.funcs &&
2928+ adev->df.funcs->query_ras_poison_mode &&
2929+ adev->umc.ras &&
2930+ adev->umc.ras->query_ras_poison_mode) {
2931+ df_poison =
2932+ adev->df.funcs->query_ras_poison_mode(adev);
2933+ umc_poison =
2934+ adev->umc.ras->query_ras_poison_mode(adev);
2935+
2936+ /* Only poison is set in both DF and UMC, we can support it */
2937+ if (df_poison && umc_poison)
2938+ con->poison_supported = true;
2939+ else if (df_poison != umc_poison)
2940+ dev_warn(adev->dev,
2941+ "Poison setting is inconsistent in DF/UMC(%d:%d)!\n",
2942+ df_poison, umc_poison);
2943+ }
2944+}
2945+
26822946 /*
26832947 * check hardware's ras ability which will be saved in hw_supported.
26842948 * if hardware does not support ras, we can skip some ras initializtion and
@@ -2695,49 +2959,13 @@ static void amdgpu_ras_check_supported(struct amdgpu_device *adev) · 10 unmodified lines
26952959 if (!amdgpu_ras_asic_supported(adev))
26962960 return;
26972961
2698− if (!adev->gmc.xgmi.connected_to_cpu && !adev->gmc.is_app_apu) {
2699− if (amdgpu_atomfirmware_mem_ecc_supported(adev)) {
2700− dev_info(adev->dev, "MEM ECC is active.\n");
2701− adev->ras_hw_enabled |= (1 << AMDGPU_RAS_BLOCK__UMC |
2702− 1 << AMDGPU_RAS_BLOCK__DF);
2703− } else {
2704− dev_info(adev->dev, "MEM ECC is not presented.\n");
2705− }
2706−
2707− if (amdgpu_atomfirmware_sram_ecc_supported(adev)) {
2708− dev_info(adev->dev, "SRAM ECC is active.\n");
2709− if (!amdgpu_sriov_vf(adev))
2710− adev->ras_hw_enabled |= ~(1 << AMDGPU_RAS_BLOCK__UMC |
2711− 1 << AMDGPU_RAS_BLOCK__DF);
2712− else
2713− adev->ras_hw_enabled |= (1 << AMDGPU_RAS_BLOCK__PCIE_BIF |
2714− 1 << AMDGPU_RAS_BLOCK__SDMA |
2715− 1 << AMDGPU_RAS_BLOCK__GFX);
2716−
2717− /* VCN/JPEG RAS can be supported on both bare metal and
2718− * SRIOV environment
2719− */
2720− if (amdgpu_ip_version(adev, VCN_HWIP, 0) ==
2721− IP_VERSION(2, 6, 0) ||
2722− amdgpu_ip_version(adev, VCN_HWIP, 0) ==
2723− IP_VERSION(4, 0, 0) ||
2724− amdgpu_ip_version(adev, VCN_HWIP, 0) ==
2725− IP_VERSION(4, 0, 3))
2726− adev->ras_hw_enabled |= (1 << AMDGPU_RAS_BLOCK__VCN |
2727− 1 << AMDGPU_RAS_BLOCK__JPEG);
2728− else
2729− adev->ras_hw_enabled &= ~(1 << AMDGPU_RAS_BLOCK__VCN |
2730− 1 << AMDGPU_RAS_BLOCK__JPEG);
2962+ /* query ras capability from psp */
2963+ if (amdgpu_psp_get_ras_capability(&adev->psp))
2964+ goto init_ras_enabled_flag;
27312965
2732− /*
2733− * XGMI RAS is not supported if xgmi num physical nodes
2734− * is zero
2735− */
2736− if (!adev->gmc.xgmi.num_physical_nodes)
2737− adev->ras_hw_enabled &= ~(1 << AMDGPU_RAS_BLOCK__XGMI_WAFL);
2738− } else {
2739− dev_info(adev->dev, "SRAM ECC is not presented.\n");
2740− }
2966+ /* query ras capablity from bios */
2967+ if (!adev->gmc.xgmi.connected_to_cpu && !adev->gmc.is_app_apu) {
2968+ amdgpu_ras_query_ras_capablity_from_vbios(adev);
27412969 } else {
27422970 /* driver only manages a few IP blocks RAS feature
27432971 * when GPU is connected cpu through XGMI */
@@ -2746,13 +2974,21 @@ static void amdgpu_ras_check_supported(struct amdgpu_device *adev) · 2 unmodified lines
27462974 1 << AMDGPU_RAS_BLOCK__MMHUB);
27472975 }
27482976
2977+ /* apply asic specific settings (vega20 only for now) */
27492978 amdgpu_ras_get_quirks(adev);
27502979
2980+ /* query poison mode from umc/df ip callback */
2981+ amdgpu_ras_query_poison_mode(adev);
2982+
2983+init_ras_enabled_flag:
27512984 /* hw_supported needs to be aligned with RAS block mask. */
27522985 adev->ras_hw_enabled &= AMDGPU_RAS_BLOCK_MASK;
27532986
27542987 adev->ras_enabled = amdgpu_ras_enable == 0 ? 0 :
27552988 adev->ras_hw_enabled & amdgpu_ras_mask;
2989+
2990+ /* aca is disabled by default */
2991+ adev->aca.is_enabled = false;
27562992 }
27572993
27582994 static void amdgpu_ras_counte_dw(struct work_struct *work)
@@ -2780,39 +3016,6 @@ Out: · 21 unmodified lines
27803016 pm_runtime_put_autosuspend(dev->dev);
27813017 }
27823018
2783−static void amdgpu_ras_query_poison_mode(struct amdgpu_device *adev)
2784−{
2785− struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
2786− bool df_poison, umc_poison;
2787−
2788− /* poison setting is useless on SRIOV guest */
2789− if (amdgpu_sriov_vf(adev) || !con)
2790− return;
2791−
2792− /* Init poison supported flag, the default value is false */
2793− if (adev->gmc.xgmi.connected_to_cpu ||
2794− adev->gmc.is_app_apu) {
2795− /* enabled by default when GPU is connected to CPU */
2796− con->poison_supported = true;
2797− } else if (adev->df.funcs &&
2798− adev->df.funcs->query_ras_poison_mode &&
2799− adev->umc.ras &&
2800− adev->umc.ras->query_ras_poison_mode) {
2801− df_poison =
2802− adev->df.funcs->query_ras_poison_mode(adev);
2803− umc_poison =
2804− adev->umc.ras->query_ras_poison_mode(adev);
2805−
2806− /* Only poison is set in both DF and UMC, we can support it */
2807− if (df_poison && umc_poison)
2808− con->poison_supported = true;
2809− else if (df_poison != umc_poison)
2810− dev_warn(adev->dev,
2811− "Poison setting is inconsistent in DF/UMC(%d:%d)!\n",
2812− df_poison, umc_poison);
2813− }
2814−}
2815−
28163019 static int amdgpu_get_ras_schema(struct amdgpu_device *adev)
28173020 {
28183021 return amdgpu_ras_is_poison_mode_supported(adev) ? AMDGPU_RAS_ERROR__POISON : 0 |
@@ -2917,12 +3120,11 @@ int amdgpu_ras_init(struct amdgpu_device *adev) · 98 unmodified lines
29173120 goto release_con;
29183121 }
29193122
2920− amdgpu_ras_query_poison_mode(adev);
2921−
29223123 /* Packed socket_id to ras feature mask bits[31:29] */
29233124 if (adev->smuio.funcs &&
29243125 adev->smuio.funcs->get_socket_id)
2925− con->features |= ((adev->smuio.funcs->get_socket_id(adev)) << 29);
3126+ con->features |= ((adev->smuio.funcs->get_socket_id(adev)) <<
3127+ AMDGPU_RAS_FEATURES_SOCKETID_SHIFT);
29263128
29273129 /* Get RAS schema for particular SOC */
29283130 con->schema = amdgpu_get_ras_schema(adev);
@@ -3128,7 +3330,7 @@ void amdgpu_ras_suspend(struct amdgpu_device *adev) · 199 unmodified lines
31283330
31293331 amdgpu_ras_disable_all_features(adev, 0);
31303332 /* Make sure all ras objects are disabled. */
3131− if (con->features)
3333+ if (AMDGPU_RAS_GET_FEATURES(con->features))
31323334 amdgpu_ras_disable_all_features(adev, 1);
31333335 }
31343336
@@ -3142,15 +3344,29 @@ int amdgpu_ras_late_init(struct amdgpu_device *adev) · 7 unmodified lines
31423344 if (amdgpu_sriov_vf(adev))
31433345 return 0;
31443346
3145− amdgpu_ras_set_mca_debug_mode(adev, false);
3347+ if (amdgpu_aca_is_enabled(adev)) {
3348+ if (amdgpu_in_reset(adev))
3349+ r = amdgpu_aca_reset(adev);
3350+ else
3351+ r = amdgpu_aca_init(adev);
3352+ if (r)
3353+ return r;
3354+
3355+ amdgpu_ras_set_aca_debug_mode(adev, false);
3356+ } else {
3357+ amdgpu_ras_set_mca_debug_mode(adev, false);
3358+ }
31463359
31473360 list_for_each_entry_safe(node, tmp, &adev->ras_list, node) {
3148− if (!node->ras_obj) {
3361+ obj = node->ras_obj;
3362+ if (!obj) {
31493363 dev_warn(adev->dev, "Warning: abnormal ras list node.\n");
31503364 continue;
31513365 }
31523366
3153− obj = node->ras_obj;
3367+ if (!amdgpu_ras_is_supported(adev, obj->ras_comm.block))
3368+ continue;
3369+
31543370 if (obj->ras_late_init) {
31553371 r = obj->ras_late_init(adev, &obj->ras_comm);
31563372 if (r) {
@@ -3175,7 +3391,7 @@ int amdgpu_ras_pre_fini(struct amdgpu_device *adev) · 18 unmodified lines
31753391
31763392
31773393 /* Need disable ras on all IPs here before ip [hw/sw]fini */
3178− if (con->features)
3394+ if (AMDGPU_RAS_GET_FEATURES(con->features))
31793395 amdgpu_ras_disable_all_features(adev, 0);
31803396 amdgpu_ras_recovery_fini(adev);
31813397 return 0;
@@ -3208,10 +3424,13 @@ int amdgpu_ras_fini(struct amdgpu_device *adev) · 26 unmodified lines
32083424 amdgpu_ras_fs_fini(adev);
32093425 amdgpu_ras_interrupt_remove_all(adev);
32103426
3211− WARN(con->features, "Feature mask is not cleared");
3427+ if (amdgpu_aca_is_enabled(adev))
3428+ amdgpu_aca_fini(adev);
32123429
3213− if (con->features)
3214− amdgpu_ras_disable_all_features(adev, 1);
3430+ WARN(AMDGPU_RAS_GET_FEATURES(con->features), "Feature mask is not cleared");
3431+
3432+ if (AMDGPU_RAS_GET_FEATURES(con->features))
3433+ amdgpu_ras_disable_all_features(adev, 0);
32153434
32163435 cancel_delayed_work_sync(&con->ras_counte_delay_work);
32173436
@@ -3425,22 +3644,41 @@ int amdgpu_ras_set_mca_debug_mode(struct amdgpu_device *adev, bool enable) · 207 unmodified lines
34253644 if (con) {
34263645 ret = amdgpu_mca_smu_set_debug_mode(adev, enable);
34273646 if (!ret)
3428− con->is_mca_debug_mode = enable;
3647+ con->is_aca_debug_mode = enable;
3648+ }
3649+
3650+ return ret;
3651+}
3652+
3653+int amdgpu_ras_set_aca_debug_mode(struct amdgpu_device *adev, bool enable)
3654+{
3655+ struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
3656+ int ret = 0;
3657+
3658+ if (con) {
3659+ if (amdgpu_aca_is_enabled(adev))
3660+ ret = amdgpu_aca_smu_set_debug_mode(adev, enable);
3661+ else
3662+ ret = amdgpu_mca_smu_set_debug_mode(adev, enable);
3663+ if (!ret)
3664+ con->is_aca_debug_mode = enable;
34293665 }
34303666
34313667 return ret;
34323668 }
34333669
3434−bool amdgpu_ras_get_mca_debug_mode(struct amdgpu_device *adev)
3670+bool amdgpu_ras_get_aca_debug_mode(struct amdgpu_device *adev)
34353671 {
34363672 struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
3673+ const struct aca_smu_funcs *smu_funcs = adev->aca.smu_funcs;
34373674 const struct amdgpu_mca_smu_funcs *mca_funcs = adev->mca.mca_funcs;
34383675
34393676 if (!con)
34403677 return false;
34413678
3442− if (mca_funcs && mca_funcs->mca_set_debug_mode)
3443− return con->is_mca_debug_mode;
3679+ if ((amdgpu_aca_is_enabled(adev) && smu_funcs && smu_funcs->set_debug_mode) ||
3680+ (!amdgpu_aca_is_enabled(adev) && mca_funcs && mca_funcs->mca_set_debug_mode))
3681+ return con->is_aca_debug_mode;
34443682 else
34453683 return true;
34463684 }
@@ -3450,15 +3688,16 @@ bool amdgpu_ras_get_error_query_mode(struct amdgpu_device *adev, · 3 unmodified lines
34503688 {
34513689 struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
34523690 const struct amdgpu_mca_smu_funcs *mca_funcs = adev->mca.mca_funcs;
3691+ const struct aca_smu_funcs *smu_funcs = adev->aca.smu_funcs;
34533692
34543693 if (!con) {
34553694 *error_query_mode = AMDGPU_RAS_INVALID_ERROR_QUERY;
34563695 return false;
34573696 }
34583697
3459− if (mca_funcs && mca_funcs->mca_set_debug_mode)
3698+ if ((smu_funcs && smu_funcs->set_debug_mode) || (mca_funcs && mca_funcs->mca_set_debug_mode))
34603699 *error_query_mode =
3461− (con->is_mca_debug_mode) ? AMDGPU_RAS_DIRECT_ERROR_QUERY : AMDGPU_RAS_FIRMWARE_ERROR_QUERY;
3700+ (con->is_aca_debug_mode) ? AMDGPU_RAS_DIRECT_ERROR_QUERY : AMDGPU_RAS_FIRMWARE_ERROR_QUERY;
34623701 else
34633702 *error_query_mode = AMDGPU_RAS_DIRECT_ERROR_QUERY;
34643703
@@ -3699,8 +3938,7 @@ static int ras_err_info_cmp(void *priv, const struct list_head *a, const struct · 234 unmodified lines
36993938 }
37003939
37013940 static struct ras_err_info *amdgpu_ras_error_get_info(struct ras_err_data *err_data,
3702− struct amdgpu_smuio_mcm_config_info *mcm_info,
3703− struct ras_err_addr *err_addr)
3941+ struct amdgpu_smuio_mcm_config_info *mcm_info)
37043942 {
37053943 struct ras_err_node *err_node;
37063944
@@ -3712,10 +3950,9 @@ static struct ras_err_info *amdgpu_ras_error_get_info(struct ras_err_data *err_d · 5 unmodified lines
37123950 if (!err_node)
37133951 return NULL;
37143952
3715− memcpy(&err_node->err_info.mcm_info, mcm_info, sizeof(*mcm_info));
3953+ INIT_LIST_HEAD(&err_node->err_info.err_addr_list);
37163954
3717− if (err_addr)
3718− memcpy(&err_node->err_info.err_addr, err_addr, sizeof(*err_addr));
3955+ memcpy(&err_node->err_info.mcm_info, mcm_info, sizeof(*mcm_info));
37193956
37203957 err_data->err_list_count++;
37213958 list_add_tail(&err_node->node, &err_data->err_node_list);
@@ -3724,6 +3961,29 @@ static struct ras_err_info *amdgpu_ras_error_get_info(struct ras_err_data *err_d · 2 unmodified lines
37243961 return &err_node->err_info;
37253962 }
37263963
3964+void amdgpu_ras_add_mca_err_addr(struct ras_err_info *err_info, struct ras_err_addr *err_addr)
3965+{
3966+ struct ras_err_addr *mca_err_addr;
3967+
3968+ mca_err_addr = kzalloc(sizeof(*mca_err_addr), GFP_KERNEL);
3969+ if (!mca_err_addr)
3970+ return;
3971+
3972+ INIT_LIST_HEAD(&mca_err_addr->node);
3973+
3974+ mca_err_addr->err_status = err_addr->err_status;
3975+ mca_err_addr->err_ipid = err_addr->err_ipid;
3976+ mca_err_addr->err_addr = err_addr->err_addr;
3977+
3978+ list_add_tail(&mca_err_addr->node, &err_info->err_addr_list);
3979+}
3980+
3981+void amdgpu_ras_del_mca_err_addr(struct ras_err_info *err_info, struct ras_err_addr *mca_err_addr)
3982+{
3983+ list_del(&mca_err_addr->node);
3984+ kfree(mca_err_addr);
3985+}
3986+
37273987 int amdgpu_ras_error_statistic_ue_count(struct ras_err_data *err_data,
37283988 struct amdgpu_smuio_mcm_config_info *mcm_info,
37293989 struct ras_err_addr *err_addr, u64 count)
@@ -3736,10 +3996,13 @@ int amdgpu_ras_error_statistic_ue_count(struct ras_err_data *err_data, · 6 unmodified lines
37363996 if (!count)
37373997 return 0;
37383998
3739− err_info = amdgpu_ras_error_get_info(err_data, mcm_info, err_addr);
3999+ err_info = amdgpu_ras_error_get_info(err_data, mcm_info);
37404000 if (!err_info)
37414001 return -EINVAL;
37424002
4003+ if (err_addr && err_addr->err_status)
4004+ amdgpu_ras_add_mca_err_addr(err_info, err_addr);
4005+
37434006 err_info->ue_count += count;
37444007 err_data->ue_count += count;
37454008
@@ -3758,7 +4021,7 @@ int amdgpu_ras_error_statistic_ce_count(struct ras_err_data *err_data, · 12 unmodified lines
37584021 if (!count)
37594022 return 0;
37604023
3761− err_info = amdgpu_ras_error_get_info(err_data, mcm_info, err_addr);
4024+ err_info = amdgpu_ras_error_get_info(err_data, mcm_info);
37624025 if (!err_info)
37634026 return -EINVAL;
37644027
@@ -3767,3 +4030,135 @@ int amdgpu_ras_error_statistic_ce_count(struct ras_err_data *err_data, · 2 unmodified lines
37674030
37684031 return 0;
37694032 }
4033+
4034+int amdgpu_ras_error_statistic_de_count(struct ras_err_data *err_data,
4035+ struct amdgpu_smuio_mcm_config_info *mcm_info,
4036+ struct ras_err_addr *err_addr, u64 count)
4037+{
4038+ struct ras_err_info *err_info;
4039+
4040+ if (!err_data || !mcm_info)
4041+ return -EINVAL;
4042+
4043+ if (!count)
4044+ return 0;
4045+
4046+ err_info = amdgpu_ras_error_get_info(err_data, mcm_info);
4047+ if (!err_info)
4048+ return -EINVAL;
4049+
4050+ if (err_addr && err_addr->err_status)
4051+ amdgpu_ras_add_mca_err_addr(err_info, err_addr);
4052+
4053+ err_info->de_count += count;
4054+ err_data->de_count += count;
4055+
4056+ return 0;
4057+}
4058+
4059+#define mmMP0_SMN_C2PMSG_92 0x1609C
4060+#define mmMP0_SMN_C2PMSG_126 0x160BE
4061+static void amdgpu_ras_boot_time_error_reporting(struct amdgpu_device *adev,
4062+ u32 instance, u32 boot_error)
4063+{
4064+ u32 socket_id, aid_id, hbm_id;
4065+ u32 reg_data;
4066+ u64 reg_addr;
4067+
4068+ socket_id = AMDGPU_RAS_GPU_ERR_SOCKET_ID(boot_error);
4069+ aid_id = AMDGPU_RAS_GPU_ERR_AID_ID(boot_error);
4070+ hbm_id = AMDGPU_RAS_GPU_ERR_HBM_ID(boot_error);
4071+
4072+ /* The pattern for smn addressing in other SOC could be different from
4073+ * the one for aqua_vanjaram. We should revisit the code if the pattern
4074+ * is changed. In such case, replace the aqua_vanjaram implementation
4075+ * with more common helper */
4076+ reg_addr = (mmMP0_SMN_C2PMSG_92 << 2) +
4077+ aqua_vanjaram_encode_ext_smn_addressing(instance);
4078+
4079+ reg_data = amdgpu_device_indirect_rreg_ext(adev, reg_addr);
4080+ dev_err(adev->dev, "socket: %d, aid: %d, firmware boot failed, fw status is 0x%x\n",
4081+ socket_id, aid_id, reg_data);
4082+
4083+ if (AMDGPU_RAS_GPU_ERR_MEM_TRAINING(boot_error))
4084+ dev_info(adev->dev, "socket: %d, aid: %d, hbm: %d, memory training failed\n",
4085+ socket_id, aid_id, hbm_id);
4086+
4087+ if (AMDGPU_RAS_GPU_ERR_FW_LOAD(boot_error))
4088+ dev_info(adev->dev, "socket: %d, aid: %d, firmware load failed at boot time\n",
4089+ socket_id, aid_id);
4090+
4091+ if (AMDGPU_RAS_GPU_ERR_WAFL_LINK_TRAINING(boot_error))
4092+ dev_info(adev->dev, "socket: %d, aid: %d, wafl link training failed\n",
4093+ socket_id, aid_id);
4094+
4095+ if (AMDGPU_RAS_GPU_ERR_XGMI_LINK_TRAINING(boot_error))
4096+ dev_info(adev->dev, "socket: %d, aid: %d, xgmi link training failed\n",
4097+ socket_id, aid_id);
4098+
4099+ if (AMDGPU_RAS_GPU_ERR_USR_CP_LINK_TRAINING(boot_error))
4100+ dev_info(adev->dev, "socket: %d, aid: %d, usr cp link training failed\n",
4101+ socket_id, aid_id);
4102+
4103+ if (AMDGPU_RAS_GPU_ERR_USR_DP_LINK_TRAINING(boot_error))
4104+ dev_info(adev->dev, "socket: %d, aid: %d, usr dp link training failed\n",
4105+ socket_id, aid_id);
4106+
4107+ if (AMDGPU_RAS_GPU_ERR_HBM_MEM_TEST(boot_error))
4108+ dev_info(adev->dev, "socket: %d, aid: %d, hbm: %d, hbm memory test failed\n",
4109+ socket_id, aid_id, hbm_id);
4110+
4111+ if (AMDGPU_RAS_GPU_ERR_HBM_BIST_TEST(boot_error))
4112+ dev_info(adev->dev, "socket: %d, aid: %d, hbm: %d, hbm bist test failed\n",
4113+ socket_id, aid_id, hbm_id);
4114+}
4115+
4116+static int amdgpu_ras_wait_for_boot_complete(struct amdgpu_device *adev,
4117+ u32 instance, u32 *boot_error)
4118+{
4119+ u32 reg_addr;
4120+ u32 reg_data;
4121+ int retry_loop;
4122+
4123+ reg_addr = (mmMP0_SMN_C2PMSG_92 << 2) +
4124+ aqua_vanjaram_encode_ext_smn_addressing(instance);
4125+
4126+ for (retry_loop = 0; retry_loop < AMDGPU_RAS_BOOT_STATUS_POLLING_LIMIT; retry_loop++) {
4127+ reg_data = amdgpu_device_indirect_rreg_ext(adev, reg_addr);
4128+ if ((reg_data & AMDGPU_RAS_BOOT_STATUS_MASK) == AMDGPU_RAS_BOOT_STEADY_STATUS) {
4129+ *boot_error = AMDGPU_RAS_BOOT_SUCEESS;
4130+ return 0;
4131+ }
4132+ msleep(1);
4133+ }
4134+
4135+ /* The pattern for smn addressing in other SOC could be different from
4136+ * the one for aqua_vanjaram. We should revisit the code if the pattern
4137+ * is changed. In such case, replace the aqua_vanjaram implementation
4138+ * with more common helper */
4139+ reg_addr = (mmMP0_SMN_C2PMSG_126 << 2) +
4140+ aqua_vanjaram_encode_ext_smn_addressing(instance);
4141+
4142+ for (retry_loop = 0; retry_loop < AMDGPU_RAS_BOOT_STATUS_POLLING_LIMIT; retry_loop++) {
4143+ reg_data = amdgpu_device_indirect_rreg_ext(adev, reg_addr);
4144+ if (AMDGPU_RAS_GPU_ERR_BOOT_STATUS(reg_data)) {
4145+ *boot_error = reg_data;
4146+ return 0;
4147+ }
4148+ msleep(1);
4149+ }
4150+
4151+ *boot_error = reg_data;
4152+ return -ETIME;
4153+}
4154+
4155+void amdgpu_ras_query_boot_status(struct amdgpu_device *adev, u32 num_instances)
4156+{
4157+ u32 boot_error = 0;
4158+ u32 i;
4159+
4160+ for (i = 0; i < num_instances; i++) {
4161+ if (amdgpu_ras_wait_for_boot_complete(adev, i, &boot_error))
4162+ amdgpu_ras_boot_time_error_reporting(adev, i, boot_error);
4163+ }
4164+}
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h+57−3
@@ -29,9 +29,28 @@ · 28 unmodified lines
2929 #include "ta_ras_if.h"
3030 #include "amdgpu_ras_eeprom.h"
3131 #include "amdgpu_smuio.h"
32+#include "amdgpu_aca.h"
3233
3334 struct amdgpu_iv_entry;
3435
36+#define AMDGPU_RAS_GPU_ERR_MEM_TRAINING(x) AMDGPU_GET_REG_FIELD(x, 0, 0)
37+#define AMDGPU_RAS_GPU_ERR_FW_LOAD(x) AMDGPU_GET_REG_FIELD(x, 1, 1)
38+#define AMDGPU_RAS_GPU_ERR_WAFL_LINK_TRAINING(x) AMDGPU_GET_REG_FIELD(x, 2, 2)
39+#define AMDGPU_RAS_GPU_ERR_XGMI_LINK_TRAINING(x) AMDGPU_GET_REG_FIELD(x, 3, 3)
40+#define AMDGPU_RAS_GPU_ERR_USR_CP_LINK_TRAINING(x) AMDGPU_GET_REG_FIELD(x, 4, 4)
41+#define AMDGPU_RAS_GPU_ERR_USR_DP_LINK_TRAINING(x) AMDGPU_GET_REG_FIELD(x, 5, 5)
42+#define AMDGPU_RAS_GPU_ERR_HBM_MEM_TEST(x) AMDGPU_GET_REG_FIELD(x, 6, 6)
43+#define AMDGPU_RAS_GPU_ERR_HBM_BIST_TEST(x) AMDGPU_GET_REG_FIELD(x, 7, 7)
44+#define AMDGPU_RAS_GPU_ERR_SOCKET_ID(x) AMDGPU_GET_REG_FIELD(x, 10, 8)
45+#define AMDGPU_RAS_GPU_ERR_AID_ID(x) AMDGPU_GET_REG_FIELD(x, 12, 11)
46+#define AMDGPU_RAS_GPU_ERR_HBM_ID(x) AMDGPU_GET_REG_FIELD(x, 13, 13)
47+#define AMDGPU_RAS_GPU_ERR_BOOT_STATUS(x) AMDGPU_GET_REG_FIELD(x, 31, 31)
48+
49+#define AMDGPU_RAS_BOOT_STATUS_POLLING_LIMIT 1000
50+#define AMDGPU_RAS_BOOT_STEADY_STATUS 0xBA
51+#define AMDGPU_RAS_BOOT_STATUS_MASK 0xFF
52+#define AMDGPU_RAS_BOOT_SUCEESS 0x80000000
53+
3554 #define AMDGPU_RAS_FLAG_INIT_BY_VBIOS (0x1 << 0)
3655 /* position of instance value in sub_block_index of
3756 * ta_ras_trigger_error_input, the sub block uses lower 12 bits
@@ -39,6 +58,12 @@ struct amdgpu_iv_entry; · 1 unmodified line
3958 #define AMDGPU_RAS_INST_MASK 0xfffff000
4059 #define AMDGPU_RAS_INST_SHIFT 0xc
4160
61+#define AMDGPU_RAS_FEATURES_SOCKETID_SHIFT 29
62+#define AMDGPU_RAS_FEATURES_SOCKETID_MASK 0xe0000000
63+
64+/* The high three bits indicates socketid */
65+#define AMDGPU_RAS_GET_FEATURES(val) ((val) & ~AMDGPU_RAS_FEATURES_SOCKETID_MASK)
66+
4267 enum amdgpu_ras_block {
4368 AMDGPU_RAS_BLOCK__UMC = 0,
4469 AMDGPU_RAS_BLOCK__SDMA,
@@ -57,6 +82,8 @@ enum amdgpu_ras_block { · 12 unmodified lines
5782 AMDGPU_RAS_BLOCK__MCA,
5883 AMDGPU_RAS_BLOCK__VCN,
5984 AMDGPU_RAS_BLOCK__JPEG,
85+ AMDGPU_RAS_BLOCK__IH,
86+ AMDGPU_RAS_BLOCK__MPIO,
6087
6188 AMDGPU_RAS_BLOCK__LAST
6289 };
@@ -441,10 +468,15 @@ struct amdgpu_ras { · 378 unmodified lines
441468 /* Indicates smu whether need update bad channel info */
442469 bool update_channel_flag;
443470 /* Record status of smu mca debug mode */
444− bool is_mca_debug_mode;
471+ bool is_aca_debug_mode;
445472
446473 /* Record special requirements of gpu reset caller */
447474 uint32_t gpu_reset_flags;
475+
476+ struct task_struct *page_retirement_thread;
477+ wait_queue_head_t page_retirement_wq;
478+ struct mutex page_retirement_lock;
479+ atomic_t page_retirement_req_cnt;
448480 };
449481
450482 struct ras_fs_data {
@@ -453,6 +485,7 @@ struct ras_fs_data { · 2 unmodified lines
453485 };
454486
455487 struct ras_err_addr {
488+ struct list_head node;
456489 uint64_t err_status;
457490 uint64_t err_ipid;
458491 uint64_t err_addr;
@@ -462,7 +495,8 @@ struct ras_err_info { · 3 unmodified lines
462495 struct amdgpu_smuio_mcm_config_info mcm_info;
463496 u64 ce_count;
464497 u64 ue_count;
465− struct ras_err_addr err_addr;
498+ u64 de_count;
499+ struct list_head err_addr_list;
466500 };
467501
468502 struct ras_err_node {
@@ -473,6 +507,7 @@ struct ras_err_node { · 4 unmodified lines
473507 struct ras_err_data {
474508 unsigned long ue_count;
475509 unsigned long ce_count;
510+ unsigned long de_count;
476511 unsigned long err_addr_cnt;
477512 struct eeprom_table_record *err_addr;
478513 u32 err_list_count;
@@ -529,6 +564,8 @@ struct ras_manager { · 50 unmodified lines
529564 struct ras_ih_data ih_data;
530565
531566 struct ras_err_data err_data;
567+
568+ struct aca_handle aca_handle;
532569 };
533570
534571 struct ras_badpage {
@@ -548,6 +585,7 @@ struct ras_query_if { · 13 unmodified lines
548585 struct ras_common_if head;
549586 unsigned long ue_count;
550587 unsigned long ce_count;
588+ unsigned long de_count;
551589 };
552590
553591 struct ras_inject_if {
@@ -781,7 +819,8 @@ struct amdgpu_ras* amdgpu_ras_get_context(struct amdgpu_device *adev); · 227 unmodified lines
781819 int amdgpu_ras_set_context(struct amdgpu_device *adev, struct amdgpu_ras *ras_con);
782820
783821 int amdgpu_ras_set_mca_debug_mode(struct amdgpu_device *adev, bool enable);
784−bool amdgpu_ras_get_mca_debug_mode(struct amdgpu_device *adev);
822+int amdgpu_ras_set_aca_debug_mode(struct amdgpu_device *adev, bool enable);
823+bool amdgpu_ras_get_aca_debug_mode(struct amdgpu_device *adev);
785824 bool amdgpu_ras_get_error_query_mode(struct amdgpu_device *adev,
786825 unsigned int *mode);
787826
@@ -818,5 +857,20 @@ int amdgpu_ras_error_statistic_ce_count(struct ras_err_data *err_data, · 30 unmodified lines
818857 int amdgpu_ras_error_statistic_ue_count(struct ras_err_data *err_data,
819858 struct amdgpu_smuio_mcm_config_info *mcm_info,
820859 struct ras_err_addr *err_addr, u64 count);
860+int amdgpu_ras_error_statistic_de_count(struct ras_err_data *err_data,
861+ struct amdgpu_smuio_mcm_config_info *mcm_info,
862+ struct ras_err_addr *err_addr, u64 count);
863+void amdgpu_ras_query_boot_status(struct amdgpu_device *adev, u32 num_instances);
864+int amdgpu_ras_bind_aca(struct amdgpu_device *adev, enum amdgpu_ras_block blk,
865+ const struct aca_info *aca_info, void *data);
866+int amdgpu_ras_unbind_aca(struct amdgpu_device *adev, enum amdgpu_ras_block blk);
867+
868+ssize_t amdgpu_ras_aca_sysfs_read(struct device *dev, struct device_attribute *attr,
869+ struct aca_handle *handle, char *buf, void *data);
870+
871+void amdgpu_ras_add_mca_err_addr(struct ras_err_info *err_info,
872+ struct ras_err_addr *err_addr);
821873
874+void amdgpu_ras_del_mca_err_addr(struct ras_err_info *err_info,
875+ struct ras_err_addr *mca_err_addr);
822876 #endif
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c+12−0
@@ -635,6 +635,7 @@ int amdgpu_ring_test_helper(struct amdgpu_ring *ring) · 634 unmodified lines
635635 ring->name);
636636
637637 ring->sched.ready = !r;
638+
638639 return r;
639640 }
640641
@@ -717,3 +718,14 @@ void amdgpu_ring_ib_on_emit_de(struct amdgpu_ring *ring) · 76 unmodified lines
717718 if (ring->is_sw_ring)
718719 amdgpu_sw_ring_ib_mark_offset(ring, AMDGPU_MUX_OFFSET_TYPE_DE);
719720 }
721+
722+bool amdgpu_ring_sched_ready(struct amdgpu_ring *ring)
723+{
724+ if (!ring)
725+ return false;
726+
727+ if (ring->no_scheduler || !drm_sched_wqueue_ready(&ring->sched))
728+ return false;
729+
730+ return true;
731+}
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h+1−1
@@ -450,5 +450,5 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, · 449 unmodified lines
450450 int amdgpu_ib_pool_init(struct amdgpu_device *adev);
451451 void amdgpu_ib_pool_fini(struct amdgpu_device *adev);
452452 int amdgpu_ib_ring_tests(struct amdgpu_device *adev);
453−
453+bool amdgpu_ring_sched_ready(struct amdgpu_ring *ring);
454454 #endif
drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c+1−1
@@ -241,7 +241,7 @@ void amdgpu_gfx_rlc_setup_cp_table(struct amdgpu_device *adev) · 240 unmodified lines
241241 table_size = le32_to_cpu(hdr->jt_size);
242242 }
243243
244− for (i = 0; i < table_size; i ++) {
244+ for (i = 0; i < table_size; i++) {
245245 dst_ptr[bo_offset + i] =
246246 cpu_to_le32(le32_to_cpu(fw_data[table_offset + i]));
247247 }
drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.h+1−1
@@ -169,7 +169,7 @@ struct amdgpu_rlc_funcs { · 168 unmodified lines
169169 void (*stop)(struct amdgpu_device *adev);
170170 void (*reset)(struct amdgpu_device *adev);
171171 void (*start)(struct amdgpu_device *adev);
172− void (*update_spm_vmid)(struct amdgpu_device *adev, unsigned vmid);
172+ void (*update_spm_vmid)(struct amdgpu_device *adev, struct amdgpu_ring *ring, unsigned vmid);
173173 bool (*is_rlcg_access_range)(struct amdgpu_device *adev, uint32_t reg);
174174 };
175175
drivers/gpu/drm/amd/amdgpu/amdgpu_seq64.c+38−32
@@ -35,14 +35,29 @@ · 34 unmodified lines
3535 * counters and VM updates. It has maximum count of 32768 64 bit slots.
3636 */
3737
38+/**
39+ * amdgpu_seq64_get_va_base - Get the seq64 va base address
40+ *
41+ * @adev: amdgpu_device pointer
42+ *
43+ * Returns:
44+ * va base address on success
45+ */
46+static inline u64 amdgpu_seq64_get_va_base(struct amdgpu_device *adev)
47+{
48+ u64 addr = adev->vm_manager.max_pfn << AMDGPU_GPU_PAGE_SHIFT;
49+
50+ addr -= AMDGPU_VA_RESERVED_TOP;
51+
52+ return addr;
53+}
54+
3855 /**
3956 * amdgpu_seq64_map - Map the seq64 memory to VM
4057 *
4158 * @adev: amdgpu_device pointer
4259 * @vm: vm pointer
4360 * @bo_va: bo_va pointer
44− * @seq64_addr: seq64 vaddr start address
45− * @size: seq64 pool size
4661 *
4762 * Map the seq64 memory to the given VM.
4863 *
@@ -50,11 +65,11 @@ · 1 unmodified line
5065 * 0 on success or a negative error code on failure
5166 */
5267 int amdgpu_seq64_map(struct amdgpu_device *adev, struct amdgpu_vm *vm,
53− struct amdgpu_bo_va **bo_va, u64 seq64_addr,
54− uint32_t size)
68+ struct amdgpu_bo_va **bo_va)
5569 {
5670 struct amdgpu_bo *bo;
5771 struct drm_exec exec;
72+ u64 seq64_addr;
5873 int r;
5974
6075 bo = adev->seq64.sbo;
@@ -77,9 +92,9 @@ int amdgpu_seq64_map(struct amdgpu_device *adev, struct amdgpu_vm *vm, · 16 unmodified lines
7792 goto error;
7893 }
7994
80− r = amdgpu_vm_bo_map(adev, *bo_va, seq64_addr, 0, size,
81− AMDGPU_PTE_READABLE | AMDGPU_PTE_WRITEABLE |
82− AMDGPU_PTE_EXECUTABLE);
95+ seq64_addr = amdgpu_seq64_get_va_base(adev);
96+ r = amdgpu_vm_bo_map(adev, *bo_va, seq64_addr, 0, AMDGPU_VA_RESERVED_SEQ64_SIZE,
97+ AMDGPU_PTE_READABLE);
8398 if (r) {
8499 DRM_ERROR("failed to do bo_map on userq sem, err=%d\n", r);
85100 amdgpu_vm_bo_del(adev, *bo_va);
@@ -144,31 +159,25 @@ error: · 58 unmodified lines
144159 * amdgpu_seq64_alloc - Allocate a 64 bit memory
145160 *
146161 * @adev: amdgpu_device pointer
147− * @gpu_addr: allocated gpu VA start address
148− * @cpu_addr: allocated cpu VA start address
162+ * @va: VA to access the seq in process address space
163+ * @cpu_addr: CPU address to access the seq
149164 *
150165 * Alloc a 64 bit memory from seq64 pool.
151166 *
152167 * Returns:
153168 * 0 on success or a negative error code on failure
154169 */
155−int amdgpu_seq64_alloc(struct amdgpu_device *adev, u64 *gpu_addr,
156− u64 **cpu_addr)
170+int amdgpu_seq64_alloc(struct amdgpu_device *adev, u64 *va, u64 **cpu_addr)
157171 {
158172 unsigned long bit_pos;
159− u32 offset;
160173
161174 bit_pos = find_first_zero_bit(adev->seq64.used, adev->seq64.num_sem);
175+ if (bit_pos >= adev->seq64.num_sem)
176+ return -ENOSPC;
162177
163− if (bit_pos < adev->seq64.num_sem) {
164− __set_bit(bit_pos, adev->seq64.used);
165− offset = bit_pos << 6; /* convert to qw offset */
166− } else {
167− return -EINVAL;
168− }
169−
170− *gpu_addr = offset + AMDGPU_SEQ64_VADDR_START;
171− *cpu_addr = offset + adev->seq64.cpu_base_addr;
178+ __set_bit(bit_pos, adev->seq64.used);
179+ *va = bit_pos * sizeof(u64) + amdgpu_seq64_get_va_base(adev);
180+ *cpu_addr = bit_pos + adev->seq64.cpu_base_addr;
172181
173182 return 0;
174183 }
@@ -177,20 +186,17 @@ int amdgpu_seq64_alloc(struct amdgpu_device *adev, u64 *gpu_addr, · 2 unmodified lines
177186 * amdgpu_seq64_free - Free the given 64 bit memory
178187 *
179188 * @adev: amdgpu_device pointer
180− * @gpu_addr: gpu start address to be freed
189+ * @va: gpu start address to be freed
181190 *
182191 * Free the given 64 bit memory from seq64 pool.
183− *
184192 */
185−void amdgpu_seq64_free(struct amdgpu_device *adev, u64 gpu_addr)
193+void amdgpu_seq64_free(struct amdgpu_device *adev, u64 va)
186194 {
187− u32 offset;
188−
189− offset = gpu_addr - AMDGPU_SEQ64_VADDR_START;
195+ unsigned long bit_pos;
190196
191− offset >>= 6;
192− if (offset < adev->seq64.num_sem)
193− __clear_bit(offset, adev->seq64.used);
197+ bit_pos = (va - amdgpu_seq64_get_va_base(adev)) / sizeof(u64);
198+ if (bit_pos < adev->seq64.num_sem)
199+ __clear_bit(bit_pos, adev->seq64.used);
194200 }
195201
196202 /**
@@ -229,7 +235,7 @@ int amdgpu_seq64_init(struct amdgpu_device *adev) · 32 unmodified lines
229235 * AMDGPU_MAX_SEQ64_SLOTS * sizeof(u64) * 8 = AMDGPU_MAX_SEQ64_SLOTS
230236 * 64bit slots
231237 */
232− r = amdgpu_bo_create_kernel(adev, AMDGPU_SEQ64_SIZE,
238+ r = amdgpu_bo_create_kernel(adev, AMDGPU_VA_RESERVED_SEQ64_SIZE,
233239 PAGE_SIZE, AMDGPU_GEM_DOMAIN_GTT,
234240 &adev->seq64.sbo, NULL,
235241 (void **)&adev->seq64.cpu_base_addr);
@@ -238,7 +244,7 @@ int amdgpu_seq64_init(struct amdgpu_device *adev) · 2 unmodified lines
238244 return r;
239245 }
240246
241− memset(adev->seq64.cpu_base_addr, 0, AMDGPU_SEQ64_SIZE);
247+ memset(adev->seq64.cpu_base_addr, 0, AMDGPU_VA_RESERVED_SEQ64_SIZE);
242248
243249 adev->seq64.num_sem = AMDGPU_MAX_SEQ64_SLOTS;
244250 memset(&adev->seq64.used, 0, sizeof(adev->seq64.used));
drivers/gpu/drm/amd/amdgpu/amdgpu_seq64.h+4−5
@@ -25,10 +25,9 @@ · 24 unmodified lines
2525 #ifndef __AMDGPU_SEQ64_H__
2626 #define __AMDGPU_SEQ64_H__
2727
28−#define AMDGPU_SEQ64_SIZE (2ULL << 20)
29−#define AMDGPU_MAX_SEQ64_SLOTS (AMDGPU_SEQ64_SIZE / (sizeof(u64) * 8))
30−#define AMDGPU_SEQ64_VADDR_OFFSET 0x50000
31−#define AMDGPU_SEQ64_VADDR_START (AMDGPU_VA_RESERVED_SIZE + AMDGPU_SEQ64_VADDR_OFFSET)
28+#include "amdgpu_vm.h"
29+
30+#define AMDGPU_MAX_SEQ64_SLOTS (AMDGPU_VA_RESERVED_SEQ64_SIZE / sizeof(u64))
3231
3332 struct amdgpu_seq64 {
3433 struct amdgpu_bo *sbo;
@@ -42,7 +41,7 @@ int amdgpu_seq64_init(struct amdgpu_device *adev); · 7 unmodified lines
4241 int amdgpu_seq64_alloc(struct amdgpu_device *adev, u64 *gpu_addr, u64 **cpu_addr);
4342 void amdgpu_seq64_free(struct amdgpu_device *adev, u64 gpu_addr);
4443 int amdgpu_seq64_map(struct amdgpu_device *adev, struct amdgpu_vm *vm,
45− struct amdgpu_bo_va **bo_va, u64 seq64_addr, uint32_t size);
44+ struct amdgpu_bo_va **bo_va);
4645 void amdgpu_seq64_unmap(struct amdgpu_device *adev, struct amdgpu_fpriv *fpriv);
4746
4847 #endif
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c+2−9
@@ -102,23 +102,19 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo, · 101 unmodified lines
102102 /* Don't handle scatter gather BOs */
103103 if (bo->type == ttm_bo_type_sg) {
104104 placement->num_placement = 0;
105− placement->num_busy_placement = 0;
106105 return;
107106 }
108107
109108 /* Object isn't an AMDGPU object so ignore */
110109 if (!amdgpu_bo_is_amdgpu_bo(bo)) {
111110 placement->placement = &placements;
112− placement->busy_placement = &placements;
113111 placement->num_placement = 1;
114− placement->num_busy_placement = 1;
115112 return;
116113 }
117114
118115 abo = ttm_to_amdgpu_bo(bo);
119116 if (abo->flags & AMDGPU_GEM_CREATE_DISCARDABLE) {
120117 placement->num_placement = 0;
121− placement->num_busy_placement = 0;
122118 return;
123119 }
124120
@@ -128,13 +124,13 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo, · 3 unmodified lines
128124 case AMDGPU_PL_OA:
129125 case AMDGPU_PL_DOORBELL:
130126 placement->num_placement = 0;
131− placement->num_busy_placement = 0;
132127 return;
133128
134129 case TTM_PL_VRAM:
135130 if (!adev->mman.buffer_funcs_enabled) {
136131 /* Move to system memory */
137132 amdgpu_bo_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_CPU);
133+
138134 } else if (!amdgpu_gmc_vram_full_visible(&adev->gmc) &&
139135 !(abo->flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) &&
140136 amdgpu_bo_in_cpu_visible_vram(abo)) {
@@ -149,8 +145,7 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo, · 8 unmodified lines
149145 AMDGPU_GEM_DOMAIN_CPU);
150146 abo->placements[0].fpfn = adev->gmc.visible_vram_size >> PAGE_SHIFT;
151147 abo->placements[0].lpfn = 0;
152− abo->placement.busy_placement = &abo->placements[1];
153− abo->placement.num_busy_placement = 1;
148+ abo->placements[0].flags |= TTM_PL_FLAG_DESIRED;
154149 } else {
155150 /* Move to GTT memory */
156151 amdgpu_bo_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_GTT |
@@ -966,8 +961,6 @@ int amdgpu_ttm_alloc_gart(struct ttm_buffer_object *bo) · 809 unmodified lines
966961 /* allocate GART space */
967962 placement.num_placement = 1;
968963 placement.placement = &placements;
969− placement.num_busy_placement = 1;
970− placement.busy_placement = &placements;
971964 placements.fpfn = 0;
972965 placements.lpfn = adev->gmc.gart_size >> PAGE_SHIFT;
973966 placements.mem_type = TTM_PL_TT;
drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c+119−36
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323
2424 #include "amdgpu.h"
2525 #include "umc_v6_7.h"
26+#define MAX_UMC_POISON_POLLING_TIME_SYNC 20 //ms
2627
2728 static int amdgpu_umc_convert_error_address(struct amdgpu_device *adev,
2829 struct ras_err_data *err_data, uint64_t err_addr,
@@ -85,18 +86,21 @@ out_fini_err_data: · 56 unmodified lines
8586 return ret;
8687 }
8788
88−static int amdgpu_umc_do_page_retirement(struct amdgpu_device *adev,
89− void *ras_error_status,
90− struct amdgpu_iv_entry *entry,
91− bool reset)
89+static void amdgpu_umc_handle_bad_pages(struct amdgpu_device *adev,
90+ void *ras_error_status)
9291 {
9392 struct ras_err_data *err_data = (struct ras_err_data *)ras_error_status;
9493 struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
94+ unsigned int error_query_mode;
9595 int ret = 0;
96+ unsigned long err_count;
9697
97− kgd2kfd_set_sram_ecc_flag(adev->kfd.dev);
98+ amdgpu_ras_get_error_query_mode(adev, &error_query_mode);
99+
100+ mutex_lock(&con->page_retirement_lock);
98101 ret = amdgpu_dpm_get_ecc_info(adev, (void *)&(con->umc_ecc));
99− if (ret == -EOPNOTSUPP) {
102+ if (ret == -EOPNOTSUPP &&
103+ error_query_mode == AMDGPU_RAS_DIRECT_ERROR_QUERY) {
100104 if (adev->umc.ras && adev->umc.ras->ras_block.hw_ops &&
101105 adev->umc.ras->ras_block.hw_ops->query_ras_error_count)
102106 adev->umc.ras->ras_block.hw_ops->query_ras_error_count(adev, ras_error_status);
@@ -120,7 +124,8 @@ static int amdgpu_umc_do_page_retirement(struct amdgpu_device *adev, · 17 unmodified lines
120124 */
121125 adev->umc.ras->ras_block.hw_ops->query_ras_error_address(adev, ras_error_status);
122126 }
123− } else if (!ret) {
127+ } else if (error_query_mode == AMDGPU_RAS_FIRMWARE_ERROR_QUERY ||
128+ (!ret && error_query_mode == AMDGPU_RAS_DIRECT_ERROR_QUERY)) {
124129 if (adev->umc.ras &&
125130 adev->umc.ras->ecc_info_query_ras_error_count)
126131 adev->umc.ras->ecc_info_query_ras_error_count(adev, ras_error_status);
@@ -147,16 +152,13 @@ static int amdgpu_umc_do_page_retirement(struct amdgpu_device *adev, · 20 unmodified lines
147152 }
148153
149154 /* only uncorrectable error needs gpu reset */
150− if (err_data->ue_count) {
151− dev_info(adev->dev, "%ld uncorrectable hardware errors "
152− "detected in UMC block\n",
153− err_data->ue_count);
154−
155+ if (err_data->ue_count || err_data->de_count) {
156+ err_count = err_data->ue_count + err_data->de_count;
155157 if ((amdgpu_bad_page_threshold != 0) &&
156158 err_data->err_addr_cnt) {
157159 amdgpu_ras_add_bad_pages(adev, err_data->err_addr,
158160 err_data->err_addr_cnt);
159− amdgpu_ras_save_bad_pages(adev, &(err_data->ue_count));
161+ amdgpu_ras_save_bad_pages(adev, &err_count);
160162
161163 amdgpu_dpm_send_hbm_bad_pages_num(adev, con->eeprom_control.ras_num_recs);
162164
@@ -165,20 +167,87 @@ static int amdgpu_umc_do_page_retirement(struct amdgpu_device *adev, · 2 unmodified lines
165167 con->update_channel_flag = false;
166168 }
167169 }
168−
169− if (reset) {
170− /* use mode-2 reset for poison consumption */
171− if (!entry)
172− con->gpu_reset_flags |= AMDGPU_RAS_GPU_RESET_MODE2_RESET;
173− amdgpu_ras_reset_gpu(adev);
174− }
175170 }
176171
177172 kfree(err_data->err_addr);
173+
174+ mutex_unlock(&con->page_retirement_lock);
175+}
176+
177+static int amdgpu_umc_do_page_retirement(struct amdgpu_device *adev,
178+ void *ras_error_status,
179+ struct amdgpu_iv_entry *entry,
180+ bool reset)
181+{
182+ struct ras_err_data *err_data = (struct ras_err_data *)ras_error_status;
183+ struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
184+
185+ kgd2kfd_set_sram_ecc_flag(adev->kfd.dev);
186+ amdgpu_umc_handle_bad_pages(adev, ras_error_status);
187+
188+ if (err_data->ue_count && reset) {
189+ /* use mode-2 reset for poison consumption */
190+ if (!entry)
191+ con->gpu_reset_flags |= AMDGPU_RAS_GPU_RESET_MODE2_RESET;
192+ amdgpu_ras_reset_gpu(adev);
193+ }
194+
178195 return AMDGPU_RAS_SUCCESS;
179196 }
180197
181−int amdgpu_umc_poison_handler(struct amdgpu_device *adev, bool reset)
198+int amdgpu_umc_bad_page_polling_timeout(struct amdgpu_device *adev,
199+ bool reset, uint32_t timeout_ms)
200+{
201+ struct ras_err_data err_data;
202+ struct ras_common_if head = {
203+ .block = AMDGPU_RAS_BLOCK__UMC,
204+ };
205+ struct ras_manager *obj = amdgpu_ras_find_obj(adev, &head);
206+ uint32_t timeout = timeout_ms;
207+
208+ memset(&err_data, 0, sizeof(err_data));
209+ amdgpu_ras_error_data_init(&err_data);
210+
211+ do {
212+
213+ amdgpu_umc_handle_bad_pages(adev, &err_data);
214+
215+ if (timeout && !err_data.de_count) {
216+ msleep(1);
217+ timeout--;
218+ }
219+
220+ } while (timeout && !err_data.de_count);
221+
222+ if (!timeout)
223+ dev_warn(adev->dev, "Can't find bad pages\n");
224+
225+ if (err_data.de_count)
226+ dev_info(adev->dev, "%ld new deferred hardware errors detected\n", err_data.de_count);
227+
228+ if (obj) {
229+ obj->err_data.ue_count += err_data.ue_count;
230+ obj->err_data.ce_count += err_data.ce_count;
231+ obj->err_data.de_count += err_data.de_count;
232+ }
233+
234+ amdgpu_ras_error_data_fini(&err_data);
235+
236+ kgd2kfd_set_sram_ecc_flag(adev->kfd.dev);
237+
238+ if (reset) {
239+ struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
240+
241+ /* use mode-2 reset for poison consumption */
242+ con->gpu_reset_flags |= AMDGPU_RAS_GPU_RESET_MODE2_RESET;
243+ amdgpu_ras_reset_gpu(adev);
244+ }
245+
246+ return 0;
247+}
248+
249+int amdgpu_umc_poison_handler(struct amdgpu_device *adev,
250+ enum amdgpu_ras_block block, bool reset)
182251 {
183252 int ret = AMDGPU_RAS_SUCCESS;
184253
@@ -195,27 +264,41 @@ int amdgpu_umc_poison_handler(struct amdgpu_device *adev, bool reset) · 10 unmodified lines
195264 }
196265
197266 if (!amdgpu_sriov_vf(adev)) {
198− struct ras_err_data err_data;
199− struct ras_common_if head = {
200− .block = AMDGPU_RAS_BLOCK__UMC,
201− };
202− struct ras_manager *obj = amdgpu_ras_find_obj(adev, &head);
267+ if (amdgpu_ip_version(adev, UMC_HWIP, 0) < IP_VERSION(12, 0, 0)) {
268+ struct ras_err_data err_data;
269+ struct ras_common_if head = {
270+ .block = AMDGPU_RAS_BLOCK__UMC,
271+ };
272+ struct ras_manager *obj = amdgpu_ras_find_obj(adev, &head);
273+
274+ ret = amdgpu_ras_error_data_init(&err_data);
275+ if (ret)
276+ return ret;
203277
204− ret = amdgpu_ras_error_data_init(&err_data);
205− if (ret)
206− return ret;
278+ ret = amdgpu_umc_do_page_retirement(adev, &err_data, NULL, reset);
207279
208− ret = amdgpu_umc_do_page_retirement(adev, &err_data, NULL, reset);
280+ if (ret == AMDGPU_RAS_SUCCESS && obj) {
281+ obj->err_data.ue_count += err_data.ue_count;
282+ obj->err_data.ce_count += err_data.ce_count;
283+ obj->err_data.de_count += err_data.de_count;
284+ }
209285
210− if (ret == AMDGPU_RAS_SUCCESS && obj) {
211− obj->err_data.ue_count += err_data.ue_count;
212− obj->err_data.ce_count += err_data.ce_count;
213− }
286+ amdgpu_ras_error_data_fini(&err_data);
287+ } else {
288+ if (reset) {
289+ amdgpu_umc_bad_page_polling_timeout(adev,
290+ reset, MAX_UMC_POISON_POLLING_TIME_SYNC);
291+ } else {
292+ struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
214293
215− amdgpu_ras_error_data_fini(&err_data);
294+ atomic_inc(&con->page_retirement_req_cnt);
295+
296+ wake_up(&con->page_retirement_wq);
297+ }
298+ }
216299 } else {
217300 if (adev->virt.ops && adev->virt.ops->ras_poison_handler)
218− adev->virt.ops->ras_poison_handler(adev);
301+ adev->virt.ops->ras_poison_handler(adev, block);
219302 else
220303 dev_warn(adev->dev,
221304 "No ras_poison_handler interface in SRIOV!\n");
drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h+8−2
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 #ifndef __AMDGPU_UMC_H__
2222 #define __AMDGPU_UMC_H__
2323 #include "amdgpu_ras.h"
24−
24+#include "amdgpu_mca.h"
2525 /*
2626 * (addr / 256) * 4096, the higher 26 bits in ErrorAddr
2727 * is the index of 4KB block
@@ -64,6 +64,8 @@ struct amdgpu_umc_ras { · 36 unmodified lines
6464 void *ras_error_status);
6565 void (*ecc_info_query_ras_error_address)(struct amdgpu_device *adev,
6666 void *ras_error_status);
67+ bool (*check_ecc_err_status)(struct amdgpu_device *adev,
68+ enum amdgpu_mca_error_type type, void *ras_error_status);
6769 /* support different eeprom table version for different asic */
6870 void (*set_eeprom_table_version)(struct amdgpu_ras_eeprom_table_header *hdr);
6971 };
@@ -100,7 +102,8 @@ struct amdgpu_umc { · 30 unmodified lines
100102
101103 int amdgpu_umc_ras_sw_init(struct amdgpu_device *adev);
102104 int amdgpu_umc_ras_late_init(struct amdgpu_device *adev, struct ras_common_if *ras_block);
103−int amdgpu_umc_poison_handler(struct amdgpu_device *adev, bool reset);
105+int amdgpu_umc_poison_handler(struct amdgpu_device *adev,
106+ enum amdgpu_ras_block block, bool reset);
104107 int amdgpu_umc_process_ecc_irq(struct amdgpu_device *adev,
105108 struct amdgpu_irq_src *source,
106109 struct amdgpu_iv_entry *entry);
@@ -118,4 +121,7 @@ int amdgpu_umc_page_retirement_mca(struct amdgpu_device *adev, · 11 unmodified lines
118121
119122 int amdgpu_umc_loop_channels(struct amdgpu_device *adev,
120123 umc_func func, void *data);
124+
125+int amdgpu_umc_bad_page_polling_timeout(struct amdgpu_device *adev,
126+ bool reset, uint32_t timeout_ms);
121127 #endif
drivers/gpu/drm/amd/amdgpu/amdgpu_umr.h+2−2
@@ -69,12 +69,12 @@ struct amdgpu_debugfs_gprwave_data { · 68 unmodified lines
6969 };
7070
7171 enum AMDGPU_DEBUGFS_REGS2_CMDS {
72− AMDGPU_DEBUGFS_REGS2_CMD_SET_STATE=0,
72+ AMDGPU_DEBUGFS_REGS2_CMD_SET_STATE = 0,
7373 AMDGPU_DEBUGFS_REGS2_CMD_SET_STATE_V2,
7474 };
7575
7676 enum AMDGPU_DEBUGFS_GPRWAVE_CMDS {
77− AMDGPU_DEBUGFS_GPRWAVE_CMD_SET_STATE=0,
77+ AMDGPU_DEBUGFS_GPRWAVE_CMD_SET_STATE = 0,
7878 };
7979
8080 //reg2 interface
drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c+1−1
@@ -358,7 +358,7 @@ static int setup_umsch_mm_test(struct amdgpu_device *adev, · 357 unmodified lines
358358
359359 memset(test->ring_data_cpu_addr, 0, sizeof(struct umsch_mm_test_ring_data));
360360
361− test->ring_data_gpu_addr = AMDGPU_VA_RESERVED_SIZE;
361+ test->ring_data_gpu_addr = AMDGPU_VA_RESERVED_BOTTOM;
362362 r = map_ring_data(adev, test->vm, test->ring_data_obj, &test->bo_va,
363363 test->ring_data_gpu_addr, sizeof(struct umsch_mm_test_ring_data));
364364 if (r)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c+1−1
@@ -1189,7 +1189,7 @@ int amdgpu_vcn_process_poison_irq(struct amdgpu_device *adev, · 1188 unmodified lines
11891189 amdgpu_ras_interrupt_dispatch(adev, &ih_data);
11901190 } else {
11911191 if (adev->virt.ops && adev->virt.ops->ras_poison_handler)
1192− adev->virt.ops->ras_poison_handler(adev);
1192+ adev->virt.ops->ras_poison_handler(adev, ras_if->block);
11931193 else
11941194 dev_warn(adev->dev,
11951195 "No ras_poison_handler interface in SRIOV for VCN!\n");
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c+20−63
@@ -71,59 +71,6 @@ void amdgpu_virt_init_setting(struct amdgpu_device *adev) · 70 unmodified lines
7171 amdgpu_num_kcq = 2;
7272 }
7373
74−void amdgpu_virt_kiq_reg_write_reg_wait(struct amdgpu_device *adev,
75− uint32_t reg0, uint32_t reg1,
76− uint32_t ref, uint32_t mask,
77− uint32_t xcc_inst)
78−{
79− struct amdgpu_kiq *kiq = &adev->gfx.kiq[xcc_inst];
80− struct amdgpu_ring *ring = &kiq->ring;
81− signed long r, cnt = 0;
82− unsigned long flags;
83− uint32_t seq;
84−
85− if (adev->mes.ring.sched.ready) {
86− amdgpu_mes_reg_write_reg_wait(adev, reg0, reg1,
87− ref, mask);
88− return;
89− }
90−
91− spin_lock_irqsave(&kiq->ring_lock, flags);
92− amdgpu_ring_alloc(ring, 32);
93− amdgpu_ring_emit_reg_write_reg_wait(ring, reg0, reg1,
94− ref, mask);
95− r = amdgpu_fence_emit_polling(ring, &seq, MAX_KIQ_REG_WAIT);
96− if (r)
97− goto failed_undo;
98−
99− amdgpu_ring_commit(ring);
100− spin_unlock_irqrestore(&kiq->ring_lock, flags);
101−
102− r = amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT);
103−
104− /* don't wait anymore for IRQ context */
105− if (r < 1 && in_interrupt())
106− goto failed_kiq;
107−
108− might_sleep();
109− while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) {
110−
111− msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);
112− r = amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT);
113− }
114−
115− if (cnt > MAX_KIQ_REG_TRY)
116− goto failed_kiq;
117−
118− return;
119−
120−failed_undo:
121− amdgpu_ring_undo(ring);
122− spin_unlock_irqrestore(&kiq->ring_lock, flags);
123−failed_kiq:
124− dev_err(adev->dev, "failed to write reg %x wait reg %x\n", reg0, reg1);
125−}
126−
12774 /**
12875 * amdgpu_virt_request_full_gpu() - request full gpu access
12976 * @adev: amdgpu device.
@@ -303,11 +250,11 @@ static int amdgpu_virt_init_ras_err_handler_data(struct amdgpu_device *adev) · 173 unmodified lines
303250 if (!*data)
304251 goto data_failure;
305252
306− bps = kmalloc_array(align_space, sizeof((*data)->bps), GFP_KERNEL);
253+ bps = kmalloc_array(align_space, sizeof(*(*data)->bps), GFP_KERNEL);
307254 if (!bps)
308255 goto bps_failure;
309256
310− bps_bo = kmalloc_array(align_space, sizeof((*data)->bps_bo), GFP_KERNEL);
257+ bps_bo = kmalloc_array(align_space, sizeof(*(*data)->bps_bo), GFP_KERNEL);
311258 if (!bps_bo)
312259 goto bps_bo_failure;
313260
@@ -340,8 +287,10 @@ static void amdgpu_virt_ras_release_bp(struct amdgpu_device *adev) · 26 unmodified lines
340287
341288 for (i = data->last_reserved - 1; i >= 0; i--) {
342289 bo = data->bps_bo[i];
343− amdgpu_bo_free_kernel(&bo, NULL, NULL);
344− data->bps_bo[i] = bo;
290+ if (bo) {
291+ amdgpu_bo_free_kernel(&bo, NULL, NULL);
292+ data->bps_bo[i] = bo;
293+ }
345294 data->last_reserved = i;
346295 }
347296 }
@@ -381,6 +330,8 @@ static void amdgpu_virt_ras_reserve_bps(struct amdgpu_device *adev) · 33 unmodified lines
381330 {
382331 struct amdgpu_virt *virt = &adev->virt;
383332 struct amdgpu_virt_ras_err_handler_data *data = virt->virt_eh_data;
333+ struct amdgpu_vram_mgr *mgr = &adev->mman.vram_mgr;
334+ struct ttm_resource_manager *man = &mgr->manager;
384335 struct amdgpu_bo *bo = NULL;
385336 uint64_t bp;
386337 int i;
@@ -396,12 +347,18 @@ static void amdgpu_virt_ras_reserve_bps(struct amdgpu_device *adev) · 9 unmodified lines
396347 * 2) a ras bad page has been reserved (duplicate error injection
397348 * for one page);
398349 */
399− if (amdgpu_bo_create_kernel_at(adev, bp << AMDGPU_GPU_PAGE_SHIFT,
400− AMDGPU_GPU_PAGE_SIZE,
401− &bo, NULL))
402− DRM_DEBUG("RAS WARN: reserve vram for retired page %llx fail\n", bp);
403−
404− data->bps_bo[i] = bo;
350+ if (ttm_resource_manager_used(man)) {
351+ amdgpu_vram_mgr_reserve_range(&adev->mman.vram_mgr,
352+ bp << AMDGPU_GPU_PAGE_SHIFT,
353+ AMDGPU_GPU_PAGE_SIZE);
354+ data->bps_bo[i] = NULL;
355+ } else {
356+ if (amdgpu_bo_create_kernel_at(adev, bp << AMDGPU_GPU_PAGE_SHIFT,
357+ AMDGPU_GPU_PAGE_SIZE,
358+ &bo, NULL))
359+ DRM_DEBUG("RAS WARN: reserve vram for retired page %llx fail\n", bp);
360+ data->bps_bo[i] = bo;
361+ }
405362 data->last_reserved = i + 1;
406363 bo = NULL;
407364 }
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h+2−5
@@ -88,7 +88,8 @@ struct amdgpu_virt_ops { · 87 unmodified lines
8888 int (*wait_reset)(struct amdgpu_device *adev);
8989 void (*trans_msg)(struct amdgpu_device *adev, enum idh_request req,
9090 u32 data1, u32 data2, u32 data3);
91− void (*ras_poison_handler)(struct amdgpu_device *adev);
91+ void (*ras_poison_handler)(struct amdgpu_device *adev,
92+ enum amdgpu_ras_block block);
9293 };
9394
9495 /*
@@ -332,10 +333,6 @@ static inline bool is_virtual_machine(void) · 237 unmodified lines
332333 ((adev)->virt.gim_feature & AMDGIM_FEATURE_VCN_RB_DECOUPLE)
333334 bool amdgpu_virt_mmio_blocked(struct amdgpu_device *adev);
334335 void amdgpu_virt_init_setting(struct amdgpu_device *adev);
335−void amdgpu_virt_kiq_reg_write_reg_wait(struct amdgpu_device *adev,
336− uint32_t reg0, uint32_t rreg1,
337− uint32_t ref, uint32_t mask,
338− uint32_t xcc_inst);
339336 int amdgpu_virt_request_full_gpu(struct amdgpu_device *adev, bool init);
340337 int amdgpu_virt_release_full_gpu(struct amdgpu_device *adev, bool init);
341338 int amdgpu_virt_reset_gpu(struct amdgpu_device *adev);
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c+1−2
@@ -660,8 +660,7 @@ static const struct amd_ip_funcs amdgpu_vkms_ip_funcs = { · 659 unmodified lines
660660 .set_powergating_state = amdgpu_vkms_set_powergating_state,
661661 };
662662
663−const struct amdgpu_ip_block_version amdgpu_vkms_ip_block =
664−{
663+const struct amdgpu_ip_block_version amdgpu_vkms_ip_block = {
665664 .type = AMD_IP_BLOCK_TYPE_DCE,
666665 .major = 1,
667666 .minor = 0,
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c+61−8
@@ -233,6 +233,22 @@ static void amdgpu_vm_bo_invalidated(struct amdgpu_vm_bo_base *vm_bo) · 232 unmodified lines
233233 spin_unlock(&vm_bo->vm->status_lock);
234234 }
235235
236+/**
237+ * amdgpu_vm_bo_evicted_user - vm_bo is evicted
238+ *
239+ * @vm_bo: vm_bo which is evicted
240+ *
241+ * State for BOs used by user mode queues which are not at the location they
242+ * should be.
243+ */
244+static void amdgpu_vm_bo_evicted_user(struct amdgpu_vm_bo_base *vm_bo)
245+{
246+ vm_bo->moved = true;
247+ spin_lock(&vm_bo->vm->status_lock);
248+ list_move(&vm_bo->vm_status, &vm_bo->vm->evicted_user);
249+ spin_unlock(&vm_bo->vm->status_lock);
250+}
251+
236252 /**
237253 * amdgpu_vm_bo_relocated - vm_bo is reloacted
238254 *
@@ -427,21 +443,25 @@ uint64_t amdgpu_vm_generation(struct amdgpu_device *adev, struct amdgpu_vm *vm) · 188 unmodified lines
427443 }
428444
429445 /**
430− * amdgpu_vm_validate_pt_bos - validate the page table BOs
446+ * amdgpu_vm_validate - validate evicted BOs tracked in the VM
431447 *
432448 * @adev: amdgpu device pointer
433449 * @vm: vm providing the BOs
450+ * @ticket: optional reservation ticket used to reserve the VM
434451 * @validate: callback to do the validation
435452 * @param: parameter for the validation callback
436453 *
437− * Validate the page table BOs on command submission if neccessary.
454+ * Validate the page table BOs and per-VM BOs on command submission if
455+ * necessary. If a ticket is given, also try to validate evicted user queue
456+ * BOs. They must already be reserved with the given ticket.
438457 *
439458 * Returns:
440459 * Validation result.
441460 */
442−int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, struct amdgpu_vm *vm,
443− int (*validate)(void *p, struct amdgpu_bo *bo),
444− void *param)
461+int amdgpu_vm_validate(struct amdgpu_device *adev, struct amdgpu_vm *vm,
462+ struct ww_acquire_ctx *ticket,
463+ int (*validate)(void *p, struct amdgpu_bo *bo),
464+ void *param)
445465 {
446466 struct amdgpu_vm_bo_base *bo_base;
447467 struct amdgpu_bo *shadow;
@@ -484,6 +504,28 @@ int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, struct amdgpu_vm *vm, · 36 unmodified lines
484504 }
485505 spin_lock(&vm->status_lock);
486506 }
507+ while (ticket && !list_empty(&vm->evicted_user)) {
508+ bo_base = list_first_entry(&vm->evicted_user,
509+ struct amdgpu_vm_bo_base,
510+ vm_status);
511+ spin_unlock(&vm->status_lock);
512+
513+ bo = bo_base->bo;
514+
515+ if (dma_resv_locking_ctx(bo->tbo.base.resv) != ticket) {
516+ pr_warn_ratelimited("Evicted user BO is not reserved in pid %d\n",
517+ vm->task_info.pid);
518+ return -EINVAL;
519+ }
520+
521+ r = validate(param, bo);
522+ if (r)
523+ return r;
524+
525+ amdgpu_vm_bo_invalidated(bo_base);
526+
527+ spin_lock(&vm->status_lock);
528+ }
487529 spin_unlock(&vm->status_lock);
488530
489531 amdgpu_vm_eviction_lock(vm);
@@ -651,7 +693,7 @@ int amdgpu_vm_flush(struct amdgpu_ring *ring, struct amdgpu_job *job, · 161 unmodified lines
651693 amdgpu_gmc_emit_pasid_mapping(ring, job->vmid, job->pasid);
652694
653695 if (spm_update_needed && adev->gfx.rlc.funcs->update_spm_vmid)
654− adev->gfx.rlc.funcs->update_spm_vmid(adev, job->vmid);
696+ adev->gfx.rlc.funcs->update_spm_vmid(adev, ring, job->vmid);
655697
656698 if (!ring->is_mes_queue && ring->funcs->emit_gds_switch &&
657699 gds_switch_needed) {
@@ -1426,11 +1468,21 @@ int amdgpu_vm_handle_moved(struct amdgpu_device *adev, · 768 unmodified lines
14261468 }
14271469
14281470 r = amdgpu_vm_bo_update(adev, bo_va, clear);
1429− if (r)
1430− return r;
14311471
14321472 if (unlock)
14331473 dma_resv_unlock(resv);
1474+ if (r)
1475+ return r;
1476+
1477+ /* Remember evicted DMABuf imports in compute VMs for later
1478+ * validation
1479+ */
1480+ if (vm->is_compute_context &&
1481+ bo_va->base.bo->tbo.base.import_attach &&
1482+ (!bo_va->base.bo->tbo.resource ||
1483+ bo_va->base.bo->tbo.resource->mem_type == TTM_PL_SYSTEM))
1484+ amdgpu_vm_bo_evicted_user(&bo_va->base);
1485+
14341486 spin_lock(&vm->status_lock);
14351487 }
14361488 spin_unlock(&vm->status_lock);
@@ -2196,6 +2248,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, · 759 unmodified lines
21962248 for (i = 0; i < AMDGPU_MAX_VMHUBS; i++)
21972249 vm->reserved_vmid[i] = NULL;
21982250 INIT_LIST_HEAD(&vm->evicted);
2251+ INIT_LIST_HEAD(&vm->evicted_user);
21992252 INIT_LIST_HEAD(&vm->relocated);
22002253 INIT_LIST_HEAD(&vm->moved);
22012254 INIT_LIST_HEAD(&vm->idle);
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h+13−5
@@ -136,7 +136,11 @@ struct amdgpu_mem_stats; · 135 unmodified lines
136136 #define AMDGPU_IS_MMHUB1(x) ((x) >= AMDGPU_MMHUB1_START && (x) < AMDGPU_MAX_VMHUBS)
137137
138138 /* Reserve 2MB at top/bottom of address space for kernel use */
139−#define AMDGPU_VA_RESERVED_SIZE (2ULL << 20)
139+#define AMDGPU_VA_RESERVED_CSA_SIZE (2ULL << 20)
140+#define AMDGPU_VA_RESERVED_SEQ64_SIZE (2ULL << 20)
141+#define AMDGPU_VA_RESERVED_BOTTOM (2ULL << 20)
142+#define AMDGPU_VA_RESERVED_TOP (AMDGPU_VA_RESERVED_SEQ64_SIZE + \
143+ AMDGPU_VA_RESERVED_CSA_SIZE)
140144
141145 /* See vm_update_mode */
142146 #define AMDGPU_VM_USE_CPU_FOR_GFX (1 << 0)
@@ -288,9 +292,12 @@ struct amdgpu_vm { · 145 unmodified lines
288292 /* Lock to protect vm_bo add/del/move on all lists of vm */
289293 spinlock_t status_lock;
290294
291− /* BOs who needs a validation */
295+ /* Per-VM and PT BOs who needs a validation */
292296 struct list_head evicted;
293297
298+ /* BOs for user mode queues that need a validation */
299+ struct list_head evicted_user;
300+
294301 /* PT BOs which relocated and their parent need an update */
295302 struct list_head relocated;
296303
@@ -434,9 +441,10 @@ int amdgpu_vm_lock_pd(struct amdgpu_vm *vm, struct drm_exec *exec, · 137 unmodified lines
434441 unsigned int num_fences);
435442 bool amdgpu_vm_ready(struct amdgpu_vm *vm);
436443 uint64_t amdgpu_vm_generation(struct amdgpu_device *adev, struct amdgpu_vm *vm);
437−int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, struct amdgpu_vm *vm,
438− int (*callback)(void *p, struct amdgpu_bo *bo),
439− void *param);
444+int amdgpu_vm_validate(struct amdgpu_device *adev, struct amdgpu_vm *vm,
445+ struct ww_acquire_ctx *ticket,
446+ int (*callback)(void *p, struct amdgpu_bo *bo),
447+ void *param);
440448 int amdgpu_vm_flush(struct amdgpu_ring *ring, struct amdgpu_job *job, bool need_pipe_sync);
441449 int amdgpu_vm_update_pdes(struct amdgpu_device *adev,
442450 struct amdgpu_vm *vm, bool immediate);
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c+16−1
@@ -221,8 +221,23 @@ static struct attribute *amdgpu_vram_mgr_attributes[] = { · 220 unmodified lines
221221 NULL
222222 };
223223
224+static umode_t amdgpu_vram_attrs_is_visible(struct kobject *kobj,
225+ struct attribute *attr, int i)
226+{
227+ struct device *dev = kobj_to_dev(kobj);
228+ struct drm_device *ddev = dev_get_drvdata(dev);
229+ struct amdgpu_device *adev = drm_to_adev(ddev);
230+
231+ if (attr == &dev_attr_mem_info_vram_vendor.attr &&
232+ !adev->gmc.vram_vendor)
233+ return 0;
234+
235+ return attr->mode;
236+}
237+
224238 const struct attribute_group amdgpu_vram_mgr_attr_group = {
225− .attrs = amdgpu_vram_mgr_attributes
239+ .attrs = amdgpu_vram_mgr_attributes,
240+ .is_visible = amdgpu_vram_attrs_is_visible
226241 };
227242
228243 /**
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c+70−11
@@ -1035,15 +1035,74 @@ int amdgpu_xgmi_remove_device(struct amdgpu_device *adev) · 1034 unmodified lines
10351035 return 0;
10361036 }
10371037
1038+static int xgmi_v6_4_0_aca_bank_generate_report(struct aca_handle *handle, struct aca_bank *bank, enum aca_error_type type,
1039+ struct aca_bank_report *report, void *data)
1040+{
1041+ struct amdgpu_device *adev = handle->adev;
1042+ const char *error_str;
1043+ u64 status;
1044+ int ret, ext_error_code;
1045+
1046+ ret = aca_bank_info_decode(bank, &report->info);
1047+ if (ret)
1048+ return ret;
1049+
1050+ status = bank->regs[ACA_REG_IDX_STATUS];
1051+ ext_error_code = ACA_REG__STATUS__ERRORCODEEXT(status);
1052+
1053+ error_str = ext_error_code < ARRAY_SIZE(xgmi_v6_4_0_ras_error_code_ext) ?
1054+ xgmi_v6_4_0_ras_error_code_ext[ext_error_code] : NULL;
1055+ if (error_str)
1056+ dev_info(adev->dev, "%s detected\n", error_str);
1057+
1058+ if ((type == ACA_ERROR_TYPE_UE && ext_error_code == 0) ||
1059+ (type == ACA_ERROR_TYPE_CE && ext_error_code == 6))
1060+ report->count[type] = ACA_REG__MISC0__ERRCNT(bank->regs[ACA_REG_IDX_MISC0]);
1061+
1062+ return 0;
1063+}
1064+
1065+static const struct aca_bank_ops xgmi_v6_4_0_aca_bank_ops = {
1066+ .aca_bank_generate_report = xgmi_v6_4_0_aca_bank_generate_report,
1067+};
1068+
1069+static const struct aca_info xgmi_v6_4_0_aca_info = {
1070+ .hwip = ACA_HWIP_TYPE_PCS_XGMI,
1071+ .mask = ACA_ERROR_UE_MASK | ACA_ERROR_CE_MASK,
1072+ .bank_ops = &xgmi_v6_4_0_aca_bank_ops,
1073+};
1074+
10381075 static int amdgpu_xgmi_ras_late_init(struct amdgpu_device *adev, struct ras_common_if *ras_block)
10391076 {
1077+ int r;
1078+
10401079 if (!adev->gmc.xgmi.supported ||
10411080 adev->gmc.xgmi.num_physical_nodes == 0)
10421081 return 0;
10431082
10441083 amdgpu_ras_reset_error_count(adev, AMDGPU_RAS_BLOCK__XGMI_WAFL);
10451084
1046− return amdgpu_ras_block_late_init(adev, ras_block);
1085+ r = amdgpu_ras_block_late_init(adev, ras_block);
1086+ if (r)
1087+ return r;
1088+
1089+ switch (amdgpu_ip_version(adev, XGMI_HWIP, 0)) {
1090+ case IP_VERSION(6, 4, 0):
1091+ r = amdgpu_ras_bind_aca(adev, AMDGPU_RAS_BLOCK__XGMI_WAFL,
1092+ &xgmi_v6_4_0_aca_info, NULL);
1093+ if (r)
1094+ goto late_fini;
1095+ break;
1096+ default:
1097+ break;
1098+ }
1099+
1100+ return 0;
1101+
1102+late_fini:
1103+ amdgpu_ras_block_late_fini(adev, ras_block);
1104+
1105+ return r;
10471106 }
10481107
10491108 uint64_t amdgpu_xgmi_get_relative_phy_addr(struct amdgpu_device *adev,
@@ -1099,7 +1158,7 @@ static void amdgpu_xgmi_legacy_reset_ras_error_count(struct amdgpu_device *adev) · 49 unmodified lines
10991158
11001159 static void __xgmi_v6_4_0_reset_error_count(struct amdgpu_device *adev, int xgmi_inst, u64 mca_base)
11011160 {
1102− WREG64_MCA(xgmi_inst, mca_base, MCA_REG_IDX_STATUS, 0ULL);
1161+ WREG64_MCA(xgmi_inst, mca_base, ACA_REG_IDX_STATUS, 0ULL);
11031162 }
11041163
11051164 static void xgmi_v6_4_0_reset_error_count(struct amdgpu_device *adev, int xgmi_inst)
@@ -1277,12 +1336,12 @@ static void amdgpu_xgmi_legacy_query_ras_error_count(struct amdgpu_device *adev, · 171 unmodified lines
12771336 err_data->ce_count += ce_cnt;
12781337 }
12791338
1280−static enum amdgpu_mca_error_type xgmi_v6_4_0_pcs_mca_get_error_type(struct amdgpu_device *adev, u64 status)
1339+static enum aca_error_type xgmi_v6_4_0_pcs_mca_get_error_type(struct amdgpu_device *adev, u64 status)
12811340 {
12821341 const char *error_str;
12831342 int ext_error_code;
12841343
1285− ext_error_code = MCA_REG__STATUS__ERRORCODEEXT(status);
1344+ ext_error_code = ACA_REG__STATUS__ERRORCODEEXT(status);
12861345
12871346 error_str = ext_error_code < ARRAY_SIZE(xgmi_v6_4_0_ras_error_code_ext) ?
12881347 xgmi_v6_4_0_ras_error_code_ext[ext_error_code] : NULL;
@@ -1291,9 +1350,9 @@ static enum amdgpu_mca_error_type xgmi_v6_4_0_pcs_mca_get_error_type(struct amdg · 2 unmodified lines
12911350
12921351 switch (ext_error_code) {
12931352 case 0:
1294− return AMDGPU_MCA_ERROR_TYPE_UE;
1353+ return ACA_ERROR_TYPE_UE;
12951354 case 6:
1296− return AMDGPU_MCA_ERROR_TYPE_CE;
1355+ return ACA_ERROR_TYPE_CE;
12971356 default:
12981357 return -EINVAL;
12991358 }
@@ -1307,22 +1366,22 @@ static void __xgmi_v6_4_0_query_error_count(struct amdgpu_device *adev, struct a · 7 unmodified lines
13071366 int xgmi_inst = mcm_info->die_id;
13081367 u64 status = 0;
13091368
1310− status = RREG64_MCA(xgmi_inst, mca_base, MCA_REG_IDX_STATUS);
1311− if (!MCA_REG__STATUS__VAL(status))
1369+ status = RREG64_MCA(xgmi_inst, mca_base, ACA_REG_IDX_STATUS);
1370+ if (!ACA_REG__STATUS__VAL(status))
13121371 return;
13131372
13141373 switch (xgmi_v6_4_0_pcs_mca_get_error_type(adev, status)) {
1315− case AMDGPU_MCA_ERROR_TYPE_UE:
1374+ case ACA_ERROR_TYPE_UE:
13161375 amdgpu_ras_error_statistic_ue_count(err_data, mcm_info, NULL, 1ULL);
13171376 break;
1318− case AMDGPU_MCA_ERROR_TYPE_CE:
1377+ case ACA_ERROR_TYPE_CE:
13191378 amdgpu_ras_error_statistic_ce_count(err_data, mcm_info, NULL, 1ULL);
13201379 break;
13211380 default:
13221381 break;
13231382 }
13241383
1325− WREG64_MCA(xgmi_inst, mca_base, MCA_REG_IDX_STATUS, 0ULL);
1384+ WREG64_MCA(xgmi_inst, mca_base, ACA_REG_IDX_STATUS, 0ULL);
13261385 }
13271386
13281387 static void xgmi_v6_4_0_query_error_count(struct amdgpu_device *adev, int xgmi_inst, struct ras_err_data *err_data)
drivers/gpu/drm/amd/amdgpu/atom.c+30−11
@@ -62,6 +62,7 @@ · 61 unmodified lines
6262 typedef struct {
6363 struct atom_context *ctx;
6464 uint32_t *ps, *ws;
65+ int ps_size, ws_size;
6566 int ps_shift;
6667 uint16_t start;
6768 unsigned last_jump;
@@ -70,8 +71,8 @@ typedef struct { · 2 unmodified lines
7071 } atom_exec_context;
7172
7273 int amdgpu_atom_debug;
73−static int amdgpu_atom_execute_table_locked(struct atom_context *ctx, int index, uint32_t *params);
74−int amdgpu_atom_execute_table(struct atom_context *ctx, int index, uint32_t *params);
74+static int amdgpu_atom_execute_table_locked(struct atom_context *ctx, int index, uint32_t *params, int params_size);
75+int amdgpu_atom_execute_table(struct atom_context *ctx, int index, uint32_t *params, int params_size);
7576
7677 static uint32_t atom_arg_mask[8] =
7778 { 0xFFFFFFFF, 0xFFFF, 0xFFFF00, 0xFFFF0000, 0xFF, 0xFF00, 0xFF0000,
@@ -223,7 +224,10 @@ static uint32_t atom_get_src_int(atom_exec_context *ctx, uint8_t attr, · 145 unmodified lines
223224 (*ptr)++;
224225 /* get_unaligned_le32 avoids unaligned accesses from atombios
225226 * tables, noticed on a DEC Alpha. */
226− val = get_unaligned_le32((u32 *)&ctx->ps[idx]);
227+ if (idx < ctx->ps_size)
228+ val = get_unaligned_le32((u32 *)&ctx->ps[idx]);
229+ else
230+ pr_info("PS index out of range: %i > %i\n", idx, ctx->ps_size);
227231 if (print)
228232 DEBUG("PS[0x%02X,0x%04X]", idx, val);
229233 break;
@@ -261,7 +265,10 @@ static uint32_t atom_get_src_int(atom_exec_context *ctx, uint8_t attr, · 31 unmodified lines
261265 val = gctx->reg_block;
262266 break;
263267 default:
264− val = ctx->ws[idx];
268+ if (idx < ctx->ws_size)
269+ val = ctx->ws[idx];
270+ else
271+ pr_info("WS index out of range: %i > %i\n", idx, ctx->ws_size);
265272 }
266273 break;
267274 case ATOM_ARG_ID:
@@ -495,6 +502,10 @@ static void atom_put_dst(atom_exec_context *ctx, int arg, uint8_t attr, · 227 unmodified lines
495502 idx = U8(*ptr);
496503 (*ptr)++;
497504 DEBUG("PS[0x%02X]", idx);
505+ if (idx >= ctx->ps_size) {
506+ pr_info("PS index out of range: %i > %i\n", idx, ctx->ps_size);
507+ return;
508+ }
498509 ctx->ps[idx] = cpu_to_le32(val);
499510 break;
500511 case ATOM_ARG_WS:
@@ -527,6 +538,10 @@ static void atom_put_dst(atom_exec_context *ctx, int arg, uint8_t attr, · 26 unmodified lines
527538 gctx->reg_block = val;
528539 break;
529540 default:
541+ if (idx >= ctx->ws_size) {
542+ pr_info("WS index out of range: %i > %i\n", idx, ctx->ws_size);
543+ return;
544+ }
530545 ctx->ws[idx] = val;
531546 }
532547 break;
@@ -624,7 +639,7 @@ static void atom_op_calltable(atom_exec_context *ctx, int *ptr, int arg) · 91 unmodified lines
624639 else
625640 SDEBUG(" table: %d\n", idx);
626641 if (U16(ctx->ctx->cmd_table + 4 + 2 * idx))
627− r = amdgpu_atom_execute_table_locked(ctx->ctx, idx, ctx->ps + ctx->ps_shift);
642+ r = amdgpu_atom_execute_table_locked(ctx->ctx, idx, ctx->ps + ctx->ps_shift, ctx->ps_size - ctx->ps_shift);
628643 if (r) {
629644 ctx->abort = true;
630645 }
@@ -1203,7 +1218,7 @@ static struct { · 572 unmodified lines
12031218 atom_op_div32, ATOM_ARG_WS},
12041219 };
12051220
1206−static int amdgpu_atom_execute_table_locked(struct atom_context *ctx, int index, uint32_t *params)
1221+static int amdgpu_atom_execute_table_locked(struct atom_context *ctx, int index, uint32_t *params, int params_size)
12071222 {
12081223 int base = CU16(ctx->cmd_table + 4 + 2 * index);
12091224 int len, ws, ps, ptr;
@@ -1225,12 +1240,16 @@ static int amdgpu_atom_execute_table_locked(struct atom_context *ctx, int index, · 15 unmodified lines
12251240 ectx.ps_shift = ps / 4;
12261241 ectx.start = base;
12271242 ectx.ps = params;
1243+ ectx.ps_size = params_size;
12281244 ectx.abort = false;
12291245 ectx.last_jump = 0;
1230− if (ws)
1246+ if (ws) {
12311247 ectx.ws = kcalloc(4, ws, GFP_KERNEL);
1232− else
1248+ ectx.ws_size = ws;
1249+ } else {
12331250 ectx.ws = NULL;
1251+ ectx.ws_size = 0;
1252+ }
12341253
12351254 debug_depth++;
12361255 while (1) {
@@ -1264,7 +1283,7 @@ free: · 27 unmodified lines
12641283 return ret;
12651284 }
12661285
1267−int amdgpu_atom_execute_table(struct atom_context *ctx, int index, uint32_t *params)
1286+int amdgpu_atom_execute_table(struct atom_context *ctx, int index, uint32_t *params, int params_size)
12681287 {
12691288 int r;
12701289
@@ -1280,7 +1299,7 @@ int amdgpu_atom_execute_table(struct atom_context *ctx, int index, uint32_t *par · 9 unmodified lines
12801299 /* reset divmul */
12811300 ctx->divmul[0] = 0;
12821301 ctx->divmul[1] = 0;
1283− r = amdgpu_atom_execute_table_locked(ctx, index, params);
1302+ r = amdgpu_atom_execute_table_locked(ctx, index, params, params_size);
12841303 mutex_unlock(&ctx->mutex);
12851304 return r;
12861305 }
@@ -1552,7 +1571,7 @@ int amdgpu_atom_asic_init(struct atom_context *ctx) · 265 unmodified lines
15521571
15531572 if (!CU16(ctx->cmd_table + 4 + 2 * ATOM_CMD_INIT))
15541573 return 1;
1555− ret = amdgpu_atom_execute_table(ctx, ATOM_CMD_INIT, ps);
1574+ ret = amdgpu_atom_execute_table(ctx, ATOM_CMD_INIT, ps, 16);
15561575 if (ret)
15571576 return ret;
15581577
drivers/gpu/drm/amd/amdgpu/atom.h+1−1
@@ -156,7 +156,7 @@ struct atom_context { · 155 unmodified lines
156156 extern int amdgpu_atom_debug;
157157
158158 struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios);
159−int amdgpu_atom_execute_table(struct atom_context *ctx, int index, uint32_t *params);
159+int amdgpu_atom_execute_table(struct atom_context *ctx, int index, uint32_t *params, int params_size);
160160 int amdgpu_atom_asic_init(struct atom_context *ctx);
161161 void amdgpu_atom_destroy(struct atom_context *ctx);
162162 bool amdgpu_atom_parse_data_header(struct atom_context *ctx, int index, uint16_t *size,
drivers/gpu/drm/amd/amdgpu/atombios_crtc.c+14−14
@@ -77,7 +77,7 @@ void amdgpu_atombios_crtc_overscan_setup(struct drm_crtc *crtc, · 76 unmodified lines
7777 args.usOverscanTop = cpu_to_le16(amdgpu_crtc->v_border);
7878 break;
7979 }
80− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
80+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
8181 }
8282
8383 void amdgpu_atombios_crtc_scaler_setup(struct drm_crtc *crtc)
@@ -106,7 +106,7 @@ void amdgpu_atombios_crtc_scaler_setup(struct drm_crtc *crtc) · 22 unmodified lines
106106 args.ucEnable = ATOM_SCALER_DISABLE;
107107 break;
108108 }
109− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
109+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
110110 }
111111
112112 void amdgpu_atombios_crtc_lock(struct drm_crtc *crtc, int lock)
@@ -123,7 +123,7 @@ void amdgpu_atombios_crtc_lock(struct drm_crtc *crtc, int lock) · 10 unmodified lines
123123 args.ucCRTC = amdgpu_crtc->crtc_id;
124124 args.ucEnable = lock;
125125
126− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
126+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
127127 }
128128
129129 void amdgpu_atombios_crtc_enable(struct drm_crtc *crtc, int state)
@@ -139,7 +139,7 @@ void amdgpu_atombios_crtc_enable(struct drm_crtc *crtc, int state) · 9 unmodified lines
139139 args.ucCRTC = amdgpu_crtc->crtc_id;
140140 args.ucEnable = state;
141141
142− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
142+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
143143 }
144144
145145 void amdgpu_atombios_crtc_blank(struct drm_crtc *crtc, int state)
@@ -155,7 +155,7 @@ void amdgpu_atombios_crtc_blank(struct drm_crtc *crtc, int state) · 9 unmodified lines
155155 args.ucCRTC = amdgpu_crtc->crtc_id;
156156 args.ucBlanking = state;
157157
158− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
158+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
159159 }
160160
161161 void amdgpu_atombios_crtc_powergate(struct drm_crtc *crtc, int state)
@@ -171,7 +171,7 @@ void amdgpu_atombios_crtc_powergate(struct drm_crtc *crtc, int state) · 9 unmodified lines
171171 args.ucDispPipeId = amdgpu_crtc->crtc_id;
172172 args.ucEnable = state;
173173
174− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
174+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
175175 }
176176
177177 void amdgpu_atombios_crtc_powergate_init(struct amdgpu_device *adev)
@@ -183,7 +183,7 @@ void amdgpu_atombios_crtc_powergate_init(struct amdgpu_device *adev) · 5 unmodified lines
183183
184184 args.ucEnable = ATOM_INIT;
185185
186− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
186+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
187187 }
188188
189189 void amdgpu_atombios_crtc_set_dtd_timing(struct drm_crtc *crtc,
@@ -228,7 +228,7 @@ void amdgpu_atombios_crtc_set_dtd_timing(struct drm_crtc *crtc, · 38 unmodified lines
228228 args.susModeMiscInfo.usAccess = cpu_to_le16(misc);
229229 args.ucCRTC = amdgpu_crtc->crtc_id;
230230
231− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
231+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
232232 }
233233
234234 union atom_enable_ss {
@@ -293,7 +293,7 @@ static void amdgpu_atombios_crtc_program_ss(struct amdgpu_device *adev, · 58 unmodified lines
293293 args.v3.usSpreadSpectrumStep = cpu_to_le16(ss->step);
294294 args.v3.ucEnable = enable;
295295
296− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
296+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
297297 }
298298
299299 union adjust_pixel_clock {
@@ -395,7 +395,7 @@ static u32 amdgpu_atombios_crtc_adjust_pll(struct drm_crtc *crtc, · 95 unmodified lines
395395 ADJUST_DISPLAY_CONFIG_SS_ENABLE;
396396
397397 amdgpu_atom_execute_table(adev->mode_info.atom_context,
398− index, (uint32_t *)&args);
398+ index, (uint32_t *)&args, sizeof(args));
399399 adjusted_clock = le16_to_cpu(args.v1.usPixelClock) * 10;
400400 break;
401401 case 3:
@@ -428,7 +428,7 @@ static u32 amdgpu_atombios_crtc_adjust_pll(struct drm_crtc *crtc, · 26 unmodified lines
428428 args.v3.sInput.ucExtTransmitterID = 0;
429429
430430 amdgpu_atom_execute_table(adev->mode_info.atom_context,
431− index, (uint32_t *)&args);
431+ index, (uint32_t *)&args, sizeof(args));
432432 adjusted_clock = le32_to_cpu(args.v3.sOutput.ulDispPllFreq) * 10;
433433 if (args.v3.sOutput.ucRefDiv) {
434434 amdgpu_crtc->pll_flags |= AMDGPU_PLL_USE_FRAC_FB_DIV;
@@ -514,7 +514,7 @@ void amdgpu_atombios_crtc_set_disp_eng_pll(struct amdgpu_device *adev, · 79 unmodified lines
514514 DRM_ERROR("Unknown table version %d %d\n", frev, crev);
515515 return;
516516 }
517− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
517+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
518518 }
519519
520520 union set_dce_clock {
@@ -544,7 +544,7 @@ u32 amdgpu_atombios_crtc_set_dce_clock(struct amdgpu_device *adev, · 23 unmodified lines
544544 args.v2_1.asParam.ulDCEClkFreq = cpu_to_le32(freq); /* 10kHz units */
545545 args.v2_1.asParam.ucDCEClkType = clk_type;
546546 args.v2_1.asParam.ucDCEClkSrc = clk_src;
547− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
547+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
548548 ret_freq = le32_to_cpu(args.v2_1.asParam.ulDCEClkFreq) * 10;
549549 break;
550550 default:
@@ -740,7 +740,7 @@ void amdgpu_atombios_crtc_program_pll(struct drm_crtc *crtc, · 189 unmodified lines
740740 return;
741741 }
742742
743− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
743+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
744744 }
745745
746746 int amdgpu_atombios_crtc_prepare_pll(struct drm_crtc *crtc,
drivers/gpu/drm/amd/amdgpu/atombios_dp.c+2−2
@@ -83,7 +83,7 @@ static int amdgpu_atombios_dp_process_aux_ch(struct amdgpu_i2c_chan *chan, · 82 unmodified lines
8383 args.v2.ucDelay = delay / 10;
8484 args.v2.ucHPD_ID = chan->rec.hpd;
8585
86− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
86+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
8787
8888 *ack = args.v2.ucReplyStatus;
8989
@@ -301,7 +301,7 @@ static u8 amdgpu_atombios_dp_encoder_service(struct amdgpu_device *adev, · 211 unmodified lines
301301 args.ucLaneNum = lane_num;
302302 args.ucStatus = 0;
303303
304− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
304+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
305305 return args.ucStatus;
306306 }
307307
drivers/gpu/drm/amd/amdgpu/atombios_encoders.c+8−8
@@ -335,7 +335,7 @@ amdgpu_atombios_encoder_setup_dac(struct drm_encoder *encoder, int action) · 334 unmodified lines
335335 args.ucDacStandard = ATOM_DAC1_PS2;
336336 args.usPixelClock = cpu_to_le16(amdgpu_encoder->pixel_clock / 10);
337337
338− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
338+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
339339
340340 }
341341
@@ -432,7 +432,7 @@ amdgpu_atombios_encoder_setup_dvo(struct drm_encoder *encoder, int action) · 90 unmodified lines
432432 break;
433433 }
434434
435− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
435+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
436436 }
437437
438438 int amdgpu_atombios_encoder_get_encoder_mode(struct drm_encoder *encoder)
@@ -732,7 +732,7 @@ amdgpu_atombios_encoder_setup_dig_encoder(struct drm_encoder *encoder, · 293 unmodified lines
732732 break;
733733 }
734734
735− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
735+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
736736
737737 }
738738
@@ -1136,7 +1136,7 @@ amdgpu_atombios_encoder_setup_dig_transmitter(struct drm_encoder *encoder, int a · 397 unmodified lines
11361136 break;
11371137 }
11381138
1139− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
1139+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
11401140 }
11411141
11421142 bool
@@ -1164,7 +1164,7 @@ amdgpu_atombios_encoder_set_edp_panel_power(struct drm_connector *connector, · 21 unmodified lines
11641164
11651165 args.v1.ucAction = action;
11661166
1167− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
1167+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
11681168
11691169 /* wait for the panel to power up */
11701170 if (action == ATOM_TRANSMITTER_ACTION_POWER_ON) {
@@ -1288,7 +1288,7 @@ amdgpu_atombios_encoder_setup_external_encoder(struct drm_encoder *encoder, · 117 unmodified lines
12881288 DRM_ERROR("Unknown table version: %d, %d\n", frev, crev);
12891289 return;
12901290 }
1291− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
1291+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
12921292 }
12931293
12941294 static void
@@ -1633,7 +1633,7 @@ amdgpu_atombios_encoder_set_crtc_source(struct drm_encoder *encoder) · 338 unmodified lines
16331633 return;
16341634 }
16351635
1636− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
1636+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
16371637 }
16381638
16391639 /* This only needs to be called once at startup */
@@ -1706,7 +1706,7 @@ amdgpu_atombios_encoder_dac_load_detect(struct drm_encoder *encoder, · 66 unmodified lines
17061706 args.sDacload.ucMisc = DAC_LOAD_MISC_YPrPb;
17071707 }
17081708
1709− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
1709+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
17101710
17111711 return true;
17121712 } else
drivers/gpu/drm/amd/amdgpu/atombios_i2c.c+2−2
@@ -86,7 +86,7 @@ static int amdgpu_atombios_i2c_process_i2c_ch(struct amdgpu_i2c_chan *chan, · 85 unmodified lines
8686 args.ucSlaveAddr = slave_addr << 1;
8787 args.ucLineNumber = chan->rec.i2c_id;
8888
89− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
89+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
9090
9191 /* error */
9292 if (args.ucStatus != HW_ASSISTED_I2C_STATUS_SUCCESS) {
@@ -172,5 +172,5 @@ void amdgpu_atombios_i2c_channel_trans(struct amdgpu_device *adev, u8 slave_addr · 79 unmodified lines
172172 args.ucSlaveAddr = slave_addr;
173173 args.ucLineNumber = line_number;
174174
175− amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
175+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args, sizeof(args));
176176 }
drivers/gpu/drm/amd/amdgpu/cik_ih.c+6−0
@@ -204,6 +204,12 @@ static u32 cik_ih_get_wptr(struct amdgpu_device *adev, · 203 unmodified lines
204204 tmp = RREG32(mmIH_RB_CNTL);
205205 tmp |= IH_RB_CNTL__WPTR_OVERFLOW_CLEAR_MASK;
206206 WREG32(mmIH_RB_CNTL, tmp);
207+
208+ /* Unset the CLEAR_OVERFLOW bit immediately so new overflows
209+ * can be detected.
210+ */
211+ tmp &= ~IH_RB_CNTL__WPTR_OVERFLOW_CLEAR_MASK;
212+ WREG32(mmIH_RB_CNTL, tmp);
207213 }
208214 return (wptr & ih->ptr_mask);
209215 }
drivers/gpu/drm/amd/amdgpu/clearstate_gfx9.h+9−18
@@ -21,8 +21,7 @@ · 20 unmodified lines
2121 *
2222 */
2323
24−static const unsigned int gfx9_SECT_CONTEXT_def_1[] =
25−{
24+static const unsigned int gfx9_SECT_CONTEXT_def_1[] = {
2625 0x00000000, // DB_RENDER_CONTROL
2726 0x00000000, // DB_COUNT_CONTROL
2827 0x00000000, // DB_DEPTH_VIEW
@@ -236,8 +235,7 @@ static const unsigned int gfx9_SECT_CONTEXT_def_1[] = · 207 unmodified lines
236235 0x00000000, // PA_SC_VPORT_ZMIN_15
237236 0x3f800000, // PA_SC_VPORT_ZMAX_15
238237 };
239−static const unsigned int gfx9_SECT_CONTEXT_def_2[] =
240−{
238+static const unsigned int gfx9_SECT_CONTEXT_def_2[] = {
241239 0x00000000, // PA_SC_SCREEN_EXTENT_CONTROL
242240 0x00000000, // PA_SC_TILE_STEERING_OVERRIDE
243241 0x00000000, // CP_PERFMON_CNTX_CNTL
@@ -521,15 +519,13 @@ static const unsigned int gfx9_SECT_CONTEXT_def_2[] = · 277 unmodified lines
521519 0x00000000, // CB_MRT6_EPITCH
522520 0x00000000, // CB_MRT7_EPITCH
523521 };
524−static const unsigned int gfx9_SECT_CONTEXT_def_3[] =
525−{
522+static const unsigned int gfx9_SECT_CONTEXT_def_3[] = {
526523 0x00000000, // PA_CL_POINT_X_RAD
527524 0x00000000, // PA_CL_POINT_Y_RAD
528525 0x00000000, // PA_CL_POINT_SIZE
529526 0x00000000, // PA_CL_POINT_CULL_RAD
530527 };
531−static const unsigned int gfx9_SECT_CONTEXT_def_4[] =
532−{
528+static const unsigned int gfx9_SECT_CONTEXT_def_4[] = {
533529 0x00000000, // DB_DEPTH_CONTROL
534530 0x00000000, // DB_EQAA
535531 0x00000000, // CB_COLOR_CONTROL
@@ -688,17 +684,14 @@ static const unsigned int gfx9_SECT_CONTEXT_def_4[] = · 152 unmodified lines
688684 0x00000000, // VGT_GS_OUT_PRIM_TYPE
689685 0x00000000, // IA_ENHANCE
690686 };
691−static const unsigned int gfx9_SECT_CONTEXT_def_5[] =
692−{
687+static const unsigned int gfx9_SECT_CONTEXT_def_5[] = {
693688 0x00000000, // WD_ENHANCE
694689 0x00000000, // VGT_PRIMITIVEID_EN
695690 };
696−static const unsigned int gfx9_SECT_CONTEXT_def_6[] =
697−{
691+static const unsigned int gfx9_SECT_CONTEXT_def_6[] = {
698692 0x00000000, // VGT_PRIMITIVEID_RESET
699693 };
700−static const unsigned int gfx9_SECT_CONTEXT_def_7[] =
701−{
694+static const unsigned int gfx9_SECT_CONTEXT_def_7[] = {
702695 0x00000000, // VGT_GS_MAX_PRIMS_PER_SUBGROUP
703696 0x00000000, // VGT_DRAW_PAYLOAD_CNTL
704697 0, // HOLE
@@ -766,8 +759,7 @@ static const unsigned int gfx9_SECT_CONTEXT_def_7[] = · 61 unmodified lines
766759 0x00000000, // VGT_STRMOUT_CONFIG
767760 0x00000000, // VGT_STRMOUT_BUFFER_CONFIG
768761 };
769−static const unsigned int gfx9_SECT_CONTEXT_def_8[] =
770−{
762+static const unsigned int gfx9_SECT_CONTEXT_def_8[] = {
771763 0x00000000, // PA_SC_CENTROID_PRIORITY_0
772764 0x00000000, // PA_SC_CENTROID_PRIORITY_1
773765 0x00001000, // PA_SC_LINE_CNTL
@@ -924,8 +916,7 @@ static const unsigned int gfx9_SECT_CONTEXT_def_8[] = · 150 unmodified lines
924916 0x00000000, // CB_COLOR7_DCC_BASE
925917 0x00000000, // CB_COLOR7_DCC_BASE_EXT
926918 };
927−static const struct cs_extent_def gfx9_SECT_CONTEXT_defs[] =
928−{
919+static const struct cs_extent_def gfx9_SECT_CONTEXT_defs[] = {
929920 {gfx9_SECT_CONTEXT_def_1, 0x0000a000, 212 },
930921 {gfx9_SECT_CONTEXT_def_2, 0x0000a0d6, 282 },
931922 {gfx9_SECT_CONTEXT_def_3, 0x0000a1f5, 4 },
drivers/gpu/drm/amd/amdgpu/clearstate_si.h+8−16
@@ -21,8 +21,7 @@ · 20 unmodified lines
2121 *
2222 */
2323
24−static const u32 si_SECT_CONTEXT_def_1[] =
25−{
24+static const u32 si_SECT_CONTEXT_def_1[] = {
2625 0x00000000, // DB_RENDER_CONTROL
2726 0x00000000, // DB_COUNT_CONTROL
2827 0x00000000, // DB_DEPTH_VIEW
@@ -236,8 +235,7 @@ static const u32 si_SECT_CONTEXT_def_1[] = · 207 unmodified lines
236235 0x00000000, // PA_SC_VPORT_ZMIN_15
237236 0x3f800000, // PA_SC_VPORT_ZMAX_15
238237 };
239−static const u32 si_SECT_CONTEXT_def_2[] =
240−{
238+static const u32 si_SECT_CONTEXT_def_2[] = {
241239 0x00000000, // CP_PERFMON_CNTX_CNTL
242240 0x00000000, // CP_RINGID
243241 0x00000000, // CP_VMID
@@ -511,8 +509,7 @@ static const u32 si_SECT_CONTEXT_def_2[] = · 267 unmodified lines
511509 0x00000000, // CB_BLEND6_CONTROL
512510 0x00000000, // CB_BLEND7_CONTROL
513511 };
514−static const u32 si_SECT_CONTEXT_def_3[] =
515−{
512+static const u32 si_SECT_CONTEXT_def_3[] = {
516513 0x00000000, // PA_CL_POINT_X_RAD
517514 0x00000000, // PA_CL_POINT_Y_RAD
518515 0x00000000, // PA_CL_POINT_SIZE
@@ -520,8 +517,7 @@ static const u32 si_SECT_CONTEXT_def_3[] = · 1 unmodified line
520517 0x00000000, // VGT_DMA_BASE_HI
521518 0x00000000, // VGT_DMA_BASE
522519 };
523−static const u32 si_SECT_CONTEXT_def_4[] =
524−{
520+static const u32 si_SECT_CONTEXT_def_4[] = {
525521 0x00000000, // DB_DEPTH_CONTROL
526522 0x00000000, // DB_EQAA
527523 0x00000000, // CB_COLOR_CONTROL
@@ -680,16 +676,13 @@ static const u32 si_SECT_CONTEXT_def_4[] = · 152 unmodified lines
680676 0x00000000, // VGT_GS_OUT_PRIM_TYPE
681677 0x00000000, // IA_ENHANCE
682678 };
683−static const u32 si_SECT_CONTEXT_def_5[] =
684−{
679+static const u32 si_SECT_CONTEXT_def_5[] = {
685680 0x00000000, // VGT_PRIMITIVEID_EN
686681 };
687−static const u32 si_SECT_CONTEXT_def_6[] =
688−{
682+static const u32 si_SECT_CONTEXT_def_6[] = {
689683 0x00000000, // VGT_PRIMITIVEID_RESET
690684 };
691−static const u32 si_SECT_CONTEXT_def_7[] =
692−{
685+static const u32 si_SECT_CONTEXT_def_7[] = {
693686 0x00000000, // VGT_MULTI_PRIM_IB_RESET_EN
694687 0, // HOLE
695688 0, // HOLE
@@ -924,8 +917,7 @@ static const u32 si_SECT_CONTEXT_def_7[] = · 228 unmodified lines
924917 0x00000000, // CB_COLOR7_CLEAR_WORD0
925918 0x00000000, // CB_COLOR7_CLEAR_WORD1
926919 };
927−static const struct cs_extent_def si_SECT_CONTEXT_defs[] =
928−{
920+static const struct cs_extent_def si_SECT_CONTEXT_defs[] = {
929921 {si_SECT_CONTEXT_def_1, 0x0000a000, 212 },
930922 {si_SECT_CONTEXT_def_2, 0x0000a0d8, 272 },
931923 {si_SECT_CONTEXT_def_3, 0x0000a1f5, 6 },
drivers/gpu/drm/amd/amdgpu/cz_ih.c+5−0
@@ -216,6 +216,11 @@ static u32 cz_ih_get_wptr(struct amdgpu_device *adev, · 215 unmodified lines
216216 tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);
217217 WREG32(mmIH_RB_CNTL, tmp);
218218
219+ /* Unset the CLEAR_OVERFLOW bit immediately so new overflows
220+ * can be detected.
221+ */
222+ tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 0);
223+ WREG32(mmIH_RB_CNTL, tmp);
219224
220225 out:
221226 return (wptr & ih->ptr_mask);
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c+2−0
@@ -52,6 +52,7 @@ · 51 unmodified lines
5252
5353 static void dce_v10_0_set_display_funcs(struct amdgpu_device *adev);
5454 static void dce_v10_0_set_irq_funcs(struct amdgpu_device *adev);
55+static void dce_v10_0_hpd_int_ack(struct amdgpu_device *adev, int hpd);
5556
5657 static const u32 crtc_offsets[] = {
5758 CRTC0_REGISTER_OFFSET,
@@ -364,6 +365,7 @@ static void dce_v10_0_hpd_init(struct amdgpu_device *adev) · 306 unmodified lines
364365 AMDGPU_HPD_DISCONNECT_INT_DELAY_IN_MS);
365366 WREG32(mmDC_HPD_TOGGLE_FILT_CNTL + hpd_offsets[amdgpu_connector->hpd.hpd], tmp);
366367
368+ dce_v10_0_hpd_int_ack(adev, amdgpu_connector->hpd.hpd);
367369 dce_v10_0_hpd_set_polarity(adev, amdgpu_connector->hpd.hpd);
368370 amdgpu_irq_get(adev, &adev->hpd_irq,
369371 amdgpu_connector->hpd.hpd);
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c+2−0
@@ -52,6 +52,7 @@ · 51 unmodified lines
5252
5353 static void dce_v11_0_set_display_funcs(struct amdgpu_device *adev);
5454 static void dce_v11_0_set_irq_funcs(struct amdgpu_device *adev);
55+static void dce_v11_0_hpd_int_ack(struct amdgpu_device *adev, int hpd);
5556
5657 static const u32 crtc_offsets[] =
5758 {
@@ -388,6 +389,7 @@ static void dce_v11_0_hpd_init(struct amdgpu_device *adev) · 330 unmodified lines
388389 AMDGPU_HPD_DISCONNECT_INT_DELAY_IN_MS);
389390 WREG32(mmDC_HPD_TOGGLE_FILT_CNTL + hpd_offsets[amdgpu_connector->hpd.hpd], tmp);
390391
392+ dce_v11_0_hpd_int_ack(adev, amdgpu_connector->hpd.hpd);
391393 dce_v11_0_hpd_set_polarity(adev, amdgpu_connector->hpd.hpd);
392394 amdgpu_irq_get(adev, &adev->hpd_irq, amdgpu_connector->hpd.hpd);
393395 }
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c+18−4
@@ -273,6 +273,21 @@ static void dce_v6_0_hpd_set_polarity(struct amdgpu_device *adev, · 272 unmodified lines
273273 WREG32(mmDC_HPD1_INT_CONTROL + hpd_offsets[hpd], tmp);
274274 }
275275
276+static void dce_v6_0_hpd_int_ack(struct amdgpu_device *adev,
277+ int hpd)
278+{
279+ u32 tmp;
280+
281+ if (hpd >= adev->mode_info.num_hpd) {
282+ DRM_DEBUG("invalid hdp %d\n", hpd);
283+ return;
284+ }
285+
286+ tmp = RREG32(mmDC_HPD1_INT_CONTROL + hpd_offsets[hpd]);
287+ tmp |= DC_HPD1_INT_CONTROL__DC_HPD1_INT_ACK_MASK;
288+ WREG32(mmDC_HPD1_INT_CONTROL + hpd_offsets[hpd], tmp);
289+}
290+
276291 /**
277292 * dce_v6_0_hpd_init - hpd setup callback.
278293 *
@@ -312,6 +327,7 @@ static void dce_v6_0_hpd_init(struct amdgpu_device *adev) · 33 unmodified lines
312327 continue;
313328 }
314329
330+ dce_v6_0_hpd_int_ack(adev, amdgpu_connector->hpd.hpd);
315331 dce_v6_0_hpd_set_polarity(adev, amdgpu_connector->hpd.hpd);
316332 amdgpu_irq_get(adev, &adev->hpd_irq, amdgpu_connector->hpd.hpd);
317333 }
@@ -3089,7 +3105,7 @@ static int dce_v6_0_hpd_irq(struct amdgpu_device *adev, · 2771 unmodified lines
30893105 struct amdgpu_irq_src *source,
30903106 struct amdgpu_iv_entry *entry)
30913107 {
3092− uint32_t disp_int, mask, tmp;
3108+ uint32_t disp_int, mask;
30933109 unsigned hpd;
30943110
30953111 if (entry->src_data[0] >= adev->mode_info.num_hpd) {
@@ -3102,9 +3118,7 @@ static int dce_v6_0_hpd_irq(struct amdgpu_device *adev, · 6 unmodified lines
31023118 mask = interrupt_status_offsets[hpd].hpd;
31033119
31043120 if (disp_int & mask) {
3105− tmp = RREG32(mmDC_HPD1_INT_CONTROL + hpd_offsets[hpd]);
3106− tmp |= DC_HPD1_INT_CONTROL__DC_HPD1_INT_ACK_MASK;
3107− WREG32(mmDC_HPD1_INT_CONTROL + hpd_offsets[hpd], tmp);
3121+ dce_v6_0_hpd_int_ack(adev, hpd);
31083122 schedule_delayed_work(&adev->hotplug_work, 0);
31093123 DRM_DEBUG("IH: HPD%d\n", hpd + 1);
31103124 }
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c+18−4
@@ -265,6 +265,21 @@ static void dce_v8_0_hpd_set_polarity(struct amdgpu_device *adev, · 264 unmodified lines
265265 WREG32(mmDC_HPD1_INT_CONTROL + hpd_offsets[hpd], tmp);
266266 }
267267
268+static void dce_v8_0_hpd_int_ack(struct amdgpu_device *adev,
269+ int hpd)
270+{
271+ u32 tmp;
272+
273+ if (hpd >= adev->mode_info.num_hpd) {
274+ DRM_DEBUG("invalid hdp %d\n", hpd);
275+ return;
276+ }
277+
278+ tmp = RREG32(mmDC_HPD1_INT_CONTROL + hpd_offsets[hpd]);
279+ tmp |= DC_HPD1_INT_CONTROL__DC_HPD1_INT_ACK_MASK;
280+ WREG32(mmDC_HPD1_INT_CONTROL + hpd_offsets[hpd], tmp);
281+}
282+
268283 /**
269284 * dce_v8_0_hpd_init - hpd setup callback.
270285 *
@@ -304,6 +319,7 @@ static void dce_v8_0_hpd_init(struct amdgpu_device *adev) · 33 unmodified lines
304319 continue;
305320 }
306321
322+ dce_v8_0_hpd_int_ack(adev, amdgpu_connector->hpd.hpd);
307323 dce_v8_0_hpd_set_polarity(adev, amdgpu_connector->hpd.hpd);
308324 amdgpu_irq_get(adev, &adev->hpd_irq, amdgpu_connector->hpd.hpd);
309325 }
@@ -3177,7 +3193,7 @@ static int dce_v8_0_hpd_irq(struct amdgpu_device *adev, · 2867 unmodified lines
31773193 struct amdgpu_irq_src *source,
31783194 struct amdgpu_iv_entry *entry)
31793195 {
3180− uint32_t disp_int, mask, tmp;
3196+ uint32_t disp_int, mask;
31813197 unsigned hpd;
31823198
31833199 if (entry->src_data[0] >= adev->mode_info.num_hpd) {
@@ -3190,9 +3206,7 @@ static int dce_v8_0_hpd_irq(struct amdgpu_device *adev, · 6 unmodified lines
31903206 mask = interrupt_status_offsets[hpd].hpd;
31913207
31923208 if (disp_int & mask) {
3193− tmp = RREG32(mmDC_HPD1_INT_CONTROL + hpd_offsets[hpd]);
3194− tmp |= DC_HPD1_INT_CONTROL__DC_HPD1_INT_ACK_MASK;
3195− WREG32(mmDC_HPD1_INT_CONTROL + hpd_offsets[hpd], tmp);
3209+ dce_v8_0_hpd_int_ack(adev, hpd);
31963210 schedule_delayed_work(&adev->hotplug_work, 0);
31973211 DRM_DEBUG("IH: HPD%d\n", hpd + 1);
31983212 }
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c+2−4
@@ -4027,8 +4027,6 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev) · 4026 unmodified lines
40274027 err = 0;
40284028 adev->gfx.mec2_fw = NULL;
40294029 }
4030− amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_MEC2);
4031− amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_MEC2_JT);
40324030
40334031 gfx_v10_0_check_fw_write_wait(adev);
40344032 out:
@@ -6589,7 +6587,7 @@ static int gfx_v10_0_compute_mqd_init(struct amdgpu_device *adev, void *m, · 2554 unmodified lines
65896587 #ifdef __BIG_ENDIAN
65906588 tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, ENDIAN_SWAP, 1);
65916589 #endif
6592− tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, UNORD_DISPATCH, 0);
6590+ tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, UNORD_DISPATCH, 1);
65936591 tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, TUNNEL_DISPATCH,
65946592 prop->allow_tunneling);
65956593 tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, PRIV_STATE, 1);
@@ -7949,7 +7947,7 @@ static void gfx_v10_0_update_spm_vmid_internal(struct amdgpu_device *adev, · 1353 unmodified lines
79497947 WREG32_SOC15_NO_KIQ(GC, 0, mmRLC_SPM_MC_CNTL, data);
79507948 }
79517949
7952−static void gfx_v10_0_update_spm_vmid(struct amdgpu_device *adev, unsigned int vmid)
7950+static void gfx_v10_0_update_spm_vmid(struct amdgpu_device *adev, struct amdgpu_ring *ring, unsigned int vmid)
79537951 {
79547952 amdgpu_gfx_off_ctrl(adev, false);
79557953
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c+14−26
@@ -107,23 +107,6 @@ static const struct soc15_reg_golden golden_settings_gc_11_0_1[] = · 106 unmodified lines
107107 SOC15_REG_GOLDEN_VALUE(GC, 0, regTCP_CNTL2, 0xfcffffff, 0x0000000a)
108108 };
109109
110−static const struct soc15_reg_golden golden_settings_gc_11_5_0[] = {
111− SOC15_REG_GOLDEN_VALUE(GC, 0, regDB_DEBUG5, 0xffffffff, 0x00000800),
112− SOC15_REG_GOLDEN_VALUE(GC, 0, regGB_ADDR_CONFIG, 0x0c1807ff, 0x00000242),
113− SOC15_REG_GOLDEN_VALUE(GC, 0, regGCR_GENERAL_CNTL, 0x1ff1ffff, 0x00000500),
114− SOC15_REG_GOLDEN_VALUE(GC, 0, regGL2A_ADDR_MATCH_MASK, 0xffffffff, 0xfffffff3),
115− SOC15_REG_GOLDEN_VALUE(GC, 0, regGL2C_ADDR_MATCH_MASK, 0xffffffff, 0xfffffff3),
116− SOC15_REG_GOLDEN_VALUE(GC, 0, regGL2C_CTRL, 0xffffffff, 0xf37fff3f),
117− SOC15_REG_GOLDEN_VALUE(GC, 0, regGL2C_CTRL3, 0xfffffffb, 0x00f40188),
118− SOC15_REG_GOLDEN_VALUE(GC, 0, regGL2C_CTRL4, 0xf0ffffff, 0x80009007),
119− SOC15_REG_GOLDEN_VALUE(GC, 0, regPA_CL_ENHANCE, 0xf1ffffff, 0x00880007),
120− SOC15_REG_GOLDEN_VALUE(GC, 0, regPC_CONFIG_CNTL_1, 0xffffffff, 0x00010000),
121− SOC15_REG_GOLDEN_VALUE(GC, 0, regTA_CNTL_AUX, 0xf7f7ffff, 0x01030000),
122− SOC15_REG_GOLDEN_VALUE(GC, 0, regTA_CNTL2, 0x007f0000, 0x00000000),
123− SOC15_REG_GOLDEN_VALUE(GC, 0, regTCP_CNTL2, 0xffcfffff, 0x0000200a),
124− SOC15_REG_GOLDEN_VALUE(GC, 0, regUTCL1_CTRL_2, 0xffffffff, 0x0000048f)
125−};
126−
127110 #define DEFAULT_SH_MEM_CONFIG \
128111 ((SH_MEM_ADDRESS_MODE_64 << SH_MEM_CONFIG__ADDRESS_MODE__SHIFT) | \
129112 (SH_MEM_ALIGNMENT_MODE_UNALIGNED << SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) | \
@@ -304,11 +287,6 @@ static void gfx_v11_0_init_golden_registers(struct amdgpu_device *adev) · 174 unmodified lines
304287 golden_settings_gc_11_0_1,
305288 (const u32)ARRAY_SIZE(golden_settings_gc_11_0_1));
306289 break;
307− case IP_VERSION(11, 5, 0):
308− soc15_program_register_sequence(adev,
309− golden_settings_gc_11_5_0,
310− (const u32)ARRAY_SIZE(golden_settings_gc_11_5_0));
311− break;
312290 default:
313291 break;
314292 }
@@ -749,7 +727,7 @@ static int gfx_v11_0_rlc_init(struct amdgpu_device *adev) · 434 unmodified lines
749727
750728 /* init spm vmid with 0xf */
751729 if (adev->gfx.rlc.funcs->update_spm_vmid)
752− adev->gfx.rlc.funcs->update_spm_vmid(adev, 0xf);
730+ adev->gfx.rlc.funcs->update_spm_vmid(adev, NULL, 0xf);
753731
754732 return 0;
755733 }
@@ -3846,7 +3824,7 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m, · 3090 unmodified lines
38463824 (order_base_2(prop->queue_size / 4) - 1));
38473825 tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, RPTR_BLOCK_SIZE,
38483826 (order_base_2(AMDGPU_GPU_PAGE_SIZE / 4) - 1));
3849− tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, UNORD_DISPATCH, 0);
3827+ tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, UNORD_DISPATCH, 1);
38503828 tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, TUNNEL_DISPATCH,
38513829 prop->allow_tunneling);
38523830 tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, PRIV_STATE, 1);
@@ -5049,7 +5027,7 @@ static int gfx_v11_0_update_gfx_clock_gating(struct amdgpu_device *adev, · 1196 unmodified lines
50495027 return 0;
50505028 }
50515029
5052−static void gfx_v11_0_update_spm_vmid(struct amdgpu_device *adev, unsigned vmid)
5030+static void gfx_v11_0_update_spm_vmid(struct amdgpu_device *adev, struct amdgpu_ring *ring, unsigned vmid)
50535031 {
50545032 u32 data;
50555033
@@ -5063,6 +5041,14 @@ static void gfx_v11_0_update_spm_vmid(struct amdgpu_device *adev, unsigned vmid) · 7 unmodified lines
50635041 WREG32_SOC15_NO_KIQ(GC, 0, regRLC_SPM_MC_CNTL, data);
50645042
50655043 amdgpu_gfx_off_ctrl(adev, true);
5044+
5045+ if (ring
5046+ && amdgpu_sriov_is_pp_one_vf(adev)
5047+ && ((ring->funcs->type == AMDGPU_RING_TYPE_GFX)
5048+ || (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE))) {
5049+ uint32_t reg = SOC15_REG_OFFSET(GC, 0, regRLC_SPM_MC_CNTL);
5050+ amdgpu_ring_emit_wreg(ring, reg, data);
5051+ }
50665052 }
50675053
50685054 static const struct amdgpu_rlc_funcs gfx_v11_0_rlc_funcs = {
@@ -6126,7 +6112,8 @@ static const struct amdgpu_ring_funcs gfx_v11_0_ring_funcs_gfx = { · 1057 unmodified lines
61266112 .get_rptr = gfx_v11_0_ring_get_rptr_gfx,
61276113 .get_wptr = gfx_v11_0_ring_get_wptr_gfx,
61286114 .set_wptr = gfx_v11_0_ring_set_wptr_gfx,
6129− .emit_frame_size = /* totally 242 maximum if 16 IBs */
6115+ .emit_frame_size = /* totally 247 maximum if 16 IBs */
6116+ 5 + /* update_spm_vmid */
61306117 5 + /* COND_EXEC */
61316118 9 + /* SET_Q_PREEMPTION_MODE */
61326119 7 + /* PIPELINE_SYNC */
@@ -6176,6 +6163,7 @@ static const struct amdgpu_ring_funcs gfx_v11_0_ring_funcs_compute = { · 43 unmodified lines
61766163 .get_wptr = gfx_v11_0_ring_get_wptr_compute,
61776164 .set_wptr = gfx_v11_0_ring_set_wptr_compute,
61786165 .emit_frame_size =
6166+ 5 + /* update_spm_vmid */
61796167 20 + /* gfx_v11_0_ring_emit_gds_switch */
61806168 7 + /* gfx_v11_0_ring_emit_hdp_flush */
61816169 5 + /* hdp invalidate */
drivers/gpu/drm/amd/amdgpu/gfx_v11_0_3.c+1−1
@@ -69,7 +69,7 @@ static int gfx_v11_0_3_rlc_gc_fed_irq(struct amdgpu_device *adev, · 68 unmodified lines
6969 amdgpu_ras_interrupt_dispatch(adev, &ih_data);
7070 } else {
7171 if (adev->virt.ops && adev->virt.ops->ras_poison_handler)
72− adev->virt.ops->ras_poison_handler(adev);
72+ adev->virt.ops->ras_poison_handler(adev, ras_if->block);
7373 else
7474 dev_warn(adev->dev,
7575 "No ras_poison_handler interface in SRIOV for %s!\n", ras_if->name);
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c+2−2
@@ -3274,7 +3274,7 @@ static int gfx_v7_0_rlc_init(struct amdgpu_device *adev) · 3273 unmodified lines
32743274
32753275 /* init spm vmid with 0xf */
32763276 if (adev->gfx.rlc.funcs->update_spm_vmid)
3277− adev->gfx.rlc.funcs->update_spm_vmid(adev, 0xf);
3277+ adev->gfx.rlc.funcs->update_spm_vmid(adev, NULL, 0xf);
32783278
32793279 return 0;
32803280 }
@@ -3500,7 +3500,7 @@ static int gfx_v7_0_rlc_resume(struct amdgpu_device *adev) · 219 unmodified lines
35003500 return 0;
35013501 }
35023502
3503−static void gfx_v7_0_update_spm_vmid(struct amdgpu_device *adev, unsigned vmid)
3503+static void gfx_v7_0_update_spm_vmid(struct amdgpu_device *adev, struct amdgpu_ring *ring, unsigned vmid)
35043504 {
35053505 u32 data;
35063506
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c+2−2
@@ -1288,7 +1288,7 @@ static int gfx_v8_0_rlc_init(struct amdgpu_device *adev) · 1287 unmodified lines
12881288
12891289 /* init spm vmid with 0xf */
12901290 if (adev->gfx.rlc.funcs->update_spm_vmid)
1291− adev->gfx.rlc.funcs->update_spm_vmid(adev, 0xf);
1291+ adev->gfx.rlc.funcs->update_spm_vmid(adev, NULL, 0xf);
12921292
12931293 return 0;
12941294 }
@@ -5579,7 +5579,7 @@ static void gfx_v8_0_unset_safe_mode(struct amdgpu_device *adev, int xcc_id) · 4284 unmodified lines
55795579 }
55805580 }
55815581
5582−static void gfx_v8_0_update_spm_vmid(struct amdgpu_device *adev, unsigned vmid)
5582+static void gfx_v8_0_update_spm_vmid(struct amdgpu_device *adev, struct amdgpu_ring *ring, unsigned vmid)
55835583 {
55845584 u32 data;
55855585
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c+9−1
@@ -3034,6 +3034,14 @@ static int gfx_v9_0_cp_gfx_start(struct amdgpu_device *adev) · 3033 unmodified lines
30343034
30353035 gfx_v9_0_cp_gfx_enable(adev, true);
30363036
3037+ /* Now only limit the quirk on the APU gfx9 series and already
3038+ * confirmed that the APU gfx10/gfx11 needn't such update.
3039+ */
3040+ if (adev->flags & AMD_IS_APU &&
3041+ adev->in_s3 && !adev->suspend_complete) {
3042+ DRM_INFO(" Will skip the CSB packet resubmit\n");
3043+ return 0;
3044+ }
30373045 r = amdgpu_ring_alloc(ring, gfx_v9_0_get_csb_size(adev) + 4 + 3);
30383046 if (r) {
30393047 DRM_ERROR("amdgpu: cp failed to lock ring (%d).\n", r);
@@ -4894,7 +4902,7 @@ static void gfx_v9_0_update_spm_vmid_internal(struct amdgpu_device *adev, · 1854 unmodified lines
48944902 WREG32_SOC15(GC, 0, mmRLC_SPM_MC_CNTL, data);
48954903 }
48964904
4897−static void gfx_v9_0_update_spm_vmid(struct amdgpu_device *adev, unsigned int vmid)
4905+static void gfx_v9_0_update_spm_vmid(struct amdgpu_device *adev, struct amdgpu_ring *ring, unsigned int vmid)
48984906 {
48994907 amdgpu_gfx_off_ctrl(adev, false);
49004908
drivers/gpu/drm/amd/amdgpu/gfx_v9_4.c+3−2
@@ -970,8 +970,9 @@ static void gfx_v9_4_reset_ras_error_count(struct amdgpu_device *adev) · 969 unmodified lines
970970 WREG32_SOC15(GC, 0, mmATC_L2_CACHE_4K_DSM_INDEX, 255);
971971 }
972972
973−static const struct soc15_reg_entry gfx_v9_4_ea_err_status_regs =
974− { SOC15_REG_ENTRY(GC, 0, mmGCEA_ERR_STATUS), 0, 1, 32 };
973+static const struct soc15_reg_entry gfx_v9_4_ea_err_status_regs = {
974+ SOC15_REG_ENTRY(GC, 0, mmGCEA_ERR_STATUS), 0, 1, 32
975+};
975976
976977 static void gfx_v9_4_query_ras_error_status(struct amdgpu_device *adev)
977978 {
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c+90−2
@@ -38,6 +38,7 @@ · 37 unmodified lines
3838
3939 #include "gfx_v9_4_3.h"
4040 #include "amdgpu_xcp.h"
41+#include "amdgpu_aca.h"
4142
4243 MODULE_FIRMWARE("amdgpu/gc_9_4_3_mec.bin");
4344 MODULE_FIRMWARE("amdgpu/gc_9_4_3_rlc.bin");
@@ -48,6 +49,10 @@ MODULE_FIRMWARE("amdgpu/gc_9_4_3_rlc.bin"); · 4 unmodified lines
4849 #define GOLDEN_GB_ADDR_CONFIG 0x2a114042
4950 #define CP_HQD_PERSISTENT_STATE_DEFAULT 0xbe05301
5051
52+#define mmSMNAID_XCD0_MCA_SMU 0x36430400 /* SMN AID XCD0 */
53+#define mmSMNAID_XCD1_MCA_SMU 0x38430400 /* SMN AID XCD1 */
54+#define mmSMNXCD_XCD0_MCA_SMU 0x40430400 /* SMN XCD XCD0 */
55+
5156 struct amdgpu_gfx_ras gfx_v9_4_3_ras;
5257
5358 static void gfx_v9_4_3_set_ring_funcs(struct amdgpu_device *adev);
@@ -675,6 +680,66 @@ static const struct amdgpu_gfx_funcs gfx_v9_4_3_gfx_funcs = { · 621 unmodified lines
675680 .ih_node_to_logical_xcc = &gfx_v9_4_3_ih_to_xcc_inst,
676681 };
677682
683+static int gfx_v9_4_3_aca_bank_generate_report(struct aca_handle *handle,
684+ struct aca_bank *bank, enum aca_error_type type,
685+ struct aca_bank_report *report, void *data)
686+{
687+ u64 status, misc0;
688+ u32 instlo;
689+ int ret;
690+
691+ status = bank->regs[ACA_REG_IDX_STATUS];
692+ if ((type == ACA_ERROR_TYPE_UE &&
693+ ACA_REG__STATUS__ERRORCODEEXT(status) == ACA_EXTERROR_CODE_FAULT) ||
694+ (type == ACA_ERROR_TYPE_CE &&
695+ ACA_REG__STATUS__ERRORCODEEXT(status) == ACA_EXTERROR_CODE_CE)) {
696+
697+ ret = aca_bank_info_decode(bank, &report->info);
698+ if (ret)
699+ return ret;
700+
701+ /* NOTE: overwrite info.die_id with xcd id for gfx */
702+ instlo = ACA_REG__IPID__INSTANCEIDLO(bank->regs[ACA_REG_IDX_IPID]);
703+ instlo &= GENMASK(31, 1);
704+ report->info.die_id = instlo == mmSMNAID_XCD0_MCA_SMU ? 0 : 1;
705+
706+ misc0 = bank->regs[ACA_REG_IDX_MISC0];
707+ report->count[type] = ACA_REG__MISC0__ERRCNT(misc0);
708+ }
709+
710+ return 0;
711+}
712+
713+static bool gfx_v9_4_3_aca_bank_is_valid(struct aca_handle *handle, struct aca_bank *bank,
714+ enum aca_error_type type, void *data)
715+{
716+ u32 instlo;
717+
718+ instlo = ACA_REG__IPID__INSTANCEIDLO(bank->regs[ACA_REG_IDX_IPID]);
719+ instlo &= GENMASK(31, 1);
720+ switch (instlo) {
721+ case mmSMNAID_XCD0_MCA_SMU:
722+ case mmSMNAID_XCD1_MCA_SMU:
723+ case mmSMNXCD_XCD0_MCA_SMU:
724+ return true;
725+ default:
726+ break;
727+ }
728+
729+ return false;
730+}
731+
732+static const struct aca_bank_ops gfx_v9_4_3_aca_bank_ops = {
733+ .aca_bank_generate_report = gfx_v9_4_3_aca_bank_generate_report,
734+ .aca_bank_is_valid = gfx_v9_4_3_aca_bank_is_valid,
735+};
736+
737+static const struct aca_info gfx_v9_4_3_aca_info = {
738+ .hwip = ACA_HWIP_TYPE_SMU,
739+ .mask = ACA_ERROR_UE_MASK | ACA_ERROR_CE_MASK,
740+ .bank_ops = &gfx_v9_4_3_aca_bank_ops,
741+};
742+
678743 static int gfx_v9_4_3_gpu_early_init(struct amdgpu_device *adev)
679744 {
680745 u32 gb_addr_config;
@@ -1109,7 +1174,7 @@ static int gfx_v9_4_3_rlc_init(struct amdgpu_device *adev) · 428 unmodified lines
11091174 {
11101175 /* init spm vmid with 0xf */
11111176 if (adev->gfx.rlc.funcs->update_spm_vmid)
1112− adev->gfx.rlc.funcs->update_spm_vmid(adev, 0xf);
1177+ adev->gfx.rlc.funcs->update_spm_vmid(adev, NULL, 0xf);
11131178
11141179 return 0;
11151180 }
@@ -1320,7 +1385,7 @@ static int gfx_v9_4_3_rlc_resume(struct amdgpu_device *adev) · 204 unmodified lines
13201385 return 0;
13211386 }
13221387
1323−static void gfx_v9_4_3_update_spm_vmid(struct amdgpu_device *adev,
1388+static void gfx_v9_4_3_update_spm_vmid(struct amdgpu_device *adev, struct amdgpu_ring *ring,
13241389 unsigned vmid)
13251390 {
13261391 u32 reg, data;
@@ -4242,9 +4307,32 @@ struct amdgpu_ras_block_hw_ops gfx_v9_4_3_ras_ops = { · 2915 unmodified lines
42424307 .reset_ras_error_count = &gfx_v9_4_3_reset_ras_error_count,
42434308 };
42444309
4310+static int gfx_v9_4_3_ras_late_init(struct amdgpu_device *adev, struct ras_common_if *ras_block)
4311+{
4312+ int r;
4313+
4314+ r = amdgpu_ras_block_late_init(adev, ras_block);
4315+ if (r)
4316+ return r;
4317+
4318+ r = amdgpu_ras_bind_aca(adev, AMDGPU_RAS_BLOCK__GFX,
4319+ &gfx_v9_4_3_aca_info,
4320+ NULL);
4321+ if (r)
4322+ goto late_fini;
4323+
4324+ return 0;
4325+
4326+late_fini:
4327+ amdgpu_ras_block_late_fini(adev, ras_block);
4328+
4329+ return r;
4330+}
4331+
42454332 struct amdgpu_gfx_ras gfx_v9_4_3_ras = {
42464333 .ras_block = {
42474334 .hw_ops = &gfx_v9_4_3_ras_ops,
4335+ .ras_late_init = &gfx_v9_4_3_ras_late_init,
42484336 },
42494337 .enable_watchdog_timer = &gfx_v9_4_3_enable_watchdog_timer,
42504338 };
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c+5−4
@@ -262,16 +262,17 @@ static void gmc_v10_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid, · 261 unmodified lines
262262 /* flush hdp cache */
263263 adev->hdp.funcs->flush_hdp(adev, NULL);
264264
265− /* For SRIOV run time, driver shouldn't access the register through MMIO
266− * Directly use kiq to do the vm invalidation instead
265+ /* This is necessary for SRIOV as well as for GFXOFF to function
266+ * properly under bare metal
267267 */
268268 if (adev->gfx.kiq[0].ring.sched.ready && !adev->enable_mes &&
269269 (amdgpu_sriov_runtime(adev) || !amdgpu_sriov_vf(adev))) {
270− amdgpu_virt_kiq_reg_write_reg_wait(adev, req, ack, inv_req,
271− 1 << vmid, GET_INST(GC, 0));
270+ amdgpu_gmc_fw_reg_write_reg_wait(adev, req, ack, inv_req,
271+ 1 << vmid, GET_INST(GC, 0));
272272 return;
273273 }
274274
275+ /* This path is needed before KIQ/MES/GFXOFF are set up */
275276 hub_ip = (vmhub == AMDGPU_GFXHUB(0)) ? GC_HWIP : MMHUB_HWIP;
276277
277278 spin_lock(&adev->gmc.invalidate_lock);
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c+5−4
@@ -223,16 +223,17 @@ static void gmc_v11_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid, · 222 unmodified lines
223223 /* flush hdp cache */
224224 adev->hdp.funcs->flush_hdp(adev, NULL);
225225
226− /* For SRIOV run time, driver shouldn't access the register through MMIO
227− * Directly use kiq to do the vm invalidation instead
226+ /* This is necessary for SRIOV as well as for GFXOFF to function
227+ * properly under bare metal
228228 */
229229 if ((adev->gfx.kiq[0].ring.sched.ready || adev->mes.ring.sched.ready) &&
230230 (amdgpu_sriov_runtime(adev) || !amdgpu_sriov_vf(adev))) {
231− amdgpu_virt_kiq_reg_write_reg_wait(adev, req, ack, inv_req,
232− 1 << vmid, GET_INST(GC, 0));
231+ amdgpu_gmc_fw_reg_write_reg_wait(adev, req, ack, inv_req,
232+ 1 << vmid, GET_INST(GC, 0));
233233 return;
234234 }
235235
236+ /* This path is needed before KIQ/MES/GFXOFF are set up */
236237 hub_ip = (vmhub == AMDGPU_GFXHUB(0)) ? GC_HWIP : MMHUB_HWIP;
237238
238239 spin_lock(&adev->gmc.invalidate_lock);
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c+5−4
@@ -435,9 +435,10 @@ static void gmc_v6_0_set_prt(struct amdgpu_device *adev, bool enable) · 434 unmodified lines
435435 WREG32(mmVM_PRT_CNTL, tmp);
436436
437437 if (enable) {
438− uint32_t low = AMDGPU_VA_RESERVED_SIZE >> AMDGPU_GPU_PAGE_SHIFT;
438+ uint32_t low = AMDGPU_VA_RESERVED_BOTTOM >>
439+ AMDGPU_GPU_PAGE_SHIFT;
439440 uint32_t high = adev->vm_manager.max_pfn -
440− (AMDGPU_VA_RESERVED_SIZE >> AMDGPU_GPU_PAGE_SHIFT);
441+ (AMDGPU_VA_RESERVED_TOP >> AMDGPU_GPU_PAGE_SHIFT);
441442
442443 WREG32(mmVM_PRT_APERTURE0_LOW_ADDR, low);
443444 WREG32(mmVM_PRT_APERTURE1_LOW_ADDR, low);
@@ -915,8 +916,8 @@ static int gmc_v6_0_hw_init(void *handle) · 471 unmodified lines
915916
916917 if (amdgpu_emu_mode == 1)
917918 return amdgpu_gmc_vram_checking(adev);
918− else
919− return r;
919+
920+ return 0;
920921 }
921922
922923 static int gmc_v6_0_hw_fini(void *handle)
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c+5−4
@@ -563,9 +563,10 @@ static void gmc_v7_0_set_prt(struct amdgpu_device *adev, bool enable) · 562 unmodified lines
563563 WREG32(mmVM_PRT_CNTL, tmp);
564564
565565 if (enable) {
566− uint32_t low = AMDGPU_VA_RESERVED_SIZE >> AMDGPU_GPU_PAGE_SHIFT;
566+ uint32_t low = AMDGPU_VA_RESERVED_BOTTOM >>
567+ AMDGPU_GPU_PAGE_SHIFT;
567568 uint32_t high = adev->vm_manager.max_pfn -
568− (AMDGPU_VA_RESERVED_SIZE >> AMDGPU_GPU_PAGE_SHIFT);
569+ (AMDGPU_VA_RESERVED_TOP >> AMDGPU_GPU_PAGE_SHIFT);
569570
570571 WREG32(mmVM_PRT_APERTURE0_LOW_ADDR, low);
571572 WREG32(mmVM_PRT_APERTURE1_LOW_ADDR, low);
@@ -1099,8 +1100,8 @@ static int gmc_v7_0_hw_init(void *handle) · 527 unmodified lines
10991100
11001101 if (amdgpu_emu_mode == 1)
11011102 return amdgpu_gmc_vram_checking(adev);
1102− else
1103− return r;
1103+
1104+ return 0;
11041105 }
11051106
11061107 static int gmc_v7_0_hw_fini(void *handle)
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c+5−4
@@ -777,9 +777,10 @@ static void gmc_v8_0_set_prt(struct amdgpu_device *adev, bool enable) · 776 unmodified lines
777777 WREG32(mmVM_PRT_CNTL, tmp);
778778
779779 if (enable) {
780− uint32_t low = AMDGPU_VA_RESERVED_SIZE >> AMDGPU_GPU_PAGE_SHIFT;
780+ uint32_t low = AMDGPU_VA_RESERVED_BOTTOM >>
781+ AMDGPU_GPU_PAGE_SHIFT;
781782 uint32_t high = adev->vm_manager.max_pfn -
782− (AMDGPU_VA_RESERVED_SIZE >> AMDGPU_GPU_PAGE_SHIFT);
783+ (AMDGPU_VA_RESERVED_TOP >> AMDGPU_GPU_PAGE_SHIFT);
783784
784785 WREG32(mmVM_PRT_APERTURE0_LOW_ADDR, low);
785786 WREG32(mmVM_PRT_APERTURE1_LOW_ADDR, low);
@@ -1219,8 +1220,8 @@ static int gmc_v8_0_hw_init(void *handle) · 433 unmodified lines
12191220
12201221 if (amdgpu_emu_mode == 1)
12211222 return amdgpu_gmc_vram_checking(adev);
1222− else
1223− return r;
1223+
1224+ return 0;
12241225 }
12251226
12261227 static int gmc_v8_0_hw_fini(void *handle)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c+9−14
@@ -829,23 +829,25 @@ static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid, · 828 unmodified lines
829829 req = hub->vm_inv_eng0_req + hub->eng_distance * eng;
830830 ack = hub->vm_inv_eng0_ack + hub->eng_distance * eng;
831831
832− /* This is necessary for a HW workaround under SRIOV as well
833− * as GFXOFF under bare metal
834− */
835832 if (vmhub >= AMDGPU_MMHUB0(0))
836833 inst = GET_INST(GC, 0);
837834 else
838835 inst = vmhub;
836+
837+ /* This is necessary for SRIOV as well as for GFXOFF to function
838+ * properly under bare metal
839+ */
839840 if (adev->gfx.kiq[inst].ring.sched.ready &&
840841 (amdgpu_sriov_runtime(adev) || !amdgpu_sriov_vf(adev))) {
841842 uint32_t req = hub->vm_inv_eng0_req + hub->eng_distance * eng;
842843 uint32_t ack = hub->vm_inv_eng0_ack + hub->eng_distance * eng;
843844
844− amdgpu_virt_kiq_reg_write_reg_wait(adev, req, ack, inv_req,
845− 1 << vmid, inst);
845+ amdgpu_gmc_fw_reg_write_reg_wait(adev, req, ack, inv_req,
846+ 1 << vmid, inst);
846847 return;
847848 }
848849
850+ /* This path is needed before KIQ/MES/GFXOFF are set up */
849851 spin_lock(&adev->gmc.invalidate_lock);
850852
851853 /*
@@ -1947,13 +1949,6 @@ static int gmc_v9_0_init_mem_ranges(struct amdgpu_device *adev) · 1095 unmodified lines
19471949
19481950 static void gmc_v9_4_3_init_vram_info(struct amdgpu_device *adev)
19491951 {
1950− static const u32 regBIF_BIOS_SCRATCH_4 = 0x50;
1951− u32 vram_info;
1952−
1953− if (!amdgpu_sriov_vf(adev)) {
1954− vram_info = RREG32(regBIF_BIOS_SCRATCH_4);
1955− adev->gmc.vram_vendor = vram_info & 0xF;
1956− }
19571952 adev->gmc.vram_type = AMDGPU_VRAM_TYPE_HBM;
19581953 adev->gmc.vram_width = 128 * 64;
19591954 }
@@ -2340,8 +2335,8 @@ static int gmc_v9_0_hw_init(void *handle) · 380 unmodified lines
23402335
23412336 if (amdgpu_emu_mode == 1)
23422337 return amdgpu_gmc_vram_checking(adev);
2343− else
2344− return r;
2338+
2339+ return 0;
23452340 }
23462341
23472342 /**
drivers/gpu/drm/amd/amdgpu/iceland_ih.c+5−0
@@ -215,6 +215,11 @@ static u32 iceland_ih_get_wptr(struct amdgpu_device *adev, · 214 unmodified lines
215215 tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);
216216 WREG32(mmIH_RB_CNTL, tmp);
217217
218+ /* Unset the CLEAR_OVERFLOW bit immediately so new overflows
219+ * can be detected.
220+ */
221+ tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 0);
222+ WREG32(mmIH_RB_CNTL, tmp);
218223
219224 out:
220225 return (wptr & ih->ptr_mask);
drivers/gpu/drm/amd/amdgpu/ih_v6_0.c+6−0
@@ -418,6 +418,12 @@ static u32 ih_v6_0_get_wptr(struct amdgpu_device *adev, · 417 unmodified lines
418418 tmp = RREG32_NO_KIQ(ih_regs->ih_rb_cntl);
419419 tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);
420420 WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);
421+
422+ /* Unset the CLEAR_OVERFLOW bit immediately so new overflows
423+ * can be detected.
424+ */
425+ tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 0);
426+ WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);
421427 out:
422428 return (wptr & ih->ptr_mask);
423429 }
drivers/gpu/drm/amd/amdgpu/ih_v6_1.c+7−0
@@ -418,6 +418,13 @@ static u32 ih_v6_1_get_wptr(struct amdgpu_device *adev, · 417 unmodified lines
418418 tmp = RREG32_NO_KIQ(ih_regs->ih_rb_cntl);
419419 tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);
420420 WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);
421+
422+ /* Unset the CLEAR_OVERFLOW bit immediately so new overflows
423+ * can be detected.
424+ */
425+ tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 0);
426+ WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);
427+
421428 out:
422429 return (wptr & ih->ptr_mask);
423430 }
drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c+4−6
@@ -551,7 +551,7 @@ static int jpeg_v2_5_set_powergating_state(void *handle, · 550 unmodified lines
551551 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
552552 int ret;
553553
554− if(state == adev->jpeg.cur_state)
554+ if (state == adev->jpeg.cur_state)
555555 return 0;
556556
557557 if (state == AMD_PG_STATE_GATE)
@@ -559,7 +559,7 @@ static int jpeg_v2_5_set_powergating_state(void *handle, · 1 unmodified line
559559 else
560560 ret = jpeg_v2_5_start(adev);
561561
562− if(!ret)
562+ if (!ret)
563563 adev->jpeg.cur_state = state;
564564
565565 return ret;
@@ -754,8 +754,7 @@ static void jpeg_v2_5_set_irq_funcs(struct amdgpu_device *adev) · 188 unmodified lines
754754 }
755755 }
756756
757−const struct amdgpu_ip_block_version jpeg_v2_5_ip_block =
758−{
757+const struct amdgpu_ip_block_version jpeg_v2_5_ip_block = {
759758 .type = AMD_IP_BLOCK_TYPE_JPEG,
760759 .major = 2,
761760 .minor = 5,
@@ -763,8 +762,7 @@ const struct amdgpu_ip_block_version jpeg_v2_5_ip_block = · 1 unmodified line
763762 .funcs = &jpeg_v2_5_ip_funcs,
764763 };
765764
766−const struct amdgpu_ip_block_version jpeg_v2_6_ip_block =
767−{
765+const struct amdgpu_ip_block_version jpeg_v2_6_ip_block = {
768766 .type = AMD_IP_BLOCK_TYPE_JPEG,
769767 .major = 2,
770768 .minor = 6,
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c+0−9
@@ -674,14 +674,6 @@ static int jpeg_v4_0_set_powergating_state(void *handle, · 673 unmodified lines
674674 return ret;
675675 }
676676
677−static int jpeg_v4_0_set_interrupt_state(struct amdgpu_device *adev,
678− struct amdgpu_irq_src *source,
679− unsigned type,
680− enum amdgpu_interrupt_state state)
681−{
682− return 0;
683−}
684−
685677 static int jpeg_v4_0_set_ras_interrupt_state(struct amdgpu_device *adev,
686678 struct amdgpu_irq_src *source,
687679 unsigned int type,
@@ -765,7 +757,6 @@ static void jpeg_v4_0_set_dec_ring_funcs(struct amdgpu_device *adev) · 77 unmodified lines
765757 }
766758
767759 static const struct amdgpu_irq_src_funcs jpeg_v4_0_irq_funcs = {
768− .set = jpeg_v4_0_set_interrupt_state,
769760 .process = jpeg_v4_0_process_interrupt,
770761 };
771762
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c+0−10
@@ -181,7 +181,6 @@ static int jpeg_v4_0_5_hw_fini(void *handle) · 180 unmodified lines
181181 RREG32_SOC15(JPEG, 0, regUVD_JRBC_STATUS))
182182 jpeg_v4_0_5_set_powergating_state(adev, AMD_PG_STATE_GATE);
183183 }
184− amdgpu_irq_put(adev, &adev->jpeg.inst->irq, 0);
185184
186185 return 0;
187186 }
@@ -516,14 +515,6 @@ static int jpeg_v4_0_5_set_powergating_state(void *handle, · 328 unmodified lines
516515 return ret;
517516 }
518517
519−static int jpeg_v4_0_5_set_interrupt_state(struct amdgpu_device *adev,
520− struct amdgpu_irq_src *source,
521− unsigned type,
522− enum amdgpu_interrupt_state state)
523−{
524− return 0;
525−}
526−
527518 static int jpeg_v4_0_5_process_interrupt(struct amdgpu_device *adev,
528519 struct amdgpu_irq_src *source,
529520 struct amdgpu_iv_entry *entry)
@@ -603,7 +594,6 @@ static void jpeg_v4_0_5_set_dec_ring_funcs(struct amdgpu_device *adev) · 73 unmodified lines
603594 }
604595
605596 static const struct amdgpu_irq_src_funcs jpeg_v4_0_5_irq_funcs = {
606− .set = jpeg_v4_0_5_set_interrupt_state,
607597 .process = jpeg_v4_0_5_process_interrupt,
608598 };
609599
drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c+87−0
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333
3434 #define regVM_L2_CNTL3_DEFAULT 0x80100007
3535 #define regVM_L2_CNTL4_DEFAULT 0x000000c1
36+#define mmSMNAID_AID0_MCA_SMU 0x03b30400
3637
3738 static u64 mmhub_v1_8_get_fb_location(struct amdgpu_device *adev)
3839 {
@@ -705,8 +706,94 @@ static const struct amdgpu_ras_block_hw_ops mmhub_v1_8_ras_hw_ops = { · 666 unmodified lines
705706 .reset_ras_error_count = mmhub_v1_8_reset_ras_error_count,
706707 };
707708
709+static int mmhub_v1_8_aca_bank_generate_report(struct aca_handle *handle,
710+ struct aca_bank *bank, enum aca_error_type type,
711+ struct aca_bank_report *report, void *data)
712+{
713+ u64 status, misc0;
714+ int ret;
715+
716+ status = bank->regs[ACA_REG_IDX_STATUS];
717+ if ((type == ACA_ERROR_TYPE_UE &&
718+ ACA_REG__STATUS__ERRORCODEEXT(status) == ACA_EXTERROR_CODE_FAULT) ||
719+ (type == ACA_ERROR_TYPE_CE &&
720+ ACA_REG__STATUS__ERRORCODEEXT(status) == ACA_EXTERROR_CODE_CE)) {
721+
722+ ret = aca_bank_info_decode(bank, &report->info);
723+ if (ret)
724+ return ret;
725+
726+ misc0 = bank->regs[ACA_REG_IDX_MISC0];
727+ report->count[type] = ACA_REG__MISC0__ERRCNT(misc0);
728+ }
729+
730+ return 0;
731+}
732+
733+/* reference to smu driver if header file */
734+static int mmhub_v1_8_err_codes[] = {
735+ 0, 1, 2, 3, 4, /* CODE_DAGB0 - 4 */
736+ 5, 6, 7, 8, 9, /* CODE_EA0 - 4 */
737+ 10, /* CODE_UTCL2_ROUTER */
738+ 11, /* CODE_VML2 */
739+ 12, /* CODE_VML2_WALKER */
740+ 13, /* CODE_MMCANE */
741+};
742+
743+static bool mmhub_v1_8_aca_bank_is_valid(struct aca_handle *handle, struct aca_bank *bank,
744+ enum aca_error_type type, void *data)
745+{
746+ u32 instlo;
747+
748+ instlo = ACA_REG__IPID__INSTANCEIDLO(bank->regs[ACA_REG_IDX_IPID]);
749+ instlo &= GENMASK(31, 1);
750+
751+ if (instlo != mmSMNAID_AID0_MCA_SMU)
752+ return false;
753+
754+ if (aca_bank_check_error_codes(handle->adev, bank,
755+ mmhub_v1_8_err_codes,
756+ ARRAY_SIZE(mmhub_v1_8_err_codes)))
757+ return false;
758+
759+ return true;
760+}
761+
762+static const struct aca_bank_ops mmhub_v1_8_aca_bank_ops = {
763+ .aca_bank_generate_report = mmhub_v1_8_aca_bank_generate_report,
764+ .aca_bank_is_valid = mmhub_v1_8_aca_bank_is_valid,
765+};
766+
767+static const struct aca_info mmhub_v1_8_aca_info = {
768+ .hwip = ACA_HWIP_TYPE_SMU,
769+ .mask = ACA_ERROR_UE_MASK,
770+ .bank_ops = &mmhub_v1_8_aca_bank_ops,
771+};
772+
773+static int mmhub_v1_8_ras_late_init(struct amdgpu_device *adev, struct ras_common_if *ras_block)
774+{
775+ int r;
776+
777+ r = amdgpu_ras_block_late_init(adev, ras_block);
778+ if (r)
779+ return r;
780+
781+ r = amdgpu_ras_bind_aca(adev, AMDGPU_RAS_BLOCK__MMHUB,
782+ &mmhub_v1_8_aca_info, NULL);
783+ if (r)
784+ goto late_fini;
785+
786+ return 0;
787+
788+late_fini:
789+ amdgpu_ras_block_late_fini(adev, ras_block);
790+
791+ return r;
792+}
793+
708794 struct amdgpu_mmhub_ras mmhub_v1_8_ras = {
709795 .ras_block = {
710796 .hw_ops = &mmhub_v1_8_ras_hw_ops,
797+ .ras_late_init = mmhub_v1_8_ras_late_init,
711798 },
712799 };
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c+2−1
@@ -404,7 +404,8 @@ static int xgpu_ai_request_init_data(struct amdgpu_device *adev) · 403 unmodified lines
404404 return xgpu_ai_send_access_requests(adev, IDH_REQ_GPU_INIT_DATA);
405405 }
406406
407−static void xgpu_ai_ras_poison_handler(struct amdgpu_device *adev)
407+static void xgpu_ai_ras_poison_handler(struct amdgpu_device *adev,
408+ enum amdgpu_ras_block block)
408409 {
409410 xgpu_ai_send_access_requests(adev, IDH_RAS_POISON);
410411 }
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c+24−5
@@ -152,14 +152,14 @@ static void xgpu_nv_mailbox_trans_msg (struct amdgpu_device *adev, · 151 unmodified lines
152152 xgpu_nv_mailbox_set_valid(adev, false);
153153 }
154154
155−static int xgpu_nv_send_access_requests(struct amdgpu_device *adev,
156− enum idh_request req)
155+static int xgpu_nv_send_access_requests_with_param(struct amdgpu_device *adev,
156+ enum idh_request req, u32 data1, u32 data2, u32 data3)
157157 {
158158 int r, retry = 1;
159159 enum idh_event event = -1;
160160
161161 send_request:
162− xgpu_nv_mailbox_trans_msg(adev, req, 0, 0, 0);
162+ xgpu_nv_mailbox_trans_msg(adev, req, data1, data2, data3);
163163
164164 switch (req) {
165165 case IDH_REQ_GPU_INIT_ACCESS:
@@ -170,6 +170,10 @@ send_request: · 4 unmodified lines
170170 case IDH_REQ_GPU_INIT_DATA:
171171 event = IDH_REQ_GPU_INIT_DATA_READY;
172172 break;
173+ case IDH_RAS_POISON:
174+ if (data1 != 0)
175+ event = IDH_RAS_POISON_READY;
176+ break;
173177 default:
174178 break;
175179 }
@@ -206,6 +210,13 @@ send_request: · 30 unmodified lines
206210 return 0;
207211 }
208212
213+static int xgpu_nv_send_access_requests(struct amdgpu_device *adev,
214+ enum idh_request req)
215+{
216+ return xgpu_nv_send_access_requests_with_param(adev,
217+ req, 0, 0, 0);
218+}
219+
209220 static int xgpu_nv_request_reset(struct amdgpu_device *adev)
210221 {
211222 int ret, i = 0;
@@ -424,9 +435,17 @@ void xgpu_nv_mailbox_put_irq(struct amdgpu_device *adev) · 212 unmodified lines
424435 amdgpu_irq_put(adev, &adev->virt.rcv_irq, 0);
425436 }
426437
427−static void xgpu_nv_ras_poison_handler(struct amdgpu_device *adev)
438+static void xgpu_nv_ras_poison_handler(struct amdgpu_device *adev,
439+ enum amdgpu_ras_block block)
428440 {
429− xgpu_nv_send_access_requests(adev, IDH_RAS_POISON);
441+ if (amdgpu_ip_version(adev, UMC_HWIP, 0) < IP_VERSION(12, 0, 0)) {
442+ xgpu_nv_send_access_requests(adev, IDH_RAS_POISON);
443+ } else {
444+ amdgpu_virt_fini_data_exchange(adev);
445+ xgpu_nv_send_access_requests_with_param(adev,
446+ IDH_RAS_POISON, block, 0, 0);
447+ amdgpu_virt_init_data_exchange(adev);
448+ }
430449 }
431450
432451 const struct amdgpu_virt_ops xgpu_nv_virt_ops = {
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.h+1−0
@@ -51,6 +51,7 @@ enum idh_event { · 50 unmodified lines
5151 IDH_FAIL,
5252 IDH_QUERY_ALIVE,
5353 IDH_REQ_GPU_INIT_DATA_READY,
54+ IDH_RAS_POISON_READY,
5455
5556 IDH_TEXT_MESSAGE = 255,
5657 };
drivers/gpu/drm/amd/amdgpu/navi10_ih.c+7−2
@@ -442,6 +442,12 @@ static u32 navi10_ih_get_wptr(struct amdgpu_device *adev, · 441 unmodified lines
442442 tmp = RREG32_NO_KIQ(ih_regs->ih_rb_cntl);
443443 tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);
444444 WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);
445+
446+ /* Unset the CLEAR_OVERFLOW bit immediately so new overflows
447+ * can be detected.
448+ */
449+ tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 0);
450+ WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);
445451 out:
446452 return (wptr & ih->ptr_mask);
447453 }
@@ -722,8 +728,7 @@ static void navi10_ih_set_interrupt_funcs(struct amdgpu_device *adev) · 274 unmodified lines
722728 adev->irq.ih_funcs = &navi10_ih_funcs;
723729 }
724730
725−const struct amdgpu_ip_block_version navi10_ih_ip_block =
726−{
731+const struct amdgpu_ip_block_version navi10_ih_ip_block = {
727732 .type = AMD_IP_BLOCK_TYPE_IH,
728733 .major = 5,
729734 .minor = 0,
drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c+6−0
@@ -431,6 +431,12 @@ static void nbio_v7_9_init_registers(struct amdgpu_device *adev) · 430 unmodified lines
431431 u32 inst_mask;
432432 int i;
433433
434+ if (amdgpu_sriov_vf(adev))
435+ adev->rmmio_remap.reg_offset =
436+ SOC15_REG_OFFSET(
437+ NBIO, 0,
438+ regBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL)
439+ << 2;
434440 WREG32_SOC15(NBIO, 0, regXCC_DOORBELL_FENCE,
435441 0xff & ~(adev->gfx.xcc_mask));
436442
drivers/gpu/drm/amd/amdgpu/psp_v13_0.c+27−72
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 #include "amdgpu_ucode.h"
2828 #include "soc15_common.h"
2929 #include "psp_v13_0.h"
30+#include "amdgpu_ras.h"
3031
3132 #include "mp/mp_13_0_2_offset.h"
3233 #include "mp/mp_13_0_2_sh_mask.h"
@@ -187,11 +188,18 @@ static int psp_v13_0_wait_for_bootloader(struct psp_context *psp) · 154 unmodified lines
187188 static int psp_v13_0_wait_for_bootloader_steady_state(struct psp_context *psp)
188189 {
189190 struct amdgpu_device *adev = psp->adev;
191+ int ret;
190192
191193 if (amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 6)) {
192− psp_v13_0_wait_for_vmbx_ready(psp);
194+ ret = psp_v13_0_wait_for_vmbx_ready(psp);
195+ if (ret)
196+ amdgpu_ras_query_boot_status(adev, 4);
197+
198+ ret = psp_v13_0_wait_for_bootloader(psp);
199+ if (ret)
200+ amdgpu_ras_query_boot_status(adev, 4);
193201
194− return psp_v13_0_wait_for_bootloader(psp);
202+ return ret;
195203 }
196204
197205 return 0;
@@ -763,81 +771,28 @@ static int psp_v13_0_fatal_error_recovery_quirk(struct psp_context *psp) · 565 unmodified lines
763771 return 0;
764772 }
765773
766−
767−static void psp_v13_0_boot_error_reporting(struct amdgpu_device *adev,
768− uint32_t inst,
769− uint32_t boot_error)
770−{
771− uint32_t socket_id;
772− uint32_t aid_id;
773− uint32_t hbm_id;
774− uint32_t reg_data;
775−
776− socket_id = REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, SOCKET_ID);
777− aid_id = REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, AID_ID);
778− hbm_id = REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, HBM_ID);
779−
780− reg_data = RREG32_SOC15(MP0, inst, regMP0_SMN_C2PMSG_109);
781− dev_info(adev->dev, "socket: %d, aid: %d, firmware boot failed, fw status is 0x%x\n",
782− socket_id, aid_id, reg_data);
783−
784− if (REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, GPU_ERR_MEM_TRAINING))
785− dev_info(adev->dev, "socket: %d, aid: %d, hbm: %d, memory training failed\n",
786− socket_id, aid_id, hbm_id);
787−
788− if (REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, GPU_ERR_FW_LOAD))
789− dev_info(adev->dev, "socket: %d, aid: %d, firmware load failed at boot time\n",
790− socket_id, aid_id);
791−
792− if (REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, GPU_ERR_WAFL_LINK_TRAINING))
793− dev_info(adev->dev, "socket: %d, aid: %d, wafl link training failed\n",
794− socket_id, aid_id);
795−
796− if (REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, GPU_ERR_XGMI_LINK_TRAINING))
797− dev_info(adev->dev, "socket: %d, aid: %d, xgmi link training failed\n",
798− socket_id, aid_id);
799−
800− if (REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, GPU_ERR_USR_CP_LINK_TRAINING))
801− dev_info(adev->dev, "socket: %d, aid: %d, usr cp link training failed\n",
802− socket_id, aid_id);
803−
804− if (REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, GPU_ERR_USR_DP_LINK_TRAINING))
805− dev_info(adev->dev, "socket: %d, aid: %d, usr dp link training failed\n",
806− socket_id, aid_id);
807−
808− if (REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, GPU_ERR_HBM_MEM_TEST))
809− dev_info(adev->dev, "socket: %d, aid: %d, hbm: %d, hbm memory test failed\n",
810− socket_id, aid_id, hbm_id);
811−
812− if (REG_GET_FIELD(boot_error, MP0_SMN_C2PMSG_126, GPU_ERR_HBM_BIST_TEST))
813− dev_info(adev->dev, "socket: %d, aid: %d, hbm: %d, hbm bist test failed\n",
814− socket_id, aid_id, hbm_id);
815−}
816−
817−static int psp_v13_0_query_boot_status(struct psp_context *psp)
774+static bool psp_v13_0_get_ras_capability(struct psp_context *psp)
818775 {
819776 struct amdgpu_device *adev = psp->adev;
820− int inst_mask = adev->aid_mask;
821− uint32_t reg_data;
822− uint32_t i;
823− int ret = 0;
777+ struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
778+ u32 reg_data;
824779
825− if (amdgpu_ip_version(adev, MP0_HWIP, 0) != IP_VERSION(13, 0, 6))
826− return 0;
780+ /* query ras cap should be done from host side */
781+ if (amdgpu_sriov_vf(adev))
782+ return false;
827783
828− if (RREG32_SOC15(MP0, 0, regMP0_SMN_C2PMSG_59) < 0x00a10109)
829− return 0;
784+ if (!con)
785+ return false;
830786
831− for_each_inst(i, inst_mask) {
832− reg_data = RREG32_SOC15(MP0, i, regMP0_SMN_C2PMSG_126);
833− if (!REG_GET_FIELD(reg_data, MP0_SMN_C2PMSG_126, BOOT_STATUS)) {
834− psp_v13_0_boot_error_reporting(adev, i, reg_data);
835− ret = -EINVAL;
836− break;
837− }
787+ if ((amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 6)) &&
788+ (!(adev->flags & AMD_IS_APU))) {
789+ reg_data = RREG32_SOC15(MP0, 0, regMP0_SMN_C2PMSG_127);
790+ adev->ras_hw_enabled = (reg_data & GENMASK_ULL(23, 0));
791+ con->poison_supported = ((reg_data & GENMASK_ULL(24, 24)) >> 24) ? true : false;
792+ return true;
793+ } else {
794+ return false;
838795 }
839−
840− return ret;
841796 }
842797
843798 static const struct psp_funcs psp_v13_0_funcs = {
@@ -862,7 +817,7 @@ static const struct psp_funcs psp_v13_0_funcs = { · 18 unmodified lines
862817 .update_spirom = psp_v13_0_update_spirom,
863818 .vbflash_stat = psp_v13_0_vbflash_status,
864819 .fatal_error_recovery_quirk = psp_v13_0_fatal_error_recovery_quirk,
865− .query_boot_status = psp_v13_0_query_boot_status,
820+ .get_ras_capability = psp_v13_0_get_ras_capability,
866821 };
867822
868823 void psp_v13_0_set_psp_funcs(struct psp_context *psp)
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c+6−9
@@ -57,22 +57,19 @@ static void sdma_v2_4_set_irq_funcs(struct amdgpu_device *adev); · 56 unmodified lines
5757 MODULE_FIRMWARE("amdgpu/topaz_sdma.bin");
5858 MODULE_FIRMWARE("amdgpu/topaz_sdma1.bin");
5959
60−static const u32 sdma_offsets[SDMA_MAX_INSTANCE] =
61−{
60+static const u32 sdma_offsets[SDMA_MAX_INSTANCE] = {
6261 SDMA0_REGISTER_OFFSET,
6362 SDMA1_REGISTER_OFFSET
6463 };
6564
66−static const u32 golden_settings_iceland_a11[] =
67−{
65+static const u32 golden_settings_iceland_a11[] = {
6866 mmSDMA0_CHICKEN_BITS, 0xfc910007, 0x00810007,
6967 mmSDMA0_CLK_CTRL, 0xff000fff, 0x00000000,
7068 mmSDMA1_CHICKEN_BITS, 0xfc910007, 0x00810007,
7169 mmSDMA1_CLK_CTRL, 0xff000fff, 0x00000000,
7270 };
7371
74−static const u32 iceland_mgcg_cgcg_init[] =
75−{
72+static const u32 iceland_mgcg_cgcg_init[] = {
7673 mmSDMA0_CLK_CTRL, 0xff000ff0, 0x00000100,
7774 mmSDMA1_CLK_CTRL, 0xff000ff0, 0x00000100
7875 };
@@ -142,7 +139,8 @@ static int sdma_v2_4_init_microcode(struct amdgpu_device *adev) · 63 unmodified lines
142139 case CHIP_TOPAZ:
143140 chip_name = "topaz";
144141 break;
145− default: BUG();
142+ default:
143+ BUG();
146144 }
147145
148146 for (i = 0; i < adev->sdma.num_instances; i++) {
@@ -1258,8 +1256,7 @@ static void sdma_v2_4_set_vm_pte_funcs(struct amdgpu_device *adev) · 1109 unmodified lines
12581256 adev->vm_manager.vm_pte_num_scheds = adev->sdma.num_instances;
12591257 }
12601258
1261−const struct amdgpu_ip_block_version sdma_v2_4_ip_block =
1262−{
1259+const struct amdgpu_ip_block_version sdma_v2_4_ip_block = {
12631260 .type = AMD_IP_BLOCK_TYPE_SDMA,
12641261 .major = 2,
12651262 .minor = 4,
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c+72−0
@@ -45,6 +45,8 @@ · 44 unmodified lines
4545
4646 MODULE_FIRMWARE("amdgpu/sdma_4_4_2.bin");
4747
48+#define mmSMNAID_AID0_MCA_SMU 0x03b30400
49+
4850 #define WREG32_SDMA(instance, offset, value) \
4951 WREG32(sdma_v4_4_2_get_reg_offset(adev, (instance), (offset)), value)
5052 #define RREG32_SDMA(instance, offset) \
@@ -2204,9 +2206,79 @@ static const struct amdgpu_ras_block_hw_ops sdma_v4_4_2_ras_hw_ops = { · 2153 unmodified lines
22042206 .reset_ras_error_count = sdma_v4_4_2_reset_ras_error_count,
22052207 };
22062208
2209+static int sdma_v4_4_2_aca_bank_generate_report(struct aca_handle *handle,
2210+ struct aca_bank *bank, enum aca_error_type type,
2211+ struct aca_bank_report *report, void *data)
2212+{
2213+ u64 status, misc0;
2214+ int ret;
2215+
2216+ status = bank->regs[ACA_REG_IDX_STATUS];
2217+ if ((type == ACA_ERROR_TYPE_UE &&
2218+ ACA_REG__STATUS__ERRORCODEEXT(status) == ACA_EXTERROR_CODE_FAULT) ||
2219+ (type == ACA_ERROR_TYPE_CE &&
2220+ ACA_REG__STATUS__ERRORCODEEXT(status) == ACA_EXTERROR_CODE_CE)) {
2221+
2222+ ret = aca_bank_info_decode(bank, &report->info);
2223+ if (ret)
2224+ return ret;
2225+
2226+ misc0 = bank->regs[ACA_REG_IDX_MISC0];
2227+ report->count[type] = ACA_REG__MISC0__ERRCNT(misc0);
2228+ }
2229+
2230+ return 0;
2231+}
2232+
2233+/* CODE_SDMA0 - CODE_SDMA4, reference to smu driver if header file */
2234+static int sdma_v4_4_2_err_codes[] = { 33, 34, 35, 36 };
2235+
2236+static bool sdma_v4_4_2_aca_bank_is_valid(struct aca_handle *handle, struct aca_bank *bank,
2237+ enum aca_error_type type, void *data)
2238+{
2239+ u32 instlo;
2240+
2241+ instlo = ACA_REG__IPID__INSTANCEIDLO(bank->regs[ACA_REG_IDX_IPID]);
2242+ instlo &= GENMASK(31, 1);
2243+
2244+ if (instlo != mmSMNAID_AID0_MCA_SMU)
2245+ return false;
2246+
2247+ if (aca_bank_check_error_codes(handle->adev, bank,
2248+ sdma_v4_4_2_err_codes,
2249+ ARRAY_SIZE(sdma_v4_4_2_err_codes)))
2250+ return false;
2251+
2252+ return true;
2253+}
2254+
2255+static const struct aca_bank_ops sdma_v4_4_2_aca_bank_ops = {
2256+ .aca_bank_generate_report = sdma_v4_4_2_aca_bank_generate_report,
2257+ .aca_bank_is_valid = sdma_v4_4_2_aca_bank_is_valid,
2258+};
2259+
2260+static const struct aca_info sdma_v4_4_2_aca_info = {
2261+ .hwip = ACA_HWIP_TYPE_SMU,
2262+ .mask = ACA_ERROR_UE_MASK,
2263+ .bank_ops = &sdma_v4_4_2_aca_bank_ops,
2264+};
2265+
2266+static int sdma_v4_4_2_ras_late_init(struct amdgpu_device *adev, struct ras_common_if *ras_block)
2267+{
2268+ int r;
2269+
2270+ r = amdgpu_sdma_ras_late_init(adev, ras_block);
2271+ if (r)
2272+ return r;
2273+
2274+ return amdgpu_ras_bind_aca(adev, AMDGPU_RAS_BLOCK__SDMA,
2275+ &sdma_v4_4_2_aca_info, NULL);
2276+}
2277+
22072278 static struct amdgpu_sdma_ras sdma_v4_4_2_ras = {
22082279 .ras_block = {
22092280 .hw_ops = &sdma_v4_4_2_ras_hw_ops,
2281+ .ras_late_init = sdma_v4_4_2_ras_late_init,
22102282 },
22112283 };
22122284
drivers/gpu/drm/amd/amdgpu/si_ih.c+6−0
@@ -119,6 +119,12 @@ static u32 si_ih_get_wptr(struct amdgpu_device *adev, · 118 unmodified lines
119119 tmp = RREG32(IH_RB_CNTL);
120120 tmp |= IH_RB_CNTL__WPTR_OVERFLOW_CLEAR_MASK;
121121 WREG32(IH_RB_CNTL, tmp);
122+
123+ /* Unset the CLEAR_OVERFLOW bit immediately so new overflows
124+ * can be detected.
125+ */
126+ tmp &= ~IH_RB_CNTL__WPTR_OVERFLOW_CLEAR_MASK;
127+ WREG32(IH_RB_CNTL, tmp);
122128 }
123129 return (wptr & ih->ptr_mask);
124130 }
drivers/gpu/drm/amd/amdgpu/soc15.c+22−0
@@ -1298,10 +1298,32 @@ static int soc15_common_suspend(void *handle) · 1297 unmodified lines
12981298 return soc15_common_hw_fini(adev);
12991299 }
13001300
1301+static bool soc15_need_reset_on_resume(struct amdgpu_device *adev)
1302+{
1303+ u32 sol_reg;
1304+
1305+ sol_reg = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81);
1306+
1307+ /* Will reset for the following suspend abort cases.
1308+ * 1) Only reset limit on APU side, dGPU hasn't checked yet.
1309+ * 2) S3 suspend abort and TOS already launched.
1310+ */
1311+ if (adev->flags & AMD_IS_APU && adev->in_s3 &&
1312+ !adev->suspend_complete &&
1313+ sol_reg)
1314+ return true;
1315+
1316+ return false;
1317+}
1318+
13011319 static int soc15_common_resume(void *handle)
13021320 {
13031321 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
13041322
1323+ if (soc15_need_reset_on_resume(adev)) {
1324+ dev_info(adev->dev, "S3 suspend abort case, let's reset ASIC.\n");
1325+ soc15_asic_reset(adev);
1326+ }
13051327 return soc15_common_hw_init(adev);
13061328 }
13071329
drivers/gpu/drm/amd/amdgpu/ta_ras_if.h+36−0
@@ -36,6 +36,9 @@ enum ras_command { · 35 unmodified lines
3636 TA_RAS_COMMAND__ENABLE_FEATURES = 0,
3737 TA_RAS_COMMAND__DISABLE_FEATURES,
3838 TA_RAS_COMMAND__TRIGGER_ERROR,
39+ TA_RAS_COMMAND__QUERY_BLOCK_INFO,
40+ TA_RAS_COMMAND__QUERY_SUB_BLOCK_INFO,
41+ TA_RAS_COMMAND__QUERY_ADDRESS,
3942 };
4043
4144 enum ta_ras_status {
@@ -105,6 +108,11 @@ enum ta_ras_error_type { · 63 unmodified lines
105108 TA_RAS_ERROR__POISON = 8,
106109 };
107110
111+enum ta_ras_address_type {
112+ TA_RAS_MCA_TO_PA,
113+ TA_RAS_PA_TO_MCA,
114+};
115+
108116 /* Input/output structures for RAS commands */
109117 /**********************************************************/
110118
@@ -133,12 +141,38 @@ struct ta_ras_init_flags { · 22 unmodified lines
133141 uint8_t channel_dis_num;
134142 };
135143
144+struct ta_ras_mca_addr {
145+ uint64_t err_addr;
146+ uint32_t ch_inst;
147+ uint32_t umc_inst;
148+ uint32_t node_inst;
149+};
150+
151+struct ta_ras_phy_addr {
152+ uint64_t pa;
153+ uint32_t bank;
154+ uint32_t channel_idx;
155+};
156+
157+struct ta_ras_query_address_input {
158+ enum ta_ras_address_type addr_type;
159+ struct ta_ras_mca_addr ma;
160+ struct ta_ras_phy_addr pa;
161+};
162+
136163 struct ta_ras_output_flags {
137164 uint8_t ras_init_success_flag;
138165 uint8_t err_inject_switch_disable_flag;
139166 uint8_t reg_access_failure_flag;
140167 };
141168
169+struct ta_ras_query_address_output {
170+ /* don't use the flags here */
171+ struct ta_ras_output_flags flags;
172+ struct ta_ras_mca_addr ma;
173+ struct ta_ras_phy_addr pa;
174+};
175+
142176 /* Common input structure for RAS callbacks */
143177 /**********************************************************/
144178 union ta_ras_cmd_input {
@@ -146,12 +180,14 @@ union ta_ras_cmd_input { · 1 unmodified line
146180 struct ta_ras_enable_features_input enable_features;
147181 struct ta_ras_disable_features_input disable_features;
148182 struct ta_ras_trigger_error_input trigger_error;
183+ struct ta_ras_query_address_input address;
149184
150185 uint32_t reserve_pad[256];
151186 };
152187
153188 union ta_ras_cmd_output {
154189 struct ta_ras_output_flags flags;
190+ struct ta_ras_query_address_output address;
155191
156192 uint32_t reserve_pad[256];
157193 };
drivers/gpu/drm/amd/amdgpu/tonga_ih.c+6−0
@@ -219,6 +219,12 @@ static u32 tonga_ih_get_wptr(struct amdgpu_device *adev, · 218 unmodified lines
219219 tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);
220220 WREG32(mmIH_RB_CNTL, tmp);
221221
222+ /* Unset the CLEAR_OVERFLOW bit immediately so new overflows
223+ * can be detected.
224+ */
225+ tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 0);
226+ WREG32(mmIH_RB_CNTL, tmp);
227+
222228 out:
223229 return (wptr & ih->ptr_mask);
224230 }
drivers/gpu/drm/amd/amdgpu/umc_v12_0.c+187−75
@@ -89,12 +89,28 @@ static void umc_v12_0_reset_error_count(struct amdgpu_device *adev) · 88 unmodified lines
8989 umc_v12_0_reset_error_count_per_channel, NULL);
9090 }
9191
92+bool umc_v12_0_is_deferred_error(struct amdgpu_device *adev, uint64_t mc_umc_status)
93+{
94+ dev_info(adev->dev,
95+ "MCA_UMC_STATUS(0x%llx): Val:%llu, Poison:%llu, Deferred:%llu, PCC:%llu, UC:%llu, TCC:%llu\n",
96+ mc_umc_status,
97+ REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, Val),
98+ REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, Poison),
99+ REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, Deferred),
100+ REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, PCC),
101+ REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, UC),
102+ REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, TCC)
103+ );
104+
105+ return (amdgpu_ras_is_poison_mode_supported(adev) &&
106+ (REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, Val) == 1) &&
107+ (REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, Deferred) == 1));
108+}
109+
92110 bool umc_v12_0_is_uncorrectable_error(struct amdgpu_device *adev, uint64_t mc_umc_status)
93111 {
94− if (amdgpu_ras_is_poison_mode_supported(adev) &&
95− (REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, Val) == 1) &&
96− (REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, Deferred) == 1))
97− return true;
112+ if (umc_v12_0_is_deferred_error(adev, mc_umc_status))
113+ return false;
98114
99115 return ((REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, Val) == 1) &&
100116 (REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, PCC) == 1 ||
@@ -104,9 +120,7 @@ bool umc_v12_0_is_uncorrectable_error(struct amdgpu_device *adev, uint64_t mc_um · 3 unmodified lines
104120
105121 bool umc_v12_0_is_correctable_error(struct amdgpu_device *adev, uint64_t mc_umc_status)
106122 {
107− if (amdgpu_ras_is_poison_mode_supported(adev) &&
108− (REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, Val) == 1) &&
109− (REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, Deferred) == 1))
123+ if (umc_v12_0_is_deferred_error(adev, mc_umc_status))
110124 return false;
111125
112126 return (REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, Val) == 1 &&
@@ -119,9 +133,10 @@ bool umc_v12_0_is_correctable_error(struct amdgpu_device *adev, uint64_t mc_umc_ · 6 unmodified lines
119133 !(umc_v12_0_is_uncorrectable_error(adev, mc_umc_status)))));
120134 }
121135
122−static void umc_v12_0_query_correctable_error_count(struct amdgpu_device *adev,
136+static void umc_v12_0_query_error_count_per_type(struct amdgpu_device *adev,
123137 uint64_t umc_reg_offset,
124− unsigned long *error_count)
138+ unsigned long *error_count,
139+ check_error_type_func error_type_func)
125140 {
126141 uint64_t mc_umc_status;
127142 uint64_t mc_umc_status_addr;
@@ -129,31 +144,11 @@ static void umc_v12_0_query_correctable_error_count(struct amdgpu_device *adev, · 1 unmodified line
129144 mc_umc_status_addr =
130145 SOC15_REG_OFFSET(UMC, 0, regMCA_UMC_UMC0_MCUMC_STATUST0);
131146
132− /* Rely on MCUMC_STATUS for correctable error counter
133− * MCUMC_STATUS is a 64 bit register
134− */
147+ /* Check MCUMC_STATUS */
135148 mc_umc_status =
136149 RREG64_PCIE_EXT((mc_umc_status_addr + umc_reg_offset) * 4);
137150
138− if (umc_v12_0_is_correctable_error(adev, mc_umc_status))
139− *error_count += 1;
140−}
141−
142−static void umc_v12_0_query_uncorrectable_error_count(struct amdgpu_device *adev,
143− uint64_t umc_reg_offset,
144− unsigned long *error_count)
145−{
146− uint64_t mc_umc_status;
147− uint64_t mc_umc_status_addr;
148−
149− mc_umc_status_addr =
150− SOC15_REG_OFFSET(UMC, 0, regMCA_UMC_UMC0_MCUMC_STATUST0);
151−
152− /* Check the MCUMC_STATUS. */
153− mc_umc_status =
154− RREG64_PCIE_EXT((mc_umc_status_addr + umc_reg_offset) * 4);
155−
156− if (umc_v12_0_is_uncorrectable_error(adev, mc_umc_status))
151+ if (error_type_func(adev, mc_umc_status))
157152 *error_count += 1;
158153 }
159154
@@ -162,7 +157,7 @@ static int umc_v12_0_query_error_count(struct amdgpu_device *adev, · 2 unmodified lines
162157 uint32_t ch_inst, void *data)
163158 {
164159 struct ras_err_data *err_data = (struct ras_err_data *)data;
165− unsigned long ue_count = 0, ce_count = 0;
160+ unsigned long ue_count = 0, ce_count = 0, de_count = 0;
166161
167162 /* NOTE: node_inst is converted by adev->umc.active_mask and the range is [0-3],
168163 * which can be used as die ID directly */
@@ -174,11 +169,16 @@ static int umc_v12_0_query_error_count(struct amdgpu_device *adev, · 5 unmodified lines
174169 uint64_t umc_reg_offset =
175170 get_umc_v12_0_reg_offset(adev, node_inst, umc_inst, ch_inst);
176171
177− umc_v12_0_query_correctable_error_count(adev, umc_reg_offset, &ce_count);
178− umc_v12_0_query_uncorrectable_error_count(adev, umc_reg_offset, &ue_count);
172+ umc_v12_0_query_error_count_per_type(adev, umc_reg_offset,
173+ &ce_count, umc_v12_0_is_correctable_error);
174+ umc_v12_0_query_error_count_per_type(adev, umc_reg_offset,
175+ &ue_count, umc_v12_0_is_uncorrectable_error);
176+ umc_v12_0_query_error_count_per_type(adev, umc_reg_offset,
177+ &de_count, umc_v12_0_is_deferred_error);
179178
180179 amdgpu_ras_error_statistic_ue_count(err_data, &mcm_info, NULL, ue_count);
181180 amdgpu_ras_error_statistic_ce_count(err_data, &mcm_info, NULL, ce_count);
181+ amdgpu_ras_error_statistic_de_count(err_data, &mcm_info, NULL, de_count);
182182
183183 return 0;
184184 }
@@ -203,14 +203,14 @@ static bool umc_v12_0_bit_wise_xor(uint32_t val) · 18 unmodified lines
203203 return result;
204204 }
205205
206−static void umc_v12_0_convert_error_address(struct amdgpu_device *adev,
207− struct ras_err_data *err_data, uint64_t err_addr,
208− uint32_t ch_inst, uint32_t umc_inst,
209− uint32_t node_inst)
206+static void umc_v12_0_mca_addr_to_pa(struct amdgpu_device *adev,
207+ uint64_t err_addr, uint32_t ch_inst, uint32_t umc_inst,
208+ uint32_t node_inst,
209+ struct ta_ras_query_address_output *addr_out)
210210 {
211211 uint32_t channel_index, i;
212− uint64_t soc_pa, na, retired_page, column;
213− uint32_t bank_hash0, bank_hash1, bank_hash2, bank_hash3, col, row, row_xor;
212+ uint64_t na, soc_pa;
213+ uint32_t bank_hash0, bank_hash1, bank_hash2, bank_hash3, col, row;
214214 uint32_t bank0, bank1, bank2, bank3, bank;
215215
216216 bank_hash0 = (err_addr >> UMC_V12_0_MCA_B0_BIT) & 0x1ULL;
@@ -260,12 +260,44 @@ static void umc_v12_0_convert_error_address(struct amdgpu_device *adev, · 43 unmodified lines
260260 /* the umc channel bits are not original values, they are hashed */
261261 UMC_V12_0_SET_CHANNEL_HASH(channel_index, soc_pa);
262262
263+ addr_out->pa.pa = soc_pa;
264+ addr_out->pa.bank = bank;
265+ addr_out->pa.channel_idx = channel_index;
266+}
267+
268+static void umc_v12_0_convert_error_address(struct amdgpu_device *adev,
269+ struct ras_err_data *err_data, uint64_t err_addr,
270+ uint32_t ch_inst, uint32_t umc_inst,
271+ uint32_t node_inst)
272+{
273+ uint32_t col, row, row_xor, bank, channel_index;
274+ uint64_t soc_pa, retired_page, column;
275+ struct ta_ras_query_address_input addr_in;
276+ struct ta_ras_query_address_output addr_out;
277+
278+ addr_in.addr_type = TA_RAS_MCA_TO_PA;
279+ addr_in.ma.err_addr = err_addr;
280+ addr_in.ma.ch_inst = ch_inst;
281+ addr_in.ma.umc_inst = umc_inst;
282+ addr_in.ma.node_inst = node_inst;
283+
284+ if (psp_ras_query_address(&adev->psp, &addr_in, &addr_out))
285+ /* fallback to old path if fail to get pa from psp */
286+ umc_v12_0_mca_addr_to_pa(adev, err_addr, ch_inst, umc_inst,
287+ node_inst, &addr_out);
288+
289+ soc_pa = addr_out.pa.pa;
290+ bank = addr_out.pa.bank;
291+ channel_index = addr_out.pa.channel_idx;
292+
293+ col = (err_addr >> 1) & 0x1fULL;
294+ row = (err_addr >> 10) & 0x3fffULL;
295+ row_xor = row ^ (0x1ULL << 13);
263296 /* clear [C3 C2] in soc physical address */
264297 soc_pa &= ~(0x3ULL << UMC_V12_0_PA_C2_BIT);
265298 /* clear [C4] in soc physical address */
266299 soc_pa &= ~(0x1ULL << UMC_V12_0_PA_C4_BIT);
267300
268− row_xor = row ^ (0x1ULL << 13);
269301 /* loop for all possibilities of [C4 C3 C2] */
270302 for (column = 0; column < UMC_V12_0_NA_MAP_PA_NUM; column++) {
271303 retired_page = soc_pa | ((column & 0x3) << UMC_V12_0_PA_C2_BIT);
@@ -316,10 +348,7 @@ static int umc_v12_0_query_error_address(struct amdgpu_device *adev, · 44 unmodified lines
316348 }
317349
318350 /* calculate error address if ue error is detected */
319− if (REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, Val) == 1 &&
320− REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, AddrV) == 1 &&
321− REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, UC) == 1) {
322−
351+ if (umc_v12_0_is_uncorrectable_error(adev, mc_umc_status)) {
323352 mc_umc_addrt0 =
324353 SOC15_REG_OFFSET(UMC, 0, regMCA_UMC_UMC0_MCUMC_ADDRT0);
325354
@@ -385,45 +414,69 @@ static void umc_v12_0_ecc_info_query_ras_error_address(struct amdgpu_device *ade · 59 unmodified lines
385414 {
386415 struct ras_err_node *err_node;
387416 uint64_t mc_umc_status;
417+ struct ras_err_info *err_info;
418+ struct ras_err_addr *mca_err_addr, *tmp;
388419 struct ras_err_data *err_data = (struct ras_err_data *)ras_error_status;
389420
390421 for_each_ras_error(err_node, err_data) {
391− mc_umc_status = err_node->err_info.err_addr.err_status;
392− if (!mc_umc_status)
422+ err_info = &err_node->err_info;
423+ if (list_empty(&err_info->err_addr_list))
393424 continue;
394425
395− if (umc_v12_0_is_uncorrectable_error(adev, mc_umc_status)) {
396− uint64_t mca_addr, err_addr, mca_ipid;
397− uint32_t InstanceIdLo;
398− struct amdgpu_smuio_mcm_config_info *mcm_info;
399−
400− mcm_info = &err_node->err_info.mcm_info;
401− mca_addr = err_node->err_info.err_addr.err_addr;
402− mca_ipid = err_node->err_info.err_addr.err_ipid;
403−
404− err_addr = REG_GET_FIELD(mca_addr, MCA_UMC_UMC0_MCUMC_ADDRT0, ErrorAddr);
405− InstanceIdLo = REG_GET_FIELD(mca_ipid, MCMP1_IPIDT0, InstanceIdLo);
406−
407− dev_info(adev->dev, "UMC:IPID:0x%llx, aid:%d, inst:%d, ch:%d, err_addr:0x%llx\n",
408− mca_ipid,
409− mcm_info->die_id,
410− MCA_IPID_LO_2_UMC_INST(InstanceIdLo),
411− MCA_IPID_LO_2_UMC_CH(InstanceIdLo),
412− err_addr);
413−
414− umc_v12_0_convert_error_address(adev,
415− err_data, err_addr,
416− MCA_IPID_LO_2_UMC_CH(InstanceIdLo),
417− MCA_IPID_LO_2_UMC_INST(InstanceIdLo),
418− mcm_info->die_id);
419−
420− /* Clear umc error address content */
421− memset(&err_node->err_info.err_addr,
422− 0, sizeof(err_node->err_info.err_addr));
426+ list_for_each_entry_safe(mca_err_addr, tmp, &err_info->err_addr_list, node) {
427+ mc_umc_status = mca_err_addr->err_status;
428+ if (mc_umc_status &&
429+ (umc_v12_0_is_uncorrectable_error(adev, mc_umc_status) ||
430+ umc_v12_0_is_deferred_error(adev, mc_umc_status))) {
431+ uint64_t mca_addr, err_addr, mca_ipid;
432+ uint32_t InstanceIdLo;
433+
434+ mca_addr = mca_err_addr->err_addr;
435+ mca_ipid = mca_err_addr->err_ipid;
436+
437+ err_addr = REG_GET_FIELD(mca_addr,
438+ MCA_UMC_UMC0_MCUMC_ADDRT0, ErrorAddr);
439+ InstanceIdLo = REG_GET_FIELD(mca_ipid, MCMP1_IPIDT0, InstanceIdLo);
440+
441+ dev_info(adev->dev, "UMC:IPID:0x%llx, aid:%d, inst:%d, ch:%d, err_addr:0x%llx\n",
442+ mca_ipid,
443+ err_info->mcm_info.die_id,
444+ MCA_IPID_LO_2_UMC_INST(InstanceIdLo),
445+ MCA_IPID_LO_2_UMC_CH(InstanceIdLo),
446+ err_addr);
447+
448+ umc_v12_0_convert_error_address(adev,
449+ err_data, err_addr,
450+ MCA_IPID_LO_2_UMC_CH(InstanceIdLo),
451+ MCA_IPID_LO_2_UMC_INST(InstanceIdLo),
452+ err_info->mcm_info.die_id);
453+ }
454+
455+ /* Delete error address node from list and free memory */
456+ amdgpu_ras_del_mca_err_addr(err_info, mca_err_addr);
423457 }
424458 }
425459 }
426460
461+static bool umc_v12_0_check_ecc_err_status(struct amdgpu_device *adev,
462+ enum amdgpu_mca_error_type type, void *ras_error_status)
463+{
464+ uint64_t mc_umc_status = *(uint64_t *)ras_error_status;
465+
466+ switch (type) {
467+ case AMDGPU_MCA_ERROR_TYPE_UE:
468+ return umc_v12_0_is_uncorrectable_error(adev, mc_umc_status);
469+ case AMDGPU_MCA_ERROR_TYPE_CE:
470+ return umc_v12_0_is_correctable_error(adev, mc_umc_status);
471+ case AMDGPU_MCA_ERROR_TYPE_DE:
472+ return umc_v12_0_is_deferred_error(adev, mc_umc_status);
473+ default:
474+ return false;
475+ }
476+
477+ return false;
478+}
479+
427480 static void umc_v12_0_err_cnt_init(struct amdgpu_device *adev)
428481 {
429482 amdgpu_umc_loop_channels(adev,
@@ -444,12 +497,71 @@ const struct amdgpu_ras_block_hw_ops umc_v12_0_ras_hw_ops = { · 14 unmodified lines
444497 .query_ras_error_address = umc_v12_0_query_ras_error_address,
445498 };
446499
500+static int umc_v12_0_aca_bank_generate_report(struct aca_handle *handle, struct aca_bank *bank, enum aca_error_type type,
501+ struct aca_bank_report *report, void *data)
502+{
503+ struct amdgpu_device *adev = handle->adev;
504+ u64 status;
505+ int ret;
506+
507+ ret = aca_bank_info_decode(bank, &report->info);
508+ if (ret)
509+ return ret;
510+
511+ status = bank->regs[ACA_REG_IDX_STATUS];
512+ switch (type) {
513+ case ACA_ERROR_TYPE_UE:
514+ if (umc_v12_0_is_uncorrectable_error(adev, status)) {
515+ report->count[type] = 1;
516+ }
517+ break;
518+ case ACA_ERROR_TYPE_CE:
519+ if (umc_v12_0_is_correctable_error(adev, status)) {
520+ report->count[type] = 1;
521+ }
522+ break;
523+ default:
524+ return -EINVAL;
525+ }
526+
527+ return 0;
528+}
529+
530+static const struct aca_bank_ops umc_v12_0_aca_bank_ops = {
531+ .aca_bank_generate_report = umc_v12_0_aca_bank_generate_report,
532+};
533+
534+const struct aca_info umc_v12_0_aca_info = {
535+ .hwip = ACA_HWIP_TYPE_UMC,
536+ .mask = ACA_ERROR_UE_MASK | ACA_ERROR_CE_MASK,
537+ .bank_ops = &umc_v12_0_aca_bank_ops,
538+};
539+
540+static int umc_v12_0_ras_late_init(struct amdgpu_device *adev, struct ras_common_if *ras_block)
541+{
542+ int ret;
543+
544+ ret = amdgpu_umc_ras_late_init(adev, ras_block);
545+ if (ret)
546+ return ret;
547+
548+ ret = amdgpu_ras_bind_aca(adev, AMDGPU_RAS_BLOCK__UMC,
549+ &umc_v12_0_aca_info, NULL);
550+ if (ret)
551+ return ret;
552+
553+ return 0;
554+}
555+
447556 struct amdgpu_umc_ras umc_v12_0_ras = {
448557 .ras_block = {
449558 .hw_ops = &umc_v12_0_ras_hw_ops,
559+ .ras_late_init = umc_v12_0_ras_late_init,
450560 },
451561 .err_cnt_init = umc_v12_0_err_cnt_init,
452562 .query_ras_poison_mode = umc_v12_0_query_ras_poison_mode,
453563 .ecc_info_query_ras_error_count = umc_v12_0_ecc_info_query_ras_error_count,
454564 .ecc_info_query_ras_error_address = umc_v12_0_ecc_info_query_ras_error_address,
565+ .check_ecc_err_status = umc_v12_0_check_ecc_err_status,
455566 };
567+
drivers/gpu/drm/amd/amdgpu/umc_v12_0.h+3−0
@@ -121,9 +121,12 @@ · 120 unmodified lines
121121 (((_ipid_lo) >> 12) & 0xF))
122122 #define MCA_IPID_LO_2_UMC_INST(_ipid_lo) (((_ipid_lo) >> 21) & 0x7)
123123
124+bool umc_v12_0_is_deferred_error(struct amdgpu_device *adev, uint64_t mc_umc_status);
124125 bool umc_v12_0_is_uncorrectable_error(struct amdgpu_device *adev, uint64_t mc_umc_status);
125126 bool umc_v12_0_is_correctable_error(struct amdgpu_device *adev, uint64_t mc_umc_status);
126127
128+typedef bool (*check_error_type_func)(struct amdgpu_device *adev, uint64_t mc_umc_status);
129+
127130 extern const uint32_t
128131 umc_v12_0_channel_idx_tbl[]
129132 [UMC_V12_0_UMC_INSTANCE_NUM]
drivers/gpu/drm/amd/amdgpu/umc_v6_0.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525
2626 static void umc_v6_0_init_registers(struct amdgpu_device *adev)
2727 {
28− unsigned i,j;
28+ unsigned i, j;
2929
3030 for (i = 0; i < 4; i++)
3131 for (j = 0; j < 4; j++)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c+0−17
@@ -2017,22 +2017,6 @@ static int vcn_v4_0_set_powergating_state(void *handle, enum amd_powergating_sta · 2016 unmodified lines
20172017 return ret;
20182018 }
20192019
2020−/**
2021− * vcn_v4_0_set_interrupt_state - set VCN block interrupt state
2022− *
2023− * @adev: amdgpu_device pointer
2024− * @source: interrupt sources
2025− * @type: interrupt types
2026− * @state: interrupt states
2027− *
2028− * Set VCN block interrupt state
2029− */
2030−static int vcn_v4_0_set_interrupt_state(struct amdgpu_device *adev, struct amdgpu_irq_src *source,
2031− unsigned type, enum amdgpu_interrupt_state state)
2032−{
2033− return 0;
2034−}
2035−
20362020 /**
20372021 * vcn_v4_0_set_ras_interrupt_state - set VCN block RAS interrupt state
20382022 *
@@ -2097,7 +2081,6 @@ static int vcn_v4_0_process_interrupt(struct amdgpu_device *adev, struct amdgpu_ · 58 unmodified lines
20972081 }
20982082
20992083 static const struct amdgpu_irq_src_funcs vcn_v4_0_irq_funcs = {
2100− .set = vcn_v4_0_set_interrupt_state,
21012084 .process = vcn_v4_0_process_interrupt,
21022085 };
21032086
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c+0−19
@@ -269,8 +269,6 @@ static int vcn_v4_0_5_hw_fini(void *handle) · 268 unmodified lines
269269 vcn_v4_0_5_set_powergating_state(adev, AMD_PG_STATE_GATE);
270270 }
271271 }
272−
273− amdgpu_irq_put(adev, &adev->vcn.inst[i].irq, 0);
274272 }
275273
276274 return 0;
@@ -1668,22 +1666,6 @@ static int vcn_v4_0_5_set_powergating_state(void *handle, enum amd_powergating_s · 1391 unmodified lines
16681666 return ret;
16691667 }
16701668
1671−/**
1672− * vcn_v4_0_5_set_interrupt_state - set VCN block interrupt state
1673− *
1674− * @adev: amdgpu_device pointer
1675− * @source: interrupt sources
1676− * @type: interrupt types
1677− * @state: interrupt states
1678− *
1679− * Set VCN block interrupt state
1680− */
1681−static int vcn_v4_0_5_set_interrupt_state(struct amdgpu_device *adev, struct amdgpu_irq_src *source,
1682− unsigned type, enum amdgpu_interrupt_state state)
1683−{
1684− return 0;
1685−}
1686−
16871669 /**
16881670 * vcn_v4_0_5_process_interrupt - process VCN block interrupt
16891671 *
@@ -1726,7 +1708,6 @@ static int vcn_v4_0_5_process_interrupt(struct amdgpu_device *adev, struct amdgp · 36 unmodified lines
17261708 }
17271709
17281710 static const struct amdgpu_irq_src_funcs vcn_v4_0_5_irq_funcs = {
1729− .set = vcn_v4_0_5_set_interrupt_state,
17301711 .process = vcn_v4_0_5_process_interrupt,
17311712 };
17321713
drivers/gpu/drm/amd/amdgpu/vega10_ih.c+6−0
@@ -373,6 +373,12 @@ static u32 vega10_ih_get_wptr(struct amdgpu_device *adev, · 372 unmodified lines
373373 tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);
374374 WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);
375375
376+ /* Unset the CLEAR_OVERFLOW bit immediately so new overflows
377+ * can be detected.
378+ */
379+ tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 0);
380+ WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);
381+
376382 out:
377383 return (wptr & ih->ptr_mask);
378384 }
drivers/gpu/drm/amd/amdgpu/vega20_ih.c+6−0
@@ -421,6 +421,12 @@ static u32 vega20_ih_get_wptr(struct amdgpu_device *adev, · 420 unmodified lines
421421 tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);
422422 WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);
423423
424+ /* Unset the CLEAR_OVERFLOW bit immediately so new overflows
425+ * can be detected.
426+ */
427+ tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 0);
428+ WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);
429+
424430 out:
425431 return (wptr & ih->ptr_mask);
426432 }
drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h+7−7
@@ -674,7 +674,7 @@ static const uint32_t cwsr_trap_gfx9_hex[] = { · 673 unmodified lines
674674 0x86ea6a6a, 0x8f6e837a,
675675 0xb96ee0c2, 0xbf800002,
676676 0xb97a0002, 0xbf8a0000,
677− 0xbe801f6c, 0xbf810000,
677+ 0xbe801f6c, 0xbf9b0000,
678678 };
679679
680680 static const uint32_t cwsr_trap_nv1x_hex[] = {
@@ -1091,7 +1091,7 @@ static const uint32_t cwsr_trap_nv1x_hex[] = { · 410 unmodified lines
10911091 0xb9eef807, 0x876dff6d,
10921092 0x0000ffff, 0x87fe7e7e,
10931093 0x87ea6a6a, 0xb9faf802,
1094− 0xbe80226c, 0xbf810000,
1094+ 0xbe80226c, 0xbf9b0000,
10951095 0xbf9f0000, 0xbf9f0000,
10961096 0xbf9f0000, 0xbf9f0000,
10971097 0xbf9f0000, 0x00000000,
@@ -1574,7 +1574,7 @@ static const uint32_t cwsr_trap_arcturus_hex[] = { · 476 unmodified lines
15741574 0x86ea6a6a, 0x8f6e837a,
15751575 0xb96ee0c2, 0xbf800002,
15761576 0xb97a0002, 0xbf8a0000,
1577− 0xbe801f6c, 0xbf810000,
1577+ 0xbe801f6c, 0xbf9b0000,
15781578 };
15791579
15801580 static const uint32_t cwsr_trap_aldebaran_hex[] = {
@@ -2065,7 +2065,7 @@ static const uint32_t cwsr_trap_aldebaran_hex[] = { · 484 unmodified lines
20652065 0x86ea6a6a, 0x8f6e837a,
20662066 0xb96ee0c2, 0xbf800002,
20672067 0xb97a0002, 0xbf8a0000,
2068− 0xbe801f6c, 0xbf810000,
2068+ 0xbe801f6c, 0xbf9b0000,
20692069 };
20702070
20712071 static const uint32_t cwsr_trap_gfx10_hex[] = {
@@ -2500,7 +2500,7 @@ static const uint32_t cwsr_trap_gfx10_hex[] = { · 428 unmodified lines
25002500 0x876dff6d, 0x0000ffff,
25012501 0x87fe7e7e, 0x87ea6a6a,
25022502 0xb9faf802, 0xbe80226c,
2503− 0xbf810000, 0xbf9f0000,
2503+ 0xbf9b0000, 0xbf9f0000,
25042504 0xbf9f0000, 0xbf9f0000,
25052505 0xbf9f0000, 0xbf9f0000,
25062506 };
@@ -2944,7 +2944,7 @@ static const uint32_t cwsr_trap_gfx11_hex[] = { · 437 unmodified lines
29442944 0xb8eef802, 0xbf0d866e,
29452945 0xbfa20002, 0xb97af802,
29462946 0xbe80486c, 0xb97af802,
2947− 0xbe804a6c, 0xbfb00000,
2947+ 0xbe804a6c, 0xbfb10000,
29482948 0xbf9f0000, 0xbf9f0000,
29492949 0xbf9f0000, 0xbf9f0000,
29502950 0xbf9f0000, 0x00000000,
@@ -3436,5 +3436,5 @@ static const uint32_t cwsr_trap_gfx9_4_3_hex[] = { · 485 unmodified lines
34363436 0x86ea6a6a, 0x8f6e837a,
34373437 0xb96ee0c2, 0xbf800002,
34383438 0xb97a0002, 0xbf8a0000,
3439− 0xbe801f6c, 0xbf810000,
3439+ 0xbe801f6c, 0xbf9b0000,
34403440 };
drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx10.asm+1−1
@@ -1104,7 +1104,7 @@ L_RETURN_WITHOUT_PRIV: · 1103 unmodified lines
11041104 s_rfe_b64 s_restore_pc_lo //Return to the main shader program and resume execution
11051105
11061106 L_END_PGM:
1107− s_endpgm
1107+ s_endpgm_saved
11081108 end
11091109
11101110 function write_hwreg_to_mem(s, s_rsrc, s_mem_offset)
drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx9.asm+1−1
@@ -921,7 +921,7 @@ L_RESTORE: · 920 unmodified lines
921921 /* the END */
922922 /**************************************************************************/
923923 L_END_PGM:
924− s_endpgm
924+ s_endpgm_saved
925925
926926 end
927927
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c+3−1
@@ -1442,7 +1442,9 @@ static int kfd_ioctl_unmap_memory_from_gpu(struct file *filep, · 1441 unmodified lines
14421442 kfd_flush_tlb(peer_pdd, TLB_FLUSH_HEAVYWEIGHT);
14431443
14441444 /* Remove dma mapping after tlb flush to avoid IO_PAGE_FAULT */
1445− amdgpu_amdkfd_gpuvm_dmaunmap_mem(mem, peer_pdd->drm_priv);
1445+ err = amdgpu_amdkfd_gpuvm_dmaunmap_mem(mem, peer_pdd->drm_priv);
1446+ if (err)
1447+ goto sync_memory_failed;
14461448 }
14471449
14481450 mutex_unlock(&p->mutex);
drivers/gpu/drm/amd/amdkfd/kfd_crat.c+91−2
@@ -55,6 +55,7 @@ static struct kfd_gpu_cache_info kaveri_cache_info[] = { · 54 unmodified lines
5555 /* TCP L1 Cache per CU */
5656 .cache_size = 16,
5757 .cache_level = 1,
58+ .cache_line_size = 64,
5859 .flags = (CRAT_CACHE_FLAGS_ENABLED |
5960 CRAT_CACHE_FLAGS_DATA_CACHE |
6061 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -64,6 +65,7 @@ static struct kfd_gpu_cache_info kaveri_cache_info[] = { · 3 unmodified lines
6465 /* Scalar L1 Instruction Cache (in SQC module) per bank */
6566 .cache_size = 16,
6667 .cache_level = 1,
68+ .cache_line_size = 64,
6769 .flags = (CRAT_CACHE_FLAGS_ENABLED |
6870 CRAT_CACHE_FLAGS_INST_CACHE |
6971 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -73,6 +75,7 @@ static struct kfd_gpu_cache_info kaveri_cache_info[] = { · 3 unmodified lines
7375 /* Scalar L1 Data Cache (in SQC module) per bank */
7476 .cache_size = 8,
7577 .cache_level = 1,
78+ .cache_line_size = 64,
7679 .flags = (CRAT_CACHE_FLAGS_ENABLED |
7780 CRAT_CACHE_FLAGS_DATA_CACHE |
7881 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -88,6 +91,7 @@ static struct kfd_gpu_cache_info carrizo_cache_info[] = { · 9 unmodified lines
8891 /* TCP L1 Cache per CU */
8992 .cache_size = 16,
9093 .cache_level = 1,
94+ .cache_line_size = 64,
9195 .flags = (CRAT_CACHE_FLAGS_ENABLED |
9296 CRAT_CACHE_FLAGS_DATA_CACHE |
9397 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -95,8 +99,9 @@ static struct kfd_gpu_cache_info carrizo_cache_info[] = { · 1 unmodified line
9599 },
96100 {
97101 /* Scalar L1 Instruction Cache (in SQC module) per bank */
98− .cache_size = 8,
102+ .cache_size = 32,
99103 .cache_level = 1,
104+ .cache_line_size = 64,
100105 .flags = (CRAT_CACHE_FLAGS_ENABLED |
101106 CRAT_CACHE_FLAGS_INST_CACHE |
102107 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -104,8 +109,9 @@ static struct kfd_gpu_cache_info carrizo_cache_info[] = { · 1 unmodified line
104109 },
105110 {
106111 /* Scalar L1 Data Cache (in SQC module) per bank. */
107− .cache_size = 4,
112+ .cache_size = 16,
108113 .cache_level = 1,
114+ .cache_line_size = 64,
109115 .flags = (CRAT_CACHE_FLAGS_ENABLED |
110116 CRAT_CACHE_FLAGS_DATA_CACHE |
111117 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -135,6 +141,7 @@ static struct kfd_gpu_cache_info vega10_cache_info[] = { · 23 unmodified lines
135141 /* TCP L1 Cache per CU */
136142 .cache_size = 16,
137143 .cache_level = 1,
144+ .cache_line_size = 64,
138145 .flags = (CRAT_CACHE_FLAGS_ENABLED |
139146 CRAT_CACHE_FLAGS_DATA_CACHE |
140147 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -144,6 +151,7 @@ static struct kfd_gpu_cache_info vega10_cache_info[] = { · 3 unmodified lines
144151 /* Scalar L1 Instruction Cache per SQC */
145152 .cache_size = 32,
146153 .cache_level = 1,
154+ .cache_line_size = 64,
147155 .flags = (CRAT_CACHE_FLAGS_ENABLED |
148156 CRAT_CACHE_FLAGS_INST_CACHE |
149157 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -153,6 +161,7 @@ static struct kfd_gpu_cache_info vega10_cache_info[] = { · 3 unmodified lines
153161 /* Scalar L1 Data Cache per SQC */
154162 .cache_size = 16,
155163 .cache_level = 1,
164+ .cache_line_size = 64,
156165 .flags = (CRAT_CACHE_FLAGS_ENABLED |
157166 CRAT_CACHE_FLAGS_DATA_CACHE |
158167 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -162,6 +171,7 @@ static struct kfd_gpu_cache_info vega10_cache_info[] = { · 3 unmodified lines
162171 /* L2 Data Cache per GPU (Total Tex Cache) */
163172 .cache_size = 4096,
164173 .cache_level = 2,
174+ .cache_line_size = 64,
165175 .flags = (CRAT_CACHE_FLAGS_ENABLED |
166176 CRAT_CACHE_FLAGS_DATA_CACHE |
167177 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -174,6 +184,7 @@ static struct kfd_gpu_cache_info raven_cache_info[] = { · 6 unmodified lines
174184 /* TCP L1 Cache per CU */
175185 .cache_size = 16,
176186 .cache_level = 1,
187+ .cache_line_size = 64,
177188 .flags = (CRAT_CACHE_FLAGS_ENABLED |
178189 CRAT_CACHE_FLAGS_DATA_CACHE |
179190 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -183,6 +194,7 @@ static struct kfd_gpu_cache_info raven_cache_info[] = { · 3 unmodified lines
183194 /* Scalar L1 Instruction Cache per SQC */
184195 .cache_size = 32,
185196 .cache_level = 1,
197+ .cache_line_size = 64,
186198 .flags = (CRAT_CACHE_FLAGS_ENABLED |
187199 CRAT_CACHE_FLAGS_INST_CACHE |
188200 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -192,6 +204,7 @@ static struct kfd_gpu_cache_info raven_cache_info[] = { · 3 unmodified lines
192204 /* Scalar L1 Data Cache per SQC */
193205 .cache_size = 16,
194206 .cache_level = 1,
207+ .cache_line_size = 64,
195208 .flags = (CRAT_CACHE_FLAGS_ENABLED |
196209 CRAT_CACHE_FLAGS_DATA_CACHE |
197210 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -201,6 +214,7 @@ static struct kfd_gpu_cache_info raven_cache_info[] = { · 3 unmodified lines
201214 /* L2 Data Cache per GPU (Total Tex Cache) */
202215 .cache_size = 1024,
203216 .cache_level = 2,
217+ .cache_line_size = 64,
204218 .flags = (CRAT_CACHE_FLAGS_ENABLED |
205219 CRAT_CACHE_FLAGS_DATA_CACHE |
206220 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -213,6 +227,7 @@ static struct kfd_gpu_cache_info renoir_cache_info[] = { · 6 unmodified lines
213227 /* TCP L1 Cache per CU */
214228 .cache_size = 16,
215229 .cache_level = 1,
230+ .cache_line_size = 64,
216231 .flags = (CRAT_CACHE_FLAGS_ENABLED |
217232 CRAT_CACHE_FLAGS_DATA_CACHE |
218233 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -222,6 +237,7 @@ static struct kfd_gpu_cache_info renoir_cache_info[] = { · 3 unmodified lines
222237 /* Scalar L1 Instruction Cache per SQC */
223238 .cache_size = 32,
224239 .cache_level = 1,
240+ .cache_line_size = 64,
225241 .flags = (CRAT_CACHE_FLAGS_ENABLED |
226242 CRAT_CACHE_FLAGS_INST_CACHE |
227243 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -231,6 +247,7 @@ static struct kfd_gpu_cache_info renoir_cache_info[] = { · 3 unmodified lines
231247 /* Scalar L1 Data Cache per SQC */
232248 .cache_size = 16,
233249 .cache_level = 1,
250+ .cache_line_size = 64,
234251 .flags = (CRAT_CACHE_FLAGS_ENABLED |
235252 CRAT_CACHE_FLAGS_DATA_CACHE |
236253 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -240,6 +257,7 @@ static struct kfd_gpu_cache_info renoir_cache_info[] = { · 3 unmodified lines
240257 /* L2 Data Cache per GPU (Total Tex Cache) */
241258 .cache_size = 1024,
242259 .cache_level = 2,
260+ .cache_line_size = 64,
243261 .flags = (CRAT_CACHE_FLAGS_ENABLED |
244262 CRAT_CACHE_FLAGS_DATA_CACHE |
245263 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -252,6 +270,7 @@ static struct kfd_gpu_cache_info vega12_cache_info[] = { · 6 unmodified lines
252270 /* TCP L1 Cache per CU */
253271 .cache_size = 16,
254272 .cache_level = 1,
273+ .cache_line_size = 64,
255274 .flags = (CRAT_CACHE_FLAGS_ENABLED |
256275 CRAT_CACHE_FLAGS_DATA_CACHE |
257276 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -261,6 +280,7 @@ static struct kfd_gpu_cache_info vega12_cache_info[] = { · 3 unmodified lines
261280 /* Scalar L1 Instruction Cache per SQC */
262281 .cache_size = 32,
263282 .cache_level = 1,
283+ .cache_line_size = 64,
264284 .flags = (CRAT_CACHE_FLAGS_ENABLED |
265285 CRAT_CACHE_FLAGS_INST_CACHE |
266286 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -270,6 +290,7 @@ static struct kfd_gpu_cache_info vega12_cache_info[] = { · 3 unmodified lines
270290 /* Scalar L1 Data Cache per SQC */
271291 .cache_size = 16,
272292 .cache_level = 1,
293+ .cache_line_size = 64,
273294 .flags = (CRAT_CACHE_FLAGS_ENABLED |
274295 CRAT_CACHE_FLAGS_DATA_CACHE |
275296 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -279,6 +300,7 @@ static struct kfd_gpu_cache_info vega12_cache_info[] = { · 3 unmodified lines
279300 /* L2 Data Cache per GPU (Total Tex Cache) */
280301 .cache_size = 2048,
281302 .cache_level = 2,
303+ .cache_line_size = 64,
282304 .flags = (CRAT_CACHE_FLAGS_ENABLED |
283305 CRAT_CACHE_FLAGS_DATA_CACHE |
284306 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -291,6 +313,7 @@ static struct kfd_gpu_cache_info vega20_cache_info[] = { · 6 unmodified lines
291313 /* TCP L1 Cache per CU */
292314 .cache_size = 16,
293315 .cache_level = 1,
316+ .cache_line_size = 64,
294317 .flags = (CRAT_CACHE_FLAGS_ENABLED |
295318 CRAT_CACHE_FLAGS_DATA_CACHE |
296319 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -300,6 +323,7 @@ static struct kfd_gpu_cache_info vega20_cache_info[] = { · 3 unmodified lines
300323 /* Scalar L1 Instruction Cache per SQC */
301324 .cache_size = 32,
302325 .cache_level = 1,
326+ .cache_line_size = 64,
303327 .flags = (CRAT_CACHE_FLAGS_ENABLED |
304328 CRAT_CACHE_FLAGS_INST_CACHE |
305329 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -309,6 +333,7 @@ static struct kfd_gpu_cache_info vega20_cache_info[] = { · 3 unmodified lines
309333 /* Scalar L1 Data Cache per SQC */
310334 .cache_size = 16,
311335 .cache_level = 1,
336+ .cache_line_size = 64,
312337 .flags = (CRAT_CACHE_FLAGS_ENABLED |
313338 CRAT_CACHE_FLAGS_DATA_CACHE |
314339 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -318,6 +343,7 @@ static struct kfd_gpu_cache_info vega20_cache_info[] = { · 3 unmodified lines
318343 /* L2 Data Cache per GPU (Total Tex Cache) */
319344 .cache_size = 8192,
320345 .cache_level = 2,
346+ .cache_line_size = 64,
321347 .flags = (CRAT_CACHE_FLAGS_ENABLED |
322348 CRAT_CACHE_FLAGS_DATA_CACHE |
323349 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -330,6 +356,7 @@ static struct kfd_gpu_cache_info aldebaran_cache_info[] = { · 6 unmodified lines
330356 /* TCP L1 Cache per CU */
331357 .cache_size = 16,
332358 .cache_level = 1,
359+ .cache_line_size = 64,
333360 .flags = (CRAT_CACHE_FLAGS_ENABLED |
334361 CRAT_CACHE_FLAGS_DATA_CACHE |
335362 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -339,6 +366,7 @@ static struct kfd_gpu_cache_info aldebaran_cache_info[] = { · 3 unmodified lines
339366 /* Scalar L1 Instruction Cache per SQC */
340367 .cache_size = 32,
341368 .cache_level = 1,
369+ .cache_line_size = 64,
342370 .flags = (CRAT_CACHE_FLAGS_ENABLED |
343371 CRAT_CACHE_FLAGS_INST_CACHE |
344372 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -348,6 +376,7 @@ static struct kfd_gpu_cache_info aldebaran_cache_info[] = { · 3 unmodified lines
348376 /* Scalar L1 Data Cache per SQC */
349377 .cache_size = 16,
350378 .cache_level = 1,
379+ .cache_line_size = 64,
351380 .flags = (CRAT_CACHE_FLAGS_ENABLED |
352381 CRAT_CACHE_FLAGS_DATA_CACHE |
353382 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -357,6 +386,7 @@ static struct kfd_gpu_cache_info aldebaran_cache_info[] = { · 3 unmodified lines
357386 /* L2 Data Cache per GPU (Total Tex Cache) */
358387 .cache_size = 8192,
359388 .cache_level = 2,
389+ .cache_line_size = 128,
360390 .flags = (CRAT_CACHE_FLAGS_ENABLED |
361391 CRAT_CACHE_FLAGS_DATA_CACHE |
362392 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -369,6 +399,7 @@ static struct kfd_gpu_cache_info navi10_cache_info[] = { · 6 unmodified lines
369399 /* TCP L1 Cache per CU */
370400 .cache_size = 16,
371401 .cache_level = 1,
402+ .cache_line_size = 128,
372403 .flags = (CRAT_CACHE_FLAGS_ENABLED |
373404 CRAT_CACHE_FLAGS_DATA_CACHE |
374405 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -378,6 +409,7 @@ static struct kfd_gpu_cache_info navi10_cache_info[] = { · 3 unmodified lines
378409 /* Scalar L1 Instruction Cache per SQC */
379410 .cache_size = 32,
380411 .cache_level = 1,
412+ .cache_line_size = 64,
381413 .flags = (CRAT_CACHE_FLAGS_ENABLED |
382414 CRAT_CACHE_FLAGS_INST_CACHE |
383415 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -387,6 +419,7 @@ static struct kfd_gpu_cache_info navi10_cache_info[] = { · 3 unmodified lines
387419 /* Scalar L1 Data Cache per SQC */
388420 .cache_size = 16,
389421 .cache_level = 1,
422+ .cache_line_size = 64,
390423 .flags = (CRAT_CACHE_FLAGS_ENABLED |
391424 CRAT_CACHE_FLAGS_DATA_CACHE |
392425 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -396,6 +429,7 @@ static struct kfd_gpu_cache_info navi10_cache_info[] = { · 3 unmodified lines
396429 /* GL1 Data Cache per SA */
397430 .cache_size = 128,
398431 .cache_level = 1,
432+ .cache_line_size = 128,
399433 .flags = (CRAT_CACHE_FLAGS_ENABLED |
400434 CRAT_CACHE_FLAGS_DATA_CACHE |
401435 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -405,6 +439,7 @@ static struct kfd_gpu_cache_info navi10_cache_info[] = { · 3 unmodified lines
405439 /* L2 Data Cache per GPU (Total Tex Cache) */
406440 .cache_size = 4096,
407441 .cache_level = 2,
442+ .cache_line_size = 128,
408443 .flags = (CRAT_CACHE_FLAGS_ENABLED |
409444 CRAT_CACHE_FLAGS_DATA_CACHE |
410445 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -417,6 +452,7 @@ static struct kfd_gpu_cache_info vangogh_cache_info[] = { · 6 unmodified lines
417452 /* TCP L1 Cache per CU */
418453 .cache_size = 16,
419454 .cache_level = 1,
455+ .cache_line_size = 128,
420456 .flags = (CRAT_CACHE_FLAGS_ENABLED |
421457 CRAT_CACHE_FLAGS_DATA_CACHE |
422458 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -426,6 +462,7 @@ static struct kfd_gpu_cache_info vangogh_cache_info[] = { · 3 unmodified lines
426462 /* Scalar L1 Instruction Cache per SQC */
427463 .cache_size = 32,
428464 .cache_level = 1,
465+ .cache_line_size = 64,
429466 .flags = (CRAT_CACHE_FLAGS_ENABLED |
430467 CRAT_CACHE_FLAGS_INST_CACHE |
431468 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -435,6 +472,7 @@ static struct kfd_gpu_cache_info vangogh_cache_info[] = { · 3 unmodified lines
435472 /* Scalar L1 Data Cache per SQC */
436473 .cache_size = 16,
437474 .cache_level = 1,
475+ .cache_line_size = 64,
438476 .flags = (CRAT_CACHE_FLAGS_ENABLED |
439477 CRAT_CACHE_FLAGS_DATA_CACHE |
440478 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -444,6 +482,7 @@ static struct kfd_gpu_cache_info vangogh_cache_info[] = { · 3 unmodified lines
444482 /* GL1 Data Cache per SA */
445483 .cache_size = 128,
446484 .cache_level = 1,
485+ .cache_line_size = 128,
447486 .flags = (CRAT_CACHE_FLAGS_ENABLED |
448487 CRAT_CACHE_FLAGS_DATA_CACHE |
449488 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -453,6 +492,7 @@ static struct kfd_gpu_cache_info vangogh_cache_info[] = { · 3 unmodified lines
453492 /* L2 Data Cache per GPU (Total Tex Cache) */
454493 .cache_size = 1024,
455494 .cache_level = 2,
495+ .cache_line_size = 128,
456496 .flags = (CRAT_CACHE_FLAGS_ENABLED |
457497 CRAT_CACHE_FLAGS_DATA_CACHE |
458498 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -465,6 +505,7 @@ static struct kfd_gpu_cache_info navi14_cache_info[] = { · 6 unmodified lines
465505 /* TCP L1 Cache per CU */
466506 .cache_size = 16,
467507 .cache_level = 1,
508+ .cache_line_size = 128,
468509 .flags = (CRAT_CACHE_FLAGS_ENABLED |
469510 CRAT_CACHE_FLAGS_DATA_CACHE |
470511 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -474,6 +515,7 @@ static struct kfd_gpu_cache_info navi14_cache_info[] = { · 3 unmodified lines
474515 /* Scalar L1 Instruction Cache per SQC */
475516 .cache_size = 32,
476517 .cache_level = 1,
518+ .cache_line_size = 64,
477519 .flags = (CRAT_CACHE_FLAGS_ENABLED |
478520 CRAT_CACHE_FLAGS_INST_CACHE |
479521 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -483,6 +525,7 @@ static struct kfd_gpu_cache_info navi14_cache_info[] = { · 3 unmodified lines
483525 /* Scalar L1 Data Cache per SQC */
484526 .cache_size = 16,
485527 .cache_level = 1,
528+ .cache_line_size = 64,
486529 .flags = (CRAT_CACHE_FLAGS_ENABLED |
487530 CRAT_CACHE_FLAGS_DATA_CACHE |
488531 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -492,6 +535,7 @@ static struct kfd_gpu_cache_info navi14_cache_info[] = { · 3 unmodified lines
492535 /* GL1 Data Cache per SA */
493536 .cache_size = 128,
494537 .cache_level = 1,
538+ .cache_line_size = 128,
495539 .flags = (CRAT_CACHE_FLAGS_ENABLED |
496540 CRAT_CACHE_FLAGS_DATA_CACHE |
497541 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -501,6 +545,7 @@ static struct kfd_gpu_cache_info navi14_cache_info[] = { · 3 unmodified lines
501545 /* L2 Data Cache per GPU (Total Tex Cache) */
502546 .cache_size = 2048,
503547 .cache_level = 2,
548+ .cache_line_size = 128,
504549 .flags = (CRAT_CACHE_FLAGS_ENABLED |
505550 CRAT_CACHE_FLAGS_DATA_CACHE |
506551 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -513,6 +558,7 @@ static struct kfd_gpu_cache_info sienna_cichlid_cache_info[] = { · 6 unmodified lines
513558 /* TCP L1 Cache per CU */
514559 .cache_size = 16,
515560 .cache_level = 1,
561+ .cache_line_size = 128,
516562 .flags = (CRAT_CACHE_FLAGS_ENABLED |
517563 CRAT_CACHE_FLAGS_DATA_CACHE |
518564 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -522,6 +568,7 @@ static struct kfd_gpu_cache_info sienna_cichlid_cache_info[] = { · 3 unmodified lines
522568 /* Scalar L1 Instruction Cache per SQC */
523569 .cache_size = 32,
524570 .cache_level = 1,
571+ .cache_line_size = 64,
525572 .flags = (CRAT_CACHE_FLAGS_ENABLED |
526573 CRAT_CACHE_FLAGS_INST_CACHE |
527574 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -531,6 +578,7 @@ static struct kfd_gpu_cache_info sienna_cichlid_cache_info[] = { · 3 unmodified lines
531578 /* Scalar L1 Data Cache per SQC */
532579 .cache_size = 16,
533580 .cache_level = 1,
581+ .cache_line_size = 64,
534582 .flags = (CRAT_CACHE_FLAGS_ENABLED |
535583 CRAT_CACHE_FLAGS_DATA_CACHE |
536584 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -540,6 +588,7 @@ static struct kfd_gpu_cache_info sienna_cichlid_cache_info[] = { · 3 unmodified lines
540588 /* GL1 Data Cache per SA */
541589 .cache_size = 128,
542590 .cache_level = 1,
591+ .cache_line_size = 128,
543592 .flags = (CRAT_CACHE_FLAGS_ENABLED |
544593 CRAT_CACHE_FLAGS_DATA_CACHE |
545594 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -549,6 +598,7 @@ static struct kfd_gpu_cache_info sienna_cichlid_cache_info[] = { · 3 unmodified lines
549598 /* L2 Data Cache per GPU (Total Tex Cache) */
550599 .cache_size = 4096,
551600 .cache_level = 2,
601+ .cache_line_size = 128,
552602 .flags = (CRAT_CACHE_FLAGS_ENABLED |
553603 CRAT_CACHE_FLAGS_DATA_CACHE |
554604 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -558,6 +608,7 @@ static struct kfd_gpu_cache_info sienna_cichlid_cache_info[] = { · 3 unmodified lines
558608 /* L3 Data Cache per GPU */
559609 .cache_size = 128*1024,
560610 .cache_level = 3,
611+ .cache_line_size = 64,
561612 .flags = (CRAT_CACHE_FLAGS_ENABLED |
562613 CRAT_CACHE_FLAGS_DATA_CACHE |
563614 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -570,6 +621,7 @@ static struct kfd_gpu_cache_info navy_flounder_cache_info[] = { · 6 unmodified lines
570621 /* TCP L1 Cache per CU */
571622 .cache_size = 16,
572623 .cache_level = 1,
624+ .cache_line_size = 128,
573625 .flags = (CRAT_CACHE_FLAGS_ENABLED |
574626 CRAT_CACHE_FLAGS_DATA_CACHE |
575627 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -579,6 +631,7 @@ static struct kfd_gpu_cache_info navy_flounder_cache_info[] = { · 3 unmodified lines
579631 /* Scalar L1 Instruction Cache per SQC */
580632 .cache_size = 32,
581633 .cache_level = 1,
634+ .cache_line_size = 64,
582635 .flags = (CRAT_CACHE_FLAGS_ENABLED |
583636 CRAT_CACHE_FLAGS_INST_CACHE |
584637 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -588,6 +641,7 @@ static struct kfd_gpu_cache_info navy_flounder_cache_info[] = { · 3 unmodified lines
588641 /* Scalar L1 Data Cache per SQC */
589642 .cache_size = 16,
590643 .cache_level = 1,
644+ .cache_line_size = 64,
591645 .flags = (CRAT_CACHE_FLAGS_ENABLED |
592646 CRAT_CACHE_FLAGS_DATA_CACHE |
593647 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -597,6 +651,7 @@ static struct kfd_gpu_cache_info navy_flounder_cache_info[] = { · 3 unmodified lines
597651 /* GL1 Data Cache per SA */
598652 .cache_size = 128,
599653 .cache_level = 1,
654+ .cache_line_size = 128,
600655 .flags = (CRAT_CACHE_FLAGS_ENABLED |
601656 CRAT_CACHE_FLAGS_DATA_CACHE |
602657 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -606,6 +661,7 @@ static struct kfd_gpu_cache_info navy_flounder_cache_info[] = { · 3 unmodified lines
606661 /* L2 Data Cache per GPU (Total Tex Cache) */
607662 .cache_size = 3072,
608663 .cache_level = 2,
664+ .cache_line_size = 128,
609665 .flags = (CRAT_CACHE_FLAGS_ENABLED |
610666 CRAT_CACHE_FLAGS_DATA_CACHE |
611667 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -615,6 +671,7 @@ static struct kfd_gpu_cache_info navy_flounder_cache_info[] = { · 3 unmodified lines
615671 /* L3 Data Cache per GPU */
616672 .cache_size = 96*1024,
617673 .cache_level = 3,
674+ .cache_line_size = 64,
618675 .flags = (CRAT_CACHE_FLAGS_ENABLED |
619676 CRAT_CACHE_FLAGS_DATA_CACHE |
620677 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -627,6 +684,7 @@ static struct kfd_gpu_cache_info dimgrey_cavefish_cache_info[] = { · 6 unmodified lines
627684 /* TCP L1 Cache per CU */
628685 .cache_size = 16,
629686 .cache_level = 1,
687+ .cache_line_size = 128,
630688 .flags = (CRAT_CACHE_FLAGS_ENABLED |
631689 CRAT_CACHE_FLAGS_DATA_CACHE |
632690 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -636,6 +694,7 @@ static struct kfd_gpu_cache_info dimgrey_cavefish_cache_info[] = { · 3 unmodified lines
636694 /* Scalar L1 Instruction Cache per SQC */
637695 .cache_size = 32,
638696 .cache_level = 1,
697+ .cache_line_size = 64,
639698 .flags = (CRAT_CACHE_FLAGS_ENABLED |
640699 CRAT_CACHE_FLAGS_INST_CACHE |
641700 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -645,6 +704,7 @@ static struct kfd_gpu_cache_info dimgrey_cavefish_cache_info[] = { · 3 unmodified lines
645704 /* Scalar L1 Data Cache per SQC */
646705 .cache_size = 16,
647706 .cache_level = 1,
707+ .cache_line_size = 64,
648708 .flags = (CRAT_CACHE_FLAGS_ENABLED |
649709 CRAT_CACHE_FLAGS_DATA_CACHE |
650710 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -654,6 +714,7 @@ static struct kfd_gpu_cache_info dimgrey_cavefish_cache_info[] = { · 3 unmodified lines
654714 /* GL1 Data Cache per SA */
655715 .cache_size = 128,
656716 .cache_level = 1,
717+ .cache_line_size = 128,
657718 .flags = (CRAT_CACHE_FLAGS_ENABLED |
658719 CRAT_CACHE_FLAGS_DATA_CACHE |
659720 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -663,6 +724,7 @@ static struct kfd_gpu_cache_info dimgrey_cavefish_cache_info[] = { · 3 unmodified lines
663724 /* L2 Data Cache per GPU (Total Tex Cache) */
664725 .cache_size = 2048,
665726 .cache_level = 2,
727+ .cache_line_size = 128,
666728 .flags = (CRAT_CACHE_FLAGS_ENABLED |
667729 CRAT_CACHE_FLAGS_DATA_CACHE |
668730 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -672,6 +734,7 @@ static struct kfd_gpu_cache_info dimgrey_cavefish_cache_info[] = { · 3 unmodified lines
672734 /* L3 Data Cache per GPU */
673735 .cache_size = 32*1024,
674736 .cache_level = 3,
737+ .cache_line_size = 64,
675738 .flags = (CRAT_CACHE_FLAGS_ENABLED |
676739 CRAT_CACHE_FLAGS_DATA_CACHE |
677740 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -684,6 +747,7 @@ static struct kfd_gpu_cache_info beige_goby_cache_info[] = { · 6 unmodified lines
684747 /* TCP L1 Cache per CU */
685748 .cache_size = 16,
686749 .cache_level = 1,
750+ .cache_line_size = 128,
687751 .flags = (CRAT_CACHE_FLAGS_ENABLED |
688752 CRAT_CACHE_FLAGS_DATA_CACHE |
689753 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -693,6 +757,7 @@ static struct kfd_gpu_cache_info beige_goby_cache_info[] = { · 3 unmodified lines
693757 /* Scalar L1 Instruction Cache per SQC */
694758 .cache_size = 32,
695759 .cache_level = 1,
760+ .cache_line_size = 64,
696761 .flags = (CRAT_CACHE_FLAGS_ENABLED |
697762 CRAT_CACHE_FLAGS_INST_CACHE |
698763 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -702,6 +767,7 @@ static struct kfd_gpu_cache_info beige_goby_cache_info[] = { · 3 unmodified lines
702767 /* Scalar L1 Data Cache per SQC */
703768 .cache_size = 16,
704769 .cache_level = 1,
770+ .cache_line_size = 64,
705771 .flags = (CRAT_CACHE_FLAGS_ENABLED |
706772 CRAT_CACHE_FLAGS_DATA_CACHE |
707773 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -711,6 +777,7 @@ static struct kfd_gpu_cache_info beige_goby_cache_info[] = { · 3 unmodified lines
711777 /* GL1 Data Cache per SA */
712778 .cache_size = 128,
713779 .cache_level = 1,
780+ .cache_line_size = 128,
714781 .flags = (CRAT_CACHE_FLAGS_ENABLED |
715782 CRAT_CACHE_FLAGS_DATA_CACHE |
716783 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -720,6 +787,7 @@ static struct kfd_gpu_cache_info beige_goby_cache_info[] = { · 3 unmodified lines
720787 /* L2 Data Cache per GPU (Total Tex Cache) */
721788 .cache_size = 1024,
722789 .cache_level = 2,
790+ .cache_line_size = 128,
723791 .flags = (CRAT_CACHE_FLAGS_ENABLED |
724792 CRAT_CACHE_FLAGS_DATA_CACHE |
725793 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -729,6 +797,7 @@ static struct kfd_gpu_cache_info beige_goby_cache_info[] = { · 3 unmodified lines
729797 /* L3 Data Cache per GPU */
730798 .cache_size = 16*1024,
731799 .cache_level = 3,
800+ .cache_line_size = 64,
732801 .flags = (CRAT_CACHE_FLAGS_ENABLED |
733802 CRAT_CACHE_FLAGS_DATA_CACHE |
734803 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -741,6 +810,7 @@ static struct kfd_gpu_cache_info yellow_carp_cache_info[] = { · 6 unmodified lines
741810 /* TCP L1 Cache per CU */
742811 .cache_size = 16,
743812 .cache_level = 1,
813+ .cache_line_size = 128,
744814 .flags = (CRAT_CACHE_FLAGS_ENABLED |
745815 CRAT_CACHE_FLAGS_DATA_CACHE |
746816 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -750,6 +820,7 @@ static struct kfd_gpu_cache_info yellow_carp_cache_info[] = { · 3 unmodified lines
750820 /* Scalar L1 Instruction Cache per SQC */
751821 .cache_size = 32,
752822 .cache_level = 1,
823+ .cache_line_size = 64,
753824 .flags = (CRAT_CACHE_FLAGS_ENABLED |
754825 CRAT_CACHE_FLAGS_INST_CACHE |
755826 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -759,6 +830,7 @@ static struct kfd_gpu_cache_info yellow_carp_cache_info[] = { · 3 unmodified lines
759830 /* Scalar L1 Data Cache per SQC */
760831 .cache_size = 16,
761832 .cache_level = 1,
833+ .cache_line_size = 64,
762834 .flags = (CRAT_CACHE_FLAGS_ENABLED |
763835 CRAT_CACHE_FLAGS_DATA_CACHE |
764836 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -768,6 +840,7 @@ static struct kfd_gpu_cache_info yellow_carp_cache_info[] = { · 3 unmodified lines
768840 /* GL1 Data Cache per SA */
769841 .cache_size = 128,
770842 .cache_level = 1,
843+ .cache_line_size = 128,
771844 .flags = (CRAT_CACHE_FLAGS_ENABLED |
772845 CRAT_CACHE_FLAGS_DATA_CACHE |
773846 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -777,6 +850,7 @@ static struct kfd_gpu_cache_info yellow_carp_cache_info[] = { · 3 unmodified lines
777850 /* L2 Data Cache per GPU (Total Tex Cache) */
778851 .cache_size = 2048,
779852 .cache_level = 2,
853+ .cache_line_size = 128,
780854 .flags = (CRAT_CACHE_FLAGS_ENABLED |
781855 CRAT_CACHE_FLAGS_DATA_CACHE |
782856 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -789,6 +863,7 @@ static struct kfd_gpu_cache_info gfx1037_cache_info[] = { · 6 unmodified lines
789863 /* TCP L1 Cache per CU */
790864 .cache_size = 16,
791865 .cache_level = 1,
866+ .cache_line_size = 128,
792867 .flags = (CRAT_CACHE_FLAGS_ENABLED |
793868 CRAT_CACHE_FLAGS_DATA_CACHE |
794869 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -798,6 +873,7 @@ static struct kfd_gpu_cache_info gfx1037_cache_info[] = { · 3 unmodified lines
798873 /* Scalar L1 Instruction Cache per SQC */
799874 .cache_size = 32,
800875 .cache_level = 1,
876+ .cache_line_size = 64,
801877 .flags = (CRAT_CACHE_FLAGS_ENABLED |
802878 CRAT_CACHE_FLAGS_INST_CACHE |
803879 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -807,6 +883,7 @@ static struct kfd_gpu_cache_info gfx1037_cache_info[] = { · 3 unmodified lines
807883 /* Scalar L1 Data Cache per SQC */
808884 .cache_size = 16,
809885 .cache_level = 1,
886+ .cache_line_size = 64,
810887 .flags = (CRAT_CACHE_FLAGS_ENABLED |
811888 CRAT_CACHE_FLAGS_DATA_CACHE |
812889 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -816,6 +893,7 @@ static struct kfd_gpu_cache_info gfx1037_cache_info[] = { · 3 unmodified lines
816893 /* GL1 Data Cache per SA */
817894 .cache_size = 128,
818895 .cache_level = 1,
896+ .cache_line_size = 128,
819897 .flags = (CRAT_CACHE_FLAGS_ENABLED |
820898 CRAT_CACHE_FLAGS_DATA_CACHE |
821899 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -825,6 +903,7 @@ static struct kfd_gpu_cache_info gfx1037_cache_info[] = { · 3 unmodified lines
825903 /* L2 Data Cache per GPU (Total Tex Cache) */
826904 .cache_size = 256,
827905 .cache_level = 2,
906+ .cache_line_size = 128,
828907 .flags = (CRAT_CACHE_FLAGS_ENABLED |
829908 CRAT_CACHE_FLAGS_DATA_CACHE |
830909 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -837,6 +916,7 @@ static struct kfd_gpu_cache_info gc_10_3_6_cache_info[] = { · 6 unmodified lines
837916 /* TCP L1 Cache per CU */
838917 .cache_size = 16,
839918 .cache_level = 1,
919+ .cache_line_size = 128,
840920 .flags = (CRAT_CACHE_FLAGS_ENABLED |
841921 CRAT_CACHE_FLAGS_DATA_CACHE |
842922 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -846,6 +926,7 @@ static struct kfd_gpu_cache_info gc_10_3_6_cache_info[] = { · 3 unmodified lines
846926 /* Scalar L1 Instruction Cache per SQC */
847927 .cache_size = 32,
848928 .cache_level = 1,
929+ .cache_line_size = 64,
849930 .flags = (CRAT_CACHE_FLAGS_ENABLED |
850931 CRAT_CACHE_FLAGS_INST_CACHE |
851932 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -855,6 +936,7 @@ static struct kfd_gpu_cache_info gc_10_3_6_cache_info[] = { · 3 unmodified lines
855936 /* Scalar L1 Data Cache per SQC */
856937 .cache_size = 16,
857938 .cache_level = 1,
939+ .cache_line_size = 64,
858940 .flags = (CRAT_CACHE_FLAGS_ENABLED |
859941 CRAT_CACHE_FLAGS_DATA_CACHE |
860942 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -864,6 +946,7 @@ static struct kfd_gpu_cache_info gc_10_3_6_cache_info[] = { · 3 unmodified lines
864946 /* GL1 Data Cache per SA */
865947 .cache_size = 128,
866948 .cache_level = 1,
949+ .cache_line_size = 128,
867950 .flags = (CRAT_CACHE_FLAGS_ENABLED |
868951 CRAT_CACHE_FLAGS_DATA_CACHE |
869952 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -873,6 +956,7 @@ static struct kfd_gpu_cache_info gc_10_3_6_cache_info[] = { · 3 unmodified lines
873956 /* L2 Data Cache per GPU (Total Tex Cache) */
874957 .cache_size = 256,
875958 .cache_level = 2,
959+ .cache_line_size = 128,
876960 .flags = (CRAT_CACHE_FLAGS_ENABLED |
877961 CRAT_CACHE_FLAGS_DATA_CACHE |
878962 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -885,6 +969,7 @@ static struct kfd_gpu_cache_info dummy_cache_info[] = { · 6 unmodified lines
885969 /* TCP L1 Cache per CU */
886970 .cache_size = 16,
887971 .cache_level = 1,
972+ .cache_line_size = 64,
888973 .flags = (CRAT_CACHE_FLAGS_ENABLED |
889974 CRAT_CACHE_FLAGS_DATA_CACHE |
890975 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -894,6 +979,7 @@ static struct kfd_gpu_cache_info dummy_cache_info[] = { · 3 unmodified lines
894979 /* Scalar L1 Instruction Cache per SQC */
895980 .cache_size = 32,
896981 .cache_level = 1,
982+ .cache_line_size = 64,
897983 .flags = (CRAT_CACHE_FLAGS_ENABLED |
898984 CRAT_CACHE_FLAGS_INST_CACHE |
899985 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -903,6 +989,7 @@ static struct kfd_gpu_cache_info dummy_cache_info[] = { · 3 unmodified lines
903989 /* Scalar L1 Data Cache per SQC */
904990 .cache_size = 16,
905991 .cache_level = 1,
992+ .cache_line_size = 64,
906993 .flags = (CRAT_CACHE_FLAGS_ENABLED |
907994 CRAT_CACHE_FLAGS_DATA_CACHE |
908995 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -912,6 +999,7 @@ static struct kfd_gpu_cache_info dummy_cache_info[] = { · 3 unmodified lines
912999 /* GL1 Data Cache per SA */
9131000 .cache_size = 128,
9141001 .cache_level = 1,
1002+ .cache_line_size = 64,
9151003 .flags = (CRAT_CACHE_FLAGS_ENABLED |
9161004 CRAT_CACHE_FLAGS_DATA_CACHE |
9171005 CRAT_CACHE_FLAGS_SIMD_CACHE),
@@ -921,6 +1009,7 @@ static struct kfd_gpu_cache_info dummy_cache_info[] = { · 3 unmodified lines
9211009 /* L2 Data Cache per GPU (Total Tex Cache) */
9221010 .cache_size = 2048,
9231011 .cache_level = 2,
1012+ .cache_line_size = 64,
9241013 .flags = (CRAT_CACHE_FLAGS_ENABLED |
9251014 CRAT_CACHE_FLAGS_DATA_CACHE |
9261015 CRAT_CACHE_FLAGS_SIMD_CACHE),
drivers/gpu/drm/amd/amdkfd/kfd_crat.h+1−0
@@ -303,6 +303,7 @@ struct kfd_node; · 302 unmodified lines
303303 struct kfd_gpu_cache_info {
304304 uint32_t cache_size;
305305 uint32_t cache_level;
306+ uint32_t cache_line_size;
306307 uint32_t flags;
307308 /* Indicates how many Compute Units share this cache
308309 * within a SA. Value = 1 indicates the cache is not shared
drivers/gpu/drm/amd/amdkfd/kfd_debug.c+3−1
@@ -1018,12 +1018,14 @@ int kfd_dbg_trap_device_snapshot(struct kfd_process *target, · 1017 unmodified lines
10181018 uint32_t *entry_size)
10191019 {
10201020 struct kfd_dbg_device_info_entry device_info;
1021− uint32_t tmp_entry_size = *entry_size, tmp_num_devices;
1021+ uint32_t tmp_entry_size, tmp_num_devices;
10221022 int i, r = 0;
10231023
10241024 if (!(target && user_info && number_of_device_infos && entry_size))
10251025 return -EINVAL;
10261026
1027+ tmp_entry_size = *entry_size;
1028+
10271029 tmp_num_devices = min_t(size_t, *number_of_device_infos, target->n_pdds);
10281030 *number_of_device_infos = target->n_pdds;
10291031 *entry_size = min_t(size_t, *entry_size, sizeof(device_info));
drivers/gpu/drm/amd/amdkfd/kfd_events.c+5−1
@@ -1285,8 +1285,10 @@ void kfd_signal_poison_consumed_event(struct kfd_node *dev, u32 pasid) · 1284 unmodified lines
12851285 uint32_t id = KFD_FIRST_NONSIGNAL_EVENT_ID;
12861286 int user_gpu_id;
12871287
1288− if (!p)
1288+ if (!p) {
1289+ dev_warn(dev->adev->dev, "Not find process with pasid:%d\n", pasid);
12891290 return; /* Presumably process exited. */
1291+ }
12901292
12911293 user_gpu_id = kfd_process_get_user_gpu_id(p, dev->id);
12921294 if (unlikely(user_gpu_id == -EINVAL)) {
@@ -1322,6 +1324,8 @@ void kfd_signal_poison_consumed_event(struct kfd_node *dev, u32 pasid) · 29 unmodified lines
13221324 }
13231325 }
13241326
1327+ dev_warn(dev->adev->dev, "Send SIGBUS to process %s(pasid:%d)\n",
1328+ p->lead_thread->comm, pasid);
13251329 rcu_read_unlock();
13261330
13271331 /* user application will handle SIGBUS signal */
drivers/gpu/drm/amd/amdkfd/kfd_int_process_v10.c+5−2
@@ -132,6 +132,7 @@ enum SQ_INTERRUPT_ERROR_TYPE { · 131 unmodified lines
132132 static void event_interrupt_poison_consumption(struct kfd_node *dev,
133133 uint16_t pasid, uint16_t client_id)
134134 {
135+ enum amdgpu_ras_block block = 0;
135136 int old_poison, ret = -EINVAL;
136137 struct kfd_process *p = kfd_lookup_process_by_pasid(pasid);
137138
@@ -151,12 +152,14 @@ static void event_interrupt_poison_consumption(struct kfd_node *dev, · 13 unmodified lines
151152 case SOC15_IH_CLIENTID_SE3SH:
152153 case SOC15_IH_CLIENTID_UTCL2:
153154 ret = kfd_dqm_evict_pasid(dev->dqm, pasid);
155+ block = AMDGPU_RAS_BLOCK__GFX;
154156 break;
155157 case SOC15_IH_CLIENTID_SDMA0:
156158 case SOC15_IH_CLIENTID_SDMA1:
157159 case SOC15_IH_CLIENTID_SDMA2:
158160 case SOC15_IH_CLIENTID_SDMA3:
159161 case SOC15_IH_CLIENTID_SDMA4:
162+ block = AMDGPU_RAS_BLOCK__SDMA;
160163 break;
161164 default:
162165 break;
@@ -171,12 +174,12 @@ static void event_interrupt_poison_consumption(struct kfd_node *dev, · 8 unmodified lines
171174 dev_warn(dev->adev->dev,
172175 "RAS poison consumption, unmap queue flow succeeded: client id %d\n",
173176 client_id);
174− amdgpu_amdkfd_ras_poison_consumption_handler(dev->adev, false);
177+ amdgpu_amdkfd_ras_poison_consumption_handler(dev->adev, block, false);
175178 } else {
176179 dev_warn(dev->adev->dev,
177180 "RAS poison consumption, fall back to gpu reset flow: client id %d\n",
178181 client_id);
179− amdgpu_amdkfd_ras_poison_consumption_handler(dev->adev, true);
182+ amdgpu_amdkfd_ras_poison_consumption_handler(dev->adev, block, true);
180183 }
181184 }
182185
drivers/gpu/drm/amd/amdkfd/kfd_int_process_v11.c+5−2
@@ -191,6 +191,7 @@ static void print_sq_intr_info_error(uint32_t context_id0, uint32_t context_id1) · 190 unmodified lines
191191 static void event_interrupt_poison_consumption_v11(struct kfd_node *dev,
192192 uint16_t pasid, uint16_t source_id)
193193 {
194+ enum amdgpu_ras_block block = 0;
194195 int ret = -EINVAL;
195196 struct kfd_process *p = kfd_lookup_process_by_pasid(pasid);
196197
@@ -210,9 +211,11 @@ static void event_interrupt_poison_consumption_v11(struct kfd_node *dev, · 13 unmodified lines
210211 case SOC15_INTSRC_SQ_INTERRUPT_MSG:
211212 if (dev->dqm->ops.reset_queues)
212213 ret = dev->dqm->ops.reset_queues(dev->dqm, pasid);
214+ block = AMDGPU_RAS_BLOCK__GFX;
213215 break;
214216 case SOC21_INTSRC_SDMA_ECC:
215217 default:
218+ block = AMDGPU_RAS_BLOCK__GFX;
216219 break;
217220 }
218221
@@ -221,9 +224,9 @@ static void event_interrupt_poison_consumption_v11(struct kfd_node *dev, · 2 unmodified lines
221224 /* resetting queue passes, do page retirement without gpu reset
222225 resetting queue fails, fallback to gpu reset solution */
223226 if (!ret)
224− amdgpu_amdkfd_ras_poison_consumption_handler(dev->adev, false);
227+ amdgpu_amdkfd_ras_poison_consumption_handler(dev->adev, block, false);
225228 else
226− amdgpu_amdkfd_ras_poison_consumption_handler(dev->adev, true);
229+ amdgpu_amdkfd_ras_poison_consumption_handler(dev->adev, block, true);
227230 }
228231
229232 static bool event_interrupt_isr_v11(struct kfd_node *dev,
drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c+5−2
@@ -143,6 +143,7 @@ enum SQ_INTERRUPT_ERROR_TYPE { · 142 unmodified lines
143143 static void event_interrupt_poison_consumption_v9(struct kfd_node *dev,
144144 uint16_t pasid, uint16_t client_id)
145145 {
146+ enum amdgpu_ras_block block = 0;
146147 int old_poison, ret = -EINVAL;
147148 struct kfd_process *p = kfd_lookup_process_by_pasid(pasid);
148149
@@ -162,12 +163,14 @@ static void event_interrupt_poison_consumption_v9(struct kfd_node *dev, · 13 unmodified lines
162163 case SOC15_IH_CLIENTID_SE3SH:
163164 case SOC15_IH_CLIENTID_UTCL2:
164165 ret = kfd_dqm_evict_pasid(dev->dqm, pasid);
166+ block = AMDGPU_RAS_BLOCK__GFX;
165167 break;
166168 case SOC15_IH_CLIENTID_SDMA0:
167169 case SOC15_IH_CLIENTID_SDMA1:
168170 case SOC15_IH_CLIENTID_SDMA2:
169171 case SOC15_IH_CLIENTID_SDMA3:
170172 case SOC15_IH_CLIENTID_SDMA4:
173+ block = AMDGPU_RAS_BLOCK__SDMA;
171174 break;
172175 default:
173176 break;
@@ -182,12 +185,12 @@ static void event_interrupt_poison_consumption_v9(struct kfd_node *dev, · 8 unmodified lines
182185 dev_warn(dev->adev->dev,
183186 "RAS poison consumption, unmap queue flow succeeded: client id %d\n",
184187 client_id);
185− amdgpu_amdkfd_ras_poison_consumption_handler(dev->adev, false);
188+ amdgpu_amdkfd_ras_poison_consumption_handler(dev->adev, block, false);
186189 } else {
187190 dev_warn(dev->adev->dev,
188191 "RAS poison consumption, fall back to gpu reset flow: client id %d\n",
189192 client_id);
190− amdgpu_amdkfd_ras_poison_consumption_handler(dev->adev, true);
193+ amdgpu_amdkfd_ras_poison_consumption_handler(dev->adev, block, true);
191194 }
192195 }
193196
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c+1−1
@@ -574,7 +574,7 @@ svm_migrate_copy_to_ram(struct amdgpu_device *adev, struct svm_range *prange, · 573 unmodified lines
574574 pr_debug("svms 0x%p [0x%lx 0x%lx]\n", prange->svms, prange->start,
575575 prange->last);
576576
577− addr = prange->start << PAGE_SHIFT;
577+ addr = migrate->start;
578578
579579 src = (uint64_t *)(scratch + npages);
580580 dst = scratch;
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c+1−0
@@ -170,6 +170,7 @@ static void update_mqd(struct mqd_manager *mm, void *mqd, · 169 unmodified lines
170170 m->cp_hqd_pq_control = 5 << CP_HQD_PQ_CONTROL__RPTR_BLOCK_SIZE__SHIFT;
171171 m->cp_hqd_pq_control |=
172172 ffs(q->queue_size / sizeof(unsigned int)) - 1 - 1;
173+ m->cp_hqd_pq_control |= CP_HQD_PQ_CONTROL__UNORD_DISPATCH_MASK;
173174 pr_debug("cp_hqd_pq_control 0x%x\n", m->cp_hqd_pq_control);
174175
175176 m->cp_hqd_pq_base_lo = lower_32_bits((uint64_t)q->queue_address >> 8);
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c+1−0
@@ -224,6 +224,7 @@ static void update_mqd(struct mqd_manager *mm, void *mqd, · 223 unmodified lines
224224 m->cp_hqd_pq_control = 5 << CP_HQD_PQ_CONTROL__RPTR_BLOCK_SIZE__SHIFT;
225225 m->cp_hqd_pq_control |=
226226 ffs(q->queue_size / sizeof(unsigned int)) - 1 - 1;
227+ m->cp_hqd_pq_control |= CP_HQD_PQ_CONTROL__UNORD_DISPATCH_MASK;
227228 pr_debug("cp_hqd_pq_control 0x%x\n", m->cp_hqd_pq_control);
228229
229230 m->cp_hqd_pq_base_lo = lower_32_bits((uint64_t)q->queue_address >> 8);
drivers/gpu/drm/amd/amdkfd/kfd_priv.h+7−2
@@ -1488,10 +1488,15 @@ void kfd_dec_compute_active(struct kfd_node *dev); · 1487 unmodified lines
14881488
14891489 /* Cgroup Support */
14901490 /* Check with device cgroup if @kfd device is accessible */
1491−static inline int kfd_devcgroup_check_permission(struct kfd_node *kfd)
1491+static inline int kfd_devcgroup_check_permission(struct kfd_node *node)
14921492 {
14931493 #if defined(CONFIG_CGROUP_DEVICE) || defined(CONFIG_CGROUP_BPF)
1494− struct drm_device *ddev = adev_to_drm(kfd->adev);
1494+ struct drm_device *ddev;
1495+
1496+ if (node->xcp)
1497+ ddev = node->xcp->ddev;
1498+ else
1499+ ddev = adev_to_drm(node->adev);
14951500
14961501 return devcgroup_check_permission(DEVCG_DEV_CHAR, DRM_MAJOR,
14971502 ddev->render->index,
drivers/gpu/drm/amd/amdkfd/kfd_svm.c+6−4
@@ -1515,9 +1515,9 @@ static int svm_range_reserve_bos(struct svm_validate_context *ctx, bool intr) · 1514 unmodified lines
15151515 goto unreserve_out;
15161516 }
15171517
1518− r = amdgpu_vm_validate_pt_bos(pdd->dev->adev,
1519− drm_priv_to_vm(pdd->drm_priv),
1520− svm_range_bo_validate, NULL);
1518+ r = amdgpu_vm_validate(pdd->dev->adev,
1519+ drm_priv_to_vm(pdd->drm_priv), NULL,
1520+ svm_range_bo_validate, NULL);
15211521 if (r) {
15221522 pr_debug("failed %d validate pt bos\n", r);
15231523 goto unreserve_out;
@@ -1641,7 +1641,9 @@ static int svm_range_validate_and_map(struct mm_struct *mm, · 117 unmodified lines
16411641 goto free_ctx;
16421642 }
16431643
1644− svm_range_reserve_bos(ctx, intr);
1644+ r = svm_range_reserve_bos(ctx, intr);
1645+ if (r)
1646+ goto free_ctx;
16451647
16461648 p = container_of(prange->svms, struct kfd_process, svms);
16471649 owner = kfd_svm_page_owner(p, find_first_bit(ctx->bitmap,
drivers/gpu/drm/amd/amdkfd/kfd_topology.c+3−0
@@ -1564,6 +1564,7 @@ static int fill_in_l1_pcache(struct kfd_cache_properties **props_ext, · 1563 unmodified lines
15641564 pcache->processor_id_low = cu_processor_id + (first_active_cu - 1);
15651565 pcache->cache_level = pcache_info[cache_type].cache_level;
15661566 pcache->cache_size = pcache_info[cache_type].cache_size;
1567+ pcache->cacheline_size = pcache_info[cache_type].cache_line_size;
15671568
15681569 if (pcache_info[cache_type].flags & CRAT_CACHE_FLAGS_DATA_CACHE)
15691570 pcache->cache_type |= HSA_CACHE_TYPE_DATA;
@@ -1632,6 +1633,7 @@ static int fill_in_l2_l3_pcache(struct kfd_cache_properties **props_ext, · 62 unmodified lines
16321633 pcache->processor_id_low = cu_processor_id
16331634 + (first_active_cu - 1);
16341635 pcache->cache_level = pcache_info[cache_type].cache_level;
1636+ pcache->cacheline_size = pcache_info[cache_type].cache_line_size;
16351637
16361638 if (KFD_GC_VERSION(knode) == IP_VERSION(9, 4, 3))
16371639 mode = adev->gmc.gmc_funcs->query_mem_partition_mode(adev);
@@ -1705,6 +1707,7 @@ static void kfd_fill_cache_non_crat_info(struct kfd_topology_device *dev, struct · 67 unmodified lines
17051707
17061708 gpu_processor_id = dev->node_props.simd_id_base;
17071709
1710+ memset(cache_info, 0, sizeof(cache_info));
17081711 pcache_info = cache_info;
17091712 num_of_cache_types = kfd_get_gpu_cache_info(kdev, &pcache_info);
17101713 if (!num_of_cache_types) {
drivers/gpu/drm/amd/display/TODO+0−110
@@ -1,110 +0,0 @@
1−===============================================================================
2−TODOs
3−===============================================================================
4−
5−1. Base this on drm-next - WIP
6−
7−
8−2. Cleanup commit history
9−
10−
11−3. WIP - Drop page flip helper and use DRM's version
12−
13−
14−4. DONE - Flatten all DC objects
15− * dc_stream/core_stream/stream should just be dc_stream
16− * Same for other DC objects
17−
18− "Is there any major reason to keep all those abstractions?
19−
20− Could you collapse everything into struct dc_stream?
21−
22− I haven't looked recently but I didn't get the impression there was a
23− lot of design around what was public/protected, more whatever needed
24− to be used by someone else was in public."
25− ~ Dave Airlie
26−
27−
28−5. DONE - Rename DC objects to align more with DRM
29− * dc_surface -> dc_plane_state
30− * dc_stream -> dc_stream_state
31−
32−
33−6. DONE - Per-plane and per-stream validation
34−
35−
36−7. WIP - Per-plane and per-stream commit
37−
38−
39−8. WIP - Split pipe_ctx into plane and stream resource structs
40−
41−
42−9. Attach plane and stream reources to state object instead of validate_context
43−
44−
45−10. Remove dc_edid_caps and drm_helpers_parse_edid_caps
46− * Use drm_display_info instead
47− * Remove DC's edid quirks and rely on DRM's quirks (add quirks if needed)
48−
49− "Making sure you use the sink-specific helper libraries and kernel
50− subsystems, since there's really no good reason to have 2nd
51− implementation of those in the kernel. Looks likes that's done for mst
52− and edid parsing. There's still a bit a midlayer feeling to the edid
53− parsing side (e.g. dc_edid_caps and dm_helpers_parse_edid_caps, I
54− think it'd be much better if you convert that over to reading stuff
55− from drm_display_info and if needed, push stuff into the core). Also,
56− I can't come up with a good reason why DC needs all this (except to
57− reimplement half of our edid quirk table, which really isn't a good
58− idea). Might be good if you put this onto the list of things to fix
59− long-term, but imo not a blocker. Definitely make sure new stuff
60− doesn't slip in (i.e. if you start adding edid quirks to DC instead of
61− the drm core, refactoring to use the core edid stuff was pointless)."
62− ~ Daniel Vetter
63−
64−
65−11. Remove dc/i2caux. This folder can be somewhat misleading. It's basically an
66−overy complicated HW programming function for sendind and receiving i2c/aux
67−commands. We can greatly simplify that and move it into dc/dceXYZ like other
68−HW blocks.
69−
70−12. drm_modeset_lock in MST should no longer be needed in recent kernels
71− * Adopt appropriate locking scheme
72−
73−13. get_modes and best_encoder callbacks look a bit funny. Can probably rip out
74−a few indirections, and consider removing entirely and using the
75−drm_atomic_helper_best_encoder default behaviour.
76−
77−14. core/dc_debug.c, consider switching to the atomic state debug helpers and
78−moving all your driver state printing into the various atomic_print_state
79−callbacks. There's also plans to expose this stuff in a standard way across all
80−drivers, to make debugging userspace compositors easier across different hw.
81−
82−15. Move DP/HDMI dual mode adaptors to drm_dp_dual_mode_helper.c. See
83−dal_ddc_service_i2c_query_dp_dual_mode_adaptor.
84−
85−16. Move to core SCDC helpers (I think those are new since initial DC review).
86−
87−17. There's still a pretty massive layer cake around dp aux and DPCD handling,
88−with like 3 levels of abstraction and using your own structures instead of the
89−stuff in drm_dp_helper.h. drm_dp_helper.h isn't really great and already has 2
90−incompatible styles, just means more reasons not to add a third (or well third
91−one gets to do the cleanup refactor).
92−
93−18. There's a pile of sink handling code, both for DP and HDMI where I didn't
94−immediately recognize the standard. I think long term it'd be best for the drm
95−subsystem if we try to move as much of that into helpers/core as possible, and
96−share it with drivers. But that's a very long term goal, and by far not just an
97−issue with DC - other drivers, especially around DP sink handling, are equally
98−guilty.
99−
100−19. DONE - The DC logger is still a rather sore thing, but I know that the
101−DRM_DEBUG stuff just isn't up to the challenges either. We need to figure out
102−something that integrates better with DRM and linux debug printing, while not
103−being useless with filtering output. dynamic debug printing might be an option.
104−
105−20. Use kernel i2c device to program HDMI retimer. Some boards have an HDMI
106−retimer that we need to program to pass PHY compliance. Currently that's
107−bypassing the i2c device and goes directly to HW. This should be changed.
108−
109−21. Remove vector.c from dc/basics. It's used in DDC code which can probably
110−be simplified enough to no longer need a vector implementation.
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+154−22
@@ -67,6 +67,7 @@ · 66 unmodified lines
6767 #include "amdgpu_dm_debugfs.h"
6868 #endif
6969 #include "amdgpu_dm_psr.h"
70+#include "amdgpu_dm_replay.h"
7071
7172 #include "ivsrcid/ivsrcid_vislands30.h"
7273
@@ -272,6 +273,7 @@ static int dm_crtc_get_scanoutpos(struct amdgpu_device *adev, int crtc, · 199 unmodified lines
272273 {
273274 u32 v_blank_start, v_blank_end, h_position, v_position;
274275 struct amdgpu_crtc *acrtc = NULL;
276+ struct dc *dc = adev->dm.dc;
275277
276278 if ((crtc < 0) || (crtc >= adev->mode_info.num_crtc))
277279 return -EINVAL;
@@ -284,6 +286,9 @@ static int dm_crtc_get_scanoutpos(struct amdgpu_device *adev, int crtc, · 6 unmodified lines
284286 return 0;
285287 }
286288
289+ if (dc && dc->caps.ips_support && dc->idle_optimizations_allowed)
290+ dc_allow_idle_optimizations(dc, false);
291+
287292 /*
288293 * TODO rework base driver to use values directly.
289294 * for now parse it back into reg-format
@@ -1715,7 +1720,10 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) · 1425 unmodified lines
17151720 init_data.nbio_reg_offsets = adev->reg_offset[NBIO_HWIP][0];
17161721 init_data.clk_reg_offsets = adev->reg_offset[CLK_HWIP][0];
17171722
1718− init_data.flags.disable_ips = DMUB_IPS_DISABLE_ALL;
1723+ if (amdgpu_dc_debug_mask & DC_DISABLE_IPS)
1724+ init_data.flags.disable_ips = DMUB_IPS_DISABLE_ALL;
1725+
1726+ init_data.flags.disable_ips_in_vpb = 1;
17191727
17201728 /* Enable DWB for tested platforms only */
17211729 if (amdgpu_ip_version(adev, DCE_HWIP, 0) >= IP_VERSION(3, 0, 0))
@@ -2114,6 +2122,16 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev) · 392 unmodified lines
21142122 const struct dmcub_firmware_header_v1_0 *hdr;
21152123 enum dmub_asic dmub_asic;
21162124 enum dmub_status status;
2125+ static enum dmub_window_memory_type window_memory_type[DMUB_WINDOW_TOTAL] = {
2126+ DMUB_WINDOW_MEMORY_TYPE_FB, //DMUB_WINDOW_0_INST_CONST
2127+ DMUB_WINDOW_MEMORY_TYPE_FB, //DMUB_WINDOW_1_STACK
2128+ DMUB_WINDOW_MEMORY_TYPE_FB, //DMUB_WINDOW_2_BSS_DATA
2129+ DMUB_WINDOW_MEMORY_TYPE_FB, //DMUB_WINDOW_3_VBIOS
2130+ DMUB_WINDOW_MEMORY_TYPE_FB, //DMUB_WINDOW_4_MAILBOX
2131+ DMUB_WINDOW_MEMORY_TYPE_FB, //DMUB_WINDOW_5_TRACEBUFF
2132+ DMUB_WINDOW_MEMORY_TYPE_FB, //DMUB_WINDOW_6_FW_STATE
2133+ DMUB_WINDOW_MEMORY_TYPE_FB //DMUB_WINDOW_7_SCRATCH_MEM
2134+ };
21172135 int r;
21182136
21192137 switch (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
@@ -2211,7 +2229,7 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev) · 91 unmodified lines
22112229 adev->dm.dmub_fw->data +
22122230 le32_to_cpu(hdr->header.ucode_array_offset_bytes) +
22132231 PSP_HEADER_BYTES;
2214− region_params.is_mailbox_in_inbox = false;
2232+ region_params.window_memory_type = window_memory_type;
22152233
22162234 status = dmub_srv_calc_region_info(dmub_srv, &region_params,
22172235 &region_info);
@@ -2239,6 +2257,7 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev) · 21 unmodified lines
22392257 memory_params.cpu_fb_addr = adev->dm.dmub_bo_cpu_addr;
22402258 memory_params.gpu_fb_addr = adev->dm.dmub_bo_gpu_addr;
22412259 memory_params.region_info = &region_info;
2260+ memory_params.window_memory_type = window_memory_type;
22422261
22432262 adev->dm.dmub_fb_info =
22442263 kzalloc(sizeof(*adev->dm.dmub_fb_info), GFP_KERNEL);
@@ -4392,6 +4411,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) · 2147 unmodified lines
43924411 enum dc_connection_type new_connection_type = dc_connection_none;
43934412 const struct dc_plane_cap *plane;
43944413 bool psr_feature_enabled = false;
4414+ bool replay_feature_enabled = false;
43954415 int max_overlay = dm->dc->caps.max_slave_planes;
43964416
43974417 dm->display_indexes_num = dm->dc->caps.max_streams;
@@ -4503,6 +4523,23 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) · 105 unmodified lines
45034523 }
45044524 }
45054525
4526+ /* Determine whether to enable Replay support by default. */
4527+ if (!(amdgpu_dc_debug_mask & DC_DISABLE_REPLAY)) {
4528+ switch (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
4529+ case IP_VERSION(3, 1, 4):
4530+ case IP_VERSION(3, 1, 5):
4531+ case IP_VERSION(3, 1, 6):
4532+ case IP_VERSION(3, 2, 0):
4533+ case IP_VERSION(3, 2, 1):
4534+ case IP_VERSION(3, 5, 0):
4535+ replay_feature_enabled = true;
4536+ break;
4537+ default:
4538+ replay_feature_enabled = amdgpu_dc_feature_mask & DC_REPLAY_MASK;
4539+ break;
4540+ }
4541+ }
4542+
45064543 /* loops over all connectors on the board */
45074544 for (i = 0; i < link_cnt; i++) {
45084545 struct dc_link *link = NULL;
@@ -4571,6 +4608,11 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) · 62 unmodified lines
45714608 amdgpu_dm_update_connector_after_detect(aconnector);
45724609 setup_backlight_device(dm, aconnector);
45734610
4611+ /* Disable PSR if Replay can be enabled */
4612+ if (replay_feature_enabled)
4613+ if (amdgpu_dm_set_replay_caps(link, aconnector))
4614+ psr_feature_enabled = false;
4615+
45744616 if (psr_feature_enabled)
45754617 amdgpu_dm_set_psr_caps(link);
45764618
@@ -6395,10 +6437,81 @@ int amdgpu_dm_connector_atomic_get_property(struct drm_connector *connector, · 1818 unmodified lines
63956437 return ret;
63966438 }
63976439
6440+/**
6441+ * DOC: panel power savings
6442+ *
6443+ * The display manager allows you to set your desired **panel power savings**
6444+ * level (between 0-4, with 0 representing off), e.g. using the following::
6445+ *
6446+ * # echo 3 > /sys/class/drm/card0-eDP-1/amdgpu/panel_power_savings
6447+ *
6448+ * Modifying this value can have implications on color accuracy, so tread
6449+ * carefully.
6450+ */
6451+
6452+static ssize_t panel_power_savings_show(struct device *device,
6453+ struct device_attribute *attr,
6454+ char *buf)
6455+{
6456+ struct drm_connector *connector = dev_get_drvdata(device);
6457+ struct drm_device *dev = connector->dev;
6458+ u8 val;
6459+
6460+ drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
6461+ val = to_dm_connector_state(connector->state)->abm_level ==
6462+ ABM_LEVEL_IMMEDIATE_DISABLE ? 0 :
6463+ to_dm_connector_state(connector->state)->abm_level;
6464+ drm_modeset_unlock(&dev->mode_config.connection_mutex);
6465+
6466+ return sysfs_emit(buf, "%u\n", val);
6467+}
6468+
6469+static ssize_t panel_power_savings_store(struct device *device,
6470+ struct device_attribute *attr,
6471+ const char *buf, size_t count)
6472+{
6473+ struct drm_connector *connector = dev_get_drvdata(device);
6474+ struct drm_device *dev = connector->dev;
6475+ long val;
6476+ int ret;
6477+
6478+ ret = kstrtol(buf, 0, &val);
6479+
6480+ if (ret)
6481+ return ret;
6482+
6483+ if (val < 0 || val > 4)
6484+ return -EINVAL;
6485+
6486+ drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
6487+ to_dm_connector_state(connector->state)->abm_level = val ?:
6488+ ABM_LEVEL_IMMEDIATE_DISABLE;
6489+ drm_modeset_unlock(&dev->mode_config.connection_mutex);
6490+
6491+ drm_kms_helper_hotplug_event(dev);
6492+
6493+ return count;
6494+}
6495+
6496+static DEVICE_ATTR_RW(panel_power_savings);
6497+
6498+static struct attribute *amdgpu_attrs[] = {
6499+ &dev_attr_panel_power_savings.attr,
6500+ NULL
6501+};
6502+
6503+static const struct attribute_group amdgpu_group = {
6504+ .name = "amdgpu",
6505+ .attrs = amdgpu_attrs
6506+};
6507+
63986508 static void amdgpu_dm_connector_unregister(struct drm_connector *connector)
63996509 {
64006510 struct amdgpu_dm_connector *amdgpu_dm_connector = to_amdgpu_dm_connector(connector);
64016511
6512+ if (connector->connector_type == DRM_MODE_CONNECTOR_eDP)
6513+ sysfs_remove_group(&connector->kdev->kobj, &amdgpu_group);
6514+
64026515 drm_dp_aux_unregister(&amdgpu_dm_connector->dm_dp_aux.aux);
64036516 }
64046517
@@ -6500,6 +6613,13 @@ amdgpu_dm_connector_late_register(struct drm_connector *connector) · 95 unmodified lines
65006613 to_amdgpu_dm_connector(connector);
65016614 int r;
65026615
6616+ if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
6617+ r = sysfs_create_group(&connector->kdev->kobj,
6618+ &amdgpu_group);
6619+ if (r)
6620+ return r;
6621+ }
6622+
65036623 amdgpu_dm_register_backlight_device(amdgpu_dm_connector);
65046624
65056625 if ((connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) ||
@@ -8519,10 +8639,22 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, · 2013 unmodified lines
85198639 dm_update_pflip_irq_state(drm_to_adev(dev),
85208640 acrtc_attach);
85218641
8522− if ((acrtc_state->update_type > UPDATE_TYPE_FAST) &&
8523− acrtc_state->stream->link->psr_settings.psr_version != DC_PSR_VERSION_UNSUPPORTED &&
8524− !acrtc_state->stream->link->psr_settings.psr_feature_enabled)
8525− amdgpu_dm_link_setup_psr(acrtc_state->stream);
8642+ if (acrtc_state->update_type > UPDATE_TYPE_FAST) {
8643+ if (acrtc_state->stream->link->replay_settings.config.replay_supported &&
8644+ !acrtc_state->stream->link->replay_settings.replay_feature_enabled) {
8645+ struct amdgpu_dm_connector *aconn =
8646+ (struct amdgpu_dm_connector *)acrtc_state->stream->dm_stream_context;
8647+ amdgpu_dm_link_setup_replay(acrtc_state->stream->link, aconn);
8648+ } else if (acrtc_state->stream->link->psr_settings.psr_version != DC_PSR_VERSION_UNSUPPORTED &&
8649+ !acrtc_state->stream->link->psr_settings.psr_feature_enabled) {
8650+
8651+ struct amdgpu_dm_connector *aconn = (struct amdgpu_dm_connector *)
8652+ acrtc_state->stream->dm_stream_context;
8653+
8654+ if (!aconn->disallow_edp_enter_psr)
8655+ amdgpu_dm_link_setup_psr(acrtc_state->stream);
8656+ }
8657+ }
85268658
85278659 /* Decrement skip count when PSR is enabled and we're doing fast updates. */
85288660 if (acrtc_state->update_type == UPDATE_TYPE_FAST &&
@@ -8549,6 +8681,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, · 20 unmodified lines
85498681 !amdgpu_dm_crc_window_is_activated(acrtc_state->base.crtc) &&
85508682 #endif
85518683 !acrtc_state->stream->link->psr_settings.psr_allow_active &&
8684+ !aconn->disallow_edp_enter_psr &&
85528685 (timestamp_ns -
85538686 acrtc_state->stream->link->psr_settings.psr_dirty_rects_change_timestamp_ns) >
85548687 500000000)
@@ -8811,11 +8944,12 @@ static void amdgpu_dm_commit_streams(struct drm_atomic_state *state, · 256 unmodified lines
88118944 }
88128945 } /* for_each_crtc_in_state() */
88138946
8814− /* if there mode set or reset, disable eDP PSR */
8947+ /* if there mode set or reset, disable eDP PSR, Replay */
88158948 if (mode_set_reset_required) {
88168949 if (dm->vblank_control_workqueue)
88178950 flush_workqueue(dm->vblank_control_workqueue);
88188951
8952+ amdgpu_dm_replay_disable_all(dm);
88198953 amdgpu_dm_psr_disable_all(dm);
88208954 }
88218955
@@ -8976,16 +9110,8 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 154 unmodified lines
89769110
89779111 trace_amdgpu_dm_atomic_commit_tail_begin(state);
89789112
8979− if (dm->dc->caps.ips_support) {
8980− for_each_oldnew_connector_in_state(state, connector, old_con_state, new_con_state, i) {
8981− if (new_con_state->crtc &&
8982− new_con_state->crtc->state->active &&
8983− drm_atomic_crtc_needs_modeset(new_con_state->crtc->state)) {
8984− dc_dmub_srv_apply_idle_power_optimizations(dm->dc, false);
8985− break;
8986− }
8987− }
8988− }
9113+ if (dm->dc->caps.ips_support && dm->dc->idle_optimizations_allowed)
9114+ dc_allow_idle_optimizations(dm->dc, false);
89899115
89909116 drm_atomic_helper_update_legacy_modeset_state(dev, state);
89919117 drm_dp_mst_atomic_wait_for_dependencies(state);
@@ -9188,6 +9314,10 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 196 unmodified lines
91889314 * To fix this, DC should permit updating only stream properties.
91899315 */
91909316 dummy_updates = kzalloc(sizeof(struct dc_surface_update) * MAX_SURFACES, GFP_ATOMIC);
9317+ if (!dummy_updates) {
9318+ DRM_ERROR("Failed to allocate memory for dummy_updates.\n");
9319+ continue;
9320+ }
91919321 for (j = 0; j < status->plane_count; j++)
91929322 dummy_updates[j].surface = status->plane_states[0];
91939323
@@ -10728,11 +10858,13 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, · 1534 unmodified lines
1072810858 goto fail;
1072910859 }
1073010860
10731− ret = compute_mst_dsc_configs_for_state(state, dm_state->context, vars);
10732− if (ret) {
10733− DRM_DEBUG_DRIVER("compute_mst_dsc_configs_for_state() failed\n");
10734− ret = -EINVAL;
10735− goto fail;
10861+ if (dc_resource_is_dsc_encoding_supported(dc)) {
10862+ ret = compute_mst_dsc_configs_for_state(state, dm_state->context, vars);
10863+ if (ret) {
10864+ DRM_DEBUG_DRIVER("compute_mst_dsc_configs_for_state() failed\n");
10865+ ret = -EINVAL;
10866+ goto fail;
10867+ }
1073610868 }
1073710869
1073810870 ret = dm_update_mst_vcpi_slots_for_dsc(state, dm_state->context, vars);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h+1−0
@@ -693,6 +693,7 @@ struct amdgpu_dm_connector { · 692 unmodified lines
693693 struct drm_display_mode freesync_vid_base;
694694
695695 int psr_skip_count;
696+ bool disallow_edp_enter_psr;
696697
697698 /* Record progress status of mst*/
698699 uint8_t mst_status;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c+60−12
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include "dc.h"
3030 #include "amdgpu.h"
3131 #include "amdgpu_dm_psr.h"
32+#include "amdgpu_dm_replay.h"
3233 #include "amdgpu_dm_crtc.h"
3334 #include "amdgpu_dm_plane.h"
3435 #include "amdgpu_dm_trace.h"
@@ -95,6 +96,61 @@ bool amdgpu_dm_crtc_vrr_active(struct dm_crtc_state *dm_state) · 60 unmodified lines
9596 dm_state->freesync_config.state == VRR_STATE_ACTIVE_FIXED;
9697 }
9798
99+/**
100+ * amdgpu_dm_crtc_set_panel_sr_feature() - Manage panel self-refresh features.
101+ *
102+ * @vblank_work: is a pointer to a struct vblank_control_work object.
103+ * @vblank_enabled: indicates whether the DRM vblank counter is currently
104+ * enabled (true) or disabled (false).
105+ * @allow_sr_entry: represents whether entry into the self-refresh mode is
106+ * allowed (true) or not allowed (false).
107+ *
108+ * The DRM vblank counter enable/disable action is used as the trigger to enable
109+ * or disable various panel self-refresh features:
110+ *
111+ * Panel Replay and PSR SU
112+ * - Enable when:
113+ * - vblank counter is disabled
114+ * - entry is allowed: usermode demonstrates an adequate number of fast
115+ * commits)
116+ * - CRC capture window isn't active
117+ * - Keep enabled even when vblank counter gets enabled
118+ *
119+ * PSR1
120+ * - Enable condition same as above
121+ * - Disable when vblank counter is enabled
122+ */
123+static void amdgpu_dm_crtc_set_panel_sr_feature(
124+ struct vblank_control_work *vblank_work,
125+ bool vblank_enabled, bool allow_sr_entry)
126+{
127+ struct dc_link *link = vblank_work->stream->link;
128+ bool is_sr_active = (link->replay_settings.replay_allow_active ||
129+ link->psr_settings.psr_allow_active);
130+ bool is_crc_window_active = false;
131+
132+#ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
133+ is_crc_window_active =
134+ amdgpu_dm_crc_window_is_activated(&vblank_work->acrtc->base);
135+#endif
136+
137+ if (link->replay_settings.replay_feature_enabled &&
138+ allow_sr_entry && !is_sr_active && !is_crc_window_active) {
139+ amdgpu_dm_replay_enable(vblank_work->stream, true);
140+ } else if (vblank_enabled) {
141+ if (link->psr_settings.psr_version < DC_PSR_VERSION_SU_1 && is_sr_active)
142+ amdgpu_dm_psr_disable(vblank_work->stream);
143+ } else if (link->psr_settings.psr_feature_enabled &&
144+ allow_sr_entry && !is_sr_active && !is_crc_window_active) {
145+
146+ struct amdgpu_dm_connector *aconn =
147+ (struct amdgpu_dm_connector *) vblank_work->stream->dm_stream_context;
148+
149+ if (!aconn->disallow_edp_enter_psr)
150+ amdgpu_dm_psr_enable(vblank_work->stream);
151+ }
152+}
153+
98154 static void amdgpu_dm_crtc_vblank_control_worker(struct work_struct *work)
99155 {
100156 struct vblank_control_work *vblank_work =
@@ -123,18 +179,10 @@ static void amdgpu_dm_crtc_vblank_control_worker(struct work_struct *work) · 22 unmodified lines
123179 * fill_dc_dirty_rects().
124180 */
125181 if (vblank_work->stream && vblank_work->stream->link) {
126− if (vblank_work->enable) {
127− if (vblank_work->stream->link->psr_settings.psr_version < DC_PSR_VERSION_SU_1 &&
128− vblank_work->stream->link->psr_settings.psr_allow_active)
129− amdgpu_dm_psr_disable(vblank_work->stream);
130− } else if (vblank_work->stream->link->psr_settings.psr_feature_enabled &&
131− !vblank_work->stream->link->psr_settings.psr_allow_active &&
132−#ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
133− !amdgpu_dm_crc_window_is_activated(&vblank_work->acrtc->base) &&
134−#endif
135− vblank_work->acrtc->dm_irq_params.allow_psr_entry) {
136− amdgpu_dm_psr_enable(vblank_work->stream);
137− }
182+ amdgpu_dm_crtc_set_panel_sr_feature(
183+ vblank_work, vblank_work->enable,
184+ vblank_work->acrtc->dm_irq_params.allow_psr_entry ||
185+ vblank_work->stream->link->replay_settings.replay_feature_enabled);
138186 }
139187
140188 mutex_unlock(&dm->dc_lock);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c+54−1
@@ -1483,7 +1483,7 @@ static ssize_t dp_dsc_clock_en_read(struct file *f, char __user *buf, · 1482 unmodified lines
14831483 const uint32_t rd_buf_size = 10;
14841484 struct pipe_ctx *pipe_ctx;
14851485 ssize_t result = 0;
1486− int i, r, str_len = 30;
1486+ int i, r, str_len = 10;
14871487
14881488 rd_buf = kcalloc(rd_buf_size, sizeof(char), GFP_KERNEL);
14891489
@@ -2971,6 +2971,53 @@ static int allow_edp_hotplug_detection_set(void *data, u64 val) · 1481 unmodified lines
29712971 return 0;
29722972 }
29732973
2974+/* check if kernel disallow eDP enter psr state
2975+ * cat /sys/kernel/debug/dri/0/eDP-X/disallow_edp_enter_psr
2976+ * 0: allow edp enter psr; 1: disallow
2977+ */
2978+static int disallow_edp_enter_psr_get(void *data, u64 *val)
2979+{
2980+ struct amdgpu_dm_connector *aconnector = data;
2981+
2982+ *val = (u64) aconnector->disallow_edp_enter_psr;
2983+ return 0;
2984+}
2985+
2986+/* set kernel disallow eDP enter psr state
2987+ * echo 0x0 /sys/kernel/debug/dri/0/eDP-X/disallow_edp_enter_psr
2988+ * 0: allow edp enter psr; 1: disallow
2989+ *
2990+ * usage: test app read crc from PSR eDP rx.
2991+ *
2992+ * during kernel boot up, kernel write dpcd 0x170 = 5.
2993+ * this notify eDP rx psr enable and let rx check crc.
2994+ * rx fw will start checking crc for rx internal logic.
2995+ * crc read count within dpcd 0x246 is not updated and
2996+ * value is 0. when eDP tx driver wants to read rx crc
2997+ * from dpcd 0x246, 0x270, read count 0 lead tx driver
2998+ * timeout.
2999+ *
3000+ * to avoid this, we add this debugfs to let test app to disbable
3001+ * rx crc checking for rx internal logic. then test app can read
3002+ * non-zero crc read count.
3003+ *
3004+ * expected app sequence is as below:
3005+ * 1. disable eDP PHY and notify eDP rx with dpcd 0x600 = 2.
3006+ * 2. echo 0x1 /sys/kernel/debug/dri/0/eDP-X/disallow_edp_enter_psr
3007+ * 3. enable eDP PHY and notify eDP rx with dpcd 0x600 = 1 but
3008+ * without dpcd 0x170 = 5.
3009+ * 4. read crc from rx dpcd 0x270, 0x246, etc.
3010+ * 5. echo 0x0 /sys/kernel/debug/dri/0/eDP-X/disallow_edp_enter_psr.
3011+ * this will let eDP back to normal with psr setup dpcd 0x170 = 5.
3012+ */
3013+static int disallow_edp_enter_psr_set(void *data, u64 val)
3014+{
3015+ struct amdgpu_dm_connector *aconnector = data;
3016+
3017+ aconnector->disallow_edp_enter_psr = val ? true : false;
3018+ return 0;
3019+}
3020+
29743021 static int dmub_trace_mask_set(void *data, u64 val)
29753022 {
29763023 struct amdgpu_device *adev = data;
@@ -3092,6 +3139,10 @@ DEFINE_DEBUGFS_ATTRIBUTE(allow_edp_hotplug_detection_fops, · 115 unmodified lines
30923139 allow_edp_hotplug_detection_get,
30933140 allow_edp_hotplug_detection_set, "%llu\n");
30943141
3142+DEFINE_DEBUGFS_ATTRIBUTE(disallow_edp_enter_psr_fops,
3143+ disallow_edp_enter_psr_get,
3144+ disallow_edp_enter_psr_set, "%llu\n");
3145+
30953146 DEFINE_SHOW_ATTRIBUTE(current_backlight);
30963147 DEFINE_SHOW_ATTRIBUTE(target_backlight);
30973148
@@ -3265,6 +3316,8 @@ void connector_debugfs_init(struct amdgpu_dm_connector *connector) · 167 unmodified lines
32653316 &edp_ilr_debugfs_fops);
32663317 debugfs_create_file("allow_edp_hotplug_detection", 0644, dir, connector,
32673318 &allow_edp_hotplug_detection_fops);
3319+ debugfs_create_file("disallow_edp_enter_psr", 0644, dir, connector,
3320+ &disallow_edp_enter_psr_fops);
32683321 }
32693322
32703323 for (i = 0; i < ARRAY_SIZE(connector_debugfs_entries); i++) {
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c+4−1
@@ -711,7 +711,7 @@ static inline int dm_irq_state(struct amdgpu_device *adev, · 710 unmodified lines
711711 {
712712 bool st;
713713 enum dc_irq_source irq_source;
714−
714+ struct dc *dc = adev->dm.dc;
715715 struct amdgpu_crtc *acrtc = adev->mode_info.crtcs[crtc_id];
716716
717717 if (!acrtc) {
@@ -729,6 +729,9 @@ static inline int dm_irq_state(struct amdgpu_device *adev, · 11 unmodified lines
729729
730730 st = (state == AMDGPU_IRQ_STATE_ENABLE);
731731
732+ if (dc && dc->caps.ips_support && dc->idle_optimizations_allowed)
733+ dc_allow_idle_optimizations(dc, false);
734+
732735 dc_interrupt_set(adev->dm.dc, irq_source, st);
733736 return 0;
734737 }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_replay.c+69−50
@@ -60,21 +60,26 @@ static bool link_supports_replay(struct dc_link *link, struct amdgpu_dm_connecto · 59 unmodified lines
6060 if (!as_caps->dp_adap_sync_caps.bits.ADAPTIVE_SYNC_SDP_SUPPORT)
6161 return false;
6262
63+ // Sink shall populate line deviation information
64+ if (dpcd_caps->pr_info.pixel_deviation_per_line == 0 ||
65+ dpcd_caps->pr_info.max_deviation_line == 0)
66+ return false;
67+
6368 return true;
6469 }
6570
6671 /*
67− * amdgpu_dm_setup_replay() - setup replay configuration
72+ * amdgpu_dm_set_replay_caps() - setup Replay capabilities
6873 * @link: link
6974 * @aconnector: aconnector
7075 *
7176 */
72−bool amdgpu_dm_setup_replay(struct dc_link *link, struct amdgpu_dm_connector *aconnector)
77+bool amdgpu_dm_set_replay_caps(struct dc_link *link, struct amdgpu_dm_connector *aconnector)
7378 {
74− struct replay_config pr_config;
79+ struct replay_config pr_config = { 0 };
7580 union replay_debug_flags *debug_flags = NULL;
7681
77− // For eDP, if Replay is supported, return true to skip checks
82+ // If Replay is already set to support, return true to skip checks
7883 if (link->replay_settings.config.replay_supported)
7984 return true;
8085
@@ -87,27 +92,50 @@ bool amdgpu_dm_setup_replay(struct dc_link *link, struct amdgpu_dm_connector *ac · 6 unmodified lines
8792 if (!link_supports_replay(link, aconnector))
8893 return false;
8994
90− // Mark Replay is supported in link and update related attributes
95+ // Mark Replay is supported in pr_config
9196 pr_config.replay_supported = true;
92− pr_config.replay_power_opt_supported = 0;
93− pr_config.replay_enable_option |= pr_enable_option_static_screen;
94− pr_config.replay_timing_sync_supported = aconnector->max_vfreq >= 2 * aconnector->min_vfreq;
95−
96− if (!pr_config.replay_timing_sync_supported)
97− pr_config.replay_enable_option &= ~pr_enable_option_general_ui;
9897
9998 debug_flags = (union replay_debug_flags *)&pr_config.debug_flags;
10099 debug_flags->u32All = 0;
101100 debug_flags->bitfields.visual_confirm =
102101 link->ctx->dc->debug.visual_confirm == VISUAL_CONFIRM_REPLAY;
103102
104− link->replay_settings.replay_feature_enabled = true;
105−
106103 init_replay_config(link, &pr_config);
107104
108105 return true;
109106 }
110107
108+/*
109+ * amdgpu_dm_link_setup_replay() - configure replay link
110+ * @link: link
111+ * @aconnector: aconnector
112+ *
113+ */
114+bool amdgpu_dm_link_setup_replay(struct dc_link *link, struct amdgpu_dm_connector *aconnector)
115+{
116+ struct replay_config *pr_config;
117+
118+ if (link == NULL || aconnector == NULL)
119+ return false;
120+
121+ pr_config = &link->replay_settings.config;
122+
123+ if (!pr_config->replay_supported)
124+ return false;
125+
126+ pr_config->replay_power_opt_supported = 0x11;
127+ pr_config->replay_smu_opt_supported = false;
128+ pr_config->replay_enable_option |= pr_enable_option_static_screen;
129+ pr_config->replay_support_fast_resync_in_ultra_sleep_mode = aconnector->max_vfreq >= 2 * aconnector->min_vfreq;
130+ pr_config->replay_timing_sync_supported = false;
131+
132+ if (!pr_config->replay_timing_sync_supported)
133+ pr_config->replay_enable_option &= ~pr_enable_option_general_ui;
134+
135+ link->replay_settings.replay_feature_enabled = true;
136+
137+ return true;
138+}
111139
112140 /*
113141 * amdgpu_dm_replay_enable() - enable replay f/w
@@ -117,51 +145,23 @@ bool amdgpu_dm_setup_replay(struct dc_link *link, struct amdgpu_dm_connector *ac · 3 unmodified lines
117145 */
118146 bool amdgpu_dm_replay_enable(struct dc_stream_state *stream, bool wait)
119147 {
120− uint64_t state;
121− unsigned int retry_count;
122148 bool replay_active = true;
123− const unsigned int max_retry = 1000;
124− bool force_static = true;
125149 struct dc_link *link = NULL;
126150
127−
128151 if (stream == NULL)
129152 return false;
130153
131154 link = stream->link;
132155
133− if (link == NULL)
134− return false;
135−
136− link->dc->link_srv->edp_setup_replay(link, stream);
137−
138− link->dc->link_srv->edp_set_replay_allow_active(link, NULL, false, false, NULL);
139−
140− link->dc->link_srv->edp_set_replay_allow_active(link, &replay_active, false, true, NULL);
141−
142− if (wait == true) {
143−
144− for (retry_count = 0; retry_count <= max_retry; retry_count++) {
145− dc_link_get_replay_state(link, &state);
146− if (replay_active) {
147− if (state != REPLAY_STATE_0 &&
148− (!force_static || state == REPLAY_STATE_3))
149− break;
150− } else {
151− if (state == REPLAY_STATE_0)
152− break;
153− }
154− udelay(500);
155− }
156−
157− /* assert if max retry hit */
158− if (retry_count >= max_retry)
159− ASSERT(0);
160− } else {
161− /* To-do: Add trace log */
156+ if (link) {
157+ link->dc->link_srv->edp_setup_replay(link, stream);
158+ link->dc->link_srv->edp_set_coasting_vtotal(link, stream->timing.v_total);
159+ DRM_DEBUG_DRIVER("Enabling replay...\n");
160+ link->dc->link_srv->edp_set_replay_allow_active(link, &replay_active, wait, false, NULL);
161+ return true;
162162 }
163163
164− return true;
164+ return false;
165165 }
166166
167167 /*
@@ -172,12 +172,31 @@ bool amdgpu_dm_replay_enable(struct dc_stream_state *stream, bool wait) · 4 unmodified lines
172172 */
173173 bool amdgpu_dm_replay_disable(struct dc_stream_state *stream)
174174 {
175+ bool replay_active = false;
176+ struct dc_link *link = NULL;
175177
176− if (stream->link) {
178+ if (stream == NULL)
179+ return false;
180+
181+ link = stream->link;
182+
183+ if (link) {
177184 DRM_DEBUG_DRIVER("Disabling replay...\n");
178− stream->link->dc->link_srv->edp_set_replay_allow_active(stream->link, NULL, false, false, NULL);
185+ link->dc->link_srv->edp_set_replay_allow_active(stream->link, &replay_active, true, false, NULL);
179186 return true;
180187 }
181188
182189 return false;
183190 }
191+
192+/*
193+ * amdgpu_dm_replay_disable_all() - disable replay f/w
194+ * if replay is enabled on any stream
195+ *
196+ * Return: true if success
197+ */
198+bool amdgpu_dm_replay_disable_all(struct amdgpu_display_manager *dm)
199+{
200+ DRM_DEBUG_DRIVER("Disabling replay if replay is enabled on any stream\n");
201+ return dc_set_replay_allow_active(dm->dc, false);
202+}
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_replay.h+3−1
@@ -40,7 +40,9 @@ enum replay_enable_option { · 39 unmodified lines
4040
4141
4242 bool amdgpu_dm_replay_enable(struct dc_stream_state *stream, bool enable);
43−bool amdgpu_dm_setup_replay(struct dc_link *link, struct amdgpu_dm_connector *aconnector);
43+bool amdgpu_dm_set_replay_caps(struct dc_link *link, struct amdgpu_dm_connector *aconnector);
44+bool amdgpu_dm_link_setup_replay(struct dc_link *link, struct amdgpu_dm_connector *aconnector);
4445 bool amdgpu_dm_replay_disable(struct dc_stream_state *stream);
46+bool amdgpu_dm_replay_disable_all(struct amdgpu_display_manager *dm);
4547
4648 #endif /* AMDGPU_DM_AMDGPU_DM_REPLAY_H_ */
drivers/gpu/drm/amd/display/dc/basics/conversion.c+34−0
@@ -101,6 +101,40 @@ void convert_float_matrix( · 100 unmodified lines
101101 }
102102 }
103103
104+static struct fixed31_32 int_frac_to_fixed_point(uint16_t arg,
105+ uint8_t integer_bits,
106+ uint8_t fractional_bits)
107+{
108+ struct fixed31_32 result;
109+ uint16_t sign_mask = 1 << (fractional_bits + integer_bits);
110+ uint16_t value_mask = sign_mask - 1;
111+
112+ result.value = (long long)(arg & value_mask) <<
113+ (FIXED31_32_BITS_PER_FRACTIONAL_PART - fractional_bits);
114+
115+ if (arg & sign_mask)
116+ result = dc_fixpt_neg(result);
117+
118+ return result;
119+}
120+
121+/**
122+ * convert_hw_matrix - converts HW values into fixed31_32 matrix.
123+ * @matrix: fixed point 31.32 matrix
124+ * @reg: array of register values
125+ * @buffer_size: size of the array of register values
126+ *
127+ * Converts HW register spec defined format S2D13 into a fixed-point 31.32
128+ * matrix.
129+ */
130+void convert_hw_matrix(struct fixed31_32 *matrix,
131+ uint16_t *reg,
132+ uint32_t buffer_size)
133+{
134+ for (int i = 0; i < buffer_size; ++i)
135+ matrix[i] = int_frac_to_fixed_point(reg[i], 2, 13);
136+}
137+
104138 static uint32_t find_gcd(uint32_t a, uint32_t b)
105139 {
106140 uint32_t remainder;
drivers/gpu/drm/amd/display/dc/basics/conversion.h+4−0
@@ -41,6 +41,10 @@ void convert_float_matrix( · 40 unmodified lines
4141 void reduce_fraction(uint32_t num, uint32_t den,
4242 uint32_t *out_num, uint32_t *out_den);
4343
44+void convert_hw_matrix(struct fixed31_32 *matrix,
45+ uint16_t *reg,
46+ uint32_t buffer_size);
47+
4448 static inline unsigned int log_2(unsigned int num)
4549 {
4650 return ilog2(num);
drivers/gpu/drm/amd/display/dc/bios/command_table.c+1−1
@@ -37,7 +37,7 @@ · 36 unmodified lines
3737 #define EXEC_BIOS_CMD_TABLE(command, params)\
3838 (amdgpu_atom_execute_table(((struct amdgpu_device *)bp->base.ctx->driver_context)->mode_info.atom_context, \
3939 GetIndexIntoMasterTable(COMMAND, command), \
40− (uint32_t *)&params) == 0)
40+ (uint32_t *)&params, sizeof(params)) == 0)
4141
4242 #define BIOS_CMD_TABLE_REVISION(command, frev, crev)\
4343 amdgpu_atom_parse_cmd_header(((struct amdgpu_device *)bp->base.ctx->driver_context)->mode_info.atom_context, \
drivers/gpu/drm/amd/display/dc/bios/command_table2.c+1−1
@@ -49,7 +49,7 @@ · 48 unmodified lines
4949 #define EXEC_BIOS_CMD_TABLE(fname, params)\
5050 (amdgpu_atom_execute_table(((struct amdgpu_device *)bp->base.ctx->driver_context)->mode_info.atom_context, \
5151 GET_INDEX_INTO_MASTER_TABLE(command, fname), \
52− (uint32_t *)&params) == 0)
52+ (uint32_t *)&params, sizeof(params)) == 0)
5353
5454 #define BIOS_CMD_TABLE_REVISION(fname, frev, crev)\
5555 amdgpu_atom_parse_cmd_header(((struct amdgpu_device *)bp->base.ctx->driver_context)->mode_info.atom_context, \
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c+0−2
@@ -707,9 +707,7 @@ void rn_clk_mgr_construct( · 706 unmodified lines
707707 int is_green_sardine = 0;
708708 struct clk_log_info log_info = {0};
709709
710−#if defined(CONFIG_DRM_AMD_DC_FP)
711710 is_green_sardine = ASICREV_IS_GREEN_SARDINE(ctx->asic_id.hw_internal_rev);
712−#endif
713711
714712 clk_mgr->base.ctx = ctx;
715713 clk_mgr->base.funcs = &dcn21_funcs;
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c+0−4
@@ -185,10 +185,6 @@ int rn_vbios_smu_set_hard_min_dcfclk(struct clk_mgr_internal *clk_mgr, int reque · 184 unmodified lines
185185 VBIOSSMC_MSG_SetHardMinDcfclkByFreq,
186186 khz_to_mhz_ceil(requested_dcfclk_khz));
187187
188−#ifdef DBG
189− smu_print("actual_dcfclk_set_mhz %d is set to : %d\n", actual_dcfclk_set_mhz, actual_dcfclk_set_mhz * 1000);
190−#endif
191−
192188 return actual_dcfclk_set_mhz * 1000;
193189 }
194190
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/dcn301_smu.c+0−4
@@ -180,10 +180,6 @@ int dcn301_smu_set_hard_min_dcfclk(struct clk_mgr_internal *clk_mgr, int request · 179 unmodified lines
180180 VBIOSSMC_MSG_SetHardMinDcfclkByFreq,
181181 khz_to_mhz_ceil(requested_dcfclk_khz));
182182
183−#ifdef DBG
184− smu_print("actual_dcfclk_set_mhz %d is set to : %d\n", actual_dcfclk_set_mhz, actual_dcfclk_set_mhz * 1000);
185−#endif
186−
187183 return actual_dcfclk_set_mhz * 1000;
188184 }
189185
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_smu.c+0−4
@@ -202,10 +202,6 @@ int dcn31_smu_set_hard_min_dcfclk(struct clk_mgr_internal *clk_mgr, int requeste · 201 unmodified lines
202202 VBIOSSMC_MSG_SetHardMinDcfclkByFreq,
203203 khz_to_mhz_ceil(requested_dcfclk_khz));
204204
205−#ifdef DBG
206− smu_print("actual_dcfclk_set_mhz %d is set to : %d\n", actual_dcfclk_set_mhz, actual_dcfclk_set_mhz * 1000);
207−#endif
208−
209205 return actual_dcfclk_set_mhz * 1000;
210206 }
211207
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_smu.c+0−6
@@ -220,12 +220,6 @@ int dcn314_smu_set_hard_min_dcfclk(struct clk_mgr_internal *clk_mgr, int request · 219 unmodified lines
220220 VBIOSSMC_MSG_SetHardMinDcfclkByFreq,
221221 khz_to_mhz_ceil(requested_dcfclk_khz));
222222
223−#ifdef DBG
224− smu_print("actual_dcfclk_set_mhz %d is set to : %d\n",
225− actual_dcfclk_set_mhz,
226− actual_dcfclk_set_mhz * 1000);
227−#endif
228−
229223 return actual_dcfclk_set_mhz * 1000;
230224 }
231225
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c+0−4
@@ -215,10 +215,6 @@ int dcn315_smu_set_hard_min_dcfclk(struct clk_mgr_internal *clk_mgr, int request · 214 unmodified lines
215215 VBIOSSMC_MSG_SetHardMinDcfclkByFreq,
216216 khz_to_mhz_ceil(requested_dcfclk_khz));
217217
218−#ifdef DBG
219− smu_print("actual_dcfclk_set_mhz %d is set to : %d\n", actual_dcfclk_set_mhz, actual_dcfclk_set_mhz * 1000);
220−#endif
221−
222218 return actual_dcfclk_set_mhz * 1000;
223219 }
224220
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_smu.c+0−4
@@ -189,10 +189,6 @@ int dcn316_smu_set_hard_min_dcfclk(struct clk_mgr_internal *clk_mgr, int request · 188 unmodified lines
189189 VBIOSSMC_MSG_SetHardMinDcfclkByFreq,
190190 khz_to_mhz_ceil(requested_dcfclk_khz));
191191
192−#ifdef DBG
193− smu_print("actual_dcfclk_set_mhz %d is set to : %d\n", actual_dcfclk_set_mhz, actual_dcfclk_set_mhz * 1000);
194−#endif
195−
196192 return actual_dcfclk_set_mhz * 1000;
197193 }
198194
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c+38−4
@@ -387,7 +387,15 @@ static void dcn32_update_clocks_update_dentist( · 386 unmodified lines
387387 uint32_t temp_dispclk_khz = (DENTIST_DIVIDER_RANGE_SCALE_FACTOR * clk_mgr->base.dentist_vco_freq_khz) / temp_disp_divider;
388388
389389 if (clk_mgr->smu_present)
390− dcn32_smu_set_hard_min_by_freq(clk_mgr, PPCLK_DISPCLK, khz_to_mhz_ceil(temp_dispclk_khz));
390+ /*
391+ * SMU uses discrete dispclk presets. We applied
392+ * the same formula to increase our dppclk_khz
393+ * to the next matching discrete value. By
394+ * contract, we should use the preset dispclk
395+ * floored in Mhz to describe the intended clock.
396+ */
397+ dcn32_smu_set_hard_min_by_freq(clk_mgr, PPCLK_DISPCLK,
398+ khz_to_mhz_floor(temp_dispclk_khz));
391399
392400 if (dc->debug.override_dispclk_programming) {
393401 REG_GET(DENTIST_DISPCLK_CNTL,
@@ -426,7 +434,15 @@ static void dcn32_update_clocks_update_dentist( · 32 unmodified lines
426434
427435 /* do requested DISPCLK updates*/
428436 if (clk_mgr->smu_present)
429− dcn32_smu_set_hard_min_by_freq(clk_mgr, PPCLK_DISPCLK, khz_to_mhz_ceil(clk_mgr->base.clks.dispclk_khz));
437+ /*
438+ * SMU uses discrete dispclk presets. We applied
439+ * the same formula to increase our dppclk_khz
440+ * to the next matching discrete value. By
441+ * contract, we should use the preset dispclk
442+ * floored in Mhz to describe the intended clock.
443+ */
444+ dcn32_smu_set_hard_min_by_freq(clk_mgr, PPCLK_DISPCLK,
445+ khz_to_mhz_floor(clk_mgr->base.clks.dispclk_khz));
430446
431447 if (dc->debug.override_dispclk_programming) {
432448 REG_GET(DENTIST_DISPCLK_CNTL,
@@ -493,6 +509,8 @@ static void dcn32_auto_dpm_test_log( · 60 unmodified lines
493509 }
494510 }
495511
512+ msleep(5);
513+
496514 mall_ss_size_bytes = context->bw_ctx.bw.dcn.mall_ss_size_bytes;
497515
498516 dispclk_khz_reg = REG_READ(CLK1_CLK0_CURRENT_CNT); // DISPCLK
@@ -734,7 +752,15 @@ static void dcn32_update_clocks(struct clk_mgr *clk_mgr_base, · 235 unmodified lines
734752 clk_mgr_base->clks.dppclk_khz = new_clocks->dppclk_khz;
735753
736754 if (clk_mgr->smu_present && !dpp_clock_lowered)
737− dcn32_smu_set_hard_min_by_freq(clk_mgr, PPCLK_DPPCLK, khz_to_mhz_ceil(clk_mgr_base->clks.dppclk_khz));
755+ /*
756+ * SMU uses discrete dppclk presets. We applied
757+ * the same formula to increase our dppclk_khz
758+ * to the next matching discrete value. By
759+ * contract, we should use the preset dppclk
760+ * floored in Mhz to describe the intended clock.
761+ */
762+ dcn32_smu_set_hard_min_by_freq(clk_mgr, PPCLK_DPPCLK,
763+ khz_to_mhz_floor(clk_mgr_base->clks.dppclk_khz));
738764
739765 update_dppclk = true;
740766 }
@@ -765,7 +791,15 @@ static void dcn32_update_clocks(struct clk_mgr *clk_mgr_base, · 24 unmodified lines
765791 dcn32_update_clocks_update_dpp_dto(clk_mgr, context, safe_to_lower);
766792 dcn32_update_clocks_update_dentist(clk_mgr, context);
767793 if (clk_mgr->smu_present)
768− dcn32_smu_set_hard_min_by_freq(clk_mgr, PPCLK_DPPCLK, khz_to_mhz_ceil(clk_mgr_base->clks.dppclk_khz));
794+ /*
795+ * SMU uses discrete dppclk presets. We applied
796+ * the same formula to increase our dppclk_khz
797+ * to the next matching discrete value. By
798+ * contract, we should use the preset dppclk
799+ * floored in Mhz to describe the intended clock.
800+ */
801+ dcn32_smu_set_hard_min_by_freq(clk_mgr, PPCLK_DPPCLK,
802+ khz_to_mhz_floor(clk_mgr_base->clks.dppclk_khz));
769803 } else {
770804 /* if clock is being raised, increase refclk before lowering DTO */
771805 if (update_dppclk || update_dispclk)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr_smu_msg.h+1−2
@@ -36,8 +36,7 @@ · 35 unmodified lines
3636 #define DALSMC_MSG_SetCabForUclkPstate 0x12
3737 #define DALSMC_Result_OK 0x1
3838
39−void
40−dcn32_smu_send_fclk_pstate_message(struct clk_mgr_internal *clk_mgr, bool enable);
39+void dcn32_smu_send_fclk_pstate_message(struct clk_mgr_internal *clk_mgr, bool enable);
4140 void dcn32_smu_transfer_wm_table_dram_2_smu(struct clk_mgr_internal *clk_mgr);
4241 void dcn32_smu_set_pme_workaround(struct clk_mgr_internal *clk_mgr);
4342 void dcn32_smu_send_cab_for_uclk_message(struct clk_mgr_internal *clk_mgr, unsigned int num_ways);
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c+38−34
@@ -384,19 +384,6 @@ static void dcn35_enable_pme_wa(struct clk_mgr *clk_mgr_base) · 383 unmodified lines
384384 dcn35_smu_enable_pme_wa(clk_mgr);
385385 }
386386
387−void dcn35_init_clocks(struct clk_mgr *clk_mgr)
388−{
389− uint32_t ref_dtbclk = clk_mgr->clks.ref_dtbclk_khz;
390−
391− memset(&(clk_mgr->clks), 0, sizeof(struct dc_clocks));
392−
393− // Assumption is that boot state always supports pstate
394− clk_mgr->clks.ref_dtbclk_khz = ref_dtbclk; // restore ref_dtbclk
395− clk_mgr->clks.p_state_change_support = true;
396− clk_mgr->clks.prev_p_state_change_support = true;
397− clk_mgr->clks.pwr_state = DCN_PWR_STATE_UNKNOWN;
398− clk_mgr->clks.zstate_support = DCN_ZSTATE_SUPPORT_UNKNOWN;
399−}
400387
401388 bool dcn35_are_clock_states_equal(struct dc_clocks *a,
402389 struct dc_clocks *b)
@@ -422,6 +409,23 @@ static void dcn35_dump_clk_registers(struct clk_state_registers_and_bypass *regs · 19 unmodified lines
422409 {
423410 }
424411
412+static void init_clk_states(struct clk_mgr *clk_mgr)
413+{
414+ uint32_t ref_dtbclk = clk_mgr->clks.ref_dtbclk_khz;
415+ memset(&(clk_mgr->clks), 0, sizeof(struct dc_clocks));
416+
417+ clk_mgr->clks.dtbclk_en = true;
418+ clk_mgr->clks.ref_dtbclk_khz = ref_dtbclk; // restore ref_dtbclk
419+ clk_mgr->clks.p_state_change_support = true;
420+ clk_mgr->clks.prev_p_state_change_support = true;
421+ clk_mgr->clks.pwr_state = DCN_PWR_STATE_UNKNOWN;
422+ clk_mgr->clks.zstate_support = DCN_ZSTATE_SUPPORT_UNKNOWN;
423+}
424+
425+void dcn35_init_clocks(struct clk_mgr *clk_mgr)
426+{
427+ init_clk_states(clk_mgr);
428+}
425429 static struct clk_bw_params dcn35_bw_params = {
426430 .vram_type = Ddr4MemType,
427431 .num_channels = 1,
@@ -437,32 +441,32 @@ static struct wm_table ddr5_wm_table = { · 9 unmodified lines
437441 .wm_inst = WM_A,
438442 .wm_type = WM_TYPE_PSTATE_CHG,
439443 .pstate_latency_us = 11.72,
440− .sr_exit_time_us = 14.0,
441− .sr_enter_plus_exit_time_us = 16.0,
444+ .sr_exit_time_us = 28.0,
445+ .sr_enter_plus_exit_time_us = 30.0,
442446 .valid = true,
443447 },
444448 {
445449 .wm_inst = WM_B,
446450 .wm_type = WM_TYPE_PSTATE_CHG,
447451 .pstate_latency_us = 11.72,
448− .sr_exit_time_us = 14.0,
449− .sr_enter_plus_exit_time_us = 16.0,
452+ .sr_exit_time_us = 28.0,
453+ .sr_enter_plus_exit_time_us = 30.0,
450454 .valid = true,
451455 },
452456 {
453457 .wm_inst = WM_C,
454458 .wm_type = WM_TYPE_PSTATE_CHG,
455459 .pstate_latency_us = 11.72,
456− .sr_exit_time_us = 14.0,
457− .sr_enter_plus_exit_time_us = 16.0,
460+ .sr_exit_time_us = 28.0,
461+ .sr_enter_plus_exit_time_us = 30.0,
458462 .valid = true,
459463 },
460464 {
461465 .wm_inst = WM_D,
462466 .wm_type = WM_TYPE_PSTATE_CHG,
463467 .pstate_latency_us = 11.72,
464− .sr_exit_time_us = 14.0,
465− .sr_enter_plus_exit_time_us = 16.0,
468+ .sr_exit_time_us = 28.0,
469+ .sr_enter_plus_exit_time_us = 30.0,
466470 .valid = true,
467471 },
468472 }
@@ -474,32 +478,32 @@ static struct wm_table lpddr5_wm_table = { · 5 unmodified lines
474478 .wm_inst = WM_A,
475479 .wm_type = WM_TYPE_PSTATE_CHG,
476480 .pstate_latency_us = 11.65333,
477− .sr_exit_time_us = 14.0,
478− .sr_enter_plus_exit_time_us = 16.0,
481+ .sr_exit_time_us = 28.0,
482+ .sr_enter_plus_exit_time_us = 30.0,
479483 .valid = true,
480484 },
481485 {
482486 .wm_inst = WM_B,
483487 .wm_type = WM_TYPE_PSTATE_CHG,
484488 .pstate_latency_us = 11.65333,
485− .sr_exit_time_us = 14.0,
486− .sr_enter_plus_exit_time_us = 16.0,
489+ .sr_exit_time_us = 28.0,
490+ .sr_enter_plus_exit_time_us = 30.0,
487491 .valid = true,
488492 },
489493 {
490494 .wm_inst = WM_C,
491495 .wm_type = WM_TYPE_PSTATE_CHG,
492496 .pstate_latency_us = 11.65333,
493− .sr_exit_time_us = 14.0,
494− .sr_enter_plus_exit_time_us = 16.0,
497+ .sr_exit_time_us = 28.0,
498+ .sr_enter_plus_exit_time_us = 30.0,
495499 .valid = true,
496500 },
497501 {
498502 .wm_inst = WM_D,
499503 .wm_type = WM_TYPE_PSTATE_CHG,
500504 .pstate_latency_us = 11.65333,
501− .sr_exit_time_us = 14.0,
502− .sr_enter_plus_exit_time_us = 16.0,
505+ .sr_exit_time_us = 28.0,
506+ .sr_enter_plus_exit_time_us = 30.0,
503507 .valid = true,
504508 },
505509 }
@@ -826,7 +830,7 @@ static void dcn35_set_low_power_state(struct clk_mgr *clk_mgr_base) · 320 unmodified lines
826830 }
827831 }
828832
829−static void dcn35_set_idle_state(struct clk_mgr *clk_mgr_base, bool allow_idle)
833+static void dcn35_set_ips_idle_state(struct clk_mgr *clk_mgr_base, bool allow_idle)
830834 {
831835 struct clk_mgr_internal *clk_mgr = TO_CLK_MGR_INTERNAL(clk_mgr_base);
832836 struct dc *dc = clk_mgr_base->ctx->dc;
@@ -874,7 +878,7 @@ static bool dcn35_is_ips_supported(struct clk_mgr *clk_mgr_base) · 41 unmodified lines
874878 return ips_supported;
875879 }
876880
877−static uint32_t dcn35_get_idle_state(struct clk_mgr *clk_mgr_base)
881+static uint32_t dcn35_get_ips_idle_state(struct clk_mgr *clk_mgr_base)
878882 {
879883 struct clk_mgr_internal *clk_mgr = TO_CLK_MGR_INTERNAL(clk_mgr_base);
880884
@@ -883,7 +887,7 @@ static uint32_t dcn35_get_idle_state(struct clk_mgr *clk_mgr_base) · 2 unmodified lines
883887
884888 static void dcn35_init_clocks_fpga(struct clk_mgr *clk_mgr)
885889 {
886− dcn35_init_clocks(clk_mgr);
890+ init_clk_states(clk_mgr);
887891
888892 /* TODO: Implement the functions and remove the ifndef guard */
889893 }
@@ -968,8 +972,8 @@ static struct clk_mgr_funcs dcn35_funcs = { · 78 unmodified lines
968972 .set_low_power_state = dcn35_set_low_power_state,
969973 .exit_low_power_state = dcn35_exit_low_power_state,
970974 .is_ips_supported = dcn35_is_ips_supported,
971− .set_idle_state = dcn35_set_idle_state,
972− .get_idle_state = dcn35_get_idle_state
975+ .set_idle_state = dcn35_set_ips_idle_state,
976+ .get_idle_state = dcn35_get_ips_idle_state
973977 };
974978
975979 struct clk_mgr_funcs dcn35_fpga_funcs = {
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_smu.c+15−0
@@ -447,6 +447,9 @@ void dcn35_smu_set_dtbclk(struct clk_mgr_internal *clk_mgr, bool enable) · 446 unmodified lines
447447
448448 void dcn35_vbios_smu_enable_48mhz_tmdp_refclk_pwrdwn(struct clk_mgr_internal *clk_mgr, bool enable)
449449 {
450+ if (!clk_mgr->smu_present)
451+ return;
452+
450453 dcn35_smu_send_msg_with_param(
451454 clk_mgr,
452455 VBIOSSMC_MSG_EnableTmdp48MHzRefclkPwrDown,
@@ -458,6 +461,9 @@ int dcn35_smu_exit_low_power_state(struct clk_mgr_internal *clk_mgr) · 5 unmodified lines
458461 {
459462 int retv;
460463
464+ if (!clk_mgr->smu_present)
465+ return 0;
466+
461467 retv = dcn35_smu_send_msg_with_param(
462468 clk_mgr,
463469 VBIOSSMC_MSG_DispPsrExit,
@@ -470,6 +476,9 @@ int dcn35_smu_get_ips_supported(struct clk_mgr_internal *clk_mgr) · 6 unmodified lines
470476 {
471477 int retv;
472478
479+ if (!clk_mgr->smu_present)
480+ return 0;
481+
473482 retv = dcn35_smu_send_msg_with_param(
474483 clk_mgr,
475484 VBIOSSMC_MSG_QueryIPS2Support,
@@ -481,6 +490,9 @@ int dcn35_smu_get_ips_supported(struct clk_mgr_internal *clk_mgr) · 5 unmodified lines
481490
482491 void dcn35_smu_write_ips_scratch(struct clk_mgr_internal *clk_mgr, uint32_t param)
483492 {
493+ if (!clk_mgr->smu_present)
494+ return;
495+
484496 REG_WRITE(MP1_SMN_C2PMSG_71, param);
485497 //smu_print("%s: write_ips_scratch = %x\n", __func__, param);
486498 }
@@ -489,6 +501,9 @@ uint32_t dcn35_smu_read_ips_scratch(struct clk_mgr_internal *clk_mgr) · 2 unmodified lines
489501 {
490502 uint32_t retv;
491503
504+ if (!clk_mgr->smu_present)
505+ return 0;
506+
492507 retv = REG_READ(MP1_SMN_C2PMSG_71);
493508 //smu_print("%s: dcn35_smu_read_ips_scratch = %x\n", __func__, retv);
494509 return retv;
drivers/gpu/drm/amd/display/dc/core/dc.c+60−12
@@ -414,6 +414,8 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc, · 413 unmodified lines
414414 if (dc->optimized_required || dc->wm_optimized_required)
415415 return false;
416416
417+ dc_exit_ips_for_hw_access(dc);
418+
417419 stream->adjust.v_total_max = adjust->v_total_max;
418420 stream->adjust.v_total_mid = adjust->v_total_mid;
419421 stream->adjust.v_total_mid_frame_num = adjust->v_total_mid_frame_num;
@@ -454,6 +456,8 @@ bool dc_stream_get_last_used_drr_vtotal(struct dc *dc, · 34 unmodified lines
454456
455457 int i = 0;
456458
459+ dc_exit_ips_for_hw_access(dc);
460+
457461 for (i = 0; i < MAX_PIPES; i++) {
458462 struct pipe_ctx *pipe = &dc->current_state->res_ctx.pipe_ctx[i];
459463
@@ -484,6 +488,8 @@ bool dc_stream_get_crtc_position(struct dc *dc, · 24 unmodified lines
484488 bool ret = false;
485489 struct crtc_position position;
486490
491+ dc_exit_ips_for_hw_access(dc);
492+
487493 for (i = 0; i < MAX_PIPES; i++) {
488494 struct pipe_ctx *pipe =
489495 &dc->current_state->res_ctx.pipe_ctx[i];
@@ -603,6 +609,8 @@ bool dc_stream_configure_crc(struct dc *dc, struct dc_stream_state *stream, · 113 unmodified lines
603609 if (pipe == NULL)
604610 return false;
605611
612+ dc_exit_ips_for_hw_access(dc);
613+
606614 /* By default, capture the full frame */
607615 param.windowa_x_start = 0;
608616 param.windowa_y_start = 0;
@@ -662,6 +670,8 @@ bool dc_stream_get_crc(struct dc *dc, struct dc_stream_state *stream, · 53 unmodified lines
662670 struct pipe_ctx *pipe;
663671 struct timing_generator *tg;
664672
673+ dc_exit_ips_for_hw_access(dc);
674+
665675 for (i = 0; i < MAX_PIPES; i++) {
666676 pipe = &dc->current_state->res_ctx.pipe_ctx[i];
667677 if (pipe->stream == stream)
@@ -686,6 +696,8 @@ void dc_stream_set_dyn_expansion(struct dc *dc, struct dc_stream_state *stream, · 18 unmodified lines
686696 int i;
687697 struct pipe_ctx *pipe_ctx;
688698
699+ dc_exit_ips_for_hw_access(dc);
700+
689701 for (i = 0; i < MAX_PIPES; i++) {
690702 if (dc->current_state->res_ctx.pipe_ctx[i].stream
691703 == stream) {
@@ -721,6 +733,8 @@ void dc_stream_set_dither_option(struct dc_stream_state *stream, · 29 unmodified lines
721733 if (option > DITHER_OPTION_MAX)
722734 return;
723735
736+ dc_exit_ips_for_hw_access(stream->ctx->dc);
737+
724738 stream->dither_option = option;
725739
726740 memset(&params, 0, sizeof(params));
@@ -745,6 +759,8 @@ bool dc_stream_set_gamut_remap(struct dc *dc, const struct dc_stream_state *stre · 18 unmodified lines
745759 bool ret = false;
746760 struct pipe_ctx *pipes;
747761
762+ dc_exit_ips_for_hw_access(dc);
763+
748764 for (i = 0; i < MAX_PIPES; i++) {
749765 if (dc->current_state->res_ctx.pipe_ctx[i].stream == stream) {
750766 pipes = &dc->current_state->res_ctx.pipe_ctx[i];
@@ -762,6 +778,8 @@ bool dc_stream_program_csc_matrix(struct dc *dc, struct dc_stream_state *stream) · 11 unmodified lines
762778 bool ret = false;
763779 struct pipe_ctx *pipes;
764780
781+ dc_exit_ips_for_hw_access(dc);
782+
765783 for (i = 0; i < MAX_PIPES; i++) {
766784 if (dc->current_state->res_ctx.pipe_ctx[i].stream
767785 == stream) {
@@ -788,6 +806,8 @@ void dc_stream_set_static_screen_params(struct dc *dc, · 20 unmodified lines
788806 struct pipe_ctx *pipes_affected[MAX_PIPES];
789807 int num_pipes_affected = 0;
790808
809+ dc_exit_ips_for_hw_access(dc);
810+
791811 for (i = 0; i < num_streams; i++) {
792812 struct dc_stream_state *stream = streams[i];
793813
@@ -1766,6 +1786,8 @@ void dc_enable_stereo( · 972 unmodified lines
17661786 int i, j;
17671787 struct pipe_ctx *pipe;
17681788
1789+ dc_exit_ips_for_hw_access(dc);
1790+
17691791 for (i = 0; i < MAX_PIPES; i++) {
17701792 if (context != NULL) {
17711793 pipe = &context->res_ctx.pipe_ctx[i];
@@ -1785,6 +1807,8 @@ void dc_enable_stereo( · 13 unmodified lines
17851807 void dc_trigger_sync(struct dc *dc, struct dc_state *context)
17861808 {
17871809 if (context->stream_count > 1 && !dc->debug.disable_timing_sync) {
1810+ dc_exit_ips_for_hw_access(dc);
1811+
17881812 enable_timing_multisync(dc, context);
17891813 program_timing_sync(dc, context);
17901814 }
@@ -2041,6 +2065,8 @@ enum dc_status dc_commit_streams(struct dc *dc, · 250 unmodified lines
20412065 if (!streams_changed(dc, streams, stream_count))
20422066 return res;
20432067
2068+ dc_exit_ips_for_hw_access(dc);
2069+
20442070 DC_LOG_DC("%s: %d streams\n", __func__, stream_count);
20452071
20462072 for (i = 0; i < stream_count; i++) {
@@ -3067,6 +3093,10 @@ static bool update_planes_and_stream_state(struct dc *dc, · 1020 unmodified lines
30673093
30683094 if (otg_master && otg_master->stream->test_pattern.type != DP_TEST_PATTERN_VIDEO_MODE)
30693095 resource_build_test_pattern_params(&context->res_ctx, otg_master);
3096+
3097+ if (otg_master && (otg_master->stream->timing.pixel_encoding == PIXEL_ENCODING_YCBCR422 ||
3098+ otg_master->stream->timing.pixel_encoding == PIXEL_ENCODING_YCBCR420))
3099+ resource_build_subsampling_params(&context->res_ctx, otg_master);
30703100 }
30713101 }
30723102
@@ -3376,6 +3406,8 @@ static void commit_planes_for_stream_fast(struct dc *dc, · 303 unmodified lines
33763406 int i, j;
33773407 struct pipe_ctx *top_pipe_to_program = NULL;
33783408 struct dc_stream_status *stream_status = NULL;
3409+ dc_exit_ips_for_hw_access(dc);
3410+
33793411 dc_z10_restore(dc);
33803412
33813413 top_pipe_to_program = resource_get_otg_master_for_stream(
@@ -3503,10 +3535,23 @@ static void commit_planes_for_stream(struct dc *dc, · 121 unmodified lines
35033535 // dc->current_state anymore, so we have to cache it before we apply
35043536 // the new SubVP context
35053537 subvp_prev_use = false;
3538+ dc_exit_ips_for_hw_access(dc);
3539+
35063540 dc_z10_restore(dc);
35073541 if (update_type == UPDATE_TYPE_FULL)
35083542 wait_for_outstanding_hw_updates(dc, context);
35093543
3544+ for (i = 0; i < dc->res_pool->pipe_count; i++) {
3545+ struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
3546+
3547+ if (pipe->stream && pipe->plane_state) {
3548+ set_p_state_switch_method(dc, context, pipe);
3549+
3550+ if (dc->debug.visual_confirm)
3551+ dc_update_visual_confirm_color(dc, context, pipe);
3552+ }
3553+ }
3554+
35103555 if (update_type == UPDATE_TYPE_FULL) {
35113556 dc_allow_idle_optimizations(dc, false);
35123557
@@ -3541,17 +3586,6 @@ static void commit_planes_for_stream(struct dc *dc, · 28 unmodified lines
35413586 }
35423587 }
35433588
3544− for (i = 0; i < dc->res_pool->pipe_count; i++) {
3545− struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
3546−
3547− if (pipe->stream && pipe->plane_state) {
3548− set_p_state_switch_method(dc, context, pipe);
3549−
3550− if (dc->debug.visual_confirm)
3551− dc_update_visual_confirm_color(dc, context, pipe);
3552− }
3553− }
3554−
35553589 if (stream->test_pattern.type != DP_TEST_PATTERN_VIDEO_MODE) {
35563590 struct pipe_ctx *mpcc_pipe;
35573591 struct pipe_ctx *odm_pipe;
@@ -3817,7 +3851,9 @@ static void commit_planes_for_stream(struct dc *dc, · 259 unmodified lines
38173851 * programming has completed (we turn on phantom OTG in order
38183852 * to complete the plane disable for phantom pipes).
38193853 */
3820− dc->hwss.apply_ctx_to_hw(dc, context);
3854+
3855+ if (dc->hwss.disable_phantom_streams)
3856+ dc->hwss.disable_phantom_streams(dc, context);
38213857 }
38223858
38233859 if (update_type != UPDATE_TYPE_FAST)
@@ -4382,6 +4418,8 @@ bool dc_update_planes_and_stream(struct dc *dc, · 558 unmodified lines
43824418 bool is_plane_addition = 0;
43834419 bool is_fast_update_only;
43844420
4421+ dc_exit_ips_for_hw_access(dc);
4422+
43854423 populate_fast_updates(fast_update, srf_updates, surface_count, stream_update);
43864424 is_fast_update_only = fast_update_only(dc, fast_update, srf_updates,
43874425 surface_count, stream_update, stream);
@@ -4502,6 +4540,8 @@ void dc_commit_updates_for_stream(struct dc *dc, · 114 unmodified lines
45024540 int i, j;
45034541 struct dc_fast_update fast_update[MAX_SURFACES] = {0};
45044542
4543+ dc_exit_ips_for_hw_access(dc);
4544+
45054545 populate_fast_updates(fast_update, srf_updates, surface_count, stream_update);
45064546 stream_status = dc_stream_get_status(stream);
45074547 context = dc->current_state;
@@ -4686,6 +4726,8 @@ void dc_set_power_state( · 178 unmodified lines
46864726 case DC_ACPI_CM_POWER_STATE_D0:
46874727 dc_state_construct(dc, dc->current_state);
46884728
4729+ dc_exit_ips_for_hw_access(dc);
4730+
46894731 dc_z10_restore(dc);
46904732
46914733 dc->hwss.init_hw(dc);
@@ -4827,6 +4869,12 @@ void dc_allow_idle_optimizations(struct dc *dc, bool allow) · 135 unmodified lines
48274869 dc->idle_optimizations_allowed = allow;
48284870 }
48294871
4872+void dc_exit_ips_for_hw_access(struct dc *dc)
4873+{
4874+ if (dc->caps.ips_support)
4875+ dc_allow_idle_optimizations(dc, false);
4876+}
4877+
48304878 bool dc_dmub_is_ips_idle_state(struct dc *dc)
48314879 {
48324880 uint32_t idle_state = 0;
drivers/gpu/drm/amd/display/dc/core/dc_resource.c+37−17
@@ -822,6 +822,16 @@ static struct rect calculate_odm_slice_in_timing_active(struct pipe_ctx *pipe_ct · 821 unmodified lines
822822 stream->timing.v_border_bottom +
823823 stream->timing.v_border_top;
824824
825+ /* Recout for ODM slices after the first slice need one extra left edge pixel
826+ * for 3-tap chroma subsampling.
827+ */
828+ if (odm_slice_idx > 0 &&
829+ (pipe_ctx->stream->timing.pixel_encoding == PIXEL_ENCODING_YCBCR422 ||
830+ pipe_ctx->stream->timing.pixel_encoding == PIXEL_ENCODING_YCBCR420)) {
831+ odm_rec.x -= 1;
832+ odm_rec.width += 1;
833+ }
834+
825835 return odm_rec;
826836 }
827837
@@ -1438,6 +1448,7 @@ void resource_build_test_pattern_params(struct resource_context *res_ctx, · 610 unmodified lines
14381448 enum controller_dp_test_pattern controller_test_pattern;
14391449 enum controller_dp_color_space controller_color_space;
14401450 enum dc_color_depth color_depth = otg_master->stream->timing.display_color_depth;
1451+ enum dc_pixel_encoding pixel_encoding = otg_master->stream->timing.pixel_encoding;
14411452 int h_active = otg_master->stream->timing.h_addressable +
14421453 otg_master->stream->timing.h_border_left +
14431454 otg_master->stream->timing.h_border_right;
@@ -1469,10 +1480,36 @@ void resource_build_test_pattern_params(struct resource_context *res_ctx, · 25 unmodified lines
14691480 else
14701481 params->width = last_odm_slice_width;
14711482
1483+ /* Extra left edge pixel is required for 3-tap chroma subsampling. */
1484+ if (i != 0 && (pixel_encoding == PIXEL_ENCODING_YCBCR422 ||
1485+ pixel_encoding == PIXEL_ENCODING_YCBCR420)) {
1486+ params->offset -= 1;
1487+ params->width += 1;
1488+ }
1489+
14721490 offset += odm_slice_width;
14731491 }
14741492 }
14751493
1494+void resource_build_subsampling_params(struct resource_context *res_ctx,
1495+ struct pipe_ctx *otg_master)
1496+{
1497+ struct pipe_ctx *opp_heads[MAX_PIPES];
1498+ int odm_cnt = 1;
1499+ int i;
1500+
1501+ odm_cnt = resource_get_opp_heads_for_otg_master(otg_master, res_ctx, opp_heads);
1502+
1503+ /* For ODM slices after the first slice, extra left edge pixel is required
1504+ * for 3-tap chroma subsampling.
1505+ */
1506+ if (otg_master->stream->timing.pixel_encoding == PIXEL_ENCODING_YCBCR422 ||
1507+ otg_master->stream->timing.pixel_encoding == PIXEL_ENCODING_YCBCR420) {
1508+ for (i = 0; i < odm_cnt; i++)
1509+ opp_heads[i]->stream_res.left_edge_extra_pixel = (i == 0) ? false : true;
1510+ }
1511+}
1512+
14761513 bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
14771514 {
14781515 const struct dc_plane_state *plane_state = pipe_ctx->plane_state;
@@ -1834,23 +1871,6 @@ int resource_find_any_free_pipe(struct resource_context *new_res_ctx, · 355 unmodified lines
18341871
18351872 bool resource_is_pipe_type(const struct pipe_ctx *pipe_ctx, enum pipe_type type)
18361873 {
1837−#ifdef DBG
1838− if (pipe_ctx->stream == NULL) {
1839− /* a free pipe with dangling states */
1840− ASSERT(!pipe_ctx->plane_state);
1841− ASSERT(!pipe_ctx->prev_odm_pipe);
1842− ASSERT(!pipe_ctx->next_odm_pipe);
1843− ASSERT(!pipe_ctx->top_pipe);
1844− ASSERT(!pipe_ctx->bottom_pipe);
1845− } else if (pipe_ctx->top_pipe) {
1846− /* a secondary DPP pipe must be signed to a plane */
1847− ASSERT(pipe_ctx->plane_state)
1848− }
1849− /* Add more checks here to prevent corrupted pipe ctx. It is very hard
1850− * to debug this issue afterwards because we can't pinpoint the code
1851− * location causing inconsistent pipe context states.
1852− */
1853−#endif
18541874 switch (type) {
18551875 case OTG_MASTER:
18561876 return !pipe_ctx->prev_odm_pipe &&
drivers/gpu/drm/amd/display/dc/core/dc_state.c+3−0
@@ -291,11 +291,14 @@ void dc_state_destruct(struct dc_state *state) · 290 unmodified lines
291291 dc_stream_release(state->phantom_streams[i]);
292292 state->phantom_streams[i] = NULL;
293293 }
294+ state->phantom_stream_count = 0;
294295
295296 for (i = 0; i < state->phantom_plane_count; i++) {
296297 dc_plane_state_release(state->phantom_planes[i]);
297298 state->phantom_planes[i] = NULL;
298299 }
300+ state->phantom_plane_count = 0;
301+
299302 state->stream_mask = 0;
300303 memset(&state->res_ctx, 0, sizeof(state->res_ctx));
301304 memset(&state->pp_display_cfg, 0, sizeof(state->pp_display_cfg));
drivers/gpu/drm/amd/display/dc/core/dc_stream.c+18−0
@@ -423,6 +423,8 @@ bool dc_stream_add_writeback(struct dc *dc, · 422 unmodified lines
423423 return false;
424424 }
425425
426+ dc_exit_ips_for_hw_access(dc);
427+
426428 wb_info->dwb_params.out_transfer_func = stream->out_transfer_func;
427429
428430 dwb = dc->res_pool->dwbc[wb_info->dwb_pipe_inst];
@@ -493,6 +495,8 @@ bool dc_stream_fc_disable_writeback(struct dc *dc, · 64 unmodified lines
493495 return false;
494496 }
495497
498+ dc_exit_ips_for_hw_access(dc);
499+
496500 if (dwb->funcs->set_fc_enable)
497501 dwb->funcs->set_fc_enable(dwb, DWB_FRAME_CAPTURE_DISABLE);
498502
@@ -542,6 +546,8 @@ bool dc_stream_remove_writeback(struct dc *dc, · 43 unmodified lines
542546 return false;
543547 }
544548
549+ dc_exit_ips_for_hw_access(dc);
550+
545551 /* disable writeback */
546552 if (dc->hwss.disable_writeback) {
547553 struct dwbc *dwb = dc->res_pool->dwbc[dwb_pipe_inst];
@@ -557,6 +563,8 @@ bool dc_stream_warmup_writeback(struct dc *dc, · 9 unmodified lines
557563 int num_dwb,
558564 struct dc_writeback_info *wb_info)
559565 {
566+ dc_exit_ips_for_hw_access(dc);
567+
560568 if (dc->hwss.mmhubbub_warmup)
561569 return dc->hwss.mmhubbub_warmup(dc, num_dwb, wb_info);
562570 else
@@ -569,6 +577,8 @@ uint32_t dc_stream_get_vblank_counter(const struct dc_stream_state *stream) · 6 unmodified lines
569577 struct resource_context *res_ctx =
570578 &dc->current_state->res_ctx;
571579
580+ dc_exit_ips_for_hw_access(dc);
581+
572582 for (i = 0; i < MAX_PIPES; i++) {
573583 struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg;
574584
@@ -597,6 +607,8 @@ bool dc_stream_send_dp_sdp(const struct dc_stream_state *stream, · 22 unmodified lines
597607 dc = stream->ctx->dc;
598608 res_ctx = &dc->current_state->res_ctx;
599609
610+ dc_exit_ips_for_hw_access(dc);
611+
600612 for (i = 0; i < MAX_PIPES; i++) {
601613 struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];
602614
@@ -628,6 +640,8 @@ bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream, · 25 unmodified lines
628640 struct resource_context *res_ctx =
629641 &dc->current_state->res_ctx;
630642
643+ dc_exit_ips_for_hw_access(dc);
644+
631645 for (i = 0; i < MAX_PIPES; i++) {
632646 struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg;
633647
@@ -664,6 +678,8 @@ bool dc_stream_dmdata_status_done(struct dc *dc, struct dc_stream_state *stream) · 30 unmodified lines
664678 if (i == MAX_PIPES)
665679 return true;
666680
681+ dc_exit_ips_for_hw_access(dc);
682+
667683 return dc->hwss.dmdata_status_done(pipe);
668684 }
669685
@@ -698,6 +714,8 @@ bool dc_stream_set_dynamic_metadata(struct dc *dc, · 28 unmodified lines
698714
699715 pipe_ctx->stream->dmdata_address = attr->address;
700716
717+ dc_exit_ips_for_hw_access(dc);
718+
701719 dc->hwss.program_dmdata_engine(pipe_ctx);
702720
703721 if (hubp->funcs->dmdata_set_attributes != NULL &&
drivers/gpu/drm/amd/display/dc/core/dc_surface.c+2−0
@@ -161,6 +161,8 @@ const struct dc_plane_status *dc_plane_get_status( · 160 unmodified lines
161161 break;
162162 }
163163
164+ dc_exit_ips_for_hw_access(dc);
165+
164166 for (i = 0; i < dc->res_pool->pipe_count; i++) {
165167 struct pipe_ctx *pipe_ctx =
166168 &dc->current_state->res_ctx.pipe_ctx[i];
drivers/gpu/drm/amd/display/dc/dc.h+7−4
@@ -51,7 +51,7 @@ struct aux_payload; · 50 unmodified lines
5151 struct set_config_cmd_payload;
5252 struct dmub_notification;
5353
54−#define DC_VER "3.2.266"
54+#define DC_VER "3.2.271"
5555
5656 #define MAX_SURFACES 3
5757 #define MAX_PLANES 6
@@ -429,11 +429,12 @@ struct dc_config { · 371 unmodified lines
429429 bool force_bios_enable_lttpr;
430430 uint8_t force_bios_fixed_vs;
431431 int sdpif_request_limit_words_per_umc;
432− bool use_old_fixed_vs_sequence;
433432 bool dc_mode_clk_limit_support;
434433 bool EnableMinDispClkODM;
435434 bool enable_auto_dpm_test_logs;
436435 unsigned int disable_ips;
436+ unsigned int disable_ips_in_vpb;
437+ bool usb4_bw_alloc_support;
437438 };
438439
439440 enum visual_confirm {
@@ -986,9 +987,11 @@ struct dc_debug_options { · 546 unmodified lines
986987 bool psp_disabled_wa;
987988 unsigned int ips2_eval_delay_us;
988989 unsigned int ips2_entry_delay_us;
990+ bool disable_dmub_reallow_idle;
989991 bool disable_timeout;
990992 bool disable_extblankadj;
991993 unsigned int static_screen_wait_frames;
994+ bool force_chroma_subsampling_1tap;
992995 };
993996
994997 struct gpu_info_soc_bounding_box_v1_0;
@@ -1067,6 +1070,7 @@ struct dc { · 72 unmodified lines
10671070 } scratch;
10681071
10691072 struct dml2_configuration_options dml2_options;
1073+ enum dc_acpi_cm_power_state power_state;
10701074 };
10711075
10721076 enum frame_buffer_mode {
@@ -2218,11 +2222,9 @@ struct dc_sink_dsc_caps { · 1145 unmodified lines
22182222 // 'true' if these are virtual DPCD's DSC caps (immediately upstream of sink in MST topology),
22192223 // 'false' if they are sink's DSC caps
22202224 bool is_virtual_dpcd_dsc;
2221−#if defined(CONFIG_DRM_AMD_DC_FP)
22222225 // 'true' if MST topology supports DSC passthrough for sink
22232226 // 'false' if MST topology does not support DSC passthrough
22242227 bool is_dsc_passthrough_supported;
2225−#endif
22262228 struct dsc_dec_dpcd_caps dsc_dec_caps;
22272229 };
22282230
@@ -2324,6 +2326,7 @@ bool dc_is_plane_eligible_for_idle_optimizations(struct dc *dc, struct dc_plane_ · 95 unmodified lines
23242326 struct dc_cursor_attributes *cursor_attr);
23252327
23262328 void dc_allow_idle_optimizations(struct dc *dc, bool allow);
2329+void dc_exit_ips_for_hw_access(struct dc *dc);
23272330 bool dc_dmub_is_ips_idle_state(struct dc *dc);
23282331
23292332 /* set min and max memory clock to lowest and highest DPM level, respectively */
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c+22−9
@@ -74,7 +74,10 @@ void dc_dmub_srv_wait_idle(struct dc_dmub_srv *dc_dmub_srv) · 73 unmodified lines
7474 struct dc_context *dc_ctx = dc_dmub_srv->ctx;
7575 enum dmub_status status;
7676
77− status = dmub_srv_wait_for_idle(dmub, 100000);
77+ do {
78+ status = dmub_srv_wait_for_idle(dmub, 100000);
79+ } while (dc_dmub_srv->ctx->dc->debug.disable_timeout && status != DMUB_STATUS_OK);
80+
7881 if (status != DMUB_STATUS_OK) {
7982 DC_ERROR("Error waiting for DMUB idle: status=%d\n", status);
8083 dc_dmub_srv_log_diagnostic_data(dc_dmub_srv);
@@ -145,7 +148,9 @@ bool dc_dmub_srv_cmd_list_queue_execute(struct dc_dmub_srv *dc_dmub_srv, · 64 unmodified lines
145148 if (status == DMUB_STATUS_POWER_STATE_D3)
146149 return false;
147150
148− dmub_srv_wait_for_idle(dmub, 100000);
151+ do {
152+ status = dmub_srv_wait_for_idle(dmub, 100000);
153+ } while (dc_dmub_srv->ctx->dc->debug.disable_timeout && status != DMUB_STATUS_OK);
149154
150155 /* Requeue the command. */
151156 status = dmub_srv_cmd_queue(dmub, &cmd_list[i]);
@@ -186,7 +191,9 @@ bool dc_dmub_srv_wait_for_idle(struct dc_dmub_srv *dc_dmub_srv, · 34 unmodified lines
186191
187192 // Wait for DMUB to process command
188193 if (wait_type != DM_DMUB_WAIT_TYPE_NO_WAIT) {
189− status = dmub_srv_wait_for_idle(dmub, 100000);
194+ do {
195+ status = dmub_srv_wait_for_idle(dmub, 100000);
196+ } while (dc_dmub_srv->ctx->dc->debug.disable_timeout && status != DMUB_STATUS_OK);
190197
191198 if (status != DMUB_STATUS_OK) {
192199 DC_LOG_DEBUG("No reply for DMUB command: status=%d\n", status);
@@ -780,21 +787,22 @@ static void populate_subvp_cmd_pipe_info(struct dc *dc, · 587 unmodified lines
780787 } else if (subvp_pipe->next_odm_pipe) {
781788 pipe_data->pipe_config.subvp_data.main_split_pipe_index = subvp_pipe->next_odm_pipe->pipe_idx;
782789 } else {
783− pipe_data->pipe_config.subvp_data.main_split_pipe_index = 0;
790+ pipe_data->pipe_config.subvp_data.main_split_pipe_index = 0xF;
784791 }
785792
786793 // Find phantom pipe index based on phantom stream
787794 for (j = 0; j < dc->res_pool->pipe_count; j++) {
788795 struct pipe_ctx *phantom_pipe = &context->res_ctx.pipe_ctx[j];
789796
790− if (phantom_pipe->stream == dc_state_get_paired_subvp_stream(context, subvp_pipe->stream)) {
797+ if (resource_is_pipe_type(phantom_pipe, OTG_MASTER) &&
798+ phantom_pipe->stream == dc_state_get_paired_subvp_stream(context, subvp_pipe->stream)) {
791799 pipe_data->pipe_config.subvp_data.phantom_pipe_index = phantom_pipe->stream_res.tg->inst;
792800 if (phantom_pipe->bottom_pipe) {
793801 pipe_data->pipe_config.subvp_data.phantom_split_pipe_index = phantom_pipe->bottom_pipe->plane_res.hubp->inst;
794802 } else if (phantom_pipe->next_odm_pipe) {
795803 pipe_data->pipe_config.subvp_data.phantom_split_pipe_index = phantom_pipe->next_odm_pipe->plane_res.hubp->inst;
796804 } else {
797− pipe_data->pipe_config.subvp_data.phantom_split_pipe_index = 0;
805+ pipe_data->pipe_config.subvp_data.phantom_split_pipe_index = 0xF;
798806 }
799807 break;
800808 }
@@ -1195,6 +1203,9 @@ static void dc_dmub_srv_notify_idle(const struct dc *dc, bool allow_idle) · 394 unmodified lines
11951203 if (dc->debug.dmcub_emulation)
11961204 return;
11971205
1206+ if (!dc->ctx->dmub_srv || !dc->ctx->dmub_srv->dmub)
1207+ return;
1208+
11981209 memset(&cmd, 0, sizeof(cmd));
11991210 cmd.idle_opt_notify_idle.header.type = DMUB_CMD__IDLE_OPT;
12001211 cmd.idle_opt_notify_idle.header.sub_type = DMUB_CMD__IDLE_OPT_DCN_NOTIFY_IDLE;
@@ -1205,13 +1216,15 @@ static void dc_dmub_srv_notify_idle(const struct dc *dc, bool allow_idle) · 4 unmodified lines
12051216 cmd.idle_opt_notify_idle.cntl_data.driver_idle = allow_idle;
12061217
12071218 if (allow_idle) {
1219+ dc_dmub_srv_wait_idle(dc->ctx->dmub_srv);
1220+
12081221 if (dc->hwss.set_idle_state)
12091222 dc->hwss.set_idle_state(dc, true);
12101223 }
12111224
12121225 /* NOTE: This does not use the "wake" interface since this is part of the wake path. */
12131226 /* We also do not perform a wait since DMCUB could enter idle after the notification. */
1214− dm_execute_dmub_cmd(dc->ctx, &cmd, DM_DMUB_WAIT_TYPE_NO_WAIT);
1227+ dm_execute_dmub_cmd(dc->ctx, &cmd, allow_idle ? DM_DMUB_WAIT_TYPE_NO_WAIT : DM_DMUB_WAIT_TYPE_WAIT);
12151228 }
12161229
12171230 static void dc_dmub_srv_exit_low_power_state(const struct dc *dc)
@@ -1361,7 +1374,7 @@ bool dc_wake_and_execute_dmub_cmd_list(const struct dc_context *ctx, unsigned in · 143 unmodified lines
13611374 else
13621375 result = dm_execute_dmub_cmd(ctx, cmd, wait_type);
13631376
1364− if (result && reallow_idle)
1377+ if (result && reallow_idle && !ctx->dc->debug.disable_dmub_reallow_idle)
13651378 dc_dmub_srv_apply_idle_power_optimizations(ctx->dc, true);
13661379
13671380 return result;
@@ -1410,7 +1423,7 @@ bool dc_wake_and_execute_gpint(const struct dc_context *ctx, enum dmub_gpint_com · 42 unmodified lines
14101423
14111424 result = dc_dmub_execute_gpint(ctx, command_code, param, response, wait_type);
14121425
1413− if (result && reallow_idle)
1426+ if (result && reallow_idle && !ctx->dc->debug.disable_dmub_reallow_idle)
14141427 dc_dmub_srv_apply_idle_power_optimizations(ctx->dc, true);
14151428
14161429 return result;
drivers/gpu/drm/amd/display/dc/dc_hw_types.h+1−2
@@ -827,9 +827,7 @@ struct dc_dsc_config { · 826 unmodified lines
827827 uint32_t version_minor; /* DSC minor version. Full version is formed as 1.version_minor. */
828828 bool ycbcr422_simple; /* Tell DSC engine to convert YCbCr 4:2:2 to 'YCbCr 4:2:2 simple'. */
829829 int32_t rc_buffer_size; /* DSC RC buffer block size in bytes */
830−#if defined(CONFIG_DRM_AMD_DC_FP)
831830 bool is_frl; /* indicate if DSC is applied based on HDMI FRL sink's capability */
832−#endif
833831 bool is_dp; /* indicate if DSC is applied based on DP's capability */
834832 uint32_t mst_pbn; /* pbn of display on dsc mst hub */
835833 const struct dc_dsc_rc_params_override *rc_params_ovrd; /* DM owned memory. If not NULL, apply custom dsc rc params */
@@ -942,6 +940,7 @@ struct dc_crtc_timing { · 106 unmodified lines
942940 uint32_t hdmi_vic;
943941 uint32_t rid;
944942 uint32_t fr_index;
943+ uint32_t frl_uncompressed_video_bandwidth_in_kbps;
945944 enum dc_timing_3d_format timing_3d_format;
946945 enum dc_color_depth display_color_depth;
947946 enum dc_pixel_encoding pixel_encoding;
drivers/gpu/drm/amd/display/dc/dc_types.h+5−0
@@ -1034,6 +1034,7 @@ enum replay_FW_Message_type { · 1033 unmodified lines
10341034 Replay_Msg_Not_Support = -1,
10351035 Replay_Set_Timing_Sync_Supported,
10361036 Replay_Set_Residency_Frameupdate_Timer,
1037+ Replay_Set_Pseudo_VTotal,
10371038 };
10381039
10391040 union replay_error_status {
@@ -1089,6 +1090,10 @@ struct replay_settings { · 49 unmodified lines
10891090 uint16_t coasting_vtotal_table[PR_COASTING_TYPE_NUM];
10901091 /* Maximum link off frame count */
10911092 enum replay_link_off_frame_count_level link_off_frame_count_level;
1093+ /* Replay pseudo vtotal for abm + ips on full screen video which can improve ips residency */
1094+ uint16_t abm_with_ips_on_full_screen_video_pseudo_vtotal;
1095+ /* Replay last pseudo vtotal set to DMUB */
1096+ uint16_t last_pseudo_vtotal;
10921097 };
10931098
10941099 /* To split out "global" and "per-panel" config settings.
drivers/gpu/drm/amd/display/dc/dce/dce_audio.c+280−13
@@ -239,27 +239,294 @@ static void check_audio_bandwidth_hdmi( · 238 unmodified lines
239239 }
240240 }
241241 }
242+static struct fixed31_32 get_link_symbol_clk_freq_mhz(enum dc_link_rate link_rate)
243+{
244+ switch (link_rate) {
245+ case LINK_RATE_LOW:
246+ return dc_fixpt_from_int(162); /* 162 MHz */
247+ case LINK_RATE_HIGH:
248+ return dc_fixpt_from_int(270); /* 270 MHz */
249+ case LINK_RATE_HIGH2:
250+ return dc_fixpt_from_int(540); /* 540 MHz */
251+ case LINK_RATE_HIGH3:
252+ return dc_fixpt_from_int(810); /* 810 MHz */
253+ case LINK_RATE_UHBR10:
254+ return dc_fixpt_from_fraction(3125, 10); /* 312.5 MHz */
255+ case LINK_RATE_UHBR13_5:
256+ return dc_fixpt_from_fraction(421875, 1000); /* 421.875 MHz */
257+ case LINK_RATE_UHBR20:
258+ return dc_fixpt_from_int(625); /* 625 MHz */
259+ default:
260+ /* Unexpected case, this requires debug if encountered. */
261+ ASSERT(0);
262+ return dc_fixpt_from_int(0);
263+ }
264+}
265+
266+struct dp_audio_layout_config {
267+ uint8_t layouts_per_sample_denom;
268+ uint8_t symbols_per_layout;
269+ uint8_t max_layouts_per_audio_sdp;
270+};
271+
272+static void get_audio_layout_config(
273+ uint32_t channel_count,
274+ enum dp_link_encoding encoding,
275+ struct dp_audio_layout_config *output)
276+{
277+ /* Assuming L-PCM audio. Current implementation uses max 1 layout per SDP,
278+ * with each layout being the same size (8ch layout).
279+ */
280+ if (encoding == DP_8b_10b_ENCODING) {
281+ if (channel_count == 2) {
282+ output->layouts_per_sample_denom = 4;
283+ output->symbols_per_layout = 40;
284+ output->max_layouts_per_audio_sdp = 1;
285+ } else if (channel_count == 8 || channel_count == 6) {
286+ output->layouts_per_sample_denom = 1;
287+ output->symbols_per_layout = 40;
288+ output->max_layouts_per_audio_sdp = 1;
289+ }
290+ } else if (encoding == DP_128b_132b_ENCODING) {
291+ if (channel_count == 2) {
292+ output->layouts_per_sample_denom = 4;
293+ output->symbols_per_layout = 10;
294+ output->max_layouts_per_audio_sdp = 1;
295+ } else if (channel_count == 8 || channel_count == 6) {
296+ output->layouts_per_sample_denom = 1;
297+ output->symbols_per_layout = 10;
298+ output->max_layouts_per_audio_sdp = 1;
299+ }
300+ }
301+}
242302
243−/*For DP SST, calculate if specified sample rates can fit into a given timing */
244−static void check_audio_bandwidth_dpsst(
303+static uint32_t get_av_stream_map_lane_count(
304+ enum dp_link_encoding encoding,
305+ enum dc_lane_count lane_count,
306+ bool is_mst)
307+{
308+ uint32_t av_stream_map_lane_count = 0;
309+
310+ if (encoding == DP_8b_10b_ENCODING) {
311+ if (!is_mst)
312+ av_stream_map_lane_count = lane_count;
313+ else
314+ av_stream_map_lane_count = 4;
315+ } else if (encoding == DP_128b_132b_ENCODING) {
316+ av_stream_map_lane_count = 4;
317+ }
318+
319+ ASSERT(av_stream_map_lane_count != 0);
320+
321+ return av_stream_map_lane_count;
322+}
323+
324+static uint32_t get_audio_sdp_overhead(
325+ enum dp_link_encoding encoding,
326+ enum dc_lane_count lane_count,
327+ bool is_mst)
328+{
329+ uint32_t audio_sdp_overhead = 0;
330+
331+ if (encoding == DP_8b_10b_ENCODING) {
332+ if (is_mst)
333+ audio_sdp_overhead = 16; /* 4 * 2 + 8 */
334+ else
335+ audio_sdp_overhead = lane_count * 2 + 8;
336+ } else if (encoding == DP_128b_132b_ENCODING) {
337+ audio_sdp_overhead = 10; /* 4 x 2.5 */
338+ }
339+
340+ ASSERT(audio_sdp_overhead != 0);
341+
342+ return audio_sdp_overhead;
343+}
344+
345+static uint32_t calculate_required_audio_bw_in_symbols(
245346 const struct audio_crtc_info *crtc_info,
347+ const struct dp_audio_layout_config *layout_config,
246348 uint32_t channel_count,
247− union audio_sample_rates *sample_rates)
349+ uint32_t sample_rate_hz,
350+ uint32_t av_stream_map_lane_count,
351+ uint32_t audio_sdp_overhead)
352+{
353+ /* DP spec recommends between 1.05 to 1.1 safety margin to prevent sample under-run */
354+ struct fixed31_32 audio_sdp_margin = dc_fixpt_from_fraction(110, 100);
355+ struct fixed31_32 horizontal_line_freq_khz = dc_fixpt_from_fraction(
356+ crtc_info->requested_pixel_clock_100Hz, crtc_info->h_total * 10);
357+ struct fixed31_32 samples_per_line;
358+ struct fixed31_32 layouts_per_line;
359+ struct fixed31_32 symbols_per_sdp_max_layout;
360+ struct fixed31_32 remainder;
361+ uint32_t num_sdp_with_max_layouts;
362+ uint32_t required_symbols_per_hblank;
363+
364+ samples_per_line = dc_fixpt_from_fraction(sample_rate_hz, 1000);
365+ samples_per_line = dc_fixpt_div(samples_per_line, horizontal_line_freq_khz);
366+ layouts_per_line = dc_fixpt_div_int(samples_per_line, layout_config->layouts_per_sample_denom);
367+
368+ num_sdp_with_max_layouts = dc_fixpt_floor(
369+ dc_fixpt_div_int(layouts_per_line, layout_config->max_layouts_per_audio_sdp));
370+ symbols_per_sdp_max_layout = dc_fixpt_from_int(
371+ layout_config->max_layouts_per_audio_sdp * layout_config->symbols_per_layout);
372+ symbols_per_sdp_max_layout = dc_fixpt_add_int(symbols_per_sdp_max_layout, audio_sdp_overhead);
373+ symbols_per_sdp_max_layout = dc_fixpt_mul(symbols_per_sdp_max_layout, audio_sdp_margin);
374+ required_symbols_per_hblank = num_sdp_with_max_layouts;
375+ required_symbols_per_hblank *= ((dc_fixpt_ceil(symbols_per_sdp_max_layout) + av_stream_map_lane_count) /
376+ av_stream_map_lane_count) * av_stream_map_lane_count;
377+
378+ if (num_sdp_with_max_layouts != dc_fixpt_ceil(
379+ dc_fixpt_div_int(layouts_per_line, layout_config->max_layouts_per_audio_sdp))) {
380+ remainder = dc_fixpt_sub_int(layouts_per_line,
381+ num_sdp_with_max_layouts * layout_config->max_layouts_per_audio_sdp);
382+ remainder = dc_fixpt_mul_int(remainder, layout_config->symbols_per_layout);
383+ remainder = dc_fixpt_add_int(remainder, audio_sdp_overhead);
384+ remainder = dc_fixpt_mul(remainder, audio_sdp_margin);
385+ required_symbols_per_hblank += ((dc_fixpt_ceil(remainder) + av_stream_map_lane_count) /
386+ av_stream_map_lane_count) * av_stream_map_lane_count;
387+ }
388+
389+ return required_symbols_per_hblank;
390+}
391+
392+/* Current calculation only applicable for 8b/10b MST and 128b/132b SST/MST.
393+ */
394+static uint32_t calculate_available_hblank_bw_in_symbols(
395+ const struct audio_crtc_info *crtc_info,
396+ const struct audio_dp_link_info *dp_link_info)
248397 {
249− /* do nothing */
398+ uint64_t hblank = crtc_info->h_total - crtc_info->h_active;
399+ struct fixed31_32 hblank_time_msec =
400+ dc_fixpt_from_fraction(hblank * 10, crtc_info->requested_pixel_clock_100Hz);
401+ struct fixed31_32 lsclkfreq_mhz =
402+ get_link_symbol_clk_freq_mhz(dp_link_info->link_rate);
403+ struct fixed31_32 average_stream_sym_bw_frac;
404+ struct fixed31_32 peak_stream_bw_kbps;
405+ struct fixed31_32 bits_per_pixel;
406+ struct fixed31_32 link_bw_kbps;
407+ struct fixed31_32 available_stream_sym_count;
408+ uint32_t available_hblank_bw = 0; /* in stream symbols */
409+
410+ if (crtc_info->dsc_bits_per_pixel) {
411+ bits_per_pixel = dc_fixpt_from_fraction(crtc_info->dsc_bits_per_pixel, 16);
412+ } else {
413+ switch (crtc_info->color_depth) {
414+ case COLOR_DEPTH_666:
415+ bits_per_pixel = dc_fixpt_from_int(6);
416+ break;
417+ case COLOR_DEPTH_888:
418+ bits_per_pixel = dc_fixpt_from_int(8);
419+ break;
420+ case COLOR_DEPTH_101010:
421+ bits_per_pixel = dc_fixpt_from_int(10);
422+ break;
423+ case COLOR_DEPTH_121212:
424+ bits_per_pixel = dc_fixpt_from_int(12);
425+ break;
426+ default:
427+ /* Default to commonly supported color depth. */
428+ bits_per_pixel = dc_fixpt_from_int(8);
429+ break;
430+ }
431+
432+ bits_per_pixel = dc_fixpt_mul_int(bits_per_pixel, 3);
433+
434+ if (crtc_info->pixel_encoding == PIXEL_ENCODING_YCBCR422) {
435+ bits_per_pixel = dc_fixpt_div_int(bits_per_pixel, 3);
436+ bits_per_pixel = dc_fixpt_mul_int(bits_per_pixel, 2);
437+ } else if (crtc_info->pixel_encoding == PIXEL_ENCODING_YCBCR420) {
438+ bits_per_pixel = dc_fixpt_div_int(bits_per_pixel, 2);
439+ }
440+ }
441+
442+ /* Use simple stream BW calculation because mainlink overhead is
443+ * accounted for separately in the audio BW calculations.
444+ */
445+ peak_stream_bw_kbps = dc_fixpt_from_fraction(crtc_info->requested_pixel_clock_100Hz, 10);
446+ peak_stream_bw_kbps = dc_fixpt_mul(peak_stream_bw_kbps, bits_per_pixel);
447+ link_bw_kbps = dc_fixpt_from_int(dp_link_info->link_bandwidth_kbps);
448+ average_stream_sym_bw_frac = dc_fixpt_div(peak_stream_bw_kbps, link_bw_kbps);
449+
450+ available_stream_sym_count = dc_fixpt_mul_int(hblank_time_msec, 1000);
451+ available_stream_sym_count = dc_fixpt_mul(available_stream_sym_count, lsclkfreq_mhz);
452+ available_stream_sym_count = dc_fixpt_mul(available_stream_sym_count, average_stream_sym_bw_frac);
453+ available_hblank_bw = dc_fixpt_floor(available_stream_sym_count);
454+ available_hblank_bw *= dp_link_info->lane_count;
455+ available_hblank_bw -= crtc_info->dsc_num_slices * 4; /* EOC overhead */
456+
457+ if (available_hblank_bw < dp_link_info->hblank_min_symbol_width)
458+ available_hblank_bw = dp_link_info->hblank_min_symbol_width;
459+
460+ if (available_hblank_bw < 12)
461+ available_hblank_bw = 0;
462+ else
463+ available_hblank_bw -= 12; /* Main link overhead */
464+
465+ return available_hblank_bw;
250466 }
251467
252−/*For DP MST, calculate if specified sample rates can fit into a given timing */
253−static void check_audio_bandwidth_dpmst(
468+static void check_audio_bandwidth_dp(
254469 const struct audio_crtc_info *crtc_info,
470+ const struct audio_dp_link_info *dp_link_info,
255471 uint32_t channel_count,
256472 union audio_sample_rates *sample_rates)
257473 {
258− /* do nothing */
474+ struct dp_audio_layout_config layout_config = {0};
475+ uint32_t available_hblank_bw;
476+ uint32_t av_stream_map_lane_count;
477+ uint32_t audio_sdp_overhead;
478+
479+ /* TODO: Add validation for SST 8b/10 case */
480+ if (!dp_link_info->is_mst && dp_link_info->encoding == DP_8b_10b_ENCODING)
481+ return;
482+
483+ available_hblank_bw = calculate_available_hblank_bw_in_symbols(
484+ crtc_info, dp_link_info);
485+ av_stream_map_lane_count = get_av_stream_map_lane_count(
486+ dp_link_info->encoding, dp_link_info->lane_count, dp_link_info->is_mst);
487+ audio_sdp_overhead = get_audio_sdp_overhead(
488+ dp_link_info->encoding, dp_link_info->lane_count, dp_link_info->is_mst);
489+ get_audio_layout_config(
490+ channel_count, dp_link_info->encoding, &layout_config);
491+
492+ if (layout_config.max_layouts_per_audio_sdp == 0 ||
493+ layout_config.symbols_per_layout == 0 ||
494+ layout_config.layouts_per_sample_denom == 0) {
495+ return;
496+ }
497+ if (available_hblank_bw < calculate_required_audio_bw_in_symbols(
498+ crtc_info, &layout_config, channel_count, 192000,
499+ av_stream_map_lane_count, audio_sdp_overhead))
500+ sample_rates->rate.RATE_192 = 0;
501+ if (available_hblank_bw < calculate_required_audio_bw_in_symbols(
502+ crtc_info, &layout_config, channel_count, 176400,
503+ av_stream_map_lane_count, audio_sdp_overhead))
504+ sample_rates->rate.RATE_176_4 = 0;
505+ if (available_hblank_bw < calculate_required_audio_bw_in_symbols(
506+ crtc_info, &layout_config, channel_count, 96000,
507+ av_stream_map_lane_count, audio_sdp_overhead))
508+ sample_rates->rate.RATE_96 = 0;
509+ if (available_hblank_bw < calculate_required_audio_bw_in_symbols(
510+ crtc_info, &layout_config, channel_count, 88200,
511+ av_stream_map_lane_count, audio_sdp_overhead))
512+ sample_rates->rate.RATE_88_2 = 0;
513+ if (available_hblank_bw < calculate_required_audio_bw_in_symbols(
514+ crtc_info, &layout_config, channel_count, 48000,
515+ av_stream_map_lane_count, audio_sdp_overhead))
516+ sample_rates->rate.RATE_48 = 0;
517+ if (available_hblank_bw < calculate_required_audio_bw_in_symbols(
518+ crtc_info, &layout_config, channel_count, 44100,
519+ av_stream_map_lane_count, audio_sdp_overhead))
520+ sample_rates->rate.RATE_44_1 = 0;
521+ if (available_hblank_bw < calculate_required_audio_bw_in_symbols(
522+ crtc_info, &layout_config, channel_count, 32000,
523+ av_stream_map_lane_count, audio_sdp_overhead))
524+ sample_rates->rate.RATE_32 = 0;
259525 }
260526
261527 static void check_audio_bandwidth(
262528 const struct audio_crtc_info *crtc_info,
529+ const struct audio_dp_link_info *dp_link_info,
263530 uint32_t channel_count,
264531 enum signal_type signal,
265532 union audio_sample_rates *sample_rates)
@@ -271,12 +538,9 @@ static void check_audio_bandwidth( · 5 unmodified lines
271538 break;
272539 case SIGNAL_TYPE_EDP:
273540 case SIGNAL_TYPE_DISPLAY_PORT:
274− check_audio_bandwidth_dpsst(
275− crtc_info, channel_count, sample_rates);
276− break;
277541 case SIGNAL_TYPE_DISPLAY_PORT_MST:
278− check_audio_bandwidth_dpmst(
279− crtc_info, channel_count, sample_rates);
542+ check_audio_bandwidth_dp(
543+ crtc_info, dp_link_info, channel_count, sample_rates);
280544 break;
281545 default:
282546 break;
@@ -394,7 +658,8 @@ void dce_aud_az_configure( · 111 unmodified lines
394658 struct audio *audio,
395659 enum signal_type signal,
396660 const struct audio_crtc_info *crtc_info,
397− const struct audio_info *audio_info)
661+ const struct audio_info *audio_info,
662+ const struct audio_dp_link_info *dp_link_info)
398663 {
399664 struct dce_audio *aud = DCE_AUD(audio);
400665
@@ -529,6 +794,7 @@ void dce_aud_az_configure( · 128 unmodified lines
529794
530795 check_audio_bandwidth(
531796 crtc_info,
797+ dp_link_info,
532798 channel_count,
533799 signal,
534800 &sample_rates);
@@ -588,6 +854,7 @@ void dce_aud_az_configure( · 53 unmodified lines
588854
589855 check_audio_bandwidth(
590856 crtc_info,
857+ dp_link_info,
591858 8,
592859 signal,
593860 &sample_rate);
drivers/gpu/drm/amd/display/dc/dce/dce_audio.h+2−1
@@ -170,7 +170,8 @@ void dce_aud_az_disable(struct audio *audio); · 169 unmodified lines
170170 void dce_aud_az_configure(struct audio *audio,
171171 enum signal_type signal,
172172 const struct audio_crtc_info *crtc_info,
173− const struct audio_info *audio_info);
173+ const struct audio_info *audio_info,
174+ const struct audio_dp_link_info *dp_link_info);
174175
175176 void dce_aud_wall_dto_setup(struct audio *audio,
176177 enum signal_type signal,
drivers/gpu/drm/amd/display/dc/dce/dmub_replay.c+2−2
@@ -258,7 +258,7 @@ static void dmub_replay_residency(struct dmub_replay *dmub, uint8_t panel_inst, · 257 unmodified lines
258258 *residency = 0;
259259 }
260260
261−/**
261+/*
262262 * Set REPLAY power optimization flags and coasting vtotal.
263263 */
264264 static void dmub_replay_set_power_opt_and_coasting_vtotal(struct dmub_replay *dmub,
@@ -280,7 +280,7 @@ static void dmub_replay_set_power_opt_and_coasting_vtotal(struct dmub_replay *dm · 15 unmodified lines
280280 dc_wake_and_execute_dmub_cmd(dc, &cmd, DM_DMUB_WAIT_TYPE_WAIT);
281281 }
282282
283−/**
283+/*
284284 * send Replay general cmd to DMUB.
285285 */
286286 static void dmub_replay_send_cmd(struct dmub_replay *dmub,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c+20−0
@@ -62,6 +62,26 @@ void cm_helper_program_color_matrices( · 61 unmodified lines
6262
6363 }
6464
65+void cm_helper_read_color_matrices(struct dc_context *ctx,
66+ uint16_t *regval,
67+ const struct color_matrices_reg *reg)
68+{
69+ uint32_t cur_csc_reg, regval0, regval1;
70+ unsigned int i = 0;
71+
72+ for (cur_csc_reg = reg->csc_c11_c12;
73+ cur_csc_reg <= reg->csc_c33_c34; cur_csc_reg++) {
74+ REG_GET_2(cur_csc_reg,
75+ csc_c11, &regval0,
76+ csc_c12, &regval1);
77+
78+ regval[2 * i] = regval0;
79+ regval[(2 * i) + 1] = regval1;
80+
81+ i++;
82+ }
83+}
84+
6585 void cm_helper_program_xfer_func(
6686 struct dc_context *ctx,
6787 const struct pwl_params *params,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.h+3−1
@@ -114,5 +114,7 @@ bool cm_helper_translate_curve_to_degamma_hw_format( · 113 unmodified lines
114114 const struct dc_transfer_func *output_tf,
115115 struct pwl_params *lut_params);
116116
117−
117+void cm_helper_read_color_matrices(struct dc_context *ctx,
118+ uint16_t *regval,
119+ const struct color_matrices_reg *reg);
118120 #endif
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c+2−1
@@ -543,7 +543,8 @@ static const struct dpp_funcs dcn10_dpp_funcs = { · 542 unmodified lines
543543 .dpp_set_hdr_multiplier = dpp1_set_hdr_multiplier,
544544 .dpp_program_blnd_lut = NULL,
545545 .dpp_program_shaper_lut = NULL,
546− .dpp_program_3dlut = NULL
546+ .dpp_program_3dlut = NULL,
547+ .dpp_get_gamut_remap = dpp1_cm_get_gamut_remap,
547548 };
548549
549550 static struct dpp_caps dcn10_dpp_cap = {
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h+3−0
@@ -1521,4 +1521,7 @@ void dpp1_construct(struct dcn10_dpp *dpp1, · 1520 unmodified lines
15211521 const struct dcn_dpp_registers *tf_regs,
15221522 const struct dcn_dpp_shift *tf_shift,
15231523 const struct dcn_dpp_mask *tf_mask);
1524+
1525+void dpp1_cm_get_gamut_remap(struct dpp *dpp_base,
1526+ struct dpp_grph_csc_adjustment *adjust);
15241527 #endif
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c+69−1
@@ -98,7 +98,7 @@ static void program_gamut_remap( · 97 unmodified lines
9898
9999 if (regval == NULL || select == GAMUT_REMAP_BYPASS) {
100100 REG_SET(CM_GAMUT_REMAP_CONTROL, 0,
101− CM_GAMUT_REMAP_MODE, 0);
101+ CM_GAMUT_REMAP_MODE, 0);
102102 return;
103103 }
104104 switch (select) {
@@ -181,6 +181,74 @@ void dpp1_cm_set_gamut_remap( · 76 unmodified lines
181181 }
182182 }
183183
184+static void read_gamut_remap(struct dcn10_dpp *dpp,
185+ uint16_t *regval,
186+ enum gamut_remap_select *select)
187+{
188+ struct color_matrices_reg gam_regs;
189+ uint32_t selection;
190+
191+ REG_GET(CM_GAMUT_REMAP_CONTROL,
192+ CM_GAMUT_REMAP_MODE, &selection);
193+
194+ *select = selection;
195+
196+ gam_regs.shifts.csc_c11 = dpp->tf_shift->CM_GAMUT_REMAP_C11;
197+ gam_regs.masks.csc_c11 = dpp->tf_mask->CM_GAMUT_REMAP_C11;
198+ gam_regs.shifts.csc_c12 = dpp->tf_shift->CM_GAMUT_REMAP_C12;
199+ gam_regs.masks.csc_c12 = dpp->tf_mask->CM_GAMUT_REMAP_C12;
200+
201+ if (*select == GAMUT_REMAP_COEFF) {
202+
203+ gam_regs.csc_c11_c12 = REG(CM_GAMUT_REMAP_C11_C12);
204+ gam_regs.csc_c33_c34 = REG(CM_GAMUT_REMAP_C33_C34);
205+
206+ cm_helper_read_color_matrices(
207+ dpp->base.ctx,
208+ regval,
209+ &gam_regs);
210+
211+ } else if (*select == GAMUT_REMAP_COMA_COEFF) {
212+
213+ gam_regs.csc_c11_c12 = REG(CM_COMA_C11_C12);
214+ gam_regs.csc_c33_c34 = REG(CM_COMA_C33_C34);
215+
216+ cm_helper_read_color_matrices(
217+ dpp->base.ctx,
218+ regval,
219+ &gam_regs);
220+
221+ } else if (*select == GAMUT_REMAP_COMB_COEFF) {
222+
223+ gam_regs.csc_c11_c12 = REG(CM_COMB_C11_C12);
224+ gam_regs.csc_c33_c34 = REG(CM_COMB_C33_C34);
225+
226+ cm_helper_read_color_matrices(
227+ dpp->base.ctx,
228+ regval,
229+ &gam_regs);
230+ }
231+}
232+
233+void dpp1_cm_get_gamut_remap(struct dpp *dpp_base,
234+ struct dpp_grph_csc_adjustment *adjust)
235+{
236+ struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
237+ uint16_t arr_reg_val[12];
238+ enum gamut_remap_select select;
239+
240+ read_gamut_remap(dpp, arr_reg_val, &select);
241+
242+ if (select == GAMUT_REMAP_BYPASS) {
243+ adjust->gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS;
244+ return;
245+ }
246+
247+ adjust->gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW;
248+ convert_hw_matrix(adjust->temperature_matrix,
249+ arr_reg_val, ARRAY_SIZE(arr_reg_val));
250+}
251+
184252 static void dpp1_cm_program_color_matrix(
185253 struct dcn10_dpp *dpp,
186254 const uint16_t *regval)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.c+7−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 *
2424 */
2525
26+#include "core_types.h"
2627 #include "dm_services.h"
2728 #include "dcn10_opp.h"
2829 #include "reg_helper.h"
@@ -160,6 +161,9 @@ static void opp1_set_pixel_encoding( · 131 unmodified lines
160161 struct dcn10_opp *oppn10,
161162 const struct clamping_and_pixel_encoding_params *params)
162163 {
164+ bool force_chroma_subsampling_1tap =
165+ oppn10->base.ctx->dc->debug.force_chroma_subsampling_1tap;
166+
163167 switch (params->pixel_encoding) {
164168
165169 case PIXEL_ENCODING_RGB:
@@ -178,6 +182,9 @@ static void opp1_set_pixel_encoding( · 12 unmodified lines
178182 default:
179183 break;
180184 }
185+
186+ if (force_chroma_subsampling_1tap)
187+ REG_UPDATE(FMT_CONTROL, FMT_SUBSAMPLING_MODE, 0);
181188 }
182189
183190 /**
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dpp.c+17−14
@@ -55,21 +55,23 @@ void dpp20_read_state(struct dpp *dpp_base, · 54 unmodified lines
5555
5656 REG_GET(DPP_CONTROL,
5757 DPP_CLOCK_ENABLE, &s->is_enabled);
58+
59+ // Degamma LUT (RAM)
5860 REG_GET(CM_DGAM_CONTROL,
59− CM_DGAM_LUT_MODE, &s->dgam_lut_mode);
60− // BGAM has no ROM, and definition is different, can't reuse same dump
61− //REG_GET(CM_BLNDGAM_CONTROL,
62− // CM_BLNDGAM_LUT_MODE, &s->rgam_lut_mode);
63− REG_GET(CM_GAMUT_REMAP_CONTROL,
64− CM_GAMUT_REMAP_MODE, &s->gamut_remap_mode);
65− if (s->gamut_remap_mode) {
66− s->gamut_remap_c11_c12 = REG_READ(CM_GAMUT_REMAP_C11_C12);
67− s->gamut_remap_c13_c14 = REG_READ(CM_GAMUT_REMAP_C13_C14);
68− s->gamut_remap_c21_c22 = REG_READ(CM_GAMUT_REMAP_C21_C22);
69− s->gamut_remap_c23_c24 = REG_READ(CM_GAMUT_REMAP_C23_C24);
70− s->gamut_remap_c31_c32 = REG_READ(CM_GAMUT_REMAP_C31_C32);
71− s->gamut_remap_c33_c34 = REG_READ(CM_GAMUT_REMAP_C33_C34);
72− }
61+ CM_DGAM_LUT_MODE, &s->dgam_lut_mode);
62+
63+ // Shaper LUT (RAM), 3D LUT (mode, bit-depth, size)
64+ REG_GET(CM_SHAPER_CONTROL,
65+ CM_SHAPER_LUT_MODE, &s->shaper_lut_mode);
66+ REG_GET_2(CM_3DLUT_READ_WRITE_CONTROL,
67+ CM_3DLUT_CONFIG_STATUS, &s->lut3d_mode,
68+ CM_3DLUT_30BIT_EN, &s->lut3d_bit_depth);
69+ REG_GET(CM_3DLUT_MODE,
70+ CM_3DLUT_SIZE, &s->lut3d_size);
71+
72+ // Blend/Out Gamma (RAM)
73+ REG_GET(CM_BLNDGAM_LUT_WRITE_EN_MASK,
74+ CM_BLNDGAM_CONFIG_STATUS, &s->rgam_lut_mode);
7375 }
7476
7577 void dpp2_power_on_obuf(
@@ -393,6 +395,7 @@ static struct dpp_funcs dcn20_dpp_funcs = { · 317 unmodified lines
393395 .set_optional_cursor_attributes = dpp1_cnv_set_optional_cursor_attributes,
394396 .dpp_dppclk_control = dpp1_dppclk_control,
395397 .dpp_set_hdr_multiplier = dpp2_set_hdr_multiplier,
398+ .dpp_get_gamut_remap = dpp2_cm_get_gamut_remap,
396399 };
397400
398401 static struct dpp_caps dcn20_dpp_cap = {
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dpp.h+3−0
@@ -775,4 +775,7 @@ bool dpp2_construct(struct dcn20_dpp *dpp2, · 774 unmodified lines
775775 void dpp2_power_on_obuf(
776776 struct dpp *dpp_base,
777777 bool power_on);
778+
779+void dpp2_cm_get_gamut_remap(struct dpp *dpp_base,
780+ struct dpp_grph_csc_adjustment *adjust);
778781 #endif /* __DC_HWSS_DCN20_H__ */
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dpp_cm.c+55−0
@@ -234,6 +234,61 @@ void dpp2_cm_set_gamut_remap( · 233 unmodified lines
234234 }
235235 }
236236
237+static void read_gamut_remap(struct dcn20_dpp *dpp,
238+ uint16_t *regval,
239+ enum dcn20_gamut_remap_select *select)
240+{
241+ struct color_matrices_reg gam_regs;
242+ uint32_t selection;
243+
244+ IX_REG_GET(CM_TEST_DEBUG_INDEX, CM_TEST_DEBUG_DATA,
245+ CM_TEST_DEBUG_DATA_STATUS_IDX,
246+ CM_TEST_DEBUG_DATA_GAMUT_REMAP_MODE, &selection);
247+
248+ *select = selection;
249+
250+ gam_regs.shifts.csc_c11 = dpp->tf_shift->CM_GAMUT_REMAP_C11;
251+ gam_regs.masks.csc_c11 = dpp->tf_mask->CM_GAMUT_REMAP_C11;
252+ gam_regs.shifts.csc_c12 = dpp->tf_shift->CM_GAMUT_REMAP_C12;
253+ gam_regs.masks.csc_c12 = dpp->tf_mask->CM_GAMUT_REMAP_C12;
254+
255+ if (*select == DCN2_GAMUT_REMAP_COEF_A) {
256+ gam_regs.csc_c11_c12 = REG(CM_GAMUT_REMAP_C11_C12);
257+ gam_regs.csc_c33_c34 = REG(CM_GAMUT_REMAP_C33_C34);
258+
259+ cm_helper_read_color_matrices(dpp->base.ctx,
260+ regval,
261+ &gam_regs);
262+
263+ } else if (*select == DCN2_GAMUT_REMAP_COEF_B) {
264+ gam_regs.csc_c11_c12 = REG(CM_GAMUT_REMAP_B_C11_C12);
265+ gam_regs.csc_c33_c34 = REG(CM_GAMUT_REMAP_B_C33_C34);
266+
267+ cm_helper_read_color_matrices(dpp->base.ctx,
268+ regval,
269+ &gam_regs);
270+ }
271+}
272+
273+void dpp2_cm_get_gamut_remap(struct dpp *dpp_base,
274+ struct dpp_grph_csc_adjustment *adjust)
275+{
276+ struct dcn20_dpp *dpp = TO_DCN20_DPP(dpp_base);
277+ uint16_t arr_reg_val[12];
278+ enum dcn20_gamut_remap_select select;
279+
280+ read_gamut_remap(dpp, arr_reg_val, &select);
281+
282+ if (select == DCN2_GAMUT_REMAP_BYPASS) {
283+ adjust->gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS;
284+ return;
285+ }
286+
287+ adjust->gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW;
288+ convert_hw_matrix(adjust->temperature_matrix,
289+ arr_reg_val, ARRAY_SIZE(arr_reg_val));
290+}
291+
237292 void dpp2_program_input_csc(
238293 struct dpp *dpp_base,
239294 enum dc_color_space color_space,
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c+23−1
@@ -542,8 +542,30 @@ static struct mpcc *mpc2_get_mpcc_for_dpp(struct mpc_tree *tree, int dpp_id) · 541 unmodified lines
542542 return NULL;
543543 }
544544
545+static void mpc2_read_mpcc_state(
546+ struct mpc *mpc,
547+ int mpcc_inst,
548+ struct mpcc_state *s)
549+{
550+ struct dcn20_mpc *mpc20 = TO_DCN20_MPC(mpc);
551+
552+ REG_GET(MPCC_OPP_ID[mpcc_inst], MPCC_OPP_ID, &s->opp_id);
553+ REG_GET(MPCC_TOP_SEL[mpcc_inst], MPCC_TOP_SEL, &s->dpp_id);
554+ REG_GET(MPCC_BOT_SEL[mpcc_inst], MPCC_BOT_SEL, &s->bot_mpcc_id);
555+ REG_GET_4(MPCC_CONTROL[mpcc_inst], MPCC_MODE, &s->mode,
556+ MPCC_ALPHA_BLND_MODE, &s->alpha_mode,
557+ MPCC_ALPHA_MULTIPLIED_MODE, &s->pre_multiplied_alpha,
558+ MPCC_BLND_ACTIVE_OVERLAP_ONLY, &s->overlap_only);
559+ REG_GET_2(MPCC_STATUS[mpcc_inst], MPCC_IDLE, &s->idle,
560+ MPCC_BUSY, &s->busy);
561+
562+ /* Gamma block state */
563+ REG_GET(MPCC_OGAM_LUT_RAM_CONTROL[mpcc_inst],
564+ MPCC_OGAM_CONFIG_STATUS, &s->rgam_mode);
565+}
566+
545567 static const struct mpc_funcs dcn20_mpc_funcs = {
546− .read_mpcc_state = mpc1_read_mpcc_state,
568+ .read_mpcc_state = mpc2_read_mpcc_state,
547569 .insert_plane = mpc1_insert_plane,
548570 .remove_mpcc = mpc1_remove_mpcc,
549571 .mpc_init = mpc1_mpc_init,
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_dpp.c+1−0
@@ -275,6 +275,7 @@ static struct dpp_funcs dcn201_dpp_funcs = { · 274 unmodified lines
275275 .set_optional_cursor_attributes = dpp1_cnv_set_optional_cursor_attributes,
276276 .dpp_dppclk_control = dpp1_dppclk_control,
277277 .dpp_set_hdr_multiplier = dpp2_set_hdr_multiplier,
278+ .dpp_get_gamut_remap = dpp2_cm_get_gamut_remap,
278279 };
279280
280281 static struct dpp_caps dcn201_dpp_cap = {
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dpp.c+36−2
@@ -44,12 +44,45 @@ · 43 unmodified lines
4444 void dpp30_read_state(struct dpp *dpp_base, struct dcn_dpp_state *s)
4545 {
4646 struct dcn3_dpp *dpp = TO_DCN30_DPP(dpp_base);
47+ uint32_t gamcor_lut_mode, rgam_lut_mode;
4748
4849 REG_GET(DPP_CONTROL,
49− DPP_CLOCK_ENABLE, &s->is_enabled);
50+ DPP_CLOCK_ENABLE, &s->is_enabled);
51+
52+ // Pre-degamma (ROM)
53+ REG_GET_2(PRE_DEGAM,
54+ PRE_DEGAM_MODE, &s->pre_dgam_mode,
55+ PRE_DEGAM_SELECT, &s->pre_dgam_select);
56+
57+ // Gamma Correction (RAM)
58+ REG_GET(CM_GAMCOR_CONTROL,
59+ CM_GAMCOR_MODE_CURRENT, &s->gamcor_mode);
60+ if (s->gamcor_mode) {
61+ REG_GET(CM_GAMCOR_CONTROL, CM_GAMCOR_SELECT_CURRENT, &gamcor_lut_mode);
62+ if (!gamcor_lut_mode)
63+ s->gamcor_mode = LUT_RAM_A; // Otherwise, LUT_RAM_B
64+ }
5065
51− // TODO: Implement for DCN3
66+ // Shaper LUT (RAM), 3D LUT (mode, bit-depth, size)
67+ REG_GET(CM_SHAPER_CONTROL,
68+ CM_SHAPER_LUT_MODE, &s->shaper_lut_mode);
69+ REG_GET(CM_3DLUT_MODE,
70+ CM_3DLUT_MODE_CURRENT, &s->lut3d_mode);
71+ REG_GET(CM_3DLUT_READ_WRITE_CONTROL,
72+ CM_3DLUT_30BIT_EN, &s->lut3d_bit_depth);
73+ REG_GET(CM_3DLUT_MODE,
74+ CM_3DLUT_SIZE, &s->lut3d_size);
75+
76+ // Blend/Out Gamma (RAM)
77+ REG_GET(CM_BLNDGAM_CONTROL,
78+ CM_BLNDGAM_MODE_CURRENT, &s->rgam_lut_mode);
79+ if (s->rgam_lut_mode){
80+ REG_GET(CM_BLNDGAM_CONTROL, CM_BLNDGAM_SELECT_CURRENT, &rgam_lut_mode);
81+ if (!rgam_lut_mode)
82+ s->rgam_lut_mode = LUT_RAM_A; // Otherwise, LUT_RAM_B
83+ }
5284 }
85+
5386 /*program post scaler scs block in dpp CM*/
5487 void dpp3_program_post_csc(
5588 struct dpp *dpp_base,
@@ -1462,6 +1495,7 @@ static struct dpp_funcs dcn30_dpp_funcs = { · 1406 unmodified lines
14621495 .set_optional_cursor_attributes = dpp1_cnv_set_optional_cursor_attributes,
14631496 .dpp_dppclk_control = dpp1_dppclk_control,
14641497 .dpp_set_hdr_multiplier = dpp3_set_hdr_multiplier,
1498+ .dpp_get_gamut_remap = dpp3_cm_get_gamut_remap,
14651499 };
14661500
14671501
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dpp.h+2−0
@@ -637,4 +637,6 @@ void dpp3_program_cm_dealpha( · 636 unmodified lines
637637 struct dpp *dpp_base,
638638 uint32_t enable, uint32_t additive_blending);
639639
640+void dpp3_cm_get_gamut_remap(struct dpp *dpp_base,
641+ struct dpp_grph_csc_adjustment *adjust);
640642 #endif /* __DC_HWSS_DCN30_H__ */
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dpp_cm.c+54−0
@@ -408,3 +408,57 @@ void dpp3_cm_set_gamut_remap( · 407 unmodified lines
408408 program_gamut_remap(dpp, arr_reg_val, gamut_mode);
409409 }
410410 }
411+
412+static void read_gamut_remap(struct dcn3_dpp *dpp,
413+ uint16_t *regval,
414+ int *select)
415+{
416+ struct color_matrices_reg gam_regs;
417+ uint32_t selection;
418+
419+ //current coefficient set in use
420+ REG_GET(CM_GAMUT_REMAP_CONTROL, CM_GAMUT_REMAP_MODE_CURRENT, &selection);
421+
422+ *select = selection;
423+
424+ gam_regs.shifts.csc_c11 = dpp->tf_shift->CM_GAMUT_REMAP_C11;
425+ gam_regs.masks.csc_c11 = dpp->tf_mask->CM_GAMUT_REMAP_C11;
426+ gam_regs.shifts.csc_c12 = dpp->tf_shift->CM_GAMUT_REMAP_C12;
427+ gam_regs.masks.csc_c12 = dpp->tf_mask->CM_GAMUT_REMAP_C12;
428+
429+ if (*select == GAMUT_REMAP_COEFF) {
430+ gam_regs.csc_c11_c12 = REG(CM_GAMUT_REMAP_C11_C12);
431+ gam_regs.csc_c33_c34 = REG(CM_GAMUT_REMAP_C33_C34);
432+
433+ cm_helper_read_color_matrices(dpp->base.ctx,
434+ regval,
435+ &gam_regs);
436+
437+ } else if (*select == GAMUT_REMAP_COMA_COEFF) {
438+ gam_regs.csc_c11_c12 = REG(CM_GAMUT_REMAP_B_C11_C12);
439+ gam_regs.csc_c33_c34 = REG(CM_GAMUT_REMAP_B_C33_C34);
440+
441+ cm_helper_read_color_matrices(dpp->base.ctx,
442+ regval,
443+ &gam_regs);
444+ }
445+}
446+
447+void dpp3_cm_get_gamut_remap(struct dpp *dpp_base,
448+ struct dpp_grph_csc_adjustment *adjust)
449+{
450+ struct dcn3_dpp *dpp = TO_DCN30_DPP(dpp_base);
451+ uint16_t arr_reg_val[12];
452+ int select;
453+
454+ read_gamut_remap(dpp, arr_reg_val, &select);
455+
456+ if (select == GAMUT_REMAP_BYPASS) {
457+ adjust->gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS;
458+ return;
459+ }
460+
461+ adjust->gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW;
462+ convert_hw_matrix(adjust->temperature_matrix,
463+ arr_reg_val, ARRAY_SIZE(arr_reg_val));
464+}
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c+105−1
@@ -1129,6 +1129,64 @@ void mpc3_set_gamut_remap( · 1128 unmodified lines
11291129 }
11301130 }
11311131
1132+static void read_gamut_remap(struct dcn30_mpc *mpc30,
1133+ int mpcc_id,
1134+ uint16_t *regval,
1135+ uint32_t *select)
1136+{
1137+ struct color_matrices_reg gam_regs;
1138+
1139+ //current coefficient set in use
1140+ REG_GET(MPCC_GAMUT_REMAP_MODE[mpcc_id], MPCC_GAMUT_REMAP_MODE_CURRENT, select);
1141+
1142+ gam_regs.shifts.csc_c11 = mpc30->mpc_shift->MPCC_GAMUT_REMAP_C11_A;
1143+ gam_regs.masks.csc_c11 = mpc30->mpc_mask->MPCC_GAMUT_REMAP_C11_A;
1144+ gam_regs.shifts.csc_c12 = mpc30->mpc_shift->MPCC_GAMUT_REMAP_C12_A;
1145+ gam_regs.masks.csc_c12 = mpc30->mpc_mask->MPCC_GAMUT_REMAP_C12_A;
1146+
1147+ if (*select == GAMUT_REMAP_COEFF) {
1148+ gam_regs.csc_c11_c12 = REG(MPC_GAMUT_REMAP_C11_C12_A[mpcc_id]);
1149+ gam_regs.csc_c33_c34 = REG(MPC_GAMUT_REMAP_C33_C34_A[mpcc_id]);
1150+
1151+ cm_helper_read_color_matrices(
1152+ mpc30->base.ctx,
1153+ regval,
1154+ &gam_regs);
1155+
1156+ } else if (*select == GAMUT_REMAP_COMA_COEFF) {
1157+
1158+ gam_regs.csc_c11_c12 = REG(MPC_GAMUT_REMAP_C11_C12_B[mpcc_id]);
1159+ gam_regs.csc_c33_c34 = REG(MPC_GAMUT_REMAP_C33_C34_B[mpcc_id]);
1160+
1161+ cm_helper_read_color_matrices(
1162+ mpc30->base.ctx,
1163+ regval,
1164+ &gam_regs);
1165+
1166+ }
1167+
1168+}
1169+
1170+void mpc3_get_gamut_remap(struct mpc *mpc,
1171+ int mpcc_id,
1172+ struct mpc_grph_gamut_adjustment *adjust)
1173+{
1174+ struct dcn30_mpc *mpc30 = TO_DCN30_MPC(mpc);
1175+ uint16_t arr_reg_val[12];
1176+ int select;
1177+
1178+ read_gamut_remap(mpc30, mpcc_id, arr_reg_val, &select);
1179+
1180+ if (select == GAMUT_REMAP_BYPASS) {
1181+ adjust->gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS;
1182+ return;
1183+ }
1184+
1185+ adjust->gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW;
1186+ convert_hw_matrix(adjust->temperature_matrix,
1187+ arr_reg_val, ARRAY_SIZE(arr_reg_val));
1188+}
1189+
11321190 bool mpc3_program_3dlut(
11331191 struct mpc *mpc,
11341192 const struct tetrahedral_params *params,
@@ -1382,8 +1440,54 @@ static void mpc3_set_mpc_mem_lp_mode(struct mpc *mpc) · 247 unmodified lines
13821440 }
13831441 }
13841442
1443+static void mpc3_read_mpcc_state(
1444+ struct mpc *mpc,
1445+ int mpcc_inst,
1446+ struct mpcc_state *s)
1447+{
1448+ struct dcn30_mpc *mpc30 = TO_DCN30_MPC(mpc);
1449+ uint32_t rmu_status = 0xf;
1450+
1451+ REG_GET(MPCC_OPP_ID[mpcc_inst], MPCC_OPP_ID, &s->opp_id);
1452+ REG_GET(MPCC_TOP_SEL[mpcc_inst], MPCC_TOP_SEL, &s->dpp_id);
1453+ REG_GET(MPCC_BOT_SEL[mpcc_inst], MPCC_BOT_SEL, &s->bot_mpcc_id);
1454+ REG_GET_4(MPCC_CONTROL[mpcc_inst], MPCC_MODE, &s->mode,
1455+ MPCC_ALPHA_BLND_MODE, &s->alpha_mode,
1456+ MPCC_ALPHA_MULTIPLIED_MODE, &s->pre_multiplied_alpha,
1457+ MPCC_BLND_ACTIVE_OVERLAP_ONLY, &s->overlap_only);
1458+ REG_GET_2(MPCC_STATUS[mpcc_inst], MPCC_IDLE, &s->idle,
1459+ MPCC_BUSY, &s->busy);
1460+
1461+ /* Color blocks state */
1462+ REG_GET(MPC_RMU_CONTROL, MPC_RMU0_MUX_STATUS, &rmu_status);
1463+
1464+ if (rmu_status == mpcc_inst) {
1465+ REG_GET(SHAPER_CONTROL[0],
1466+ MPC_RMU_SHAPER_LUT_MODE_CURRENT, &s->shaper_lut_mode);
1467+ REG_GET(RMU_3DLUT_MODE[0],
1468+ MPC_RMU_3DLUT_MODE_CURRENT, &s->lut3d_mode);
1469+ REG_GET(RMU_3DLUT_READ_WRITE_CONTROL[0],
1470+ MPC_RMU_3DLUT_30BIT_EN, &s->lut3d_bit_depth);
1471+ REG_GET(RMU_3DLUT_MODE[0],
1472+ MPC_RMU_3DLUT_SIZE, &s->lut3d_size);
1473+ } else {
1474+ REG_GET(SHAPER_CONTROL[1],
1475+ MPC_RMU_SHAPER_LUT_MODE_CURRENT, &s->shaper_lut_mode);
1476+ REG_GET(RMU_3DLUT_MODE[1],
1477+ MPC_RMU_3DLUT_MODE_CURRENT, &s->lut3d_mode);
1478+ REG_GET(RMU_3DLUT_READ_WRITE_CONTROL[1],
1479+ MPC_RMU_3DLUT_30BIT_EN, &s->lut3d_bit_depth);
1480+ REG_GET(RMU_3DLUT_MODE[1],
1481+ MPC_RMU_3DLUT_SIZE, &s->lut3d_size);
1482+ }
1483+
1484+ REG_GET_2(MPCC_OGAM_CONTROL[mpcc_inst],
1485+ MPCC_OGAM_MODE_CURRENT, &s->rgam_mode,
1486+ MPCC_OGAM_SELECT_CURRENT, &s->rgam_lut);
1487+}
1488+
13851489 static const struct mpc_funcs dcn30_mpc_funcs = {
1386− .read_mpcc_state = mpc1_read_mpcc_state,
1490+ .read_mpcc_state = mpc3_read_mpcc_state,
13871491 .insert_plane = mpc1_insert_plane,
13881492 .remove_mpcc = mpc1_remove_mpcc,
13891493 .mpc_init = mpc1_mpc_init,
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.h+4−0
@@ -1056,6 +1056,10 @@ void mpc3_set_gamut_remap( · 1055 unmodified lines
10561056 int mpcc_id,
10571057 const struct mpc_grph_gamut_adjustment *adjust);
10581058
1059+void mpc3_get_gamut_remap(struct mpc *mpc,
1060+ int mpcc_id,
1061+ struct mpc_grph_gamut_adjustment *adjust);
1062+
10591063 void mpc3_set_rmu_mux(
10601064 struct mpc *mpc,
10611065 int rmu_idx,
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dio_link_encoder.c+2−2
@@ -203,12 +203,12 @@ void dcn32_link_encoder_construct( · 202 unmodified lines
203203 enc10->base.hpd_source = init_data->hpd_source;
204204 enc10->base.connector = init_data->connector;
205205
206− if (enc10->base.connector.id == CONNECTOR_ID_USBC)
207− enc10->base.features.flags.bits.DP_IS_USB_C = 1;
208206
209207 enc10->base.preferred_engine = ENGINE_ID_UNKNOWN;
210208
211209 enc10->base.features = *enc_features;
210+ if (enc10->base.connector.id == CONNECTOR_ID_USBC)
211+ enc10->base.features.flags.bits.DP_IS_USB_C = 1;
212212
213213 enc10->base.transmitter = init_data->transmitter;
214214
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dpp.c+1−0
@@ -133,6 +133,7 @@ static struct dpp_funcs dcn32_dpp_funcs = { · 132 unmodified lines
133133 .set_optional_cursor_attributes = dpp1_cnv_set_optional_cursor_attributes,
134134 .dpp_dppclk_control = dpp1_dppclk_control,
135135 .dpp_set_hdr_multiplier = dpp3_set_hdr_multiplier,
136+ .dpp_get_gamut_remap = dpp3_cm_get_gamut_remap,
136137 };
137138
138139
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_link_encoder.c+2−2
@@ -184,8 +184,6 @@ void dcn35_link_encoder_construct( · 183 unmodified lines
184184 enc10->base.hpd_source = init_data->hpd_source;
185185 enc10->base.connector = init_data->connector;
186186
187− if (enc10->base.connector.id == CONNECTOR_ID_USBC)
188− enc10->base.features.flags.bits.DP_IS_USB_C = 1;
189187
190188 enc10->base.preferred_engine = ENGINE_ID_UNKNOWN;
191189
@@ -240,6 +238,8 @@ void dcn35_link_encoder_construct( · 48 unmodified lines
240238 }
241239
242240 enc10->base.features.flags.bits.HDMI_6GB_EN = 1;
241+ if (enc10->base.connector.id == CONNECTOR_ID_USBC)
242+ enc10->base.features.flags.bits.DP_IS_USB_C = 1;
243243
244244 if (bp_funcs->get_connector_speed_cap_info)
245245 result = bp_funcs->get_connector_speed_cap_info(enc10->base.ctx->dc_bios,
drivers/gpu/drm/amd/display/dc/dm_cp_psp.h+3−0
@@ -26,6 +26,9 @@ · 25 unmodified lines
2626 #ifndef DM_CP_PSP_IF__H
2727 #define DM_CP_PSP_IF__H
2828
29+/*
30+ * Interface to CPLIB/PSP to enable ASSR
31+ */
2932 struct dc_link;
3033
3134 struct cp_psp_stream_config {
drivers/gpu/drm/amd/display/dc/dml/Makefile+3−3
@@ -72,11 +72,11 @@ CFLAGS_$(AMDDALPATH)/dc/dml/display_mode_lib.o := $(dml_ccflags) · 71 unmodified lines
7272 CFLAGS_$(AMDDALPATH)/dc/dml/display_mode_vba.o := $(dml_ccflags)
7373 CFLAGS_$(AMDDALPATH)/dc/dml/dcn10/dcn10_fpu.o := $(dml_ccflags)
7474 CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/dcn20_fpu.o := $(dml_ccflags)
75−CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20.o := $(dml_ccflags)
75+CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20.o := $(dml_ccflags) $(frame_warn_flag)
7676 CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_rq_dlg_calc_20.o := $(dml_ccflags)
77−CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20v2.o := $(dml_ccflags)
77+CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20v2.o := $(dml_ccflags) $(frame_warn_flag)
7878 CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_rq_dlg_calc_20v2.o := $(dml_ccflags)
79−CFLAGS_$(AMDDALPATH)/dc/dml/dcn21/display_mode_vba_21.o := $(dml_ccflags)
79+CFLAGS_$(AMDDALPATH)/dc/dml/dcn21/display_mode_vba_21.o := $(dml_ccflags) $(frame_warn_flag)
8080 CFLAGS_$(AMDDALPATH)/dc/dml/dcn21/display_rq_dlg_calc_21.o := $(dml_ccflags)
8181 CFLAGS_$(AMDDALPATH)/dc/dml/dcn30/display_mode_vba_30.o := $(dml_ccflags) $(frame_warn_flag)
8282 CFLAGS_$(AMDDALPATH)/dc/dml/dcn30/display_rq_dlg_calc_30.o := $(dml_ccflags)
drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c+8−8
@@ -4273,7 +4273,7 @@ void dml30_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 4272 unmodified lines
42734273
42744274 //Calculate Swath, DET Configuration, DCFCLKDeepSleep
42754275 //
4276− for (i = 0; i < mode_lib->soc.num_states; ++i) {
4276+ for (i = start_state; i < mode_lib->soc.num_states; ++i) {
42774277 for (j = 0; j <= 1; ++j) {
42784278 for (k = 0; k < v->NumberOfActivePlanes; ++k) {
42794279 v->RequiredDPPCLKThisState[k] = v->RequiredDPPCLK[i][j][k];
@@ -4576,7 +4576,7 @@ void dml30_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 296 unmodified lines
45764576
45774577 //Calculate Return BW
45784578
4579− for (i = 0; i < mode_lib->soc.num_states; ++i) {
4579+ for (i = start_state; i < mode_lib->soc.num_states; ++i) {
45804580 for (j = 0; j <= 1; ++j) {
45814581 for (k = 0; k <= v->NumberOfActivePlanes - 1; k++) {
45824582 if (v->BlendingAndTiming[k] == k) {
@@ -4635,7 +4635,7 @@ void dml30_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 52 unmodified lines
46354635 v->UrgentOutOfOrderReturnPerChannelVMDataOnly);
46364636 v->FinalDRAMClockChangeLatency = (v->DRAMClockChangeLatencyOverride > 0 ? v->DRAMClockChangeLatencyOverride : v->DRAMClockChangeLatency);
46374637
4638− for (i = 0; i < mode_lib->soc.num_states; ++i) {
4638+ for (i = start_state; i < mode_lib->soc.num_states; ++i) {
46394639 for (j = 0; j <= 1; ++j) {
46404640 v->DCFCLKState[i][j] = v->DCFCLKPerState[i];
46414641 }
@@ -4646,7 +4646,7 @@ void dml30_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 4 unmodified lines
46464646
46474647 if (v->ClampMinDCFCLK) {
46484648 /* Clamp calculated values to actual minimum */
4649− for (i = 0; i < mode_lib->soc.num_states; ++i) {
4649+ for (i = start_state; i < mode_lib->soc.num_states; ++i) {
46504650 for (j = 0; j <= 1; ++j) {
46514651 if (v->DCFCLKState[i][j] < mode_lib->soc.min_dcfclk) {
46524652 v->DCFCLKState[i][j] = mode_lib->soc.min_dcfclk;
@@ -4656,7 +4656,7 @@ void dml30_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 3 unmodified lines
46564656 }
46574657 }
46584658
4659− for (i = 0; i < mode_lib->soc.num_states; ++i) {
4659+ for (i = start_state; i < mode_lib->soc.num_states; ++i) {
46604660 for (j = 0; j <= 1; ++j) {
46614661 v->IdealSDPPortBandwidthPerState[i][j] = dml_min3(
46624662 v->ReturnBusWidth * v->DCFCLKState[i][j],
@@ -4674,7 +4674,7 @@ void dml30_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 11 unmodified lines
46744674
46754675 //Re-ordering Buffer Support Check
46764676
4677− for (i = 0; i < mode_lib->soc.num_states; ++i) {
4677+ for (i = start_state; i < mode_lib->soc.num_states; ++i) {
46784678 for (j = 0; j <= 1; ++j) {
46794679 if ((v->ROBBufferSizeInKByte - v->PixelChunkSizeInKByte) * 1024 / v->ReturnBWPerState[i][j]
46804680 > (v->RoundTripPingLatencyCycles + 32) / v->DCFCLKState[i][j] + ReorderingBytes / v->ReturnBWPerState[i][j]) {
@@ -4692,7 +4692,7 @@ void dml30_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 11 unmodified lines
46924692 MaxTotalVActiveRDBandwidth = MaxTotalVActiveRDBandwidth + v->ReadBandwidthLuma[k] + v->ReadBandwidthChroma[k];
46934693 }
46944694
4695− for (i = 0; i < mode_lib->soc.num_states; ++i) {
4695+ for (i = start_state; i < mode_lib->soc.num_states; ++i) {
46964696 for (j = 0; j <= 1; ++j) {
46974697 v->MaxTotalVerticalActiveAvailableBandwidth[i][j] = dml_min(
46984698 v->IdealSDPPortBandwidthPerState[i][j] * v->MaxAveragePercentOfIdealSDPPortBWDisplayCanUseInNormalSystemOperation / 100,
@@ -4708,7 +4708,7 @@ void dml30_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 9 unmodified lines
47084708
47094709 //Prefetch Check
47104710
4711− for (i = 0; i < mode_lib->soc.num_states; ++i) {
4711+ for (i = start_state; i < mode_lib->soc.num_states; ++i) {
47124712 for (j = 0; j <= 1; ++j) {
47134713 int NextPrefetchModeState = MinPrefetchMode;
47144714
drivers/gpu/drm/amd/display/dc/dml/dcn303/dcn303_fpu.c+11−0
@@ -266,6 +266,17 @@ void dcn303_fpu_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_p · 265 unmodified lines
266266 optimal_uclk_for_dcfclk_sta_targets[i] =
267267 bw_params->clk_table.entries[j].memclk_mhz * 16;
268268 break;
269+ } else {
270+ /* condition where (dcfclk_sta_targets[i] >= optimal_dcfclk_for_uclk[j]):
271+ * This is required for dcn303 because it just so happens that the memory
272+ * bandwidth is low enough such that all the optimal DCFCLK for each UCLK
273+ * is lower than the smallest DCFCLK STA target. In this case we need to
274+ * populate the optimal UCLK for each DCFCLK STA target to be the max UCLK.
275+ */
276+ if (j == num_uclk_states - 1) {
277+ optimal_uclk_for_dcfclk_sta_targets[i] =
278+ bw_params->clk_table.entries[j].memclk_mhz * 16;
279+ }
269280 }
270281 }
271282 }
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c+13−6
@@ -1112,7 +1112,7 @@ struct pipe_slice_table { · 1111 unmodified lines
11121112 struct pipe_ctx *pri_pipe;
11131113 struct dc_plane_state *plane;
11141114 int slice_count;
1115− } mpc_combines[MAX_SURFACES];
1115+ } mpc_combines[MAX_PLANES];
11161116 int mpc_combine_count;
11171117 };
11181118
@@ -1288,7 +1288,7 @@ static bool update_pipes_with_split_flags(struct dc *dc, struct dc_state *contex · 169 unmodified lines
12881288 return updated;
12891289 }
12901290
1291−static bool should_allow_odm_power_optimization(struct dc *dc,
1291+static bool should_apply_odm_power_optimization(struct dc *dc,
12921292 struct dc_state *context, struct vba_vars_st *v, int *split,
12931293 bool *merge)
12941294 {
@@ -1392,9 +1392,12 @@ static void try_odm_power_optimization_and_revalidate( · 97 unmodified lines
13921392 {
13931393 int i;
13941394 unsigned int new_vlevel;
1395+ unsigned int cur_policy[MAX_PIPES];
13951396
1396− for (i = 0; i < pipe_cnt; i++)
1397+ for (i = 0; i < pipe_cnt; i++) {
1398+ cur_policy[i] = pipes[i].pipe.dest.odm_combine_policy;
13971399 pipes[i].pipe.dest.odm_combine_policy = dm_odm_combine_policy_2to1;
1400+ }
13981401
13991402 new_vlevel = dml_get_voltage_level(&context->bw_ctx.dml, pipes, pipe_cnt);
14001403
@@ -1403,6 +1406,9 @@ static void try_odm_power_optimization_and_revalidate( · 2 unmodified lines
14031406 memset(merge, 0, MAX_PIPES * sizeof(bool));
14041407 *vlevel = dcn20_validate_apply_pipe_split_flags(dc, context, new_vlevel, split, merge);
14051408 context->bw_ctx.dml.vba.VoltageLevel = *vlevel;
1409+ } else {
1410+ for (i = 0; i < pipe_cnt; i++)
1411+ pipes[i].pipe.dest.odm_combine_policy = cur_policy[i];
14061412 }
14071413 }
14081414
@@ -1580,7 +1586,7 @@ static void dcn32_full_validate_bw_helper(struct dc *dc, · 171 unmodified lines
15801586 }
15811587 }
15821588
1583− if (should_allow_odm_power_optimization(dc, context, vba, split, merge))
1589+ if (should_apply_odm_power_optimization(dc, context, vba, split, merge))
15841590 try_odm_power_optimization_and_revalidate(
15851591 dc, context, pipes, split, merge, vlevel, *pipe_cnt);
15861592
@@ -2209,7 +2215,8 @@ bool dcn32_internal_validate_bw(struct dc *dc, · 622 unmodified lines
22092215 int i;
22102216
22112217 pipe_cnt = dc->res_pool->funcs->populate_dml_pipes(dc, context, pipes, fast_validate);
2212− dcn32_update_dml_pipes_odm_policy_based_on_context(dc, context, pipes);
2218+ if (!dc->config.enable_windowed_mpo_odm)
2219+ dcn32_update_dml_pipes_odm_policy_based_on_context(dc, context, pipes);
22132220
22142221 /* repopulate_pipes = 1 means the pipes were either split or merged. In this case
22152222 * we have to re-calculate the DET allocation and run through DML once more to
@@ -2753,7 +2760,7 @@ static int build_synthetic_soc_states(bool disable_dc_mode_overwrite, struct clk · 537 unmodified lines
27532760 struct _vcs_dpi_voltage_scaling_st entry = {0};
27542761 struct clk_limit_table_entry max_clk_data = {0};
27552762
2756− unsigned int min_dcfclk_mhz = 199, min_fclk_mhz = 299;
2763+ unsigned int min_dcfclk_mhz = 399, min_fclk_mhz = 599;
27572764
27582765 static const unsigned int num_dcfclk_stas = 5;
27592766 unsigned int dcfclk_sta_targets[DC__VOLTAGE_STATES] = {199, 615, 906, 1324, 1564};
drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c+4−4
@@ -164,8 +164,8 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_5_soc = { · 163 unmodified lines
164164 },
165165 },
166166 .num_states = 5,
167− .sr_exit_time_us = 14.0,
168− .sr_enter_plus_exit_time_us = 16.0,
167+ .sr_exit_time_us = 28.0,
168+ .sr_enter_plus_exit_time_us = 30.0,
169169 .sr_exit_z8_time_us = 210.0,
170170 .sr_enter_plus_exit_z8_time_us = 320.0,
171171 .fclk_change_latency_us = 24.0,
@@ -583,9 +583,9 @@ void dcn35_decide_zstate_support(struct dc *dc, struct dc_state *context) · 411 unmodified lines
583583 plane_count++;
584584 }
585585
586− if (plane_count == 0) {
586+ if (context->stream_count == 0 || plane_count == 0) {
587587 support = DCN_ZSTATE_SUPPORT_ALLOW;
588− } else if (plane_count == 1 && context->stream_count == 1 && context->streams[0]->signal == SIGNAL_TYPE_EDP) {
588+ } else if (context->stream_count == 1 && context->streams[0]->signal == SIGNAL_TYPE_EDP) {
589589 struct dc_link *link = context->streams[0]->sink->link;
590590 bool is_pwrseq0 = link && link->link_index == 0;
591591 bool is_psr1 = link && link->psr_settings.psr_version == DC_PSR_VERSION_1 && !link->panel_config.psr.disable_psr;
drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c+33−8
@@ -141,14 +141,33 @@ static unsigned int find_pipes_assigned_to_plane(struct dml2_context *ctx, · 140 unmodified lines
141141 {
142142 int i;
143143 unsigned int num_found = 0;
144− unsigned int plane_id_assigned_to_pipe;
144+ unsigned int plane_id_assigned_to_pipe = -1;
145145
146146 for (i = 0; i < ctx->config.dcn_pipe_count; i++) {
147− if (state->res_ctx.pipe_ctx[i].plane_state && get_plane_id(ctx, state, state->res_ctx.pipe_ctx[i].plane_state,
148− state->res_ctx.pipe_ctx[i].stream->stream_id,
149− ctx->v20.scratch.dml_to_dc_pipe_mapping.dml_pipe_idx_to_plane_index[state->res_ctx.pipe_ctx[i].pipe_idx], &plane_id_assigned_to_pipe)) {
150− if (plane_id_assigned_to_pipe == plane_id)
151− pipes[num_found++] = i;
147+ struct pipe_ctx *pipe = &state->res_ctx.pipe_ctx[i];
148+
149+ if (!pipe->plane_state || !pipe->stream)
150+ continue;
151+
152+ get_plane_id(ctx, state, pipe->plane_state, pipe->stream->stream_id,
153+ ctx->v20.scratch.dml_to_dc_pipe_mapping.dml_pipe_idx_to_plane_index[pipe->pipe_idx],
154+ &plane_id_assigned_to_pipe);
155+ if (plane_id_assigned_to_pipe == plane_id && !pipe->prev_odm_pipe
156+ && (!pipe->top_pipe || pipe->top_pipe->plane_state != pipe->plane_state)) {
157+ while (pipe) {
158+ struct pipe_ctx *mpc_pipe = pipe;
159+
160+ while (mpc_pipe) {
161+ pipes[num_found++] = mpc_pipe->pipe_idx;
162+ mpc_pipe = mpc_pipe->bottom_pipe;
163+ if (!mpc_pipe)
164+ break;
165+ if (mpc_pipe->plane_state != pipe->plane_state)
166+ mpc_pipe = NULL;
167+ }
168+ pipe = pipe->next_odm_pipe;
169+ }
170+ break;
152171 }
153172 }
154173
@@ -566,8 +585,14 @@ static unsigned int find_pipes_assigned_to_stream(struct dml2_context *ctx, stru · 411 unmodified lines
566585 unsigned int num_found = 0;
567586
568587 for (i = 0; i < ctx->config.dcn_pipe_count; i++) {
569− if (state->res_ctx.pipe_ctx[i].stream && state->res_ctx.pipe_ctx[i].stream->stream_id == stream_id) {
570− pipes[num_found++] = i;
588+ struct pipe_ctx *pipe = &state->res_ctx.pipe_ctx[i];
589+
590+ if (pipe->stream && pipe->stream->stream_id == stream_id && !pipe->top_pipe && !pipe->prev_odm_pipe) {
591+ while (pipe) {
592+ pipes[num_found++] = pipe->pipe_idx;
593+ pipe = pipe->next_odm_pipe;
594+ }
595+ break;
571596 }
572597 }
573598
drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c+12−21
@@ -341,9 +341,6 @@ void dml2_init_soc_states(struct dml2_context *dml2, const struct dc *in_dc, · 340 unmodified lines
341341 break;
342342 }
343343
344− if (dml2->config.bbox_overrides.clks_table.num_states)
345− p->in_states->num_states = dml2->config.bbox_overrides.clks_table.num_states;
346−
347344 /* Override from passed values, if available */
348345 for (i = 0; i < p->in_states->num_states; i++) {
349346 if (dml2->config.bbox_overrides.sr_exit_latency_us) {
@@ -400,6 +397,7 @@ void dml2_init_soc_states(struct dml2_context *dml2, const struct dc *in_dc, · 50 unmodified lines
400397 }
401398 /* Copy clocks tables entries, if available */
402399 if (dml2->config.bbox_overrides.clks_table.num_states) {
400+ p->in_states->num_states = dml2->config.bbox_overrides.clks_table.num_states;
403401
404402 for (i = 0; i < dml2->config.bbox_overrides.clks_table.num_entries_per_clk.num_dcfclk_levels; i++) {
405403 p->in_states->state_array[i].dcfclk_mhz = dml2->config.bbox_overrides.clks_table.clk_entries[i].dcfclk_mhz;
@@ -793,35 +791,28 @@ static void populate_dml_surface_cfg_from_plane_state(enum dml_project_id dml2_p · 387 unmodified lines
793791 }
794792 }
795793
796−/*TODO no support for mpc combine, need rework - should calculate scaling params based on plane+stream*/
797−static struct scaler_data get_scaler_data_for_plane(const struct dc_plane_state *in, const struct dc_state *context)
794+static struct scaler_data get_scaler_data_for_plane(const struct dc_plane_state *in, struct dc_state *context)
798795 {
799796 int i;
800− struct scaler_data data = { 0 };
797+ struct pipe_ctx *temp_pipe = &context->res_ctx.temp_pipe;
798+
799+ memset(temp_pipe, 0, sizeof(struct pipe_ctx));
801800
802801 for (i = 0; i < MAX_PIPES; i++) {
803802 const struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
804803
805804 if (pipe->plane_state == in && !pipe->prev_odm_pipe) {
806− const struct pipe_ctx *next_pipe = pipe->next_odm_pipe;
807−
808− data = context->res_ctx.pipe_ctx[i].plane_res.scl_data;
809− while (next_pipe) {
810− data.h_active += next_pipe->plane_res.scl_data.h_active;
811− data.recout.width += next_pipe->plane_res.scl_data.recout.width;
812− if (in->rotation == ROTATION_ANGLE_0 || in->rotation == ROTATION_ANGLE_180) {
813− data.viewport.width += next_pipe->plane_res.scl_data.viewport.width;
814− } else {
815− data.viewport.height += next_pipe->plane_res.scl_data.viewport.height;
816− }
817− next_pipe = next_pipe->next_odm_pipe;
818− }
805+ temp_pipe->stream = pipe->stream;
806+ temp_pipe->plane_state = pipe->plane_state;
807+ temp_pipe->plane_res.scl_data.taps = pipe->plane_res.scl_data.taps;
808+
809+ resource_build_scaling_params(temp_pipe);
819810 break;
820811 }
821812 }
822813
823814 ASSERT(i < MAX_PIPES);
824− return data;
815+ return temp_pipe->plane_res.scl_data;
825816 }
826817
827818 static void populate_dummy_dml_plane_cfg(struct dml_plane_cfg_st *out, unsigned int location, const struct dc_stream_state *in)
@@ -866,7 +857,7 @@ static void populate_dummy_dml_plane_cfg(struct dml_plane_cfg_st *out, unsigned · 38 unmodified lines
866857 out->ScalerEnabled[location] = false;
867858 }
868859
869−static void populate_dml_plane_cfg_from_plane_state(struct dml_plane_cfg_st *out, unsigned int location, const struct dc_plane_state *in, const struct dc_state *context)
860+static void populate_dml_plane_cfg_from_plane_state(struct dml_plane_cfg_st *out, unsigned int location, const struct dc_plane_state *in, struct dc_state *context)
870861 {
871862 const struct scaler_data scaler_data = get_scaler_data_for_plane(in, context);
872863
drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c+1−1
@@ -234,7 +234,7 @@ static bool get_plane_id(struct dml2_context *dml2, const struct dc_state *state · 233 unmodified lines
234234 if (state->streams[i]->stream_id == stream_id) {
235235 for (j = 0; j < state->stream_status[i].plane_count; j++) {
236236 if (state->stream_status[i].plane_states[j] == plane &&
237− (!is_plane_duplicate || (is_plane_duplicate && (j == plane_index)))) {
237+ (!is_plane_duplicate || (j == plane_index))) {
238238 *plane_id = (i << 16) | j;
239239 return true;
240240 }
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c+5−0
@@ -137,6 +137,11 @@ uint32_t dc_bandwidth_in_kbps_from_timing( · 136 unmodified lines
137137 if (link_encoding == DC_LINK_ENCODING_DP_128b_132b)
138138 kbps = apply_128b_132b_stream_overhead(timing, kbps);
139139
140+ if (link_encoding == DC_LINK_ENCODING_HDMI_FRL &&
141+ timing->vic == 0 && timing->hdmi_vic == 0 &&
142+ timing->frl_uncompressed_video_bandwidth_in_kbps != 0)
143+ kbps = timing->frl_uncompressed_video_bandwidth_in_kbps;
144+
140145 return kbps;
141146 }
142147
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c+58−4
@@ -1183,9 +1183,9 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx) · 1182 unmodified lines
11831183 dto_params.timing = &pipe_ctx->stream->timing;
11841184 dp_hpo_inst = pipe_ctx->stream_res.hpo_dp_stream_enc->inst;
11851185 if (dccg) {
1186− dccg->funcs->set_dtbclk_dto(dccg, &dto_params);
11871186 dccg->funcs->disable_symclk32_se(dccg, dp_hpo_inst);
11881187 dccg->funcs->set_dpstreamclk(dccg, REFCLK, tg->inst, dp_hpo_inst);
1188+ dccg->funcs->set_dtbclk_dto(dccg, &dto_params);
11891189 }
11901190 } else if (dccg && dccg->funcs->disable_symclk_se) {
11911191 dccg->funcs->disable_symclk_se(dccg, stream_enc->stream_enc_inst,
@@ -1291,6 +1291,46 @@ static enum audio_dto_source translate_to_dto_source(enum controller_id crtc_id) · 99 unmodified lines
12911291 }
12921292 }
12931293
1294+static void populate_audio_dp_link_info(
1295+ const struct pipe_ctx *pipe_ctx,
1296+ struct audio_dp_link_info *dp_link_info)
1297+{
1298+ const struct dc_stream_state *stream = pipe_ctx->stream;
1299+ const struct dc_link *link = stream->link;
1300+ struct fixed31_32 link_bw_kbps;
1301+
1302+ dp_link_info->encoding = link->dc->link_srv->dp_get_encoding_format(
1303+ &pipe_ctx->link_config.dp_link_settings);
1304+ dp_link_info->is_mst = (stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST);
1305+ dp_link_info->lane_count = pipe_ctx->link_config.dp_link_settings.lane_count;
1306+ dp_link_info->link_rate = pipe_ctx->link_config.dp_link_settings.link_rate;
1307+
1308+ link_bw_kbps = dc_fixpt_from_int(dc_link_bandwidth_kbps(link,
1309+ &pipe_ctx->link_config.dp_link_settings));
1310+
1311+ /* For audio stream calculations, the video stream should not include FEC or SSC
1312+ * in order to get the most pessimistic values.
1313+ */
1314+ if (dp_link_info->encoding == DP_8b_10b_ENCODING &&
1315+ link->dc->link_srv->dp_is_fec_supported(link)) {
1316+ link_bw_kbps = dc_fixpt_mul(link_bw_kbps,
1317+ dc_fixpt_from_fraction(100, DATA_EFFICIENCY_8b_10b_FEC_EFFICIENCY_x100));
1318+ } else if (dp_link_info->encoding == DP_128b_132b_ENCODING) {
1319+ link_bw_kbps = dc_fixpt_mul(link_bw_kbps,
1320+ dc_fixpt_from_fraction(10000, 9975)); /* 99.75% SSC overhead*/
1321+ }
1322+
1323+ dp_link_info->link_bandwidth_kbps = dc_fixpt_floor(link_bw_kbps);
1324+
1325+ /* HW minimum for 128b/132b HBlank is 4 frame symbols.
1326+ * TODO: Plumb the actual programmed HBlank min symbol width to here.
1327+ */
1328+ if (dp_link_info->encoding == DP_128b_132b_ENCODING)
1329+ dp_link_info->hblank_min_symbol_width = 4;
1330+ else
1331+ dp_link_info->hblank_min_symbol_width = 0;
1332+}
1333+
12941334 static void build_audio_output(
12951335 struct dc_state *state,
12961336 const struct pipe_ctx *pipe_ctx,
@@ -1338,6 +1378,15 @@ static void build_audio_output( · 41 unmodified lines
13381378 audio_output->crtc_info.calculated_pixel_clock_100Hz =
13391379 pipe_ctx->stream_res.pix_clk_params.requested_pix_clk_100hz;
13401380
1381+ audio_output->crtc_info.pixel_encoding =
1382+ stream->timing.pixel_encoding;
1383+
1384+ audio_output->crtc_info.dsc_bits_per_pixel =
1385+ stream->timing.dsc_cfg.bits_per_pixel;
1386+
1387+ audio_output->crtc_info.dsc_num_slices =
1388+ stream->timing.dsc_cfg.num_slices_h;
1389+
13411390 /*for HDMI, audio ACR is with deep color ratio factor*/
13421391 if (dc_is_hdmi_tmds_signal(pipe_ctx->stream->signal) &&
13431392 audio_output->crtc_info.requested_pixel_clock_100Hz ==
@@ -1371,6 +1420,10 @@ static void build_audio_output( · 27 unmodified lines
13711420
13721421 audio_output->pll_info.ss_percentage =
13731422 pipe_ctx->pll_settings.ss_percentage;
1423+
1424+ if (dc_is_dp_signal(pipe_ctx->stream->signal)) {
1425+ populate_audio_dp_link_info(pipe_ctx, &audio_output->dp_link_info);
1426+ }
13741427 }
13751428
13761429 static void program_scaler(const struct dc *dc,
@@ -1476,7 +1529,7 @@ static enum dc_status dce110_enable_stream_timing( · 99 unmodified lines
14761529 return DC_OK;
14771530 }
14781531
1479−static enum dc_status apply_single_controller_ctx_to_hw(
1532+enum dc_status dce110_apply_single_controller_ctx_to_hw(
14801533 struct pipe_ctx *pipe_ctx,
14811534 struct dc_state *context,
14821535 struct dc *dc)
@@ -1507,7 +1560,8 @@ static enum dc_status apply_single_controller_ctx_to_hw( · 24 unmodified lines
15071560 pipe_ctx->stream_res.audio,
15081561 pipe_ctx->stream->signal,
15091562 &audio_output.crtc_info,
1510− &pipe_ctx->stream->audio_info);
1563+ &pipe_ctx->stream->audio_info,
1564+ &audio_output.dp_link_info);
15111565 }
15121566
15131567 /* make sure no pipes syncd to the pipe being enabled */
@@ -2302,7 +2356,7 @@ enum dc_status dce110_apply_ctx_to_hw( · 788 unmodified lines
23022356 if (pipe_ctx->top_pipe || pipe_ctx->prev_odm_pipe)
23032357 continue;
23042358
2305− status = apply_single_controller_ctx_to_hw(
2359+ status = dce110_apply_single_controller_ctx_to_hw(
23062360 pipe_ctx,
23072361 context,
23082362 dc);
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.h+4−0
@@ -39,6 +39,10 @@ enum dc_status dce110_apply_ctx_to_hw( · 38 unmodified lines
3939 struct dc *dc,
4040 struct dc_state *context);
4141
42+enum dc_status dce110_apply_single_controller_ctx_to_hw(
43+ struct pipe_ctx *pipe_ctx,
44+ struct dc_state *context,
45+ struct dc *dc);
4246
4347 void dce110_enable_stream(struct pipe_ctx *pipe_ctx);
4448
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c+75−22
@@ -283,33 +283,33 @@ static void dcn10_log_hubp_states(struct dc *dc, void *log_ctx) · 282 unmodified lines
283283 DTN_INFO("\n");
284284 }
285285
286−void dcn10_log_hw_state(struct dc *dc,
287− struct dc_log_buffer_ctx *log_ctx)
286+static void dcn10_log_color_state(struct dc *dc,
287+ struct dc_log_buffer_ctx *log_ctx)
288288 {
289289 struct dc_context *dc_ctx = dc->ctx;
290290 struct resource_pool *pool = dc->res_pool;
291291 int i;
292292
293− DTN_INFO_BEGIN();
294−
295− dcn10_log_hubbub_state(dc, log_ctx);
296−
297− dcn10_log_hubp_states(dc, log_ctx);
298−
299− DTN_INFO("DPP: IGAM format IGAM mode DGAM mode RGAM mode"
300− " GAMUT mode C11 C12 C13 C14 C21 C22 C23 C24 "
301− "C31 C32 C33 C34\n");
293+ DTN_INFO("DPP: IGAM format IGAM mode DGAM mode RGAM mode"
294+ " GAMUT adjust "
295+ "C11 C12 C13 C14 "
296+ "C21 C22 C23 C24 "
297+ "C31 C32 C33 C34 \n");
302298 for (i = 0; i < pool->pipe_count; i++) {
303299 struct dpp *dpp = pool->dpps[i];
304300 struct dcn_dpp_state s = {0};
305301
306302 dpp->funcs->dpp_read_state(dpp, &s);
303+ dpp->funcs->dpp_get_gamut_remap(dpp, &s.gamut_remap);
307304
308305 if (!s.is_enabled)
309306 continue;
310307
311− DTN_INFO("[%2d]: %11xh %-11s %-11s %-11s"
312− "%8x %08xh %08xh %08xh %08xh %08xh %08xh",
308+ DTN_INFO("[%2d]: %11xh %11s %9s %9s"
309+ " %12s "
310+ "%010lld %010lld %010lld %010lld "
311+ "%010lld %010lld %010lld %010lld "
312+ "%010lld %010lld %010lld %010lld",
313313 dpp->inst,
314314 s.igam_input_format,
315315 (s.igam_lut_mode == 0) ? "BypassFixed" :
@@ -329,16 +329,42 @@ void dcn10_log_hw_state(struct dc *dc, · 13 unmodified lines
329329 ((s.rgam_lut_mode == 3) ? "RAM" :
330330 ((s.rgam_lut_mode == 4) ? "RAM" :
331331 "Unknown")))),
332− s.gamut_remap_mode,
333− s.gamut_remap_c11_c12,
334− s.gamut_remap_c13_c14,
335− s.gamut_remap_c21_c22,
336− s.gamut_remap_c23_c24,
337− s.gamut_remap_c31_c32,
338− s.gamut_remap_c33_c34);
332+ (s.gamut_remap.gamut_adjust_type == 0) ? "Bypass" :
333+ ((s.gamut_remap.gamut_adjust_type == 1) ? "HW" :
334+ "SW"),
335+ s.gamut_remap.temperature_matrix[0].value,
336+ s.gamut_remap.temperature_matrix[1].value,
337+ s.gamut_remap.temperature_matrix[2].value,
338+ s.gamut_remap.temperature_matrix[3].value,
339+ s.gamut_remap.temperature_matrix[4].value,
340+ s.gamut_remap.temperature_matrix[5].value,
341+ s.gamut_remap.temperature_matrix[6].value,
342+ s.gamut_remap.temperature_matrix[7].value,
343+ s.gamut_remap.temperature_matrix[8].value,
344+ s.gamut_remap.temperature_matrix[9].value,
345+ s.gamut_remap.temperature_matrix[10].value,
346+ s.gamut_remap.temperature_matrix[11].value);
339347 DTN_INFO("\n");
340348 }
341349 DTN_INFO("\n");
350+ DTN_INFO("DPP Color Caps: input_lut_shared:%d icsc:%d"
351+ " dgam_ram:%d dgam_rom: srgb:%d,bt2020:%d,gamma2_2:%d,pq:%d,hlg:%d"
352+ " post_csc:%d gamcor:%d dgam_rom_for_yuv:%d 3d_lut:%d"
353+ " blnd_lut:%d oscs:%d\n\n",
354+ dc->caps.color.dpp.input_lut_shared,
355+ dc->caps.color.dpp.icsc,
356+ dc->caps.color.dpp.dgam_ram,
357+ dc->caps.color.dpp.dgam_rom_caps.srgb,
358+ dc->caps.color.dpp.dgam_rom_caps.bt2020,
359+ dc->caps.color.dpp.dgam_rom_caps.gamma2_2,
360+ dc->caps.color.dpp.dgam_rom_caps.pq,
361+ dc->caps.color.dpp.dgam_rom_caps.hlg,
362+ dc->caps.color.dpp.post_csc,
363+ dc->caps.color.dpp.gamma_corr,
364+ dc->caps.color.dpp.dgam_rom_for_yuv,
365+ dc->caps.color.dpp.hw_3d_lut,
366+ dc->caps.color.dpp.ogam_ram,
367+ dc->caps.color.dpp.ocsc);
342368
343369 DTN_INFO("MPCC: OPP DPP MPCCBOT MODE ALPHA_MODE PREMULT OVERLAP_ONLY IDLE\n");
344370 for (i = 0; i < pool->pipe_count; i++) {
@@ -352,6 +378,30 @@ void dcn10_log_hw_state(struct dc *dc, · 7 unmodified lines
352378 s.idle);
353379 }
354380 DTN_INFO("\n");
381+ DTN_INFO("MPC Color Caps: gamut_remap:%d, 3dlut:%d, ogam_ram:%d, ocsc:%d\n\n",
382+ dc->caps.color.mpc.gamut_remap,
383+ dc->caps.color.mpc.num_3dluts,
384+ dc->caps.color.mpc.ogam_ram,
385+ dc->caps.color.mpc.ocsc);
386+}
387+
388+void dcn10_log_hw_state(struct dc *dc,
389+ struct dc_log_buffer_ctx *log_ctx)
390+{
391+ struct dc_context *dc_ctx = dc->ctx;
392+ struct resource_pool *pool = dc->res_pool;
393+ int i;
394+
395+ DTN_INFO_BEGIN();
396+
397+ dcn10_log_hubbub_state(dc, log_ctx);
398+
399+ dcn10_log_hubp_states(dc, log_ctx);
400+
401+ if (dc->hwss.log_color_state)
402+ dc->hwss.log_color_state(dc, log_ctx);
403+ else
404+ dcn10_log_color_state(dc, log_ctx);
355405
356406 DTN_INFO("OTG: v_bs v_be v_ss v_se vpol vmax vmin vmax_sel vmin_sel h_bs h_be h_ss h_se hpol htot vtot underflow blank_en\n");
357407
@@ -1840,6 +1890,9 @@ bool dcn10_set_output_transfer_func(struct dc *dc, struct pipe_ctx *pipe_ctx, · 1482 unmodified lines
18401890 {
18411891 struct dpp *dpp = pipe_ctx->plane_res.dpp;
18421892
1893+ if (!stream)
1894+ return false;
1895+
18431896 if (dpp == NULL)
18441897 return false;
18451898
@@ -1862,8 +1915,8 @@ bool dcn10_set_output_transfer_func(struct dc *dc, struct pipe_ctx *pipe_ctx, · 16 unmodified lines
18621915 } else
18631916 dpp->funcs->dpp_program_regamma_pwl(dpp, NULL, OPP_REGAMMA_BYPASS);
18641917
1865− if (stream != NULL && stream->ctx != NULL &&
1866− stream->out_transfer_func != NULL) {
1918+ if (stream->ctx &&
1919+ stream->out_transfer_func) {
18671920 log_tf(stream->ctx,
18681921 stream->out_transfer_func,
18691922 dpp->regamma_params.hw_points_num);
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c+118−9
@@ -71,6 +71,112 @@ · 70 unmodified lines
7171 #define FN(reg_name, field_name) \
7272 hws->shifts->field_name, hws->masks->field_name
7373
74+void dcn20_log_color_state(struct dc *dc,
75+ struct dc_log_buffer_ctx *log_ctx)
76+{
77+ struct dc_context *dc_ctx = dc->ctx;
78+ struct resource_pool *pool = dc->res_pool;
79+ int i;
80+
81+ DTN_INFO("DPP: DGAM mode SHAPER mode 3DLUT mode 3DLUT bit depth"
82+ " 3DLUT size RGAM mode GAMUT adjust "
83+ "C11 C12 C13 C14 "
84+ "C21 C22 C23 C24 "
85+ "C31 C32 C33 C34 \n");
86+
87+ for (i = 0; i < pool->pipe_count; i++) {
88+ struct dpp *dpp = pool->dpps[i];
89+ struct dcn_dpp_state s = {0};
90+
91+ dpp->funcs->dpp_read_state(dpp, &s);
92+ dpp->funcs->dpp_get_gamut_remap(dpp, &s.gamut_remap);
93+
94+ if (!s.is_enabled)
95+ continue;
96+
97+ DTN_INFO("[%2d]: %8s %11s %10s %15s %10s %9s %12s "
98+ "%010lld %010lld %010lld %010lld "
99+ "%010lld %010lld %010lld %010lld "
100+ "%010lld %010lld %010lld %010lld",
101+ dpp->inst,
102+ (s.dgam_lut_mode == 0) ? "Bypass" :
103+ ((s.dgam_lut_mode == 1) ? "sRGB" :
104+ ((s.dgam_lut_mode == 2) ? "Ycc" :
105+ ((s.dgam_lut_mode == 3) ? "RAM" :
106+ ((s.dgam_lut_mode == 4) ? "RAM" :
107+ "Unknown")))),
108+ (s.shaper_lut_mode == 1) ? "RAM A" :
109+ ((s.shaper_lut_mode == 2) ? "RAM B" :
110+ "Bypass"),
111+ (s.lut3d_mode == 1) ? "RAM A" :
112+ ((s.lut3d_mode == 2) ? "RAM B" :
113+ "Bypass"),
114+ (s.lut3d_bit_depth <= 0) ? "12-bit" : "10-bit",
115+ (s.lut3d_size == 0) ? "17x17x17" : "9x9x9",
116+ (s.rgam_lut_mode == 1) ? "RAM A" :
117+ ((s.rgam_lut_mode == 1) ? "RAM B" : "Bypass"),
118+ (s.gamut_remap.gamut_adjust_type == 0) ? "Bypass" :
119+ ((s.gamut_remap.gamut_adjust_type == 1) ? "HW" :
120+ "SW"),
121+ s.gamut_remap.temperature_matrix[0].value,
122+ s.gamut_remap.temperature_matrix[1].value,
123+ s.gamut_remap.temperature_matrix[2].value,
124+ s.gamut_remap.temperature_matrix[3].value,
125+ s.gamut_remap.temperature_matrix[4].value,
126+ s.gamut_remap.temperature_matrix[5].value,
127+ s.gamut_remap.temperature_matrix[6].value,
128+ s.gamut_remap.temperature_matrix[7].value,
129+ s.gamut_remap.temperature_matrix[8].value,
130+ s.gamut_remap.temperature_matrix[9].value,
131+ s.gamut_remap.temperature_matrix[10].value,
132+ s.gamut_remap.temperature_matrix[11].value);
133+ DTN_INFO("\n");
134+ }
135+ DTN_INFO("\n");
136+ DTN_INFO("DPP Color Caps: input_lut_shared:%d icsc:%d"
137+ " dgam_ram:%d dgam_rom: srgb:%d,bt2020:%d,gamma2_2:%d,pq:%d,hlg:%d"
138+ " post_csc:%d gamcor:%d dgam_rom_for_yuv:%d 3d_lut:%d"
139+ " blnd_lut:%d oscs:%d\n\n",
140+ dc->caps.color.dpp.input_lut_shared,
141+ dc->caps.color.dpp.icsc,
142+ dc->caps.color.dpp.dgam_ram,
143+ dc->caps.color.dpp.dgam_rom_caps.srgb,
144+ dc->caps.color.dpp.dgam_rom_caps.bt2020,
145+ dc->caps.color.dpp.dgam_rom_caps.gamma2_2,
146+ dc->caps.color.dpp.dgam_rom_caps.pq,
147+ dc->caps.color.dpp.dgam_rom_caps.hlg,
148+ dc->caps.color.dpp.post_csc,
149+ dc->caps.color.dpp.gamma_corr,
150+ dc->caps.color.dpp.dgam_rom_for_yuv,
151+ dc->caps.color.dpp.hw_3d_lut,
152+ dc->caps.color.dpp.ogam_ram,
153+ dc->caps.color.dpp.ocsc);
154+
155+ DTN_INFO("MPCC: OPP DPP MPCCBOT MODE ALPHA_MODE PREMULT OVERLAP_ONLY IDLE"
156+ " OGAM mode\n");
157+
158+ for (i = 0; i < pool->pipe_count; i++) {
159+ struct mpcc_state s = {0};
160+
161+ pool->mpc->funcs->read_mpcc_state(pool->mpc, i, &s);
162+ if (s.opp_id != 0xf)
163+ DTN_INFO("[%2d]: %2xh %2xh %6xh %4d %10d %7d %12d %4d %9s\n",
164+ i, s.opp_id, s.dpp_id, s.bot_mpcc_id,
165+ s.mode, s.alpha_mode, s.pre_multiplied_alpha, s.overlap_only,
166+ s.idle,
167+ (s.rgam_mode == 1) ? "RAM A" :
168+ ((s.rgam_mode == 2) ? "RAM B" :
169+ "Bypass"));
170+ }
171+ DTN_INFO("\n");
172+ DTN_INFO("MPC Color Caps: gamut_remap:%d, 3dlut:%d, ogam_ram:%d, ocsc:%d\n\n",
173+ dc->caps.color.mpc.gamut_remap,
174+ dc->caps.color.mpc.num_3dluts,
175+ dc->caps.color.mpc.ogam_ram,
176+ dc->caps.color.mpc.ocsc);
177+}
178+
179+
74180 static int find_free_gsl_group(const struct dc *dc)
75181 {
76182 if (dc->res_pool->gsl_groups.gsl_0 == 0)
@@ -1467,7 +1573,8 @@ static void dcn20_detect_pipe_changes(struct dc_state *old_state, · 1390 unmodified lines
14671573 * makes this assumption at the moment with how hubp reset is matched to
14681574 * same index mpcc reset.
14691575 */
1470− if (old_pipe->stream_res.opp != new_pipe->stream_res.opp)
1576+ if (old_pipe->stream_res.opp != new_pipe->stream_res.opp ||
1577+ old_pipe->stream_res.left_edge_extra_pixel != new_pipe->stream_res.left_edge_extra_pixel)
14711578 new_pipe->update_flags.bits.opp_changed = 1;
14721579 if (old_pipe->stream_res.tg != new_pipe->stream_res.tg)
14731580 new_pipe->update_flags.bits.tg_changed = 1;
@@ -1853,6 +1960,10 @@ static void dcn20_program_pipe( · 379 unmodified lines
18531960 pipe_ctx->stream_res.opp,
18541961 &pipe_ctx->stream->bit_depth_params,
18551962 &pipe_ctx->stream->clamping);
1963+
1964+ pipe_ctx->stream_res.opp->funcs->opp_program_left_edge_extra_pixel(
1965+ pipe_ctx->stream_res.opp,
1966+ pipe_ctx->stream_res.left_edge_extra_pixel);
18561967 }
18571968
18581969 /* Set ABM pipe after other pipe configurations done */
@@ -1958,7 +2069,6 @@ void dcn20_program_front_end_for_ctx( · 99 unmodified lines
19582069 && context->res_ctx.pipe_ctx[i].stream)
19592070 hws->funcs.blank_pixel_data(dc, &context->res_ctx.pipe_ctx[i], true);
19602071
1961−
19622072 /* Disconnect mpcc */
19632073 for (i = 0; i < dc->res_pool->pipe_count; i++)
19642074 if (context->res_ctx.pipe_ctx[i].update_flags.bits.disable
@@ -2561,7 +2671,7 @@ void dcn20_setup_vupdate_interrupt(struct dc *dc, struct pipe_ctx *pipe_ctx) · 596 unmodified lines
25612671 tg->funcs->setup_vertical_interrupt2(tg, start_line);
25622672 }
25632673
2564−static void dcn20_reset_back_end_for_pipe(
2674+void dcn20_reset_back_end_for_pipe(
25652675 struct dc *dc,
25662676 struct pipe_ctx *pipe_ctx,
25672677 struct dc_state *context)
@@ -2790,18 +2900,17 @@ void dcn20_enable_stream(struct pipe_ctx *pipe_ctx) · 222 unmodified lines
27902900 }
27912901
27922902 if (dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) {
2793− dp_hpo_inst = pipe_ctx->stream_res.hpo_dp_stream_enc->inst;
2794− dccg->funcs->set_dpstreamclk(dccg, DTBCLK0, tg->inst, dp_hpo_inst);
2795−
2796− phyd32clk = get_phyd32clk_src(link);
2797− dccg->funcs->enable_symclk32_se(dccg, dp_hpo_inst, phyd32clk);
2798−
27992903 dto_params.otg_inst = tg->inst;
28002904 dto_params.pixclk_khz = pipe_ctx->stream->timing.pix_clk_100hz / 10;
28012905 dto_params.num_odm_segments = get_odm_segment_count(pipe_ctx);
28022906 dto_params.timing = &pipe_ctx->stream->timing;
28032907 dto_params.ref_dtbclk_khz = dc->clk_mgr->funcs->get_dtb_ref_clk_frequency(dc->clk_mgr);
28042908 dccg->funcs->set_dtbclk_dto(dccg, &dto_params);
2909+ dp_hpo_inst = pipe_ctx->stream_res.hpo_dp_stream_enc->inst;
2910+ dccg->funcs->set_dpstreamclk(dccg, DTBCLK0, tg->inst, dp_hpo_inst);
2911+
2912+ phyd32clk = get_phyd32clk_src(link);
2913+ dccg->funcs->enable_symclk32_se(dccg, dp_hpo_inst, phyd32clk);
28052914 } else {
28062915 if (dccg->funcs->enable_symclk_se)
28072916 dccg->funcs->enable_symclk_se(dccg, stream_enc->stream_enc_inst,
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.h+6−0
@@ -28,6 +28,8 @@ · 27 unmodified lines
2828
2929 #include "hw_sequencer_private.h"
3030
31+void dcn20_log_color_state(struct dc *dc,
32+ struct dc_log_buffer_ctx *log_ctx);
3133 bool dcn20_set_blend_lut(
3234 struct pipe_ctx *pipe_ctx, const struct dc_plane_state *plane_state);
3335 bool dcn20_set_shaper_3dlut(
@@ -84,6 +86,10 @@ enum dc_status dcn20_enable_stream_timing( · 50 unmodified lines
8486 void dcn20_disable_stream_gating(struct dc *dc, struct pipe_ctx *pipe_ctx);
8587 void dcn20_enable_stream_gating(struct dc *dc, struct pipe_ctx *pipe_ctx);
8688 void dcn20_setup_vupdate_interrupt(struct dc *dc, struct pipe_ctx *pipe_ctx);
89+void dcn20_reset_back_end_for_pipe(
90+ struct dc *dc,
91+ struct pipe_ctx *pipe_ctx,
92+ struct dc_state *context);
8793 void dcn20_init_blank(
8894 struct dc *dc,
8995 struct timing_generator *tg);
drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c+34−29
@@ -206,28 +206,32 @@ void dcn21_set_abm_immediate_disable(struct pipe_ctx *pipe_ctx) · 205 unmodified lines
206206 void dcn21_set_pipe(struct pipe_ctx *pipe_ctx)
207207 {
208208 struct abm *abm = pipe_ctx->stream_res.abm;
209− uint32_t otg_inst = pipe_ctx->stream_res.tg->inst;
209+ struct timing_generator *tg = pipe_ctx->stream_res.tg;
210210 struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl;
211211 struct dmcu *dmcu = pipe_ctx->stream->ctx->dc->res_pool->dmcu;
212+ uint32_t otg_inst;
213+
214+ if (!abm && !tg && !panel_cntl)
215+ return;
216+
217+ otg_inst = tg->inst;
212218
213219 if (dmcu) {
214220 dce110_set_pipe(pipe_ctx);
215221 return;
216222 }
217223
218− if (abm && panel_cntl) {
219− if (abm->funcs && abm->funcs->set_pipe_ex) {
220− abm->funcs->set_pipe_ex(abm,
224+ if (abm->funcs && abm->funcs->set_pipe_ex) {
225+ abm->funcs->set_pipe_ex(abm,
221226 otg_inst,
222227 SET_ABM_PIPE_NORMAL,
223228 panel_cntl->inst,
224229 panel_cntl->pwrseq_inst);
225− } else {
226− dmub_abm_set_pipe(abm, otg_inst,
227− SET_ABM_PIPE_NORMAL,
228− panel_cntl->inst,
229− panel_cntl->pwrseq_inst);
230− }
230+ } else {
231+ dmub_abm_set_pipe(abm, otg_inst,
232+ SET_ABM_PIPE_NORMAL,
233+ panel_cntl->inst,
234+ panel_cntl->pwrseq_inst);
231235 }
232236 }
233237
@@ -237,34 +241,35 @@ bool dcn21_set_backlight_level(struct pipe_ctx *pipe_ctx, · 3 unmodified lines
237241 {
238242 struct dc_context *dc = pipe_ctx->stream->ctx;
239243 struct abm *abm = pipe_ctx->stream_res.abm;
244+ struct timing_generator *tg = pipe_ctx->stream_res.tg;
240245 struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl;
246+ uint32_t otg_inst;
247+
248+ if (!abm && !tg && !panel_cntl)
249+ return false;
250+
251+ otg_inst = tg->inst;
241252
242253 if (dc->dc->res_pool->dmcu) {
243254 dce110_set_backlight_level(pipe_ctx, backlight_pwm_u16_16, frame_ramp);
244255 return true;
245256 }
246257
247− if (abm != NULL) {
248− uint32_t otg_inst = pipe_ctx->stream_res.tg->inst;
249−
250− if (abm && panel_cntl) {
251− if (abm->funcs && abm->funcs->set_pipe_ex) {
252− abm->funcs->set_pipe_ex(abm,
253− otg_inst,
254− SET_ABM_PIPE_NORMAL,
255− panel_cntl->inst,
256− panel_cntl->pwrseq_inst);
257− } else {
258− dmub_abm_set_pipe(abm,
259− otg_inst,
260− SET_ABM_PIPE_NORMAL,
261− panel_cntl->inst,
262− panel_cntl->pwrseq_inst);
263− }
264− }
258+ if (abm->funcs && abm->funcs->set_pipe_ex) {
259+ abm->funcs->set_pipe_ex(abm,
260+ otg_inst,
261+ SET_ABM_PIPE_NORMAL,
262+ panel_cntl->inst,
263+ panel_cntl->pwrseq_inst);
264+ } else {
265+ dmub_abm_set_pipe(abm,
266+ otg_inst,
267+ SET_ABM_PIPE_NORMAL,
268+ panel_cntl->inst,
269+ panel_cntl->pwrseq_inst);
265270 }
266271
267− if (abm && abm->funcs && abm->funcs->set_backlight_level_pwm)
272+ if (abm->funcs && abm->funcs->set_backlight_level_pwm)
268273 abm->funcs->set_backlight_level_pwm(abm, backlight_pwm_u16_16,
269274 frame_ramp, 0, panel_cntl->inst);
270275 else
drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c+149−18
@@ -69,6 +69,155 @@ · 68 unmodified lines
6969 #define FN(reg_name, field_name) \
7070 hws->shifts->field_name, hws->masks->field_name
7171
72+void dcn30_log_color_state(struct dc *dc,
73+ struct dc_log_buffer_ctx *log_ctx)
74+{
75+ struct dc_context *dc_ctx = dc->ctx;
76+ struct resource_pool *pool = dc->res_pool;
77+ int i;
78+
79+ DTN_INFO("DPP: DGAM ROM DGAM ROM type DGAM LUT SHAPER mode"
80+ " 3DLUT mode 3DLUT bit depth 3DLUT size RGAM mode"
81+ " GAMUT adjust "
82+ "C11 C12 C13 C14 "
83+ "C21 C22 C23 C24 "
84+ "C31 C32 C33 C34 \n");
85+
86+ for (i = 0; i < pool->pipe_count; i++) {
87+ struct dpp *dpp = pool->dpps[i];
88+ struct dcn_dpp_state s = {0};
89+
90+ dpp->funcs->dpp_read_state(dpp, &s);
91+ dpp->funcs->dpp_get_gamut_remap(dpp, &s.gamut_remap);
92+
93+ if (!s.is_enabled)
94+ continue;
95+
96+ DTN_INFO("[%2d]: %7x %13s %8s %11s %10s %15s %10s %9s"
97+ " %12s "
98+ "%010lld %010lld %010lld %010lld "
99+ "%010lld %010lld %010lld %010lld "
100+ "%010lld %010lld %010lld %010lld",
101+ dpp->inst,
102+ s.pre_dgam_mode,
103+ (s.pre_dgam_select == 0) ? "sRGB" :
104+ ((s.pre_dgam_select == 1) ? "Gamma 2.2" :
105+ ((s.pre_dgam_select == 2) ? "Gamma 2.4" :
106+ ((s.pre_dgam_select == 3) ? "Gamma 2.6" :
107+ ((s.pre_dgam_select == 4) ? "BT.709" :
108+ ((s.pre_dgam_select == 5) ? "PQ" :
109+ ((s.pre_dgam_select == 6) ? "HLG" :
110+ "Unknown")))))),
111+ (s.gamcor_mode == 0) ? "Bypass" :
112+ ((s.gamcor_mode == 1) ? "RAM A" :
113+ "RAM B"),
114+ (s.shaper_lut_mode == 1) ? "RAM A" :
115+ ((s.shaper_lut_mode == 2) ? "RAM B" :
116+ "Bypass"),
117+ (s.lut3d_mode == 1) ? "RAM A" :
118+ ((s.lut3d_mode == 2) ? "RAM B" :
119+ "Bypass"),
120+ (s.lut3d_bit_depth <= 0) ? "12-bit" : "10-bit",
121+ (s.lut3d_size == 0) ? "17x17x17" : "9x9x9",
122+ (s.rgam_lut_mode == 0) ? "Bypass" :
123+ ((s.rgam_lut_mode == 1) ? "RAM A" :
124+ "RAM B"),
125+ (s.gamut_remap.gamut_adjust_type == 0) ? "Bypass" :
126+ ((s.gamut_remap.gamut_adjust_type == 1) ? "HW" :
127+ "SW"),
128+ s.gamut_remap.temperature_matrix[0].value,
129+ s.gamut_remap.temperature_matrix[1].value,
130+ s.gamut_remap.temperature_matrix[2].value,
131+ s.gamut_remap.temperature_matrix[3].value,
132+ s.gamut_remap.temperature_matrix[4].value,
133+ s.gamut_remap.temperature_matrix[5].value,
134+ s.gamut_remap.temperature_matrix[6].value,
135+ s.gamut_remap.temperature_matrix[7].value,
136+ s.gamut_remap.temperature_matrix[8].value,
137+ s.gamut_remap.temperature_matrix[9].value,
138+ s.gamut_remap.temperature_matrix[10].value,
139+ s.gamut_remap.temperature_matrix[11].value);
140+ DTN_INFO("\n");
141+ }
142+ DTN_INFO("\n");
143+ DTN_INFO("DPP Color Caps: input_lut_shared:%d icsc:%d"
144+ " dgam_ram:%d dgam_rom: srgb:%d,bt2020:%d,gamma2_2:%d,pq:%d,hlg:%d"
145+ " post_csc:%d gamcor:%d dgam_rom_for_yuv:%d 3d_lut:%d"
146+ " blnd_lut:%d oscs:%d\n\n",
147+ dc->caps.color.dpp.input_lut_shared,
148+ dc->caps.color.dpp.icsc,
149+ dc->caps.color.dpp.dgam_ram,
150+ dc->caps.color.dpp.dgam_rom_caps.srgb,
151+ dc->caps.color.dpp.dgam_rom_caps.bt2020,
152+ dc->caps.color.dpp.dgam_rom_caps.gamma2_2,
153+ dc->caps.color.dpp.dgam_rom_caps.pq,
154+ dc->caps.color.dpp.dgam_rom_caps.hlg,
155+ dc->caps.color.dpp.post_csc,
156+ dc->caps.color.dpp.gamma_corr,
157+ dc->caps.color.dpp.dgam_rom_for_yuv,
158+ dc->caps.color.dpp.hw_3d_lut,
159+ dc->caps.color.dpp.ogam_ram,
160+ dc->caps.color.dpp.ocsc);
161+
162+ DTN_INFO("MPCC: OPP DPP MPCCBOT MODE ALPHA_MODE PREMULT OVERLAP_ONLY IDLE"
163+ " SHAPER mode 3DLUT mode 3DLUT bit-depth 3DLUT size OGAM mode OGAM LUT"
164+ " GAMUT adjust "
165+ "C11 C12 C13 C14 "
166+ "C21 C22 C23 C24 "
167+ "C31 C32 C33 C34 \n");
168+
169+ for (i = 0; i < pool->pipe_count; i++) {
170+ struct mpcc_state s = {0};
171+
172+ pool->mpc->funcs->read_mpcc_state(pool->mpc, i, &s);
173+ mpc3_get_gamut_remap(pool->mpc, i, &s.gamut_remap);
174+
175+ if (s.opp_id != 0xf)
176+ DTN_INFO("[%2d]: %2xh %2xh %6xh %4d %10d %7d %12d %4d %11s %11s %16s %11s %10s %9s"
177+ " %-12s "
178+ "%010lld %010lld %010lld %010lld "
179+ "%010lld %010lld %010lld %010lld "
180+ "%010lld %010lld %010lld %010lld\n",
181+ i, s.opp_id, s.dpp_id, s.bot_mpcc_id,
182+ s.mode, s.alpha_mode, s.pre_multiplied_alpha, s.overlap_only,
183+ s.idle,
184+ (s.shaper_lut_mode == 1) ? "RAM A" :
185+ ((s.shaper_lut_mode == 2) ? "RAM B" :
186+ "Bypass"),
187+ (s.lut3d_mode == 1) ? "RAM A" :
188+ ((s.lut3d_mode == 2) ? "RAM B" :
189+ "Bypass"),
190+ (s.lut3d_bit_depth <= 0) ? "12-bit" : "10-bit",
191+ (s.lut3d_size == 0) ? "17x17x17" : "9x9x9",
192+ (s.rgam_mode == 0) ? "Bypass" :
193+ ((s.rgam_mode == 2) ? "RAM" :
194+ "Unknown"),
195+ (s.rgam_mode == 1) ? "B" : "A",
196+ (s.gamut_remap.gamut_adjust_type == 0) ? "Bypass" :
197+ ((s.gamut_remap.gamut_adjust_type == 1) ? "HW" :
198+ "SW"),
199+ s.gamut_remap.temperature_matrix[0].value,
200+ s.gamut_remap.temperature_matrix[1].value,
201+ s.gamut_remap.temperature_matrix[2].value,
202+ s.gamut_remap.temperature_matrix[3].value,
203+ s.gamut_remap.temperature_matrix[4].value,
204+ s.gamut_remap.temperature_matrix[5].value,
205+ s.gamut_remap.temperature_matrix[6].value,
206+ s.gamut_remap.temperature_matrix[7].value,
207+ s.gamut_remap.temperature_matrix[8].value,
208+ s.gamut_remap.temperature_matrix[9].value,
209+ s.gamut_remap.temperature_matrix[10].value,
210+ s.gamut_remap.temperature_matrix[11].value);
211+
212+ }
213+ DTN_INFO("\n");
214+ DTN_INFO("MPC Color Caps: gamut_remap:%d, 3dlut:%d, ogam_ram:%d, ocsc:%d\n\n",
215+ dc->caps.color.mpc.gamut_remap,
216+ dc->caps.color.mpc.num_3dluts,
217+ dc->caps.color.mpc.ogam_ram,
218+ dc->caps.color.mpc.ocsc);
219+}
220+
72221 bool dcn30_set_blend_lut(
73222 struct pipe_ctx *pipe_ctx, const struct dc_plane_state *plane_state)
74223 {
@@ -1015,21 +1164,3 @@ void dcn30_prepare_bandwidth(struct dc *dc, · 940 unmodified lines
10151164 if (!dc->clk_mgr->clks.fw_based_mclk_switching)
10161165 dc_dmub_srv_p_state_delegate(dc, false, context);
10171166 }
1018−
1019−void dcn30_set_static_screen_control(struct pipe_ctx **pipe_ctx,
1020− int num_pipes, const struct dc_static_screen_params *params)
1021−{
1022− unsigned int i;
1023− unsigned int triggers = 0;
1024−
1025− if (params->triggers.surface_update)
1026− triggers |= 0x100;
1027− if (params->triggers.cursor_update)
1028− triggers |= 0x8;
1029− if (params->triggers.force_trigger)
1030− triggers |= 0x1;
1031−
1032− for (i = 0; i < num_pipes; i++)
1033− pipe_ctx[i]->stream_res.tg->funcs->set_static_screen_control(pipe_ctx[i]->stream_res.tg,
1034− triggers, params->num_frames);
1035−}
drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.h+3−3
@@ -52,6 +52,9 @@ bool dcn30_mmhubbub_warmup( · 51 unmodified lines
5252 unsigned int num_dwb,
5353 struct dc_writeback_info *wb_info);
5454
55+void dcn30_log_color_state(struct dc *dc,
56+ struct dc_log_buffer_ctx *log_ctx);
57+
5558 bool dcn30_set_blend_lut(struct pipe_ctx *pipe_ctx,
5659 const struct dc_plane_state *plane_state);
5760
@@ -90,7 +93,4 @@ void dcn30_set_hubp_blank(const struct dc *dc, · 32 unmodified lines
9093 void dcn30_prepare_bandwidth(struct dc *dc,
9194 struct dc_state *context);
9295
93−void dcn30_set_static_screen_control(struct pipe_ctx **pipe_ctx,
94− int num_pipes, const struct dc_static_screen_params *params);
95−
9696 #endif /* __DC_HWSS_DCN30_H__ */
drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_init.c+1−1
@@ -64,7 +64,7 @@ static const struct hw_sequencer_funcs dcn30_funcs = { · 63 unmodified lines
6464 .update_bandwidth = dcn20_update_bandwidth,
6565 .set_drr = dcn10_set_drr,
6666 .get_position = dcn10_get_position,
67− .set_static_screen_control = dcn30_set_static_screen_control,

4 more lines aren’t shown here.

drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c+18−2

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

drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.h+4−0

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

drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_init.c+1−1

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

drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c+1−1

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

drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c+67−9

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

drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.h+2−0

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

drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_init.c+4−1

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

drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c+27−3

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

drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h+3−0

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

drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c+1−1

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

drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c+1−1

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

drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h+3−0

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

drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h+7−2

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

drivers/gpu/drm/amd/display/dc/inc/core_types.h+4−0

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

drivers/gpu/drm/amd/display/dc/inc/hw/audio.h+2−1

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

drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h+6−0

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

drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h+6−0

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

drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h+39−0

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

drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h+12−3

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

drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h+180−77

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

drivers/gpu/drm/amd/display/dc/inc/hw/opp.h+16−0

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

drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h+0−2

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

drivers/gpu/drm/amd/display/dc/inc/resource.h+12−12

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

drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.h+10−0

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

drivers/gpu/drm/amd/display/dc/link/link_detection.c+18−0

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

drivers/gpu/drm/amd/display/dc/link/link_dpms.c+58−0

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

drivers/gpu/drm/amd/display/dc/link/link_validation.c+0−2

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

drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c+1−1

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

drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c+1−4

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

drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_fixed_vs_pe_retimer.c+12−360

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

drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_fixed_vs_pe_retimer.h+0−5

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

drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c+2−2

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

drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c+1−1

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

drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c+11−0

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

drivers/gpu/drm/amd/display/dc/resource/dcn301/dcn301_resource.c+1−1

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

drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c+0−2

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

drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c+15−1

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

drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c+1−0

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

drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c+6−3

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

drivers/gpu/drm/amd/display/dmub/dmub_srv.h+11−5

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

drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h+57−20

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

drivers/gpu/drm/amd/display/dmub/src/dmub_dcn32.c+0−2

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

drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c+55−64

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

drivers/gpu/drm/amd/display/include/audio_types.h+15−0

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

drivers/gpu/drm/amd/display/modules/power/power_helpers.c+5−0

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

drivers/gpu/drm/amd/display/modules/power/power_helpers.h+1−0

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

drivers/gpu/drm/amd/include/amd_shared.h+2−0

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

drivers/gpu/drm/amd/include/amdgpu_reg_state.h+1−1

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

drivers/gpu/drm/amd/include/arct_ip_offset.h+2−4

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

drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_1_6_offset.h+4−0

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

drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_1_6_sh_mask.h+10−0

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

drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_5_0_offset.h+24−0

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

drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_3_5_0_sh_mask.h+65−0

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

drivers/gpu/drm/amd/include/atom-bits.h+1−1

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

drivers/gpu/drm/amd/include/beige_goby_ip_offset.h+2−4

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

drivers/gpu/drm/amd/include/cgs_common.h+11−12

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

drivers/gpu/drm/amd/include/cyan_skillfish_ip_offset.h+2−4

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

drivers/gpu/drm/amd/include/dimgrey_cavefish_ip_offset.h+2−4

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

drivers/gpu/drm/amd/include/dm_pp_interface.h+4−5

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

drivers/gpu/drm/amd/include/kgd_pp_interface.h+2−4

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

drivers/gpu/drm/amd/include/navi12_ip_offset.h+2−4

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

drivers/gpu/drm/amd/include/navi14_ip_offset.h+2−4

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

drivers/gpu/drm/amd/include/pptable.h+3−3

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

drivers/gpu/drm/amd/include/renoir_ip_offset.h+2−4

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

drivers/gpu/drm/amd/include/sienna_cichlid_ip_offset.h+2−4

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

drivers/gpu/drm/amd/include/v10_structs.h+1−2

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

drivers/gpu/drm/amd/include/vangogh_ip_offset.h+2−4

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

drivers/gpu/drm/amd/include/vega10_ip_offset.h+2−4

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

drivers/gpu/drm/amd/include/vega20_ip_offset.h+38−40

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

drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c+21−21

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

drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomfwctrl.c+2−2

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

drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c+6−41

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

drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h+0−1

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

drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c+12−6

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

drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c+1−1

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

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c+13−7

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

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c+54−10

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

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c+153−15

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

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c+53−9

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

drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c+1−1

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

drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c+8−1

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

drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h+10−0

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

drivers/gpu/drm/bridge/adv7511/adv7511_drv.c+30−17

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

drivers/gpu/drm/bridge/analogix/anx7625.c+16−21

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

drivers/gpu/drm/bridge/analogix/anx7625.h+2−0

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

drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c+15−13

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

drivers/gpu/drm/bridge/chrontel-ch7033.c+6−6

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

drivers/gpu/drm/bridge/display-connector.c+4−4

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

drivers/gpu/drm/bridge/imx/Kconfig+18−0

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

drivers/gpu/drm/bridge/imx/Makefile+2−0

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

drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pvi.c+207−0

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

drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c+154−0

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

drivers/gpu/drm/bridge/ite-it6505.c+12−9

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

drivers/gpu/drm/bridge/ite-it66121.c+8−8

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

drivers/gpu/drm/bridge/lontium-lt8912b.c+10−10

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

drivers/gpu/drm/bridge/lontium-lt9611.c+5−4

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

drivers/gpu/drm/bridge/lontium-lt9611uxc.c+10−9

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

drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c+9−9

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

drivers/gpu/drm/bridge/nxp-ptn3460.c+12−10

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

drivers/gpu/drm/bridge/parade-ps8640.c+23−0

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

drivers/gpu/drm/bridge/samsung-dsim.c+13−37

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

drivers/gpu/drm/bridge/sii902x.c+46−34

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

drivers/gpu/drm/bridge/simple-bridge.c+9−8

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

drivers/gpu/drm/bridge/synopsys/dw-hdmi.c+26−18

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

drivers/gpu/drm/bridge/tc358767.c+148−47

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

drivers/gpu/drm/bridge/ti-sn65dsi86.c+4−4

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

drivers/gpu/drm/bridge/ti-tfp410.c+9−9

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

drivers/gpu/drm/ci/build.sh+1−0

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

drivers/gpu/drm/ci/gitlab-ci.yml+12−2

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

drivers/gpu/drm/ci/test.yml+25−6

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

drivers/gpu/drm/ci/testlist.txt+49−0

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

drivers/gpu/drm/ci/xfails/msm-apq8016-fails.txt+1−2

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

drivers/gpu/drm/ci/xfails/msm-sc7180-fails.txt+0−30

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

drivers/gpu/drm/ci/xfails/msm-sc7180-flakes.txt+0−17

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

drivers/gpu/drm/ci/xfails/msm-sc7180-skips.txt+0−7

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

drivers/gpu/drm/ci/xfails/msm-sc7180-trogdor-kingoftown-fails.txt+17−0

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

drivers/gpu/drm/ci/xfails/msm-sc7180-trogdor-lazor-limozeen-fails.txt+17−0

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

drivers/gpu/drm/ci/xfails/msm-sdm845-fails.txt+1−4

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

drivers/gpu/drm/ci/xfails/msm-sdm845-flakes.txt+19−9

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

drivers/gpu/drm/ci/xfails/msm-sdm845-skips.txt+6−1

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

drivers/gpu/drm/display/drm_dp_aux_bus.c+1−1

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

drivers/gpu/drm/display/drm_dp_helper.c+7−10

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

drivers/gpu/drm/display/drm_dp_mst_topology.c+16−9

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

drivers/gpu/drm/drm_bridge.c+9−8

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

drivers/gpu/drm/drm_bridge_connector.c+8−8

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

drivers/gpu/drm/drm_crtc.c+4−4

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

drivers/gpu/drm/drm_debugfs.c+0−4

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

drivers/gpu/drm/drm_edid.c+2−23

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

drivers/gpu/drm/drm_exec.c+1−1

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

drivers/gpu/drm/drm_gem_vram_helper.c+0−2

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

drivers/gpu/drm/drm_ioc32.c+2−2

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

drivers/gpu/drm/drm_managed.c+39−0

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

drivers/gpu/drm/drm_mipi_dsi.c+1−1

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

drivers/gpu/drm/drm_mode_config.c+1−1

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

drivers/gpu/drm/drm_modes.c+22−0

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

drivers/gpu/drm/drm_modeset_lock.c+1−1

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

drivers/gpu/drm/drm_panel_orientation_quirks.c+12−0

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

drivers/gpu/drm/drm_print.c+24−5

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

drivers/gpu/drm/drm_probe_helper.c+0−36

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

drivers/gpu/drm/exynos/exynos5433_drm_decon.c+2−2

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

drivers/gpu/drm/exynos/exynos_drm_fimd.c+3−3

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

drivers/gpu/drm/exynos/exynos_drm_gsc.c+1−1

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

drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h+0−1

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

drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c+1−0

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

drivers/gpu/drm/i915/Makefile+0−1

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

drivers/gpu/drm/i915/display/i9xx_plane.c+30−0

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

drivers/gpu/drm/i915/display/i9xx_plane.h+7−0

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

drivers/gpu/drm/i915/display/icl_dsi.c+1−2

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

drivers/gpu/drm/i915/display/intel_atomic_plane.c+3−3

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

drivers/gpu/drm/i915/display/intel_backlight.c+1−1

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

drivers/gpu/drm/i915/display/intel_bios.c+32−4

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

drivers/gpu/drm/i915/display/intel_bios.h+2−3

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

drivers/gpu/drm/i915/display/intel_cdclk.c+185−190

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

drivers/gpu/drm/i915/display/intel_crt.c+5−0

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

drivers/gpu/drm/i915/display/intel_crtc.c+8−120

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

drivers/gpu/drm/i915/display/intel_crtc_state_dump.c+2−3

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

drivers/gpu/drm/i915/display/intel_cursor.c+49−14

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

drivers/gpu/drm/i915/display/intel_cx0_phy.c+119−110

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

drivers/gpu/drm/i915/display/intel_cx0_phy_regs.h+55−8

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

drivers/gpu/drm/i915/display/intel_ddi.c+48−19

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

drivers/gpu/drm/i915/display/intel_display.c+73−30

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

drivers/gpu/drm/i915/display/intel_display_core.h+17−1

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

drivers/gpu/drm/i915/display/intel_display_debugfs.c+2−24

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

drivers/gpu/drm/i915/display/intel_display_debugfs_params.c+1−0

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

drivers/gpu/drm/i915/display/intel_display_device.c+1−1

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

drivers/gpu/drm/i915/display/intel_display_driver.c+156−12

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

drivers/gpu/drm/i915/display/intel_display_driver.h+6−0

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

drivers/gpu/drm/i915/display/intel_display_irq.c+5−5

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

drivers/gpu/drm/i915/display/intel_display_types.h+27−11

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

drivers/gpu/drm/i915/display/intel_dmc.c+1−1

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

drivers/gpu/drm/i915/display/intel_dp.c+104−88

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

drivers/gpu/drm/i915/display/intel_dp.h+3−7

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

drivers/gpu/drm/i915/display/intel_dp_aux.c+13−16

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

drivers/gpu/drm/i915/display/intel_dp_mst.c+4−0

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

drivers/gpu/drm/i915/display/intel_dpll_mgr.c+51−32

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

drivers/gpu/drm/i915/display/intel_dpll_mgr.h+12−6

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

drivers/gpu/drm/i915/display/intel_dsb.c+4−0

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

drivers/gpu/drm/i915/display/intel_dvo.c+5−0

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

drivers/gpu/drm/i915/display/intel_fbc.c+1−12

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

drivers/gpu/drm/i915/display/intel_fbdev_fb.c+3−2

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

drivers/gpu/drm/i915/display/intel_global_state.c+126−11

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

drivers/gpu/drm/i915/display/intel_global_state.h+8−1

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

drivers/gpu/drm/i915/display/intel_gmbus.c+1−4

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

drivers/gpu/drm/i915/display/intel_hdcp.c+42−36

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

drivers/gpu/drm/i915/display/intel_hdcp_gsc.c+1−1

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

drivers/gpu/drm/i915/display/intel_hdcp_regs.h+15−13

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

drivers/gpu/drm/i915/display/intel_hdmi.c+13−3

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

drivers/gpu/drm/i915/display/intel_hotplug.c+146−19

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

drivers/gpu/drm/i915/display/intel_hotplug.h+4−0

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

drivers/gpu/drm/i915/display/intel_hotplug_irq.c+2−4

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

drivers/gpu/drm/i915/display/intel_opregion.c+124−52

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

drivers/gpu/drm/i915/display/intel_opregion.h+21−26

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

drivers/gpu/drm/i915/display/intel_panel.c+4−0

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

drivers/gpu/drm/i915/display/intel_plane_initial.c+187−68

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

drivers/gpu/drm/i915/display/intel_plane_initial.h+2−2

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

drivers/gpu/drm/i915/display/intel_pps.c+1−1

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

drivers/gpu/drm/i915/display/intel_psr.c+168−48

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

drivers/gpu/drm/i915/display/intel_psr.h+0−6

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

drivers/gpu/drm/i915/display/intel_psr_regs.h+63−0

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

drivers/gpu/drm/i915/display/intel_sdvo.c+6−0

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

drivers/gpu/drm/i915/display/intel_tc.c+20−20

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

drivers/gpu/drm/i915/display/intel_tc.h+1−1

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

drivers/gpu/drm/i915/display/intel_tv.c+6−1

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

drivers/gpu/drm/i915/display/intel_vblank.c+130−0

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

drivers/gpu/drm/i915/display/intel_vblank.h+12−0

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

drivers/gpu/drm/i915/display/skl_universal_plane.c+28−0

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

drivers/gpu/drm/i915/display/skl_universal_plane.h+2−0

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

drivers/gpu/drm/i915/display/skl_watermark.c+30−24

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

drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c+0−8

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

drivers/gpu/drm/i915/gem/i915_gem_pm.c+10−0

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

drivers/gpu/drm/i915/gem/i915_gem_region.c+1−1

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

drivers/gpu/drm/i915/gem/i915_gem_stolen.c+13−12

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

drivers/gpu/drm/i915/gem/i915_gem_ttm.c+22−28

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

drivers/gpu/drm/i915/gem/i915_gem_userptr.c+0−42

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

drivers/gpu/drm/i915/gem/i915_gem_userptr.h+0−14

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

drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c+9−9

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

drivers/gpu/drm/i915/gt/gen8_engine_cs.c+2−2

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

drivers/gpu/drm/i915/gt/intel_engine_cs.c+2−1

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

drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c+5−1

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

drivers/gpu/drm/i915/gt/intel_ggtt.c+9−1

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

drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c+2−16

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

drivers/gpu/drm/i915/gt/intel_gtt.c+2−1

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

drivers/gpu/drm/i915/gt/intel_mocs.c+1−1

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

drivers/gpu/drm/i915/gt/intel_rc6.c+1−1

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

drivers/gpu/drm/i915/gt/intel_region_lmem.c+3−11

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

drivers/gpu/drm/i915/gt/intel_reset.c+2−1

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

drivers/gpu/drm/i915/gt/intel_workarounds.c+20−10

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

drivers/gpu/drm/i915/gt/selftest_context.c+2−1

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

drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c+5−5

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

drivers/gpu/drm/i915/gt/selftest_rc6.c+2−2

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

drivers/gpu/drm/i915/gt/selftest_tlb.c+2−2

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

drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c+13−8

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

drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c+5−5

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

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c+120−6

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

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h+2−0

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

drivers/gpu/drm/i915/gt/uc/intel_huc.c+58−6

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

drivers/gpu/drm/i915/gt/uc/intel_uc.c+3−1

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

drivers/gpu/drm/i915/gvt/kvmgt.c+1−1

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

drivers/gpu/drm/i915/i915_debugfs.c+1−1

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

drivers/gpu/drm/i915/i915_driver.c+22−6

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

drivers/gpu/drm/i915/i915_drv.h+0−8

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

drivers/gpu/drm/i915/i915_gem.c+0−5

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

drivers/gpu/drm/i915/i915_gpu_error.c+1−1

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

drivers/gpu/drm/i915/i915_perf.c+1−1

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

drivers/gpu/drm/i915/i915_query.c+34−1

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

drivers/gpu/drm/i915/i915_reg.h+15−3

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

drivers/gpu/drm/i915/i915_syncmap.c+8−11

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

drivers/gpu/drm/i915/i915_utils.c+17−0

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

drivers/gpu/drm/i915/i915_utils.h+2−0

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

drivers/gpu/drm/i915/intel_memory_region.c+25−8

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

drivers/gpu/drm/i915/intel_memory_region.h+1−2

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

drivers/gpu/drm/i915/intel_region_ttm.c+4−4

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

drivers/gpu/drm/i915/intel_uncore.c+4−1

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

drivers/gpu/drm/i915/selftests/i915_active.c+4−4

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

drivers/gpu/drm/i915/selftests/intel_memory_region.c+2−2

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

drivers/gpu/drm/i915/soc/intel_pch.c+8−8

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

drivers/gpu/drm/i915/soc/intel_pch.h+1−5

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

drivers/gpu/drm/imx/dcss/dcss-blkctl.c+2−11

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

drivers/gpu/drm/imx/dcss/dcss-ctxld.c+3−11

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

drivers/gpu/drm/imx/dcss/dcss-dev.c+9−10

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

drivers/gpu/drm/imx/dcss/dcss-dev.h+0−1

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

drivers/gpu/drm/imx/dcss/dcss-dpr.c+3−18

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

drivers/gpu/drm/imx/dcss/dcss-drv.c+3−9

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

drivers/gpu/drm/imx/dcss/dcss-dtg.c+5−21

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

drivers/gpu/drm/imx/dcss/dcss-scaler.c+3−18

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

drivers/gpu/drm/imx/dcss/dcss-ss.c+3−9

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

drivers/gpu/drm/imx/ipuv3/imx-ldb.c+1−1

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

drivers/gpu/drm/ingenic/Kconfig+0−1

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

drivers/gpu/drm/lima/lima_ctx.c+1−1

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

drivers/gpu/drm/lima/lima_ctx.h+0−1

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

drivers/gpu/drm/lima/lima_gem.c+14−9

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

drivers/gpu/drm/lima/lima_gp.c+30−9

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

drivers/gpu/drm/lima/lima_l2_cache.c+4−2

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

drivers/gpu/drm/lima/lima_mmu.c+9−9

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

drivers/gpu/drm/lima/lima_pmu.c+2−1

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

drivers/gpu/drm/lima/lima_pp.c+29−8

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

drivers/gpu/drm/lima/lima_sched.c+31−7

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

drivers/gpu/drm/lima/lima_sched.h+1−2

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

drivers/gpu/drm/loongson/lsdc_drv.c+1−1

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

drivers/gpu/drm/loongson/lsdc_ttm.c+0−2

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

drivers/gpu/drm/mcde/Kconfig+0−1

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

drivers/gpu/drm/mediatek/mtk_dp.c+20−11

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

drivers/gpu/drm/mediatek/mtk_hdmi.c+17−9

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

drivers/gpu/drm/meson/meson_encoder_hdmi.c+16−4

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

drivers/gpu/drm/mgag200/mgag200_drv.c+4−5

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

drivers/gpu/drm/mgag200/mgag200_mode.c+10−4

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

drivers/gpu/drm/msm/dp/dp_display.c+1−0

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

drivers/gpu/drm/msm/hdmi/hdmi_bridge.c+21−12

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

drivers/gpu/drm/nouveau/dispnv04/crtc.c+2−2

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

drivers/gpu/drm/nouveau/dispnv50/head.c+1−0

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

drivers/gpu/drm/nouveau/nouveau_bo.c+23−36

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

drivers/gpu/drm/nouveau/nouveau_bo.h+0−1

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

drivers/gpu/drm/nouveau/nouveau_connector.h+1−1

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

drivers/gpu/drm/nouveau/nouveau_fence.c+21−27

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

drivers/gpu/drm/nouveau/nouveau_fence.h+2−4

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

drivers/gpu/drm/nouveau/nouveau_ioc32.c+2−2

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

drivers/gpu/drm/nouveau/nouveau_svm.c+3−7

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

drivers/gpu/drm/nouveau/nvif/outp.c+1−2

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

drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c+1−1

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

drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c+1−2

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

drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c+68−68

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

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c+1−1

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

drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c+2−2

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

drivers/gpu/drm/omapdrm/dss/hdmi4.c+15−7

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

drivers/gpu/drm/omapdrm/dss/hdmi5.c+6−6

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

drivers/gpu/drm/panel/Kconfig+123−100

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

drivers/gpu/drm/panel/Makefile+2−0

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

drivers/gpu/drm/panel/panel-boe-himax8279d.c+6−12

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

drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c+322−0

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

drivers/gpu/drm/panel/panel-edp.c+95−2

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

drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c+7−16

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

drivers/gpu/drm/panel/panel-novatek-nt35510.c+367−57

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

drivers/gpu/drm/panel/panel-novatek-nt36523.c+4−4

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

drivers/gpu/drm/panel/panel-novatek-nt36672e.c+643−0

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

drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c+1−1

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

drivers/gpu/drm/panel/panel-simple.c+48−15

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

drivers/gpu/drm/panel/panel-sitronix-st7703.c+104−0

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

drivers/gpu/drm/panel/panel-visionox-r66451.c+1−0

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

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c+1−0

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

drivers/gpu/drm/pl111/Kconfig+0−1

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

drivers/gpu/drm/qxl/qxl_object.c+0−2

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

drivers/gpu/drm/qxl/qxl_ttm.c+0−2

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

drivers/gpu/drm/radeon/atom-bits.h+1−1

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

drivers/gpu/drm/radeon/atom.c+33−14

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

drivers/gpu/drm/radeon/atom.h+2−2

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

drivers/gpu/drm/radeon/atombios_crtc.c+14−14

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

drivers/gpu/drm/radeon/atombios_dp.c+2−2

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

drivers/gpu/drm/radeon/atombios_encoders.c+19−19

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

drivers/gpu/drm/radeon/atombios_i2c.c+1−1

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

drivers/gpu/drm/radeon/btc_dpm.c+31−59

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

drivers/gpu/drm/radeon/ci_dpm.c+13−18

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

drivers/gpu/drm/radeon/ci_dpm.h+2−4

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

drivers/gpu/drm/radeon/clearstate_cayman.h+3−6

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

drivers/gpu/drm/radeon/clearstate_ci.h+1−2

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

drivers/gpu/drm/radeon/evergreen.c+8−12

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

drivers/gpu/drm/radeon/evergreen_cs.c+2−2

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

drivers/gpu/drm/radeon/evergreen_reg.h+5−5

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

drivers/gpu/drm/radeon/evergreen_smc.h+3−6

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

drivers/gpu/drm/radeon/kv_dpm.c+4−5

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

drivers/gpu/drm/radeon/kv_smc.c+1−1

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

drivers/gpu/drm/radeon/ni.c+9−22

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

drivers/gpu/drm/radeon/ni_dpm.c+0−3

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

drivers/gpu/drm/radeon/ni_dpm.h+4−8

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

drivers/gpu/drm/radeon/nislands_smc.h+17−34

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

drivers/gpu/drm/radeon/r100.c+1−1

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

drivers/gpu/drm/radeon/r300_reg.h+1−1

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

drivers/gpu/drm/radeon/r600.c+1−2

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

drivers/gpu/drm/radeon/r600_dpm.c+2−4

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

drivers/gpu/drm/radeon/r600_dpm.h+1−2

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

drivers/gpu/drm/radeon/radeon.h+2−4

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

drivers/gpu/drm/radeon/radeon_asic.c+4−4

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

drivers/gpu/drm/radeon/radeon_atombios.c+22−22

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

drivers/gpu/drm/radeon/radeon_atpx_handler.c+8−4

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

drivers/gpu/drm/radeon/radeon_audio.c+5−6

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

drivers/gpu/drm/radeon/radeon_audio.h+2−4

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

drivers/gpu/drm/radeon/radeon_mode.h+3−6

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

drivers/gpu/drm/radeon/radeon_object.c+0−2

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

drivers/gpu/drm/radeon/radeon_pm.c+2−2

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

drivers/gpu/drm/radeon/radeon_ttm.c+1−7

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

drivers/gpu/drm/radeon/radeon_uvd.c+0−1

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

drivers/gpu/drm/radeon/rs400.c+2−2

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

drivers/gpu/drm/radeon/rs600.c+1−2

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

drivers/gpu/drm/radeon/rv515.c+1−2

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

drivers/gpu/drm/radeon/rv6xx_dpm.h+1−2

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

drivers/gpu/drm/radeon/rv770_dpm.c+2−2

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

drivers/gpu/drm/radeon/rv770_smc.h+9−18

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

drivers/gpu/drm/radeon/si.c+22−41

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

drivers/gpu/drm/radeon/si_dpm.c+44−88

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

drivers/gpu/drm/radeon/si_dpm.h+7−14

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

drivers/gpu/drm/radeon/smu7.h+2−4

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

drivers/gpu/drm/radeon/smu7_discrete.h+17−34

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

drivers/gpu/drm/radeon/smu7_fusion.h+16−26

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

drivers/gpu/drm/radeon/sumo_dpm.c+8−10

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

drivers/gpu/drm/radeon/trinity_dpm.c+9−13

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

drivers/gpu/drm/radeon/trinity_dpm.h+1−2

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

drivers/gpu/drm/radeon/uvd_v1_0.c+1−1

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

drivers/gpu/drm/rockchip/analogix_dp-rockchip.c+3−0

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

drivers/gpu/drm/rockchip/inno_hdmi.c+342−207

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

drivers/gpu/drm/rockchip/inno_hdmi.h+0−5

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

drivers/gpu/drm/rockchip/rockchip_lvds.c+1−2

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

drivers/gpu/drm/rockchip/rockchip_vop_reg.c+12−1

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

drivers/gpu/drm/rockchip/rockchip_vop_reg.h+3−0

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

drivers/gpu/drm/scheduler/sched_main.c+13−13

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

drivers/gpu/drm/solomon/ssd130x-spi.c+7−0

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

drivers/gpu/drm/solomon/ssd130x.c+370−0

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

drivers/gpu/drm/solomon/ssd130x.h+4−1

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

drivers/gpu/drm/tegra/dpaux.c+10−4

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

drivers/gpu/drm/tegra/drm.c+2−1

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

drivers/gpu/drm/tegra/drm.h+1−1

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

drivers/gpu/drm/tegra/dsi.c+39−20

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

drivers/gpu/drm/tegra/hdmi.c+14−7

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

drivers/gpu/drm/tegra/output.c+13−4

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

drivers/gpu/drm/tegra/rgb.c+13−5

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

drivers/gpu/drm/tegra/sor.c+1−0

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

drivers/gpu/drm/tests/drm_managed_test.c+61−16

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

drivers/gpu/drm/tests/drm_mm_test.c+4−1

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

drivers/gpu/drm/tilcdc/tilcdc_drv.c+4−15

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

drivers/gpu/drm/ttm/tests/Makefile+3−0

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

drivers/gpu/drm/ttm/tests/ttm_bo_test.c+622−0

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

drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c+47−1

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

drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h+3−0

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

drivers/gpu/drm/ttm/tests/ttm_pool_test.c+1−2

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

drivers/gpu/drm/ttm/tests/ttm_resource_test.c+335−0

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

drivers/gpu/drm/ttm/tests/ttm_tt_test.c+295−0

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

drivers/gpu/drm/ttm/ttm_bo.c+19−11

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

drivers/gpu/drm/ttm/ttm_bo_util.c+11−2

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

drivers/gpu/drm/ttm/ttm_device.c+16−5

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

drivers/gpu/drm/ttm/ttm_resource.c+19−57

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

drivers/gpu/drm/ttm/ttm_tt.c+15−0

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

drivers/gpu/drm/tve200/Kconfig+0−1

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

drivers/gpu/drm/v3d/v3d_debugfs.c+15−0

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

drivers/gpu/drm/v3d/v3d_submit.c+28−7

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

drivers/gpu/drm/vc4/vc4_hdmi.c+1−0

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

drivers/gpu/drm/vc4/vc4_plane.c+5−5

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

drivers/gpu/drm/virtio/virtgpu_drv.c+1−0

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

drivers/gpu/drm/virtio/virtgpu_submit.c+3−3

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

drivers/gpu/drm/vkms/Kconfig+15−0

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

drivers/gpu/drm/vkms/vkms_composer.c+10−4

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

drivers/gpu/drm/vmwgfx/ttm_object.c+3−3

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

drivers/gpu/drm/vmwgfx/ttm_object.h+1−2

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

drivers/gpu/drm/vmwgfx/vmwgfx_bo.c+24−9

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

drivers/gpu/drm/vmwgfx/vmwgfx_drv.h+0−1

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

drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c+15−5

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

drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c+4−1

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

drivers/gpu/drm/vmwgfx/vmwgfx_kms.c+104−196

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

drivers/gpu/drm/vmwgfx/vmwgfx_kms.h+3−3

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

drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c+3−2

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

drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c+3−2

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

drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c+15−6

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

drivers/gpu/drm/vmwgfx/vmwgfx_surface.c+6−12

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

drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c+0−32

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

drivers/gpu/drm/xe/display/xe_plane_initial.c+40−27

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

drivers/gpu/drm/xe/xe_bo.c+15−18

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

drivers/gpu/drm/xe/xe_gt.c+1−1

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

drivers/gpu/drm/xe/xe_gt_topology.c+3−1

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

drivers/gpu/drm/xe/xe_guc_submit.c+2−1

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

drivers/gpu/drm/xe/xe_reg_sr.c+1−1

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

drivers/gpu/drm/xlnx/zynqmp_disp.c+1−1

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

drivers/gpu/drm/xlnx/zynqmp_dp.c+15−7

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

drivers/gpu/host1x/bus.c+1−1

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

drivers/gpu/host1x/bus.h+1−1

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

drivers/hid/bpf/hid_bpf_dispatch.c+74−27

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

drivers/hid/bpf/hid_bpf_dispatch.h+2−2

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

drivers/hid/bpf/hid_bpf_jmp_table.c+20−20

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

drivers/hid/hid-ids.h+3−0

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

drivers/hid/hid-logitech-hidpp.c+2−0

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

drivers/hid/hid-nvidia-shield.c+4−0

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

drivers/hid/hid-steam.c+18−18

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

drivers/hid/hidraw.c+5−2

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

drivers/hid/i2c-hid/i2c-hid-core.c+5−1

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

drivers/hid/i2c-hid/i2c-hid-of.c+1−0

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

drivers/hwmon/gigabyte_waterforce.c+1−1

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

drivers/hwmon/pmbus/mp2975.c+16−0

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

drivers/input/joystick/xpad.c+2−0

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

drivers/input/keyboard/atkbd.c+9−5

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

drivers/input/mouse/bcm5974.c+20−0

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

drivers/input/serio/i8042-acpipnpio.h+14−0

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

drivers/input/touchscreen/goodix.c+2−1

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

drivers/iommu/iommu.c+13−5

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

drivers/md/dm-core.h+2−0

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

drivers/md/dm-crypt.c+2−36

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

drivers/md/dm-ioctl.c+2−1

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

drivers/md/dm-stats.c+9−0

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

drivers/md/dm-table.c+7−2

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

drivers/md/dm-verity-target.c+2−24

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

drivers/md/dm-verity.h+0−1

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

drivers/md/dm-writecache.c+4−4

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

drivers/md/raid1.c+1−1

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

drivers/media/common/videobuf2/videobuf2-core.c+1−1

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

drivers/media/common/videobuf2/videobuf2-v4l2.c+26−29

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

drivers/media/i2c/tc358743.c+4−3

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

drivers/media/platform/chips-media/wave5/wave5-vpu.c+1−1

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

drivers/misc/fastrpc.c+1−1

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

drivers/misc/open-dice.c+1−1

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

drivers/net/dsa/mt7530.c+1−2

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

drivers/net/dsa/mv88e6xxx/chip.c+1−1

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

drivers/net/dsa/qca/qca8k-8xxx.c+1−2

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

drivers/net/ethernet/8390/8390.c+1−0

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

drivers/net/ethernet/8390/8390p.c+1−0

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

drivers/net/ethernet/8390/apne.c+1−0

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

drivers/net/ethernet/8390/hydra.c+1−0

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

drivers/net/ethernet/8390/stnic.c+1−0

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

drivers/net/ethernet/8390/zorro8390.c+1−0

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

drivers/net/ethernet/amd/pds_core/adminq.c+48−16

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

drivers/net/ethernet/amd/pds_core/core.c+36−10

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

drivers/net/ethernet/amd/pds_core/core.h+1−1

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

drivers/net/ethernet/amd/pds_core/debugfs.c+4−0

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

drivers/net/ethernet/amd/pds_core/dev.c+8−8

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

drivers/net/ethernet/amd/pds_core/devlink.c+2−1

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

drivers/net/ethernet/amd/pds_core/fw.c+3−0

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

drivers/net/ethernet/amd/pds_core/main.c+22−4

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

drivers/net/ethernet/broadcom/bcm4908_enet.c+1−0

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

drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c+1−0

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

drivers/net/ethernet/broadcom/bgmac-bcma.c+1−0

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

drivers/net/ethernet/broadcom/bgmac-platform.c+1−0

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

drivers/net/ethernet/broadcom/bgmac.c+1−0

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

drivers/net/ethernet/broadcom/bnxt/bnxt.c+35−14

This diff is large: its 181 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_dcb.c+1−1

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

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c+4−3

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

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

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

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

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

drivers/net/ethernet/cavium/liquidio/lio_core.c+1−0

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

drivers/net/ethernet/cirrus/ep93xx_eth.c+1−0

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

drivers/net/ethernet/engleder/tsnep_main.c+15−2

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

drivers/net/ethernet/ezchip/nps_enet.c+1−0

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

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

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

drivers/net/ethernet/freescale/fec_main.c+3−0

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

drivers/net/ethernet/freescale/fsl_pq_mdio.c+1−0

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

drivers/net/ethernet/google/gve/gve_rx.c+4−4

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

drivers/net/ethernet/intel/e1000e/e1000.h+20−0

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

drivers/net/ethernet/intel/e1000e/ptp.c+15−7

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

drivers/net/ethernet/intel/i40e/i40e_main.c+31−16

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

drivers/net/ethernet/intel/i40e/i40e_txrx.c+23−26

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

drivers/net/ethernet/intel/i40e/i40e_xsk.c+2−2

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

drivers/net/ethernet/intel/ice/ice_base.c+23−14

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

drivers/net/ethernet/intel/ice/ice_txrx.c+9−10

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

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

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

drivers/net/ethernet/intel/ice/ice_txrx_lib.h+22−9

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

drivers/net/ethernet/intel/ice/ice_xsk.c+2−2

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

drivers/net/ethernet/intel/idpf/idpf_lib.c+2−0

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

drivers/net/ethernet/intel/idpf/virtchnl2.h+1−1

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

drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c+2−1

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

drivers/net/ethernet/litex/litex_liteeth.c+1−0

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

drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c+26−1

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

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

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

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

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

drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c+1−2

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

drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c+3−4

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

drivers/net/ethernet/mediatek/mtk_eth_soc.c+4−1

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

drivers/net/ethernet/mellanox/mlx5/core/cmd.c+3−2

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/en/fs_tt_redirect.c+1−0

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c+1−1

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c+15−11

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

drivers/net/ethernet/mellanox/mlx5/core/en_common.c+13−8

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+3−2

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

drivers/net/ethernet/mellanox/mlx5/core/esw/bridge_mcast.c+3−0

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

drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c+2−0

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c+1−1

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

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c+12−5

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

drivers/net/ethernet/mellanox/mlx5/core/vport.c+21−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_port.c+3−2

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

drivers/net/ethernet/netronome/nfp/flower/conntrack.c+43−3

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

drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c+4−0

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

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+6−0

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

drivers/net/fjes/fjes_hw.c+30−7

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

drivers/net/hyperv/netvsc.c+4−1

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

drivers/net/hyperv/netvsc_drv.c+2−2

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

drivers/net/macsec.c+20−5

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

drivers/net/phy/mediatek-ge-soc.c+81−66

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

drivers/net/phy/micrel.c+11−0

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

drivers/net/tun.c+8−2

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

drivers/net/wireless/ath/ath11k/core.h+0−4

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

drivers/net/wireless/ath/ath11k/debugfs.c+10−15

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

drivers/net/wireless/ath/ath11k/debugfs.h+2−10

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

drivers/net/wireless/ath/ath11k/mac.c+1−11

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

drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c+2−2

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

drivers/net/wireless/intersil/p54/fwio.c+1−1

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

drivers/net/xen-netback/netback.c+67−39

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

drivers/nvme/common/auth.c+1−0

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

drivers/nvme/common/keyring.c+1−0

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

drivers/nvme/host/apple.c+7−6

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

drivers/nvme/host/auth.c+9−10

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

drivers/nvme/host/constants.c+5−5

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

drivers/nvme/host/core.c+70−15

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

drivers/nvme/host/fabrics.c+12−7

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

drivers/nvme/host/fabrics.h+5−3

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

drivers/nvme/host/fc.c+14−46

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

drivers/nvme/host/multipath.c+8−7

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

drivers/nvme/host/nvme.h+43−19

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

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

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

drivers/nvme/host/rdma.c+14−9

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

drivers/nvme/host/sysfs.c+61−3

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

drivers/nvme/host/tcp.c+6−5

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

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

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

drivers/nvme/target/discovery.c+1−1

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

drivers/nvme/target/fc.c+103−83

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

drivers/nvme/target/fcloop.c+4−3

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

drivers/nvme/target/loop.c+6−3

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

drivers/nvme/target/rdma.c+1−0

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

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

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

drivers/pci/bus.c+32−17

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

drivers/pci/controller/dwc/pcie-qcom.c+1−1

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

drivers/pci/pci.c+52−26

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

drivers/pci/pci.h+2−2

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

drivers/pci/pcie/aspm.c+9−4

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

drivers/phy/microchip/lan966x_serdes.c+2−0

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

drivers/phy/qualcomm/phy-qcom-qmp-usb.c+28−2

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

drivers/phy/renesas/phy-rcar-gen3-usb2.c+0−4

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

drivers/phy/ti/phy-omap-usb2.c+2−2

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

drivers/platform/mellanox/mlxbf-pmc.c+2−2

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

drivers/platform/mellanox/mlxbf-tmfifo.c+67−0

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

drivers/platform/x86/amd/pmf/Kconfig+1−0

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

drivers/platform/x86/amd/pmf/spc.c+36−0

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

drivers/platform/x86/amd/pmf/tee-if.c+3−1

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

drivers/platform/x86/intel/ifs/load.c+2−1

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

drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c+41−41

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

drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.h+16−16

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

drivers/platform/x86/intel/wmi/sbl-fw-update.c+2−2

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

drivers/platform/x86/p2sb.c+140−42

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

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

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

drivers/platform/x86/wmi.c+112−69

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

drivers/power/supply/qcom_battmgr.c+49−60

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

drivers/regulator/max5970-regulator.c+1−1

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

drivers/regulator/pwm-regulator.c+43−0

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

drivers/regulator/ti-abb-regulator.c+19−3

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

drivers/scsi/initio.c+1−2

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

drivers/scsi/isci/request.c+1−1

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

drivers/scsi/scsi_error.c+4−4

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

drivers/scsi/scsi_lib.c+1−1

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

drivers/scsi/scsi_priv.h+1−1

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

drivers/scsi/storvsc_drv.c+7−5

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

drivers/scsi/virtio_scsi.c+0−2

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

drivers/soc/apple/mailbox.c+3−3

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

drivers/spi/spi-bcm-qspi.c+2−2

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

drivers/spi/spi-cadence.c+9−8

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

drivers/spi/spi-cs42l43.c+4−1

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

drivers/spi/spi-hisi-sfc-v3xx.c+5−0

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

drivers/spi/spi-imx.c+2−2

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

drivers/spi/spi-intel-pci.c+1−1

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

drivers/spi/spi-sh-msiof.c+8−8

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

drivers/spi/spi.c+4−0

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

drivers/staging/sm750fb/Kconfig+0−1

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

drivers/thermal/intel/intel_powerclamp.c+0−32

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

drivers/tty/serial/8250/8250_pci1xxxx.c+2−2

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

drivers/tty/serial/max310x.c+43−10

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

drivers/tty/serial/serial_core.c+1−1

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

drivers/usb/chipidea/ci.h+2−0

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

drivers/usb/chipidea/core.c+24−20

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

drivers/usb/common/ulpi.c+1−1

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

drivers/usb/core/hub.c+32−14

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

drivers/usb/dwc3/dwc3-pci.c+4−0

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

drivers/usb/dwc3/gadget.c+2−4

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

drivers/usb/dwc3/host.c+3−1

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

drivers/usb/gadget/function/f_mass_storage.c+18−2

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

drivers/usb/gadget/function/f_ncm.c+4−4

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

drivers/usb/gadget/udc/pch_udc.c+0−1

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

drivers/usb/host/xhci-mem.c+7−7

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

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

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

drivers/usb/host/xhci-ring.c+65−15

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

drivers/usb/host/xhci.h+1−0

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

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

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

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

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

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

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

drivers/usb/typec/tcpm/tcpm.c+3−3

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

drivers/usb/typec/ucsi/ucsi.c+2−0

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

drivers/usb/typec/ucsi/ucsi_acpi.c+81−7

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

drivers/video/Kconfig+5−4

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

drivers/video/Makefile+5−2

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

drivers/video/cmdline.c+2−0

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

drivers/video/fbdev/Kconfig+0−35

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

drivers/video/fbdev/core/Kconfig+1−1

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

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

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

drivers/video/fbdev/core/fbmem.c+0−2

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

drivers/video/fbdev/efifb.c+77−148

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

drivers/video/fbdev/geode/Kconfig+0−3

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

drivers/video/fbdev/savage/savagefb_driver.c+3−0

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

drivers/video/fbdev/simplefb.c+1−1

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

drivers/video/fbdev/sis/sis_main.c+2−0

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

drivers/video/fbdev/stifb.c+1−1

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

drivers/video/fbdev/vesafb.c+47−31

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

drivers/video/fbdev/vt8500lcdfb.c+0−1

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

drivers/video/screen_info_generic.c+146−0

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

drivers/video/screen_info_pci.c+136−0

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

fs/afs/dir.c+22−8

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

fs/afs/dynroot.c+0−9

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

fs/afs/proc.c+3−2

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

fs/bcachefs/alloc_background.c+1−1

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

fs/bcachefs/btree_locking.c+2−2

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

fs/bcachefs/debug.c+1−1

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

fs/bcachefs/fs-io.c+1−1

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

fs/bcachefs/fsck.c+12−11

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

fs/bcachefs/journal.c+1−1

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

fs/bcachefs/journal_io.c+2−1

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

fs/bcachefs/str_hash.h+15−7

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

fs/bcachefs/util.c+5−5

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

fs/bcachefs/util.h+2−2

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

fs/btrfs/compression.c+16−7

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

fs/btrfs/compression.h+2−2

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

fs/btrfs/extent-tree.c+39−14

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

fs/btrfs/inode.c+13−9

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

fs/btrfs/ioctl.c+7−0

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

fs/btrfs/lzo.c+9−25

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

fs/btrfs/ref-verify.c+4−2

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

fs/btrfs/scrub.c+29−7

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

fs/btrfs/send.c+2−2

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

fs/btrfs/subpage.c+2−1

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

fs/btrfs/super.c+8−0

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

fs/btrfs/tree-checker.c+1−1

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

fs/btrfs/volumes.c+0−2

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

fs/btrfs/zlib.c+19−54

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

fs/btrfs/zoned.c+2−6

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

fs/cachefiles/ondemand.c+3−0

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

fs/erofs/compress.h+2−3

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

fs/erofs/decompressor.c+3−2

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

fs/erofs/decompressor_deflate.c+13−6

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

fs/erofs/decompressor_lzma.c+12−5

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

fs/erofs/fscache.c+1−1

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

fs/erofs/inode.c+1−1

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

fs/erofs/utils.c+1−1

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

fs/erofs/zdata.c+54−44

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

fs/exec.c+31−10

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

fs/exfat/inode.c+3−4

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

fs/ext4/ext4.h+5−3

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

fs/ext4/extents.c+78−46

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

fs/ext4/file.c+1−1

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

fs/ext4/indirect.c+1−1

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

fs/ext4/inode.c+30−60

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

fs/ext4/ioctl.c+1−1

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

fs/ext4/mballoc.c+78−62

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

fs/ext4/mballoc.h+0−1

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

fs/ext4/move_extent.c+4−6

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

fs/ext4/super.c+1−1

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

fs/gfs2/dentry.c+9−14

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

fs/gfs2/inode.c+4−4

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

fs/hugetlbfs/inode.c+1−1

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

fs/jfs/jfs_dmap.c+1−7

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

fs/netfs/buffered_read.c+6−6

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

fs/netfs/buffered_write.c+8−7

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

fs/netfs/fscache_cache.c+2−1

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

fs/netfs/io.c+1−1

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

fs/netfs/misc.c+1−1

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

fs/nfsd/nfs4state.c+15−11

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

fs/overlayfs/namei.c+27−16

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

fs/overlayfs/overlayfs.h+17−6

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

fs/overlayfs/ovl_entry.h+3−1

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

fs/overlayfs/readdir.c+4−3

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

fs/overlayfs/super.c+15−0

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

fs/overlayfs/util.c+31−22

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

fs/smb/client/cached_dir.c+20−4

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

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

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

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

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

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

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

fs/smb/client/file.c+10−9

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

fs/smb/client/inode.c+5−3

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

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

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

fs/smb/client/sess.c+6−0

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

fs/smb/client/smb2inode.c+27−6

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

fs/smb/client/smb2ops.c+127−14

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

fs/smb/client/smb2pdu.c+256−33

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

fs/smb/client/smb2proto.h+5−0

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

fs/smb/client/smbencrypt.c+0−7

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

fs/smb/client/transport.c+14−4

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

fs/smb/server/ksmbd_netlink.h+2−1

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

fs/smb/server/transport_ipc.c+2−2

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

fs/smb/server/transport_tcp.c+2−0

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

fs/tracefs/event_inode.c+162−458

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

fs/tracefs/inode.c+22−80

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

fs/tracefs/internal.h+19−26

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

fs/xfs/libxfs/xfs_attr.c+3−3

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

fs/xfs/libxfs/xfs_rtbitmap.c+0−14

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

fs/xfs/libxfs/xfs_rtbitmap.h+0−16

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

fs/xfs/libxfs/xfs_sb.c+14−0

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

fs/xfs/libxfs/xfs_sb.h+2−0

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

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

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

fs/xfs/scrub/rtbitmap.c+1−0

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

fs/xfs/scrub/rtsummary.c+1−0

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

fs/xfs/xfs_super.c+17−10

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

include/drm/display/drm_dp.h+1−0

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

include/drm/display/drm_dp_helper.h+1−2

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

include/drm/drm_atomic.h+59−11

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

include/drm/drm_bridge.h+13−12

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

include/drm/drm_edid.h+21−25

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

include/drm/drm_exec.h+2−2

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

include/drm/drm_fixed.h+1−1

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

include/drm/drm_gpuvm.h+1−1

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

include/drm/drm_managed.h+4−0

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

include/drm/drm_modes.h+2−0

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

include/drm/drm_print.h+119−104

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

include/drm/drm_probe_helper.h+0−1

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

include/drm/drm_rect.h+2−2

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

include/drm/i915_pciids.h+3−0

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

include/drm/ttm/ttm_placement.h+6−4

This diff is large: its 30 lines aren’t shown here.

include/drm/ttm/ttm_resource.h+2−6

This diff is large: its 15 lines aren’t shown here.

include/drm/ttm/ttm_tt.h+8−1

This diff is large: its 24 lines aren’t shown here.

include/linux/dmaengine.h+2−1

This diff is large: its 10 lines aren’t shown here.

include/linux/fb.h+0−7

This diff is large: its 15 lines aren’t shown here.

include/linux/hid_bpf.h+0−11

This diff is large: its 18 lines aren’t shown here.

include/linux/iosys-map.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/libata.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/lsm_hook_defs.h+2−2

This diff is large: its 12 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/mlx5/fs.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/mlx5/mlx5_ifc.h+8−4

This diff is large: its 34 lines aren’t shown here.

include/linux/mlx5/vport.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/mman.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/mmzone.h+3−3

This diff is large: its 21 lines aren’t shown here.

include/linux/netfilter/ipset/ip_set.h+4−0

This diff is large: its 18 lines aren’t shown here.

include/linux/nvme.h+2−8

This diff is large: its 31 lines aren’t shown here.

include/linux/pci.h+5−0

This diff is large: its 26 lines aren’t shown here.

include/linux/sched.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/screen_info.h+126−0

This diff is large: its 133 lines aren’t shown here.

include/linux/skmsg.h+0−6

This diff is large: its 13 lines aren’t shown here.

include/linux/spi/spi.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/syscalls.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/sysfb.h+4−2

This diff is large: its 20 lines aren’t shown here.

include/net/af_unix.h+14−6

This diff is large: its 34 lines aren’t shown here.

include/net/inet_connection_sock.h+8−0

This diff is large: its 13 lines aren’t shown here.

include/net/inet_sock.h+0−5

This diff is large: its 12 lines aren’t shown here.

include/net/ip.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/net/llc_pdu.h+2−4

This diff is large: its 20 lines aren’t shown here.

include/net/netfilter/nf_tables.h+41−10

This diff is large: its 194 lines aren’t shown here.

include/net/sch_generic.h+4−0

This diff is large: its 11 lines aren’t shown here.

include/net/sock.h+17−1

This diff is large: its 27 lines aren’t shown here.

include/net/xdp_sock_drv.h+27−0

This diff is large: its 46 lines aren’t shown here.

include/sound/cs35l56.h+6−1

This diff is large: its 36 lines aren’t shown here.

include/sound/hdmi-codec.h+0−1

This diff is large: its 8 lines aren’t shown here.

include/trace/events/afs.h+25−0

This diff is large: its 32 lines aren’t shown here.

include/trace/events/ext4.h+4−7

This diff is large: its 34 lines aren’t shown here.

include/uapi/drm/amdgpu_drm.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/uapi/drm/i915_drm.h+12−0

This diff is large: its 33 lines aren’t shown here.

include/uapi/drm/ivpu_accel.h+20−5

This diff is large: its 58 lines aren’t shown here.

include/uapi/drm/nouveau_drm.h+27−29

This diff is large: its 80 lines aren’t shown here.

include/uapi/drm/qaic_accel.h+1−12

This diff is large: its 20 lines aren’t shown here.

include/uapi/drm/vmwgfx_drm.h+4−2

This diff is large: its 19 lines aren’t shown here.

include/uapi/linux/btrfs.h+3−0

This diff is large: its 10 lines aren’t shown here.

include/uapi/linux/kfd_ioctl.h+2−1

This diff is large: its 12 lines aren’t shown here.

include/uapi/linux/serial.h+7−6

This diff is large: its 20 lines aren’t shown here.

include/uapi/linux/virtio_gpu.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/video/cmdline.h+2−6

This diff is large: its 21 lines aren’t shown here.

init/Kconfig+12−0

This diff is large: its 19 lines aren’t shown here.

io_uring/io_uring.h+7−1

This diff is large: its 19 lines aren’t shown here.

io_uring/net.c+36−14

This diff is large: its 88 lines aren’t shown here.

io_uring/opdef.c+0−1

This diff is large: its 8 lines aren’t shown here.

io_uring/openclose.c+4−0

This diff is large: its 11 lines aren’t shown here.

io_uring/poll.c+28−21

This diff is large: its 80 lines aren’t shown here.

io_uring/poll.h+9−0

This diff is large: its 16 lines aren’t shown here.

io_uring/rw.c+9−1

This diff is large: its 25 lines aren’t shown here.

kernel/events/uprobes.c+1−1

This diff is large: its 9 lines aren’t shown here.

kernel/fork.c+1−0

This diff is large: its 8 lines aren’t shown here.

kernel/futex/core.c+12−3

This diff is large: its 25 lines aren’t shown here.

kernel/futex/pi.c+8−3

This diff is large: its 36 lines aren’t shown here.

kernel/irq/irqdesc.c+1−1

This diff is large: its 9 lines aren’t shown here.

kernel/rcu/tree.c+33−1

This diff is large: its 48 lines aren’t shown here.

kernel/rcu/tree_exp.h+1−2

This diff is large: its 17 lines aren’t shown here.

kernel/time/clocksource.c+24−1

This diff is large: its 54 lines aren’t shown here.

kernel/time/tick-sched.c+5−0

This diff is large: its 22 lines aren’t shown here.

kernel/trace/ring_buffer.c+1−1

This diff is large: its 9 lines aren’t shown here.

kernel/trace/trace_events_trigger.c+4−2

This diff is large: its 13 lines aren’t shown here.

kernel/trace/trace_osnoise.c+3−3

This diff is large: its 20 lines aren’t shown here.

kernel/trace/tracing_map.c+6−1

This diff is large: its 14 lines aren’t shown here.

lib/kunit/device.c+2−2

This diff is large: its 11 lines aren’t shown here.

lib/kunit/executor.c+4−0

This diff is large: its 11 lines aren’t shown here.

lib/kunit/kunit-test.c+1−1

This diff is large: its 9 lines aren’t shown here.

lib/kunit/test.c+11−3

This diff is large: its 44 lines aren’t shown here.

lib/stackdepot.c+263−110

This diff is large: its 587 lines aren’t shown here.

mm/huge_memory.c+14−4

This diff is large: its 53 lines aren’t shown here.

mm/memblock.c+3−0

This diff is large: its 10 lines aren’t shown here.

mm/memcontrol.c+25−4

This diff is large: its 60 lines aren’t shown here.

mm/memory-failure.c+1−1

This diff is large: its 9 lines aren’t shown here.

mm/memory.c+1−1

This diff is large: its 9 lines aren’t shown here.

mm/mmap.c+4−2

This diff is large: its 20 lines aren’t shown here.

mm/page-writeback.c+1−1

This diff is large: its 9 lines aren’t shown here.

mm/readahead.c+2−2

This diff is large: its 18 lines aren’t shown here.

mm/userfaultfd.c+13−2

This diff is large: its 43 lines aren’t shown here.

net/8021q/vlan_netlink.c+4−0

This diff is large: its 17 lines aren’t shown here.

net/batman-adv/multicast.c+3−0

This diff is large: its 17 lines aren’t shown here.

net/bridge/br_multicast.c+15−5

This diff is large: its 83 lines aren’t shown here.

net/bridge/br_private.h+2−2

This diff is large: its 18 lines aren’t shown here.

net/core/dev.c+9−0

This diff is large: its 23 lines aren’t shown here.

net/core/dev.h+3−0

This diff is large: its 10 lines aren’t shown here.

net/core/filter.c+38−6

This diff is large: its 69 lines aren’t shown here.

net/core/request_sock.c+0−3

This diff is large: its 10 lines aren’t shown here.

net/core/sock.c+9−2

This diff is large: its 25 lines aren’t shown here.

net/devlink/port.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/hsr/hsr_device.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/ipv4/af_inet.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/ipv4/inet_connection_sock.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/ipv4/ip_output.c+6−6

This diff is large: its 26 lines aren’t shown here.

net/ipv4/ip_sockglue.c+4−2

This diff is large: its 25 lines aren’t shown here.

net/ipv4/ipmr.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/raw.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/tcp.c+12−1

This diff is large: its 27 lines aren’t shown here.

net/ipv4/udp.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv6/addrconf_core.c+14−7

This diff is large: its 34 lines aren’t shown here.

net/ipv6/af_inet6.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/ipv6/ip6_tunnel.c+18−3

This diff is large: its 43 lines aren’t shown here.

net/llc/af_llc.c+18−8

This diff is large: its 63 lines aren’t shown here.

net/llc/llc_core.c+0−7

This diff is large: its 23 lines aren’t shown here.

net/mac80211/Kconfig+0−1

This diff is large: its 8 lines aren’t shown here.

net/mac80211/sta_info.c+6−1

This diff is large: its 21 lines aren’t shown here.

net/mac80211/tx.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/mptcp/protocol.c+0−3

This diff is large: its 10 lines aren’t shown here.

net/netfilter/ipset/ip_set_bitmap_gen.h+11−3

This diff is large: its 42 lines aren’t shown here.

net/netfilter/ipset/ip_set_core.c+28−9

This diff is large: its 97 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_gen.h+12−3

This diff is large: its 50 lines aren’t shown here.

net/netfilter/ipset/ip_set_list_set.c+10−3

This diff is large: its 34 lines aren’t shown here.

net/netfilter/nf_conntrack_proto_sctp.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/nf_conntrack_proto_tcp.c+6−4

This diff is large: its 38 lines aren’t shown here.

net/netfilter/nf_log.c+4−3

This diff is large: its 16 lines aren’t shown here.

net/netfilter/nf_tables_api.c+19−15

This diff is large: its 97 lines aren’t shown here.

net/netfilter/nft_chain_filter.c+9−2

This diff is large: its 34 lines aren’t shown here.

net/netfilter/nft_compat.c+12−0

This diff is large: its 26 lines aren’t shown here.

net/netfilter/nft_ct.c+24−0

This diff is large: its 32 lines aren’t shown here.

net/netfilter/nft_flow_offload.c+5−0

This diff is large: its 12 lines aren’t shown here.

net/netfilter/nft_limit.c+16−7

This diff is large: its 53 lines aren’t shown here.

net/netfilter/nft_nat.c+5−0

This diff is large: its 12 lines aren’t shown here.

net/netfilter/nft_rt.c+5−0

This diff is large: its 12 lines aren’t shown here.

net/netfilter/nft_socket.c+5−0

This diff is large: its 12 lines aren’t shown here.

net/netfilter/nft_synproxy.c+5−2

This diff is large: its 28 lines aren’t shown here.

net/netfilter/nft_tproxy.c+5−0

This diff is large: its 12 lines aren’t shown here.

net/netfilter/nft_tunnel.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/netfilter/nft_xfrm.c+5−0

This diff is large: its 12 lines aren’t shown here.

net/netlink/af_netlink.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/nfc/nci/core.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/rds/af_rds.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/sched/cls_api.c+8−1

This diff is large: its 30 lines aren’t shown here.

net/sched/cls_flower.c+23−0

This diff is large: its 37 lines aren’t shown here.

net/smc/smc_core.c+9−3

This diff is large: its 19 lines aren’t shown here.

net/smc/smc_diag.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/sunrpc/svc.c+2−2

This diff is large: its 13 lines aren’t shown here.

net/sunrpc/svcsock.c+2−2

This diff is large: its 15 lines aren’t shown here.

net/unix/af_unix.c+6−8

This diff is large: its 28 lines aren’t shown here.

net/unix/diag.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/wireless/Kconfig+0−1

This diff is large: its 8 lines aren’t shown here.

net/wireless/nl80211.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/xdp/xsk.c+8−4

This diff is large: its 29 lines aren’t shown here.

net/xdp/xsk_buff_pool.c+1−0

This diff is large: its 8 lines aren’t shown here.

samples/cgroup/.gitignore+3−0

This diff is large: its 4 lines aren’t shown here.

scripts/Makefile.defconf+4−4

This diff is large: its 21 lines aren’t shown here.

scripts/Makefile.extrawarn+0−2

This diff is large: its 16 lines aren’t shown here.

scripts/kconfig/symbol.c+3−1

This diff is large: its 18 lines aren’t shown here.

scripts/mod/modpost.c+3−12

This diff is large: its 38 lines aren’t shown here.

scripts/mod/modpost.h+1−5

This diff is large: its 22 lines aren’t shown here.

scripts/package/kernel.spec+11−11

This diff is large: its 46 lines aren’t shown here.

security/apparmor/lsm.c+3−1

This diff is large: its 12 lines aren’t shown here.

security/keys/encrypted-keys/encrypted.c+0−4

This diff is large: its 11 lines aren’t shown here.

security/security.c+40−5

This diff is large: its 66 lines aren’t shown here.

security/tomoyo/tomoyo.c+2−1

This diff is large: its 10 lines aren’t shown here.

sound/core/pcm.c+4−0

This diff is large: its 11 lines aren’t shown here.

sound/pci/hda/cs35l41_hda_property.c+4−0

This diff is large: its 18 lines aren’t shown here.

sound/pci/hda/cs35l56_hda.c+77−59

This diff is large: its 268 lines aren’t shown here.

sound/pci/hda/hda_intel.c+4−2

This diff is large: its 14 lines aren’t shown here.

sound/pci/hda/patch_cs8409.c+1−0

This diff is large: its 8 lines aren’t shown here.

sound/pci/hda/patch_realtek.c+13−3

This diff is large: its 80 lines aren’t shown here.

sound/soc/amd/acp/acp-mach-common.c+14−2

This diff is large: its 30 lines aren’t shown here.

sound/soc/amd/acp/acp-sof-mach.c+4−0

This diff is large: its 32 lines aren’t shown here.

sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c+8−0

This diff is large: its 15 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/cs35l56-shared.c+122−18

This diff is large: its 199 lines aren’t shown here.

sound/soc/codecs/cs35l56.c+256−45

This diff is large: its 456 lines aren’t shown here.

sound/soc/codecs/cs35l56.h+2−0

This diff is large: its 16 lines aren’t shown here.

sound/soc/codecs/es8326.c+139−47

This diff is large: its 345 lines aren’t shown here.

sound/soc/codecs/es8326.h+2−1

This diff is large: its 17 lines aren’t shown here.

sound/soc/codecs/lpass-wsa-macro.c+0−7

This diff is large: its 30 lines aren’t shown here.

sound/soc/codecs/wcd9335.c+0−4

This diff is large: its 32 lines aren’t shown here.

sound/soc/codecs/wcd934x.c+0−1

This diff is large: its 8 lines aren’t shown here.

sound/soc/codecs/wcd938x.c+3−5

This diff is large: its 22 lines aren’t shown here.

sound/soc/codecs/wm_adsp.c+31−42

This diff is large: its 121 lines aren’t shown here.

sound/soc/codecs/wsa883x.c+5−1

This diff is large: its 13 lines aren’t shown here.

sound/soc/qcom/sc8280xp.c+7−5

This diff is large: its 20 lines aren’t shown here.

sound/soc/soc-core.c+4−1

This diff is large: its 33 lines aren’t shown here.

sound/soc/sunxi/sun4i-spdif.c+5−0

This diff is large: its 12 lines aren’t shown here.

sound/usb/clock.c+32−2

This diff is large: its 69 lines aren’t shown here.

sound/usb/format.c+20−0

This diff is large: its 37 lines aren’t shown here.

sound/usb/midi2.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/usb/quirks.c+22−16

This diff is large: its 85 lines aren’t shown here.

sound/virtio/virtio_card.c+0−2

This diff is large: its 9 lines aren’t shown here.

sound/virtio/virtio_ctl_msg.c+0−2

This diff is large: its 9 lines aren’t shown here.

sound/virtio/virtio_pcm_msg.c+0−2

This diff is large: its 9 lines aren’t shown here.

tools/arch/x86/include/asm/cpufeatures.h+7−1

This diff is large: its 32 lines aren’t shown here.

tools/arch/x86/include/asm/msr-index.h+8−0

This diff is large: its 22 lines aren’t shown here.

tools/arch/x86/include/uapi/asm/kvm.h+3−0

This diff is large: its 8 lines aren’t shown here.

tools/arch/x86/lib/memcpy_64.S+2−2

This diff is large: its 22 lines aren’t shown here.

tools/arch/x86/lib/memset_64.S+2−2

This diff is large: its 21 lines aren’t shown here.

tools/include/asm-generic/unaligned.h+12−12

This diff is large: its 45 lines aren’t shown here.

tools/include/uapi/asm-generic/unistd.h+14−1

This diff is large: its 23 lines aren’t shown here.

tools/include/uapi/drm/drm.h+71−1

This diff is large: its 121 lines aren’t shown here.

tools/include/uapi/drm/i915_drm.h+6−6

This diff is large: its 54 lines aren’t shown here.

tools/include/uapi/linux/fcntl.h+3−0

This diff is large: its 9 lines aren’t shown here.

tools/include/uapi/linux/kvm.h+50−90

This diff is large: its 231 lines aren’t shown here.

tools/include/uapi/linux/mount.h+70−0

This diff is large: its 75 lines aren’t shown here.

tools/include/uapi/linux/stat.h+1−0

This diff is large: its 8 lines aren’t shown here.

tools/perf/Documentation/perf-list.txt+4−0

This diff is large: its 11 lines aren’t shown here.

tools/perf/Makefile.perf+10−0

This diff is large: its 17 lines aren’t shown here.

tools/perf/builtin-list.c+129−82

This diff is large: its 460 lines aren’t shown here.

tools/perf/builtin-record.c+2−2

This diff is large: its 11 lines aren’t shown here.

tools/perf/builtin-top.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/perf/pmu-events/arch/x86/alderlake/adl-metrics.json+118−136

This diff is large: its 1178 lines aren’t shown here.

tools/perf/pmu-events/arch/x86/alderlaken/adln-metrics.json+0−4

This diff is large: its 32 lines aren’t shown here.

tools/perf/pmu-events/arch/x86/sapphirerapids/spr-metrics.json+5−20

This diff is large: its 200 lines aren’t shown here.

tools/perf/tests/shell/daemon.sh+24−10

This diff is large: its 41 lines aren’t shown here.

tools/perf/tests/shell/list.sh+18−3

This diff is large: its 36 lines aren’t shown here.

tools/perf/tests/shell/script.sh+9−3

This diff is large: its 26 lines aren’t shown here.

tools/perf/trace/beauty/statx.c+1−0

This diff is large: its 8 lines aren’t shown here.

tools/perf/util/evlist.c+8−1

This diff is large: its 16 lines aren’t shown here.

tools/perf/util/hist.c+2−2

This diff is large: its 11 lines aren’t shown here.

tools/perf/util/include/linux/linkage.h+4−0

This diff is large: its 11 lines aren’t shown here.

tools/perf/util/metricgroup.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/perf/util/print-events.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/perf/util/synthetic-events.c+2−2

This diff is large: its 14 lines aren’t shown here.

tools/power/cpupower/bench/Makefile+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/cxl/Kbuild+2−0

This diff is large: its 7 lines aren’t shown here.

tools/testing/cxl/test/Kbuild+2−0

This diff is large: its 6 lines aren’t shown here.

tools/testing/nvdimm/Kbuild+2−0

This diff is large: its 7 lines aren’t shown here.

tools/testing/selftests/drivers/net/bonding/bond_options.sh+4−4

This diff is large: its 30 lines aren’t shown here.

tools/testing/selftests/drivers/net/bonding/lag_lib.sh+11−0

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/drivers/net/bonding/settings+1−1

This diff is large: its 3 lines aren’t shown here.

tools/testing/selftests/drivers/net/netdevsim/udp_tunnel_nic.sh+9−0

This diff is large: its 72 lines aren’t shown here.

tools/testing/selftests/drivers/net/team/config+3−1

This diff is large: its 7 lines aren’t shown here.

tools/testing/selftests/hid/tests/test_wacom_generic.py+4−4

This diff is large: its 22 lines aren’t shown here.

tools/testing/selftests/livepatch/functions.sh+17−20

This diff is large: its 75 lines aren’t shown here.

tools/testing/selftests/mm/charge_reserved_hugetlb.sh+1−1

This diff is large: its 6 lines aren’t shown here.

tools/testing/selftests/mm/ksm_tests.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/mm/map_hugetlb.c+7−0

This diff is large: its 25 lines aren’t shown here.

tools/testing/selftests/mm/mremap_test.c+14−13

This diff is large: its 70 lines aren’t shown here.

tools/testing/selftests/mm/va_high_addr_switch.sh+6−0

This diff is large: its 16 lines aren’t shown here.

tools/testing/selftests/mm/write_hugetlb_memory.sh+1−1

This diff is large: its 6 lines aren’t shown here.

tools/testing/selftests/net/Makefile+5−4

This diff is large: its 44 lines aren’t shown here.

tools/testing/selftests/net/config+44−0

This diff is large: its 85 lines aren’t shown here.

tools/testing/selftests/net/forwarding/Makefile+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/net/lib.sh+4−1

This diff is large: its 19 lines aren’t shown here.

tools/testing/selftests/net/mptcp/config+3−0

This diff is large: its 12 lines aren’t shown here.

tools/testing/selftests/net/mptcp/mptcp_join.sh+11−16

This diff is large: its 97 lines aren’t shown here.

tools/testing/selftests/net/mptcp/mptcp_lib.sh+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/net/mptcp/settings+1−1

This diff is large: its 3 lines aren’t shown here.

tools/testing/selftests/net/mptcp/simult_flows.sh+4−4

This diff is large: its 17 lines aren’t shown here.

tools/testing/selftests/net/net_helper.sh+0−0

File mode changed from 100755 to 100644.

tools/testing/selftests/net/pmtu.sh+9−9

This diff is large: its 41 lines aren’t shown here.

tools/testing/selftests/net/rps_default_mask.sh+5−1

This diff is large: its 17 lines aren’t shown here.

tools/testing/selftests/net/setup_loopback.sh+0−0

File mode changed from 100755 to 100644.

tools/testing/selftests/net/setup_veth.sh+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/net/so_incoming_cpu.c+50−18

This diff is large: its 151 lines aren’t shown here.

tools/testing/selftests/net/tcp_ao/config+10−0

This diff is large: its 11 lines aren’t shown here.

tools/testing/selftests/net/tcp_ao/key-management.c+26−20

This diff is large: its 110 lines aren’t shown here.

tools/testing/selftests/net/tcp_ao/lib/sock.c+8−4

This diff is large: its 26 lines aren’t shown here.

tools/testing/selftests/net/tcp_ao/rst.c+90−48

This diff is large: its 214 lines aren’t shown here.

tools/testing/selftests/net/tcp_ao/settings+1−0

This diff is large: its 2 lines aren’t shown here.

tools/testing/selftests/net/udpgro.sh+2−2

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/net/udpgro_bench.sh+2−2

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/net/udpgro_frglist.sh+3−3

This diff is large: its 24 lines aren’t shown here.

tools/testing/selftests/net/udpgro_fwd.sh+5−3

This diff is large: its 29 lines aren’t shown here.

tools/testing/selftests/net/veth.sh+2−2

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/net/xdp_dummy.c+13−0

This diff is large: its 14 lines aren’t shown here.

tools/testing/selftests/rseq/basic_percpu_ops_test.c+12−2

This diff is large: its 42 lines aren’t shown here.

tools/testing/selftests/rseq/param_test.c+16−6

This diff is large: its 78 lines aren’t shown here.

tools/testing/selftests/seccomp/seccomp_benchmark.c+64−40

This diff is large: its 204 lines aren’t shown here.