History

Merge tag 'v5.11' into sched/core, to pick up fixes & refresh the branch

Ingo Molnar committed 5 years ago

Commit ed3cd452 parents bae4ec1 f40ddce1642 files · +19353 −9628Browse files

Unified · Split

1642 files
  1. .clang-format +7 −4
  2. .mailmap +10 −3
  3. CREDITS +24 −0
  4. Documentation/ABI/testing/sysfs-class-devlink +2 −2
  5. Documentation/ABI/testing/sysfs-devices-consumer +3 −2
  6. Documentation/ABI/testing/sysfs-devices-supplier +3 −2
  7. Documentation/ABI/testing/sysfs-driver-ufs +22 −14
  8. Documentation/Makefile +1 −1
  9. Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst +4 −4
  10. Documentation/RCU/Design/Requirements/Requirements.rst +10 −10
  11. Documentation/admin-guide/binfmt-misc.rst +2 −2
  12. Documentation/admin-guide/bootconfig.rst +1 −1
  13. Documentation/admin-guide/cgroup-v2.rst +3 −3
  14. Documentation/admin-guide/device-mapper/dm-integrity.rst +9 −3
  15. Documentation/admin-guide/kernel-parameters.rst +2 −2
  16. Documentation/admin-guide/kernel-parameters.txt +10 −6
  17. Documentation/admin-guide/media/rkisp1.rst +16 −0
  18. Documentation/admin-guide/mm/concepts.rst +1 −1
  19. Documentation/admin-guide/syscall-user-dispatch.rst +2 −2
  20. Documentation/asm-annotations.rst +5 −0
  21. Documentation/core-api/index.rst +0 −1
  22. Documentation/dev-tools/kasan.rst +5 −21
  23. Documentation/dev-tools/kunit/usage.rst +57 −0
  24. Documentation/devicetree/bindings/arm/cpus.yaml +0 −1
  25. Documentation/devicetree/bindings/display/bridge/sii902x.txt +1 −1
  26. Documentation/devicetree/bindings/display/mediatek/mediatek,disp.txt +2 −2
  27. Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml +3 −1
  28. Documentation/devicetree/bindings/dma/ti/k3-pktdma.yaml +3 −1
  29. Documentation/devicetree/bindings/dma/ti/k3-udma.yaml +3 −1
  30. Documentation/devicetree/bindings/extcon/wlf,arizona.yaml +0 −1
  31. Documentation/devicetree/bindings/hwmon/adi,ltc2947.yaml +0 −1
  32. Documentation/devicetree/bindings/hwmon/baikal,bt1-pvt.yaml +3 −5
  33. Documentation/devicetree/bindings/hwmon/ti,tmp513.yaml +0 −1
  34. Documentation/devicetree/bindings/i2c/i2c-gpio.yaml +0 −2
  35. Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml +0 −3
  36. Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml +2 −2
  37. Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml +1 −1
  38. Documentation/devicetree/bindings/iio/adc/maxim,max9611.yaml +0 −1
  39. Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml +0 −1
  40. Documentation/devicetree/bindings/iio/adc/ti,palmas-gpadc.yaml +0 −2
  41. Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml +26 −15
  42. Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml +0 −1
  43. Documentation/devicetree/bindings/input/adc-keys.txt +20 −2
  44. Documentation/devicetree/bindings/input/touchscreen/goodix.yaml +1 −0
  45. Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml +0 −2
  46. Documentation/devicetree/bindings/leds/richtek,rt8515.yaml +111 −0
  47. Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.txt +1 −1
  48. Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.txt +1 −1
  49. Documentation/devicetree/bindings/media/mediatek-mdp.txt +1 −1
  50. Documentation/devicetree/bindings/mmc/mmc-controller.yaml +0 −1
  51. Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.yaml +0 −2
  52. Documentation/devicetree/bindings/net/ethernet-controller.yaml +0 −2
  53. Documentation/devicetree/bindings/net/renesas,etheravb.yaml +1 −0
  54. Documentation/devicetree/bindings/net/snps,dwmac.yaml +6 −3
  55. Documentation/devicetree/bindings/power/supply/battery.yaml +0 −3
  56. Documentation/devicetree/bindings/power/supply/bq2515x.yaml +0 −1
  57. Documentation/devicetree/bindings/regulator/dlg,da9121.yaml +0 −1
  58. Documentation/devicetree/bindings/regulator/fixed-regulator.yaml +0 −2
  59. Documentation/devicetree/bindings/regulator/nxp,pf8x00-regulator.yaml +4 −2
  60. Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt +1 −0
  61. Documentation/devicetree/bindings/rtc/rtc.yaml +0 −2
  62. Documentation/devicetree/bindings/serial/pl011.yaml +0 −2
  63. Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml +2 −2
  64. Documentation/devicetree/bindings/sound/sgtl5000.yaml +0 −2
  65. Documentation/devicetree/bindings/sound/ti,j721e-cpb-audio.yaml +3 −1
  66. Documentation/devicetree/bindings/sound/ti,j721e-cpb-ivi-audio.yaml +3 −1
  67. Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml +9 −1
  68. Documentation/devicetree/bindings/watchdog/watchdog.yaml +0 −1
  69. Documentation/doc-guide/sphinx.rst +16 −16
  70. Documentation/filesystems/overlayfs.rst +8 −0
  71. Documentation/firmware-guide/acpi/apei/einj.rst +2 −2
  72. Documentation/hwmon/sbtsi_temp.rst +1 −1
  73. Documentation/kbuild/gcc-plugins.rst +21 −26
  74. Documentation/kbuild/llvm.rst +44 −0
  75. Documentation/kbuild/makefiles.rst +2 −2
  76. Documentation/kernel-hacking/locking.rst +4 −4
  77. Documentation/networking/device_drivers/ethernet/marvell/octeontx2.rst +36 −26
  78. Documentation/networking/ip-sysctl.rst +13 −1
  79. Documentation/networking/netdev-FAQ.rst +59 −67
  80. Documentation/networking/netdevices.rst +167 −8
  81. Documentation/networking/packet_mmap.rst +5 −6
  82. Documentation/networking/tls-offload.rst +4 −1
  83. Documentation/process/4.Coding.rst +2 −4
  84. Documentation/sound/alsa-configuration.rst +1 −1
  85. Documentation/sound/kernel-api/writing-an-alsa-driver.rst +8 −8
  86. Documentation/virt/kvm/api.rst +18 −12
  87. Documentation/virt/kvm/nested-vmx.rst +4 −2
  88. Documentation/virt/kvm/running-nested-guests.rst +1 −1
  89. MAINTAINERS +77 −61
  90. Makefile +6 −11
  91. arch/Kconfig +6 −0
  92. arch/arc/Makefile +13 −7
  93. arch/arc/boot/Makefile +4 −14
  94. arch/arc/include/asm/page.h +1 −0
  95. arch/arc/kernel/entry.S +1 −1
  96. arch/arc/plat-hsdk/Kconfig +1 −0
  97. arch/arm/boot/compressed/atags_to_fdt.c +2 −1
  98. arch/arm/boot/dts/imx6q-tbs2910.dts +7 −0
  99. arch/arm/boot/dts/imx6qdl-gw52xx.dtsi +1 −1
  100. arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi +3 −3
  101. arch/arm/boot/dts/imx6qdl-sr-som.dtsi +10 −2
  102. arch/arm/boot/dts/imx7d-flex-concentrator.dts +1 −0
  103. arch/arm/boot/dts/lpc32xx.dtsi +0 −3
  104. arch/arm/boot/dts/omap3-gta04.dtsi +1 −2
  105. arch/arm/boot/dts/omap3-n950-n9.dtsi +8 −0
  106. arch/arm/boot/dts/omap4-droid4-xt894.dts +5 −0
  107. arch/arm/boot/dts/picoxcell-pc3x2.dtsi +4 −0
  108. arch/arm/boot/dts/ste-db8500.dtsi +38 −0
  109. arch/arm/boot/dts/ste-db8520.dtsi +38 −0
  110. arch/arm/boot/dts/ste-db9500.dtsi +35 −0
  111. arch/arm/boot/dts/ste-snowball.dts +1 −1
  112. arch/arm/boot/dts/ste-ux500-samsung-golden.dts +1 −0
  113. arch/arm/boot/dts/stm32mp15xx-dhcom-drc02.dtsi +11 −5
  114. arch/arm/boot/dts/stm32mp15xx-dhcom-picoitx.dtsi +2 −2
  115. arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi +2 −1
  116. arch/arm/boot/dts/sun7i-a20-bananapro.dts +1 −1
  117. arch/arm/configs/omap2plus_defconfig +1 −1
  118. arch/arm/crypto/chacha-glue.c +1 −0
  119. arch/arm/include/asm/kexec-internal.h +12 −0
  120. arch/arm/include/debug/tegra.S +27 −27
  121. arch/arm/kernel/asm-offsets.c +5 −0
  122. arch/arm/kernel/machine_kexec.c +8 −12
  123. arch/arm/kernel/relocate_kernel.S +11 −27
  124. arch/arm/kernel/signal.c +8 −6
  125. arch/arm/mach-footbridge/dc21285.c +6 −6
  126. arch/arm/mach-imx/suspend-imx6.S +1 −0
  127. arch/arm/mach-omap1/board-osk.c +2 −0
  128. arch/arm/mach-omap2/Kconfig +14 −14
  129. arch/arm/mach-omap2/cpuidle44xx.c +8 −8
  130. arch/arm/mach-omap2/omap_device.c +5 −3
  131. arch/arm/mach-omap2/pdata-quirks.c +1 −0
  132. arch/arm/mach-omap2/pmic-cpcap.c +1 −1
  133. arch/arm/xen/enlighten.c +0 −2
  134. arch/arm64/Kconfig +0 −2
  135. arch/arm64/Makefile +7 −3
  136. arch/arm64/boot/dts/amlogic/meson-axg.dtsi +0 −2
  137. arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +1 −3
  138. arch/arm64/boot/dts/amlogic/meson-gx.dtsi +0 −3
  139. arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts +1 −1
  140. arch/arm64/boot/dts/bitmain/bm1880.dtsi +3 −3
  141. arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi +6 −1
  142. arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +1 −1
  143. arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi +1 −1
  144. arch/arm64/boot/dts/freescale/imx8mn.dtsi +1 −1
  145. arch/arm64/boot/dts/freescale/imx8mp.dtsi +1 −1
  146. arch/arm64/boot/dts/qcom/sdm845-db845c.dts +3 −1
  147. arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts +5 −9
  148. arch/arm64/boot/dts/rockchip/px30.dtsi +1 −1
  149. arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +4 −0
  150. arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts +0 −1
  151. arch/arm64/boot/dts/rockchip/rk3399.dtsi +1 −2
  152. arch/arm64/configs/defconfig +1 −3
  153. arch/arm64/include/asm/atomic.h +5 −5
  154. arch/arm64/include/asm/kvm_host.h +23 −0
  155. arch/arm64/include/asm/memory.h +6 −4
  156. arch/arm64/include/asm/uaccess.h +13 −3
  157. arch/arm64/kernel/asm-offsets.c +1 −1
  158. arch/arm64/kernel/cpufeature.c +2 −6
  159. arch/arm64/kernel/entry-ftrace.S +6 −6
  160. arch/arm64/kernel/entry.S +8 −8
  161. arch/arm64/kernel/mte.c +2 −1
  162. arch/arm64/kernel/perf_event.c +2 −39
  163. arch/arm64/kernel/probes/kprobes.c +2 −2
  164. arch/arm64/kernel/probes/kprobes_trampoline.S +3 −3
  165. arch/arm64/kernel/signal.c +0 −7
  166. arch/arm64/kernel/smp.c +1 −2
  167. arch/arm64/kernel/syscall.c +2 −8
  168. arch/arm64/kernel/traps.c +0 −1
  169. arch/arm64/kernel/vdso/Makefile +1 −2
  170. arch/arm64/kernel/vdso/vdso.lds.S +1 −4
  171. arch/arm64/kvm/Kconfig +0 −8
  172. arch/arm64/kvm/Makefile +1 −1
  173. arch/arm64/kvm/arch_timer.c +4 −3
  174. arch/arm64/kvm/arm.c +20 −15
  175. arch/arm64/kvm/hyp/include/hyp/adjust_pc.h +9 −0
  176. arch/arm64/kvm/hyp/nvhe/hyp-init.S +11 −9
  177. arch/arm64/kvm/hyp/nvhe/hyp-main.c +2 −10
  178. arch/arm64/kvm/hyp/nvhe/hyp-smp.c +3 −3
  179. arch/arm64/kvm/hyp/nvhe/psci-relay.c +27 −45
  180. arch/arm64/kvm/pmu-emul.c +7 −5
  181. arch/arm64/kvm/sys_regs.c +60 −37
  182. arch/arm64/kvm/va_layout.c +3 −4
  183. arch/arm64/kvm/vgic/vgic-init.c +10 −1
  184. arch/arm64/kvm/vgic/vgic-v2.c +6 −14
  185. arch/arm64/kvm/vgic/vgic-v3.c +6 −15
  186. arch/arm64/mm/fault.c +4 −3
  187. arch/arm64/mm/init.c +18 −15
  188. arch/arm64/mm/physaddr.c +1 −1
  189. arch/arm64/mm/proc.S +1 −1
  190. arch/h8300/kernel/asm-offsets.c +3 −0
  191. arch/ia64/Makefile +1 −1
  192. arch/ia64/include/asm/sparsemem.h +1 −0
  193. arch/ia64/include/uapi/asm/cmpxchg.h +1 −1
  194. arch/ia64/kernel/time.c +18 −13
  195. arch/ia64/scripts/unwcheck.py +1 −1
  196. arch/m68k/include/asm/page.h +1 −1
  197. arch/mips/boot/compressed/decompress.c +2 −1
  198. arch/mips/cavium-octeon/octeon-irq.c +1 −1
  199. arch/mips/include/asm/highmem.h +1 −0
  200. arch/mips/kernel/binfmt_elfn32.c +7 −0
  201. arch/mips/kernel/binfmt_elfo32.c +7 −0
  202. arch/mips/kernel/relocate.c +8 −2
  203. arch/openrisc/include/asm/io.h +1 −1
  204. arch/openrisc/mm/ioremap.c +1 −1
  205. arch/parisc/Kconfig +2 −3
  206. arch/parisc/include/asm/irq.h +0 −3
  207. arch/parisc/kernel/entry.S +10 −3
  208. arch/powerpc/include/asm/book3s/64/kup.h +11 −5
  209. arch/powerpc/include/asm/book3s/64/pkeys.h +0 −4
  210. arch/powerpc/include/asm/exception-64s.h +13 −0
  211. arch/powerpc/include/asm/feature-fixups.h +10 −0
  212. arch/powerpc/include/asm/highmem.h +2 −0
  213. arch/powerpc/include/asm/vdso/gettimeofday.h +15 −1
  214. arch/powerpc/kernel/Makefile +2 −2
  215. arch/powerpc/kernel/entry_64.S +1 −1
  216. arch/powerpc/kernel/exceptions-64s.S +19 −0
  217. arch/powerpc/kernel/head_book3s_32.S +9 −0
  218. arch/powerpc/kernel/irq.c +16 −12
  219. arch/powerpc/kernel/vdso32/Makefile +1 −4
  220. arch/powerpc/kernel/vdso32_wrapper.S +0 −0
  221. arch/powerpc/kernel/vdso64/Makefile +1 −7
  222. arch/powerpc/kernel/vdso64/sigtramp.S +10 −1
  223. arch/powerpc/kernel/vdso64/vdso64.lds.S +1 −1
  224. arch/powerpc/kernel/vdso64_wrapper.S +0 −0
  225. arch/powerpc/kernel/vmlinux.lds.S +16 −1
  226. arch/powerpc/lib/feature-fixups.c +21 −3
  227. arch/powerpc/lib/sstep.c +8 −6
  228. arch/powerpc/mm/book3s64/pkeys.c +1 −0
  229. arch/riscv/Kconfig +6 −2
  230. arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts +1 −0
  231. arch/riscv/configs/defconfig +2 −0
  232. arch/riscv/include/asm/page.h +4 −1
  233. arch/riscv/include/asm/pgtable.h +0 −1
  234. arch/riscv/include/asm/set_memory.h +3 −3
  235. arch/riscv/include/asm/vdso.h +1 −1
  236. arch/riscv/kernel/cacheinfo.c +10 −1
  237. arch/riscv/kernel/entry.S +13 −11
  238. arch/riscv/kernel/setup.c +16 −12
  239. arch/riscv/kernel/stacktrace.c +2 −3
  240. arch/riscv/kernel/time.c +3 −0
  241. arch/riscv/kernel/vdso.c +1 −1
  242. arch/riscv/mm/init.c +15 −3
  243. arch/riscv/mm/kasan_init.c +2 −2
  244. arch/s390/boot/uv.c +1 −1
  245. arch/s390/include/asm/uv.h +2 −2
  246. arch/s390/kernel/uv.c +1 −1
  247. arch/sh/Kconfig +0 −1
  248. arch/sh/boards/mach-sh03/rtc.c +0 −1
  249. arch/sh/configs/landisk_defconfig +4 −5
  250. arch/sh/configs/microdev_defconfig +0 −2
  251. arch/sh/configs/sdk7780_defconfig +2 −4
  252. arch/sh/configs/sdk7786_defconfig +0 −3
  253. arch/sh/configs/se7750_defconfig +0 −1
  254. arch/sh/configs/sh03_defconfig +0 −3
  255. arch/sh/drivers/dma/Kconfig +1 −2
  256. arch/sh/include/asm/gpio.h +0 −1
  257. arch/sh/kernel/cpu/sh3/entry.S +0 −1
  258. arch/sh/mm/Kconfig +1 −1
  259. arch/sh/mm/asids-debugfs.c +2 −13
  260. arch/sh/mm/cache-debugfs.c +2 −13
  261. arch/sh/mm/pmb.c +2 −13
  262. arch/sparc/include/asm/Kbuild +0 −2
  263. arch/sparc/include/asm/highmem.h +5 −4
  264. arch/um/Kconfig +0 −1
  265. arch/um/drivers/ubd_kern.c +3 −3
  266. arch/um/drivers/virtio_uml.c +2 −1
  267. arch/um/include/asm/io.h +1 −1
  268. arch/um/include/asm/pgtable.h +0 −3
  269. arch/um/include/asm/set_memory.h +0 −1
  270. arch/um/include/shared/kern_util.h +1 −1
  271. arch/um/kernel/kmsg_dump.c +7 −2
  272. arch/um/kernel/process.c +4 −7
  273. arch/um/kernel/time.c +31 −19
  274. arch/um/kernel/tlb.c +0 −54
  275. arch/um/kernel/um_arch.c +19 −3
  276. arch/um/os-Linux/helper.c +2 −2
  277. arch/um/os-Linux/time.c +14 −1
  278. arch/x86/Kconfig +1 −0
  279. arch/x86/Makefile +3 −0
  280. arch/x86/entry/common.c +7 −3
  281. arch/x86/entry/thunk_64.S +5 −10
  282. arch/x86/hyperv/hv_init.c +30 −3
  283. arch/x86/hyperv/mmu.c +9 −3
  284. arch/x86/include/asm/apic.h +0 −10
  285. arch/x86/include/asm/barrier.h +18 −0
  286. arch/x86/include/asm/entry-common.h +0 −2
  287. arch/x86/include/asm/fpu/api.h +13 −2
  288. arch/x86/include/asm/idtentry.h +1 −0
  289. arch/x86/include/asm/intel-family.h +1 −0
  290. arch/x86/include/asm/kvm_host.h +17 −2
  291. arch/x86/include/asm/mshyperv.h +2 −0
  292. arch/x86/include/asm/msr.h +2 −2
  293. arch/x86/include/asm/topology.h +2 −2
  294. arch/x86/kernel/apic/apic.c +4 −0
  295. arch/x86/kernel/apic/x2apic_cluster.c +4 −2
  296. arch/x86/kernel/apic/x2apic_phys.c +6 −3
  297. arch/x86/kernel/cpu/amd.c +2 −2
  298. arch/x86/kernel/cpu/intel.c +1 −0
  299. arch/x86/kernel/cpu/mce/core.c +4 −3
  300. arch/x86/kernel/cpu/mshyperv.c +18 −0
  301. arch/x86/kernel/cpu/mtrr/generic.c +3 −3
  302. arch/x86/kernel/cpu/resctrl/rdtgroup.c +49 −68
  303. arch/x86/kernel/cpu/sgx/driver.c +3 −0
  304. arch/x86/kernel/cpu/sgx/encl.c +5 −0
  305. arch/x86/kernel/cpu/topology.c +1 −1
  306. arch/x86/kernel/fpu/core.c +5 −4
  307. arch/x86/kernel/hw_breakpoint.c +40 −21
  308. arch/x86/kernel/sev-es-shared.c +2 −2
  309. arch/x86/kernel/sev-es.c +13 −1
  310. arch/x86/kernel/smpboot.c +20 −0
  311. arch/x86/kernel/step.c +8 −2
  312. arch/x86/kvm/cpuid.c +1 −1
  313. arch/x86/kvm/emulate.c +2 −0
  314. arch/x86/kvm/kvm_cache_regs.h +25 −26
  315. arch/x86/kvm/lapic.c +2 −2
  316. arch/x86/kvm/mmu.h +9 −2
  317. arch/x86/kvm/mmu/mmu.c +30 −23
  318. arch/x86/kvm/mmu/tdp_mmu.c +57 −62
  319. arch/x86/kvm/mmu/tdp_mmu.h +3 −1
  320. arch/x86/kvm/svm/nested.c +14 −10
  321. arch/x86/kvm/svm/sev.c +39 −17
  322. arch/x86/kvm/svm/svm.c +17 −2
  323. arch/x86/kvm/svm/svm.h +2 −3
  324. arch/x86/kvm/vmx/nested.c +35 −11
  325. arch/x86/kvm/vmx/pmu_intel.c +5 −1
  326. arch/x86/kvm/vmx/vmx.c +17 −4
  327. arch/x86/kvm/x86.c +47 −17
  328. arch/x86/kvm/x86.h +2 −0
  329. arch/x86/lib/mmx_32.c +15 −5
  330. arch/x86/mm/mem_encrypt.c +1 −0
  331. arch/x86/mm/pgtable.c +2 −0
  332. arch/x86/pci/init.c +11 −4
  333. arch/x86/platform/efi/efi_64.c +0 −19
  334. arch/x86/xen/enlighten_hvm.c +12 −3
  335. arch/x86/xen/enlighten_pv.c +14 −1
  336. arch/x86/xen/smp_hvm.c +19 −10
  337. arch/x86/xen/xen-asm.S +1 −0
  338. block/blk-cgroup.c +13 −5
  339. block/blk-iocost.c +11 −5
  340. block/blk-mq-debugfs.c +1 −0
  341. block/blk-mq.h +1 −1
  342. block/genhd.c +10 −6
  343. block/partitions/core.c +5 −3
  344. crypto/asymmetric_keys/asym_tpm.c +1 −1
  345. crypto/asymmetric_keys/public_key.c +2 −1
  346. crypto/ecdh.c +2 −1
  347. crypto/xor.c +2 −0
  348. drivers/acpi/Kconfig +0 −6
  349. drivers/acpi/acpica/nsrepair2.c +13 −4
  350. drivers/acpi/arm64/iort.c +12 −2
  351. drivers/acpi/device_sysfs.c +6 −14
  352. drivers/acpi/internal.h +1 −1
  353. drivers/acpi/nfit/core.c +28 −47
  354. drivers/acpi/scan.c +21 −6
  355. drivers/acpi/thermal.c +33 −13
  356. drivers/acpi/x86/s2idle.c +1 −13
  357. drivers/atm/idt77252.c +1 −1
  358. drivers/base/core.c +39 −14
  359. drivers/base/dd.c +2 −7
  360. drivers/base/platform.c +2 −0
  361. drivers/base/regmap/regmap-debugfs.c +7 −2
  362. drivers/block/Kconfig +1 −0
  363. drivers/block/nbd.c +8 −0
  364. drivers/block/null_blk/zoned.c +9 −7
  365. drivers/block/rnbd/Kconfig +1 −0
  366. drivers/block/rnbd/README +1 −0
  367. drivers/block/rnbd/rnbd-clt.c +9 −9
  368. drivers/block/rnbd/rnbd-srv.c +5 −3
  369. drivers/block/xen-blkfront.c +7 −13
  370. drivers/bus/arm-integrator-lm.c +1 −0
  371. drivers/bus/simple-pm-bus.c +2 −1
  372. drivers/clk/imx/Kconfig +0 −2
  373. drivers/clk/mmp/clk-audio.c +4 −2
  374. drivers/clk/qcom/gcc-sc7180.c +3 −18
  375. drivers/clk/qcom/gcc-sm8250.c +2 −2
  376. drivers/clk/sunxi-ng/ccu_mp.c +1 −1
  377. drivers/clk/tegra/clk-tegra30.c +2 −0
  378. drivers/counter/ti-eqep.c +0 −35
  379. drivers/cpufreq/acpi-cpufreq.c +103 −12
  380. drivers/cpufreq/intel_pstate.c +3 −12
  381. drivers/cpufreq/powernow-k8.c +3 −6
  382. drivers/crypto/Kconfig +1 −0
  383. drivers/crypto/marvell/cesa/cesa.h +2 −2
  384. drivers/dma-buf/dma-buf.c +17 −4
  385. drivers/dma-buf/heaps/cma_heap.c +3 −0
  386. drivers/dma/dmaengine.c +0 −1
  387. drivers/dma/dw-edma/dw-edma-core.c +2 −2
  388. drivers/dma/dw/core.c +0 −6
  389. drivers/dma/idxd/device.c +22 −1
  390. drivers/dma/idxd/dma.c +4 −1
  391. drivers/dma/idxd/idxd.h +1 −1
  392. drivers/dma/idxd/init.c +4 −1
  393. drivers/dma/idxd/irq.c +71 −51
  394. drivers/dma/idxd/sysfs.c +2 −2
  395. drivers/dma/mediatek/mtk-hsdma.c +1 −0
  396. drivers/dma/milbeaut-xdmac.c +3 −1
  397. drivers/dma/qcom/bam_dma.c +1 −5
  398. drivers/dma/qcom/gpi.c +5 −5
  399. drivers/dma/stm32-mdma.c +1 −1
  400. drivers/dma/ti/k3-udma.c +5 −4
  401. drivers/dma/xilinx/xilinx_dma.c +8 −3
  402. drivers/firmware/efi/apple-properties.c +9 −4
  403. drivers/firmware/imx/Kconfig +1 −0
  404. drivers/gpio/Kconfig +6 −2
  405. drivers/gpio/gpio-ep93xx.c +118 −98
  406. drivers/gpio/gpio-mvebu.c +8 −11
  407. drivers/gpio/gpiolib-cdev.c +75 −72
  408. drivers/gpio/gpiolib.c +12 −3
  409. drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +6 −10
  410. drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +36 −17
  411. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 −4
  412. drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +6 −2
  413. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 −0
  414. drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1 −1
  415. drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 −1
  416. drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +17 −8
  417. drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +4 −4
  418. drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +7 −1
  419. drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +65 −5
  420. drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c +62 −24
  421. drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h +1 −1
  422. drivers/gpu/drm/amd/amdgpu/soc15.c +2 −1
  423. drivers/gpu/drm/amd/amdkfd/kfd_crat.c +7 −4
  424. drivers/gpu/drm/amd/display/Kconfig +1 −1
  425. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +29 −161
  426. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +0 −38
  427. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +1 −53
  428. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h +0 −3
  429. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +5 −1
  430. drivers/gpu/drm/amd/display/dc/calcs/Makefile +0 −4
  431. drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile +0 −21
  432. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c +4 −2
  433. drivers/gpu/drm/amd/display/dc/core/dc.c +19 −8
  434. drivers/gpu/drm/amd/display/dc/core/dc_link.c +6 −1
  435. drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +15 −6
  436. drivers/gpu/drm/amd/display/dc/dc_stream.h +1 −2
  437. drivers/gpu/drm/amd/display/dc/dcn10/Makefile +0 −7
  438. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +14 −4
  439. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c +1 −1
  440. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +2 −9
  441. drivers/gpu/drm/amd/display/dc/dcn20/Makefile +0 −4
  442. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +7 −2
  443. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +6 −5
  444. drivers/gpu/drm/amd/display/dc/dcn21/Makefile +0 −4
  445. drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +11 −1
  446. drivers/gpu/drm/amd/display/dc/dcn30/Makefile +4 −7
  447. drivers/gpu/drm/amd/display/dc/dcn301/Makefile +2 −5
  448. drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c +1 −0
  449. drivers/gpu/drm/amd/display/dc/dcn302/Makefile +2 −5
  450. drivers/gpu/drm/amd/display/dc/dml/Makefile +0 −4
  451. drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c +6 −5
  452. drivers/gpu/drm/amd/display/dc/dsc/Makefile +0 −4
  453. drivers/gpu/drm/amd/display/dc/os_types.h +0 −4
  454. drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h +1 −0
  455. drivers/gpu/drm/amd/pm/inc/smu_v11_0.h +3 −0
  456. drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +151 −15
  457. drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.h +3 −0
  458. drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 −7
  459. drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +1 −0
  460. drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1 −0
  461. drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +2 −1
  462. drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +30 −1
  463. drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +5 −1
  464. drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +2 −1
  465. drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c +1 −0
  466. drivers/gpu/drm/bridge/lontium-lt9611uxc.c +45 −12
  467. drivers/gpu/drm/drm_atomic_helper.c +1 −1
  468. drivers/gpu/drm/drm_dp_mst_topology.c +19 −6
  469. drivers/gpu/drm/drm_gem_vram_helper.c +11 −3
  470. drivers/gpu/drm/drm_plane.c +8 −1
  471. drivers/gpu/drm/drm_syncobj.c +5 −3
  472. drivers/gpu/drm/i915/Makefile +1 −0
  473. drivers/gpu/drm/i915/display/icl_dsi.c +0 −4
  474. drivers/gpu/drm/i915/display/intel_ddi.c +31 −21
  475. drivers/gpu/drm/i915/display/intel_display.c +4 −5
  476. drivers/gpu/drm/i915/display/intel_display_types.h +3 −0
  477. drivers/gpu/drm/i915/display/intel_dp.c +12 −25
  478. drivers/gpu/drm/i915/display/intel_dp.h +2 −4
  479. drivers/gpu/drm/i915/display/intel_dp_link_training.c +23 −2
  480. drivers/gpu/drm/i915/display/intel_dp_link_training.h +3 −0
  481. drivers/gpu/drm/i915/display/intel_dp_mst.c +3 −1
  482. drivers/gpu/drm/i915/display/intel_hdcp.c +9 −0
  483. drivers/gpu/drm/i915/display/intel_overlay.c +10 −11
  484. drivers/gpu/drm/i915/display/intel_panel.c +5 −4
  485. drivers/gpu/drm/i915/display/intel_sprite.c +10 −55
  486. drivers/gpu/drm/i915/display/intel_tc.c +37 −30
  487. drivers/gpu/drm/i915/display/vlv_dsi.c +13 −3
  488. drivers/gpu/drm/i915/gem/i915_gem_domain.c +0 −45
  489. drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +3 −1
  490. drivers/gpu/drm/i915/gem/i915_gem_object.h +0 −1
  491. drivers/gpu/drm/i915/gt/gen7_renderclear.c +106 −63
  492. drivers/gpu/drm/i915/gt/intel_breadcrumbs.c +28 −28
  493. drivers/gpu/drm/i915/gt/intel_ggtt.c +35 −12
  494. drivers/gpu/drm/i915/gt/intel_lrc.c +3 −0
  495. drivers/gpu/drm/i915/gt/intel_ring_submission.c +4 −2
  496. drivers/gpu/drm/i915/gt/intel_timeline.c +4 −6
  497. drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c +1 −0
  498. drivers/gpu/drm/i915/gvt/display.c +57 −24
  499. drivers/gpu/drm/i915/gvt/vgpu.c +2 −3
  500. drivers/gpu/drm/i915/i915_active.c +15 −13
  501. drivers/gpu/drm/i915/i915_cmd_parser.c +9 −18
  502. drivers/gpu/drm/i915/i915_drv.c +4 −5
  503. drivers/gpu/drm/i915/i915_drv.h +1 −4
  504. drivers/gpu/drm/i915/i915_mitigations.c +146 −0
  505. drivers/gpu/drm/i915/i915_mitigations.h +13 −0
  506. drivers/gpu/drm/i915/i915_pmu.c +16 −14
  507. drivers/gpu/drm/i915/i915_request.h +32 −5
  508. drivers/gpu/drm/i915/selftests/i915_gem_gtt.c +1 −1
  509. drivers/gpu/drm/msm/adreno/a2xx_gpu.c +4 −2
  510. drivers/gpu/drm/msm/adreno/a3xx_gpu.c +4 −2
  511. drivers/gpu/drm/msm/adreno/a4xx_gpu.c +4 −2
  512. drivers/gpu/drm/msm/adreno/adreno_device.c +4 −0
  513. drivers/gpu/drm/msm/adreno/adreno_gpu.c +12 −9
  514. drivers/gpu/drm/msm/adreno/adreno_gpu.h +6 −0
  515. drivers/gpu/drm/msm/dp/dp_display.c +7 −0
  516. drivers/gpu/drm/msm/dp/dp_panel.c +9 −3
  517. drivers/gpu/drm/msm/msm_drv.c +4 −4
  518. drivers/gpu/drm/msm/msm_gem.c +9 −4
  519. drivers/gpu/drm/nouveau/dispnv50/Kbuild +1 −0
  520. drivers/gpu/drm/nouveau/dispnv50/base507c.c +5 −1
  521. drivers/gpu/drm/nouveau/dispnv50/base827c.c +5 −1
  522. drivers/gpu/drm/nouveau/dispnv50/core.c +1 −0
  523. drivers/gpu/drm/nouveau/dispnv50/curs.c +1 −0
  524. drivers/gpu/drm/nouveau/dispnv50/disp.c +10 −2
  525. drivers/gpu/drm/nouveau/dispnv50/disp.h +1 −1
  526. drivers/gpu/drm/nouveau/dispnv50/head917d.c +27 −1
  527. drivers/gpu/drm/nouveau/dispnv50/wimm.c +1 −0
  528. drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c +1 −1
  529. drivers/gpu/drm/nouveau/dispnv50/wndw.c +14 −4
  530. drivers/gpu/drm/nouveau/dispnv50/wndw.h +8 −0
  531. drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c +5 −5
  532. drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c +106 −0
  533. drivers/gpu/drm/nouveau/include/nvhw/class/cl917d.h +4 −0
  534. drivers/gpu/drm/nouveau/include/nvif/cl0080.h +1 −0
  535. drivers/gpu/drm/nouveau/include/nvif/class.h +5 −0
  536. drivers/gpu/drm/nouveau/include/nvif/push.h +108 −108
  537. drivers/gpu/drm/nouveau/include/nvkm/core/device.h +1 −0
  538. drivers/gpu/drm/nouveau/include/nvkm/engine/disp.h +1 −0
  539. drivers/gpu/drm/nouveau/include/nvkm/subdev/devinit.h +1 −0
  540. drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h +2 −0
  541. drivers/gpu/drm/nouveau/include/nvkm/subdev/gpio.h +1 −0
  542. drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h +1 −0
  543. drivers/gpu/drm/nouveau/include/nvkm/subdev/mc.h +1 −0
  544. drivers/gpu/drm/nouveau/nouveau_backlight.c +1 −0
  545. drivers/gpu/drm/nouveau/nouveau_bo.c +29 −6
  546. drivers/gpu/drm/nouveau/nouveau_svm.c +4 −0
  547. drivers/gpu/drm/nouveau/nvif/disp.c +1 −0
  548. drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +78 −9
  549. drivers/gpu/drm/nouveau/nvkm/engine/device/user.c +1 −0
  550. drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild +3 −0
  551. drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c +27 −6
  552. drivers/gpu/drm/nouveau/nvkm/engine/disp/ga102.c +46 −0
  553. drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h +4 −0
  554. drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h +2 −0
  555. drivers/gpu/drm/nouveau/nvkm/engine/disp/rootga102.c +52 −0
  556. drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h +1 −0
  557. drivers/gpu/drm/nouveau/nvkm/engine/disp/sorga102.c +140 −0
  558. drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c +1 −1
  559. drivers/gpu/drm/nouveau/nvkm/engine/disp/tu102.c +1 −1
  560. drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c +1 −1
  561. drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c +3 −0
  562. drivers/gpu/drm/nouveau/nvkm/subdev/devinit/Kbuild +1 −0
  563. drivers/gpu/drm/nouveau/nvkm/subdev/devinit/ga100.c +76 −0
  564. drivers/gpu/drm/nouveau/nvkm/subdev/devinit/priv.h +1 −0
  565. drivers/gpu/drm/nouveau/nvkm/subdev/devinit/tu102.c +1 −1
  566. drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild +3 −0
  567. drivers/gpu/drm/nouveau/nvkm/subdev/fb/ga100.c +40 −0
  568. drivers/gpu/drm/nouveau/nvkm/subdev/fb/ga102.c +40 −0
  569. drivers/gpu/drm/nouveau/nvkm/subdev/fb/gv100.c +1 −1
  570. drivers/gpu/drm/nouveau/nvkm/subdev/fb/priv.h +2 −0
  571. drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h +1 −0
  572. drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramga102.c +40 −0
  573. drivers/gpu/drm/nouveau/nvkm/subdev/gpio/Kbuild +1 −0
  574. drivers/gpu/drm/nouveau/nvkm/subdev/gpio/ga102.c +118 −0
  575. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/Kbuild +1 −0
  576. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h +7 −0
  577. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c +7 −3
  578. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c +11 −6
  579. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/gk110.c +45 −0
  580. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/gm200.c +7 −0
  581. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.h +1 −1
  582. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/priv.h +4 −0
  583. drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gf100.c +7 −3
  584. drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gk104.c +7 −3
  585. drivers/gpu/drm/nouveau/nvkm/subdev/mc/Kbuild +1 −0
  586. drivers/gpu/drm/nouveau/nvkm/subdev/mc/ga100.c +74 −0
  587. drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c +3 −3
  588. drivers/gpu/drm/radeon/radeon_ttm.c +0 −3
  589. drivers/gpu/drm/sun4i/sun4i_tcon.c +25 −0
  590. drivers/gpu/drm/sun4i/sun4i_tcon.h +6 −0
  591. drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +3 −7
  592. drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h +0 −1
  593. drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c +9 −17
  594. drivers/gpu/drm/ttm/ttm_pool.c +27 −18
  595. drivers/gpu/drm/vc4/vc4_hdmi.c +1 −0
  596. drivers/gpu/drm/vc4/vc4_hvs.c +4 −4
  597. drivers/gpu/drm/vc4/vc4_plane.c +22 −7
  598. drivers/gpu/drm/xlnx/zynqmp_disp.c +7 −8
  599. drivers/hid/Kconfig +1 −0
  600. drivers/hid/amd-sfh-hid/amd_sfh_client.c +4 −4
  601. drivers/hid/amd-sfh-hid/amd_sfh_hid.h +1 −1
  602. drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +1 −1
  603. drivers/hid/amd-sfh-hid/amd_sfh_pcie.h +1 −1
  604. drivers/hid/hid-ids.h +1 −0
  605. drivers/hid/hid-input.c +2 −0
  606. drivers/hid/hid-logitech-dj.c +4 −0
  607. drivers/hid/hid-logitech-hidpp.c +2 −0
  608. drivers/hid/hid-multitouch.c +6 −1
  609. drivers/hid/hid-uclogic-params.c +1 −1
  610. drivers/hid/hid-wiimote-core.c +1 −1
  611. drivers/hid/wacom_sys.c +35 −5
  612. drivers/hid/wacom_wac.h +1 −1
  613. drivers/hv/vmbus_drv.c +0 −2
  614. drivers/hwmon/amd_energy.c +2 −1
  615. drivers/hwmon/pwm-fan.c +11 −1
  616. drivers/hwtracing/intel_th/pci.c +5 −0
  617. drivers/hwtracing/stm/heartbeat.c +4 −2
  618. drivers/i2c/busses/Kconfig +1 −0
  619. drivers/i2c/busses/i2c-i801.c +1 −1
  620. drivers/i2c/busses/i2c-imx.c +19 −1
  621. drivers/i2c/busses/i2c-mt65xx.c +38 −8
  622. drivers/i2c/busses/i2c-octeon-core.c +1 −1
  623. drivers/i2c/busses/i2c-sprd.c +7 −1
  624. drivers/i2c/busses/i2c-stm32f7.c +10 −1
  625. drivers/i2c/busses/i2c-tegra-bpmp.c +1 −1
  626. drivers/i2c/busses/i2c-tegra.c +22 −2
  627. drivers/i3c/master/mipi-i3c-hci/core.c +1 −1
  628. drivers/iio/adc/ti_am335x_adc.c +1 −5
  629. drivers/iio/common/st_sensors/st_sensors_trigger.c +17 −14
  630. drivers/iio/dac/ad5504.c +2 −2
  631. drivers/iio/proximity/sx9310.c +3 −2
  632. drivers/iio/temperature/mlx90632.c +6 −0
  633. drivers/infiniband/core/cma_configfs.c +3 −1
  634. drivers/infiniband/core/restrack.c +1 −0
  635. drivers/infiniband/core/ucma.c +72 −63
  636. drivers/infiniband/core/umem.c +1 −1
  637. drivers/infiniband/hw/cxgb4/qp.c +1 −1
  638. drivers/infiniband/hw/hns/hns_roce_device.h +1 −1
  639. drivers/infiniband/hw/hns/hns_roce_qp.c +6 −5
  640. drivers/infiniband/hw/mlx5/main.c +4 −6
  641. drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +1 −1
  642. drivers/infiniband/hw/usnic/usnic_ib_sysfs.c +3 −4
  643. drivers/infiniband/hw/usnic/usnic_ib_verbs.c +3 −0
  644. drivers/infiniband/hw/vmw_pvrdma/pvrdma.h +14 −0
  645. drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c +1 −1
  646. drivers/infiniband/sw/rxe/rxe_net.c +6 −0
  647. drivers/infiniband/sw/rxe/rxe_resp.c +5 −0
  648. drivers/input/joystick/xpad.c +16 −1
  649. drivers/input/misc/ariel-pwrbutton.c +0 −6
  650. drivers/input/serio/i8042-x86ia64io.h +2 −0
  651. drivers/input/touchscreen/goodix.c +2 −0
  652. drivers/input/touchscreen/ili210x.c +19 −7
  653. drivers/input/touchscreen/st1232.c +42 −6
  654. drivers/interconnect/imx/imx.c +2 −1
  655. drivers/interconnect/imx/imx8mq.c +2 −0
  656. drivers/interconnect/qcom/Kconfig +15 −8
  657. drivers/iommu/amd/amd_iommu.h +2 −5
  658. drivers/iommu/amd/amd_iommu_types.h +4 −0
  659. drivers/iommu/amd/init.c +55 −4
  660. drivers/iommu/amd/iommu.c +3 −0
  661. drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +4 −0
  662. drivers/iommu/dma-iommu.c +0 −27
  663. drivers/iommu/intel/dmar.c +3 −3
  664. drivers/iommu/intel/iommu.c +139 −42
  665. drivers/iommu/intel/irq_remapping.c +2 −0
  666. drivers/iommu/intel/svm.c +33 −12
  667. drivers/iommu/iova.c +4 −4
  668. drivers/irqchip/Kconfig +3 −2
  669. drivers/irqchip/irq-bcm2836.c +2 −2
  670. drivers/irqchip/irq-loongson-liointc.c +2 −2
  671. drivers/irqchip/irq-mips-cpu.c +7 −0
  672. drivers/irqchip/irq-sl28cpld.c +1 −1
  673. drivers/isdn/mISDN/Kconfig +1 −0
  674. drivers/leds/Kconfig +3 −0
  675. drivers/leds/Makefile +3 −0
  676. drivers/leds/flash/Kconfig +16 −0
  677. drivers/leds/flash/Makefile +3 −0
  678. drivers/leds/flash/leds-rt8515.c +397 −0
  679. drivers/leds/led-triggers.c +6 −4
  680. drivers/leds/leds-ariel.c +3 −3
  681. drivers/leds/leds-lm3533.c +1 −1
  682. drivers/lightnvm/Kconfig +1 −0
  683. drivers/lightnvm/core.c +1 −2
  684. drivers/md/Kconfig +2 −0
  685. drivers/md/bcache/features.c +1 −1
  686. drivers/md/bcache/features.h +31 −5
  687. drivers/md/bcache/super.c +49 −4
  688. drivers/md/dm-bufio.c +6 −0
  689. drivers/md/dm-crypt.c +152 −18
  690. drivers/md/dm-integrity.c +79 −13
  691. drivers/md/dm-raid.c +3 −3
  692. drivers/md/dm-snap.c +24 −0
  693. drivers/md/dm-table.c +12 −3
  694. drivers/md/dm.c +1 −1
  695. drivers/md/md.c +2 −0
  696. drivers/media/cec/platform/Makefile +1 −0
  697. drivers/media/common/videobuf2/videobuf2-v4l2.c +1 −2
  698. drivers/media/i2c/ccs-pll.c +1 −7
  699. drivers/media/i2c/ccs/ccs-data.c +1 −1
  700. drivers/media/pci/intel/ipu3/ipu3-cio2.c +1 −1
  701. drivers/media/platform/qcom/venus/core.c +2 −0
  702. drivers/media/platform/rcar-vin/rcar-core.c +1 −1
  703. drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c +12 −9
  704. drivers/media/platform/rockchip/rkisp1/rkisp1-params.c +3 −2
  705. drivers/media/platform/rockchip/rkisp1/rkisp1-regs.h +1 −0
  706. drivers/media/platform/rockchip/rkisp1/rkisp1-stats.c +6 −5
  707. drivers/media/rc/ir-mce_kbd-decoder.c +1 −1
  708. drivers/media/rc/ite-cir.c +1 −1
  709. drivers/media/rc/rc-main.c +4 −4
  710. drivers/media/rc/serial_ir.c +1 −1
  711. drivers/media/v4l2-core/v4l2-common.c +2 −2
  712. drivers/misc/cardreader/rtsx_pcr.c +6 −1
  713. drivers/misc/habanalabs/common/command_submission.c +58 −19
  714. drivers/misc/habanalabs/common/device.c +15 −4
  715. drivers/misc/habanalabs/common/firmware_if.c +49 −16
  716. drivers/misc/habanalabs/common/habanalabs.h +4 −1
  717. drivers/misc/habanalabs/common/habanalabs_drv.c +1 −0
  718. drivers/misc/habanalabs/common/habanalabs_ioctl.c +8 −1
  719. drivers/misc/habanalabs/common/hw_queue.c +4 −1
  720. drivers/misc/habanalabs/common/memory.c +8 −2
  721. drivers/misc/habanalabs/common/mmu.c +3 −3
  722. drivers/misc/habanalabs/common/mmu_v1.c +10 −2
  723. drivers/misc/habanalabs/common/pci.c +17 −11
  724. drivers/misc/habanalabs/gaudi/gaudi.c +85 −109
  725. drivers/misc/habanalabs/gaudi/gaudiP.h +0 −7
  726. drivers/misc/habanalabs/gaudi/gaudi_coresight.c +2 −1
  727. drivers/misc/habanalabs/goya/goya.c +47 −31
  728. drivers/misc/habanalabs/include/common/hl_boot_if.h +8 −1
  729. drivers/misc/pvpanic.c +15 −4
  730. drivers/mmc/core/queue.c +3 −1
  731. drivers/mmc/core/sdio_cis.c +6 −0
  732. drivers/mmc/host/sdhci-brcmstb.c +1 −5
  733. drivers/mmc/host/sdhci-of-dwcmshc.c +27 −0
  734. drivers/mmc/host/sdhci-pltfm.h +6 −1
  735. drivers/mmc/host/sdhci-xenon.c +6 −1
  736. drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +1 −1
  737. drivers/mtd/nand/raw/intel-nand-controller.c +3 −2
  738. drivers/mtd/nand/raw/nandsim.c +3 −4
  739. drivers/mtd/nand/raw/omap2.c +9 −6
  740. drivers/mtd/nand/spi/core.c +11 −3
  741. drivers/net/arcnet/arc-rimi.c +2 −2
  742. drivers/net/arcnet/arcdevice.h +6 −0
  743. drivers/net/arcnet/arcnet.c +62 −4
  744. drivers/net/arcnet/com20020-isa.c +2 −2
  745. drivers/net/arcnet/com20020-pci.c +1 −1
  746. drivers/net/arcnet/com20020_cs.c +1 −1
  747. drivers/net/arcnet/com90io.c +2 −2
  748. drivers/net/arcnet/com90xx.c +2 −2
  749. drivers/net/bareudp.c +16 −9
  750. drivers/net/can/Kconfig +1 −0
  751. drivers/net/can/dev.c +3 −3
  752. drivers/net/can/m_can/m_can.c +0 −2
  753. drivers/net/can/m_can/tcan4x5x.c +0 −26
  754. drivers/net/can/rcar/Kconfig +2 −2
  755. drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +9 −10
  756. drivers/net/can/usb/peak_usb/pcan_usb_fd.c +4 −4
  757. drivers/net/can/vxcan.c +4 −2
  758. drivers/net/dsa/b53/b53_common.c +1 −1
  759. drivers/net/dsa/bcm_sf2.c +6 −2
  760. drivers/net/dsa/hirschmann/Kconfig +1 −0
  761. drivers/net/dsa/lantiq_gswip.c +11 −23
  762. drivers/net/dsa/microchip/ksz8795.c +20 −10
  763. drivers/net/dsa/microchip/ksz_common.c +2 −2
  764. drivers/net/dsa/mv88e6xxx/chip.c +5 −1
  765. drivers/net/dsa/mv88e6xxx/global1_vtu.c +4 −0
  766. drivers/net/dsa/ocelot/felix.c +16 −1
  767. drivers/net/ethernet/amazon/ena/ena_netdev.c +5 −1
  768. drivers/net/ethernet/aquantia/Kconfig +0 −1
  769. drivers/net/ethernet/broadcom/bcmsysport.c +5 −2
  770. drivers/net/ethernet/broadcom/bnxt/bnxt.c +19 −19
  771. drivers/net/ethernet/broadcom/bnxt/bnxt.h +6 −1
  772. drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +2 −1
  773. drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +6 −2
  774. drivers/net/ethernet/cadence/macb_main.c +1 −1
  775. drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h +1 −0
  776. drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h +7 −0
  777. drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls.h +4 −0
  778. drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c +56 −52
  779. drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_hw.c +41 −0
  780. drivers/net/ethernet/ethoc.c +2 −1
  781. drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +38 −4
  782. drivers/net/ethernet/freescale/enetc/enetc_hw.h +2 −0
  783. drivers/net/ethernet/freescale/enetc/enetc_pf.c +59 −0
  784. drivers/net/ethernet/freescale/fec.h +5 −0
  785. drivers/net/ethernet/freescale/fec_main.c +6 −3
  786. drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c +1 −0
  787. drivers/net/ethernet/freescale/fs_enet/mii-fec.c +1 −0
  788. drivers/net/ethernet/freescale/ucc_geth.c +2 −1
  789. drivers/net/ethernet/freescale/ucc_geth.h +8 −1
  790. drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +4 −0
  791. drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h +2 −2
  792. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +13 −3
  793. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h +2 −0
  794. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c +25 −4
  795. drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +6 −3
  796. drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h +2 −0
  797. drivers/net/ethernet/ibm/ibmvnic.c +27 −11
  798. drivers/net/ethernet/intel/e1000e/e1000.h +1 −0
  799. drivers/net/ethernet/intel/e1000e/ethtool.c +46 −0
  800. drivers/net/ethernet/intel/e1000e/ich8lan.c +14 −3
  801. drivers/net/ethernet/intel/e1000e/netdev.c +10 −49
  802. drivers/net/ethernet/intel/i40e/i40e.h +3 −0
  803. drivers/net/ethernet/intel/i40e/i40e_main.c +10 −0
  804. drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +7 −21
  805. drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h +0 −1
  806. drivers/net/ethernet/intel/i40e/i40e_xsk.c +1 −1
  807. drivers/net/ethernet/intel/iavf/iavf_main.c +1 −3
  808. drivers/net/ethernet/intel/ice/ice.h +3 −1
  809. drivers/net/ethernet/intel/ice/ice_ethtool.c +4 −4
  810. drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c +7 −1
  811. drivers/net/ethernet/intel/ice/ice_lib.c +9 −5
  812. drivers/net/ethernet/intel/ice/ice_main.c +9 −7
  813. drivers/net/ethernet/intel/ice/ice_txrx.c +6 −3
  814. drivers/net/ethernet/intel/igc/igc_ethtool.c +20 −7
  815. drivers/net/ethernet/intel/igc/igc_i225.c +1 −2
  816. drivers/net/ethernet/intel/igc/igc_mac.c +1 −1
  817. drivers/net/ethernet/marvell/mvneta.c +2 −2
  818. drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +20 −9
  819. drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c +41 −7
  820. drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.h +1 −1
  821. drivers/net/ethernet/marvell/octeontx2/af/cgx.c +11 −3
  822. drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +6 −0
  823. drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +2 −1
  824. drivers/net/ethernet/mellanox/mlx5/core/en/health.c +1 −1
  825. drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c +5 −0
  826. drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +62 −35
  827. drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h +9 −0
  828. drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h +5 −3
  829. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_stats.c +2 −2
  830. drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +8 −5
  831. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +25 −7
  832. drivers/net/ethernet/mellanox/mlx5/core/en_fs.c +3 −0
  833. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +33 −15
  834. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +2 −0
  835. drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +12 −4
  836. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +17 −5
  837. drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +5 −4
  838. drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c +13 −14
  839. drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +6 −0
  840. drivers/net/ethernet/mellanox/mlx5/core/lag.c +5 −6
  841. drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h +5 −0
  842. drivers/net/ethernet/mellanox/mlx5/core/main.c +5 −2
  843. drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +34 −24
  844. drivers/net/ethernet/mellanox/mlx5/core/rdma.c +1 −1
  845. drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +8 −5
  846. drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c +6 −0
  847. drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h +1 −0
  848. drivers/net/ethernet/mscc/ocelot.c +72 −5
  849. drivers/net/ethernet/mscc/ocelot_io.c +8 −0
  850. drivers/net/ethernet/mscc/ocelot_net.c +1 −3
  851. drivers/net/ethernet/natsemi/macsonic.c +10 −2
  852. drivers/net/ethernet/natsemi/xtsonic.c +5 −2
  853. drivers/net/ethernet/pensando/ionic/ionic_txrx.c +1 −1
  854. drivers/net/ethernet/qlogic/Kconfig +1 −0
  855. drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +1 −6
  856. drivers/net/ethernet/qlogic/qede/qede_fp.c +5 −0
  857. drivers/net/ethernet/realtek/r8169_main.c +71 −10
  858. drivers/net/ethernet/renesas/sh_eth.c +28 −2
  859. drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c +2 −2
  860. drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +6 −0
  861. drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +1 −1
  862. drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +82 −47
  863. drivers/net/ethernet/stmicro/stmmac/dwmac5.c +4 −48
  864. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +4 −3
  865. drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c +24 −3
  866. drivers/net/ethernet/ti/cpts.c +2 −0
  867. drivers/net/hyperv/netvsc.c +4 −1
  868. drivers/net/hyperv/rndis_filter.c +0 −2
  869. drivers/net/ipa/gsi.c +72 −60
  870. drivers/net/ipa/ipa_clock.c +2 −2
  871. drivers/net/ipa/ipa_endpoint.c +3 −3
  872. drivers/net/ipa/ipa_mem.c +2 −2
  873. drivers/net/ipa/ipa_modem.c +1 −0
  874. drivers/net/mdio/mdio-bitbang.c +4 −2
  875. drivers/net/phy/smsc.c +2 −1
  876. drivers/net/ppp/ppp_generic.c +9 −3
  877. drivers/net/team/team.c +3 −3
  878. drivers/net/tun.c +1 −1
  879. drivers/net/usb/Kconfig +0 −1
  880. drivers/net/usb/cdc_ether.c +13 −0
  881. drivers/net/usb/cdc_ncm.c +17 −6
  882. drivers/net/usb/qmi_wwan.c +3 −0
  883. drivers/net/usb/r8152.c +1 −0
  884. drivers/net/usb/r8153_ecm.c +8 −0
  885. drivers/net/usb/rndis_host.c +1 −1
  886. drivers/net/virtio_net.c +7 −5
  887. drivers/net/wan/Kconfig +1 −0
  888. drivers/net/wan/hdlc_ppp.c +7 −0
  889. drivers/net/wan/hdlc_x25.c +3 −3
  890. drivers/net/wireless/ath/ath11k/core.c +1 −1
  891. drivers/net/wireless/ath/ath11k/dp_rx.c +7 −3
  892. drivers/net/wireless/ath/ath11k/mac.c +6 −2
  893. drivers/net/wireless/ath/ath11k/pci.c +40 −4
  894. drivers/net/wireless/ath/ath11k/pci.h +2 −0
  895. drivers/net/wireless/ath/ath11k/peer.c +17 −0
  896. drivers/net/wireless/ath/ath11k/peer.h +2 −0
  897. drivers/net/wireless/ath/ath11k/qmi.c +22 −2
  898. drivers/net/wireless/ath/ath11k/qmi.h +1 −0
  899. drivers/net/wireless/ath/ath11k/wmi.c +3 −0
  900. drivers/net/wireless/ath/ath9k/Kconfig +2 −6
  901. drivers/net/wireless/ath/wil6210/Kconfig +1 −0
  902. drivers/net/wireless/intel/iwlwifi/cfg/22000.c +25 −0
  903. drivers/net/wireless/intel/iwlwifi/fw/acpi.c +50 −15
  904. drivers/net/wireless/intel/iwlwifi/fw/acpi.h +4 −3
  905. drivers/net/wireless/intel/iwlwifi/fw/pnvm.c +31 −25
  906. drivers/net/wireless/intel/iwlwifi/iwl-config.h +5 −2
  907. drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +0 −7
  908. drivers/net/wireless/intel/iwlwifi/iwl-io.c +5 −4
  909. drivers/net/wireless/intel/iwlwifi/iwl-io.h +8 −2
  910. drivers/net/wireless/intel/iwlwifi/iwl-prph.h +6 −0
  911. drivers/net/wireless/intel/iwlwifi/mvm/d3.c +3 −3
  912. drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c +3 −0
  913. drivers/net/wireless/intel/iwlwifi/mvm/fw.c +14 −11
  914. drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +3 −0
  915. drivers/net/wireless/intel/iwlwifi/mvm/ops.c +6 −1
  916. drivers/net/wireless/intel/iwlwifi/mvm/sta.c +6 −0
  917. drivers/net/wireless/intel/iwlwifi/mvm/tx.c +3 −0
  918. drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c +34 −19
  919. drivers/net/wireless/intel/iwlwifi/pcie/drv.c +10 −0
  920. drivers/net/wireless/intel/iwlwifi/pcie/trans.c +8 −6
  921. drivers/net/wireless/intel/iwlwifi/pcie/tx.c +5 −0
  922. drivers/net/wireless/intel/iwlwifi/queue/tx.c +26 −29
  923. drivers/net/wireless/mediatek/mt76/dma.c +5 −3
  924. drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +1 −1
  925. drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c +4 −5
  926. drivers/net/wireless/mediatek/mt76/mt7915/init.c +2 −2
  927. drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +5 −5
  928. drivers/net/wireless/mediatek/mt76/sdio.c +7 −12
  929. drivers/net/wireless/mediatek/mt76/usb.c +2 −7
  930. drivers/net/wireless/mediatek/mt7601u/dma.c +2 −3
  931. drivers/net/wireless/realtek/rtlwifi/core.c +5 −3
  932. drivers/net/xen-netback/rx.c +8 −1
  933. drivers/nvdimm/dimm_devs.c +15 −3
  934. drivers/nvdimm/namespace_devs.c +5 −5
  935. drivers/nvdimm/pmem.c +0 −1
  936. drivers/nvme/host/core.c +27 −11
  937. drivers/nvme/host/fc.c +14 −1
  938. drivers/nvme/host/multipath.c +1 −1
  939. drivers/nvme/host/nvme.h +2 −7
  940. drivers/nvme/host/pci.c +93 −42
  941. drivers/nvme/host/rdma.c +11 −4
  942. drivers/nvme/host/tcp.c +23 −7
  943. drivers/nvme/target/admin-cmd.c +6 −2
  944. drivers/nvme/target/fcloop.c +4 −3
  945. drivers/nvme/target/rdma.c +18 −8
  946. drivers/nvme/target/tcp.c +2 −1
  947. drivers/of/device.c +7 −3
  948. drivers/pci/pci.c +0 −7
  949. drivers/pci/pci.h +0 −4
  950. drivers/pci/pcie/aspm.c +0 −44
  951. drivers/perf/arm_pmu.c +0 −5
  952. drivers/phy/ingenic/Makefile +1 −1
  953. drivers/phy/mediatek/Kconfig +3 −1
  954. drivers/phy/motorola/phy-cpcap-usb.c +13 −6
  955. drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c +1 −1
  956. drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c +4 −0
  957. drivers/pinctrl/nomadik/pinctrl-nomadik.c +0 −1
  958. drivers/pinctrl/pinctrl-ingenic.c +40 −40
  959. drivers/pinctrl/qcom/pinctrl-msm.c +60 −36
  960. drivers/pinctrl/qcom/pinctrl-msm.h +2 −0
  961. drivers/platform/surface/Kconfig +4 −4
  962. drivers/platform/surface/surface_gpe.c +2 −2
  963. drivers/platform/x86/amd-pmc.c +1 −1
  964. drivers/platform/x86/dell-wmi-sysman/sysman.c +5 −1
  965. drivers/platform/x86/hp-wmi.c +12 −5
  966. drivers/platform/x86/i2c-multi-instantiate.c +23 −8
  967. drivers/platform/x86/ideapad-laptop.c +14 −1
  968. drivers/platform/x86/intel-vbtn.c +5 −5
  969. drivers/platform/x86/thinkpad_acpi.c +3 −2
  970. drivers/platform/x86/touchscreen_dmi.c +18 −0
  971. drivers/ptp/Kconfig +2 −0
  972. drivers/regulator/Kconfig +1 −0
  973. drivers/regulator/bd718x7-regulator.c +57 −0
  974. drivers/regulator/core.c +33 −11
  975. drivers/regulator/pf8x00-regulator.c +6 −2
  976. drivers/regulator/qcom-rpmh-regulator.c +1 −1
  977. drivers/rtc/rtc-cmos.c +8 −0
  978. drivers/rtc/rtc-mc146818-lib.c +7 −0
  979. drivers/s390/block/dasd_devmap.c +14 −6
  980. drivers/s390/block/dasd_eckd.c +2 −1
  981. drivers/s390/block/dasd_int.h +1 −1
  982. drivers/s390/crypto/vfio_ap_drv.c +1 −5
  983. drivers/s390/crypto/vfio_ap_ops.c +90 −59
  984. drivers/s390/crypto/vfio_ap_private.h +6 −6
  985. drivers/s390/net/qeth_core.h +2 −1
  986. drivers/s390/net/qeth_core_main.c +25 −13
  987. drivers/s390/net/qeth_l2_main.c +1 −1
  988. drivers/s390/net/qeth_l3_main.c +2 −2
  989. drivers/scsi/fnic/vnic_dev.c +5 −3
  990. drivers/scsi/hisi_sas/hisi_sas.h +4 −0
  991. drivers/scsi/hisi_sas/hisi_sas_main.c +11 −0
  992. drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +53 −13
  993. drivers/scsi/ibmvscsi/ibmvfc.c +5 −3
  994. drivers/scsi/libfc/fc_exch.c +14 −2
  995. drivers/scsi/lpfc/lpfc_nvme.c +3 −0
  996. drivers/scsi/megaraid/megaraid_sas_base.c +41 −4
  997. drivers/scsi/megaraid/megaraid_sas_fusion.c +16 −13
  998. drivers/scsi/mpt3sas/Kconfig +1 −1
  999. drivers/scsi/qedi/qedi_main.c +2 −2
  1000. drivers/scsi/qla2xxx/qla_os.c +1 −1
  1001. drivers/scsi/scsi_debug.c +4 −2
  1002. drivers/scsi/scsi_transport_srp.c +8 −1
  1003. drivers/scsi/sd.c +3 −3
  1004. drivers/scsi/ufs/Kconfig +1 −0
  1005. drivers/scsi/ufs/ufshcd.c +35 −26
  1006. drivers/sh/intc/core.c +1 −1
  1007. drivers/sh/intc/virq-debugfs.c +2 −12
  1008. drivers/soc/atmel/soc.c +13 −0
  1009. drivers/soc/imx/Kconfig +1 −1
  1010. drivers/soc/litex/Kconfig +1 −0
  1011. drivers/soc/litex/litex_soc_ctrl.c +2 −1
  1012. drivers/soc/sunxi/sunxi_mbus.c +0 −5
  1013. drivers/soc/ti/omap_prm.c +11 −0
  1014. drivers/spi/spi-altera.c +16 −13
  1015. drivers/spi/spi-cadence.c +4 −2
  1016. drivers/spi/spi-fsl-spi.c +2 −3
  1017. drivers/spi/spi-geni-qcom.c +80 −4
  1018. drivers/spi/spi-stm32.c +2 −2
  1019. drivers/spi/spi.c +8 −3
  1020. drivers/spi/spidev.c +1 −0
  1021. drivers/staging/comedi/comedi_fops.c +3 −1
  1022. drivers/staging/hikey9xx/hisi-spmi-controller.c +15 −6
  1023. drivers/staging/media/atomisp/pci/atomisp_subdev.c +0 −20
  1024. drivers/staging/media/hantro/hantro_v4l2.c +1 −1
  1025. drivers/staging/media/sunxi/cedrus/cedrus_h264.c +1 −1
  1026. drivers/staging/mt7621-dma/mtk-hsdma.c +3 −1
  1027. drivers/staging/rtl8723bs/include/rtw_wifi_regd.h +3 −3
  1028. drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +3 −3
  1029. drivers/staging/rtl8723bs/os_dep/sdio_intf.c +2 −2
  1030. drivers/staging/rtl8723bs/os_dep/wifi_regd.c +3 −7
  1031. drivers/target/iscsi/iscsi_target_login.c +1 −1
  1032. drivers/target/target_core_user.c +8 −3
  1033. drivers/target/target_core_xcopy.c +70 −49
  1034. drivers/target/target_core_xcopy.h +1 −0
  1035. drivers/tee/optee/call.c +3 −1
  1036. drivers/thunderbolt/acpi.c +1 −1
  1037. drivers/thunderbolt/icm.c +1 −1
  1038. drivers/tty/Kconfig +14 −0
  1039. drivers/tty/Makefile +2 −1
  1040. drivers/tty/n_tty.c +2 −5
  1041. drivers/tty/serial/mvebu-uart.c +9 −1
  1042. drivers/tty/serial/sifive.c +1 −0
  1043. drivers/tty/tty_io.c +41 −24
  1044. drivers/tty/ttynull.c +0 −18
  1045. drivers/usb/cdns3/cdns3-imx.c +11 −11
  1046. drivers/usb/chipidea/ci_hdrc_imx.c +5 −1
  1047. drivers/usb/class/cdc-acm.c +4 −0
  1048. drivers/usb/class/cdc-wdm.c +13 −3
  1049. drivers/usb/class/usblp.c +30 −10
  1050. drivers/usb/core/hcd.c +3 −5
  1051. drivers/usb/dwc2/gadget.c +1 −7
  1052. drivers/usb/dwc3/core.c +1 −1
  1053. drivers/usb/dwc3/core.h +1 −0
  1054. drivers/usb/dwc3/dwc3-meson-g12a.c +1 −1
  1055. drivers/usb/dwc3/gadget.c +5 −11
  1056. drivers/usb/dwc3/ulpi.c +21 −17
  1057. drivers/usb/gadget/Kconfig +2 −0
  1058. drivers/usb/gadget/composite.c +8 −2
  1059. drivers/usb/gadget/configfs.c +13 −6
  1060. drivers/usb/gadget/function/f_printer.c +1 −0
  1061. drivers/usb/gadget/function/f_uac2.c +55 −14
  1062. drivers/usb/gadget/function/u_ether.c +5 −4
  1063. drivers/usb/gadget/legacy/acm_ms.c +3 −1
  1064. drivers/usb/gadget/legacy/ether.c +3 −1
  1065. drivers/usb/gadget/udc/Kconfig +1 −1
  1066. drivers/usb/gadget/udc/Makefile +0 −1
  1067. drivers/usb/gadget/udc/aspeed-vhub/epn.c +4 −1
  1068. drivers/usb/gadget/udc/aspeed-vhub/hub.c +3 −1
  1069. drivers/usb/gadget/udc/bdc/Kconfig +1 −1
  1070. drivers/usb/gadget/udc/core.c +11 −5
  1071. drivers/usb/gadget/udc/dummy_hcd.c +30 −15
  1072. drivers/usb/gadget/udc/fsl_mxc_udc.c +0 −122
  1073. drivers/usb/host/ehci-hcd.c +12 −0
  1074. drivers/usb/host/ehci-hub.c +3 −0
  1075. drivers/usb/host/xhci-mtk-sch.c +93 −37
  1076. drivers/usb/host/xhci-mtk.c +2 −0
  1077. drivers/usb/host/xhci-mtk.h +15 −0
  1078. drivers/usb/host/xhci-mvebu.c +42 −0
  1079. drivers/usb/host/xhci-mvebu.h +6 −0
  1080. drivers/usb/host/xhci-plat.c +19 −1
  1081. drivers/usb/host/xhci-plat.h +1 −0
  1082. drivers/usb/host/xhci-ring.c +22 −11
  1083. drivers/usb/host/xhci-tegra.c +7 −0
  1084. drivers/usb/host/xhci.c +18 −14
  1085. drivers/usb/host/xhci.h +4 −0
  1086. drivers/usb/misc/yurex.c +3 −0
  1087. drivers/usb/renesas_usbhs/fifo.c +1 −0
  1088. drivers/usb/serial/cp210x.c +2 −0
  1089. drivers/usb/serial/iuu_phoenix.c +15 −5
  1090. drivers/usb/serial/option.c +9 −0
  1091. drivers/usb/storage/unusual_uas.h +7 −0
  1092. drivers/usb/typec/altmodes/Kconfig +1 −1
  1093. drivers/usb/typec/class.c +2 −0
  1094. drivers/usb/typec/mux/intel_pmc_mux.c +11 −0
  1095. drivers/usb/usbip/vhci_hcd.c +2 −0
  1096. drivers/vdpa/mlx5/core/mlx5_vdpa.h +1 −0
  1097. drivers/vdpa/mlx5/core/mr.c +12 −16
  1098. drivers/vdpa/mlx5/net/mlx5_vnet.c +18 −0
  1099. drivers/vhost/net.c +3 −3
  1100. drivers/vhost/vsock.c +65 −3
  1101. drivers/xen/events/events_base.c +0 −10
  1102. drivers/xen/platform-pci.c +7 −1
  1103. drivers/xen/privcmd.c +19 −6
  1104. drivers/xen/xenbus/xenbus_comms.c +0 −8
  1105. drivers/xen/xenbus/xenbus_probe.c +97 −13
  1106. fs/Kconfig +1 −1
  1107. fs/afs/dir.c +26 −23
  1108. fs/afs/dir_edit.c +2 −4
  1109. fs/afs/main.c +3 −3
  1110. fs/afs/xdr_fs.h +21 −4
  1111. fs/block_dev.c +14 −3
  1112. fs/btrfs/backref.c +1 −1
  1113. fs/btrfs/block-group.c +11 −2
  1114. fs/btrfs/btrfs_inode.h +9 −0
  1115. fs/btrfs/ctree.c +22 −2
  1116. fs/btrfs/ctree.h +30 −2
  1117. fs/btrfs/dev-replace.c +1 −1
  1118. fs/btrfs/discard.c +36 −34
  1119. fs/btrfs/disk-io.c +11 −7
  1120. fs/btrfs/extent-tree.c +29 −44
  1121. fs/btrfs/extent_io.c +1 −3
  1122. fs/btrfs/file-item.c +2 −0
  1123. fs/btrfs/free-space-tree.c +9 −1
  1124. fs/btrfs/inode.c +51 −18
  1125. fs/btrfs/ioctl.c +1 −1
  1126. fs/btrfs/print-tree.c +5 −5
  1127. fs/btrfs/print-tree.h +1 −1
  1128. fs/btrfs/qgroup.c +30 −13
  1129. fs/btrfs/reflink.c +15 −0
  1130. fs/btrfs/relocation.c +6 −1
  1131. fs/btrfs/send.c +46 −18
  1132. fs/btrfs/space-info.c +3 −1
  1133. fs/btrfs/super.c +37 −3
  1134. fs/btrfs/tests/btrfs-tests.c +8 −2
  1135. fs/btrfs/tests/inode-tests.c +0 −9
  1136. fs/btrfs/transaction.c +0 −8
  1137. fs/btrfs/tree-checker.c +7 −0
  1138. fs/btrfs/volumes.c +5 −3
  1139. fs/btrfs/volumes.h +6 −5
  1140. fs/cachefiles/rdwr.c +0 −2
  1141. fs/ceph/mds_client.c +17 −17
  1142. fs/cifs/cifs_dfs_ref.c +8 −4
  1143. fs/cifs/cifsfs.c +2 −2
  1144. fs/cifs/cifsproto.h +4 −2
  1145. fs/cifs/connect.c +38 −9
  1146. fs/cifs/dfs_cache.c +7 −4
  1147. fs/cifs/dir.c +20 −2
  1148. fs/cifs/fs_context.c +55 −10
  1149. fs/cifs/fs_context.h +1 −0
  1150. fs/cifs/smb2pdu.c +1 −1
  1151. fs/cifs/smb2pdu.h +2 −2
  1152. fs/cifs/transport.c +17 −5
  1153. fs/ecryptfs/inode.c +7 −3
  1154. fs/ext4/ext4_jbd2.c +0 −17
  1155. fs/ext4/ext4_jbd2.h +0 −5
  1156. fs/ext4/fast_commit.c +18 −17
  1157. fs/ext4/file.c +5 −2
  1158. fs/ext4/inode.c +5 −1
  1159. fs/ext4/ioctl.c +3 −0
  1160. fs/ext4/namei.c +17 −10
  1161. fs/ext4/resize.c +16 −4
  1162. fs/ext4/super.c +118 −72
  1163. fs/ext4/xattr.c +4 −1
  1164. fs/fs-writeback.c +13 −11
  1165. fs/hugetlbfs/inode.c +2 −1
  1166. fs/io_uring.c +305 −154
  1167. fs/kernfs/file.c +24 −41
  1168. fs/namespace.c +5 −2
  1169. fs/nfs/delegation.c +7 −5
  1170. fs/nfs/internal.h +30 −8
  1171. fs/nfs/nfs4proc.c +11 −17
  1172. fs/nfs/nfs4super.c +2 −2
  1173. fs/nfs/pnfs.c +79 −57
  1174. fs/nfs/pnfs.h +3 −5
  1175. fs/nfs/pnfs_nfs.c +10 −12
  1176. fs/nfsd/nfs3xdr.c +6 −1
  1177. fs/nfsd/nfs4proc.c +5 −0
  1178. fs/nfsd/nfs4xdr.c +36 −20
  1179. fs/nfsd/nfssvc.c +0 −6
  1180. fs/nfsd/xdr4.h +0 −1
  1181. fs/nilfs2/file.c +1 −0
  1182. fs/notify/fanotify/fanotify_user.c +7 −10
  1183. fs/overlayfs/copy_up.c +8 −7
  1184. fs/overlayfs/dir.c +1 −1
  1185. fs/overlayfs/file.c +3 −2
  1186. fs/overlayfs/inode.c +2 −0
  1187. fs/overlayfs/overlayfs.h +1 −0
  1188. fs/overlayfs/ovl_entry.h +2 −0
  1189. fs/overlayfs/readdir.c +10 −18
  1190. fs/overlayfs/super.c +31 −7
  1191. fs/overlayfs/util.c +27 −0
  1192. fs/pipe.c +1 −0
  1193. fs/proc/proc_sysctl.c +6 −1
  1194. fs/proc/task_mmu.c +30 −23
  1195. fs/select.c +11 −3
  1196. fs/squashfs/block.c +7 −1
  1197. fs/squashfs/export.c +33 −8
  1198. fs/squashfs/id.c +32 −8
  1199. fs/squashfs/squashfs_fs_sb.h +1 −0
  1200. fs/squashfs/super.c +3 −3
  1201. fs/squashfs/xattr.h +9 −1
  1202. fs/squashfs/xattr_id.c +57 −9
  1203. fs/udf/super.c +4 −3
  1204. fs/zonefs/Kconfig +1 −0
  1205. include/asm-generic/bitops/atomic.h +3 −3
  1206. include/asm-generic/vmlinux.lds.h +1 −1
  1207. include/drm/drm_dp_mst_helper.h +1 −0
  1208. include/dt-bindings/sound/apq8016-lpass.h +3 −4
  1209. include/dt-bindings/sound/qcom,lpass.h +15 −0
  1210. include/dt-bindings/sound/sc7180-lpass.h +2 −4
  1211. include/kvm/arm_pmu.h +1 −1
  1212. include/linux/acpi.h +7 −0
  1213. include/linux/compiler-gcc.h +6 −0
  1214. include/linux/compiler_attributes.h +6 −0
  1215. include/linux/compiler_types.h +0 −6
  1216. include/linux/console.h +0 −3
  1217. include/linux/device.h +12 −0
  1218. include/linux/dm-bufio.h +1 −0
  1219. include/linux/entry-common.h +1 −0
  1220. include/linux/hugetlb.h +2 −0
  1221. include/linux/intel-iommu.h +12 −6
  1222. include/linux/iommu.h +4 −1
  1223. include/linux/irq.h +2 −2
  1224. include/linux/kasan.h +12 −1
  1225. include/linux/kcov.h +21 −0
  1226. include/linux/kprobes.h +1 −1
  1227. include/linux/kthread.h +3 −0
  1228. include/linux/ktime.h +0 −1
  1229. include/linux/linkage.h +5 −0
  1230. include/linux/mdio-bitbang.h +3 −0
  1231. include/linux/memcontrol.h +1 −1
  1232. include/linux/mlx5/driver.h +0 −18
  1233. include/linux/mlx5/mlx5_ifc.h +2 −1
  1234. include/linux/msi.h +6 −0
  1235. include/linux/netdevice.h +2 −0
  1236. include/linux/nvme.h +6 −0
  1237. include/linux/perf/arm_pmu.h +0 −2
  1238. include/linux/rcupdate.h +6 −0
  1239. include/linux/regulator/consumer.h +30 −0
  1240. include/linux/skbuff.h +2 −1
  1241. include/linux/sunrpc/xdr.h +1 −2
  1242. include/linux/syscalls.h +24 −0
  1243. include/linux/thread_info.h +2 −0
  1244. include/linux/timekeeping32.h +0 −14
  1245. include/linux/tracepoint.h +7 −5
  1246. include/linux/tty.h +1 −0
  1247. include/linux/uio.h +7 −1
  1248. include/linux/usb/usbnet.h +2 −0
  1249. include/linux/vmalloc.h +2 −7
  1250. include/media/v4l2-common.h +2 −2
  1251. include/net/cfg80211.h +4 −1
  1252. include/net/inet_connection_sock.h +3 −0
  1253. include/net/lapb.h +2 −0
  1254. include/net/mac80211.h +1 −0
  1255. include/net/netfilter/nf_tables.h +2 −0
  1256. include/net/red.h +3 −1
  1257. include/net/sch_generic.h +1 −1
  1258. include/net/sock.h +12 −5
  1259. include/net/switchdev.h +0 −2
  1260. include/net/tcp.h +2 −1
  1261. include/net/udp.h +1 −1
  1262. include/net/xdp_sock.h +0 −4
  1263. include/net/xsk_buff_pool.h +5 −0
  1264. include/soc/mscc/ocelot.h +2 −0
  1265. include/soc/nps/common.h +0 −172
  1266. include/soc/nps/mtm.h +0 −59
  1267. include/sound/pcm.h +1 −1
  1268. include/trace/events/afs.h +2 −0
  1269. include/trace/events/sched.h +1 −1
  1270. include/trace/events/sunrpc.h +53 −6
  1271. include/uapi/linux/bcache.h +1 −1
  1272. include/uapi/linux/if_link.h +3 −2
  1273. include/uapi/linux/kvm.h +2 −0
  1274. include/uapi/linux/mrp_bridge.h +0 −86
  1275. include/uapi/linux/netfilter/nf_tables.h +3 −0
  1276. include/uapi/linux/ppp-ioctl.h +1 −1
  1277. include/uapi/linux/prctl.h +3 −0
  1278. include/uapi/linux/rkisp1-config.h +76 −10
  1279. include/uapi/linux/rpl.h +3 −3
  1280. include/uapi/linux/v4l2-subdev.h +1 −1
  1281. include/uapi/misc/habanalabs.h +5 −0
  1282. include/uapi/rdma/vmw_pvrdma-abi.h +7 −0
  1283. include/xen/xenbus.h +0 −2
  1284. init/Kconfig +0 −1
  1285. init/init_task.c +2 −1
  1286. init/main.c +10 −9
  1287. kernel/bpf/bpf_inode_storage.c +11 −4
  1288. kernel/bpf/bpf_lsm.c +12 −0
  1289. kernel/bpf/bpf_task_storage.c +4 −1
  1290. kernel/bpf/btf.c +1 −1
  1291. kernel/bpf/cgroup.c +9 −3
  1292. kernel/bpf/hashtab.c +1 −0
  1293. kernel/bpf/helpers.c +1 −1
  1294. kernel/bpf/preload/Makefile +4 −1
  1295. kernel/bpf/stackmap.c +2 −0
  1296. kernel/bpf/syscall.c +4 −3
  1297. kernel/bpf/task_iter.c +9 −8
  1298. kernel/bpf/verifier.c +25 −21
  1299. kernel/cgroup/cgroup-v1.c +3 −0
  1300. kernel/cgroup/cgroup.c +3 −1
  1301. kernel/configs/android-recommended.config +0 −1
  1302. kernel/dma/map_benchmark.c +6 −2
  1303. kernel/entry/common.c +3 −11
  1304. kernel/entry/syscall_user_dispatch.c +2 −2
  1305. kernel/fork.c +2 −4
  1306. kernel/futex.c +96 −123
  1307. kernel/gcov/Kconfig +1 −1
  1308. kernel/irq/manage.c +1 −0
  1309. kernel/irq/msi.c +21 −25
  1310. kernel/kexec_core.c +0 −2
  1311. kernel/kprobes.c +28 −8
  1312. kernel/kthread.c +27 −2
  1313. kernel/locking/lockdep.c +7 −2
  1314. kernel/locking/rtmutex.c +1 −2
  1315. kernel/locking/rtmutex_common.h +1 −2
  1316. kernel/power/swap.c +1 −1
  1317. kernel/printk/printk.c +29 −11
  1318. kernel/printk/printk_ringbuffer.c +1 −1
  1319. kernel/rcu/tasks.h +21 −4
  1320. kernel/sched/core.c +88 −23
  1321. kernel/sched/sched.h +1 −0
  1322. kernel/signal.c +5 −1
  1323. kernel/smpboot.c +1 −0
  1324. kernel/time/ntp.c +4 −4
  1325. kernel/time/timekeeping.c +1 −2
  1326. kernel/trace/Kconfig +1 −1
  1327. kernel/trace/bpf_trace.c +0 −3
  1328. kernel/trace/fgraph.c +0 −2
  1329. kernel/trace/trace.c +1 −1
  1330. kernel/trace/trace_events.c +2 −1
  1331. kernel/trace/trace_irqsoff.c +4 −0
  1332. kernel/trace/trace_kprobe.c +7 −5
  1333. kernel/workqueue.c +13 −9
  1334. lib/Kconfig.debug +0 −8
  1335. lib/Kconfig.ubsan +1 −0
  1336. lib/cpumask.c +5 −11
  1337. lib/fonts/font_ter16x32.c +3 −3
  1338. lib/iov_iter.c +15 −11
  1339. lib/raid6/Makefile +1 −1
  1340. lib/ubsan.c +31 −0
  1341. lib/ubsan.h +6 −0
  1342. mm/compaction.c +2 −1
  1343. mm/filemap.c +4 −0
  1344. mm/highmem.c +6 −1
  1345. mm/huge_memory.c +23 −14
  1346. mm/hugetlb.c +48 −7
  1347. mm/kasan/hw_tags.c +28 −45
  1348. mm/kasan/init.c +15 −11
  1349. mm/kasan/kasan.h +1 −1
  1350. mm/memblock.c +7 −44
  1351. mm/memcontrol.c +3 −6
  1352. mm/memory-failure.c +17 −5
  1353. mm/mempolicy.c +1 −1
  1354. mm/migrate.c +18 −11
  1355. mm/mremap.c +3 −2
  1356. mm/page-writeback.c +1 −1
  1357. mm/page_alloc.c +18 −15
  1358. mm/process_vm_access.c +1 −0
  1359. mm/slub.c +22 −9
  1360. mm/vmalloc.c +3 −1
  1361. mm/vmscan.c +2 −0
  1362. net/8021q/vlan.c +1 −2
  1363. net/bpf/test_run.c +2 −1
  1364. net/bridge/br_mrp.c +6 −3
  1365. net/bridge/br_mrp_switchdev.c +3 −4
  1366. net/bridge/br_private_mrp.h +30 −2
  1367. net/can/isotp.c +1 −0
  1368. net/ceph/auth_x.c +34 −23
  1369. net/ceph/crypto.c +2 −1
  1370. net/ceph/messenger_v1.c +1 −1
  1371. net/ceph/messenger_v2.c +26 −19
  1372. net/ceph/mon_client.c +7 −7
  1373. net/ceph/osd_client.c +20 −20
  1374. net/core/datagram.c +10 −2
  1375. net/core/dev.c +35 −18
  1376. net/core/devlink.c +2 −2
  1377. net/core/gen_estimator.c +7 −4
  1378. net/core/neighbour.c +6 −7
  1379. net/core/net-sysfs.c +53 −12
  1380. net/core/rtnetlink.c +6 −17
  1381. net/core/skbuff.c +54 −9
  1382. net/core/sock_reuseport.c +1 −1
  1383. net/dcb/dcbnl.c +2 −0
  1384. net/decnet/dn_route.c +1 −1
  1385. net/dsa/dsa2.c +9 −2
  1386. net/dsa/master.c +10 −0
  1387. net/hsr/hsr_main.h +4 −1
  1388. net/ipv4/esp4.c +1 −6
  1389. net/ipv4/fib_frontend.c +1 −1
  1390. net/ipv4/gre_demux.c +1 −1
  1391. net/ipv4/inet_connection_sock.c +1 −0
  1392. net/ipv4/ip_output.c +1 −1
  1393. net/ipv4/ip_tunnel.c +12 −15
  1394. net/ipv4/netfilter/arp_tables.c +1 −1
  1395. net/ipv4/netfilter/ip_tables.c +1 −1
  1396. net/ipv4/netfilter/ipt_rpfilter.c +1 −1
  1397. net/ipv4/nexthop.c +4 −2
  1398. net/ipv4/tcp.c +1 −0
  1399. net/ipv4/tcp_input.c +11 −9
  1400. net/ipv4/tcp_ipv4.c +15 −14
  1401. net/ipv4/tcp_output.c +3 −0
  1402. net/ipv4/tcp_recovery.c +3 −2
  1403. net/ipv4/tcp_timer.c +33 −21
  1404. net/ipv4/udp.c +2 −1
  1405. net/ipv4/udp_offload.c +64 −5
  1406. net/ipv6/addrconf.c +2 −1
  1407. net/ipv6/esp6.c +1 −6
  1408. net/ipv6/ip6_fib.c +2 −3
  1409. net/ipv6/ip6_output.c +40 −1
  1410. net/ipv6/netfilter/ip6_tables.c +1 −1
  1411. net/ipv6/sit.c +4 −1
  1412. net/ipv6/udp_offload.c +1 −1
  1413. net/key/af_key.c +3 −3
  1414. net/lapb/lapb_iface.c +55 −16
  1415. net/lapb/lapb_out.c +2 −1
  1416. net/lapb/lapb_timer.c +26 −4
  1417. net/mac80211/Kconfig +1 −1
  1418. net/mac80211/debugfs.c +20 −24
  1419. net/mac80211/driver-ops.c +4 −1
  1420. net/mac80211/ieee80211_i.h +1 −0
  1421. net/mac80211/iface.c +6 −0
  1422. net/mac80211/rate.c +2 −1
  1423. net/mac80211/rx.c +2 −0
  1424. net/mac80211/spectmgmt.c +7 −3
  1425. net/mac80211/tx.c +17 −14
  1426. net/mptcp/protocol.c +27 −47
  1427. net/ncsi/ncsi-rsp.c +1 −1
  1428. net/netfilter/ipset/ip_set_hash_gen.h +18 −24
  1429. net/netfilter/nf_conntrack_core.c +2 −1
  1430. net/netfilter/nf_conntrack_standalone.c +3 −0
  1431. net/netfilter/nf_flow_table_core.c +2 −2
  1432. net/netfilter/nf_nat_core.c +1 −0
  1433. net/netfilter/nf_tables_api.c +43 −25
  1434. net/netfilter/nft_dynset.c +36 −20
  1435. net/netfilter/xt_RATEEST.c +3 −0
  1436. net/netfilter/xt_recent.c +10 −2
  1437. net/nfc/nci/core.c +1 −1
  1438. net/nfc/netlink.c +1 −0
  1439. net/nfc/rawsock.c +1 −1
  1440. net/packet/af_packet.c +3 −1
  1441. net/qrtr/ns.c +4 −3
  1442. net/qrtr/qrtr.c +11 −5
  1443. net/qrtr/qrtr.h +1 −1
  1444. net/qrtr/tun.c +6 −0
  1445. net/rds/rdma.c +3 −0
  1446. net/rxrpc/af_rxrpc.c +3 −3
  1447. net/rxrpc/call_accept.c +1 −0
  1448. net/rxrpc/call_object.c +0 −2
  1449. net/rxrpc/input.c +1 −1
  1450. net/rxrpc/key.c +4 −2
  1451. net/sched/cls_flower.c +13 −9
  1452. net/sched/cls_tcindex.c +6 −2
  1453. net/sched/sch_api.c +2 −1
  1454. net/sched/sch_choke.c +1 −1
  1455. net/sched/sch_gred.c +1 −1
  1456. net/sched/sch_red.c +1 −1
  1457. net/sched/sch_sfq.c +1 −1
  1458. net/sched/sch_taprio.c +4 −3
  1459. net/sctp/proc.c +12 −4
  1460. net/smc/smc_core.c +13 −7
  1461. net/smc/smc_ib.c +3 −3
  1462. net/smc/smc_ism.c +2 −1
  1463. net/sunrpc/addr.c +1 −1
  1464. net/sunrpc/auth_gss/auth_gss.c +1 −29
  1465. net/sunrpc/auth_gss/auth_gss_internal.h +45 −0
  1466. net/sunrpc/auth_gss/gss_krb5_mech.c +2 −29
  1467. net/sunrpc/svc_xprt.c +2 −2
  1468. net/sunrpc/svcsock.c +86 −1
  1469. net/switchdev/switchdev.c +13 −10
  1470. net/tipc/link.c +8 −3
  1471. net/tipc/node.c +1 −1
  1472. net/vmw_vsock/af_vsock.c +19 −13
  1473. net/vmw_vsock/hyperv_transport.c +0 −4
  1474. net/vmw_vsock/virtio_transport_common.c +2 −2
  1475. net/wireless/Kconfig +1 −0
  1476. net/wireless/reg.c +10 −1
  1477. net/wireless/wext-core.c +3 −2
  1478. net/xdp/xsk.c +15 −5
  1479. net/xdp/xsk_buff_pool.c +1 −2
  1480. net/xdp/xsk_queue.h +5 −0
  1481. net/xfrm/xfrm_input.c +1 −1
  1482. net/xfrm/xfrm_policy.c +20 −10
  1483. scripts/Makefile +7 −2
  1484. scripts/bloat-o-meter +1 −1
  1485. scripts/checkpatch.pl +0 −7
  1486. scripts/clang-tools/gen_compile_commands.py +1 −1
  1487. scripts/clang-tools/run-clang-tools.py +1 −1
  1488. scripts/config +1 −0
  1489. scripts/diffconfig +1 −1
  1490. scripts/dummy-tools/gcc +3 −7
  1491. scripts/gcc-plugins/Makefile +2 −2
  1492. scripts/gen_autoksyms.sh +3 −0
  1493. scripts/jobserver-exec +1 −1
  1494. scripts/kallsyms.c +6 −0
  1495. scripts/kconfig/Makefile +0 −10
  1496. scripts/kconfig/mconf-cfg.sh +3 −1
  1497. scripts/recordmcount.pl +5 −1
  1498. security/commoncap.c +43 −24
  1499. security/lsm_audit.c +5 −2
  1500. sound/core/pcm_native.c +2 −2
  1501. sound/core/seq/oss/seq_oss_synth.c +2 −1
  1502. sound/firewire/fireface/ff-transaction.c +1 −1
  1503. sound/firewire/tascam/tascam-transaction.c +1 −1
  1504. sound/hda/intel-dsp-config.c +4 −0
  1505. sound/pci/hda/hda_codec.c +7 −17
  1506. sound/pci/hda/hda_intel.c +12 −5
  1507. sound/pci/hda/hda_tegra.c +1 −1
  1508. sound/pci/hda/patch_conexant.c +1 −0
  1509. sound/pci/hda/patch_hdmi.c +2 −1
  1510. sound/pci/hda/patch_realtek.c +24 −1
  1511. sound/pci/hda/patch_via.c +14 −0
  1512. sound/soc/amd/raven/pci-acp3x.c +3 −13
  1513. sound/soc/amd/renoir/rn-pci-acp3x.c +30 −2
  1514. sound/soc/atmel/Kconfig +2 −2
  1515. sound/soc/codecs/Kconfig +1 −1
  1516. sound/soc/codecs/ak4458.c +7 −15
  1517. sound/soc/codecs/hdmi-codec.c +1 −1
  1518. sound/soc/codecs/max98373-i2c.c +20 −0
  1519. sound/soc/codecs/max98373-sdw.c +20 −0
  1520. sound/soc/codecs/max98373.c +31 −3
  1521. sound/soc/codecs/max98373.h +8 −0
  1522. sound/soc/codecs/rt711.c +6 −0
  1523. sound/soc/codecs/wm_adsp.c +3 −0
  1524. sound/soc/fsl/imx-hdmi.c +2 −1
  1525. sound/soc/intel/boards/haswell.c +1 −0
  1526. sound/soc/intel/boards/sof_sdw.c +10 −0
  1527. sound/soc/intel/skylake/cnl-sst.c +1 −0
  1528. sound/soc/intel/skylake/skl-topology.c +8 −7
  1529. sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c +4 −1
  1530. sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c +4 −1
  1531. sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c +49 −0
  1532. sound/soc/meson/axg-tdm-interface.c +13 −1
  1533. sound/soc/meson/axg-tdmin.c +2 −11
  1534. sound/soc/qcom/lpass-cpu.c +24 −18
  1535. sound/soc/qcom/lpass-ipq806x.c +1 −1
  1536. sound/soc/qcom/lpass-lpaif-reg.h +1 −1
  1537. sound/soc/qcom/lpass-platform.c +47 −15
  1538. sound/soc/qcom/lpass-sc7180.c +4 −7
  1539. sound/soc/qcom/lpass.h +1 −1
  1540. sound/soc/sh/rcar/adg.c +10 −8
  1541. sound/soc/soc-dapm.c +1 −0
  1542. sound/soc/soc-topology.c +6 −5
  1543. sound/soc/sof/Kconfig +1 −1
  1544. sound/soc/sof/intel/Kconfig +2 −1
  1545. sound/soc/sof/intel/hda-codec.c +17 −20
  1546. sound/soc/sof/intel/hda-dsp.c +6 −3
  1547. sound/soc/sof/intel/hda.h +1 −1
  1548. sound/soc/sof/sof-acpi-dev.c +6 −5
  1549. sound/soc/sof/sof-pci-dev.c +6 −4
  1550. sound/usb/card.c +2 −3
  1551. sound/usb/card.h +3 −0
  1552. sound/usb/clock.c +6 −15
  1553. sound/usb/endpoint.c +81 −12
  1554. sound/usb/endpoint.h +1 −1
  1555. sound/usb/format.c +11 −0
  1556. sound/usb/implicit.c +47 −15
  1557. sound/usb/midi.c +4 −0
  1558. sound/usb/pcm.c +111 −63
  1559. sound/usb/quirks-table.h +6 −0
  1560. sound/usb/quirks.c +46 −40
  1561. sound/usb/usbaudio.h +1 −0
  1562. tools/bootconfig/scripts/bconf2ftrace.sh +1 −0
  1563. tools/bootconfig/scripts/ftrace2bconf.sh +4 −0
  1564. tools/bpf/bpftool/net.c +0 −1
  1565. tools/bpf/resolve_btfids/main.c +12 −5
  1566. tools/gpio/gpio-event-mon.c +2 −2
  1567. tools/gpio/gpio-watch.c +3 −2
  1568. tools/include/linux/build_bug.h +0 −5
  1569. tools/include/uapi/linux/kvm.h +2 −0
  1570. tools/lib/bpf/btf.c +0 −5
  1571. tools/lib/perf/evlist.c +4 −13
  1572. tools/lib/perf/tests/test-cpumap.c +1 −1
  1573. tools/lib/perf/tests/test-evlist.c +4 −3
  1574. tools/lib/perf/tests/test-evsel.c +1 −1
  1575. tools/lib/perf/tests/test-threadmap.c +1 −1
  1576. tools/objtool/check.c +5 −9
  1577. tools/objtool/elf.c +12 −2
  1578. tools/perf/builtin-script.c +17 −1
  1579. tools/perf/examples/bpf/5sec.c +1 −1
  1580. tools/perf/tests/shell/stat+shadow_stat.sh +14 −16
  1581. tools/perf/util/header.c +8 −0
  1582. tools/perf/util/machine.c +2 −2
  1583. tools/perf/util/metricgroup.c +11 −5
  1584. tools/perf/util/session.c +1 −1
  1585. tools/perf/util/stat-shadow.c +189 −177
  1586. tools/power/x86/intel-speed-select/isst-config.c +32 −0
  1587. tools/power/x86/turbostat/turbostat.c +9 −1
  1588. tools/testing/kunit/kunit.py +11 −23
  1589. tools/testing/kunit/kunit_config.py +4 −3
  1590. tools/testing/kunit/kunit_json.py +1 −1
  1591. tools/testing/kunit/kunit_kernel.py +29 −27
  1592. tools/testing/kunit/kunit_parser.py +40 −41
  1593. tools/testing/nvdimm/config_check.c +2 −1
  1594. tools/testing/nvdimm/test/Kbuild +5 −1
  1595. tools/testing/nvdimm/test/ndtest.c +1129 −0
  1596. tools/testing/nvdimm/test/ndtest.h +109 −0
  1597. tools/testing/selftests/Makefile +4 −2
  1598. tools/testing/selftests/arm64/fp/fpsimd-test.S +1 −1
  1599. tools/testing/selftests/arm64/fp/sve-test.S +1 −1
  1600. tools/testing/selftests/bpf/Makefile +3 −0
  1601. tools/testing/selftests/bpf/prog_tests/test_local_storage.c +26 −70
  1602. tools/testing/selftests/bpf/progs/bprm_opts.c +1 −1
  1603. tools/testing/selftests/bpf/progs/local_storage.c +35 −27
  1604. tools/testing/selftests/bpf/test_maps.c +42 −6
  1605. tools/testing/selftests/bpf/test_verifier.c +11 −1
  1606. tools/testing/selftests/bpf/verifier/spill_fill.c +30 −0
  1607. tools/testing/selftests/bpf/xdpxceiver.c +2 −2
  1608. tools/testing/selftests/dma/dma_map_benchmark.c +3 −1
  1609. tools/testing/selftests/drivers/net/mlxsw/qos_pfc.sh +1 −1
  1610. tools/testing/selftests/kvm/Makefile +1 −1
  1611. tools/testing/selftests/kvm/demand_paging_test.c +32 −86
  1612. tools/testing/selftests/kvm/dirty_log_perf_test.c +46 −99
  1613. tools/testing/selftests/kvm/dirty_log_test.c +37 −88
  1614. tools/testing/selftests/kvm/include/guest_modes.h +21 −0
  1615. tools/testing/selftests/kvm/include/kvm_util.h +9 −0
  1616. tools/testing/selftests/kvm/include/perf_test_util.h +12 −155
  1617. tools/testing/selftests/kvm/lib/guest_modes.c +70 −0
  1618. tools/testing/selftests/kvm/lib/kvm_util.c +1 −8
  1619. tools/testing/selftests/kvm/lib/perf_test_util.c +134 −0
  1620. tools/testing/selftests/net/fib_nexthops.sh +1 −1
  1621. tools/testing/selftests/net/fib_tests.sh +0 −1
  1622. tools/testing/selftests/net/forwarding/router_mpath_nh.sh +1 −1
  1623. tools/testing/selftests/net/forwarding/router_multipath.sh +1 −1
  1624. tools/testing/selftests/net/pmtu.sh +69 −2
  1625. tools/testing/selftests/net/tls.c +12 −7
  1626. tools/testing/selftests/net/txtimestamp.c +3 −3
  1627. tools/testing/selftests/net/udpgro.sh +34 −0
  1628. tools/testing/selftests/net/xfrm_policy.sh +44 −1
  1629. tools/testing/selftests/netfilter/Makefile +2 −1
  1630. tools/testing/selftests/netfilter/ipip-conntrack-mtu.sh +206 −0
  1631. tools/testing/selftests/netfilter/nft_conntrack_helper.sh +9 −3
  1632. tools/testing/selftests/netfilter/nft_meta.sh +1 −1
  1633. tools/testing/selftests/powerpc/alignment/alignment_handler.c +4 −1
  1634. tools/testing/selftests/powerpc/mm/pkey_exec_prot.c +1 −1
  1635. tools/testing/selftests/powerpc/mm/pkey_siginfo.c +1 −1
  1636. tools/testing/selftests/syscall_user_dispatch/sud_benchmark.c +5 −3
  1637. tools/testing/selftests/syscall_user_dispatch/sud_test.c +8 −6
  1638. tools/testing/selftests/vDSO/.gitignore +3 −0
  1639. tools/testing/selftests/vDSO/vdso_test_correctness.c +1 −1
  1640. tools/testing/selftests/vm/run_vmtests.sh +0 −0
  1641. tools/testing/selftests/wireguard/qemu/debug.config +0 −1
  1642. virt/kvm/kvm_main.c +2 −2
.clang-format+7−4
@@ -122,6 +122,7 @@ ForEachMacros: · 121 unmodified lines
122122 - 'drm_for_each_bridge_in_chain'
123123 - 'drm_for_each_connector_iter'
124124 - 'drm_for_each_crtc'
125+ - 'drm_for_each_crtc_reverse'
125126 - 'drm_for_each_encoder'
126127 - 'drm_for_each_encoder_mask'
127128 - 'drm_for_each_fb'
@@ -203,14 +204,13 @@ ForEachMacros: · 75 unmodified lines
203204 - 'for_each_matching_node'
204205 - 'for_each_matching_node_and_match'
205206 - 'for_each_member'
206− - 'for_each_mem_region'
207− - 'for_each_memblock_type'
208207 - 'for_each_memcg_cache_index'
209208 - 'for_each_mem_pfn_range'
210209 - '__for_each_mem_range'
211210 - 'for_each_mem_range'
212211 - '__for_each_mem_range_rev'
213212 - 'for_each_mem_range_rev'
213+ - 'for_each_mem_region'
214214 - 'for_each_migratetype_order'
215215 - 'for_each_msi_entry'
216216 - 'for_each_msi_entry_safe'
@@ -276,10 +276,8 @@ ForEachMacros: · 59 unmodified lines
276276 - 'for_each_reserved_mem_range'
277277 - 'for_each_reserved_mem_region'
278278 - 'for_each_rtd_codec_dais'
279− - 'for_each_rtd_codec_dais_rollback'
280279 - 'for_each_rtd_components'
281280 - 'for_each_rtd_cpu_dais'
282− - 'for_each_rtd_cpu_dais_rollback'
283281 - 'for_each_rtd_dais'
284282 - 'for_each_set_bit'
285283 - 'for_each_set_bit_from'
@@ -298,6 +296,7 @@ ForEachMacros: · 12 unmodified lines
298296 - '__for_each_thread'
299297 - 'for_each_thread'
300298 - 'for_each_unicast_dest_pgid'
299+ - 'for_each_vsi'
301300 - 'for_each_wakeup_source'
302301 - 'for_each_zone'
303302 - 'for_each_zone_zonelist'
@@ -330,6 +329,7 @@ ForEachMacros: · 26 unmodified lines
330329 - 'hlist_for_each_entry_rcu_bh'
331330 - 'hlist_for_each_entry_rcu_notrace'
332331 - 'hlist_for_each_entry_safe'
332+ - 'hlist_for_each_entry_srcu'
333333 - '__hlist_for_each_rcu'
334334 - 'hlist_for_each_safe'
335335 - 'hlist_nulls_for_each_entry'
@@ -378,6 +378,7 @@ ForEachMacros: · 42 unmodified lines
378378 - 'list_for_each_entry_safe_continue'
379379 - 'list_for_each_entry_safe_from'
380380 - 'list_for_each_entry_safe_reverse'
381+ - 'list_for_each_entry_srcu'
381382 - 'list_for_each_prev'
382383 - 'list_for_each_prev_safe'
383384 - 'list_for_each_safe'
@@ -411,6 +412,8 @@ ForEachMacros: · 27 unmodified lines
411412 - 'of_property_for_each_string'
412413 - 'of_property_for_each_u32'
413414 - 'pci_bus_for_each_resource'
415+ - 'pcl_for_each_chunk'
416+ - 'pcl_for_each_segment'
414417 - 'pcm_for_each_format'
415418 - 'ping_portaddr_for_each_entry'
416419 - 'plist_for_each'
.mailmap+10−3
@@ -9,9 +9,6 @@ · 8 unmodified lines
99 #
1010 # Please keep this list dictionary sorted.
1111 #
12−# This comment is parsed by git-shortlog:
13−# repo-abbrev: /pub/scm/linux/kernel/git/
14−#
1512 Aaron Durbin <adurbin@google.com>
1613 Adam Oldham <oldhamca@gmail.com>
1714 Adam Radford <aradford@gmail.com>
@@ -40,6 +37,7 @@ Andrew Murray <amurray@thegoodpenguin.co.uk> <amurray@embedded-bits.co.uk> · 22 unmodified lines
4037 Andrew Murray <amurray@thegoodpenguin.co.uk> <andrew.murray@arm.com>
4138 Andrew Vasquez <andrew.vasquez@qlogic.com>
4239 Andrey Ryabinin <ryabinin.a.a@gmail.com> <a.ryabinin@samsung.com>
40+Andrey Ryabinin <ryabinin.a.a@gmail.com> <aryabinin@virtuozzo.com>
4341 Andy Adamson <andros@citi.umich.edu>
4442 Antoine Tenart <atenart@kernel.org> <antoine.tenart@bootlin.com>
4543 Antoine Tenart <atenart@kernel.org> <antoine.tenart@free-electrons.com>
@@ -55,6 +53,8 @@ Bart Van Assche <bvanassche@acm.org> <bart.vanassche@wdc.com> · 9 unmodified lines
5553 Ben Gardner <bgardner@wabtec.com>
5654 Ben M Cahill <ben.m.cahill@intel.com>
5755 Björn Steinbrink <B.Steinbrink@gmx.de>
56+Björn Töpel <bjorn@kernel.org> <bjorn.topel@gmail.com>
57+Björn Töpel <bjorn@kernel.org> <bjorn.topel@intel.com>
5858 Boris Brezillon <bbrezillon@kernel.org> <b.brezillon.dev@gmail.com>
5959 Boris Brezillon <bbrezillon@kernel.org> <b.brezillon@overkiz.com>
6060 Boris Brezillon <bbrezillon@kernel.org> <boris.brezillon@bootlin.com>
@@ -180,6 +180,8 @@ Kees Cook <keescook@chromium.org> <kees.cook@canonical.com> · 119 unmodified lines
180180 Kees Cook <keescook@chromium.org> <keescook@google.com>
181181 Kees Cook <keescook@chromium.org> <kees@outflux.net>
182182 Kees Cook <keescook@chromium.org> <kees@ubuntu.com>
183+Keith Busch <kbusch@kernel.org> <keith.busch@intel.com>
184+Keith Busch <kbusch@kernel.org> <keith.busch@linux.intel.com>
183185 Kenneth W Chen <kenneth.w.chen@intel.com>
184186 Konstantin Khlebnikov <koct9i@gmail.com> <khlebnikov@yandex-team.ru>
185187 Konstantin Khlebnikov <koct9i@gmail.com> <k.khlebnikov@samsung.com>
@@ -200,6 +202,8 @@ Li Yang <leoyang.li@nxp.com> <leoli@freescale.com> · 14 unmodified lines
200202 Li Yang <leoyang.li@nxp.com> <leo@zh-kernel.org>
201203 Lukasz Luba <lukasz.luba@arm.com> <l.luba@partner.samsung.com>
202204 Maciej W. Rozycki <macro@mips.com> <macro@imgtec.com>
205+Manivannan Sadhasivam <mani@kernel.org> <manivannanece23@gmail.com>
206+Manivannan Sadhasivam <mani@kernel.org> <manivannan.sadhasivam@linaro.org>
203207 Marcin Nowakowski <marcin.nowakowski@mips.com> <marcin.nowakowski@imgtec.com>
204208 Marc Zyngier <maz@kernel.org> <marc.zyngier@arm.com>
205209 Mark Brown <broonie@sirena.org.uk>
@@ -245,6 +249,7 @@ Morten Welinder <welinder@anemone.rentec.com> · 39 unmodified lines
245249 Morten Welinder <welinder@darter.rentec.com>
246250 Morten Welinder <welinder@troll.com>
247251 Mythri P K <mythripk@ti.com>
252+Nathan Chancellor <nathan@kernel.org> <natechancellor@gmail.com>
248253 Nguyen Anh Quynh <aquynh@gmail.com>
249254 Nicolas Ferre <nicolas.ferre@microchip.com> <nicolas.ferre@atmel.com>
250255 Nicolas Pitre <nico@fluxnic.net> <nicolas.pitre@linaro.org>
@@ -335,6 +340,8 @@ Vinod Koul <vkoul@kernel.org> <vkoul@infradead.org> · 84 unmodified lines
335340 Viresh Kumar <vireshk@kernel.org> <viresh.kumar2@arm.com>
336341 Viresh Kumar <vireshk@kernel.org> <viresh.kumar@st.com>
337342 Viresh Kumar <vireshk@kernel.org> <viresh.linux@gmail.com>
343+Viresh Kumar <viresh.kumar@linaro.org> <viresh.kumar@linaro.org>
344+Viresh Kumar <viresh.kumar@linaro.org> <viresh.kumar@linaro.com>
338345 Vivien Didelot <vivien.didelot@gmail.com> <vivien.didelot@savoirfairelinux.com>
339346 Vlad Dogaru <ddvlad@gmail.com> <vlad.dogaru@intel.com>
340347 Vladimir Davydov <vdavydov.dev@gmail.com> <vdavydov@parallels.com>
CREDITS+24−0
@@ -710,6 +710,10 @@ S: Las Cuevas 2385 - Bo Guemes · 709 unmodified lines
710710 S: Las Heras, Mendoza CP 5539
711711 S: Argentina
712712
713+N: Jay Cliburn
714+E: jcliburn@gmail.com
715+D: ATLX Ethernet drivers
716+
713717 N: Steven P. Cole
714718 E: scole@lanl.gov
715719 E: elenstev@mesatop.com
@@ -1284,6 +1288,10 @@ D: Major kbuild rework during the 2.5 cycle · 568 unmodified lines
12841288 D: ISDN Maintainer
12851289 S: USA
12861290
1291+N: Gerrit Renker
1292+E: gerrit@erg.abdn.ac.uk
1293+D: DCCP protocol support.
1294+
12871295 N: Philip Gladstone
12881296 E: philip@gladstonefamily.net
12891297 D: Kernel / timekeeping stuff
@@ -2138,6 +2146,10 @@ E: seasons@falcon.sch.bme.hu · 848 unmodified lines
21382146 E: seasons@makosteszta.sote.hu
21392147 D: Original author of software suspend
21402148
2149+N: Alexey Kuznetsov
2150+E: kuznet@ms2.inr.ac.ru
2151+D: Author and maintainer of large parts of the networking stack
2152+
21412153 N: Jaroslav Kysela
21422154 E: perex@perex.cz
21432155 W: https://www.perex.cz
@@ -2696,6 +2708,10 @@ N: Wolfgang Muees · 552 unmodified lines
26962708 E: wolfgang@iksw-muees.de
26972709 D: Auerswald USB driver
26982710
2711+N: Shrijeet Mukherjee
2712+E: shrijeet@gmail.com
2713+D: Network routing domains (VRF).
2714+
26992715 N: Paul Mundt
27002716 E: paul.mundt@gmail.com
27012717 D: SuperH maintainer
@@ -4110,6 +4126,10 @@ S: B-1206 Jingmao Guojigongyu · 1408 unmodified lines
41104126 S: 16 Baliqiao Nanjie, Beijing 101100
41114127 S: People's Repulic of China
41124128
4129+N: Aviad Yehezkel
4130+E: aviadye@nvidia.com
4131+D: Kernel TLS implementation and offload support.
4132+
41134133 N: Victor Yodaiken
41144134 E: yodaiken@fsmlabs.com
41154135 D: RTLinux (RealTime Linux)
@@ -4167,6 +4187,10 @@ S: 1507 145th Place SE #B5 · 51 unmodified lines
41674187 S: Bellevue, Washington 98007
41684188 S: USA
41694189
4190+N: Wensong Zhang
4191+E: wensong@linux-vs.org
4192+D: IP virtual server (IPVS).
4193+
41704194 N: Haojian Zhuang
41714195 E: haojian.zhuang@gmail.com
41724196 D: MMP support
Documentation/ABI/testing/sysfs-class-devlink+2−2
@@ -5,8 +5,8 @@ Description: · 4 unmodified lines
55 Provide a place in sysfs for the device link objects in the
66 kernel at any given time. The name of a device link directory,
77 denoted as ... above, is of the form <supplier>--<consumer>
8− where <supplier> is the supplier device name and <consumer> is
9− the consumer device name.
8+ where <supplier> is the supplier bus:device name and <consumer>
9+ is the consumer bus:device name.
1010
1111 What: /sys/class/devlink/.../auto_remove_on
1212 Date: May 2020
Documentation/ABI/testing/sysfs-devices-consumer+3−2
@@ -4,5 +4,6 @@ Contact: Saravana Kannan <saravanak@google.com> · 3 unmodified lines
44 Description:
55 The /sys/devices/.../consumer:<consumer> are symlinks to device
66 links where this device is the supplier. <consumer> denotes the
7− name of the consumer in that device link. There can be zero or
8− more of these symlinks for a given device.
7+ name of the consumer in that device link and is of the form
8+ bus:device name. There can be zero or more of these symlinks
9+ for a given device.
Documentation/ABI/testing/sysfs-devices-supplier+3−2
@@ -4,5 +4,6 @@ Contact: Saravana Kannan <saravanak@google.com> · 3 unmodified lines
44 Description:
55 The /sys/devices/.../supplier:<supplier> are symlinks to device
66 links where this device is the consumer. <supplier> denotes the
7− name of the supplier in that device link. There can be zero or
8− more of these symlinks for a given device.
7+ name of the supplier in that device link and is of the form
8+ bus:device name. There can be zero or more of these symlinks
9+ for a given device.
Documentation/ABI/testing/sysfs-driver-ufs+22−14
@@ -916,21 +916,25 @@ Date: September 2014 · 915 unmodified lines
916916 Contact: Subhash Jadavani <subhashj@codeaurora.org>
917917 Description: This entry could be used to set or show the UFS device
918918 runtime power management level. The current driver
919− implementation supports 6 levels with next target states:
919+ implementation supports 7 levels with next target states:
920920
921921 == ====================================================
922− 0 an UFS device will stay active, an UIC link will
922+ 0 UFS device will stay active, UIC link will
923923 stay active
924− 1 an UFS device will stay active, an UIC link will
924+ 1 UFS device will stay active, UIC link will
925925 hibernate
926− 2 an UFS device will moved to sleep, an UIC link will
926+ 2 UFS device will be moved to sleep, UIC link will
927927 stay active
928− 3 an UFS device will moved to sleep, an UIC link will
928+ 3 UFS device will be moved to sleep, UIC link will
929929 hibernate
930− 4 an UFS device will be powered off, an UIC link will
930+ 4 UFS device will be powered off, UIC link will
931931 hibernate
932− 5 an UFS device will be powered off, an UIC link will
932+ 5 UFS device will be powered off, UIC link will
933933 be powered off
934+ 6 UFS device will be moved to deep sleep, UIC link
935+ will be powered off. Note, deep sleep might not be
936+ supported in which case this value will not be
937+ accepted
934938 == ====================================================
935939
936940 What: /sys/bus/platform/drivers/ufshcd/*/rpm_target_dev_state
@@ -954,21 +958,25 @@ Date: September 2014 · 17 unmodified lines
954958 Contact: Subhash Jadavani <subhashj@codeaurora.org>
955959 Description: This entry could be used to set or show the UFS device
956960 system power management level. The current driver
957− implementation supports 6 levels with next target states:
961+ implementation supports 7 levels with next target states:
958962
959963 == ====================================================
960− 0 an UFS device will stay active, an UIC link will
964+ 0 UFS device will stay active, UIC link will
961965 stay active
962− 1 an UFS device will stay active, an UIC link will
966+ 1 UFS device will stay active, UIC link will
963967 hibernate
964− 2 an UFS device will moved to sleep, an UIC link will
968+ 2 UFS device will be moved to sleep, UIC link will
965969 stay active
966− 3 an UFS device will moved to sleep, an UIC link will
970+ 3 UFS device will be moved to sleep, UIC link will
967971 hibernate
968− 4 an UFS device will be powered off, an UIC link will
972+ 4 UFS device will be powered off, UIC link will
969973 hibernate
970− 5 an UFS device will be powered off, an UIC link will
974+ 5 UFS device will be powered off, UIC link will
971975 be powered off
976+ 6 UFS device will be moved to deep sleep, UIC link
977+ will be powered off. Note, deep sleep might not be
978+ supported in which case this value will not be
979+ accepted
972980 == ====================================================
973981
974982 What: /sys/bus/platform/drivers/ufshcd/*/spm_target_dev_state
Documentation/Makefile+1−1
@@ -75,7 +75,7 @@ quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4) · 74 unmodified lines
7575 cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/userspace-api/media $2 && \
7676 PYTHONDONTWRITEBYTECODE=1 \
7777 BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \
78− $(PYTHON) $(srctree)/scripts/jobserver-exec \
78+ $(PYTHON3) $(srctree)/scripts/jobserver-exec \
7979 $(SHELL) $(srctree)/Documentation/sphinx/parallel-wrapper.sh \
8080 $(SPHINXBUILD) \
8181 -b $2 \
Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst+4−4
@@ -473,7 +473,7 @@ read-side critical sections that follow the idle period (the oval near · 472 unmodified lines
473473 the bottom of the diagram above).
474474
475475 Plumbing this into the full grace-period execution is described
476−`below <#Forcing%20Quiescent%20States>`__.
476+`below <Forcing Quiescent States_>`__.
477477
478478 CPU-Hotplug Interface
479479 ^^^^^^^^^^^^^^^^^^^^^
@@ -494,7 +494,7 @@ mask to detect CPUs having gone offline since the beginning of this · 14 unmodified lines
494494 grace period.
495495
496496 Plumbing this into the full grace-period execution is described
497−`below <#Forcing%20Quiescent%20States>`__.
497+`below <Forcing Quiescent States_>`__.
498498
499499 Forcing Quiescent States
500500 ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -532,7 +532,7 @@ from other CPUs. · 31 unmodified lines
532532 | RCU. But this diagram is complex enough as it is, so simplicity |
533533 | overrode accuracy. You can think of it as poetic license, or you can |
534534 | think of it as misdirection that is resolved in the |
535−| `stitched-together diagram <#Putting%20It%20All%20Together>`__. |
535+| `stitched-together diagram <Putting It All Together_>`__. |
536536 +-----------------------------------------------------------------------+
537537
538538 Grace-Period Cleanup
@@ -596,7 +596,7 @@ maintain ordering. For example, if the callback function wakes up a task · 57 unmodified lines
596596 that runs on some other CPU, proper ordering must in place in both the
597597 callback function and the task being awakened. To see why this is
598598 important, consider the top half of the `grace-period
599−cleanup <#Grace-Period%20Cleanup>`__ diagram. The callback might be
599+cleanup`_ diagram. The callback might be
600600 running on a CPU corresponding to the leftmost leaf ``rcu_node``
601601 structure, and awaken a task that is to run on a CPU corresponding to
602602 the rightmost leaf ``rcu_node`` structure, and the grace-period kernel
Documentation/RCU/Design/Requirements/Requirements.rst+10−10
@@ -45,7 +45,7 @@ requirements: · 44 unmodified lines
4545 #. `Other RCU Flavors`_
4646 #. `Possible Future Changes`_
4747
48−This is followed by a `summary <#Summary>`__, however, the answers to
48+This is followed by a summary_, however, the answers to
4949 each quick quiz immediately follows the quiz. Select the big white space
5050 with your mouse to see the answer.
5151
@@ -1096,7 +1096,7 @@ memory barriers. · 1044 unmodified lines
10961096 | case, voluntary context switch) within an RCU read-side critical |
10971097 | section. However, sleeping locks may be used within userspace RCU |
10981098 | read-side critical sections, and also within Linux-kernel sleepable |
1099−| RCU `(SRCU) <#Sleepable%20RCU>`__ read-side critical sections. In |
1099+| RCU `(SRCU) <Sleepable RCU_>`__ read-side critical sections. In |
11001100 | addition, the -rt patchset turns spinlocks into a sleeping locks so |
11011101 | that the corresponding critical sections can be preempted, which also |
11021102 | means that these sleeplockified spinlocks (but not other sleeping |
@@ -1186,7 +1186,7 @@ non-preemptible (``CONFIG_PREEMPT=n``) kernels, and thus `tiny · 83 unmodified lines
11861186 RCU <https://lkml.kernel.org/g/20090113221724.GA15307@linux.vnet.ibm.com>`__
11871187 was born. Josh Triplett has since taken over the small-memory banner
11881188 with his `Linux kernel tinification <https://tiny.wiki.kernel.org/>`__
1189−project, which resulted in `SRCU <#Sleepable%20RCU>`__ becoming optional
1189+project, which resulted in `SRCU <Sleepable RCU_>`__ becoming optional
11901190 for those kernels not needing it.
11911191
11921192 The remaining performance requirements are, for the most part,
@@ -1457,8 +1457,8 @@ will vary as the value of ``HZ`` varies, and can also be changed using · 264 unmodified lines
14571457 the relevant Kconfig options and kernel boot parameters. RCU currently
14581458 does not do much sanity checking of these parameters, so please use
14591459 caution when changing them. Note that these forward-progress measures
1460−are provided only for RCU, not for `SRCU <#Sleepable%20RCU>`__ or `Tasks
1461−RCU <#Tasks%20RCU>`__.
1460+are provided only for RCU, not for `SRCU <Sleepable RCU_>`__ or `Tasks
1461+RCU`_.
14621462
14631463 RCU takes the following steps in ``call_rcu()`` to encourage timely
14641464 invocation of callbacks when any given non-\ ``rcu_nocbs`` CPU has
@@ -1477,8 +1477,8 @@ encouragement was provided: · 12 unmodified lines
14771477
14781478 Again, these are default values when running at ``HZ=1000``, and can be
14791479 overridden. Again, these forward-progress measures are provided only for
1480−RCU, not for `SRCU <#Sleepable%20RCU>`__ or `Tasks
1481−RCU <#Tasks%20RCU>`__. Even for RCU, callback-invocation forward
1480+RCU, not for `SRCU <Sleepable RCU_>`__ or `Tasks
1481+RCU`_. Even for RCU, callback-invocation forward
14821482 progress for ``rcu_nocbs`` CPUs is much less well-developed, in part
14831483 because workloads benefiting from ``rcu_nocbs`` CPUs tend to invoke
14841484 ``call_rcu()`` relatively infrequently. If workloads emerge that need
@@ -1920,7 +1920,7 @@ Hotplug CPU · 435 unmodified lines
19201920
19211921 The Linux kernel supports CPU hotplug, which means that CPUs can come
19221922 and go. It is of course illegal to use any RCU API member from an
1923−offline CPU, with the exception of `SRCU <#Sleepable%20RCU>`__ read-side
1923+offline CPU, with the exception of `SRCU <Sleepable RCU_>`__ read-side
19241924 critical sections. This requirement was present from day one in
19251925 DYNIX/ptx, but on the other hand, the Linux kernel's CPU-hotplug
19261926 implementation is “interesting.”
@@ -2177,7 +2177,7 @@ handles these states differently: · 250 unmodified lines
21772177 However, RCU must be reliably informed as to whether any given CPU is
21782178 currently in the idle loop, and, for ``NO_HZ_FULL``, also whether that
21792179 CPU is executing in usermode, as discussed
2180−`earlier <#Energy%20Efficiency>`__. It also requires that the
2180+`earlier <Energy Efficiency_>`__. It also requires that the
21812181 scheduling-clock interrupt be enabled when RCU needs it to be:
21822182
21832183 #. If a CPU is either idle or executing in usermode, and RCU believes it
@@ -2294,7 +2294,7 @@ Performance, Scalability, Response Time, and Reliability · 110 unmodified lines
22942294 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22952295
22962296 Expanding on the `earlier
2297−discussion <#Performance%20and%20Scalability>`__, RCU is used heavily by
2297+discussion <Performance and Scalability_>`__, RCU is used heavily by
22982298 hot code paths in performance-critical portions of the Linux kernel's
22992299 networking, security, virtualization, and scheduling code paths. RCU
23002300 must therefore use efficient implementations, especially in its
Documentation/admin-guide/binfmt-misc.rst+2−2
@@ -23,7 +23,7 @@ Here is what the fields mean: · 22 unmodified lines
2323
2424 - ``name``
2525 is an identifier string. A new /proc file will be created with this
26− ``name below /proc/sys/fs/binfmt_misc``; cannot contain slashes ``/`` for
26+ name below ``/proc/sys/fs/binfmt_misc``; cannot contain slashes ``/`` for
2727 obvious reasons.
2828 - ``type``
2929 is the type of recognition. Give ``M`` for magic and ``E`` for extension.
@@ -83,7 +83,7 @@ Here is what the fields mean: · 53 unmodified lines
8383 ``F`` - fix binary
8484 The usual behaviour of binfmt_misc is to spawn the
8585 binary lazily when the misc format file is invoked. However,
86− this doesn``t work very well in the face of mount namespaces and
86+ this doesn't work very well in the face of mount namespaces and
8787 changeroots, so the ``F`` mode opens the binary as soon as the
8888 emulation is installed and uses the opened image to spawn the
8989 emulator, meaning it is always available once installed,
Documentation/admin-guide/bootconfig.rst+1−1
@@ -154,7 +154,7 @@ get the boot configuration data. · 153 unmodified lines
154154 Because of this "piggyback" method, there is no need to change or
155155 update the boot loader and the kernel image itself as long as the boot
156156 loader passes the correct initrd file size. If by any chance, the boot
157−loader passes a longer size, the kernel feils to find the bootconfig data.
157+loader passes a longer size, the kernel fails to find the bootconfig data.
158158
159159 To do this operation, Linux kernel provides "bootconfig" command under
160160 tools/bootconfig, which allows admin to apply or delete the config file
Documentation/admin-guide/cgroup-v2.rst+3−3
@@ -1029,7 +1029,7 @@ All time durations are in microseconds. · 1028 unmodified lines
10291029 one number is written, $MAX is updated.
10301030
10311031 cpu.pressure
1032− A read-only nested-key file which exists on non-root cgroups.
1032+ A read-write nested-keyed file.
10331033
10341034 Shows pressure stall information for CPU. See
10351035 :ref:`Documentation/accounting/psi.rst <psi>` for details.
@@ -1475,7 +1475,7 @@ PAGE_SIZE multiple when read back. · 439 unmodified lines
14751475 reduces the impact on the workload and memory management.
14761476
14771477 memory.pressure
1478− A read-only nested-key file which exists on non-root cgroups.
1478+ A read-only nested-keyed file.
14791479
14801480 Shows pressure stall information for memory. See
14811481 :ref:`Documentation/accounting/psi.rst <psi>` for details.
@@ -1714,7 +1714,7 @@ IO Interface Files · 232 unmodified lines
17141714 8:16 rbps=2097152 wbps=max riops=max wiops=max
17151715
17161716 io.pressure
1717− A read-only nested-key file which exists on non-root cgroups.
1717+ A read-only nested-keyed file.
17181718
17191719 Shows pressure stall information for IO. See
17201720 :ref:`Documentation/accounting/psi.rst <psi>` for details.
Documentation/admin-guide/device-mapper/dm-integrity.rst+9−3
@@ -177,14 +177,20 @@ bitmap_flush_interval:number · 176 unmodified lines
177177 The bitmap flush interval in milliseconds. The metadata buffers
178178 are synchronized when this interval expires.
179179
180+allow_discards
181+ Allow block discard requests (a.k.a. TRIM) for the integrity device.
182+ Discards are only allowed to devices using internal hash.
183+
180184 fix_padding
181185 Use a smaller padding of the tag area that is more
182186 space-efficient. If this option is not present, large padding is
183187 used - that is for compatibility with older kernels.
184188
185−allow_discards
186− Allow block discard requests (a.k.a. TRIM) for the integrity device.
187− Discards are only allowed to devices using internal hash.
189+legacy_recalculate
190+ Allow recalculating of volumes with HMAC keys. This is disabled by
191+ default for security reasons - an attacker could modify the volume,
192+ set recalc_sector to zero, and the kernel would not detect the
193+ modification.
188194
189195 The journal mode (D/J), buffer_sectors, journal_watermark, commit_time and
190196 allow_discards can be changed when reloading the target (load an inactive
Documentation/admin-guide/kernel-parameters.rst+2−2
@@ -3,8 +3,8 @@ · 2 unmodified lines
33 The kernel's command-line parameters
44 ====================================
55
6−The following is a consolidated list of the kernel parameters as
7−implemented by the __setup(), core_param() and module_param() macros
6+The following is a consolidated list of the kernel parameters as implemented
7+by the __setup(), early_param(), core_param() and module_param() macros
88 and sorted into English Dictionary order (defined as ignoring all
99 punctuation and sorting digits before letters in a case insensitive
1010 manner), and with descriptions where known.
Documentation/admin-guide/kernel-parameters.txt+10−6
@@ -1385,7 +1385,7 @@ · 1384 unmodified lines
13851385
13861386 ftrace_filter=[function-list]
13871387 [FTRACE] Limit the functions traced by the function
1388− tracer at boot up. function-list is a comma separated
1388+ tracer at boot up. function-list is a comma-separated
13891389 list of functions. This list can be changed at run
13901390 time by the set_ftrace_filter file in the debugfs
13911391 tracing directory.
@@ -1399,13 +1399,13 @@ · 7 unmodified lines
13991399 ftrace_graph_filter=[function-list]
14001400 [FTRACE] Limit the top level callers functions traced
14011401 by the function graph tracer at boot up.
1402− function-list is a comma separated list of functions
1402+ function-list is a comma-separated list of functions
14031403 that can be changed at run time by the
14041404 set_graph_function file in the debugfs tracing directory.
14051405
14061406 ftrace_graph_notrace=[function-list]
14071407 [FTRACE] Do not trace from the functions specified in
1408− function-list. This list is a comma separated list of
1408+ function-list. This list is a comma-separated list of
14091409 functions that can be changed at run time by the
14101410 set_graph_notrace file in the debugfs tracing directory.
14111411
@@ -2421,7 +2421,7 @@ · 1009 unmodified lines
24212421 when set.
24222422 Format: <int>
24232423
2424− libata.force= [LIBATA] Force configurations. The format is comma
2424+ libata.force= [LIBATA] Force configurations. The format is comma-
24252425 separated list of "[ID:]VAL" where ID is
24262426 PORT[.DEVICE]. PORT and DEVICE are decimal numbers
24272427 matching port, link or device. Basically, it matches
@@ -5145,7 +5145,7 @@ · 2717 unmodified lines
51455145
51465146 stacktrace_filter=[function-list]
51475147 [FTRACE] Limit the functions that the stack tracer
5148− will trace at boot up. function-list is a comma separated
5148+ will trace at boot up. function-list is a comma-separated
51495149 list of functions. This list can be changed at run
51505150 time by the stack_trace_filter file in the debugfs
51515151 tracing directory. Note, this enables stack tracing
@@ -5348,7 +5348,7 @@ · 196 unmodified lines
53485348 trace_event=[event-list]
53495349 [FTRACE] Set and start specified trace events in order
53505350 to facilitate early boot debugging. The event-list is a
5351− comma separated list of trace events to enable. See
5351+ comma-separated list of trace events to enable. See
53525352 also Documentation/trace/events.rst
53535353
53545354 trace_options=[option-list]
@@ -5972,6 +5972,10 @@ · 617 unmodified lines
59725972 This option is obsoleted by the "nopv" option, which
59735973 has equivalent effect for XEN platform.
59745974
5975+ xen_no_vector_callback
5976+ [KNL,X86,XEN] Disable the vector callback for Xen
5977+ event channel interrupts.
5978+
59755979 xen_scrub_pages= [XEN]
59765980 Boolean option to control scrubbing pages before giving them back
59775981 to Xen, for use by other domains. Can be also changed at runtime
Documentation/admin-guide/media/rkisp1.rst+16−0
@@ -13,6 +13,22 @@ This file documents the driver for the Rockchip ISP1 that is part of RK3288 · 12 unmodified lines
1313 and RK3399 SoCs. The driver is located under drivers/staging/media/rkisp1
1414 and uses the Media-Controller API.
1515
16+Revisions
17+=========
18+
19+There exist multiple smaller revisions to this ISP that got introduced in
20+later SoCs. Revisions can be found in the enum :c:type:`rkisp1_cif_isp_version`
21+in the UAPI and the revision of the ISP inside the running SoC can be read
22+in the field hw_revision of struct media_device_info as returned by
23+ioctl MEDIA_IOC_DEVICE_INFO.
24+
25+Versions in use are:
26+
27+- RKISP1_V10: used at least in rk3288 and rk3399
28+- RKISP1_V11: declared in the original vendor code, but not used
29+- RKISP1_V12: used at least in rk3326 and px30
30+- RKISP1_V13: used at least in rk1808
31+
1632 Topology
1733 ========
1834 .. _rkisp1_topology_graph:
Documentation/admin-guide/mm/concepts.rst+1−1
@@ -184,7 +184,7 @@ pages either asynchronously or synchronously, depending on the state · 183 unmodified lines
184184 of the system. When the system is not loaded, most of the memory is free
185185 and allocation requests will be satisfied immediately from the free
186186 pages supply. As the load increases, the amount of the free pages goes
187−down and when it reaches a certain threshold (high watermark), an
187+down and when it reaches a certain threshold (low watermark), an
188188 allocation request will awaken the ``kswapd`` daemon. It will
189189 asynchronously scan memory pages and either just free them if the data
190190 they contain is available elsewhere, or evict to the backing storage
Documentation/admin-guide/syscall-user-dispatch.rst+2−2
@@ -70,8 +70,8 @@ trampoline code on the vDSO, that trampoline is never intercepted. · 69 unmodified lines
7070 [selector] is a pointer to a char-sized region in the process memory
7171 region, that provides a quick way to enable disable syscall redirection
7272 thread-wide, without the need to invoke the kernel directly. selector
73−can be set to PR_SYS_DISPATCH_ON or PR_SYS_DISPATCH_OFF. Any other
74−value should terminate the program with a SIGSYS.
73+can be set to SYSCALL_DISPATCH_FILTER_ALLOW or SYSCALL_DISPATCH_FILTER_BLOCK.
74+Any other value should terminate the program with a SIGSYS.
7575
7676 Security Notes
7777 --------------
Documentation/asm-annotations.rst+5−0
@@ -100,6 +100,11 @@ Instruction Macros · 99 unmodified lines
100100 ~~~~~~~~~~~~~~~~~~
101101 This section covers ``SYM_FUNC_*`` and ``SYM_CODE_*`` enumerated above.
102102
103+``objtool`` requires that all code must be contained in an ELF symbol. Symbol
104+names that have a ``.L`` prefix do not emit symbol table entries. ``.L``
105+prefixed symbols can be used within a code region, but should be avoided for
106+denoting a range of code via ``SYM_*_START/END`` annotations.
107+
103108 * ``SYM_FUNC_START`` and ``SYM_FUNC_START_LOCAL`` are supposed to be **the
104109 most frequent markings**. They are used for functions with standard calling
105110 conventions -- global and local. Like in C, they both align the functions to
Documentation/core-api/index.rst+0−1
@@ -53,7 +53,6 @@ How Linux keeps everything from happening at the same time. See · 52 unmodified lines
5353 .. toctree::
5454 :maxdepth: 1
5555
56− atomic_ops
5756 refcount-vs-atomic
5857 irq/index
5958 local_ops
Documentation/dev-tools/kasan.rst+5−21
@@ -160,29 +160,13 @@ intended for use in production as a security mitigation. Therefore it supports · 159 unmodified lines
160160 boot parameters that allow to disable KASAN competely or otherwise control
161161 particular KASAN features.
162162
163−The things that can be controlled are:
163+- ``kasan=off`` or ``=on`` controls whether KASAN is enabled (default: ``on``).
164164
165−1. Whether KASAN is enabled at all.
166−2. Whether KASAN collects and saves alloc/free stacks.
167−3. Whether KASAN panics on a detected bug or not.
165+- ``kasan.stacktrace=off`` or ``=on`` disables or enables alloc and free stack
166+ traces collection (default: ``on``).
168167
169−The ``kasan.mode`` boot parameter allows to choose one of three main modes:
170−
171−- ``kasan.mode=off`` - KASAN is disabled, no tag checks are performed
172−- ``kasan.mode=prod`` - only essential production features are enabled
173−- ``kasan.mode=full`` - all KASAN features are enabled
174−
175−The chosen mode provides default control values for the features mentioned
176−above. However it's also possible to override the default values by providing:
177−
178−- ``kasan.stacktrace=off`` or ``=on`` - enable alloc/free stack collection
179− (default: ``on`` for ``mode=full``,
180− otherwise ``off``)
181−- ``kasan.fault=report`` or ``=panic`` - only print KASAN report or also panic
182− (default: ``report``)
183−
184−If ``kasan.mode`` parameter is not provided, it defaults to ``full`` when
185−``CONFIG_DEBUG_KERNEL`` is enabled, and to ``prod`` otherwise.
168+- ``kasan.fault=report`` or ``=panic`` controls whether to only print a KASAN
169+ report or also panic the kernel (default: ``report``).
186170
187171 For developers
188172 ~~~~~~~~~~~~~~
Documentation/dev-tools/kunit/usage.rst+57−0
@@ -522,6 +522,63 @@ There's more boilerplate involved, but it can: · 521 unmodified lines
522522 * E.g. if we wanted to also test ``sha256sum``, we could add a ``sha256``
523523 field and reuse ``cases``.
524524
525+* be converted to a "parameterized test", see below.
526+
527+Parameterized Testing
528+~~~~~~~~~~~~~~~~~~~~~
529+
530+The table-driven testing pattern is common enough that KUnit has special
531+support for it.
532+
533+Reusing the same ``cases`` array from above, we can write the test as a
534+"parameterized test" with the following.
535+
536+.. code-block:: c
537+
538+ // This is copy-pasted from above.
539+ struct sha1_test_case {
540+ const char *str;
541+ const char *sha1;
542+ };
543+ struct sha1_test_case cases[] = {
544+ {
545+ .str = "hello world",
546+ .sha1 = "2aae6c35c94fcfb415dbe95f408b9ce91ee846ed",
547+ },
548+ {
549+ .str = "hello world!",
550+ .sha1 = "430ce34d020724ed75a196dfc2ad67c77772d169",
551+ },
552+ };
553+
554+ // Need a helper function to generate a name for each test case.
555+ static void case_to_desc(const struct sha1_test_case *t, char *desc)
556+ {
557+ strcpy(desc, t->str);
558+ }
559+ // Creates `sha1_gen_params()` to iterate over `cases`.
560+ KUNIT_ARRAY_PARAM(sha1, cases, case_to_desc);
561+
562+ // Looks no different from a normal test.
563+ static void sha1_test(struct kunit *test)
564+ {
565+ // This function can just contain the body of the for-loop.
566+ // The former `cases[i]` is accessible under test->param_value.
567+ char out[40];
568+ struct sha1_test_case *test_param = (struct sha1_test_case *)(test->param_value);
569+
570+ sha1sum(test_param->str, out);
571+ KUNIT_EXPECT_STREQ_MSG(test, (char *)out, test_param->sha1,
572+ "sha1sum(%s)", test_param->str);
573+ }
574+
575+ // Instead of KUNIT_CASE, we use KUNIT_CASE_PARAM and pass in the
576+ // function declared by KUNIT_ARRAY_PARAM.
577+ static struct kunit_case sha1_test_cases[] = {
578+ KUNIT_CASE_PARAM(sha1_test, sha1_gen_params),
579+ {}
580+ };
581+
525582 .. _kunit-on-non-uml:
526583
527584 KUnit on non-UML architectures
Documentation/devicetree/bindings/arm/cpus.yaml+0−1
@@ -232,7 +232,6 @@ properties: · 231 unmodified lines
232232 by this cpu (see ./idle-states.yaml).
233233
234234 capacity-dmips-mhz:
235− $ref: '/schemas/types.yaml#/definitions/uint32'
236235 description:
237236 u32 value representing CPU capacity (see ./cpu-capacity.txt) in
238237 DMIPS/MHz, relative to highest capacity-dmips-mhz
Documentation/devicetree/bindings/display/bridge/sii902x.txt+1−1
@@ -40,7 +40,7 @@ Optional properties: · 39 unmodified lines
4040 documents on how to describe the way the sii902x device is
4141 connected to the rest of the audio system:
4242 Documentation/devicetree/bindings/sound/simple-card.yaml
43− Documentation/devicetree/bindings/sound/audio-graph-card.txt
43+ Documentation/devicetree/bindings/sound/audio-graph-card.yaml
4444 Note: In case of the audio-graph-card binding the used port
4545 index should be 3.
4646
Documentation/devicetree/bindings/display/mediatek/mediatek,disp.txt+2−2
@@ -23,7 +23,7 @@ connected to. · 22 unmodified lines
2323
2424 For a description of the display interface sink function blocks, see
2525 Documentation/devicetree/bindings/display/mediatek/mediatek,dsi.txt and
26−Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.txt.
26+Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml.
2727
2828 Required properties (all function blocks):
2929 - compatible: "mediatek,<chip>-disp-<function>", one of
@@ -61,7 +61,7 @@ Required properties (DMA function blocks): · 31 unmodified lines
6161 "mediatek,<chip>-disp-wdma"
6262 the supported chips are mt2701, mt8167 and mt8173.
6363 - larb: Should contain a phandle pointing to the local arbiter device as defined
64− in Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt
64+ in Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml
6565 - iommus: Should point to the respective IOMMU block with master port as
6666 argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt
6767 for details.
Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml+3−1
@@ -1,4 +1,6 @@
11 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+# Copyright (C) 2020 Texas Instruments Incorporated
3+# Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
24 %YAML 1.2
35 ---
46 $id: http://devicetree.org/schemas/dma/ti/k3-bcdma.yaml#
@@ -7,7 +9,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 2 unmodified lines
79 title: Texas Instruments K3 DMSS BCDMA Device Tree Bindings
810
911 maintainers:
10− - Peter Ujfalusi <peter.ujfalusi@ti.com>
12+ - Peter Ujfalusi <peter.ujfalusi@gmail.com>
1113
1214 description: |
1315 The Block Copy DMA (BCDMA) is intended to perform similar functions as the TR
Documentation/devicetree/bindings/dma/ti/k3-pktdma.yaml+3−1
@@ -1,4 +1,6 @@
11 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+# Copyright (C) 2020 Texas Instruments Incorporated
3+# Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
24 %YAML 1.2
35 ---
46 $id: http://devicetree.org/schemas/dma/ti/k3-pktdma.yaml#
@@ -7,7 +9,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 2 unmodified lines
79 title: Texas Instruments K3 DMSS PKTDMA Device Tree Bindings
810
911 maintainers:
10− - Peter Ujfalusi <peter.ujfalusi@ti.com>
12+ - Peter Ujfalusi <peter.ujfalusi@gmail.com>
1113
1214 description: |
1315 The Packet DMA (PKTDMA) is intended to perform similar functions as the packet
Documentation/devicetree/bindings/dma/ti/k3-udma.yaml+3−1
@@ -1,4 +1,6 @@
11 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+# Copyright (C) 2019 Texas Instruments Incorporated
3+# Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
24 %YAML 1.2
35 ---
46 $id: http://devicetree.org/schemas/dma/ti/k3-udma.yaml#
@@ -7,7 +9,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 2 unmodified lines
79 title: Texas Instruments K3 NAVSS Unified DMA Device Tree Bindings
810
911 maintainers:
10− - Peter Ujfalusi <peter.ujfalusi@ti.com>
12+ - Peter Ujfalusi <peter.ujfalusi@gmail.com>
1113
1214 description: |
1315 The UDMA-P is intended to perform similar (but significantly upgraded)
Documentation/devicetree/bindings/extcon/wlf,arizona.yaml+0−1
@@ -85,7 +85,6 @@ properties: · 84 unmodified lines
8585 wlf,micd-timeout-ms:
8686 description:
8787 Timeout for microphone detection, specified in milliseconds.
88− $ref: "/schemas/types.yaml#/definitions/uint32"
8988
9089 wlf,micd-force-micbias:
9190 description:
Documentation/devicetree/bindings/hwmon/adi,ltc2947.yaml+0−1
@@ -49,7 +49,6 @@ properties: · 48 unmodified lines
4949 description:
5050 This property controls the Accumulation Dead band which allows to set the
5151 level of current below which no accumulation takes place.
52− $ref: /schemas/types.yaml#/definitions/uint32
5352 maximum: 255
5453 default: 0
5554
Documentation/devicetree/bindings/hwmon/baikal,bt1-pvt.yaml+3−5
@@ -73,11 +73,9 @@ properties: · 72 unmodified lines
7373 description: |
7474 Temperature sensor trimming factor. It can be used to manually adjust the
7575 temperature measurements within 7.130 degrees Celsius.
76− maxItems: 1
77− items:
78− default: 0
79− minimum: 0
80− maximum: 7130
76+ default: 0
77+ minimum: 0
78+ maximum: 7130
8179
8280 additionalProperties: false
8381
Documentation/devicetree/bindings/hwmon/ti,tmp513.yaml+0−1
@@ -52,7 +52,6 @@ properties: · 51 unmodified lines
5252 ti,bus-range-microvolt:
5353 description: |
5454 This is the operating range of the bus voltage in microvolt
55− $ref: /schemas/types.yaml#/definitions/uint32
5655 enum: [16000000, 32000000]
5756 default: 32000000
5857
Documentation/devicetree/bindings/i2c/i2c-gpio.yaml+0−2
@@ -39,11 +39,9 @@ properties: · 38 unmodified lines
3939
4040 i2c-gpio,delay-us:
4141 description: delay between GPIO operations (may depend on each platform)
42− $ref: /schemas/types.yaml#/definitions/uint32
4342
4443 i2c-gpio,timeout-ms:
4544 description: timeout to get data
46− $ref: /schemas/types.yaml#/definitions/uint32
4745
4846 # Deprecated properties, do not use in new device tree sources:
4947 gpios:
Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml+0−3
@@ -66,21 +66,18 @@ properties: · 65 unmodified lines
6666 default: 400000
6767
6868 i2c-sda-hold-time-ns:
69− maxItems: 1
7069 description: |
7170 The property should contain the SDA hold time in nanoseconds. This option
7271 is only supported in hardware blocks version 1.11a or newer or on
7372 Microsemi SoCs.
7473
7574 i2c-scl-falling-time-ns:
76− maxItems: 1
7775 description: |
7876 The property should contain the SCL falling time in nanoseconds.
7977 This value is used to compute the tLOW period.
8078 default: 300
8179
8280 i2c-sda-falling-time-ns:
83− maxItems: 1
8481 description: |
8582 The property should contain the SDA falling time in nanoseconds.
8683 This value is used to compute the tHIGH period.
Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml+2−2
@@ -16,8 +16,8 @@ description: · 15 unmodified lines
1616 properties:
1717 compatible:
1818 enum:
19− - bosch,bmc150
20− - bosch,bmi055
19+ - bosch,bmc150_accel
20+ - bosch,bmi055_accel
2121 - bosch,bma255
2222 - bosch,bma250e
2323 - bosch,bma222
Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml+1−1
@@ -80,7 +80,7 @@ properties: · 79 unmodified lines
8080 type: boolean
8181
8282 bipolar:
83− description: see Documentation/devicetree/bindings/iio/adc/adc.txt
83+ description: see Documentation/devicetree/bindings/iio/adc/adc.yaml
8484 type: boolean
8585
8686 required:
Documentation/devicetree/bindings/iio/adc/maxim,max9611.yaml+0−1
@@ -23,7 +23,6 @@ properties: · 22 unmodified lines
2323 maxItems: 1
2424
2525 shunt-resistor-micro-ohms:
26− $ref: /schemas/types.yaml#/definitions/uint32
2726 description: |
2827 Value in micro Ohms of the shunt resistor connected between the RS+ and
2928 RS- inputs, across which the current is measured. Value needed to compute
Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml+0−1
@@ -246,7 +246,6 @@ patternProperties: · 245 unmodified lines
246246 Resolution (bits) to use for conversions:
247247 - can be 6, 8, 10 or 12 on stm32f4
248248 - can be 8, 10, 12, 14 or 16 on stm32h7 and stm32mp1
249− $ref: /schemas/types.yaml#/definitions/uint32
250249
251250 st,adc-channels:
252251 description: |
Documentation/devicetree/bindings/iio/adc/ti,palmas-gpadc.yaml+0−2
@@ -42,7 +42,6 @@ properties: · 41 unmodified lines
4242 const: 1
4343
4444 ti,channel0-current-microamp:
45− $ref: /schemas/types.yaml#/definitions/uint32
4645 description: Channel 0 current in uA.
4746 enum:
4847 - 0
@@ -51,7 +50,6 @@ properties: · 2 unmodified lines
5150 - 20
5251
5352 ti,channel3-current-microamp:
54− $ref: /schemas/types.yaml#/definitions/uint32
5553 description: Channel 3 current in uA.
5654 enum:
5755 - 0
Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml+26−15
@@ -46,31 +46,42 @@ properties: · 45 unmodified lines
4646 two properties must be present:
4747
4848 adi,range-microvolt:
49− $ref: /schemas/types.yaml#/definitions/int32-array
5049 description: |
5150 Voltage output range specified as <minimum, maximum>
52− enum:
53− - [[0, 5000000]]
54− - [[0, 10000000]]
55− - [[-5000000, 5000000]]
56− - [[-10000000, 10000000]]
51+ oneOf:
52+ - items:
53+ - const: 0
54+ - enum: [5000000, 10000000]
55+ - items:
56+ - const: -5000000
57+ - const: 5000000
58+ - items:
59+ - const: -10000000
60+ - const: 10000000
5761
5862 adi,range-microamp:
59− $ref: /schemas/types.yaml#/definitions/int32-array
6063 description: |
6164 Current output range specified as <minimum, maximum>
62− enum:
63− - [[0, 20000]]
64− - [[0, 24000]]
65− - [[4, 24000]]
66− - [[-20000, 20000]]
67− - [[-24000, 24000]]
68− - [[-1000, 22000]]
65+ oneOf:
66+ - items:
67+ - const: 0
68+ - enum: [20000, 24000]
69+ - items:
70+ - const: 4
71+ - const: 24000
72+ - items:
73+ - const: -20000
74+ - const: 20000
75+ - items:
76+ - const: -24000
77+ - const: 24000
78+ - items:
79+ - const: -1000
80+ - const: 22000
6981
7082 reset-gpios: true
7183
7284 adi,dc-dc-ilim-microamp:
73− $ref: /schemas/types.yaml#/definitions/uint32
7485 enum: [150000, 200000, 250000, 300000, 350000, 400000]
7586 description: |
7687 The dc-to-dc converter current limit.
Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml+0−1
@@ -21,7 +21,6 @@ properties: · 20 unmodified lines
2121 description: Connected to ADC_RDY pin.
2222
2323 maxim,led-current-microamp:
24− $ref: /schemas/types.yaml#/definitions/uint32-array
2524 minItems: 2
2625 maxItems: 2
2726 description: |
Documentation/devicetree/bindings/input/adc-keys.txt+20−2
@@ -5,7 +5,8 @@ Required properties: · 4 unmodified lines
55 - compatible: "adc-keys"
66 - io-channels: Phandle to an ADC channel
77 - io-channel-names = "buttons";
8− - keyup-threshold-microvolt: Voltage at which all the keys are considered up.
8+ - keyup-threshold-microvolt: Voltage above or equal to which all the keys are
9+ considered up.
910
1011 Optional properties:
1112 - poll-interval: Poll interval time in milliseconds
@@ -17,7 +18,12 @@ Each button (key) is represented as a sub-node of "adc-keys": · 5 unmodified lines
1718 Required subnode-properties:
1819 - label: Descriptive name of the key.
1920 - linux,code: Keycode to emit.
20− - press-threshold-microvolt: Voltage ADC input when this key is pressed.
21+ - press-threshold-microvolt: voltage above or equal to which this key is
22+ considered pressed.
23+
24+No two values of press-threshold-microvolt may be the same.
25+All values of press-threshold-microvolt must be less than
26+keyup-threshold-microvolt.
2127
2228 Example:
2329
@@ -47,3 +53,15 @@ Example: · 23 unmodified lines
4753 press-threshold-microvolt = <500000>;
4854 };
4955 };
56+
57++--------------------------------+------------------------+
58+| 2.000.000 <= value | no key pressed |
59++--------------------------------+------------------------+
60+| 1.500.000 <= value < 2.000.000 | KEY_VOLUMEUP pressed |
61++--------------------------------+------------------------+
62+| 1.000.000 <= value < 1.500.000 | KEY_VOLUMEDOWN pressed |
63++--------------------------------+------------------------+
64+| 500.000 <= value < 1.000.000 | KEY_ENTER pressed |
65++--------------------------------+------------------------+
66+| value < 500.000 | no key pressed |
67++--------------------------------+------------------------+
Documentation/devicetree/bindings/input/touchscreen/goodix.yaml+1−0
@@ -26,6 +26,7 @@ properties: · 25 unmodified lines
2626 - goodix,gt927
2727 - goodix,gt9271
2828 - goodix,gt928
29+ - goodix,gt9286
2930 - goodix,gt967
3031
3132 reg:
Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml+0−2
@@ -70,11 +70,9 @@ properties: · 69 unmodified lines
7070
7171 touchscreen-x-mm:
7272 description: horizontal length in mm of the touchscreen
73− $ref: /schemas/types.yaml#/definitions/uint32
7473
7574 touchscreen-y-mm:
7675 description: vertical length in mm of the touchscreen
77− $ref: /schemas/types.yaml#/definitions/uint32
7876
7977 dependencies:
8078 touchscreen-size-x: [ touchscreen-size-y ]
Documentation/devicetree/bindings/leds/richtek,rt8515.yaml+111−0
@@ -0,0 +1,111 @@
1+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/leds/richtek,rt8515.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: Richtek RT8515 1.5A dual channel LED driver
8+
9+maintainers:
10+ - Linus Walleij <linus.walleij@linaro.org>
11+
12+description: |
13+ The Richtek RT8515 is a dual channel (two mode) LED driver that
14+ supports driving a white LED in flash or torch mode. The maximum
15+ current for each mode is defined in hardware using two resistors
16+ RFS and RTS.
17+
18+properties:
19+ compatible:
20+ const: richtek,rt8515
21+
22+ enf-gpios:
23+ maxItems: 1
24+ description: A connection to the 'ENF' (enable flash) pin.
25+
26+ ent-gpios:
27+ maxItems: 1
28+ description: A connection to the 'ENT' (enable torch) pin.
29+
30+ richtek,rfs-ohms:
31+ minimum: 7680
32+ maximum: 367000
33+ description: The resistance value of the RFS resistor. This
34+ resistors limits the maximum flash current. This must be set
35+ for the property flash-max-microamp to work, the RFS resistor
36+ defines the range of the dimmer setting (brightness) of the
37+ flash LED.
38+
39+ richtek,rts-ohms:
40+ minimum: 7680
41+ maximum: 367000
42+ description: The resistance value of the RTS resistor. This
43+ resistors limits the maximum torch current. This must be set
44+ for the property torch-max-microamp to work, the RTS resistor
45+ defines the range of the dimmer setting (brightness) of the
46+ torch LED.
47+
48+ led:
49+ type: object
50+ $ref: common.yaml#
51+ properties:
52+ function: true
53+ color: true
54+ flash-max-timeout-us: true
55+
56+ flash-max-microamp:
57+ maximum: 700000
58+ description: The maximum current for flash mode
59+ is hardwired to the component using the RFS resistor to
60+ ground. The maximum hardware current setting is calculated
61+ according to the formula Imax = 5500 / RFS. The lowest
62+ allowed resistance value is 7.86 kOhm giving an absolute
63+ maximum current of 700mA. By setting this attribute in
64+ the device tree, you can further restrict the maximum
65+ current below the hardware limit. This requires the RFS
66+ to be defined as it defines the maximum range.
67+
68+ led-max-microamp:
69+ maximum: 700000
70+ description: The maximum current for torch mode
71+ is hardwired to the component using the RTS resistor to
72+ ground. The maximum hardware current setting is calculated
73+ according to the formula Imax = 5500 / RTS. The lowest
74+ allowed resistance value is 7.86 kOhm giving an absolute
75+ maximum current of 700mA. By setting this attribute in
76+ the device tree, you can further restrict the maximum
77+ current below the hardware limit. This requires the RTS
78+ to be defined as it defines the maximum range.
79+
80+ additionalProperties: false
81+
82+required:
83+ - compatible
84+ - ent-gpios
85+ - enf-gpios
86+ - led
87+
88+additionalProperties: false
89+
90+examples:
91+ - |
92+ #include <dt-bindings/gpio/gpio.h>
93+ #include <dt-bindings/leds/common.h>
94+
95+ led-controller {
96+ compatible = "richtek,rt8515";
97+ enf-gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>;
98+ ent-gpios = <&gpio4 13 GPIO_ACTIVE_HIGH>;
99+ richtek,rfs-ohms = <16000>;
100+ richtek,rts-ohms = <100000>;
101+
102+ led {
103+ function = LED_FUNCTION_FLASH;
104+ color = <LED_COLOR_ID_WHITE>;
105+ flash-max-timeout-us = <250000>;
106+ flash-max-microamp = <150000>;
107+ led-max-microamp = <25000>;
108+ };
109+ };
110+
111+...
Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.txt+1−1
@@ -16,7 +16,7 @@ Required properties: · 15 unmodified lines
1616 - power-domains: a phandle to the power domain, see
1717 Documentation/devicetree/bindings/power/power_domain.txt for details.
1818 - mediatek,larb: must contain the local arbiters in the current Socs, see
19− Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt
19+ Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml
2020 for details.
2121 - iommus: should point to the respective IOMMU block with master port as
2222 argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt
Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.txt+1−1
@@ -14,7 +14,7 @@ Required properties: · 13 unmodified lines
1414 - power-domains: a phandle to the power domain, see
1515 Documentation/devicetree/bindings/power/power_domain.txt for details.
1616 - mediatek,larb: must contain the local arbiters in the current SoCs, see
17− Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt
17+ Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml
1818 for details.
1919 - iommus: should point to the respective IOMMU block with master port as
2020 argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt
Documentation/devicetree/bindings/media/mediatek-mdp.txt+1−1
@@ -28,7 +28,7 @@ Required properties (DMA function blocks, child node): · 27 unmodified lines
2828 argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt
2929 for details.
3030 - mediatek,larb: must contain the local arbiters in the current Socs, see
31− Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt
31+ Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml
3232 for details.
3333
3434 Example:
Documentation/devicetree/bindings/mmc/mmc-controller.yaml+0−1
@@ -259,7 +259,6 @@ properties: · 258 unmodified lines
259259 waiting for I/O signalling and card power supply to be stable,
260260 regardless of whether pwrseq-simple is used. Default to 10ms if
261261 no available.
262− $ref: /schemas/types.yaml#/definitions/uint32
263262 default: 10
264263
265264 supports-cqe:
Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.yaml+0−2
@@ -41,13 +41,11 @@ properties: · 40 unmodified lines
4141 description:
4242 Delay in ms after powering the card and de-asserting the
4343 reset-gpios (if any).
44− $ref: /schemas/types.yaml#/definitions/uint32
4544
4645 power-off-delay-us:
4746 description:
4847 Delay in us after asserting the reset-gpios (if any)
4948 during power off of the card.
50− $ref: /schemas/types.yaml#/definitions/uint32
5149
5250 required:
5351 - compatible
Documentation/devicetree/bindings/net/ethernet-controller.yaml+0−2
@@ -122,7 +122,6 @@ properties: · 121 unmodified lines
122122 such as flow control thresholds.
123123
124124 rx-internal-delay-ps:
125− $ref: /schemas/types.yaml#/definitions/uint32
126125 description: |
127126 RGMII Receive Clock Delay defined in pico seconds.
128127 This is used for controllers that have configurable RX internal delays.
@@ -140,7 +139,6 @@ properties: · 11 unmodified lines
140139 is used for components that can have configurable fifo sizes.
141140
142141 tx-internal-delay-ps:
143− $ref: /schemas/types.yaml#/definitions/uint32
144142 description: |
145143 RGMII Transmit Clock Delay defined in pico seconds.
146144 This is used for controllers that have configurable TX internal delays.
Documentation/devicetree/bindings/net/renesas,etheravb.yaml+1−0
@@ -163,6 +163,7 @@ allOf: · 162 unmodified lines
163163 enum:
164164 - renesas,etheravb-r8a774a1
165165 - renesas,etheravb-r8a774b1
166+ - renesas,etheravb-r8a774e1
166167 - renesas,etheravb-r8a7795
167168 - renesas,etheravb-r8a7796
168169 - renesas,etheravb-r8a77961
Documentation/devicetree/bindings/net/snps,dwmac.yaml+6−3
@@ -161,7 +161,8 @@ properties: · 160 unmodified lines
161161 * snps,route-dcbcp, DCB Control Packets
162162 * snps,route-up, Untagged Packets
163163 * snps,route-multi-broad, Multicast & Broadcast Packets
164− * snps,priority, RX queue priority (Range 0x0 to 0xF)
164+ * snps,priority, bitmask of the tagged frames priorities assigned to
165+ the queue
165166
166167 snps,mtl-tx-config:
167168 $ref: /schemas/types.yaml#/definitions/phandle
@@ -188,7 +189,10 @@ properties: · 20 unmodified lines
188189 * snps,idle_slope, unlock on WoL
189190 * snps,high_credit, max write outstanding req. limit
190191 * snps,low_credit, max read outstanding req. limit
191− * snps,priority, TX queue priority (Range 0x0 to 0xF)
192+ * snps,priority, bitmask of the priorities assigned to the queue.
193+ When a PFC frame is received with priorities matching the bitmask,
194+ the queue is blocked from transmitting for the pause time specified
195+ in the PFC frame.
192196
193197 snps,reset-gpio:
194198 deprecated: true
@@ -208,7 +212,6 @@ properties: · 13 unmodified lines
208212 Triplet of delays. The 1st cell is reset pre-delay in micro
209213 seconds. The 2nd cell is reset pulse in micro seconds. The 3rd
210214 cell is reset post-delay in micro seconds.
211− $ref: /schemas/types.yaml#/definitions/uint32-array
212215 minItems: 3
213216 maxItems: 3
214217
Documentation/devicetree/bindings/power/supply/battery.yaml+0−3
@@ -83,21 +83,18 @@ properties: · 82 unmodified lines
8383 for each of the battery capacity lookup table.
8484
8585 operating-range-celsius:
86− $ref: /schemas/types.yaml#/definitions/uint32-array
8786 description: operating temperature range of a battery
8887 items:
8988 - description: minimum temperature at which battery can operate
9089 - description: maximum temperature at which battery can operate
9190
9291 ambient-celsius:
93− $ref: /schemas/types.yaml#/definitions/uint32-array
9492 description: safe range of ambient temperature
9593 items:
9694 - description: alert when ambient temperature is lower than this value
9795 - description: alert when ambient temperature is higher than this value
9896
9997 alert-celsius:
100− $ref: /schemas/types.yaml#/definitions/uint32-array
10198 description: safe range of battery temperature
10299 items:
103100 - description: alert when battery temperature is lower than this value
Documentation/devicetree/bindings/power/supply/bq2515x.yaml+0−1
@@ -50,7 +50,6 @@ properties: · 49 unmodified lines
5050 maxItems: 1
5151
5252 input-current-limit-microamp:
53− $ref: /schemas/types.yaml#/definitions/uint32
5453 description: Maximum input current in micro Amps.
5554 minimum: 50000
5655 maximum: 500000
Documentation/devicetree/bindings/regulator/dlg,da9121.yaml+0−1
@@ -62,7 +62,6 @@ properties: · 61 unmodified lines
6262 description: IRQ line information.
6363
6464 dlg,irq-polling-delay-passive-ms:
65− $ref: "/schemas/types.yaml#/definitions/uint32"
6665 minimum: 1000
6766 maximum: 10000
6867 description: |
Documentation/devicetree/bindings/regulator/fixed-regulator.yaml+0−2
@@ -72,11 +72,9 @@ properties: · 71 unmodified lines
7272
7373 startup-delay-us:
7474 description: startup time in microseconds
75− $ref: /schemas/types.yaml#/definitions/uint32
7675
7776 off-on-delay-us:
7877 description: off delay time in microseconds
79− $ref: /schemas/types.yaml#/definitions/uint32
8078
8179 enable-active-high:
8280 description:
Documentation/devicetree/bindings/regulator/nxp,pf8x00-regulator.yaml+4−2
@@ -19,7 +19,9 @@ description: | · 18 unmodified lines
1919 properties:
2020 compatible:
2121 enum:
22− - nxp,pf8x00
22+ - nxp,pf8100
23+ - nxp,pf8121a
24+ - nxp,pf8200
2325
2426 reg:
2527 maxItems: 1
@@ -118,7 +120,7 @@ examples: · 92 unmodified lines
118120 #size-cells = <0>;
119121
120122 pmic@8 {
121− compatible = "nxp,pf8x00";
123+ compatible = "nxp,pf8100";
122124 reg = <0x08>;
123125
124126 regulators {
Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.txt+1−0
@@ -44,6 +44,7 @@ First Level Nodes - PMIC · 43 unmodified lines
4444 Definition: Must be one of below:
4545 "qcom,pm8005-rpmh-regulators"
4646 "qcom,pm8009-rpmh-regulators"
47+ "qcom,pm8009-1-rpmh-regulators"
4748 "qcom,pm8150-rpmh-regulators"
4849 "qcom,pm8150l-rpmh-regulators"
4950 "qcom,pm8350-rpmh-regulators"
Documentation/devicetree/bindings/rtc/rtc.yaml+0−2
@@ -27,7 +27,6 @@ properties: · 26 unmodified lines
2727 1: chargeable
2828
2929 quartz-load-femtofarads:
30− $ref: /schemas/types.yaml#/definitions/uint32
3130 description:
3231 The capacitive load of the quartz(x-tal), expressed in femto
3332 Farad (fF). The default value shall be listed (if optional),
@@ -47,7 +46,6 @@ properties: · 13 unmodified lines
4746 deprecated: true
4847
4948 trickle-resistor-ohms:
50− $ref: /schemas/types.yaml#/definitions/uint32
5149 description:
5250 Selected resistor for trickle charger. Should be given
5351 if trickle charger should be enabled.
Documentation/devicetree/bindings/serial/pl011.yaml+0−2
@@ -88,14 +88,12 @@ properties: · 87 unmodified lines
8888 description:
8989 Rate at which poll occurs when auto-poll is set.
9090 default 100ms.
91− $ref: /schemas/types.yaml#/definitions/uint32
9291 default: 100
9392
9493 poll-timeout-ms:
9594 description:
9695 Poll timeout when auto-poll is set, default
9796 3000ms.
98− $ref: /schemas/types.yaml#/definitions/uint32
9997 default: 3000
10098
10199 required:
Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml+2−2
@@ -7,8 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines
77 title: Mediatek MT8192 with MT6359, RT1015 and RT5682 ASoC sound card driver
88
99 maintainers:
10− - Jiaxin Yu <jiaxin.yu@mediatek.com>
11− - Shane Chien <shane.chien@mediatek.com>
10+ - Jiaxin Yu <jiaxin.yu@mediatek.com>
11+ - Shane Chien <shane.chien@mediatek.com>
1212
1313 description:
1414 This binding describes the MT8192 sound card.
Documentation/devicetree/bindings/sound/sgtl5000.yaml+0−2
@@ -41,14 +41,12 @@ properties: · 40 unmodified lines
4141 values of 2k, 4k or 8k. If set to 0 it will be off. If this node is not
4242 mentioned or if the value is unknown, then micbias resistor is set to
4343 4k.
44− $ref: "/schemas/types.yaml#/definitions/uint32"
4544 enum: [ 0, 2, 4, 8 ]
4645
4746 micbias-voltage-m-volts:
4847 description: The bias voltage to be used in mVolts. The voltage can take
4948 values from 1.25V to 3V by 250mV steps. If this node is not mentioned
5049 or the value is unknown, then the value is set to 1.25V.
51− $ref: "/schemas/types.yaml#/definitions/uint32"
5250 enum: [ 1250, 1500, 1750, 2000, 2250, 2500, 2750, 3000 ]
5351
5452 lrclk-strength:
Documentation/devicetree/bindings/sound/ti,j721e-cpb-audio.yaml+3−1
@@ -1,4 +1,6 @@
11 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+# Copyright (C) 2020 Texas Instruments Incorporated
3+# Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
24 %YAML 1.2
35 ---
46 $id: http://devicetree.org/schemas/sound/ti,j721e-cpb-audio.yaml#
@@ -7,7 +9,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 2 unmodified lines
79 title: Texas Instruments J721e Common Processor Board Audio Support
810
911 maintainers:
10− - Peter Ujfalusi <peter.ujfalusi@ti.com>
12+ - Peter Ujfalusi <peter.ujfalusi@gmail.com>
1113
1214 description: |
1315 The audio support on the board is using pcm3168a codec connected to McASP10
Documentation/devicetree/bindings/sound/ti,j721e-cpb-ivi-audio.yaml+3−1
@@ -1,4 +1,6 @@
11 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+# Copyright (C) 2020 Texas Instruments Incorporated
3+# Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
24 %YAML 1.2
35 ---
46 $id: http://devicetree.org/schemas/sound/ti,j721e-cpb-ivi-audio.yaml#
@@ -7,7 +9,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 2 unmodified lines
79 title: Texas Instruments J721e Common Processor Board Audio Support
810
911 maintainers:
10− - Peter Ujfalusi <peter.ujfalusi@ti.com>
12+ - Peter Ujfalusi <peter.ujfalusi@gmail.com>
1113
1214 description: |
1315 The Infotainment board plugs into the Common Processor Board, the support of the
Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml+9−1
@@ -11,12 +11,18 @@ maintainers: · 10 unmodified lines
1111
1212 properties:
1313 compatible:
14− items:
14+ oneOf:
1515 - const: ti,j721e-usb
16+ - const: ti,am64-usb
17+ - items:
18+ - const: ti,j721e-usb
19+ - const: ti,am64-usb
1620
1721 reg:
1822 description: module registers
1923
24+ ranges: true
25+
2026 power-domains:
2127 description:
2228 PM domain provider node and an args specifier containing
@@ -58,6 +64,8 @@ properties: · 35 unmodified lines
5864 '#size-cells':
5965 const: 2
6066
67+ dma-coherent: true
68+
6169 patternProperties:
6270 "^usb@":
6371 type: object
Documentation/devicetree/bindings/watchdog/watchdog.yaml+0−1
@@ -19,7 +19,6 @@ properties: · 18 unmodified lines
1919 pattern: "^watchdog(@.*|-[0-9a-f])?$"
2020
2121 timeout-sec:
22− $ref: /schemas/types.yaml#/definitions/uint32
2322 description:
2423 Contains the watchdog timeout in seconds.
2524
Documentation/doc-guide/sphinx.rst+16−16
@@ -48,12 +48,12 @@ or ``virtualenv``, depending on how your distribution packaged Python 3. · 47 unmodified lines
4848 those versions, you should run ``pip install 'docutils==0.12'``.
4949
5050 #) It is recommended to use the RTD theme for html output. Depending
51− on the Sphinx version, it should be installed in separate,
51+ on the Sphinx version, it should be installed separately,
5252 with ``pip install sphinx_rtd_theme``.
5353
54− #) Some ReST pages contain math expressions. Due to the way Sphinx work,
54+ #) Some ReST pages contain math expressions. Due to the way Sphinx works,
5555 those expressions are written using LaTeX notation. It needs texlive
56− installed with amdfonts and amsmath in order to evaluate them.
56+ installed with amsfonts and amsmath in order to evaluate them.
5757
5858 In summary, if you want to install Sphinx version 1.7.9, you should do::
5959
@@ -128,7 +128,7 @@ Sphinx Build · 68 unmodified lines
128128 ============
129129
130130 The usual way to generate the documentation is to run ``make htmldocs`` or
131−``make pdfdocs``. There are also other formats available, see the documentation
131+``make pdfdocs``. There are also other formats available: see the documentation
132132 section of ``make help``. The generated documentation is placed in
133133 format-specific subdirectories under ``Documentation/output``.
134134
@@ -303,17 +303,17 @@ and *targets* (e.g. a ref to ``:ref:`last row <last row>``` / :ref:`last row · 168 unmodified lines
303303 - head col 3
304304 - head col 4
305305
306− * - column 1
306+ * - row 1
307307 - field 1.1
308308 - field 1.2 with autospan
309309
310− * - column 2
310+ * - row 2
311311 - field 2.1
312312 - :rspan:`1` :cspan:`1` field 2.2 - 3.3
313313
314314 * .. _`last row`:
315315
316− - column 3
316+ - row 3
317317
318318 Rendered as:
319319
@@ -325,17 +325,17 @@ Rendered as: · 5 unmodified lines
325325 - head col 3
326326 - head col 4
327327
328− * - column 1
328+ * - row 1
329329 - field 1.1
330330 - field 1.2 with autospan
331331
332− * - column 2
332+ * - row 2
333333 - field 2.1
334334 - :rspan:`1` :cspan:`1` field 2.2 - 3.3
335335
336336 * .. _`last row`:
337337
338− - column 3
338+ - row 3
339339
340340 Cross-referencing
341341 -----------------
@@ -361,7 +361,7 @@ Figures & Images · 19 unmodified lines
361361
362362 If you want to add an image, you should use the ``kernel-figure`` and
363363 ``kernel-image`` directives. E.g. to insert a figure with a scalable
364−image format use SVG (:ref:`svg_image_example`)::
364+image format, use SVG (:ref:`svg_image_example`)::
365365
366366 .. kernel-figure:: svg_image.svg
367367 :alt: simple SVG image
@@ -375,7 +375,7 @@ image format use SVG (:ref:`svg_image_example`):: · 7 unmodified lines
375375
376376 SVG image example
377377
378−The kernel figure (and image) directive support **DOT** formatted files, see
378+The kernel figure (and image) directive supports **DOT** formatted files, see
379379
380380 * DOT: http://graphviz.org/pdf/dotguide.pdf
381381 * Graphviz: http://www.graphviz.org/content/dot-language
@@ -394,7 +394,7 @@ A simple example (:ref:`hello_dot_file`):: · 12 unmodified lines
394394
395395 DOT's hello world example
396396
397−Embed *render* markups (or languages) like Graphviz's **DOT** is provided by the
397+Embedded *render* markups (or languages) like Graphviz's **DOT** are provided by the
398398 ``kernel-render`` directives.::
399399
400400 .. kernel-render:: DOT
@@ -406,7 +406,7 @@ Embed *render* markups (or languages) like Graphviz's **DOT** is provided by the · 5 unmodified lines
406406 }
407407
408408 How this will be rendered depends on the installed tools. If Graphviz is
409−installed, you will see an vector image. If not the raw markup is inserted as
409+installed, you will see a vector image. If not, the raw markup is inserted as
410410 *literal-block* (:ref:`hello_dot_render`).
411411
412412 .. _hello_dot_render:
@@ -421,8 +421,8 @@ installed, you will see an vector image. If not the raw markup is inserted as · 8 unmodified lines
421421
422422 The *render* directive has all the options known from the *figure* directive,
423423 plus option ``caption``. If ``caption`` has a value, a *figure* node is
424−inserted. If not, a *image* node is inserted. A ``caption`` is also needed, if
425−you want to refer it (:ref:`hello_svg_render`).
424+inserted. If not, an *image* node is inserted. A ``caption`` is also needed, if
425+you want to refer to it (:ref:`hello_svg_render`).
426426
427427 Embedded **SVG**::
428428
Documentation/filesystems/overlayfs.rst+8−0
@@ -586,6 +586,14 @@ without significant effort. · 585 unmodified lines
586586 The advantage of mounting with the "volatile" option is that all forms of
587587 sync calls to the upper filesystem are omitted.
588588
589+In order to avoid a giving a false sense of safety, the syncfs (and fsync)
590+semantics of volatile mounts are slightly different than that of the rest of
591+VFS. If any writeback error occurs on the upperdir's filesystem after a
592+volatile mount takes place, all sync functions will return an error. Once this
593+condition is reached, the filesystem will not recover, and every subsequent sync
594+call will return an error, even if the upperdir has not experience a new error
595+since the last sync call.
596+
589597 When overlay is mounted with "volatile" option, the directory
590598 "$workdir/work/incompat/volatile" is created. During next mount, overlay
591599 checks for this directory and refuses to mount if present. This is a strong
Documentation/firmware-guide/acpi/apei/einj.rst+2−2
@@ -50,8 +50,8 @@ The following files belong to it: · 49 unmodified lines
5050 0x00000010 Memory Uncorrectable non-fatal
5151 0x00000020 Memory Uncorrectable fatal
5252 0x00000040 PCI Express Correctable
53− 0x00000080 PCI Express Uncorrectable fatal
54− 0x00000100 PCI Express Uncorrectable non-fatal
53+ 0x00000080 PCI Express Uncorrectable non-fatal
54+ 0x00000100 PCI Express Uncorrectable fatal
5555 0x00000200 Platform Correctable
5656 0x00000400 Platform Uncorrectable non-fatal
5757 0x00000800 Platform Uncorrectable fatal
Documentation/hwmon/sbtsi_temp.rst+1−1
@@ -1,7 +1,7 @@
11 .. SPDX-License-Identifier: GPL-2.0-or-later
22
33 Kernel driver sbtsi_temp
4−==================
4+========================
55
66 Supported hardware:
77
Documentation/kbuild/gcc-plugins.rst+21−26
@@ -11,16 +11,13 @@ compiler [1]_. They are useful for runtime instrumentation and static analysis. · 10 unmodified lines
1111 We can analyse, change and add further code during compilation via
1212 callbacks [2]_, GIMPLE [3]_, IPA [4]_ and RTL passes [5]_.
1313
14−The GCC plugin infrastructure of the kernel supports all gcc versions from
15−4.5 to 6.0, building out-of-tree modules, cross-compilation and building in a
16−separate directory.
17−Plugin source files have to be compilable by both a C and a C++ compiler as well
18−because gcc versions 4.5 and 4.6 are compiled by a C compiler,
19−gcc-4.7 can be compiled by a C or a C++ compiler,
20−and versions 4.8+ can only be compiled by a C++ compiler.
14+The GCC plugin infrastructure of the kernel supports building out-of-tree
15+modules, cross-compilation and building in a separate directory.
16+Plugin source files have to be compilable by a C++ compiler.
2117
22−Currently the GCC plugin infrastructure supports only the x86, arm, arm64 and
23−powerpc architectures.
18+Currently the GCC plugin infrastructure supports only some architectures.
19+Grep "select HAVE_GCC_PLUGINS" to find out which architectures support
20+GCC plugins.
2421
2522 This infrastructure was ported from grsecurity [6]_ and PaX [7]_.
2623
@@ -47,20 +44,13 @@ Files · 20 unmodified lines
4744 This is a compatibility header for GCC plugins.
4845 It should be always included instead of individual gcc headers.
4946
50−**$(src)/scripts/gcc-plugin.sh**
51−
52− This script checks the availability of the included headers in
53− gcc-common.h and chooses the proper host compiler to build the plugins
54− (gcc-4.7 can be built by either gcc or g++).
55−
5647 **$(src)/scripts/gcc-plugins/gcc-generate-gimple-pass.h,
5748 $(src)/scripts/gcc-plugins/gcc-generate-ipa-pass.h,
5849 $(src)/scripts/gcc-plugins/gcc-generate-simple_ipa-pass.h,
5950 $(src)/scripts/gcc-plugins/gcc-generate-rtl-pass.h**
6051
6152 These headers automatically generate the registration structures for
62− GIMPLE, SIMPLE_IPA, IPA and RTL passes. They support all gcc versions
63− from 4.5 to 6.0.
53+ GIMPLE, SIMPLE_IPA, IPA and RTL passes.
6454 They should be preferred to creating the structures by hand.
6555
6656
@@ -68,21 +58,25 @@ Usage · 1 unmodified line
6858 =====
6959
7060 You must install the gcc plugin headers for your gcc version,
71−e.g., on Ubuntu for gcc-4.9::
61+e.g., on Ubuntu for gcc-10::
7262
73− apt-get install gcc-4.9-plugin-dev
63+ apt-get install gcc-10-plugin-dev
7464
7565 Or on Fedora::
7666
7767 dnf install gcc-plugin-devel
7868
79−Enable a GCC plugin based feature in the kernel config::
69+Enable the GCC plugin infrastructure and some plugin(s) you want to use
70+in the kernel config::
8071
81− CONFIG_GCC_PLUGIN_CYC_COMPLEXITY = y
72+ CONFIG_GCC_PLUGINS=y
73+ CONFIG_GCC_PLUGIN_CYC_COMPLEXITY=y
74+ CONFIG_GCC_PLUGIN_LATENT_ENTROPY=y
75+ ...
8276
83−To compile only the plugin(s)::
77+To compile the minimum tool set including the plugin(s)::
8478
85− make gcc-plugins
79+ make scripts
8680
8781 or just run the kernel make and compile the whole kernel with
8882 the cyclomatic complexity GCC plugin.
@@ -91,7 +85,8 @@ the cyclomatic complexity GCC plugin. · 2 unmodified lines
9185 4. How to add a new GCC plugin
9286 ==============================
9387
94−The GCC plugins are in $(src)/scripts/gcc-plugins/. You can use a file or a directory
95−here. It must be added to $(src)/scripts/gcc-plugins/Makefile,
96−$(src)/scripts/Makefile.gcc-plugins and $(src)/arch/Kconfig.
88+The GCC plugins are in scripts/gcc-plugins/. You need to put plugin source files
89+right under scripts/gcc-plugins/. Creating subdirectories is not supported.
90+It must be added to scripts/gcc-plugins/Makefile, scripts/Makefile.gcc-plugins
91+and a relevant Kconfig file.
9792 See the cyc_complexity_plugin.c (CONFIG_GCC_PLUGIN_CYC_COMPLEXITY) GCC plugin.
Documentation/kbuild/llvm.rst+44−0
@@ -63,6 +63,50 @@ They can be enabled individually. The full list of the parameters: :: · 62 unmodified lines
6363 Currently, the integrated assembler is disabled by default. You can pass
6464 ``LLVM_IAS=1`` to enable it.
6565
66+Supported Architectures
67+-----------------------
68+
69+LLVM does not target all of the architectures that Linux supports and
70+just because a target is supported in LLVM does not mean that the kernel
71+will build or work without any issues. Below is a general summary of
72+architectures that currently work with ``CC=clang`` or ``LLVM=1``. Level
73+of support corresponds to "S" values in the MAINTAINERS files. If an
74+architecture is not present, it either means that LLVM does not target
75+it or there are known issues. Using the latest stable version of LLVM or
76+even the development tree will generally yield the best results.
77+An architecture's ``defconfig`` is generally expected to work well,
78+certain configurations may have problems that have not been uncovered
79+yet. Bug reports are always welcome at the issue tracker below!
80+
81+.. list-table::
82+ :widths: 10 10 10
83+ :header-rows: 1
84+
85+ * - Architecture
86+ - Level of support
87+ - ``make`` command
88+ * - arm
89+ - Supported
90+ - ``LLVM=1``
91+ * - arm64
92+ - Supported
93+ - ``LLVM=1``
94+ * - mips
95+ - Maintained
96+ - ``CC=clang``
97+ * - powerpc
98+ - Maintained
99+ - ``CC=clang``
100+ * - riscv
101+ - Maintained
102+ - ``CC=clang``
103+ * - s390
104+ - Maintained
105+ - ``CC=clang``
106+ * - x86
107+ - Supported
108+ - ``LLVM=1``
109+
66110 Getting Help
67111 ------------
68112
Documentation/kbuild/makefiles.rst+2−2
@@ -598,7 +598,7 @@ more details, with real examples. · 597 unmodified lines
598598 explicitly added to $(targets).
599599
600600 Assignments to $(targets) are without $(obj)/ prefix. if_changed may be
601− used in conjunction with custom rules as defined in "3.9 Custom Rules".
601+ used in conjunction with custom rules as defined in "3.11 Custom Rules".
602602
603603 Note: It is a typical mistake to forget the FORCE prerequisite.
604604 Another common pitfall is that whitespace is sometimes significant; for
@@ -755,7 +755,7 @@ more details, with real examples. · 150 unmodified lines
755755 bits on the scripts nonetheless.
756756
757757 Kbuild provides variables $(CONFIG_SHELL), $(AWK), $(PERL),
758− $(PYTHON) and $(PYTHON3) to refer to interpreters for the respective
758+ and $(PYTHON3) to refer to interpreters for the respective
759759 scripts.
760760
761761 Example::
Documentation/kernel-hacking/locking.rst+4−4
@@ -118,11 +118,11 @@ spinlock, but you may block holding a mutex. If you can't lock a mutex, · 117 unmodified lines
118118 your task will suspend itself, and be woken up when the mutex is
119119 released. This means the CPU can do something else while you are
120120 waiting. There are many cases when you simply can't sleep (see
121−`What Functions Are Safe To Call From Interrupts? <#sleeping-things>`__),
121+`What Functions Are Safe To Call From Interrupts?`_),
122122 and so have to use a spinlock instead.
123123
124124 Neither type of lock is recursive: see
125−`Deadlock: Simple and Advanced <#deadlock>`__.
125+`Deadlock: Simple and Advanced`_.
126126
127127 Locks and Uniprocessor Kernels
128128 ------------------------------
@@ -179,7 +179,7 @@ perfect world). · 50 unmodified lines
179179
180180 Note that you can also use spin_lock_irq() or
181181 spin_lock_irqsave() here, which stop hardware interrupts
182−as well: see `Hard IRQ Context <#hard-irq-context>`__.
182+as well: see `Hard IRQ Context`_.
183183
184184 This works perfectly for UP as well: the spin lock vanishes, and this
185185 macro simply becomes local_bh_disable()
@@ -230,7 +230,7 @@ The Same Softirq · 44 unmodified lines
230230 ~~~~~~~~~~~~~~~~
231231
232232 The same softirq can run on the other CPUs: you can use a per-CPU array
233−(see `Per-CPU Data <#per-cpu-data>`__) for better performance. If you're
233+(see `Per-CPU Data`_) for better performance. If you're
234234 going so far as to use a softirq, you probably care about scalable
235235 performance enough to justify the extra complexity.
236236
Documentation/networking/device_drivers/ethernet/marvell/octeontx2.rst+36−26
@@ -164,46 +164,56 @@ Devlink health reporters · 163 unmodified lines
164164
165165 NPA Reporters
166166 -------------
167−The NPA reporters are responsible for reporting and recovering the following group of errors
167+The NPA reporters are responsible for reporting and recovering the following group of errors:
168+
168169 1. GENERAL events
170+
169171 - Error due to operation of unmapped PF.
170172 - Error due to disabled alloc/free for other HW blocks (NIX, SSO, TIM, DPI and AURA).
173+
171174 2. ERROR events
175+
172176 - Fault due to NPA_AQ_INST_S read or NPA_AQ_RES_S write.
173177 - AQ Doorbell Error.
178+
174179 3. RAS events
180+
175181 - RAS Error Reporting for NPA_AQ_INST_S/NPA_AQ_RES_S.
182+
176183 4. RVU events
184+
177185 - Error due to unmapped slot.
178186
179−Sample Output
180−-------------
181−~# devlink health
182−pci/0002:01:00.0:
183− reporter hw_npa_intr
184− state healthy error 2872 recover 2872 last_dump_date 2020-12-10 last_dump_time 09:39:09 grace_period 0 auto_recover true auto_dump true
185− reporter hw_npa_gen
186− state healthy error 2872 recover 2872 last_dump_date 2020-12-11 last_dump_time 04:43:04 grace_period 0 auto_recover true auto_dump true
187− reporter hw_npa_err
188− state healthy error 2871 recover 2871 last_dump_date 2020-12-10 last_dump_time 09:39:17 grace_period 0 auto_recover true auto_dump true
189− reporter hw_npa_ras
190− state healthy error 0 recover 0 last_dump_date 2020-12-10 last_dump_time 09:32:40 grace_period 0 auto_recover true auto_dump true
187+Sample Output::
188+
189+ ~# devlink health
190+ pci/0002:01:00.0:
191+ reporter hw_npa_intr
192+ state healthy error 2872 recover 2872 last_dump_date 2020-12-10 last_dump_time 09:39:09 grace_period 0 auto_recover true auto_dump true
193+ reporter hw_npa_gen
194+ state healthy error 2872 recover 2872 last_dump_date 2020-12-11 last_dump_time 04:43:04 grace_period 0 auto_recover true auto_dump true
195+ reporter hw_npa_err
196+ state healthy error 2871 recover 2871 last_dump_date 2020-12-10 last_dump_time 09:39:17 grace_period 0 auto_recover true auto_dump true
197+ reporter hw_npa_ras
198+ state healthy error 0 recover 0 last_dump_date 2020-12-10 last_dump_time 09:32:40 grace_period 0 auto_recover true auto_dump true
191199
192200 Each reporter dumps the
201+
193202 - Error Type
194203 - Error Register value
195204 - Reason in words
196205
197−For eg:
198−~# devlink health dump show pci/0002:01:00.0 reporter hw_npa_gen
199− NPA_AF_GENERAL:
200− NPA General Interrupt Reg : 1
201− NIX0: free disabled RX
202−~# devlink health dump show pci/0002:01:00.0 reporter hw_npa_intr
203− NPA_AF_RVU:
204− NPA RVU Interrupt Reg : 1
205− Unmap Slot Error
206−~# devlink health dump show pci/0002:01:00.0 reporter hw_npa_err
207− NPA_AF_ERR:
208− NPA Error Interrupt Reg : 4096
209− AQ Doorbell Error
206+For example::
207+
208+ ~# devlink health dump show pci/0002:01:00.0 reporter hw_npa_gen
209+ NPA_AF_GENERAL:
210+ NPA General Interrupt Reg : 1
211+ NIX0: free disabled RX
212+ ~# devlink health dump show pci/0002:01:00.0 reporter hw_npa_intr
213+ NPA_AF_RVU:
214+ NPA RVU Interrupt Reg : 1
215+ Unmap Slot Error
216+ ~# devlink health dump show pci/0002:01:00.0 reporter hw_npa_err
217+ NPA_AF_ERR:
218+ NPA Error Interrupt Reg : 4096
219+ AQ Doorbell Error
Documentation/networking/ip-sysctl.rst+13−1
@@ -1196,7 +1196,7 @@ icmp_errors_use_inbound_ifaddr - BOOLEAN · 1195 unmodified lines
11961196
11971197 If non-zero, the message will be sent with the primary address of
11981198 the interface that received the packet that caused the icmp error.
1199− This is the behaviour network many administrators will expect from
1199+ This is the behaviour many network administrators will expect from
12001200 a router. And it can make debugging complicated network layouts
12011201 much easier.
12021202
@@ -1807,12 +1807,24 @@ seg6_flowlabel - INTEGER · 604 unmodified lines
18071807 ``conf/default/*``:
18081808 Change the interface-specific default settings.
18091809
1810+ These settings would be used during creating new interfaces.
1811+
18101812
18111813 ``conf/all/*``:
18121814 Change all the interface-specific settings.
18131815
18141816 [XXX: Other special features than forwarding?]
18151817
1818+conf/all/disable_ipv6 - BOOLEAN
1819+ Changing this value is same as changing ``conf/default/disable_ipv6``
1820+ setting and also all per-interface ``disable_ipv6`` settings to the same
1821+ value.
1822+
1823+ Reading this value does not have any particular meaning. It does not say
1824+ whether IPv6 support is enabled or disabled. Returned value can be 1
1825+ also in the case when some interface has ``disable_ipv6`` set to 0 and
1826+ has configured IPv6 addresses.
1827+
18161828 conf/all/forwarding - BOOLEAN
18171829 Enable global IPv6 forwarding between all interfaces.
18181830
Documentation/networking/netdev-FAQ.rst+59−67
@@ -6,9 +6,9 @@ · 5 unmodified lines
66 netdev FAQ
77 ==========
88
9−Q: What is netdev?
10−------------------
11−A: It is a mailing list for all network-related Linux stuff. This
9+What is netdev?
10+---------------
11+It is a mailing list for all network-related Linux stuff. This
1212 includes anything found under net/ (i.e. core code like IPv6) and
1313 drivers/net (i.e. hardware specific drivers) in the Linux source tree.
1414
@@ -25,9 +25,9 @@ Aside from subsystems like that mentioned above, all network-related · 10 unmodified lines
2525 Linux development (i.e. RFC, review, comments, etc.) takes place on
2626 netdev.
2727
28−Q: How do the changes posted to netdev make their way into Linux?
29−-----------------------------------------------------------------
30−A: There are always two trees (git repositories) in play. Both are
28+How do the changes posted to netdev make their way into Linux?
29+--------------------------------------------------------------
30+There are always two trees (git repositories) in play. Both are
3131 driven by David Miller, the main network maintainer. There is the
3232 ``net`` tree, and the ``net-next`` tree. As you can probably guess from
3333 the names, the ``net`` tree is for fixes to existing code already in the
@@ -37,9 +37,9 @@ for the future release. You can find the trees here: · 3 unmodified lines
3737 - https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
3838 - https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
3939
40−Q: How often do changes from these trees make it to the mainline Linus tree?
41−----------------------------------------------------------------------------
42−A: To understand this, you need to know a bit of background information on
40+How often do changes from these trees make it to the mainline Linus tree?
41+-------------------------------------------------------------------------
42+To understand this, you need to know a bit of background information on
4343 the cadence of Linux development. Each new release starts off with a
4444 two week "merge window" where the main maintainers feed their new stuff
4545 to Linus for merging into the mainline tree. After the two weeks, the
@@ -81,7 +81,8 @@ focus for ``net`` is on stabilization and bug fixes. · 35 unmodified lines
8181
8282 Finally, the vX.Y gets released, and the whole cycle starts over.
8383
84−Q: So where are we now in this cycle?
84+So where are we now in this cycle?
85+----------------------------------
8586
8687 Load the mainline (Linus) page here:
8788
@@ -91,9 +92,9 @@ and note the top of the "tags" section. If it is rc1, it is early in · 3 unmodified lines
9192 the dev cycle. If it was tagged rc7 a week ago, then a release is
9293 probably imminent.
9394
94−Q: How do I indicate which tree (net vs. net-next) my patch should be in?
95−-------------------------------------------------------------------------
96−A: Firstly, think whether you have a bug fix or new "next-like" content.
95+How do I indicate which tree (net vs. net-next) my patch should be in?
96+----------------------------------------------------------------------
97+Firstly, think whether you have a bug fix or new "next-like" content.
9798 Then once decided, assuming that you use git, use the prefix flag, i.e.
9899 ::
99100
@@ -105,48 +106,45 @@ in the above is just the subject text of the outgoing e-mail, and you · 5 unmodified lines
105106 can manually change it yourself with whatever MUA you are comfortable
106107 with.
107108
108−Q: I sent a patch and I'm wondering what happened to it?
109−--------------------------------------------------------
110−Q: How can I tell whether it got merged?
111−A: Start by looking at the main patchworks queue for netdev:
109+I sent a patch and I'm wondering what happened to it - how can I tell whether it got merged?
110+--------------------------------------------------------------------------------------------
111+Start by looking at the main patchworks queue for netdev:
112112
113113 https://patchwork.kernel.org/project/netdevbpf/list/
114114
115115 The "State" field will tell you exactly where things are at with your
116116 patch.
117117
118−Q: The above only says "Under Review". How can I find out more?
119−----------------------------------------------------------------
120−A: Generally speaking, the patches get triaged quickly (in less than
118+The above only says "Under Review". How can I find out more?
119+-------------------------------------------------------------
120+Generally speaking, the patches get triaged quickly (in less than
121121 48h). So be patient. Asking the maintainer for status updates on your
122122 patch is a good way to ensure your patch is ignored or pushed to the
123123 bottom of the priority list.
124124
125−Q: I submitted multiple versions of the patch series
126−----------------------------------------------------
127−Q: should I directly update patchwork for the previous versions of these
128−patch series?
129−A: No, please don't interfere with the patch status on patchwork, leave
125+I submitted multiple versions of the patch series. Should I directly update patchwork for the previous versions of these patch series?
126+--------------------------------------------------------------------------------------------------------------------------------------
127+No, please don't interfere with the patch status on patchwork, leave
130128 it to the maintainer to figure out what is the most recent and current
131129 version that should be applied. If there is any doubt, the maintainer
132130 will reply and ask what should be done.
133131
134−Q: I made changes to only a few patches in a patch series should I resend only those changed?
135−---------------------------------------------------------------------------------------------
136−A: No, please resend the entire patch series and make sure you do number your
132+I made changes to only a few patches in a patch series should I resend only those changed?
133+------------------------------------------------------------------------------------------
134+No, please resend the entire patch series and make sure you do number your
137135 patches such that it is clear this is the latest and greatest set of patches
138136 that can be applied.
139137
140−Q: I submitted multiple versions of a patch series and it looks like a version other than the last one has been accepted, what should I do?
141−-------------------------------------------------------------------------------------------------------------------------------------------
142−A: There is no revert possible, once it is pushed out, it stays like that.
138+I submitted multiple versions of a patch series and it looks like a version other than the last one has been accepted, what should I do?
139+----------------------------------------------------------------------------------------------------------------------------------------
140+There is no revert possible, once it is pushed out, it stays like that.
143141 Please send incremental versions on top of what has been merged in order to fix
144142 the patches the way they would look like if your latest patch series was to be
145143 merged.
146144
147−Q: How can I tell what patches are queued up for backporting to the various stable releases?
148−--------------------------------------------------------------------------------------------
149−A: Normally Greg Kroah-Hartman collects stable commits himself, but for
145+How can I tell what patches are queued up for backporting to the various stable releases?
146+-----------------------------------------------------------------------------------------
147+Normally Greg Kroah-Hartman collects stable commits himself, but for
150148 networking, Dave collects up patches he deems critical for the
151149 networking subsystem, and then hands them off to Greg.
152150
@@ -169,11 +167,9 @@ simply clone the repo, and then git grep the mainline commit ID, e.g. · 16 unmodified lines
169167 releases/3.9.8/ipv6-fix-possible-crashes-in-ip6_cork_release.patch
170168 stable/stable-queue$
171169
172−Q: I see a network patch and I think it should be backported to stable.
173−-----------------------------------------------------------------------
174−Q: Should I request it via stable@vger.kernel.org like the references in
175−the kernel's Documentation/process/stable-kernel-rules.rst file say?
176−A: No, not for networking. Check the stable queues as per above first
170+I see a network patch and I think it should be backported to stable. Should I request it via stable@vger.kernel.org like the references in the kernel's Documentation/process/stable-kernel-rules.rst file say?
171+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
172+No, not for networking. Check the stable queues as per above first
177173 to see if it is already queued. If not, then send a mail to netdev,
178174 listing the upstream commit ID and why you think it should be a stable
179175 candidate.
@@ -190,11 +186,9 @@ mainline, the better the odds that it is an OK candidate for stable. So · 10 unmodified lines
190186 scrambling to request a commit be added the day after it appears should
191187 be avoided.
192188
193−Q: I have created a network patch and I think it should be backported to stable.
194−--------------------------------------------------------------------------------
195−Q: Should I add a Cc: stable@vger.kernel.org like the references in the
196−kernel's Documentation/ directory say?
197−A: No. See above answer. In short, if you think it really belongs in
189+I have created a network patch and I think it should be backported to stable. Should I add a Cc: stable@vger.kernel.org like the references in the kernel's Documentation/ directory say?
190+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
191+No. See above answer. In short, if you think it really belongs in
198192 stable, then ensure you write a decent commit log that describes who
199193 gets impacted by the bug fix and how it manifests itself, and when the
200194 bug was introduced. If you do that properly, then the commit will get
@@ -207,18 +201,18 @@ marker line as described in · 6 unmodified lines
207201 :ref:`Documentation/process/submitting-patches.rst <the_canonical_patch_format>`
208202 to temporarily embed that information into the patch that you send.
209203
210−Q: Are all networking bug fixes backported to all stable releases?
211−------------------------------------------------------------------
212−A: Due to capacity, Dave could only take care of the backports for the
204+Are all networking bug fixes backported to all stable releases?
205+---------------------------------------------------------------
206+Due to capacity, Dave could only take care of the backports for the
213207 last two stable releases. For earlier stable releases, each stable
214208 branch maintainer is supposed to take care of them. If you find any
215209 patch is missing from an earlier stable branch, please notify
216210 stable@vger.kernel.org with either a commit ID or a formal patch
217211 backported, and CC Dave and other relevant networking developers.
218212
219−Q: Is the comment style convention different for the networking content?
220−------------------------------------------------------------------------
221−A: Yes, in a largely trivial way. Instead of this::
213+Is the comment style convention different for the networking content?
214+---------------------------------------------------------------------
215+Yes, in a largely trivial way. Instead of this::
222216
223217 /*
224218 * foobar blah blah blah
@@ -231,32 +225,30 @@ it is requested that you make it look like this:: · 6 unmodified lines
231225 * another line of text
232226 */
233227
234−Q: I am working in existing code that has the former comment style and not the latter.
235−--------------------------------------------------------------------------------------
236−Q: Should I submit new code in the former style or the latter?
237−A: Make it the latter style, so that eventually all code in the domain
228+I am working in existing code that has the former comment style and not the latter. Should I submit new code in the former style or the latter?
229+-----------------------------------------------------------------------------------------------------------------------------------------------
230+Make it the latter style, so that eventually all code in the domain
238231 of netdev is of this format.
239232
240−Q: I found a bug that might have possible security implications or similar.
241−---------------------------------------------------------------------------
242−Q: Should I mail the main netdev maintainer off-list?**
243−A: No. The current netdev maintainer has consistently requested that
233+I found a bug that might have possible security implications or similar. Should I mail the main netdev maintainer off-list?
234+---------------------------------------------------------------------------------------------------------------------------
235+No. The current netdev maintainer has consistently requested that
244236 people use the mailing lists and not reach out directly. If you aren't
245237 OK with that, then perhaps consider mailing security@kernel.org or
246238 reading about http://oss-security.openwall.org/wiki/mailing-lists/distros
247239 as possible alternative mechanisms.
248240
249−Q: What level of testing is expected before I submit my change?
250−---------------------------------------------------------------
251−A: If your changes are against ``net-next``, the expectation is that you
241+What level of testing is expected before I submit my change?
242+------------------------------------------------------------
243+If your changes are against ``net-next``, the expectation is that you
252244 have tested by layering your changes on top of ``net-next``. Ideally
253245 you will have done run-time testing specific to your change, but at a
254246 minimum, your changes should survive an ``allyesconfig`` and an
255247 ``allmodconfig`` build without new warnings or failures.
256248
257−Q: How do I post corresponding changes to user space components?
258−----------------------------------------------------------------
259−A: User space code exercising kernel features should be posted
249+How do I post corresponding changes to user space components?
250+-------------------------------------------------------------
251+User space code exercising kernel features should be posted
260252 alongside kernel patches. This gives reviewers a chance to see
261253 how any new interface is used and how well it works.
262254
@@ -280,9 +272,9 @@ to the mailing list, e.g.:: · 17 unmodified lines
280272 Posting as one thread is discouraged because it confuses patchwork
281273 (as of patchwork 2.2.2).
282274
283−Q: Any other tips to help ensure my net/net-next patch gets OK'd?
284−-----------------------------------------------------------------
285−A: Attention to detail. Re-read your own work as if you were the
275+Any other tips to help ensure my net/net-next patch gets OK'd?
276+--------------------------------------------------------------
277+Attention to detail. Re-read your own work as if you were the
286278 reviewer. You can start with using ``checkpatch.pl``, perhaps even with
287279 the ``--strict`` flag. But do not be mindlessly robotic in doing so.
288280 If your change is a bug fix, make sure your commit log indicates the
Documentation/networking/netdevices.rst+167−8
@@ -10,18 +10,177 @@ Introduction · 9 unmodified lines
1010 The following is a random collection of documentation regarding
1111 network devices.
1212
13−struct net_device allocation rules
14−==================================
13+struct net_device lifetime rules
14+================================
1515 Network device structures need to persist even after module is unloaded and
1616 must be allocated with alloc_netdev_mqs() and friends.
1717 If device has registered successfully, it will be freed on last use
18−by free_netdev(). This is required to handle the pathologic case cleanly
19−(example: rmmod mydriver </sys/class/net/myeth/mtu )
18+by free_netdev(). This is required to handle the pathological case cleanly
19+(example: ``rmmod mydriver </sys/class/net/myeth/mtu``)
2020
21−alloc_netdev_mqs()/alloc_netdev() reserve extra space for driver
21+alloc_netdev_mqs() / alloc_netdev() reserve extra space for driver
2222 private data which gets freed when the network device is freed. If
2323 separately allocated data is attached to the network device
24−(netdev_priv(dev)) then it is up to the module exit handler to free that.
24+(netdev_priv()) then it is up to the module exit handler to free that.
25+
26+There are two groups of APIs for registering struct net_device.
27+First group can be used in normal contexts where ``rtnl_lock`` is not already
28+held: register_netdev(), unregister_netdev().
29+Second group can be used when ``rtnl_lock`` is already held:
30+register_netdevice(), unregister_netdevice(), free_netdevice().
31+
32+Simple drivers
33+--------------
34+
35+Most drivers (especially device drivers) handle lifetime of struct net_device
36+in context where ``rtnl_lock`` is not held (e.g. driver probe and remove paths).
37+
38+In that case the struct net_device registration is done using
39+the register_netdev(), and unregister_netdev() functions:
40+
41+.. code-block:: c
42+
43+ int probe()
44+ {
45+ struct my_device_priv *priv;
46+ int err;
47+
48+ dev = alloc_netdev_mqs(...);
49+ if (!dev)
50+ return -ENOMEM;
51+ priv = netdev_priv(dev);
52+
53+ /* ... do all device setup before calling register_netdev() ...
54+ */
55+
56+ err = register_netdev(dev);
57+ if (err)
58+ goto err_undo;
59+
60+ /* net_device is visible to the user! */
61+
62+ err_undo:
63+ /* ... undo the device setup ... */
64+ free_netdev(dev);
65+ return err;
66+ }
67+
68+ void remove()
69+ {
70+ unregister_netdev(dev);
71+ free_netdev(dev);
72+ }
73+
74+Note that after calling register_netdev() the device is visible in the system.
75+Users can open it and start sending / receiving traffic immediately,
76+or run any other callback, so all initialization must be done prior to
77+registration.
78+
79+unregister_netdev() closes the device and waits for all users to be done
80+with it. The memory of struct net_device itself may still be referenced
81+by sysfs but all operations on that device will fail.
82+
83+free_netdev() can be called after unregister_netdev() returns on when
84+register_netdev() failed.
85+
86+Device management under RTNL
87+----------------------------
88+
89+Registering struct net_device while in context which already holds
90+the ``rtnl_lock`` requires extra care. In those scenarios most drivers
91+will want to make use of struct net_device's ``needs_free_netdev``
92+and ``priv_destructor`` members for freeing of state.
93+
94+Example flow of netdev handling under ``rtnl_lock``:
95+
96+.. code-block:: c
97+
98+ static void my_setup(struct net_device *dev)
99+ {
100+ dev->needs_free_netdev = true;
101+ }
102+
103+ static void my_destructor(struct net_device *dev)
104+ {
105+ some_obj_destroy(priv->obj);
106+ some_uninit(priv);
107+ }
108+
109+ int create_link()
110+ {
111+ struct my_device_priv *priv;
112+ int err;
113+
114+ ASSERT_RTNL();
115+
116+ dev = alloc_netdev(sizeof(*priv), "net%d", NET_NAME_UNKNOWN, my_setup);
117+ if (!dev)
118+ return -ENOMEM;
119+ priv = netdev_priv(dev);
120+
121+ /* Implicit constructor */
122+ err = some_init(priv);
123+ if (err)
124+ goto err_free_dev;
125+
126+ priv->obj = some_obj_create();
127+ if (!priv->obj) {
128+ err = -ENOMEM;
129+ goto err_some_uninit;
130+ }
131+ /* End of constructor, set the destructor: */
132+ dev->priv_destructor = my_destructor;
133+
134+ err = register_netdevice(dev);
135+ if (err)
136+ /* register_netdevice() calls destructor on failure */
137+ goto err_free_dev;
138+
139+ /* If anything fails now unregister_netdevice() (or unregister_netdev())
140+ * will take care of calling my_destructor and free_netdev().
141+ */
142+
143+ return 0;
144+
145+ err_some_uninit:
146+ some_uninit(priv);
147+ err_free_dev:
148+ free_netdev(dev);
149+ return err;
150+ }
151+
152+If struct net_device.priv_destructor is set it will be called by the core
153+some time after unregister_netdevice(), it will also be called if
154+register_netdevice() fails. The callback may be invoked with or without
155+``rtnl_lock`` held.
156+
157+There is no explicit constructor callback, driver "constructs" the private
158+netdev state after allocating it and before registration.
159+
160+Setting struct net_device.needs_free_netdev makes core call free_netdevice()
161+automatically after unregister_netdevice() when all references to the device
162+are gone. It only takes effect after a successful call to register_netdevice()
163+so if register_netdevice() fails driver is responsible for calling
164+free_netdev().
165+
166+free_netdev() is safe to call on error paths right after unregister_netdevice()
167+or when register_netdevice() fails. Parts of netdev (de)registration process
168+happen after ``rtnl_lock`` is released, therefore in those cases free_netdev()
169+will defer some of the processing until ``rtnl_lock`` is released.
170+
171+Devices spawned from struct rtnl_link_ops should never free the
172+struct net_device directly.
173+
174+.ndo_init and .ndo_uninit
175+~~~~~~~~~~~~~~~~~~~~~~~~~
176+
177+``.ndo_init`` and ``.ndo_uninit`` callbacks are called during net_device
178+registration and de-registration, under ``rtnl_lock``. Drivers can use
179+those e.g. when parts of their init process need to run under ``rtnl_lock``.
180+
181+``.ndo_init`` runs before device is visible in the system, ``.ndo_uninit``
182+runs during de-registering after device is closed but other subsystems
183+may still have outstanding references to the netdevice.
25184
26185 MTU
27186 ===
@@ -64,8 +223,8 @@ ndo_do_ioctl: · 36 unmodified lines
64223 Context: process
65224
66225 ndo_get_stats:
67− Synchronization: dev_base_lock rwlock.
68− Context: nominally process, but don't sleep inside an rwlock
226+ Synchronization: rtnl_lock() semaphore, dev_base_lock rwlock, or RCU.
227+ Context: atomic (can't sleep under rwlock or RCU)
69228
70229 ndo_start_xmit:
71230 Synchronization: __netif_tx_lock spinlock.
Documentation/networking/packet_mmap.rst+5−6
@@ -8,7 +8,7 @@ Abstract · 7 unmodified lines
88 ========
99
1010 This file documents the mmap() facility available with the PACKET
11−socket interface on 2.4/2.6/3.x kernels. This type of sockets is used for
11+socket interface. This type of sockets is used for
1212
1313 i) capture network traffic with utilities like tcpdump,
1414 ii) transmit network traffic, or any other that needs raw
@@ -25,12 +25,12 @@ Please send your comments to · 10 unmodified lines
2525 Why use PACKET_MMAP
2626 ===================
2727
28−In Linux 2.4/2.6/3.x if PACKET_MMAP is not enabled, the capture process is very
28+Non PACKET_MMAP capture process (plain AF_PACKET) is very
2929 inefficient. It uses very limited buffers and requires one system call to
3030 capture each packet, it requires two if you want to get packet's timestamp
3131 (like libpcap always does).
3232
33−In the other hand PACKET_MMAP is very efficient. PACKET_MMAP provides a size
33+On the other hand PACKET_MMAP is very efficient. PACKET_MMAP provides a size
3434 configurable circular buffer mapped in user space that can be used to either
3535 send or receive packets. This way reading packets just needs to wait for them,
3636 most of the time there is no need to issue a single system call. Concerning
@@ -252,8 +252,7 @@ PACKET_MMAP setting constraints · 215 unmodified lines
252252
253253 In kernel versions prior to 2.4.26 (for the 2.4 branch) and 2.6.5 (2.6 branch),
254254 the PACKET_MMAP buffer could hold only 32768 frames in a 32 bit architecture or
255−16384 in a 64 bit architecture. For information on these kernel versions
256−see http://pusa.uv.es/~ulisses/packet_mmap/packet_mmap.pre-2.4.26_2.6.5.txt
255+16384 in a 64 bit architecture.
257256
258257 Block size limit
259258 ----------------
@@ -437,7 +436,7 @@ and the following flags apply: · 177 unmodified lines
437436 Capture process
438437 ^^^^^^^^^^^^^^^
439438
440− from include/linux/if_packet.h
439+From include/linux/if_packet.h::
441440
442441 #define TP_STATUS_COPY (1 << 1)
443442 #define TP_STATUS_LOSING (1 << 2)
Documentation/networking/tls-offload.rst+4−1
@@ -530,7 +530,10 @@ TLS device feature flags only control adding of new TLS connection · 529 unmodified lines
530530 offloads, old connections will remain active after flags are cleared.
531531
532532 TLS encryption cannot be offloaded to devices without checksum calculation
533−offload. Hence, TLS TX device feature flag requires NETIF_F_HW_CSUM being set.
533+offload. Hence, TLS TX device feature flag requires TX csum offload being set.
534534 Disabling the latter implies clearing the former. Disabling TX checksum offload
535535 should not affect old connections, and drivers should make sure checksum
536536 calculation does not break for them.
537+Similarly, device-offloaded TLS decryption implies doing RXCSUM. If the user
538+does not want to enable RX csum offload, TLS RX device feature is disabled
539+as well.
Documentation/process/4.Coding.rst+2−4
@@ -249,10 +249,8 @@ features; most of these are found in the "kernel hacking" submenu. Several · 248 unmodified lines
249249 of these options should be turned on for any kernel used for development or
250250 testing purposes. In particular, you should turn on:
251251
252− - ENABLE_MUST_CHECK and FRAME_WARN to get an
253− extra set of warnings for problems like the use of deprecated interfaces
254− or ignoring an important return value from a function. The output
255− generated by these warnings can be verbose, but one need not worry about
252+ - FRAME_WARN to get warnings for stack frames larger than a given amount.
253+ The output generated can be verbose, but one need not worry about
256254 warnings from other parts of the kernel.
257255
258256 - DEBUG_OBJECTS will add code to track the lifetime of various objects
Documentation/sound/alsa-configuration.rst+1−1
@@ -1501,7 +1501,7 @@ Module for Digigram miXart8 sound cards. · 1500 unmodified lines
15011501
15021502 This module supports multiple cards.
15031503 Note: One miXart8 board will be represented as 4 alsa cards.
1504−See MIXART.txt for details.
1504+See Documentation/sound/cards/mixart.rst for details.
15051505
15061506 When the driver is compiled as a module and the hotplug firmware
15071507 is supported, the firmware data is loaded via hotplug automatically.
Documentation/sound/kernel-api/writing-an-alsa-driver.rst+8−8
@@ -71,7 +71,7 @@ core/oss · 70 unmodified lines
7171 The codes for PCM and mixer OSS emulation modules are stored in this
7272 directory. The rawmidi OSS emulation is included in the ALSA rawmidi
7373 code since it's quite small. The sequencer code is stored in
74−``core/seq/oss`` directory (see `below <#core-seq-oss>`__).
74+``core/seq/oss`` directory (see `below <core/seq/oss_>`__).
7575
7676 core/seq
7777 ~~~~~~~~
@@ -382,7 +382,7 @@ where ``enable[dev]`` is the module option. · 304 unmodified lines
382382 Each time the ``probe`` callback is called, check the availability of
383383 the device. If not available, simply increment the device index and
384384 returns. dev will be incremented also later (`step 7
385−<#set-the-pci-driver-data-and-return-zero>`__).
385+<7) Set the PCI driver data and return zero._>`__).
386386
387387 2) Create a card instance
388388 ~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -450,10 +450,10 @@ field contains the information shown in ``/proc/asound/cards``. · 61 unmodified lines
450450 5) Create other components, such as mixer, MIDI, etc.
451451 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
452452
453−Here you define the basic components such as `PCM <#PCM-Interface>`__,
454−mixer (e.g. `AC97 <#API-for-AC97-Codec>`__), MIDI (e.g.
455−`MPU-401 <#MIDI-MPU401-UART-Interface>`__), and other interfaces.
456−Also, if you want a `proc file <#Proc-Interface>`__, define it here,
453+Here you define the basic components such as `PCM <PCM Interface_>`__,
454+mixer (e.g. `AC97 <API for AC97 Codec_>`__), MIDI (e.g.
455+`MPU-401 <MIDI (MPU401-UART) Interface_>`__), and other interfaces.
456+Also, if you want a `proc file <Proc Interface_>`__, define it here,
457457 too.
458458
459459 6) Register the card instance.
@@ -941,7 +941,7 @@ The allocation of an interrupt source is done like this: · 481 unmodified lines
941941 chip->irq = pci->irq;
942942
943943 where :c:func:`snd_mychip_interrupt()` is the interrupt handler
944−defined `later <#pcm-interface-interrupt-handler>`__. Note that
944+defined `later <PCM Interrupt Handler_>`__. Note that
945945 ``chip->irq`` should be defined only when :c:func:`request_irq()`
946946 succeeded.
947947
@@ -3104,7 +3104,7 @@ processing the output stream in the irq handler. · 2156 unmodified lines
31043104
31053105 If the MPU-401 interface shares its interrupt with the other logical
31063106 devices on the card, set ``MPU401_INFO_IRQ_HOOK`` (see
3107−`below <#MIDI-Interrupt-Handler>`__).
3107+`below <MIDI Interrupt Handler_>`__).
31083108
31093109 Usually, the port address corresponds to the command port and port + 1
31103110 corresponds to the data port. If not, you may change the ``cport``
Documentation/virt/kvm/api.rst+18−12
@@ -360,10 +360,9 @@ since the last call to this ioctl. Bit 0 is the first page in the · 359 unmodified lines
360360 memory slot. Ensure the entire structure is cleared to avoid padding
361361 issues.
362362
363−If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 specifies
364−the address space for which you want to return the dirty bitmap.
365−They must be less than the value that KVM_CHECK_EXTENSION returns for
366−the KVM_CAP_MULTI_ADDRESS_SPACE capability.
363+If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 of slot field specifies
364+the address space for which you want to return the dirty bitmap. See
365+KVM_SET_USER_MEMORY_REGION for details on the usage of slot field.
367366
368367 The bits in the dirty bitmap are cleared before the ioctl returns, unless
369368 KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 is enabled. For more information,
@@ -392,9 +391,14 @@ This ioctl is obsolete and has been removed. · 22 unmodified lines
392391
393392 Errors:
394393
395− ===== =============================
394+ ======= ==============================================================
396395 EINTR an unmasked signal is pending
397− ===== =============================
396+ ENOEXEC the vcpu hasn't been initialized or the guest tried to execute
397+ instructions from device memory (arm64)
398+ ENOSYS data abort outside memslots with no syndrome info and
399+ KVM_CAP_ARM_NISV_TO_USER not enabled (arm64)
400+ EPERM SVE feature set but not finalized (arm64)
401+ ======= ==============================================================
398402
399403 This ioctl is used to run a guest virtual cpu. While there are no
400404 explicit parameters, there is an implicit parameter block that can be
@@ -1276,6 +1280,9 @@ field userspace_addr, which must point at user addressable memory for · 875 unmodified lines
12761280 the entire memory slot size. Any object may back this memory, including
12771281 anonymous memory, ordinary files, and hugetlbfs.
12781282
1283+On architectures that support a form of address tagging, userspace_addr must
1284+be an untagged address.
1285+
12791286 It is recommended that the lower 21 bits of guest_phys_addr and userspace_addr
12801287 be identical. This allows large pages in the guest to be backed by large
12811288 pages in the host.
@@ -1328,7 +1335,7 @@ documentation when it pops into existence). · 46 unmodified lines
13281335
13291336 :Capability: KVM_CAP_ENABLE_CAP_VM
13301337 :Architectures: all
1331−:Type: vcpu ioctl
1338+:Type: vm ioctl
13321339 :Parameters: struct kvm_enable_cap (in)
13331340 :Returns: 0 on success; -1 on error
13341341
@@ -4427,7 +4434,7 @@ to I/O ports. · 3092 unmodified lines
44274434 :Capability: KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2
44284435 :Architectures: x86, arm, arm64, mips
44294436 :Type: vm ioctl
4430−:Parameters: struct kvm_dirty_log (in)
4437+:Parameters: struct kvm_clear_dirty_log (in)
44314438 :Returns: 0 on success, -1 on error
44324439
44334440 ::
@@ -4454,10 +4461,9 @@ in KVM's dirty bitmap, and dirty tracking is re-enabled for that page · 20 unmodified lines
44544461 (for example via write-protection, or by clearing the dirty bit in
44554462 a page table entry).
44564463
4457−If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 specifies
4458−the address space for which you want to return the dirty bitmap.
4459−They must be less than the value that KVM_CHECK_EXTENSION returns for
4460−the KVM_CAP_MULTI_ADDRESS_SPACE capability.
4464+If KVM_CAP_MULTI_ADDRESS_SPACE is available, bits 16-31 of slot field specifies
4465+the address space for which you want to clear the dirty status. See
4466+KVM_SET_USER_MEMORY_REGION for details on the usage of slot field.
44614467
44624468 This ioctl is mostly useful when KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2
44634469 is enabled; for more information, see the description of the capability.
Documentation/virt/kvm/nested-vmx.rst+4−2
@@ -37,8 +37,10 @@ call L2. · 36 unmodified lines
3737 Running nested VMX
3838 ------------------
3939
40−The nested VMX feature is disabled by default. It can be enabled by giving
41−the "nested=1" option to the kvm-intel module.
40+The nested VMX feature is enabled by default since Linux kernel v4.20. For
41+older Linux kernel, it can be enabled by giving the "nested=1" option to the
42+kvm-intel module.
43+
4244
4345 No modifications are required to user space (qemu). However, qemu's default
4446 emulated CPU type (qemu64) does not list the "VMX" CPU feature, so it must be
Documentation/virt/kvm/running-nested-guests.rst+1−1
@@ -74,7 +74,7 @@ few: · 73 unmodified lines
7474 Enabling "nested" (x86)
7575 -----------------------
7676
77−From Linux kernel v4.19 onwards, the ``nested`` KVM parameter is enabled
77+From Linux kernel v4.20 onwards, the ``nested`` KVM parameter is enabled
7878 by default for Intel and AMD. (Though your Linux distribution might
7979 override this default.)
8080
MAINTAINERS+77−61
@@ -203,8 +203,8 @@ F: include/uapi/linux/nl80211.h · 202 unmodified lines
203203 F: net/wireless/
204204
205205 8169 10/100/1000 GIGABIT ETHERNET DRIVER
206−M: Realtek linux nic maintainers <nic_swsd@realtek.com>
207206 M: Heiner Kallweit <hkallweit1@gmail.com>
207+M: nic_swsd@realtek.com
208208 L: netdev@vger.kernel.org
209209 S: Maintained
210210 F: drivers/net/ethernet/realtek/r8169*
@@ -820,7 +820,6 @@ M: Netanel Belgazal <netanel@amazon.com> · 609 unmodified lines
820820 M: Arthur Kiyanovski <akiyano@amazon.com>
821821 R: Guy Tzalik <gtzalik@amazon.com>
822822 R: Saeed Bishara <saeedb@amazon.com>
823−R: Zorik Machulsky <zorik@amazon.com>
824823 L: netdev@vger.kernel.org
825824 S: Supported
826825 F: Documentation/networking/device_drivers/ethernet/amazon/ena.rst
@@ -907,7 +906,7 @@ AMD KFD · 80 unmodified lines
907906 M: Felix Kuehling <Felix.Kuehling@amd.com>
908907 L: amd-gfx@lists.freedesktop.org
909908 S: Supported
910−T: git git://people.freedesktop.org/~agd5f/linux
909+T: git https://gitlab.freedesktop.org/agd5f/linux.git
911910 F: drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd*.[ch]
912911 F: drivers/gpu/drm/amd/amdkfd/
913912 F: drivers/gpu/drm/amd/include/cik_structs.h
@@ -2119,7 +2118,7 @@ N: atmel · 1205 unmodified lines
21192118 ARM/Microchip Sparx5 SoC support
21202119 M: Lars Povlsen <lars.povlsen@microchip.com>
21212120 M: Steen Hegelund <Steen.Hegelund@microchip.com>
2122−M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
2121+M: UNGLinuxDriver@microchip.com
21232122 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
21242123 S: Supported
21252124 T: git git://github.com/microchip-ung/linux-upstream.git
@@ -2617,8 +2616,8 @@ S: Maintained · 491 unmodified lines
26172616 F: drivers/power/reset/keystone-reset.c
26182617
26192618 ARM/TEXAS INSTRUMENTS K3 ARCHITECTURE
2620−M: Tero Kristo <t-kristo@ti.com>
26212619 M: Nishanth Menon <nm@ti.com>
2620+M: Tero Kristo <kristo@kernel.org>
26222621 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
26232622 S: Supported
26242623 F: Documentation/devicetree/bindings/arm/ti/k3.yaml
@@ -2942,7 +2941,6 @@ S: Maintained · 317 unmodified lines
29422941 F: drivers/hwmon/asus_atk0110.c
29432942
29442943 ATLX ETHERNET DRIVERS
2945−M: Jay Cliburn <jcliburn@gmail.com>
29462944 M: Chris Snook <chris.snook@gmail.com>
29472945 L: netdev@vger.kernel.org
29482946 S: Maintained
@@ -3241,6 +3239,7 @@ L: netdev@vger.kernel.org · 292 unmodified lines
32413239 S: Supported
32423240 W: http://sourceforge.net/projects/bonding/
32433241 F: drivers/net/bonding/
3242+F: include/net/bonding.h
32443243 F: include/uapi/linux/if_bonding.h
32453244
32463245 BOSCH SENSORTEC BMA400 ACCELEROMETER IIO DRIVER
@@ -3336,7 +3335,7 @@ F: arch/riscv/net/ · 89 unmodified lines
33363335 X: arch/riscv/net/bpf_jit_comp64.c
33373336
33383337 BPF JIT for RISC-V (64-bit)
3339−M: Björn Töpel <bjorn.topel@gmail.com>
3338+M: Björn Töpel <bjorn@kernel.org>
33403339 L: netdev@vger.kernel.org
33413340 L: bpf@vger.kernel.org
33423341 S: Maintained
@@ -3413,7 +3412,7 @@ F: Documentation/devicetree/bindings/pci/brcm,stb-pcie.yaml · 70 unmodified lines
34133412 F: drivers/pci/controller/pcie-brcmstb.c
34143413 F: drivers/staging/vc04_services
34153414 N: bcm2711
3416−N: bcm2835
3415+N: bcm283*
34173416
34183417 BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITECTURE
34193418 M: Florian Fainelli <f.fainelli@gmail.com>
@@ -3556,7 +3555,7 @@ S: Supported · 136 unmodified lines
35563555 F: drivers/net/ethernet/broadcom/bnxt/
35573556
35583557 BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER
3559−M: Arend van Spriel <arend.vanspriel@broadcom.com>
3558+M: Arend van Spriel <aspriel@gmail.com>
35603559 M: Franky Lin <franky.lin@broadcom.com>
35613560 M: Hante Meuleman <hante.meuleman@broadcom.com>
35623561 M: Chi-hsien Lin <chi-hsien.lin@infineon.com>
@@ -3881,9 +3880,9 @@ F: Documentation/devicetree/bindings/mtd/cadence-nand-controller.txt · 318 unmodified lines
38813880 F: drivers/mtd/nand/raw/cadence-nand-controller.c
38823881
38833882 CADENCE USB3 DRD IP DRIVER
3884−M: Peter Chen <peter.chen@nxp.com>
3883+M: Peter Chen <peter.chen@kernel.org>
38853884 M: Pawel Laszczak <pawell@cadence.com>
3886−M: Roger Quadros <rogerq@ti.com>
3885+R: Roger Quadros <rogerq@kernel.org>
38873886 R: Aswath Govindraju <a-govindraju@ti.com>
38883887 L: linux-usb@vger.kernel.org
38893888 S: Maintained
@@ -3961,7 +3960,7 @@ F: net/can/ · 71 unmodified lines
39613960 CAN-J1939 NETWORK LAYER
39623961 M: Robin van der Gracht <robin@protonic.nl>
39633962 M: Oleksij Rempel <o.rempel@pengutronix.de>
3964−R: Pengutronix Kernel Team <kernel@pengutronix.de>
3963+R: kernel@pengutronix.de
39653964 L: linux-can@vger.kernel.org
39663965 S: Maintained
39673966 F: Documentation/networking/j1939.rst
@@ -4163,7 +4162,7 @@ S: Maintained · 195 unmodified lines
41634162 F: Documentation/translations/zh_CN/
41644163
41654164 CHIPIDEA USB HIGH SPEED DUAL ROLE CONTROLLER
4166−M: Peter Chen <Peter.Chen@nxp.com>
4165+M: Peter Chen <peter.chen@kernel.org>
41674166 L: linux-usb@vger.kernel.org
41684167 S: Maintained
41694168 T: git git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb.git
@@ -4305,7 +4304,7 @@ S: Maintained · 135 unmodified lines
43054304 F: .clang-format
43064305
43074306 CLANG/LLVM BUILD SUPPORT
4308−M: Nathan Chancellor <natechancellor@gmail.com>
4307+M: Nathan Chancellor <nathan@kernel.org>
43094308 M: Nick Desaulniers <ndesaulniers@google.com>
43104309 L: clang-built-linux@googlegroups.com
43114310 S: Supported
@@ -4313,7 +4312,9 @@ W: https://clangbuiltlinux.github.io/ · 1 unmodified line
43134312 B: https://github.com/ClangBuiltLinux/linux/issues
43144313 C: irc://chat.freenode.net/clangbuiltlinux
43154314 F: Documentation/kbuild/llvm.rst
4315+F: include/linux/compiler-clang.h
43164316 F: scripts/clang-tools/
4317+F: scripts/clang-version.sh
43174318 F: scripts/lld-version.sh
43184319 K: \b(?i:clang|llvm)\b
43194320
@@ -4467,7 +4468,7 @@ F: include/linux/console* · 147 unmodified lines
44674468
44684469 CONTROL GROUP (CGROUP)
44694470 M: Tejun Heo <tj@kernel.org>
4470−M: Li Zefan <lizefan@huawei.com>
4471+M: Zefan Li <lizefan.x@bytedance.com>
44714472 M: Johannes Weiner <hannes@cmpxchg.org>
44724473 L: cgroups@vger.kernel.org
44734474 S: Maintained
@@ -4491,11 +4492,9 @@ F: block/blk-throttle.c · 17 unmodified lines
44914492 F: include/linux/blk-cgroup.h
44924493
44934494 CONTROL GROUP - CPUSET
4494−M: Li Zefan <lizefan@huawei.com>
4495+M: Zefan Li <lizefan.x@bytedance.com>
44954496 L: cgroups@vger.kernel.org
44964497 S: Maintained
4497−W: http://www.bullopensource.org/cpuset/
4498−W: http://oss.sgi.com/projects/cpusets/
44994498 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git
45004499 F: Documentation/admin-guide/cgroup-v1/cpusets.rst
45014500 F: include/linux/cpuset.h
@@ -4922,9 +4921,8 @@ F: Documentation/scsi/dc395x.rst · 420 unmodified lines
49224921 F: drivers/scsi/dc395x.*
49234922
49244923 DCCP PROTOCOL
4925−M: Gerrit Renker <gerrit@erg.abdn.ac.uk>
49264924 L: dccp@vger.kernel.org
4927−S: Maintained
4925+S: Orphan
49284926 W: http://www.linuxfoundation.org/collaborate/workgroups/networking/dccp
49294927 F: include/linux/dccp.h
49304928 F: include/linux/tfrc.h
@@ -6474,9 +6472,9 @@ S: Maintained · 1543 unmodified lines
64746472 F: drivers/edac/skx_*.[ch]
64756473
64766474 EDAC-TI
6477−M: Tero Kristo <t-kristo@ti.com>
6475+M: Tero Kristo <kristo@kernel.org>
64786476 L: linux-edac@vger.kernel.org
6479−S: Maintained
6477+S: Odd Fixes
64806478 F: drivers/edac/ti_edac.c
64816479
64826480 EDIROL UA-101/UA-1000 DRIVER
@@ -7363,7 +7361,6 @@ L: linux-hardening@vger.kernel.org · 880 unmodified lines
73637361 S: Maintained
73647362 F: Documentation/kbuild/gcc-plugins.rst
73657363 F: scripts/Makefile.gcc-plugins
7366−F: scripts/gcc-plugin.sh
73677364 F: scripts/gcc-plugins/
73687365
73697366 GCOV BASED KERNEL PROFILING
@@ -8435,11 +8432,8 @@ F: drivers/i3c/ · 1065 unmodified lines
84358432 F: include/linux/i3c/
84368433
84378434 IA64 (Itanium) PLATFORM
8438−M: Tony Luck <tony.luck@intel.com>
8439−M: Fenghua Yu <fenghua.yu@intel.com>
84408435 L: linux-ia64@vger.kernel.org
8441−S: Odd Fixes
8442−T: git git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git
8436+S: Orphan
84438437 F: Documentation/ia64/
84448438 F: arch/ia64/
84458439
@@ -9240,7 +9234,7 @@ F: tools/testing/selftests/sgx/* · 794 unmodified lines
92409234 K: \bSGX_
92419235
92429236 INTERCONNECT API
9243−M: Georgi Djakov <georgi.djakov@linaro.org>
9237+M: Georgi Djakov <djakov@kernel.org>
92449238 L: linux-pm@vger.kernel.org
92459239 S: Maintained
92469240 F: Documentation/devicetree/bindings/interconnect/
@@ -9273,7 +9267,7 @@ F: drivers/net/ethernet/sgi/ioc3-eth.c · 26 unmodified lines
92739267
92749268 IOMAP FILESYSTEM LIBRARY
92759269 M: Christoph Hellwig <hch@infradead.org>
9276−M: Darrick J. Wong <darrick.wong@oracle.com>
9270+M: Darrick J. Wong <djwong@kernel.org>
92779271 M: linux-xfs@vger.kernel.org
92789272 M: linux-fsdevel@vger.kernel.org
92799273 L: linux-xfs@vger.kernel.org
@@ -9327,7 +9321,6 @@ W: http://www.adaptec.com/ · 47 unmodified lines
93279321 F: drivers/scsi/ips*
93289322
93299323 IPVS
9330−M: Wensong Zhang <wensong@linux-vs.org>
93319324 M: Simon Horman <horms@verge.net.au>
93329325 M: Julian Anastasov <ja@ssi.bg>
93339326 L: netdev@vger.kernel.org
@@ -9564,16 +9557,18 @@ F: Documentation/hwmon/k8temp.rst · 230 unmodified lines
95649557 F: drivers/hwmon/k8temp.c
95659558
95669559 KASAN
9567−M: Andrey Ryabinin <aryabinin@virtuozzo.com>
9560+M: Andrey Ryabinin <ryabinin.a.a@gmail.com>
95689561 R: Alexander Potapenko <glider@google.com>
9562+R: Andrey Konovalov <andreyknvl@gmail.com>
95699563 R: Dmitry Vyukov <dvyukov@google.com>
95709564 L: kasan-dev@googlegroups.com
95719565 S: Maintained
95729566 F: Documentation/dev-tools/kasan.rst
9573−F: arch/*/include/asm/kasan.h
9567+F: arch/*/include/asm/*kasan.h
95749568 F: arch/*/mm/kasan_init*
95759569 F: include/linux/kasan*.h
9576−F: lib/test_kasan.c
9570+F: lib/Kconfig.kasan
9571+F: lib/test_kasan*.c
95779572 F: mm/kasan/
95789573 F: scripts/Makefile.kasan
95799574
@@ -9588,7 +9583,7 @@ F: scripts/kconfig/ · 8 unmodified lines
95889583
95899584 KCOV
95909585 R: Dmitry Vyukov <dvyukov@google.com>
9591−R: Andrey Konovalov <andreyknvl@google.com>
9586+R: Andrey Konovalov <andreyknvl@gmail.com>
95929587 L: kasan-dev@googlegroups.com
95939588 S: Maintained
95949589 F: Documentation/dev-tools/kcov.rst
@@ -9776,7 +9771,7 @@ F: tools/testing/selftests/kvm/s390x/ · 181 unmodified lines
97769771
97779772 KERNEL VIRTUAL MACHINE FOR X86 (KVM/x86)
97789773 M: Paolo Bonzini <pbonzini@redhat.com>
9779−R: Sean Christopherson <sean.j.christopherson@intel.com>
9774+R: Sean Christopherson <seanjc@google.com>
97809775 R: Vitaly Kuznetsov <vkuznets@redhat.com>
97819776 R: Wanpeng Li <wanpengli@tencent.com>
97829777 R: Jim Mattson <jmattson@google.com>
@@ -10260,7 +10255,6 @@ S: Supported · 477 unmodified lines
1026010255 T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev
1026110256 F: Documentation/atomic_bitops.txt
1026210257 F: Documentation/atomic_t.txt
10263−F: Documentation/core-api/atomic_ops.rst
1026410258 F: Documentation/core-api/refcount-vs-atomic.rst
1026510259 F: Documentation/litmus-tests/
1026610260 F: Documentation/memory-barriers.txt
@@ -10847,7 +10841,7 @@ F: drivers/media/radio/radio-maxiradio* · 580 unmodified lines
1084710841
1084810842 MCAN MMIO DEVICE DRIVER
1084910843 M: Dan Murphy <dmurphy@ti.com>
10850−M: Sriram Dash <sriram.dash@samsung.com>
10844+M: Pankaj Sharma <pankj.sharma@samsung.com>
1085110845 L: linux-can@vger.kernel.org
1085210846 S: Maintained
1085310847 F: Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
@@ -11667,7 +11661,7 @@ F: drivers/media/platform/atmel/atmel-isi.h · 813 unmodified lines
1166711661
1166811662 MICROCHIP KSZ SERIES ETHERNET SWITCH DRIVER
1166911663 M: Woojung Huh <woojung.huh@microchip.com>
11670−M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
11664+M: UNGLinuxDriver@microchip.com
1167111665 L: netdev@vger.kernel.org
1167211666 S: Maintained
1167311667 F: Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
@@ -11677,7 +11671,7 @@ F: net/dsa/tag_ksz.c · 3 unmodified lines
1167711671
1167811672 MICROCHIP LAN743X ETHERNET DRIVER
1167911673 M: Bryan Whitehead <bryan.whitehead@microchip.com>
11680−M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
11674+M: UNGLinuxDriver@microchip.com
1168111675 L: netdev@vger.kernel.org
1168211676 S: Maintained
1168311677 F: drivers/net/ethernet/microchip/lan743x_*
@@ -11771,7 +11765,7 @@ F: drivers/net/wireless/microchip/wilc1000/ · 87 unmodified lines
1177111765
1177211766 MICROSEMI MIPS SOCS
1177311767 M: Alexandre Belloni <alexandre.belloni@bootlin.com>
11774−M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
11768+M: UNGLinuxDriver@microchip.com
1177511769 L: linux-mips@vger.kernel.org
1177611770 S: Supported
1177711771 F: Documentation/devicetree/bindings/mips/mscc.txt
@@ -12418,8 +12412,8 @@ F: tools/testing/selftests/net/ipsec.c · 640 unmodified lines
1241812412
1241912413 NETWORKING [IPv4/IPv6]
1242012414 M: "David S. Miller" <davem@davemloft.net>
12421−M: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
1242212415 M: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
12416+M: David Ahern <dsahern@kernel.org>
1242312417 L: netdev@vger.kernel.org
1242412418 S: Maintained
1242512419 T: git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
@@ -12475,7 +12469,6 @@ F: net/ipv6/tcp*.c · 49 unmodified lines
1247512469
1247612470 NETWORKING [TLS]
1247712471 M: Boris Pismenny <borisp@nvidia.com>
12478−M: Aviad Yehezkel <aviadye@nvidia.com>
1247912472 M: John Fastabend <john.fastabend@gmail.com>
1248012473 M: Daniel Borkmann <daniel@iogearbox.net>
1248112474 M: Jakub Kicinski <kuba@kernel.org>
@@ -12825,10 +12818,10 @@ F: tools/objtool/ · 343 unmodified lines
1282512818 F: include/linux/objtool.h
1282612819
1282712820 OCELOT ETHERNET SWITCH DRIVER
12828−M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
1282912821 M: Vladimir Oltean <vladimir.oltean@nxp.com>
1283012822 M: Claudiu Manoil <claudiu.manoil@nxp.com>
1283112823 M: Alexandre Belloni <alexandre.belloni@bootlin.com>
12824+M: UNGLinuxDriver@microchip.com
1283212825 L: netdev@vger.kernel.org
1283312826 S: Supported
1283412827 F: drivers/net/dsa/ocelot/*
@@ -12850,7 +12843,7 @@ F: include/misc/ocxl* · 15 unmodified lines
1285012843 F: include/uapi/misc/ocxl.h
1285112844
1285212845 OMAP AUDIO SUPPORT
12853−M: Peter Ujfalusi <peter.ujfalusi@ti.com>
12846+M: Peter Ujfalusi <peter.ujfalusi@gmail.com>
1285412847 M: Jarkko Nikula <jarkko.nikula@bitmer.com>
1285512848 L: alsa-devel@alsa-project.org (moderated for non-subscribers)
1285612849 L: linux-omap@vger.kernel.org
@@ -13890,7 +13883,7 @@ F: drivers/platform/x86/peaq-wmi.c · 1033 unmodified lines
1389013883
1389113884 PENSANDO ETHERNET DRIVERS
1389213885 M: Shannon Nelson <snelson@pensando.io>
13893−M: Pensando Drivers <drivers@pensando.io>
13886+M: drivers@pensando.io
1389413887 L: netdev@vger.kernel.org
1389513888 S: Supported
1389613889 F: Documentation/networking/device_drivers/ethernet/pensando/ionic.rst
@@ -14512,10 +14505,18 @@ S: Supported · 615 unmodified lines
1451214505 F: drivers/crypto/qat/
1451314506
1451414507 QCOM AUDIO (ASoC) DRIVERS
14515−M: Patrick Lai <plai@codeaurora.org>
14508+M: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
1451614509 M: Banajit Goswami <bgoswami@codeaurora.org>
1451714510 L: alsa-devel@alsa-project.org (moderated for non-subscribers)
1451814511 S: Supported
14512+F: sound/soc/codecs/lpass-va-macro.c
14513+F: sound/soc/codecs/lpass-wsa-macro.*
14514+F: sound/soc/codecs/msm8916-wcd-analog.c
14515+F: sound/soc/codecs/msm8916-wcd-digital.c
14516+F: sound/soc/codecs/wcd9335.*
14517+F: sound/soc/codecs/wcd934x.c
14518+F: sound/soc/codecs/wcd-clsh-v2.*
14519+F: sound/soc/codecs/wsa881x.c
1451914520 F: sound/soc/qcom/
1452014521
1452114522 QCOM IPA DRIVER
@@ -14669,7 +14670,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git · 147 unmodified lines
1466914670 F: drivers/net/wireless/ath/ath11k/
1467014671
1467114672 QUALCOMM ATHEROS ATH9K WIRELESS DRIVER
14672−M: QCA ath9k Development <ath9k-devel@qca.qualcomm.com>
14673+M: ath9k-devel@qca.qualcomm.com
1467314674 L: linux-wireless@vger.kernel.org
1467414675 S: Supported
1467514676 W: https://wireless.wiki.kernel.org/en/users/Drivers/ath9k
@@ -14820,7 +14821,7 @@ M: Alex Deucher <alexander.deucher@amd.com> · 144 unmodified lines
1482014821 M: Christian König <christian.koenig@amd.com>
1482114822 L: amd-gfx@lists.freedesktop.org
1482214823 S: Supported
14823−T: git git://people.freedesktop.org/~agd5f/linux
14824+T: git https://gitlab.freedesktop.org/agd5f/linux.git
1482414825 F: drivers/gpu/drm/amd/
1482514826 F: drivers/gpu/drm/radeon/
1482614827 F: include/uapi/drm/amdgpu_drm.h
@@ -16321,6 +16322,7 @@ M: Pekka Enberg <penberg@kernel.org> · 1494 unmodified lines
1632116322 M: David Rientjes <rientjes@google.com>
1632216323 M: Joonsoo Kim <iamjoonsoo.kim@lge.com>
1632316324 M: Andrew Morton <akpm@linux-foundation.org>
16325+M: Vlastimil Babka <vbabka@suse.cz>
1632416326 L: linux-mm@kvack.org
1632516327 S: Maintained
1632616328 F: include/linux/sl?b*.h
@@ -16710,6 +16712,8 @@ M: Samuel Thibault <samuel.thibault@ens-lyon.org> · 383 unmodified lines
1671016712 L: speakup@linux-speakup.org
1671116713 S: Odd Fixes
1671216714 W: http://www.linux-speakup.org/
16715+W: https://github.com/linux-speakup/speakup
16716+B: https://github.com/linux-speakup/speakup/issues
1671316717 F: drivers/accessibility/speakup/
1671416718
1671516719 SPEAR CLOCK FRAMEWORK SUPPORT
@@ -16964,7 +16968,7 @@ M: Olivier Moysan <olivier.moysan@st.com> · 248 unmodified lines
1696416968 M: Arnaud Pouliquen <arnaud.pouliquen@st.com>
1696516969 L: alsa-devel@alsa-project.org (moderated for non-subscribers)
1696616970 S: Maintained
16967−F: Documentation/devicetree/bindings/sound/st,stm32-*.txt
16971+F: Documentation/devicetree/bindings/iio/adc/st,stm32-*.yaml
1696816972 F: sound/soc/stm/
1696916973
1697016974 STM32 TIMER/LPTIMER DRIVERS
@@ -17541,7 +17545,7 @@ F: arch/xtensa/ · 570 unmodified lines
1754117545 F: drivers/irqchip/irq-xtensa-*
1754217546
1754317547 TEXAS INSTRUMENTS ASoC DRIVERS
17544−M: Peter Ujfalusi <peter.ujfalusi@ti.com>
17548+M: Peter Ujfalusi <peter.ujfalusi@gmail.com>
1754517549 L: alsa-devel@alsa-project.org (moderated for non-subscribers)
1754617550 S: Maintained
1754717551 F: sound/soc/ti/
@@ -17553,9 +17557,22 @@ S: Supported · 5 unmodified lines
1755317557 F: Documentation/devicetree/bindings/iio/dac/ti,dac7612.txt
1755417558 F: drivers/iio/dac/ti-dac7612.c
1755517559
17560+TEXAS INSTRUMENTS DMA DRIVERS
17561+M: Peter Ujfalusi <peter.ujfalusi@gmail.com>
17562+L: dmaengine@vger.kernel.org
17563+S: Maintained
17564+F: Documentation/devicetree/bindings/dma/ti-dma-crossbar.txt
17565+F: Documentation/devicetree/bindings/dma/ti-edma.txt
17566+F: Documentation/devicetree/bindings/dma/ti/
17567+F: drivers/dma/ti/
17568+X: drivers/dma/ti/cppi41.c
17569+F: include/linux/dma/k3-udma-glue.h
17570+F: include/linux/dma/ti-cppi5.h
17571+F: include/linux/dma/k3-psil.h
17572+
1755617573 TEXAS INSTRUMENTS' SYSTEM CONTROL INTERFACE (TISCI) PROTOCOL DRIVER
1755717574 M: Nishanth Menon <nm@ti.com>
17558−M: Tero Kristo <t-kristo@ti.com>
17575+M: Tero Kristo <kristo@kernel.org>
1755917576 M: Santosh Shilimkar <ssantosh@kernel.org>
1756017577 L: linux-arm-kernel@lists.infradead.org
1756117578 S: Maintained
@@ -17699,9 +17716,9 @@ S: Maintained · 137 unmodified lines
1769917716 F: drivers/clk/clk-cdce706.c
1770017717
1770117718 TI CLOCK DRIVER
17702−M: Tero Kristo <t-kristo@ti.com>
17719+M: Tero Kristo <kristo@kernel.org>
1770317720 L: linux-omap@vger.kernel.org
17704−S: Maintained
17721+S: Odd Fixes
1770517722 F: drivers/clk/ti/
1770617723 F: include/linux/clk/ti.h
1770717724
@@ -17838,7 +17855,7 @@ F: Documentation/devicetree/bindings/net/nfc/trf7970a.txt · 130 unmodified lines
1783817855 F: drivers/nfc/trf7970a.c
1783917856
1784017857 TI TWL4030 SERIES SOC CODEC DRIVER
17841−M: Peter Ujfalusi <peter.ujfalusi@ti.com>
17858+M: Peter Ujfalusi <peter.ujfalusi@gmail.com>
1784217859 L: alsa-devel@alsa-project.org (moderated for non-subscribers)
1784317860 S: Maintained
1784417861 F: sound/soc/codecs/twl4030*
@@ -18370,7 +18387,7 @@ F: include/linux/usb/isp116x.h · 525 unmodified lines
1837018387
1837118388 USB LAN78XX ETHERNET DRIVER
1837218389 M: Woojung Huh <woojung.huh@microchip.com>
18373−M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
18390+M: UNGLinuxDriver@microchip.com
1837418391 L: netdev@vger.kernel.org
1837518392 S: Maintained
1837618393 F: Documentation/devicetree/bindings/net/microchip,lan78xx.txt
@@ -18404,7 +18421,7 @@ F: Documentation/usb/ohci.rst · 27 unmodified lines
1840418421 F: drivers/usb/host/ohci*
1840518422
1840618423 USB OTG FSM (Finite State Machine)
18407−M: Peter Chen <Peter.Chen@nxp.com>
18424+M: Peter Chen <peter.chen@kernel.org>
1840818425 L: linux-usb@vger.kernel.org
1840918426 S: Maintained
1841018427 T: git git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb.git
@@ -18484,7 +18501,7 @@ F: drivers/net/usb/smsc75xx.* · 73 unmodified lines
1848418501
1848518502 USB SMSC95XX ETHERNET DRIVER
1848618503 M: Steve Glendinning <steve.glendinning@shawell.net>
18487−M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
18504+M: UNGLinuxDriver@microchip.com
1848818505 L: netdev@vger.kernel.org
1848918506 S: Maintained
1849018507 F: drivers/net/usb/smsc95xx.*
@@ -19031,7 +19048,7 @@ F: drivers/input/mouse/vmmouse.h · 540 unmodified lines
1903119048
1903219049 VMWARE VMXNET3 ETHERNET DRIVER
1903319050 M: Ronak Doshi <doshir@vmware.com>
19034−M: "VMware, Inc." <pv-drivers@vmware.com>
19051+M: pv-drivers@vmware.com
1903519052 L: netdev@vger.kernel.org
1903619053 S: Maintained
1903719054 F: drivers/net/vmxnet3/
@@ -19058,7 +19075,6 @@ K: regulator_get_optional · 20 unmodified lines
1905819075
1905919076 VRF
1906019077 M: David Ahern <dsahern@kernel.org>
19061−M: Shrijeet Mukherjee <shrijeet@gmail.com>
1906219078 L: netdev@vger.kernel.org
1906319079 S: Maintained
1906419080 F: Documentation/networking/vrf.rst
@@ -19409,7 +19425,7 @@ F: drivers/net/ethernet/*/*/*xdp* · 344 unmodified lines
1940919425 K: (?:\b|_)xdp(?:\b|_)
1941019426
1941119427 XDP SOCKETS (AF_XDP)
19412−M: Björn Töpel <bjorn.topel@intel.com>
19428+M: Björn Töpel <bjorn@kernel.org>
1941319429 M: Magnus Karlsson <magnus.karlsson@intel.com>
1941419430 R: Jonathan Lemon <jonathan.lemon@gmail.com>
1941519431 L: netdev@vger.kernel.org
@@ -19505,7 +19521,7 @@ F: arch/x86/xen/*swiotlb* · 89 unmodified lines
1950519521 F: drivers/xen/*swiotlb*
1950619522
1950719523 XFS FILESYSTEM
19508−M: Darrick J. Wong <darrick.wong@oracle.com>
19524+M: Darrick J. Wong <djwong@kernel.org>
1950919525 M: linux-xfs@vger.kernel.org
1951019526 L: linux-xfs@vger.kernel.org
1951119527 S: Supported
Makefile+6−11
@@ -2,8 +2,8 @@ · 1 unmodified line
22 VERSION = 5
33 PATCHLEVEL = 11
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc2
6−NAME = Kleptomaniac Octopus
5+EXTRAVERSION =
6+NAME = 💕 Valentine's Day Edition 💕
77
88 # *DOCUMENTATION*
99 # To see a list of typical targets execute "make help"
@@ -452,7 +452,6 @@ AWK = awk · 442 unmodified lines
452452 INSTALLKERNEL := installkernel
453453 DEPMOD = depmod
454454 PERL = perl
455−PYTHON = python
456455 PYTHON3 = python3
457456 CHECK = sparse
458457 BASH = bash
@@ -508,7 +507,7 @@ CLANG_FLAGS := · 49 unmodified lines
508507
509508 export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC
510509 export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL
511−export PERL PYTHON PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
510+export PERL PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
512511 export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD
513512 export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE
514513
@@ -812,10 +811,12 @@ KBUILD_CFLAGS += -ftrivial-auto-var-init=zero · 297 unmodified lines
812811 KBUILD_CFLAGS += -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
813812 endif
814813
814+DEBUG_CFLAGS :=
815+
815816 # Workaround for GCC versions < 5.0
816817 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61801
817818 ifdef CONFIG_CC_IS_GCC
818−DEBUG_CFLAGS := $(call cc-ifversion, -lt, 0500, $(call cc-option, -fno-var-tracking-assignments))
819+DEBUG_CFLAGS += $(call cc-ifversion, -lt, 0500, $(call cc-option, -fno-var-tracking-assignments))
819820 endif
820821
821822 ifdef CONFIG_DEBUG_INFO
@@ -948,12 +949,6 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init) · 126 unmodified lines
948949 # change __FILE__ to the relative path from the srctree
949950 KBUILD_CPPFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
950951
951−# ensure -fcf-protection is disabled when using retpoline as it is
952−# incompatible with -mindirect-branch=thunk-extern
953−ifdef CONFIG_RETPOLINE
954−KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
955−endif
956−
957952 # include additional Makefiles when needed
958953 include-y := scripts/Makefile.extrawarn
959954 include-$(CONFIG_KASAN) += scripts/Makefile.kasan
arch/Kconfig+6−0
@@ -1105,6 +1105,12 @@ config HAVE_ARCH_PFN_VALID · 1104 unmodified lines
11051105 config ARCH_SUPPORTS_DEBUG_PAGEALLOC
11061106 bool
11071107
1108+config ARCH_SPLIT_ARG64
1109+ bool
1110+ help
1111+ If a 32-bit architecture requires 64-bit arguments to be split into
1112+ pairs of 32-bit arguments, select this option.
1113+
11081114 source "kernel/gcov/Kconfig"
11091115
11101116 source "scripts/gcc-plugins/Kconfig"
arch/arc/Makefile+13−7
@@ -102,16 +102,22 @@ libs-y += arch/arc/lib/ $(LIBGCC) · 101 unmodified lines
102102
103103 boot := arch/arc/boot
104104
105−#default target for make without any arguments.
106−KBUILD_IMAGE := $(boot)/bootpImage
107−
108−all: bootpImage
109−bootpImage: vmlinux
110−
111−boot_targets += uImage uImage.bin uImage.gz
105+boot_targets := uImage.bin uImage.gz uImage.lzma
112106
107+PHONY += $(boot_targets)
113108 $(boot_targets): vmlinux
114109 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
115110
111+uimage-default-y := uImage.bin
112+uimage-default-$(CONFIG_KERNEL_GZIP) := uImage.gz
113+uimage-default-$(CONFIG_KERNEL_LZMA) := uImage.lzma
114+
115+PHONY += uImage
116+uImage: $(uimage-default-y)
117+ @ln -sf $< $(boot)/uImage
118+ @$(kecho) ' Image $(boot)/uImage is ready'
119+
120+CLEAN_FILES += $(boot)/uImage
121+
116122 archclean:
117123 $(Q)$(MAKE) $(clean)=$(boot)
arch/arc/boot/Makefile+4−14
@@ -1,5 +1,4 @@
11 # SPDX-License-Identifier: GPL-2.0
2−targets := vmlinux.bin vmlinux.bin.gz uImage
32
43 # uImage build relies on mkimage being availble on your host for ARC target
54 # You will need to build u-boot for ARC, rename mkimage to arc-elf32-mkimage
@@ -7,23 +6,18 @@ targets := vmlinux.bin vmlinux.bin.gz uImage · 1 unmodified line
76
87 OBJCOPYFLAGS= -O binary -R .note -R .note.gnu.build-id -R .comment -S
98
10−LINUX_START_TEXT = $$(readelf -h vmlinux | \
9+LINUX_START_TEXT = $$($(READELF) -h vmlinux | \
1110 grep "Entry point address" | grep -o 0x.*)
1211
1312 UIMAGE_LOADADDR = $(CONFIG_LINUX_LINK_BASE)
1413 UIMAGE_ENTRYADDR = $(LINUX_START_TEXT)
1514
16−suffix-y := bin
17−suffix-$(CONFIG_KERNEL_GZIP) := gz
18−suffix-$(CONFIG_KERNEL_LZMA) := lzma
19−
20−targets += uImage
15+targets += vmlinux.bin
16+targets += vmlinux.bin.gz
17+targets += vmlinux.bin.lzma
2118 targets += uImage.bin
2219 targets += uImage.gz
2320 targets += uImage.lzma
24−extra-y += vmlinux.bin
25−extra-y += vmlinux.bin.gz
26−extra-y += vmlinux.bin.lzma
2721
2822 $(obj)/vmlinux.bin: vmlinux FORCE
2923 $(call if_changed,objcopy)
@@ -42,7 +36,3 @@ $(obj)/uImage.gz: $(obj)/vmlinux.bin.gz FORCE · 12 unmodified lines
4236
4337 $(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma FORCE
4438 $(call if_changed,uimage,lzma)
45−
46−$(obj)/uImage: $(obj)/uImage.$(suffix-y)
47− @ln -sf $(notdir $<) $@
48− @echo ' Image $@ is ready'
arch/arc/include/asm/page.h+1−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #ifndef __ASSEMBLY__
1111
1212 #define clear_page(paddr) memset((paddr), 0, PAGE_SIZE)
13+#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
1314 #define copy_page(to, from) memcpy((to), (from), PAGE_SIZE)
1415
1516 struct vm_area_struct;
arch/arc/kernel/entry.S+1−1
@@ -307,7 +307,7 @@ resume_user_mode_begin: · 306 unmodified lines
307307 mov r0, sp ; pt_regs for arg to do_signal()/do_notify_resume()
308308
309309 GET_CURR_THR_INFO_FLAGS r9
310− and.f 0, r9, TIF_SIGPENDING|TIF_NOTIFY_SIGNAL
310+ and.f 0, r9, _TIF_SIGPENDING|_TIF_NOTIFY_SIGNAL
311311 bz .Lchk_notify_resume
312312
313313 ; Normal Trap/IRQ entry only saves Scratch (caller-saved) regs
arch/arc/plat-hsdk/Kconfig+1−0
@@ -7,6 +7,7 @@ menuconfig ARC_SOC_HSDK · 6 unmodified lines
77 depends on ISA_ARCV2
88 select ARC_HAS_ACCL_REGS
99 select ARC_IRQ_NO_AUTOSAVE
10+ select ARC_FPU_SAVE_RESTORE
1011 select CLK_HSDK
1112 select RESET_CONTROLLER
1213 select RESET_HSDK
arch/arm/boot/compressed/atags_to_fdt.c+2−1
@@ -15,7 +15,8 @@ static int node_offset(void *fdt, const char *node_path) · 14 unmodified lines
1515 {
1616 int offset = fdt_path_offset(fdt, node_path);
1717 if (offset == -FDT_ERR_NOTFOUND)
18− offset = fdt_add_subnode(fdt, 0, node_path);
18+ /* Add the node to root if not found, dropping the leading '/' */
19+ offset = fdt_add_subnode(fdt, 0, node_path + 1);
1920 return offset;
2021 }
2122
arch/arm/boot/dts/imx6q-tbs2910.dts+7−0
@@ -16,6 +16,13 @@ · 15 unmodified lines
1616 stdout-path = &uart1;
1717 };
1818
19+ aliases {
20+ mmc0 = &usdhc2;
21+ mmc1 = &usdhc3;
22+ mmc2 = &usdhc4;
23+ /delete-property/ mmc3;
24+ };
25+
1926 memory@10000000 {
2027 device_type = "memory";
2128 reg = <0x10000000 0x80000000>;
arch/arm/boot/dts/imx6qdl-gw52xx.dtsi+1−1
@@ -418,7 +418,7 @@ · 417 unmodified lines
418418
419419 /* VDD_AUD_1P8: Audio codec */
420420 reg_aud_1p8v: ldo3 {
421− regulator-name = "vdd1p8";
421+ regulator-name = "vdd1p8a";
422422 regulator-min-microvolt = <1800000>;
423423 regulator-max-microvolt = <1800000>;
424424 regulator-boot-on;
arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi+3−3
@@ -137,7 +137,7 @@ · 136 unmodified lines
137137
138138 lcd_backlight: lcd-backlight {
139139 compatible = "pwm-backlight";
140− pwms = <&pwm4 0 5000000>;
140+ pwms = <&pwm4 0 5000000 0>;
141141 pwm-names = "LCD_BKLT_PWM";
142142
143143 brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
@@ -167,7 +167,7 @@ · 23 unmodified lines
167167 i2c-gpio,delay-us = <2>; /* ~100 kHz */
168168 #address-cells = <1>;
169169 #size-cells = <0>;
170− status = "disabld";
170+ status = "disabled";
171171 };
172172
173173 i2c_cam: i2c-gpio-cam {
@@ -179,7 +179,7 @@ · 5 unmodified lines
179179 i2c-gpio,delay-us = <2>; /* ~100 kHz */
180180 #address-cells = <1>;
181181 #size-cells = <0>;
182− status = "disabld";
182+ status = "disabled";
183183 };
184184 };
185185
arch/arm/boot/dts/imx6qdl-sr-som.dtsi+10−2
@@ -53,7 +53,6 @@ · 52 unmodified lines
5353 &fec {
5454 pinctrl-names = "default";
5555 pinctrl-0 = <&pinctrl_microsom_enet_ar8035>;
56− phy-handle = <&phy>;
5756 phy-mode = "rgmii-id";
5857 phy-reset-duration = <2>;
5958 phy-reset-gpios = <&gpio4 15 GPIO_ACTIVE_LOW>;
@@ -63,10 +62,19 @@ · 3 unmodified lines
6362 #address-cells = <1>;
6463 #size-cells = <0>;
6564
66− phy: ethernet-phy@0 {
65+ /*
66+ * The PHY can appear at either address 0 or 4 due to the
67+ * configuration (LED) pin not being pulled sufficiently.
68+ */
69+ ethernet-phy@0 {
6770 reg = <0>;
6871 qca,clk-out-frequency = <125000000>;
6972 };
73+
74+ ethernet-phy@4 {
75+ reg = <4>;
76+ qca,clk-out-frequency = <125000000>;
77+ };
7078 };
7179 };
7280
arch/arm/boot/dts/imx7d-flex-concentrator.dts+1−0
@@ -115,6 +115,7 @@ · 114 unmodified lines
115115 compatible = "nxp,pcf2127";
116116 reg = <0>;
117117 spi-max-frequency = <2000000>;
118+ reset-source;
118119 };
119120 };
120121
arch/arm/boot/dts/lpc32xx.dtsi+0−3
@@ -326,9 +326,6 @@ · 325 unmodified lines
326326
327327 clocks = <&xtal_32k>, <&xtal>;
328328 clock-names = "xtal_32k", "xtal";
329−
330− assigned-clocks = <&clk LPC32XX_CLK_HCLK_PLL>;
331− assigned-clock-rates = <208000000>;
332329 };
333330 };
334331
arch/arm/boot/dts/omap3-gta04.dtsi+1−2
@@ -114,7 +114,7 @@ · 113 unmodified lines
114114 gpio-sck = <&gpio1 12 GPIO_ACTIVE_HIGH>;
115115 gpio-miso = <&gpio1 18 GPIO_ACTIVE_HIGH>;
116116 gpio-mosi = <&gpio1 20 GPIO_ACTIVE_HIGH>;
117− cs-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
117+ cs-gpios = <&gpio1 19 GPIO_ACTIVE_LOW>;
118118 num-chipselects = <1>;
119119
120120 /* lcd panel */
@@ -124,7 +124,6 @@ · 3 unmodified lines
124124 spi-max-frequency = <100000>;
125125 spi-cpol;
126126 spi-cpha;
127− spi-cs-high;
128127
129128 backlight= <&backlight>;
130129 label = "lcd";
arch/arm/boot/dts/omap3-n950-n9.dtsi+8−0
@@ -494,3 +494,11 @@ · 493 unmodified lines
494494 clock-names = "sysclk";
495495 };
496496 };
497+
498+&aes1_target {
499+ status = "disabled";
500+};
501+
502+&aes2_target {
503+ status = "disabled";
504+};
arch/arm/boot/dts/omap4-droid4-xt894.dts+5−0
@@ -16,8 +16,13 @@ · 15 unmodified lines
1616 debounce-interval = <10>;
1717 };
1818
19+ /*
20+ * We use pad 0x4a100116 abe_dmic_din3.gpio_122 as the irq instead
21+ * of the gpio interrupt to avoid lost events in deeper idle states.
22+ */
1923 slider {
2024 label = "Keypad Slide";
25+ interrupts-extended = <&omap4_pmx_core 0xd6>;
2126 gpios = <&gpio4 26 GPIO_ACTIVE_HIGH>; /* gpio122 */
2227 linux,input-type = <EV_SW>;
2328 linux,code = <SW_KEYPAD_SLIDE>;
arch/arm/boot/dts/picoxcell-pc3x2.dtsi+4−0
@@ -45,18 +45,21 @@ · 44 unmodified lines
4545 emac: gem@30000 {
4646 compatible = "cadence,gem";
4747 reg = <0x30000 0x10000>;
48+ interrupt-parent = <&vic0>;
4849 interrupts = <31>;
4950 };
5051
5152 dmac1: dmac@40000 {
5253 compatible = "snps,dw-dmac";
5354 reg = <0x40000 0x10000>;
55+ interrupt-parent = <&vic0>;
5456 interrupts = <25>;
5557 };
5658
5759 dmac2: dmac@50000 {
5860 compatible = "snps,dw-dmac";
5961 reg = <0x50000 0x10000>;
62+ interrupt-parent = <&vic0>;
6063 interrupts = <26>;
6164 };
6265
@@ -233,6 +236,7 @@ · 170 unmodified lines
233236 axi2pico@c0000000 {
234237 compatible = "picochip,axi2pico-pc3x2";
235238 reg = <0xc0000000 0x10000>;
239+ interrupt-parent = <&vic0>;
236240 interrupts = <13 14 15 16 17 18 19 20 21>;
237241 };
238242 };
arch/arm/boot/dts/ste-db8500.dtsi+38−0
@@ -12,4 +12,42 @@ · 11 unmodified lines
1212 200000 0>;
1313 };
1414 };
15+
16+ reserved-memory {
17+ #address-cells = <1>;
18+ #size-cells = <1>;
19+ ranges;
20+
21+ /* Modem trace memory */
22+ ram@06000000 {
23+ reg = <0x06000000 0x00f00000>;
24+ no-map;
25+ };
26+
27+ /* Modem shared memory */
28+ ram@06f00000 {
29+ reg = <0x06f00000 0x00100000>;
30+ no-map;
31+ };
32+
33+ /* Modem private memory */
34+ ram@07000000 {
35+ reg = <0x07000000 0x01000000>;
36+ no-map;
37+ };
38+
39+ /*
40+ * Initial Secure Software ISSW memory
41+ *
42+ * This is probably only used if the kernel tries
43+ * to actually call into trustzone to run secure
44+ * applications, which the mainline kernel probably
45+ * will not do on this old chipset. But you can never
46+ * be too careful, so reserve this memory anyway.
47+ */
48+ ram@17f00000 {
49+ reg = <0x17f00000 0x00100000>;
50+ no-map;
51+ };
52+ };
1553 };
arch/arm/boot/dts/ste-db8520.dtsi+38−0
@@ -12,4 +12,42 @@ · 11 unmodified lines
1212 200000 0>;
1313 };
1414 };
15+
16+ reserved-memory {
17+ #address-cells = <1>;
18+ #size-cells = <1>;
19+ ranges;
20+
21+ /* Modem trace memory */
22+ ram@06000000 {
23+ reg = <0x06000000 0x00f00000>;
24+ no-map;
25+ };
26+
27+ /* Modem shared memory */
28+ ram@06f00000 {
29+ reg = <0x06f00000 0x00100000>;
30+ no-map;
31+ };
32+
33+ /* Modem private memory */
34+ ram@07000000 {
35+ reg = <0x07000000 0x01000000>;
36+ no-map;
37+ };
38+
39+ /*
40+ * Initial Secure Software ISSW memory
41+ *
42+ * This is probably only used if the kernel tries
43+ * to actually call into trustzone to run secure
44+ * applications, which the mainline kernel probably
45+ * will not do on this old chipset. But you can never
46+ * be too careful, so reserve this memory anyway.
47+ */
48+ ram@17f00000 {
49+ reg = <0x17f00000 0x00100000>;
50+ no-map;
51+ };
52+ };
1553 };
arch/arm/boot/dts/ste-db9500.dtsi+35−0
@@ -0,0 +1,35 @@
1+// SPDX-License-Identifier: GPL-2.0-or-later
2+
3+#include "ste-dbx5x0.dtsi"
4+
5+/ {
6+ cpus {
7+ cpu@300 {
8+ /* cpufreq controls */
9+ operating-points = <1152000 0
10+ 800000 0
11+ 400000 0
12+ 200000 0>;
13+ };
14+ };
15+
16+ reserved-memory {
17+ #address-cells = <1>;
18+ #size-cells = <1>;
19+ ranges;
20+
21+ /*
22+ * Initial Secure Software ISSW memory
23+ *
24+ * This is probably only used if the kernel tries
25+ * to actually call into trustzone to run secure
26+ * applications, which the mainline kernel probably
27+ * will not do on this old chipset. But you can never
28+ * be too careful, so reserve this memory anyway.
29+ */
30+ ram@17f00000 {
31+ reg = <0x17f00000 0x00100000>;
32+ no-map;
33+ };
34+ };
35+};
arch/arm/boot/dts/ste-snowball.dts+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 */
55
66 /dts-v1/;
7−#include "ste-db8500.dtsi"
7+#include "ste-db9500.dtsi"
88 #include "ste-href-ab8500.dtsi"
99 #include "ste-href-family-pinctrl.dtsi"
1010
arch/arm/boot/dts/ste-ux500-samsung-golden.dts+1−0
@@ -329,6 +329,7 @@ · 328 unmodified lines
329329 panel@0 {
330330 compatible = "samsung,s6e63m0";
331331 reg = <0>;
332+ max-brightness = <15>;
332333 vdd3-supply = <&panel_reg_3v0>;
333334 vci-supply = <&panel_reg_1v8>;
334335 reset-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>;
arch/arm/boot/dts/stm32mp15xx-dhcom-drc02.dtsi+11−5
@@ -33,9 +33,9 @@ · 32 unmodified lines
3333 * during TX anyway and that it only controls drive enable DE
3434 * line. Hence, the RX is always enabled here.
3535 */
36− rs485-rx-en {
36+ rs485-rx-en-hog {
3737 gpio-hog;
38− gpios = <8 GPIO_ACTIVE_HIGH>;
38+ gpios = <8 0>;
3939 output-low;
4040 line-name = "rs485-rx-en";
4141 };
@@ -61,9 +61,9 @@ · 19 unmodified lines
6161 * order to reset the Hub when USB bus is powered down, but
6262 * so far there is no such functionality.
6363 */
64− usb-hub {
64+ usb-hub-hog {
6565 gpio-hog;
66− gpios = <2 GPIO_ACTIVE_HIGH>;
66+ gpios = <2 0>;
6767 output-high;
6868 line-name = "usb-hub-reset";
6969 };
@@ -87,6 +87,12 @@ · 17 unmodified lines
8787 };
8888 };
8989
90+&i2c4 {
91+ touchscreen@49 {
92+ status = "disabled";
93+ };
94+};
95+
9096 &i2c5 { /* TP7/TP8 */
9197 pinctrl-names = "default";
9298 pinctrl-0 = <&i2c5_pins_a>;
@@ -104,7 +110,7 @@ · 11 unmodified lines
104110 * are used for on-board microSD slot instead.
105111 */
106112 /delete-property/broken-cd;
107− cd-gpios = <&gpioi 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
113+ cd-gpios = <&gpioi 10 GPIO_ACTIVE_HIGH>;
108114 disable-wp;
109115 };
110116
arch/arm/boot/dts/stm32mp15xx-dhcom-picoitx.dtsi+2−2
@@ -43,9 +43,9 @@ · 42 unmodified lines
4343 * in order to turn on port power when USB bus is powered up, but so
4444 * far there is no such functionality.
4545 */
46− usb-port-power {
46+ usb-port-power-hog {
4747 gpio-hog;
48− gpios = <13 GPIO_ACTIVE_LOW>;
48+ gpios = <13 0>;
4949 output-low;
5050 line-name = "usb-port-power";
5151 };
arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi+2−1
@@ -390,7 +390,8 @@ · 389 unmodified lines
390390 pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_dir_pins_a>;
391391 pinctrl-1 = <&sdmmc1_b4_od_pins_a &sdmmc1_dir_pins_a>;
392392 pinctrl-2 = <&sdmmc1_b4_sleep_pins_a &sdmmc1_dir_sleep_pins_a>;
393− broken-cd;
393+ cd-gpios = <&gpiog 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
394+ disable-wp;
394395 st,sig-dir;
395396 st,neg-edge;
396397 st,use-ckin;
arch/arm/boot/dts/sun7i-a20-bananapro.dts+1−1
@@ -110,7 +110,7 @@ · 109 unmodified lines
110110 pinctrl-names = "default";
111111 pinctrl-0 = <&gmac_rgmii_pins>;
112112 phy-handle = <&phy1>;
113− phy-mode = "rgmii";
113+ phy-mode = "rgmii-id";
114114 phy-supply = <&reg_gmac_3v3>;
115115 status = "okay";
116116 };
arch/arm/configs/omap2plus_defconfig+1−1
@@ -279,6 +279,7 @@ CONFIG_SERIAL_OMAP_CONSOLE=y · 278 unmodified lines
279279 CONFIG_SERIAL_DEV_BUS=y
280280 CONFIG_I2C_CHARDEV=y
281281 CONFIG_SPI=y
282+CONFIG_SPI_GPIO=m
282283 CONFIG_SPI_OMAP24XX=y
283284 CONFIG_SPI_TI_QSPI=m
284285 CONFIG_HSI=m
@@ -296,7 +297,6 @@ CONFIG_GPIO_TWL4030=y · 11 unmodified lines
296297 CONFIG_W1=m
297298 CONFIG_HDQ_MASTER_OMAP=m
298299 CONFIG_W1_SLAVE_DS250X=m
299−CONFIG_POWER_AVS=y
300300 CONFIG_POWER_RESET=y
301301 CONFIG_POWER_RESET_GPIO=y
302302 CONFIG_BATTERY_BQ27XXX=m
arch/arm/crypto/chacha-glue.c+1−0
@@ -60,6 +60,7 @@ static void chacha_doneon(u32 *state, u8 *dst, const u8 *src, · 59 unmodified lines
6060 chacha_block_xor_neon(state, d, s, nrounds);
6161 if (d != dst)
6262 memcpy(dst, buf, bytes);
63+ state[12]++;
6364 }
6465 }
6566
arch/arm/include/asm/kexec-internal.h+12−0
@@ -0,0 +1,12 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _ARM_KEXEC_INTERNAL_H
3+#define _ARM_KEXEC_INTERNAL_H
4+
5+struct kexec_relocate_data {
6+ unsigned long kexec_start_address;
7+ unsigned long kexec_indirection_page;
8+ unsigned long kexec_mach_type;
9+ unsigned long kexec_r2;
10+};
11+
12+#endif
arch/arm/include/debug/tegra.S+27−27
@@ -149,7 +149,34 @@ · 148 unmodified lines
149149
150150 .align
151151 99: .word .
152+#if defined(ZIMAGE)
153+ .word . + 4
154+/*
155+ * Storage for the state maintained by the macro.
156+ *
157+ * In the kernel proper, this data is located in arch/arm/mach-tegra/tegra.c.
158+ * That's because this header is included from multiple files, and we only
159+ * want a single copy of the data. In particular, the UART probing code above
160+ * assumes it's running using physical addresses. This is true when this file
161+ * is included from head.o, but not when included from debug.o. So we need
162+ * to share the probe results between the two copies, rather than having
163+ * to re-run the probing again later.
164+ *
165+ * In the decompressor, we put the storage right here, since common.c
166+ * isn't included in the decompressor build. This storage data gets put in
167+ * .text even though it's really data, since .data is discarded from the
168+ * decompressor. Luckily, .text is writeable in the decompressor, unless
169+ * CONFIG_ZBOOT_ROM. That dependency is handled in arch/arm/Kconfig.debug.
170+ */
171+ /* Debug UART initialization required */
172+ .word 1
173+ /* Debug UART physical address */
174+ .word 0
175+ /* Debug UART virtual address */
176+ .word 0
177+#else
152178 .word tegra_uart_config
179+#endif
153180 .ltorg
154181
155182 /* Load previously selected UART address */
@@ -189,30 +216,3 @@ · 33 unmodified lines
189216
190217 .macro waituarttxrdy,rd,rx
191218 .endm
192−
193−/*
194− * Storage for the state maintained by the macros above.
195− *
196− * In the kernel proper, this data is located in arch/arm/mach-tegra/tegra.c.
197− * That's because this header is included from multiple files, and we only
198− * want a single copy of the data. In particular, the UART probing code above
199− * assumes it's running using physical addresses. This is true when this file
200− * is included from head.o, but not when included from debug.o. So we need
201− * to share the probe results between the two copies, rather than having
202− * to re-run the probing again later.
203− *
204− * In the decompressor, we put the symbol/storage right here, since common.c
205− * isn't included in the decompressor build. This symbol gets put in .text
206− * even though it's really data, since .data is discarded from the
207− * decompressor. Luckily, .text is writeable in the decompressor, unless
208− * CONFIG_ZBOOT_ROM. That dependency is handled in arch/arm/Kconfig.debug.
209− */
210−#if defined(ZIMAGE)
211−tegra_uart_config:
212− /* Debug UART initialization required */
213− .word 1
214− /* Debug UART physical address */
215− .word 0
216− /* Debug UART virtual address */
217− .word 0
218−#endif
arch/arm/kernel/asm-offsets.c+5−0
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/mm.h>
1313 #include <linux/dma-mapping.h>
1414 #include <asm/cacheflush.h>
15+#include <asm/kexec-internal.h>
1516 #include <asm/glue-df.h>
1617 #include <asm/glue-pf.h>
1718 #include <asm/mach/arch.h>
@@ -170,5 +171,9 @@ int main(void) · 152 unmodified lines
170171 DEFINE(MPU_RGN_PRBAR, offsetof(struct mpu_rgn, prbar));
171172 DEFINE(MPU_RGN_PRLAR, offsetof(struct mpu_rgn, prlar));
172173 #endif
174+ DEFINE(KEXEC_START_ADDR, offsetof(struct kexec_relocate_data, kexec_start_address));
175+ DEFINE(KEXEC_INDIR_PAGE, offsetof(struct kexec_relocate_data, kexec_indirection_page));
176+ DEFINE(KEXEC_MACH_TYPE, offsetof(struct kexec_relocate_data, kexec_mach_type));
177+ DEFINE(KEXEC_R2, offsetof(struct kexec_relocate_data, kexec_r2));
173178 return 0;
174179 }
arch/arm/kernel/machine_kexec.c+8−12
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include <linux/of_fdt.h>
1414 #include <asm/mmu_context.h>
1515 #include <asm/cacheflush.h>
16+#include <asm/kexec-internal.h>
1617 #include <asm/fncpy.h>
1718 #include <asm/mach-types.h>
1819 #include <asm/smp_plat.h>
@@ -22,11 +23,6 @@ · 3 unmodified lines
2223 extern void relocate_new_kernel(void);
2324 extern const unsigned int relocate_new_kernel_size;
2425
25−extern unsigned long kexec_start_address;
26−extern unsigned long kexec_indirection_page;
27−extern unsigned long kexec_mach_type;
28−extern unsigned long kexec_boot_atags;
29−
3026 static atomic_t waiting_for_crash_ipi;
3127
3228 /*
@@ -159,6 +155,7 @@ void (*kexec_reinit)(void); · 126 unmodified lines
159155 void machine_kexec(struct kimage *image)
160156 {
161157 unsigned long page_list, reboot_entry_phys;
158+ struct kexec_relocate_data *data;
162159 void (*reboot_entry)(void);
163160 void *reboot_code_buffer;
164161
@@ -174,18 +171,17 @@ void machine_kexec(struct kimage *image) · 9 unmodified lines
174171
175172 reboot_code_buffer = page_address(image->control_code_page);
176173
177− /* Prepare parameters for reboot_code_buffer*/
178− set_kernel_text_rw();
179− kexec_start_address = image->start;
180− kexec_indirection_page = page_list;
181− kexec_mach_type = machine_arch_type;
182− kexec_boot_atags = image->arch.kernel_r2;
183−
184174 /* copy our kernel relocation code to the control code page */
185175 reboot_entry = fncpy(reboot_code_buffer,
186176 &relocate_new_kernel,
187177 relocate_new_kernel_size);
188178
179+ data = reboot_code_buffer + relocate_new_kernel_size;
180+ data->kexec_start_address = image->start;
181+ data->kexec_indirection_page = page_list;
182+ data->kexec_mach_type = machine_arch_type;
183+ data->kexec_r2 = image->arch.kernel_r2;
184+
189185 /* get the identity mapping physical address for the reboot code */
190186 reboot_entry_phys = virt_to_idmap(reboot_entry);
191187
arch/arm/kernel/relocate_kernel.S+11−27
@@ -5,14 +5,16 @@ · 4 unmodified lines
55
66 #include <linux/linkage.h>
77 #include <asm/assembler.h>
8+#include <asm/asm-offsets.h>
89 #include <asm/kexec.h>
910
1011 .align 3 /* not needed for this code, but keeps fncpy() happy */
1112
1213 ENTRY(relocate_new_kernel)
1314
14− ldr r0,kexec_indirection_page
15− ldr r1,kexec_start_address
15+ adr r7, relocate_new_kernel_end
16+ ldr r0, [r7, #KEXEC_INDIR_PAGE]
17+ ldr r1, [r7, #KEXEC_START_ADDR]
1618
1719 /*
1820 * If there is no indirection page (we are doing crashdumps)
@@ -57,34 +59,16 @@ ENTRY(relocate_new_kernel) · 38 unmodified lines
5759
5860 2:
5961 /* Jump to relocated kernel */
60− mov lr,r1
61− mov r0,#0
62− ldr r1,kexec_mach_type
63− ldr r2,kexec_boot_atags
64− ARM( ret lr )
65− THUMB( bx lr )
66−
67− .align
68−
69− .globl kexec_start_address
70−kexec_start_address:
71− .long 0x0
72−
73− .globl kexec_indirection_page
74−kexec_indirection_page:
75− .long 0x0
76−
77− .globl kexec_mach_type
78−kexec_mach_type:
79− .long 0x0
80−
81− /* phy addr of the atags for the new kernel */
82− .globl kexec_boot_atags
83−kexec_boot_atags:
84− .long 0x0
62+ mov lr, r1
63+ mov r0, #0
64+ ldr r1, [r7, #KEXEC_MACH_TYPE]
65+ ldr r2, [r7, #KEXEC_R2]
66+ ARM( ret lr )
67+ THUMB( bx lr )
8568
8669 ENDPROC(relocate_new_kernel)
8770
71+ .align 3
8872 relocate_new_kernel_end:
8973
9074 .globl relocate_new_kernel_size
arch/arm/kernel/signal.c+8−6
@@ -693,18 +693,20 @@ struct page *get_signal_page(void) · 692 unmodified lines
693693
694694 addr = page_address(page);
695695
696+ /* Poison the entire page */
697+ memset32(addr, __opcode_to_mem_arm(0xe7fddef1),
698+ PAGE_SIZE / sizeof(u32));
699+
696700 /* Give the signal return code some randomness */
697701 offset = 0x200 + (get_random_int() & 0x7fc);
698702 signal_return_offset = offset;
699703
700− /*
701− * Copy signal return handlers into the vector page, and
702− * set sigreturn to be a pointer to these.
703− */
704+ /* Copy signal return handlers into the page */
704705 memcpy(addr + offset, sigreturn_codes, sizeof(sigreturn_codes));
705706
706− ptr = (unsigned long)addr + offset;
707− flush_icache_range(ptr, ptr + sizeof(sigreturn_codes));
707+ /* Flush out all instructions in this page */
708+ ptr = (unsigned long)addr;
709+ flush_icache_range(ptr, ptr + PAGE_SIZE);
708710
709711 return page;
710712 }
arch/arm/mach-footbridge/dc21285.c+6−6
@@ -65,15 +65,15 @@ dc21285_read_config(struct pci_bus *bus, unsigned int devfn, int where, · 64 unmodified lines
6565 if (addr)
6666 switch (size) {
6767 case 1:
68− asm("ldrb %0, [%1, %2]"
68+ asm volatile("ldrb %0, [%1, %2]"
6969 : "=r" (v) : "r" (addr), "r" (where) : "cc");
7070 break;
7171 case 2:
72− asm("ldrh %0, [%1, %2]"
72+ asm volatile("ldrh %0, [%1, %2]"
7373 : "=r" (v) : "r" (addr), "r" (where) : "cc");
7474 break;
7575 case 4:
76− asm("ldr %0, [%1, %2]"
76+ asm volatile("ldr %0, [%1, %2]"
7777 : "=r" (v) : "r" (addr), "r" (where) : "cc");
7878 break;
7979 }
@@ -99,17 +99,17 @@ dc21285_write_config(struct pci_bus *bus, unsigned int devfn, int where, · 19 unmodified lines
9999 if (addr)
100100 switch (size) {
101101 case 1:
102− asm("strb %0, [%1, %2]"
102+ asm volatile("strb %0, [%1, %2]"
103103 : : "r" (value), "r" (addr), "r" (where)
104104 : "cc");
105105 break;
106106 case 2:
107− asm("strh %0, [%1, %2]"
107+ asm volatile("strh %0, [%1, %2]"
108108 : : "r" (value), "r" (addr), "r" (where)
109109 : "cc");
110110 break;
111111 case 4:
112− asm("str %0, [%1, %2]"
112+ asm volatile("str %0, [%1, %2]"
113113 : : "r" (value), "r" (addr), "r" (where)
114114 : "cc");
115115 break;
arch/arm/mach-imx/suspend-imx6.S+1−0
@@ -67,6 +67,7 @@ · 66 unmodified lines
6767 #define MX6Q_CCM_CCR 0x0
6868
6969 .align 3
70+ .arm
7071
7172 .macro sync_l2_cache
7273
arch/arm/mach-omap1/board-osk.c+2−0
@@ -203,6 +203,8 @@ static int osk_tps_setup(struct i2c_client *client, void *context) · 202 unmodified lines
203203 */
204204 gpio_request(OSK_TPS_GPIO_USB_PWR_EN, "n_vbus_en");
205205 gpio_direction_output(OSK_TPS_GPIO_USB_PWR_EN, 1);
206+ /* Free the GPIO again as the driver will request it */
207+ gpio_free(OSK_TPS_GPIO_USB_PWR_EN);
206208
207209 /* Set GPIO 2 high so LED D3 is off by default */
208210 tps65010_set_gpio_out_value(GPIO2, HIGH);
arch/arm/mach-omap2/Kconfig+14−14
@@ -17,11 +17,10 @@ config ARCH_OMAP3 · 16 unmodified lines
1717 bool "TI OMAP3"
1818 depends on ARCH_MULTI_V7
1919 select ARCH_OMAP2PLUS
20− select ARM_CPU_SUSPEND if PM
20+ select ARM_CPU_SUSPEND
2121 select OMAP_HWMOD
2222 select OMAP_INTERCONNECT
23− select PM_OPP if PM
24− select PM if CPU_IDLE
23+ select PM_OPP
2524 select SOC_HAS_OMAP2_SDRC
2625 select ARM_ERRATA_430973
2726
@@ -30,7 +29,7 @@ config ARCH_OMAP4 · 2 unmodified lines
3029 depends on ARCH_MULTI_V7
3130 select ARCH_OMAP2PLUS
3231 select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
33− select ARM_CPU_SUSPEND if PM
32+ select ARM_CPU_SUSPEND
3433 select ARM_ERRATA_720789
3534 select ARM_GIC
3635 select HAVE_ARM_SCU if SMP
@@ -40,7 +39,7 @@ config ARCH_OMAP4 · 3 unmodified lines
4039 select OMAP_INTERCONNECT_BARRIER
4140 select PL310_ERRATA_588369 if CACHE_L2X0
4241 select PL310_ERRATA_727915 if CACHE_L2X0
43− select PM_OPP if PM
42+ select PM_OPP
4443 select PM if CPU_IDLE
4544 select ARM_ERRATA_754322
4645 select ARM_ERRATA_775420
@@ -50,7 +49,7 @@ config SOC_OMAP5 · 3 unmodified lines
5049 bool "TI OMAP5"
5150 depends on ARCH_MULTI_V7
5251 select ARCH_OMAP2PLUS
53− select ARM_CPU_SUSPEND if PM
52+ select ARM_CPU_SUSPEND
5453 select ARM_GIC
5554 select HAVE_ARM_SCU if SMP
5655 select HAVE_ARM_ARCH_TIMER
@@ -58,14 +57,14 @@ config SOC_OMAP5 · 1 unmodified line
5857 select OMAP_HWMOD
5958 select OMAP_INTERCONNECT
6059 select OMAP_INTERCONNECT_BARRIER
61− select PM_OPP if PM
60+ select PM_OPP
6261 select ZONE_DMA if ARM_LPAE
6362
6463 config SOC_AM33XX
6564 bool "TI AM33XX"
6665 depends on ARCH_MULTI_V7
6766 select ARCH_OMAP2PLUS
68− select ARM_CPU_SUSPEND if PM
67+ select ARM_CPU_SUSPEND
6968
7069 config SOC_AM43XX
7170 bool "TI AM43x"
@@ -79,13 +78,13 @@ config SOC_AM43XX · 7 unmodified lines
7978 select ARM_ERRATA_754322
8079 select ARM_ERRATA_775420
8180 select OMAP_INTERCONNECT
82− select ARM_CPU_SUSPEND if PM
81+ select ARM_CPU_SUSPEND
8382
8483 config SOC_DRA7XX
8584 bool "TI DRA7XX"
8685 depends on ARCH_MULTI_V7
8786 select ARCH_OMAP2PLUS
88− select ARM_CPU_SUSPEND if PM
87+ select ARM_CPU_SUSPEND
8988 select ARM_GIC
9089 select HAVE_ARM_SCU if SMP
9190 select HAVE_ARM_ARCH_TIMER
@@ -94,7 +93,7 @@ config SOC_DRA7XX · 2 unmodified lines
9493 select OMAP_HWMOD
9594 select OMAP_INTERCONNECT
9695 select OMAP_INTERCONNECT_BARRIER
97− select PM_OPP if PM
96+ select PM_OPP
9897 select ZONE_DMA if ARM_LPAE
9998 select PINCTRL_TI_IODELAY if OF && PINCTRL
10099
@@ -112,9 +111,11 @@ config ARCH_OMAP2PLUS · 11 unmodified lines
112111 select OMAP_DM_TIMER
113112 select OMAP_GPMC
114113 select PINCTRL
115− select PM_GENERIC_DOMAINS if PM
116− select PM_GENERIC_DOMAINS_OF if PM
114+ select PM
115+ select PM_GENERIC_DOMAINS
116+ select PM_GENERIC_DOMAINS_OF
117117 select RESET_CONTROLLER
118+ select SIMPLE_PM_BUS
118119 select SOC_BUS
119120 select TI_SYSC
120121 select OMAP_IRQCHIP
@@ -140,7 +141,6 @@ config ARCH_OMAP2PLUS_TYPICAL · 19 unmodified lines
140141 select I2C_OMAP
141142 select MENELAUS if ARCH_OMAP2
142143 select NEON if CPU_V7
143− select PM
144144 select REGULATOR
145145 select REGULATOR_FIXED_VOLTAGE
146146 select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4
arch/arm/mach-omap2/cpuidle44xx.c+8−8
@@ -151,10 +151,10 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, · 150 unmodified lines
151151 (cx->mpu_logic_state == PWRDM_POWER_OFF);
152152
153153 /* Enter broadcast mode for periodic timers */
154− tick_broadcast_enable();
154+ RCU_NONIDLE(tick_broadcast_enable());
155155
156156 /* Enter broadcast mode for one-shot timers */
157− tick_broadcast_enter();
157+ RCU_NONIDLE(tick_broadcast_enter());
158158
159159 /*
160160 * Call idle CPU PM enter notifier chain so that
@@ -166,7 +166,7 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, · 5 unmodified lines
166166
167167 if (dev->cpu == 0) {
168168 pwrdm_set_logic_retst(mpu_pd, cx->mpu_logic_state);
169− omap_set_pwrdm_state(mpu_pd, cx->mpu_state);
169+ RCU_NONIDLE(omap_set_pwrdm_state(mpu_pd, cx->mpu_state));
170170
171171 /*
172172 * Call idle CPU cluster PM enter notifier chain
@@ -178,7 +178,7 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, · 5 unmodified lines
178178 index = 0;
179179 cx = state_ptr + index;
180180 pwrdm_set_logic_retst(mpu_pd, cx->mpu_logic_state);
181− omap_set_pwrdm_state(mpu_pd, cx->mpu_state);
181+ RCU_NONIDLE(omap_set_pwrdm_state(mpu_pd, cx->mpu_state));
182182 mpuss_can_lose_context = 0;
183183 }
184184 }
@@ -194,9 +194,9 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, · 9 unmodified lines
194194 mpuss_can_lose_context)
195195 gic_dist_disable();
196196
197− clkdm_deny_idle(cpu_clkdm[1]);
198− omap_set_pwrdm_state(cpu_pd[1], PWRDM_POWER_ON);
199− clkdm_allow_idle(cpu_clkdm[1]);
197+ RCU_NONIDLE(clkdm_deny_idle(cpu_clkdm[1]));
198+ RCU_NONIDLE(omap_set_pwrdm_state(cpu_pd[1], PWRDM_POWER_ON));
199+ RCU_NONIDLE(clkdm_allow_idle(cpu_clkdm[1]));
200200
201201 if (IS_PM44XX_ERRATUM(PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD) &&
202202 mpuss_can_lose_context) {
@@ -222,7 +222,7 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, · 19 unmodified lines
222222 cpu_pm_exit();
223223
224224 cpu_pm_out:
225− tick_broadcast_exit();
225+ RCU_NONIDLE(tick_broadcast_exit());
226226
227227 fail:
228228 cpuidle_coupled_parallel_barrier(dev, &abort_barrier);
arch/arm/mach-omap2/omap_device.c+5−3
@@ -230,10 +230,12 @@ static int _omap_device_notifier_call(struct notifier_block *nb, · 229 unmodified lines
230230 break;
231231 case BUS_NOTIFY_BIND_DRIVER:
232232 od = to_omap_device(pdev);
233− if (od && (od->_state == OMAP_DEVICE_STATE_ENABLED) &&
234− pm_runtime_status_suspended(dev)) {
233+ if (od) {
235234 od->_driver_status = BUS_NOTIFY_BIND_DRIVER;
236− pm_runtime_set_active(dev);
235+ if (od->_state == OMAP_DEVICE_STATE_ENABLED &&
236+ pm_runtime_status_suspended(dev)) {
237+ pm_runtime_set_active(dev);
238+ }
237239 }
238240 break;
239241 case BUS_NOTIFY_ADD_DEVICE:
arch/arm/mach-omap2/pdata-quirks.c+1−0
@@ -522,6 +522,7 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = { · 521 unmodified lines
522522 &dra7_ipu1_dsp_iommu_pdata),
523523 #endif
524524 /* Common auxdata */
525+ OF_DEV_AUXDATA("simple-pm-bus", 0, NULL, omap_auxdata_lookup),
525526 OF_DEV_AUXDATA("ti,sysc", 0, NULL, &ti_sysc_pdata),
526527 OF_DEV_AUXDATA("pinctrl-single", 0, NULL, &pcs_pdata),
527528 OF_DEV_AUXDATA("ti,omap-prm-inst", 0, NULL, &ti_prm_pdata),
arch/arm/mach-omap2/pmic-cpcap.c+1−1
@@ -71,7 +71,7 @@ static struct omap_voltdm_pmic omap_cpcap_iva = { · 70 unmodified lines
7171 .vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN,
7272 .vp_vstepmax = OMAP4_VP_VSTEPMAX_VSTEPMAX,
7373 .vddmin = 900000,
74− .vddmax = 1350000,
74+ .vddmax = 1375000,
7575 .vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
7676 .i2c_slave_addr = 0x44,
7777 .volt_reg_addr = 0x0,
arch/arm/xen/enlighten.c+0−2
@@ -370,8 +370,6 @@ static int __init xen_guest_init(void) · 369 unmodified lines
370370 return -ENOMEM;
371371 }
372372 gnttab_init();
373− if (!xen_initial_domain())
374− xenbus_probe(NULL);
375373
376374 /*
377375 * Making sure board specific code will not set up ops for
arch/arm64/Kconfig+0−2
@@ -174,8 +174,6 @@ config ARM64 · 173 unmodified lines
174174 select HAVE_NMI
175175 select HAVE_PATA_PLATFORM
176176 select HAVE_PERF_EVENTS
177− select HAVE_PERF_EVENTS_NMI if ARM64_PSEUDO_NMI && HW_PERF_EVENTS
178− select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && HAVE_PERF_EVENTS_NMI
179177 select HAVE_PERF_REGS
180178 select HAVE_PERF_USER_STACK_DUMP
181179 select HAVE_REGS_AND_STACK_ACCESS_API
arch/arm64/Makefile+7−3
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 #
1111 # Copyright (C) 1995-2001 by Russell King
1212
13−LDFLAGS_vmlinux :=--no-undefined -X -z norelro
13+LDFLAGS_vmlinux :=--no-undefined -X
1414
1515 ifeq ($(CONFIG_RELOCATABLE), y)
1616 # Pass --no-apply-dynamic-relocs to restore pre-binutils-2.27 behaviour
@@ -115,16 +115,20 @@ KBUILD_CPPFLAGS += -mbig-endian · 98 unmodified lines
115115 CHECKFLAGS += -D__AARCH64EB__
116116 # Prefer the baremetal ELF build target, but not all toolchains include
117117 # it so fall back to the standard linux version if needed.
118−KBUILD_LDFLAGS += -EB $(call ld-option, -maarch64elfb, -maarch64linuxb)
118+KBUILD_LDFLAGS += -EB $(call ld-option, -maarch64elfb, -maarch64linuxb -z norelro)
119119 UTS_MACHINE := aarch64_be
120120 else
121121 KBUILD_CPPFLAGS += -mlittle-endian
122122 CHECKFLAGS += -D__AARCH64EL__
123123 # Same as above, prefer ELF but fall back to linux target if needed.
124−KBUILD_LDFLAGS += -EL $(call ld-option, -maarch64elf, -maarch64linux)
124+KBUILD_LDFLAGS += -EL $(call ld-option, -maarch64elf, -maarch64linux -z norelro)
125125 UTS_MACHINE := aarch64
126126 endif
127127
128+ifeq ($(CONFIG_LD_IS_LLD), y)
129+KBUILD_LDFLAGS += -z norelro
130+endif
131+
128132 CHECKFLAGS += -D__aarch64__
129133
130134 ifeq ($(CONFIG_DYNAMIC_FTRACE_WITH_REGS),y)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi+0−2
@@ -280,8 +280,6 @@ · 279 unmodified lines
280280 "timing-adjustment";
281281 rx-fifo-depth = <4096>;
282282 tx-fifo-depth = <2048>;
283− resets = <&reset RESET_ETHERNET>;
284− reset-names = "stmmaceth";
285283 power-domains = <&pwrc PWRC_AXG_ETHERNET_MEM_ID>;
286284 status = "disabled";
287285 };
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi+1−3
@@ -224,8 +224,6 @@ · 223 unmodified lines
224224 "timing-adjustment";
225225 rx-fifo-depth = <4096>;
226226 tx-fifo-depth = <2048>;
227− resets = <&reset RESET_ETHERNET>;
228− reset-names = "stmmaceth";
229227 status = "disabled";
230228
231229 mdio0: mdio {
@@ -2390,7 +2388,7 @@ · 2158 unmodified lines
23902388 interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
23912389 dr_mode = "host";
23922390 snps,dis_u2_susphy_quirk;
2393− snps,quirk-frame-length-adjustment;
2391+ snps,quirk-frame-length-adjustment = <0x20>;
23942392 snps,parkmode-disable-ss-quirk;
23952393 };
23962394 };
arch/arm64/boot/dts/amlogic/meson-gx.dtsi+0−3
@@ -13,7 +13,6 @@ · 12 unmodified lines
1313 #include <dt-bindings/interrupt-controller/irq.h>
1414 #include <dt-bindings/interrupt-controller/arm-gic.h>
1515 #include <dt-bindings/power/meson-gxbb-power.h>
16−#include <dt-bindings/reset/amlogic,meson-gxbb-reset.h>
1716 #include <dt-bindings/thermal/thermal.h>
1817
1918 / {
@@ -576,8 +575,6 @@ · 556 unmodified lines
576575 interrupt-names = "macirq";
577576 rx-fifo-depth = <4096>;
578577 tx-fifo-depth = <2048>;
579− resets = <&reset RESET_ETHERNET>;
580− reset-names = "stmmaceth";
581578 power-domains = <&pwrc PWRC_GXBB_ETHERNET_MEM_ID>;
582579 status = "disabled";
583580 };
arch/arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts+1−1
@@ -52,7 +52,7 @@ · 51 unmodified lines
5252 regulator-min-microvolt = <3300000>;
5353 regulator-max-microvolt = <3300000>;
5454
55− gpio = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
55+ gpio = <&gpio_ao GPIOAO_3 GPIO_OPEN_DRAIN>;
5656 enable-active-high;
5757 regulator-always-on;
5858 };
arch/arm64/boot/dts/bitmain/bm1880.dtsi+3−3
@@ -127,7 +127,7 @@ · 126 unmodified lines
127127 compatible = "snps,dw-apb-gpio-port";
128128 gpio-controller;
129129 #gpio-cells = <2>;
130− snps,nr-gpios = <32>;
130+ ngpios = <32>;
131131 reg = <0>;
132132 interrupt-controller;
133133 #interrupt-cells = <2>;
@@ -145,7 +145,7 @@ · 11 unmodified lines
145145 compatible = "snps,dw-apb-gpio-port";
146146 gpio-controller;
147147 #gpio-cells = <2>;
148− snps,nr-gpios = <32>;
148+ ngpios = <32>;
149149 reg = <0>;
150150 interrupt-controller;
151151 #interrupt-cells = <2>;
@@ -163,7 +163,7 @@ · 11 unmodified lines
163163 compatible = "snps,dw-apb-gpio-port";
164164 gpio-controller;
165165 #gpio-cells = <2>;
166− snps,nr-gpios = <8>;
166+ ngpios = <8>;
167167 reg = <0>;
168168 interrupt-controller;
169169 #interrupt-cells = <2>;
arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi+6−1
@@ -4,11 +4,16 @@ · 3 unmodified lines
44 */
55 usb {
66 compatible = "simple-bus";
7− dma-ranges;
87 #address-cells = <2>;
98 #size-cells = <2>;
109 ranges = <0x0 0x0 0x0 0x68500000 0x0 0x00400000>;
1110
11+ /*
12+ * Internally, USB bus to the interconnect can only address up
13+ * to 40-bit
14+ */
15+ dma-ranges = <0 0 0 0 0x100 0x0>;
16+
1217 usbphy0: usb-phy@0 {
1318 compatible = "brcm,sr-usb-combo-phy";
1419 reg = <0x0 0x00000000 0x0 0x100>;
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi+1−1
@@ -101,7 +101,7 @@ · 100 unmodified lines
101101 reboot {
102102 compatible ="syscon-reboot";
103103 regmap = <&rst>;
104− offset = <0xb0>;
104+ offset = <0>;
105105 mask = <0x02>;
106106 };
107107
arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi+1−1
@@ -385,7 +385,7 @@ · 384 unmodified lines
385385
386386 dcfg: dcfg@1ee0000 {
387387 compatible = "fsl,ls1046a-dcfg", "syscon";
388− reg = <0x0 0x1ee0000 0x0 0x10000>;
388+ reg = <0x0 0x1ee0000 0x0 0x1000>;
389389 big-endian;
390390 };
391391
arch/arm64/boot/dts/freescale/imx8mn.dtsi+1−1
@@ -253,7 +253,7 @@ · 252 unmodified lines
253253 #size-cells = <1>;
254254 ranges;
255255
256− spba: bus@30000000 {
256+ spba: spba-bus@30000000 {
257257 compatible = "fsl,spba-bus", "simple-bus";
258258 #address-cells = <1>;
259259 #size-cells = <1>;
arch/arm64/boot/dts/freescale/imx8mp.dtsi+1−1
@@ -266,7 +266,7 @@ · 265 unmodified lines
266266 #gpio-cells = <2>;
267267 interrupt-controller;
268268 #interrupt-cells = <2>;
269− gpio-ranges = <&iomuxc 0 56 26>, <&iomuxc 0 144 4>;
269+ gpio-ranges = <&iomuxc 0 56 26>, <&iomuxc 26 144 4>;
270270 };
271271
272272 gpio4: gpio@30230000 {
arch/arm64/boot/dts/qcom/sdm845-db845c.dts+3−1
@@ -415,7 +415,9 @@ · 414 unmodified lines
415415 &gcc {
416416 protected-clocks = <GCC_QSPI_CORE_CLK>,
417417 <GCC_QSPI_CORE_CLK_SRC>,
418− <GCC_QSPI_CNOC_PERIPH_AHB_CLK>;
418+ <GCC_QSPI_CNOC_PERIPH_AHB_CLK>,
419+ <GCC_LPASS_Q6_AXI_CLK>,
420+ <GCC_LPASS_SWAY_CLK>;
419421 };
420422
421423 &gpu {
arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts+5−9
@@ -302,7 +302,9 @@ · 301 unmodified lines
302302 &gcc {
303303 protected-clocks = <GCC_QSPI_CORE_CLK>,
304304 <GCC_QSPI_CORE_CLK_SRC>,
305− <GCC_QSPI_CNOC_PERIPH_AHB_CLK>;
305+ <GCC_QSPI_CNOC_PERIPH_AHB_CLK>,
306+ <GCC_LPASS_Q6_AXI_CLK>,
307+ <GCC_LPASS_SWAY_CLK>;
306308 };
307309
308310 &gpu {
@@ -320,6 +322,8 @@ · 11 unmodified lines
320322 &i2c3 {
321323 status = "okay";
322324 clock-frequency = <400000>;
325+ /* Overwrite pinctrl-0 from sdm845.dtsi */
326+ pinctrl-0 = <&qup_i2c3_default &i2c3_hid_active>;
323327
324328 tsel: hid@15 {
325329 compatible = "hid-over-i2c";
@@ -327,9 +331,6 @@ · 1 unmodified line
327331 hid-descr-addr = <0x1>;
328332
329333 interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_HIGH>;
330−
331− pinctrl-names = "default";
332− pinctrl-0 = <&i2c3_hid_active>;
333334 };
334335
335336 tsc2: hid@2c {
@@ -338,11 +339,6 @@ · 2 unmodified lines
338339 hid-descr-addr = <0x20>;
339340
340341 interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_HIGH>;
341−
342− pinctrl-names = "default";
343− pinctrl-0 = <&i2c3_hid_active>;
344−
345− status = "disabled";
346342 };
347343 };
348344
arch/arm64/boot/dts/rockchip/px30.dtsi+1−1
@@ -1097,7 +1097,7 @@ · 1096 unmodified lines
10971097 vopl_mmu: iommu@ff470f00 {
10981098 compatible = "rockchip,iommu";
10991099 reg = <0x0 0xff470f00 0x0 0x100>;
1100− interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
1100+ interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
11011101 interrupt-names = "vopl_mmu";
11021102 clocks = <&cru ACLK_VOPL>, <&cru HCLK_VOPL>;
11031103 clock-names = "aclk", "iface";
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts+4−0
@@ -114,6 +114,10 @@ · 113 unmodified lines
114114 cpu-supply = <&vdd_arm>;
115115 };
116116
117+&display_subsystem {
118+ status = "disabled";
119+};
120+
117121 &gmac2io {
118122 assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
119123 assigned-clock-parents = <&gmac_clk>, <&gmac_clk>;
arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts+0−1
@@ -790,7 +790,6 @@ · 789 unmodified lines
790790 &pcie0 {
791791 bus-scan-delay-ms = <1000>;
792792 ep-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>;
793− max-link-speed = <2>;
794793 num-lanes = <4>;
795794 pinctrl-names = "default";
796795 pinctrl-0 = <&pcie_clkreqn_cpm>;
arch/arm64/boot/dts/rockchip/rk3399.dtsi+1−2
@@ -234,6 +234,7 @@ · 233 unmodified lines
234234 reg = <0x0 0xf8000000 0x0 0x2000000>,
235235 <0x0 0xfd000000 0x0 0x1000000>;
236236 reg-names = "axi-base", "apb-base";
237+ device_type = "pci";
237238 #address-cells = <3>;
238239 #size-cells = <2>;
239240 #interrupt-cells = <1>;
@@ -252,7 +253,6 @@ · 12 unmodified lines
252253 <0 0 0 2 &pcie0_intc 1>,
253254 <0 0 0 3 &pcie0_intc 2>,
254255 <0 0 0 4 &pcie0_intc 3>;
255− linux,pci-domain = <0>;
256256 max-link-speed = <1>;
257257 msi-map = <0x0 &its 0x0 0x1000>;
258258 phys = <&pcie_phy 0>, <&pcie_phy 1>,
@@ -1278,7 +1278,6 @@ · 1019 unmodified lines
12781278 compatible = "rockchip,rk3399-vdec";
12791279 reg = <0x0 0xff660000 0x0 0x400>;
12801280 interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH 0>;
1281− interrupt-names = "vdpu";
12821281 clocks = <&cru ACLK_VDU>, <&cru HCLK_VDU>,
12831282 <&cru SCLK_VDU_CA>, <&cru SCLK_VDU_CORE>;
12841283 clock-names = "axi", "ahb", "cabac", "core";
arch/arm64/configs/defconfig+1−3
@@ -991,8 +991,6 @@ CONFIG_ARCH_TEGRA_210_SOC=y · 990 unmodified lines
991991 CONFIG_ARCH_TEGRA_186_SOC=y
992992 CONFIG_ARCH_TEGRA_194_SOC=y
993993 CONFIG_ARCH_TEGRA_234_SOC=y
994−CONFIG_ARCH_K3_AM6_SOC=y
995−CONFIG_ARCH_K3_J721E_SOC=y
996994 CONFIG_TI_SCI_PM_DOMAINS=y
997995 CONFIG_EXTCON_PTN5150=m
998996 CONFIG_EXTCON_USB_GPIO=y
@@ -1078,7 +1076,7 @@ CONFIG_INTERCONNECT=y · 79 unmodified lines
10781076 CONFIG_INTERCONNECT_QCOM=y
10791077 CONFIG_INTERCONNECT_QCOM_MSM8916=m
10801078 CONFIG_INTERCONNECT_QCOM_OSM_L3=m
1081−CONFIG_INTERCONNECT_QCOM_SDM845=m
1079+CONFIG_INTERCONNECT_QCOM_SDM845=y
10821080 CONFIG_INTERCONNECT_QCOM_SM8150=m
10831081 CONFIG_INTERCONNECT_QCOM_SM8250=m
10841082 CONFIG_EXT2_FS=y
arch/arm64/include/asm/atomic.h+5−5
@@ -17,7 +17,7 @@ · 16 unmodified lines
1717 #include <asm/lse.h>
1818
1919 #define ATOMIC_OP(op) \
20−static inline void arch_##op(int i, atomic_t *v) \
20+static __always_inline void arch_##op(int i, atomic_t *v) \
2121 { \
2222 __lse_ll_sc_body(op, i, v); \
2323 }
@@ -32,7 +32,7 @@ ATOMIC_OP(atomic_sub) · 8 unmodified lines
3232 #undef ATOMIC_OP
3333
3434 #define ATOMIC_FETCH_OP(name, op) \
35−static inline int arch_##op##name(int i, atomic_t *v) \
35+static __always_inline int arch_##op##name(int i, atomic_t *v) \
3636 { \
3737 return __lse_ll_sc_body(op##name, i, v); \
3838 }
@@ -56,7 +56,7 @@ ATOMIC_FETCH_OPS(atomic_sub_return) · 17 unmodified lines
5656 #undef ATOMIC_FETCH_OPS
5757
5858 #define ATOMIC64_OP(op) \
59−static inline void arch_##op(long i, atomic64_t *v) \
59+static __always_inline void arch_##op(long i, atomic64_t *v) \
6060 { \
6161 __lse_ll_sc_body(op, i, v); \
6262 }
@@ -71,7 +71,7 @@ ATOMIC64_OP(atomic64_sub) · 8 unmodified lines
7171 #undef ATOMIC64_OP
7272
7373 #define ATOMIC64_FETCH_OP(name, op) \
74−static inline long arch_##op##name(long i, atomic64_t *v) \
74+static __always_inline long arch_##op##name(long i, atomic64_t *v) \
7575 { \
7676 return __lse_ll_sc_body(op##name, i, v); \
7777 }
@@ -94,7 +94,7 @@ ATOMIC64_FETCH_OPS(atomic64_sub_return) · 16 unmodified lines
9494 #undef ATOMIC64_FETCH_OP
9595 #undef ATOMIC64_FETCH_OPS
9696
97−static inline long arch_atomic64_dec_if_positive(atomic64_t *v)
97+static __always_inline long arch_atomic64_dec_if_positive(atomic64_t *v)
9898 {
9999 return __lse_ll_sc_body(atomic64_dec_if_positive, v);
100100 }
arch/arm64/include/asm/kvm_host.h+23−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <linux/jump_label.h>
1818 #include <linux/kvm_types.h>
1919 #include <linux/percpu.h>
20+#include <linux/psci.h>
2021 #include <asm/arch_gicv3.h>
2122 #include <asm/barrier.h>
2223 #include <asm/cpufeature.h>
@@ -240,6 +241,28 @@ struct kvm_host_data { · 217 unmodified lines
240241 struct kvm_pmu_events pmu_events;
241242 };
242243
244+struct kvm_host_psci_config {
245+ /* PSCI version used by host. */
246+ u32 version;
247+
248+ /* Function IDs used by host if version is v0.1. */
249+ struct psci_0_1_function_ids function_ids_0_1;
250+
251+ bool psci_0_1_cpu_suspend_implemented;
252+ bool psci_0_1_cpu_on_implemented;
253+ bool psci_0_1_cpu_off_implemented;
254+ bool psci_0_1_migrate_implemented;
255+};
256+
257+extern struct kvm_host_psci_config kvm_nvhe_sym(kvm_host_psci_config);
258+#define kvm_host_psci_config CHOOSE_NVHE_SYM(kvm_host_psci_config)
259+
260+extern s64 kvm_nvhe_sym(hyp_physvirt_offset);
261+#define hyp_physvirt_offset CHOOSE_NVHE_SYM(hyp_physvirt_offset)
262+
263+extern u64 kvm_nvhe_sym(hyp_cpu_logical_map)[NR_CPUS];
264+#define hyp_cpu_logical_map CHOOSE_NVHE_SYM(hyp_cpu_logical_map)
265+
243266 struct vcpu_reset_state {
244267 unsigned long pc;
245268 unsigned long r0;
arch/arm64/include/asm/memory.h+6−4
@@ -247,11 +247,13 @@ static inline const void *__tag_set(const void *addr, u8 tag) · 246 unmodified lines
247247
248248
249249 /*
250− * The linear kernel range starts at the bottom of the virtual address space.
250+ * Check whether an arbitrary address is within the linear map, which
251+ * lives in the [PAGE_OFFSET, PAGE_END) interval at the bottom of the
252+ * kernel's TTBR1 address range.
251253 */
252−#define __is_lm_address(addr) (((u64)(addr) & ~PAGE_OFFSET) < (PAGE_END - PAGE_OFFSET))
254+#define __is_lm_address(addr) (((u64)(addr) - PAGE_OFFSET) < (PAGE_END - PAGE_OFFSET))
253255
254−#define __lm_to_phys(addr) (((addr) & ~PAGE_OFFSET) + PHYS_OFFSET)
256+#define __lm_to_phys(addr) (((addr) - PAGE_OFFSET) + PHYS_OFFSET)
255257 #define __kimg_to_phys(addr) ((addr) - kimage_voffset)
256258
257259 #define __virt_to_phys_nodebug(x) ({ \
@@ -330,7 +332,7 @@ static inline void *phys_to_virt(phys_addr_t x) · 72 unmodified lines
330332 #endif /* !CONFIG_SPARSEMEM_VMEMMAP || CONFIG_DEBUG_VIRTUAL */
331333
332334 #define virt_addr_valid(addr) ({ \
333− __typeof__(addr) __addr = addr; \
335+ __typeof__(addr) __addr = __tag_reset(addr); \
334336 __is_lm_address(__addr) && pfn_valid(virt_to_pfn(__addr)); \
335337 })
336338
arch/arm64/include/asm/uaccess.h+13−3
@@ -176,10 +176,21 @@ static inline void __uaccess_enable_hw_pan(void) · 175 unmodified lines
176176 * The Tag check override (TCO) bit disables temporarily the tag checking
177177 * preventing the issue.
178178 */
179−static inline void uaccess_disable_privileged(void)
179+static inline void __uaccess_disable_tco(void)
180180 {
181181 asm volatile(ALTERNATIVE("nop", SET_PSTATE_TCO(0),
182182 ARM64_MTE, CONFIG_KASAN_HW_TAGS));
183+}
184+
185+static inline void __uaccess_enable_tco(void)
186+{
187+ asm volatile(ALTERNATIVE("nop", SET_PSTATE_TCO(1),
188+ ARM64_MTE, CONFIG_KASAN_HW_TAGS));
189+}
190+
191+static inline void uaccess_disable_privileged(void)
192+{
193+ __uaccess_disable_tco();
183194
184195 if (uaccess_ttbr0_disable())
185196 return;
@@ -189,8 +200,7 @@ static inline void uaccess_disable_privileged(void) · 3 unmodified lines
189200
190201 static inline void uaccess_enable_privileged(void)
191202 {
192− asm volatile(ALTERNATIVE("nop", SET_PSTATE_TCO(1),
193− ARM64_MTE, CONFIG_KASAN_HW_TAGS));
203+ __uaccess_enable_tco();
194204
195205 if (uaccess_ttbr0_enable())
196206 return;
arch/arm64/kernel/asm-offsets.c+1−1
@@ -75,7 +75,7 @@ int main(void) · 74 unmodified lines
7575 DEFINE(S_SDEI_TTBR1, offsetof(struct pt_regs, sdei_ttbr1));
7676 DEFINE(S_PMR_SAVE, offsetof(struct pt_regs, pmr_save));
7777 DEFINE(S_STACKFRAME, offsetof(struct pt_regs, stackframe));
78− DEFINE(S_FRAME_SIZE, sizeof(struct pt_regs));
78+ DEFINE(PT_REGS_SIZE, sizeof(struct pt_regs));
7979 BLANK();
8080 #ifdef CONFIG_COMPAT
8181 DEFINE(COMPAT_SIGFRAME_REGS_OFFSET, offsetof(struct compat_sigframe, uc.uc_mcontext.arm_r0));
arch/arm64/kernel/cpufeature.c+2−6
@@ -1701,16 +1701,12 @@ static void bti_enable(const struct arm64_cpu_capabilities *__unused) · 1700 unmodified lines
17011701 #ifdef CONFIG_ARM64_MTE
17021702 static void cpu_enable_mte(struct arm64_cpu_capabilities const *cap)
17031703 {
1704− static bool cleared_zero_page = false;
1705−
17061704 /*
17071705 * Clear the tags in the zero page. This needs to be done via the
17081706 * linear map which has the Tagged attribute.
17091707 */
1710− if (!cleared_zero_page) {
1711− cleared_zero_page = true;
1708+ if (!test_and_set_bit(PG_mte_tagged, &ZERO_PAGE(0)->flags))
17121709 mte_clear_page_tags(lm_alias(empty_zero_page));
1713− }
17141710
17151711 kasan_init_hw_tags_cpu();
17161712 }
@@ -2568,7 +2564,7 @@ static void verify_hyp_capabilities(void) · 851 unmodified lines
25682564 int parange, ipa_max;
25692565 unsigned int safe_vmid_bits, vmid_bits;
25702566
2571− if (!IS_ENABLED(CONFIG_KVM) || !IS_ENABLED(CONFIG_KVM_ARM_HOST))
2567+ if (!IS_ENABLED(CONFIG_KVM))
25722568 return;
25732569
25742570 safe_mmfr1 = read_sanitised_ftr_reg(SYS_ID_AA64MMFR1_EL1);
arch/arm64/kernel/entry-ftrace.S+6−6
@@ -35,7 +35,7 @@ · 34 unmodified lines
3535 */
3636 .macro ftrace_regs_entry, allregs=0
3737 /* Make room for pt_regs, plus a callee frame */
38− sub sp, sp, #(S_FRAME_SIZE + 16)
38+ sub sp, sp, #(PT_REGS_SIZE + 16)
3939
4040 /* Save function arguments (and x9 for simplicity) */
4141 stp x0, x1, [sp, #S_X0]
@@ -61,15 +61,15 @@ · 19 unmodified lines
6161 .endif
6262
6363 /* Save the callsite's SP and LR */
64− add x10, sp, #(S_FRAME_SIZE + 16)
64+ add x10, sp, #(PT_REGS_SIZE + 16)
6565 stp x9, x10, [sp, #S_LR]
6666
6767 /* Save the PC after the ftrace callsite */
6868 str x30, [sp, #S_PC]
6969
7070 /* Create a frame record for the callsite above pt_regs */
71− stp x29, x9, [sp, #S_FRAME_SIZE]
72− add x29, sp, #S_FRAME_SIZE
71+ stp x29, x9, [sp, #PT_REGS_SIZE]
72+ add x29, sp, #PT_REGS_SIZE
7373
7474 /* Create our frame record within pt_regs. */
7575 stp x29, x30, [sp, #S_STACKFRAME]
@@ -120,7 +120,7 @@ ftrace_common_return: · 44 unmodified lines
120120 ldr x9, [sp, #S_PC]
121121
122122 /* Restore the callsite's SP */
123− add sp, sp, #S_FRAME_SIZE + 16
123+ add sp, sp, #PT_REGS_SIZE + 16
124124
125125 ret x9
126126 SYM_CODE_END(ftrace_common)
@@ -130,7 +130,7 @@ SYM_CODE_START(ftrace_graph_caller) · 3 unmodified lines
130130 ldr x0, [sp, #S_PC]
131131 sub x0, x0, #AARCH64_INSN_SIZE // ip (callsite's BL insn)
132132 add x1, sp, #S_LR // parent_ip (callsite's LR)
133− ldr x2, [sp, #S_FRAME_SIZE] // parent fp (callsite's FP)
133+ ldr x2, [sp, #PT_REGS_SIZE] // parent fp (callsite's FP)
134134 bl prepare_ftrace_return
135135 b ftrace_common_return
136136 SYM_CODE_END(ftrace_graph_caller)
arch/arm64/kernel/entry.S+8−8
@@ -75,7 +75,7 @@ alternative_else_nop_endif · 74 unmodified lines
7575 .endif
7676 #endif
7777
78− sub sp, sp, #S_FRAME_SIZE
78+ sub sp, sp, #PT_REGS_SIZE
7979 #ifdef CONFIG_VMAP_STACK
8080 /*
8181 * Test whether the SP has overflowed, without corrupting a GPR.
@@ -96,7 +96,7 @@ alternative_else_nop_endif · 14 unmodified lines
9696 * userspace, and can clobber EL0 registers to free up GPRs.
9797 */
9898
99− /* Stash the original SP (minus S_FRAME_SIZE) in tpidr_el0. */
99+ /* Stash the original SP (minus PT_REGS_SIZE) in tpidr_el0. */
100100 msr tpidr_el0, x0
101101
102102 /* Recover the original x0 value and stash it in tpidrro_el0 */
@@ -182,7 +182,6 @@ alternative_else_nop_endif · 79 unmodified lines
182182 mrs_s \tmp2, SYS_GCR_EL1
183183 bfi \tmp2, \tmp, #0, #16
184184 msr_s SYS_GCR_EL1, \tmp2
185− isb
186185 #endif
187186 .endm
188187
@@ -194,6 +193,7 @@ alternative_else_nop_endif · 5 unmodified lines
194193 ldr_l \tmp, gcr_kernel_excl
195194
196195 mte_set_gcr \tmp, \tmp2
196+ isb
197197 1:
198198 #endif
199199 .endm
@@ -253,7 +253,7 @@ alternative_else_nop_endif · 53 unmodified lines
253253
254254 scs_load tsk, x20
255255 .else
256− add x21, sp, #S_FRAME_SIZE
256+ add x21, sp, #PT_REGS_SIZE
257257 get_current_task tsk
258258 .endif /* \el == 0 */
259259 mrs x22, elr_el1
@@ -377,7 +377,7 @@ alternative_else_nop_endif · 117 unmodified lines
377377 ldp x26, x27, [sp, #16 * 13]
378378 ldp x28, x29, [sp, #16 * 14]
379379 ldr lr, [sp, #S_LR]
380− add sp, sp, #S_FRAME_SIZE // restore sp
380+ add sp, sp, #PT_REGS_SIZE // restore sp
381381
382382 .if \el == 0
383383 alternative_insn eret, nop, ARM64_UNMAP_KERNEL_AT_EL0
@@ -580,12 +580,12 @@ __bad_stack: · 196 unmodified lines
580580
581581 /*
582582 * Store the original GPRs to the new stack. The orginal SP (minus
583− * S_FRAME_SIZE) was stashed in tpidr_el0 by kernel_ventry.
583+ * PT_REGS_SIZE) was stashed in tpidr_el0 by kernel_ventry.
584584 */
585− sub sp, sp, #S_FRAME_SIZE
585+ sub sp, sp, #PT_REGS_SIZE
586586 kernel_entry 1
587587 mrs x0, tpidr_el0
588− add x0, x0, #S_FRAME_SIZE
588+ add x0, x0, #PT_REGS_SIZE
589589 str x0, [sp, #S_SP]
590590
591591 /* Stash the regs for handle_bad_stack */
arch/arm64/kernel/mte.c+2−1
@@ -329,11 +329,12 @@ static int __access_remote_tags(struct mm_struct *mm, unsigned long addr, · 328 unmodified lines
329329 * would cause the existing tags to be cleared if the page
330330 * was never mapped with PROT_MTE.
331331 */
332− if (!test_bit(PG_mte_tagged, &page->flags)) {
332+ if (!(vma->vm_flags & VM_MTE)) {
333333 ret = -EOPNOTSUPP;
334334 put_page(page);
335335 break;
336336 }
337+ WARN_ON_ONCE(!test_bit(PG_mte_tagged, &page->flags));
337338
338339 /* limit access to the end of the page */
339340 offset = offset_in_page(addr);
arch/arm64/kernel/perf_event.c+2−39
@@ -23,8 +23,6 @@ · 22 unmodified lines
2323 #include <linux/platform_device.h>
2424 #include <linux/sched_clock.h>
2525 #include <linux/smp.h>
26−#include <linux/nmi.h>
27−#include <linux/cpufreq.h>
2826
2927 /* ARMv8 Cortex-A53 specific event types. */
3028 #define ARMV8_A53_PERFCTR_PREF_LINEFILL 0xC2
@@ -1250,21 +1248,10 @@ static struct platform_driver armv8_pmu_driver = { · 1219 unmodified lines
12501248
12511249 static int __init armv8_pmu_driver_init(void)
12521250 {
1253− int ret;
1254−
12551251 if (acpi_disabled)
1256− ret = platform_driver_register(&armv8_pmu_driver);
1252+ return platform_driver_register(&armv8_pmu_driver);
12571253 else
1258− ret = arm_pmu_acpi_probe(armv8_pmuv3_init);
1259−
1260− /*
1261− * Try to re-initialize lockup detector after PMU init in
1262− * case PMU events are triggered via NMIs.
1263− */
1264− if (ret == 0 && arm_pmu_irq_is_nmi())
1265− lockup_detector_init();
1266−
1267− return ret;
1254+ return arm_pmu_acpi_probe(armv8_pmuv3_init);
12681255 }
12691256 device_initcall(armv8_pmu_driver_init)
12701257
@@ -1322,27 +1309,3 @@ void arch_perf_update_userpage(struct perf_event *event, · 51 unmodified lines
13221309 userpg->cap_user_time_zero = 1;
13231310 userpg->cap_user_time_short = 1;
13241311 }
1325−
1326−#ifdef CONFIG_HARDLOCKUP_DETECTOR_PERF
1327−/*
1328− * Safe maximum CPU frequency in case a particular platform doesn't implement
1329− * cpufreq driver. Although, architecture doesn't put any restrictions on
1330− * maximum frequency but 5 GHz seems to be safe maximum given the available
1331− * Arm CPUs in the market which are clocked much less than 5 GHz. On the other
1332− * hand, we can't make it much higher as it would lead to a large hard-lockup
1333− * detection timeout on parts which are running slower (eg. 1GHz on
1334− * Developerbox) and doesn't possess a cpufreq driver.
1335− */
1336−#define SAFE_MAX_CPU_FREQ 5000000000UL // 5 GHz
1337−u64 hw_nmi_get_sample_period(int watchdog_thresh)
1338−{
1339− unsigned int cpu = smp_processor_id();
1340− unsigned long max_cpu_freq;
1341−
1342− max_cpu_freq = cpufreq_get_hw_max_freq(cpu) * 1000UL;
1343− if (!max_cpu_freq)
1344− max_cpu_freq = SAFE_MAX_CPU_FREQ;
1345−
1346− return (u64)max_cpu_freq * watchdog_thresh;
1347−}
1348−#endif
arch/arm64/kernel/probes/kprobes.c+2−2
@@ -352,8 +352,8 @@ kprobe_breakpoint_ss_handler(struct pt_regs *regs, unsigned int esr) · 351 unmodified lines
352352 unsigned long addr = instruction_pointer(regs);
353353 struct kprobe *cur = kprobe_running();
354354
355− if (cur && (kcb->kprobe_status == KPROBE_HIT_SS)
356− && ((unsigned long)&cur->ainsn.api.insn[1] == addr)) {
355+ if (cur && (kcb->kprobe_status & (KPROBE_HIT_SS | KPROBE_REENTER)) &&
356+ ((unsigned long)&cur->ainsn.api.insn[1] == addr)) {
357357 kprobes_restore_local_irqflag(kcb, regs);
358358 post_kprobe_handler(cur, kcb, regs);
359359
arch/arm64/kernel/probes/kprobes_trampoline.S+3−3
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 stp x24, x25, [sp, #S_X24]
2626 stp x26, x27, [sp, #S_X26]
2727 stp x28, x29, [sp, #S_X28]
28− add x0, sp, #S_FRAME_SIZE
28+ add x0, sp, #PT_REGS_SIZE
2929 stp lr, x0, [sp, #S_LR]
3030 /*
3131 * Construct a useful saved PSTATE
@@ -62,7 +62,7 @@ · 30 unmodified lines
6262 .endm
6363
6464 SYM_CODE_START(kretprobe_trampoline)
65− sub sp, sp, #S_FRAME_SIZE
65+ sub sp, sp, #PT_REGS_SIZE
6666
6767 save_all_base_regs
6868
@@ -76,7 +76,7 @@ SYM_CODE_START(kretprobe_trampoline) · 7 unmodified lines
7676
7777 restore_all_base_regs
7878
79− add sp, sp, #S_FRAME_SIZE
79+ add sp, sp, #PT_REGS_SIZE
8080 ret
8181
8282 SYM_CODE_END(kretprobe_trampoline)
arch/arm64/kernel/signal.c+0−7
@@ -914,13 +914,6 @@ static void do_signal(struct pt_regs *regs) · 913 unmodified lines
914914 asmlinkage void do_notify_resume(struct pt_regs *regs,
915915 unsigned long thread_flags)
916916 {
917− /*
918− * The assembly code enters us with IRQs off, but it hasn't
919− * informed the tracing code of that for efficiency reasons.
920− * Update the trace code with the current status.
921− */
922− trace_hardirqs_off();
923−
924917 do {
925918 if (thread_flags & _TIF_NEED_RESCHED) {
926919 /* Unmask Debug and SError for the next task */
arch/arm64/kernel/smp.c+1−2
@@ -434,7 +434,7 @@ static void __init hyp_mode_check(void) · 433 unmodified lines
434434 "CPU: CPUs started in inconsistent modes");
435435 else
436436 pr_info("CPU: All CPU(s) started at EL1\n");
437− if (IS_ENABLED(CONFIG_KVM))
437+ if (IS_ENABLED(CONFIG_KVM) && !is_kernel_in_hyp_mode())
438438 kvm_compute_layout();
439439 }
440440
@@ -807,7 +807,6 @@ int arch_show_interrupts(struct seq_file *p, int prec) · 366 unmodified lines
807807 unsigned int cpu, i;
808808
809809 for (i = 0; i < NR_IPI; i++) {
810− unsigned int irq = irq_desc_get_irq(ipi_desc[i]);
811810 seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i,
812811 prec >= 4 ? " " : "");
813812 for_each_online_cpu(cpu)
arch/arm64/kernel/syscall.c+2−8
@@ -9,6 +9,7 @@ · 8 unmodified lines
99
1010 #include <asm/daifflags.h>
1111 #include <asm/debug-monitors.h>
12+#include <asm/exception.h>
1213 #include <asm/fpsimd.h>
1314 #include <asm/syscall.h>
1415 #include <asm/thread_info.h>
@@ -165,15 +166,8 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr, · 150 unmodified lines
165166 if (!has_syscall_work(flags) && !IS_ENABLED(CONFIG_DEBUG_RSEQ)) {
166167 local_daif_mask();
167168 flags = current_thread_info()->flags;
168− if (!has_syscall_work(flags) && !(flags & _TIF_SINGLESTEP)) {
169− /*
170− * We're off to userspace, where interrupts are
171− * always enabled after we restore the flags from
172− * the SPSR.
173− */
174− trace_hardirqs_on();
169+ if (!has_syscall_work(flags) && !(flags & _TIF_SINGLESTEP))
175170 return;
176− }
177171 local_daif_restore(DAIF_PROCCTX);
178172 }
179173
arch/arm64/kernel/traps.c+0−1
@@ -42,7 +42,6 @@ · 41 unmodified lines
4242 #include <asm/smp.h>
4343 #include <asm/stack_pointer.h>
4444 #include <asm/stacktrace.h>
45−#include <asm/exception.h>
4645 #include <asm/system_misc.h>
4746 #include <asm/sysreg.h>
4847
arch/arm64/kernel/vdso/Makefile+1−2
@@ -24,8 +24,7 @@ btildflags-$(CONFIG_ARM64_BTI_KERNEL) += -z force-bti · 23 unmodified lines
2424 # routines, as x86 does (see 6f121e548f83 ("x86, vdso: Reimplement vdso.so
2525 # preparation in build-time C")).
2626 ldflags-y := -shared -nostdlib -soname=linux-vdso.so.1 --hash-style=sysv \
27− -Bsymbolic $(call ld-option, --no-eh-frame-hdr) --build-id=sha1 -n \
28− $(btildflags-y) -T
27+ -Bsymbolic --build-id=sha1 -n $(btildflags-y) -T
2928
3029 ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18
3130 ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
arch/arm64/kernel/vdso/vdso.lds.S+1−4
@@ -40,9 +40,6 @@ SECTIONS · 39 unmodified lines
4040 PROVIDE (_etext = .);
4141 PROVIDE (etext = .);
4242
43− .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
44− .eh_frame : { KEEP (*(.eh_frame)) } :text
45−
4643 .dynamic : { *(.dynamic) } :text :dynamic
4744
4845 .rodata : { *(.rodata*) } :text
@@ -54,6 +51,7 @@ SECTIONS · 5 unmodified lines
5451 *(.note.GNU-stack)
5552 *(.data .data.* .gnu.linkonce.d.* .sdata*)
5653 *(.bss .sbss .dynbss .dynsbss)
54+ *(.eh_frame .eh_frame_hdr)
5755 }
5856 }
5957
@@ -66,7 +64,6 @@ PHDRS · 6 unmodified lines
6664 text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
6765 dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
6866 note PT_NOTE FLAGS(4); /* PF_R */
69− eh_frame_hdr PT_GNU_EH_FRAME;
7067 }
7168
7269 /*
arch/arm64/kvm/Kconfig+0−8
@@ -49,14 +49,6 @@ if KVM · 48 unmodified lines
4949
5050 source "virt/kvm/Kconfig"
5151
52−config KVM_ARM_PMU
53− bool "Virtual Performance Monitoring Unit (PMU) support"
54− depends on HW_PERF_EVENTS
55− default y
56− help
57− Adds support for a virtual Performance Monitoring Unit (PMU) in
58− virtual machines.
59−
6052 endif # KVM
6153
6254 endif # VIRTUALIZATION
arch/arm64/kvm/Makefile+1−1
@@ -24,4 +24,4 @@ kvm-y := $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o $(KVM)/eventfd.o \ · 23 unmodified lines
2424 vgic/vgic-mmio-v3.o vgic/vgic-kvm-device.o \
2525 vgic/vgic-its.o vgic/vgic-debug.o
2626
27−kvm-$(CONFIG_KVM_ARM_PMU) += pmu-emul.o
27+kvm-$(CONFIG_HW_PERF_EVENTS) += pmu-emul.o
arch/arm64/kvm/arch_timer.c+4−3
@@ -1129,9 +1129,10 @@ int kvm_timer_enable(struct kvm_vcpu *vcpu) · 1128 unmodified lines
11291129 if (!irqchip_in_kernel(vcpu->kvm))
11301130 goto no_vgic;
11311131
1132− if (!vgic_initialized(vcpu->kvm))
1133− return -ENODEV;
1134−
1132+ /*
1133+ * At this stage, we have the guarantee that the vgic is both
1134+ * available and initialized.
1135+ */
11351136 if (!timer_irqs_are_valid(vcpu)) {
11361137 kvm_debug("incorrectly configured timer irqs\n");
11371138 return -EINVAL;
arch/arm64/kvm/arm.c+20−15
@@ -65,10 +65,6 @@ static bool vgic_present; · 64 unmodified lines
6565 static DEFINE_PER_CPU(unsigned char, kvm_arm_hardware_enabled);
6666 DEFINE_STATIC_KEY_FALSE(userspace_irqchip_in_use);
6767
68−extern u64 kvm_nvhe_sym(__cpu_logical_map)[NR_CPUS];
69−extern u32 kvm_nvhe_sym(kvm_host_psci_version);
70−extern struct psci_0_1_function_ids kvm_nvhe_sym(kvm_host_psci_0_1_function_ids);
71−
7268 int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu)
7369 {
7470 return kvm_vcpu_exiting_guest_mode(vcpu) == IN_GUEST_MODE;
@@ -584,11 +580,9 @@ static int kvm_vcpu_first_run_init(struct kvm_vcpu *vcpu) · 509 unmodified lines
584580 * Map the VGIC hardware resources before running a vcpu the
585581 * first time on this VM.
586582 */
587− if (unlikely(!vgic_ready(kvm))) {
588− ret = kvm_vgic_map_resources(kvm);
589− if (ret)
590− return ret;
591− }
583+ ret = kvm_vgic_map_resources(kvm);
584+ if (ret)
585+ return ret;
592586 } else {
593587 /*
594588 * Tell the rest of the code that there are userspace irqchip
@@ -1402,8 +1396,9 @@ static void cpu_init_hyp_mode(void) · 807 unmodified lines
14021396 * Calculate the raw per-cpu offset without a translation from the
14031397 * kernel's mapping to the linear mapping, and store it in tpidr_el2
14041398 * so that we can use adr_l to access per-cpu variables in EL2.
1399+ * Also drop the KASAN tag which gets in the way...
14051400 */
1406− params->tpidr_el2 = (unsigned long)this_cpu_ptr_nvhe_sym(__per_cpu_start) -
1401+ params->tpidr_el2 = (unsigned long)kasan_reset_tag(this_cpu_ptr_nvhe_sym(__per_cpu_start)) -
14071402 (unsigned long)kvm_ksym_ref(CHOOSE_NVHE_SYM(__per_cpu_start));
14081403
14091404 params->mair_el2 = read_sysreg(mair_el1);
@@ -1574,12 +1569,12 @@ static struct notifier_block hyp_init_cpu_pm_nb = { · 164 unmodified lines
15741569 .notifier_call = hyp_init_cpu_pm_notifier,
15751570 };
15761571
1577−static void __init hyp_cpu_pm_init(void)
1572+static void hyp_cpu_pm_init(void)
15781573 {
15791574 if (!is_protected_kvm_enabled())
15801575 cpu_pm_register_notifier(&hyp_init_cpu_pm_nb);
15811576 }
1582−static void __init hyp_cpu_pm_exit(void)
1577+static void hyp_cpu_pm_exit(void)
15831578 {
15841579 if (!is_protected_kvm_enabled())
15851580 cpu_pm_unregister_notifier(&hyp_init_cpu_pm_nb);
@@ -1604,9 +1599,12 @@ static void init_cpu_logical_map(void) · 18 unmodified lines
16041599 * allow any other CPUs from the `possible` set to boot.
16051600 */
16061601 for_each_online_cpu(cpu)
1607− kvm_nvhe_sym(__cpu_logical_map)[cpu] = cpu_logical_map(cpu);
1602+ hyp_cpu_logical_map[cpu] = cpu_logical_map(cpu);
16081603 }
16091604
1605+#define init_psci_0_1_impl_state(config, what) \
1606+ config.psci_0_1_ ## what ## _implemented = psci_ops.what
1607+
16101608 static bool init_psci_relay(void)
16111609 {
16121610 /*
@@ -1618,8 +1616,15 @@ static bool init_psci_relay(void) · 5 unmodified lines
16181616 return false;
16191617 }
16201618
1621− kvm_nvhe_sym(kvm_host_psci_version) = psci_ops.get_version();
1622− kvm_nvhe_sym(kvm_host_psci_0_1_function_ids) = get_psci_0_1_function_ids();
1619+ kvm_host_psci_config.version = psci_ops.get_version();
1620+
1621+ if (kvm_host_psci_config.version == PSCI_VERSION(0, 1)) {
1622+ kvm_host_psci_config.function_ids_0_1 = get_psci_0_1_function_ids();
1623+ init_psci_0_1_impl_state(kvm_host_psci_config, cpu_suspend);
1624+ init_psci_0_1_impl_state(kvm_host_psci_config, cpu_on);
1625+ init_psci_0_1_impl_state(kvm_host_psci_config, cpu_off);
1626+ init_psci_0_1_impl_state(kvm_host_psci_config, migrate);
1627+ }
16231628 return true;
16241629 }
16251630
arch/arm64/kvm/hyp/include/hyp/adjust_pc.h+9−0
@@ -59,4 +59,13 @@ static inline void __adjust_pc(struct kvm_vcpu *vcpu) · 58 unmodified lines
5959 }
6060 }
6161
62+/*
63+ * Skip an instruction while host sysregs are live.
64+ * Assumes host is always 64-bit.
65+ */
66+static inline void kvm_skip_host_instr(void)
67+{
68+ write_sysreg_el2(read_sysreg_el2(SYS_ELR) + 4, SYS_ELR);
69+}
70+
6271 #endif
arch/arm64/kvm/hyp/nvhe/hyp-init.S+11−9
@@ -47,6 +47,8 @@ __invalid: · 46 unmodified lines
4747 b .
4848
4949 /*
50+ * Only uses x0..x3 so as to not clobber callee-saved SMCCC registers.
51+ *
5052 * x0: SMCCC function ID
5153 * x1: struct kvm_nvhe_init_params PA
5254 */
@@ -70,9 +72,9 @@ __do_hyp_init: · 17 unmodified lines
7072 eret
7173
7274 1: mov x0, x1
73− mov x4, lr
74− bl ___kvm_hyp_init
75− mov lr, x4
75+ mov x3, lr
76+ bl ___kvm_hyp_init // Clobbers x0..x2
77+ mov lr, x3
7678
7779 /* Hello, World! */
7880 mov x0, #SMCCC_RET_SUCCESS
@@ -82,8 +84,8 @@ SYM_CODE_END(__kvm_hyp_init) · 3 unmodified lines
8284 /*
8385 * Initialize the hypervisor in EL2.
8486 *
85− * Only uses x0..x3 so as to not clobber callee-saved SMCCC registers
86− * and leave x4 for the caller.
87+ * Only uses x0..x2 so as to not clobber callee-saved SMCCC registers
88+ * and leave x3 for the caller.
8789 *
8890 * x0: struct kvm_nvhe_init_params PA
8991 */
@@ -112,9 +114,9 @@ alternative_else_nop_endif · 22 unmodified lines
112114 /*
113115 * Set the PS bits in TCR_EL2.
114116 */
115− ldr x1, [x0, #NVHE_INIT_TCR_EL2]
116− tcr_compute_pa_size x1, #TCR_EL2_PS_SHIFT, x2, x3
117− msr tcr_el2, x1
117+ ldr x0, [x0, #NVHE_INIT_TCR_EL2]
118+ tcr_compute_pa_size x0, #TCR_EL2_PS_SHIFT, x1, x2
119+ msr tcr_el2, x0
118120
119121 isb
120122
@@ -193,7 +195,7 @@ SYM_CODE_START_LOCAL(__kvm_hyp_init_cpu) · 72 unmodified lines
193195
194196 /* Enable MMU, set vectors and stack. */
195197 mov x0, x28
196− bl ___kvm_hyp_init // Clobbers x0..x3
198+ bl ___kvm_hyp_init // Clobbers x0..x2
197199
198200 /* Leave idmap. */
199201 mov x0, x29
arch/arm64/kvm/hyp/nvhe/hyp-main.c+2−10
@@ -157,11 +157,6 @@ static void default_host_smc_handler(struct kvm_cpu_context *host_ctxt) · 156 unmodified lines
157157 __kvm_hyp_host_forward_smc(host_ctxt);
158158 }
159159
160−static void skip_host_instruction(void)
161−{
162− write_sysreg_el2(read_sysreg_el2(SYS_ELR) + 4, SYS_ELR);
163−}
164−
165160 static void handle_host_smc(struct kvm_cpu_context *host_ctxt)
166161 {
167162 bool handled;
@@ -170,11 +165,8 @@ static void handle_host_smc(struct kvm_cpu_context *host_ctxt) · 2 unmodified lines
170165 if (!handled)
171166 default_host_smc_handler(host_ctxt);
172167
173− /*
174− * Unlike HVC, the return address of an SMC is the instruction's PC.
175− * Move the return address past the instruction.
176− */
177− skip_host_instruction();
168+ /* SMC was trapped, move ELR past the current PC. */
169+ kvm_skip_host_instr();
178170 }
179171
180172 void handle_trap(struct kvm_cpu_context *host_ctxt)
arch/arm64/kvm/hyp/nvhe/hyp-smp.c+3−3
@@ -14,14 +14,14 @@ · 13 unmodified lines
1414 * Other CPUs should not be allowed to boot because their features were
1515 * not checked against the finalized system capabilities.
1616 */
17−u64 __ro_after_init __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = INVALID_HWID };
17+u64 __ro_after_init hyp_cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = INVALID_HWID };
1818
1919 u64 cpu_logical_map(unsigned int cpu)
2020 {
21− if (cpu >= ARRAY_SIZE(__cpu_logical_map))
21+ if (cpu >= ARRAY_SIZE(hyp_cpu_logical_map))
2222 hyp_panic();
2323
24− return __cpu_logical_map[cpu];
24+ return hyp_cpu_logical_map[cpu];
2525 }
2626
2727 unsigned long __hyp_per_cpu_offset(unsigned int cpu)
arch/arm64/kvm/hyp/nvhe/psci-relay.c+27−45
@@ -7,11 +7,8 @@ · 6 unmodified lines
77 #include <asm/kvm_asm.h>
88 #include <asm/kvm_hyp.h>
99 #include <asm/kvm_mmu.h>
10−#include <kvm/arm_hypercalls.h>
1110 #include <linux/arm-smccc.h>
1211 #include <linux/kvm_host.h>
13−#include <linux/psci.h>
14−#include <kvm/arm_psci.h>
1512 #include <uapi/linux/psci.h>
1613
1714 #include <nvhe/trap_handler.h>
@@ -22,9 +19,8 @@ void kvm_hyp_cpu_resume(unsigned long r0); · 4 unmodified lines
2219 void __noreturn __host_enter(struct kvm_cpu_context *host_ctxt);
2320
2421 /* Config options set by the host. */
25−__ro_after_init u32 kvm_host_psci_version;
26−__ro_after_init struct psci_0_1_function_ids kvm_host_psci_0_1_function_ids;
27−__ro_after_init s64 hyp_physvirt_offset;
22+struct kvm_host_psci_config __ro_after_init kvm_host_psci_config;
23+s64 __ro_after_init hyp_physvirt_offset;
2824
2925 #define __hyp_pa(x) ((phys_addr_t)((x)) + hyp_physvirt_offset)
3026
@@ -47,19 +43,16 @@ struct psci_boot_args { · 16 unmodified lines
4743 static DEFINE_PER_CPU(struct psci_boot_args, cpu_on_args) = PSCI_BOOT_ARGS_INIT;
4844 static DEFINE_PER_CPU(struct psci_boot_args, suspend_args) = PSCI_BOOT_ARGS_INIT;
4945
50−static u64 get_psci_func_id(struct kvm_cpu_context *host_ctxt)
51−{
52− DECLARE_REG(u64, func_id, host_ctxt, 0);
53−
54− return func_id;
55−}
46+#define is_psci_0_1(what, func_id) \
47+ (kvm_host_psci_config.psci_0_1_ ## what ## _implemented && \
48+ (func_id) == kvm_host_psci_config.function_ids_0_1.what)
5649
5750 static bool is_psci_0_1_call(u64 func_id)
5851 {
59− return (func_id == kvm_host_psci_0_1_function_ids.cpu_suspend) ||
60− (func_id == kvm_host_psci_0_1_function_ids.cpu_on) ||
61− (func_id == kvm_host_psci_0_1_function_ids.cpu_off) ||
62− (func_id == kvm_host_psci_0_1_function_ids.migrate);
52+ return (is_psci_0_1(cpu_suspend, func_id) ||
53+ is_psci_0_1(cpu_on, func_id) ||
54+ is_psci_0_1(cpu_off, func_id) ||
55+ is_psci_0_1(migrate, func_id));
6356 }
6457
6558 static bool is_psci_0_2_call(u64 func_id)
@@ -69,16 +62,6 @@ static bool is_psci_0_2_call(u64 func_id) · 3 unmodified lines
6962 (PSCI_0_2_FN64(0) <= func_id && func_id <= PSCI_0_2_FN64(31));
7063 }
7164
72−static bool is_psci_call(u64 func_id)
73−{
74− switch (kvm_host_psci_version) {
75− case PSCI_VERSION(0, 1):
76− return is_psci_0_1_call(func_id);
77− default:
78− return is_psci_0_2_call(func_id);
79− }
80−}
81−
8265 static unsigned long psci_call(unsigned long fn, unsigned long arg0,
8366 unsigned long arg1, unsigned long arg2)
8467 {
@@ -94,12 +77,6 @@ static unsigned long psci_forward(struct kvm_cpu_context *host_ctxt) · 9 unmodified lines
9477 cpu_reg(host_ctxt, 2), cpu_reg(host_ctxt, 3));
9578 }
9679
97−static __noreturn unsigned long psci_forward_noreturn(struct kvm_cpu_context *host_ctxt)
98−{
99− psci_forward(host_ctxt);
100− hyp_panic(); /* unreachable */
101−}
102−
10380 static unsigned int find_cpu_id(u64 mpidr)
10481 {
10582 unsigned int i;
@@ -248,15 +225,14 @@ asmlinkage void __noreturn kvm_host_psci_cpu_entry(bool is_cpu_on) · 142 unmodified lines
248225
249226 static unsigned long psci_0_1_handler(u64 func_id, struct kvm_cpu_context *host_ctxt)
250227 {
251− if ((func_id == kvm_host_psci_0_1_function_ids.cpu_off) ||
252− (func_id == kvm_host_psci_0_1_function_ids.migrate))
228+ if (is_psci_0_1(cpu_off, func_id) || is_psci_0_1(migrate, func_id))
253229 return psci_forward(host_ctxt);
254− else if (func_id == kvm_host_psci_0_1_function_ids.cpu_on)
230+ if (is_psci_0_1(cpu_on, func_id))
255231 return psci_cpu_on(func_id, host_ctxt);
256− else if (func_id == kvm_host_psci_0_1_function_ids.cpu_suspend)
232+ if (is_psci_0_1(cpu_suspend, func_id))
257233 return psci_cpu_suspend(func_id, host_ctxt);
258− else
259− return PSCI_RET_NOT_SUPPORTED;
234+
235+ return PSCI_RET_NOT_SUPPORTED;
260236 }
261237
262238 static unsigned long psci_0_2_handler(u64 func_id, struct kvm_cpu_context *host_ctxt)
@@ -269,10 +245,13 @@ static unsigned long psci_0_2_handler(u64 func_id, struct kvm_cpu_context *host_ · 6 unmodified lines
269245 case PSCI_0_2_FN_MIGRATE_INFO_TYPE:
270246 case PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU:
271247 return psci_forward(host_ctxt);
248+ /*
249+ * SYSTEM_OFF/RESET should not return according to the spec.
250+ * Allow it so as to stay robust to broken firmware.
251+ */
272252 case PSCI_0_2_FN_SYSTEM_OFF:
273253 case PSCI_0_2_FN_SYSTEM_RESET:
274− psci_forward_noreturn(host_ctxt);
275− unreachable();
254+ return psci_forward(host_ctxt);
276255 case PSCI_0_2_FN64_CPU_SUSPEND:
277256 return psci_cpu_suspend(func_id, host_ctxt);
278257 case PSCI_0_2_FN64_CPU_ON:
@@ -298,20 +277,23 @@ static unsigned long psci_1_0_handler(u64 func_id, struct kvm_cpu_context *host_ · 19 unmodified lines
298277
299278 bool kvm_host_psci_handler(struct kvm_cpu_context *host_ctxt)
300279 {
301− u64 func_id = get_psci_func_id(host_ctxt);
280+ DECLARE_REG(u64, func_id, host_ctxt, 0);
302281 unsigned long ret;
303282
304− if (!is_psci_call(func_id))
305− return false;
306−
307− switch (kvm_host_psci_version) {
283+ switch (kvm_host_psci_config.version) {
308284 case PSCI_VERSION(0, 1):
285+ if (!is_psci_0_1_call(func_id))
286+ return false;
309287 ret = psci_0_1_handler(func_id, host_ctxt);
310288 break;
311289 case PSCI_VERSION(0, 2):
290+ if (!is_psci_0_2_call(func_id))
291+ return false;
312292 ret = psci_0_2_handler(func_id, host_ctxt);
313293 break;
314294 default:
295+ if (!is_psci_0_2_call(func_id))
296+ return false;
315297 ret = psci_1_0_handler(func_id, host_ctxt);
316298 break;
317299 }
arch/arm64/kvm/pmu-emul.c+7−5
@@ -788,7 +788,7 @@ u64 kvm_pmu_get_pmceid(struct kvm_vcpu *vcpu, bool pmceid1) · 787 unmodified lines
788788 {
789789 unsigned long *bmap = vcpu->kvm->arch.pmu_filter;
790790 u64 val, mask = 0;
791− int base, i;
791+ int base, i, nr_events;
792792
793793 if (!pmceid1) {
794794 val = read_sysreg(pmceid0_el0);
@@ -801,13 +801,17 @@ u64 kvm_pmu_get_pmceid(struct kvm_vcpu *vcpu, bool pmceid1) · 6 unmodified lines
801801 if (!bmap)
802802 return val;
803803
804+ nr_events = kvm_pmu_event_mask(vcpu->kvm) + 1;
805+
804806 for (i = 0; i < 32; i += 8) {
805807 u64 byte;
806808
807809 byte = bitmap_get_value8(bmap, base + i);
808810 mask |= byte << i;
809− byte = bitmap_get_value8(bmap, 0x4000 + base + i);
810− mask |= byte << (32 + i);
811+ if (nr_events >= (0x4000 + base + 32)) {
812+ byte = bitmap_get_value8(bmap, 0x4000 + base + i);
813+ mask |= byte << (32 + i);
814+ }
811815 }
812816
813817 return val & mask;
@@ -850,8 +854,6 @@ int kvm_arm_pmu_v3_enable(struct kvm_vcpu *vcpu) · 36 unmodified lines
850854 return -EINVAL;
851855 }
852856
853− kvm_pmu_vcpu_reset(vcpu);
854−
855857 return 0;
856858 }
857859
arch/arm64/kvm/sys_regs.c+60−37
@@ -43,6 +43,10 @@ · 42 unmodified lines
4343 * 64bit interface.
4444 */
4545
46+#define reg_to_encoding(x) \
47+ sys_reg((u32)(x)->Op0, (u32)(x)->Op1, \
48+ (u32)(x)->CRn, (u32)(x)->CRm, (u32)(x)->Op2)
49+
4650 static bool read_from_write_only(struct kvm_vcpu *vcpu,
4751 struct sys_reg_params *params,
4852 const struct sys_reg_desc *r)
@@ -273,8 +277,7 @@ static bool trap_loregion(struct kvm_vcpu *vcpu, · 224 unmodified lines
273277 const struct sys_reg_desc *r)
274278 {
275279 u64 val = read_sanitised_ftr_reg(SYS_ID_AA64MMFR1_EL1);
276− u32 sr = sys_reg((u32)r->Op0, (u32)r->Op1,
277− (u32)r->CRn, (u32)r->CRm, (u32)r->Op2);
280+ u32 sr = reg_to_encoding(r);
278281
279282 if (!(val & (0xfUL << ID_AA64MMFR1_LOR_SHIFT))) {
280283 kvm_inject_undefined(vcpu);
@@ -590,10 +593,23 @@ static void reset_mpidr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) · 309 unmodified lines
590593 vcpu_write_sys_reg(vcpu, (1ULL << 31) | mpidr, MPIDR_EL1);
591594 }
592595
596+static unsigned int pmu_visibility(const struct kvm_vcpu *vcpu,
597+ const struct sys_reg_desc *r)
598+{
599+ if (kvm_vcpu_has_pmu(vcpu))
600+ return 0;
601+
602+ return REG_HIDDEN;
603+}
604+
593605 static void reset_pmcr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r)
594606 {
595607 u64 pmcr, val;
596608
609+ /* No PMU available, PMCR_EL0 may UNDEF... */
610+ if (!kvm_arm_support_pmu_v3())
611+ return;
612+
597613 pmcr = read_sysreg(pmcr_el0);
598614 /*
599615 * Writable bits of PMCR_EL0 (ARMV8_PMU_PMCR_MASK) are reset to UNKNOWN
@@ -609,9 +625,8 @@ static void reset_pmcr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) · 9 unmodified lines
609625 static bool check_pmu_access_disabled(struct kvm_vcpu *vcpu, u64 flags)
610626 {
611627 u64 reg = __vcpu_sys_reg(vcpu, PMUSERENR_EL0);
612− bool enabled = kvm_vcpu_has_pmu(vcpu);
628+ bool enabled = (reg & flags) || vcpu_mode_priv(vcpu);
613629
614− enabled &= (reg & flags) || vcpu_mode_priv(vcpu);
615630 if (!enabled)
616631 kvm_inject_undefined(vcpu);
617632
@@ -896,11 +911,6 @@ static bool access_pmswinc(struct kvm_vcpu *vcpu, struct sys_reg_params *p, · 278 unmodified lines
896911 static bool access_pmuserenr(struct kvm_vcpu *vcpu, struct sys_reg_params *p,
897912 const struct sys_reg_desc *r)
898913 {
899− if (!kvm_vcpu_has_pmu(vcpu)) {
900− kvm_inject_undefined(vcpu);
901− return false;
902− }
903−
904914 if (p->is_write) {
905915 if (!vcpu_mode_priv(vcpu)) {
906916 kvm_inject_undefined(vcpu);
@@ -917,10 +927,6 @@ static bool access_pmuserenr(struct kvm_vcpu *vcpu, struct sys_reg_params *p, · 10 unmodified lines
917927 return true;
918928 }
919929
920−#define reg_to_encoding(x) \
921− sys_reg((u32)(x)->Op0, (u32)(x)->Op1, \
922− (u32)(x)->CRn, (u32)(x)->CRm, (u32)(x)->Op2);
923−
924930 /* Silly macro to expand the DBG{BCR,BVR,WVR,WCR}n_EL1 registers in one go */
925931 #define DBG_BCR_BVR_WCR_WVR_EL1(n) \
926932 { SYS_DESC(SYS_DBGBVRn_EL1(n)), \
@@ -932,15 +938,18 @@ static bool access_pmuserenr(struct kvm_vcpu *vcpu, struct sys_reg_params *p, · 5 unmodified lines
932938 { SYS_DESC(SYS_DBGWCRn_EL1(n)), \
933939 trap_wcr, reset_wcr, 0, 0, get_wcr, set_wcr }
934940
941+#define PMU_SYS_REG(r) \
942+ SYS_DESC(r), .reset = reset_unknown, .visibility = pmu_visibility
943+
935944 /* Macro to expand the PMEVCNTRn_EL0 register */
936945 #define PMU_PMEVCNTR_EL0(n) \
937− { SYS_DESC(SYS_PMEVCNTRn_EL0(n)), \
938− access_pmu_evcntr, reset_unknown, (PMEVCNTR0_EL0 + n), }
946+ { PMU_SYS_REG(SYS_PMEVCNTRn_EL0(n)), \
947+ .access = access_pmu_evcntr, .reg = (PMEVCNTR0_EL0 + n), }
939948
940949 /* Macro to expand the PMEVTYPERn_EL0 register */
941950 #define PMU_PMEVTYPER_EL0(n) \
942− { SYS_DESC(SYS_PMEVTYPERn_EL0(n)), \
943− access_pmu_evtyper, reset_unknown, (PMEVTYPER0_EL0 + n), }
951+ { PMU_SYS_REG(SYS_PMEVTYPERn_EL0(n)), \
952+ .access = access_pmu_evtyper, .reg = (PMEVTYPER0_EL0 + n), }
944953
945954 static bool undef_access(struct kvm_vcpu *vcpu, struct sys_reg_params *p,
946955 const struct sys_reg_desc *r)
@@ -1016,8 +1025,7 @@ static bool access_arch_timer(struct kvm_vcpu *vcpu, · 69 unmodified lines
10161025 static u64 read_id_reg(const struct kvm_vcpu *vcpu,
10171026 struct sys_reg_desc const *r, bool raz)
10181027 {
1019− u32 id = sys_reg((u32)r->Op0, (u32)r->Op1,
1020− (u32)r->CRn, (u32)r->CRm, (u32)r->Op2);
1028+ u32 id = reg_to_encoding(r);
10211029 u64 val = raz ? 0 : read_sanitised_ftr_reg(id);
10221030
10231031 if (id == SYS_ID_AA64PFR0_EL1) {
@@ -1058,8 +1066,7 @@ static u64 read_id_reg(const struct kvm_vcpu *vcpu, · 34 unmodified lines
10581066 static unsigned int id_visibility(const struct kvm_vcpu *vcpu,
10591067 const struct sys_reg_desc *r)
10601068 {
1061− u32 id = sys_reg((u32)r->Op0, (u32)r->Op1,
1062− (u32)r->CRn, (u32)r->CRm, (u32)r->Op2);
1069+ u32 id = reg_to_encoding(r);
10631070
10641071 switch (id) {
10651072 case SYS_ID_AA64ZFR0_EL1:
@@ -1482,8 +1489,10 @@ static const struct sys_reg_desc sys_reg_descs[] = { · 416 unmodified lines
14821489 { SYS_DESC(SYS_FAR_EL1), access_vm_reg, reset_unknown, FAR_EL1 },
14831490 { SYS_DESC(SYS_PAR_EL1), NULL, reset_unknown, PAR_EL1 },
14841491
1485− { SYS_DESC(SYS_PMINTENSET_EL1), access_pminten, reset_unknown, PMINTENSET_EL1 },
1486− { SYS_DESC(SYS_PMINTENCLR_EL1), access_pminten, reset_unknown, PMINTENSET_EL1 },
1492+ { PMU_SYS_REG(SYS_PMINTENSET_EL1),
1493+ .access = access_pminten, .reg = PMINTENSET_EL1 },
1494+ { PMU_SYS_REG(SYS_PMINTENCLR_EL1),
1495+ .access = access_pminten, .reg = PMINTENSET_EL1 },
14871496
14881497 { SYS_DESC(SYS_MAIR_EL1), access_vm_reg, reset_unknown, MAIR_EL1 },
14891498 { SYS_DESC(SYS_AMAIR_EL1), access_vm_reg, reset_amair_el1, AMAIR_EL1 },
@@ -1522,23 +1531,36 @@ static const struct sys_reg_desc sys_reg_descs[] = { · 32 unmodified lines
15221531 { SYS_DESC(SYS_CSSELR_EL1), access_csselr, reset_unknown, CSSELR_EL1 },
15231532 { SYS_DESC(SYS_CTR_EL0), access_ctr },
15241533
1525− { SYS_DESC(SYS_PMCR_EL0), access_pmcr, reset_pmcr, PMCR_EL0 },
1526− { SYS_DESC(SYS_PMCNTENSET_EL0), access_pmcnten, reset_unknown, PMCNTENSET_EL0 },
1527− { SYS_DESC(SYS_PMCNTENCLR_EL0), access_pmcnten, reset_unknown, PMCNTENSET_EL0 },
1528− { SYS_DESC(SYS_PMOVSCLR_EL0), access_pmovs, reset_unknown, PMOVSSET_EL0 },
1529− { SYS_DESC(SYS_PMSWINC_EL0), access_pmswinc, reset_unknown, PMSWINC_EL0 },
1530− { SYS_DESC(SYS_PMSELR_EL0), access_pmselr, reset_unknown, PMSELR_EL0 },
1531− { SYS_DESC(SYS_PMCEID0_EL0), access_pmceid },
1532− { SYS_DESC(SYS_PMCEID1_EL0), access_pmceid },
1533− { SYS_DESC(SYS_PMCCNTR_EL0), access_pmu_evcntr, reset_unknown, PMCCNTR_EL0 },
1534− { SYS_DESC(SYS_PMXEVTYPER_EL0), access_pmu_evtyper },
1535− { SYS_DESC(SYS_PMXEVCNTR_EL0), access_pmu_evcntr },
1534+ { PMU_SYS_REG(SYS_PMCR_EL0), .access = access_pmcr,
1535+ .reset = reset_pmcr, .reg = PMCR_EL0 },
1536+ { PMU_SYS_REG(SYS_PMCNTENSET_EL0),
1537+ .access = access_pmcnten, .reg = PMCNTENSET_EL0 },
1538+ { PMU_SYS_REG(SYS_PMCNTENCLR_EL0),
1539+ .access = access_pmcnten, .reg = PMCNTENSET_EL0 },
1540+ { PMU_SYS_REG(SYS_PMOVSCLR_EL0),
1541+ .access = access_pmovs, .reg = PMOVSSET_EL0 },
1542+ { PMU_SYS_REG(SYS_PMSWINC_EL0),
1543+ .access = access_pmswinc, .reg = PMSWINC_EL0 },
1544+ { PMU_SYS_REG(SYS_PMSELR_EL0),
1545+ .access = access_pmselr, .reg = PMSELR_EL0 },
1546+ { PMU_SYS_REG(SYS_PMCEID0_EL0),
1547+ .access = access_pmceid, .reset = NULL },
1548+ { PMU_SYS_REG(SYS_PMCEID1_EL0),
1549+ .access = access_pmceid, .reset = NULL },
1550+ { PMU_SYS_REG(SYS_PMCCNTR_EL0),
1551+ .access = access_pmu_evcntr, .reg = PMCCNTR_EL0 },
1552+ { PMU_SYS_REG(SYS_PMXEVTYPER_EL0),
1553+ .access = access_pmu_evtyper, .reset = NULL },
1554+ { PMU_SYS_REG(SYS_PMXEVCNTR_EL0),
1555+ .access = access_pmu_evcntr, .reset = NULL },
15361556 /*
15371557 * PMUSERENR_EL0 resets as unknown in 64bit mode while it resets as zero
15381558 * in 32bit mode. Here we choose to reset it as zero for consistency.
15391559 */
1540− { SYS_DESC(SYS_PMUSERENR_EL0), access_pmuserenr, reset_val, PMUSERENR_EL0, 0 },
1541− { SYS_DESC(SYS_PMOVSSET_EL0), access_pmovs, reset_unknown, PMOVSSET_EL0 },
1560+ { PMU_SYS_REG(SYS_PMUSERENR_EL0), .access = access_pmuserenr,
1561+ .reset = reset_val, .reg = PMUSERENR_EL0, .val = 0 },
1562+ { PMU_SYS_REG(SYS_PMOVSSET_EL0),
1563+ .access = access_pmovs, .reg = PMOVSSET_EL0 },
15421564
15431565 { SYS_DESC(SYS_TPIDR_EL0), NULL, reset_unknown, TPIDR_EL0 },
15441566 { SYS_DESC(SYS_TPIDRRO_EL0), NULL, reset_unknown, TPIDRRO_EL0 },
@@ -1690,7 +1712,8 @@ static const struct sys_reg_desc sys_reg_descs[] = { · 145 unmodified lines
16901712 * PMCCFILTR_EL0 resets as unknown in 64bit mode while it resets as zero
16911713 * in 32bit mode. Here we choose to reset it as zero for consistency.
16921714 */
1693− { SYS_DESC(SYS_PMCCFILTR_EL0), access_pmu_evtyper, reset_val, PMCCFILTR_EL0, 0 },
1715+ { PMU_SYS_REG(SYS_PMCCFILTR_EL0), .access = access_pmu_evtyper,
1716+ .reset = reset_val, .reg = PMCCFILTR_EL0, .val = 0 },
16941717
16951718 { SYS_DESC(SYS_DACR32_EL2), NULL, reset_unknown, DACR32_EL2 },
16961719 { SYS_DESC(SYS_IFSR32_EL2), NULL, reset_unknown, IFSR32_EL2 },
arch/arm64/kvm/va_layout.c+3−4
@@ -34,17 +34,16 @@ static u64 __early_kern_hyp_va(u64 addr) · 33 unmodified lines
3434 }
3535
3636 /*
37− * Store a hyp VA <-> PA offset into a hyp-owned variable.
37+ * Store a hyp VA <-> PA offset into a EL2-owned variable.
3838 */
3939 static void init_hyp_physvirt_offset(void)
4040 {
41− extern s64 kvm_nvhe_sym(hyp_physvirt_offset);
4241 u64 kern_va, hyp_va;
4342
4443 /* Compute the offset from the hyp VA and PA of a random symbol. */
45− kern_va = (u64)kvm_ksym_ref(__hyp_text_start);
44+ kern_va = (u64)lm_alias(__hyp_text_start);
4645 hyp_va = __early_kern_hyp_va(kern_va);
47− CHOOSE_NVHE_SYM(hyp_physvirt_offset) = (s64)__pa(kern_va) - (s64)hyp_va;
46+ hyp_physvirt_offset = (s64)__pa(kern_va) - (s64)hyp_va;
4847 }
4948
5049 /*
arch/arm64/kvm/vgic/vgic-init.c+10−1
@@ -419,7 +419,8 @@ int vgic_lazy_init(struct kvm *kvm) · 418 unmodified lines
419419 * Map the MMIO regions depending on the VGIC model exposed to the guest
420420 * called on the first VCPU run.
421421 * Also map the virtual CPU interface into the VM.
422− * v2/v3 derivatives call vgic_init if not already done.
422+ * v2 calls vgic_init() if not already done.
423+ * v3 and derivatives return an error if the VGIC is not initialized.
423424 * vgic_ready() returns true if this function has succeeded.
424425 * @kvm: kvm struct pointer
425426 */
@@ -428,7 +429,13 @@ int kvm_vgic_map_resources(struct kvm *kvm) · 2 unmodified lines
428429 struct vgic_dist *dist = &kvm->arch.vgic;
429430 int ret = 0;
430431
432+ if (likely(vgic_ready(kvm)))
433+ return 0;
434+
431435 mutex_lock(&kvm->lock);
436+ if (vgic_ready(kvm))
437+ goto out;
438+
432439 if (!irqchip_in_kernel(kvm))
433440 goto out;
434441
@@ -439,6 +446,8 @@ int kvm_vgic_map_resources(struct kvm *kvm) · 4 unmodified lines
439446
440447 if (ret)
441448 __kvm_vgic_destroy(kvm);
449+ else
450+ dist->ready = true;
442451
443452 out:
444453 mutex_unlock(&kvm->lock);
arch/arm64/kvm/vgic/vgic-v2.c+6−14
@@ -306,20 +306,15 @@ int vgic_v2_map_resources(struct kvm *kvm) · 305 unmodified lines
306306 struct vgic_dist *dist = &kvm->arch.vgic;
307307 int ret = 0;
308308
309− if (vgic_ready(kvm))
310− goto out;
311−
312309 if (IS_VGIC_ADDR_UNDEF(dist->vgic_dist_base) ||
313310 IS_VGIC_ADDR_UNDEF(dist->vgic_cpu_base)) {
314311 kvm_err("Need to set vgic cpu and dist addresses first\n");
315− ret = -ENXIO;
316− goto out;
312+ return -ENXIO;
317313 }
318314
319315 if (!vgic_v2_check_base(dist->vgic_dist_base, dist->vgic_cpu_base)) {
320316 kvm_err("VGIC CPU and dist frames overlap\n");
321− ret = -EINVAL;
322− goto out;
317+ return -EINVAL;
323318 }
324319
325320 /*
@@ -329,13 +324,13 @@ int vgic_v2_map_resources(struct kvm *kvm) · 3 unmodified lines
329324 ret = vgic_init(kvm);
330325 if (ret) {
331326 kvm_err("Unable to initialize VGIC dynamic data structures\n");
332− goto out;
327+ return ret;
333328 }
334329
335330 ret = vgic_register_dist_iodev(kvm, dist->vgic_dist_base, VGIC_V2);
336331 if (ret) {
337332 kvm_err("Unable to register VGIC MMIO regions\n");
338− goto out;
333+ return ret;
339334 }
340335
341336 if (!static_branch_unlikely(&vgic_v2_cpuif_trap)) {
@@ -344,14 +339,11 @@ int vgic_v2_map_resources(struct kvm *kvm) · 2 unmodified lines
344339 KVM_VGIC_V2_CPU_SIZE, true);
345340 if (ret) {
346341 kvm_err("Unable to remap VGIC CPU to VCPU\n");
347− goto out;
342+ return ret;
348343 }
349344 }
350345
351− dist->ready = true;
352−
353−out:
354− return ret;
346+ return 0;
355347 }
356348
357349 DEFINE_STATIC_KEY_FALSE(vgic_v2_cpuif_trap);
arch/arm64/kvm/vgic/vgic-v3.c+6−15
@@ -500,29 +500,23 @@ int vgic_v3_map_resources(struct kvm *kvm) · 499 unmodified lines
500500 int ret = 0;
501501 int c;
502502
503− if (vgic_ready(kvm))
504− goto out;
505−
506503 kvm_for_each_vcpu(c, vcpu, kvm) {
507504 struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
508505
509506 if (IS_VGIC_ADDR_UNDEF(vgic_cpu->rd_iodev.base_addr)) {
510507 kvm_debug("vcpu %d redistributor base not set\n", c);
511− ret = -ENXIO;
512− goto out;
508+ return -ENXIO;
513509 }
514510 }
515511
516512 if (IS_VGIC_ADDR_UNDEF(dist->vgic_dist_base)) {
517513 kvm_err("Need to set vgic distributor addresses first\n");
518− ret = -ENXIO;
519− goto out;
514+ return -ENXIO;
520515 }
521516
522517 if (!vgic_v3_check_base(kvm)) {
523518 kvm_err("VGIC redist and dist frames overlap\n");
524− ret = -EINVAL;
525− goto out;
519+ return -EINVAL;
526520 }
527521
528522 /*
@@ -530,22 +524,19 @@ int vgic_v3_map_resources(struct kvm *kvm) · 1 unmodified line
530524 * the VGIC before we need to use it.
531525 */
532526 if (!vgic_initialized(kvm)) {
533− ret = -EBUSY;
534− goto out;
527+ return -EBUSY;
535528 }
536529
537530 ret = vgic_register_dist_iodev(kvm, dist->vgic_dist_base, VGIC_V3);
538531 if (ret) {
539532 kvm_err("Unable to register VGICv3 dist MMIO regions\n");
540− goto out;
533+ return ret;
541534 }
542535
543536 if (kvm_vgic_global_state.has_gicv4_1)
544537 vgic_v4_configure_vsgis(kvm);
545− dist->ready = true;
546538
547−out:
548− return ret;
539+ return 0;
549540 }
550541
551542 DEFINE_STATIC_KEY_FALSE(vgic_v3_cpuif_trap);
arch/arm64/mm/fault.c+4−3
@@ -709,10 +709,11 @@ static int do_tag_check_fault(unsigned long far, unsigned int esr, · 708 unmodified lines
709709 struct pt_regs *regs)
710710 {
711711 /*
712− * The architecture specifies that bits 63:60 of FAR_EL1 are UNKNOWN for tag
713− * check faults. Mask them out now so that userspace doesn't see them.
712+ * The architecture specifies that bits 63:60 of FAR_EL1 are UNKNOWN
713+ * for tag check faults. Set them to corresponding bits in the untagged
714+ * address.
714715 */
715− far &= (1UL << 60) - 1;
716+ far = (__untagged_addr(far) & ~MTE_TAG_MASK) | (far & MTE_TAG_MASK);
716717 do_bad_area(far, esr, regs);
717718 return 0;
718719 }
arch/arm64/mm/init.c+18−15
@@ -53,13 +53,13 @@ s64 memstart_addr __ro_after_init = -1; · 52 unmodified lines
5353 EXPORT_SYMBOL(memstart_addr);
5454
5555 /*
56− * We create both ZONE_DMA and ZONE_DMA32. ZONE_DMA covers the first 1G of
57− * memory as some devices, namely the Raspberry Pi 4, have peripherals with
58− * this limited view of the memory. ZONE_DMA32 will cover the rest of the 32
59− * bit addressable memory area.
56+ * If the corresponding config options are enabled, we create both ZONE_DMA
57+ * and ZONE_DMA32. By default ZONE_DMA covers the 32-bit addressable memory
58+ * unless restricted on specific platforms (e.g. 30-bit on Raspberry Pi 4).
59+ * In such case, ZONE_DMA32 covers the rest of the 32-bit addressable memory,
60+ * otherwise it is empty.
6061 */
6162 phys_addr_t arm64_dma_phys_limit __ro_after_init;
62−static phys_addr_t arm64_dma32_phys_limit __ro_after_init;
6363
6464 #ifdef CONFIG_KEXEC_CORE
6565 /*
@@ -84,7 +84,7 @@ static void __init reserve_crashkernel(void) · 18 unmodified lines
8484
8585 if (crash_base == 0) {
8686 /* Current arm64 boot protocol requires 2MB alignment */
87− crash_base = memblock_find_in_range(0, arm64_dma32_phys_limit,
87+ crash_base = memblock_find_in_range(0, arm64_dma_phys_limit,
8888 crash_size, SZ_2M);
8989 if (crash_base == 0) {
9090 pr_warn("cannot allocate crashkernel (size:0x%llx)\n",
@@ -196,6 +196,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) · 105 unmodified lines
196196 unsigned long max_zone_pfns[MAX_NR_ZONES] = {0};
197197 unsigned int __maybe_unused acpi_zone_dma_bits;
198198 unsigned int __maybe_unused dt_zone_dma_bits;
199+ phys_addr_t __maybe_unused dma32_phys_limit = max_zone_phys(32);
199200
200201 #ifdef CONFIG_ZONE_DMA
201202 acpi_zone_dma_bits = fls64(acpi_iort_dma_get_max_cpu_address());
@@ -205,8 +206,12 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) · 3 unmodified lines
205206 max_zone_pfns[ZONE_DMA] = PFN_DOWN(arm64_dma_phys_limit);
206207 #endif
207208 #ifdef CONFIG_ZONE_DMA32
208− max_zone_pfns[ZONE_DMA32] = PFN_DOWN(arm64_dma32_phys_limit);
209+ max_zone_pfns[ZONE_DMA32] = PFN_DOWN(dma32_phys_limit);
210+ if (!arm64_dma_phys_limit)
211+ arm64_dma_phys_limit = dma32_phys_limit;
209212 #endif
213+ if (!arm64_dma_phys_limit)
214+ arm64_dma_phys_limit = PHYS_MASK + 1;
210215 max_zone_pfns[ZONE_NORMAL] = max;
211216
212217 free_area_init(max_zone_pfns);
@@ -394,16 +399,9 @@ void __init arm64_memblock_init(void) · 181 unmodified lines
394399
395400 early_init_fdt_scan_reserved_mem();
396401
397− if (IS_ENABLED(CONFIG_ZONE_DMA32))
398− arm64_dma32_phys_limit = max_zone_phys(32);
399− else
400− arm64_dma32_phys_limit = PHYS_MASK + 1;
401−
402402 reserve_elfcorehdr();
403403
404404 high_memory = __va(memblock_end_of_DRAM() - 1) + 1;
405−
406− dma_contiguous_reserve(arm64_dma32_phys_limit);
407405 }
408406
409407 void __init bootmem_init(void)
@@ -438,6 +436,11 @@ void __init bootmem_init(void) · 28 unmodified lines
438436 sparse_init();
439437 zone_sizes_init(min, max);
440438
439+ /*
440+ * Reserve the CMA area after arm64_dma_phys_limit was initialised.
441+ */
442+ dma_contiguous_reserve(arm64_dma_phys_limit);
443+
441444 /*
442445 * request_standard_resources() depends on crashkernel's memory being
443446 * reserved, so do it here.
@@ -455,7 +458,7 @@ void __init bootmem_init(void) · 11 unmodified lines
455458 void __init mem_init(void)
456459 {
457460 if (swiotlb_force == SWIOTLB_FORCE ||
458− max_pfn > PFN_DOWN(arm64_dma_phys_limit ? : arm64_dma32_phys_limit))
461+ max_pfn > PFN_DOWN(arm64_dma_phys_limit))
459462 swiotlb_init(1);
460463 else
461464 swiotlb_force = SWIOTLB_NO_FORCE;
arch/arm64/mm/physaddr.c+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
99
1010 phys_addr_t __virt_to_phys(unsigned long x)
1111 {
12− WARN(!__is_lm_address(x),
12+ WARN(!__is_lm_address(__tag_reset(x)),
1313 "virt_to_phys used for non-linear address: %pK (%pS)\n",
1414 (void *)x,
1515 (void *)x);
arch/arm64/mm/proc.S+1−1
@@ -46,7 +46,7 @@ · 45 unmodified lines
4646 #endif
4747
4848 #ifdef CONFIG_KASAN_HW_TAGS
49−#define TCR_KASAN_HW_FLAGS SYS_TCR_EL1_TCMA1 | TCR_TBI1
49+#define TCR_KASAN_HW_FLAGS SYS_TCR_EL1_TCMA1 | TCR_TBI1 | TCR_TBID1
5050 #else
5151 #define TCR_KASAN_HW_FLAGS 0
5252 #endif
arch/h8300/kernel/asm-offsets.c+3−0
@@ -63,6 +63,9 @@ int main(void) · 62 unmodified lines
6363 OFFSET(TI_FLAGS, thread_info, flags);
6464 OFFSET(TI_CPU, thread_info, cpu);
6565 OFFSET(TI_PRE, thread_info, preempt_count);
66+#ifdef CONFIG_PREEMPTION
67+ DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count));
68+#endif
6669
6770 return 0;
6871 }
arch/ia64/Makefile+1−1
@@ -69,7 +69,7 @@ vmlinux.bin: vmlinux FORCE · 68 unmodified lines
6969 $(call if_changed,objcopy)
7070
7171 unwcheck: vmlinux
72− -$(Q)READELF=$(READELF) $(PYTHON) $(srctree)/arch/ia64/scripts/unwcheck.py $<
72+ -$(Q)READELF=$(READELF) $(PYTHON3) $(srctree)/arch/ia64/scripts/unwcheck.py $<
7373
7474 archclean:
7575
arch/ia64/include/asm/sparsemem.h+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 #define _ASM_IA64_SPARSEMEM_H
44
55 #ifdef CONFIG_SPARSEMEM
6+#include <asm/page.h>
67 /*
78 * SECTION_SIZE_BITS 2^N: how big each section will be
89 * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space
arch/ia64/include/uapi/asm/cmpxchg.h+1−1
@@ -54,7 +54,7 @@ extern void ia64_xchg_called_with_bad_pointer(void); · 53 unmodified lines
5454 })
5555
5656 #define xchg(ptr, x) \
57−((__typeof__(*(ptr))) __xchg((unsigned long) (x), (ptr), sizeof(*(ptr))))
57+({(__typeof__(*(ptr))) __xchg((unsigned long) (x), (ptr), sizeof(*(ptr)));})
5858
5959 /*
6060 * Atomic compare and exchange. Compare OLD with MEM, if identical,
arch/ia64/kernel/time.c+18−13
@@ -171,29 +171,34 @@ void vtime_account_hardirq(struct task_struct *tsk) · 170 unmodified lines
171171 static irqreturn_t
172172 timer_interrupt (int irq, void *dev_id)
173173 {
174− unsigned long cur_itm, new_itm, ticks;
174+ unsigned long new_itm;
175175
176176 if (cpu_is_offline(smp_processor_id())) {
177177 return IRQ_HANDLED;
178178 }
179179
180180 new_itm = local_cpu_data->itm_next;
181− cur_itm = ia64_get_itc();
182181
183− if (!time_after(cur_itm, new_itm)) {
182+ if (!time_after(ia64_get_itc(), new_itm))
184183 printk(KERN_ERR "Oops: timer tick before it's due (itc=%lx,itm=%lx)\n",
185− cur_itm, new_itm);
186− ticks = 1;
187− } else {
188− ticks = DIV_ROUND_UP(cur_itm - new_itm,
189− local_cpu_data->itm_delta);
190− new_itm += ticks * local_cpu_data->itm_delta;
191− }
184+ ia64_get_itc(), new_itm);
185+
186+ while (1) {
187+ new_itm += local_cpu_data->itm_delta;
188+
189+ legacy_timer_tick(smp_processor_id() == time_keeper_id);
192190
193− if (smp_processor_id() != time_keeper_id)
194− ticks = 0;
191+ local_cpu_data->itm_next = new_itm;
195192
196− legacy_timer_tick(ticks);
193+ if (time_after(new_itm, ia64_get_itc()))
194+ break;
195+
196+ /*
197+ * Allow IPIs to interrupt the timer loop.
198+ */
199+ local_irq_enable();
200+ local_irq_disable();
201+ }
197202
198203 do {
199204 /*
arch/ia64/scripts/unwcheck.py+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/env python
1+#!/usr/bin/env python3
22 # SPDX-License-Identifier: GPL-2.0
33 #
44 # Usage: unwcheck.py FILE
arch/m68k/include/asm/page.h+1−1
@@ -62,7 +62,7 @@ extern unsigned long _ramend; · 61 unmodified lines
6262 #include <asm/page_no.h>
6363 #endif
6464
65−#ifdef CONFIG_DISCONTIGMEM
65+#if !defined(CONFIG_MMU) || defined(CONFIG_DISCONTIGMEM)
6666 #define __phys_to_pfn(paddr) ((unsigned long)((paddr) >> PAGE_SHIFT))
6767 #define __pfn_to_phys(pfn) PFN_PHYS(pfn)
6868 #endif
arch/mips/boot/compressed/decompress.c+2−1
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include <linux/libfdt.h>
1414
1515 #include <asm/addrspace.h>
16+#include <asm/unaligned.h>
1617
1718 /*
1819 * These two variables specify the free mem region
@@ -117,7 +118,7 @@ void decompress_kernel(unsigned long boot_heap_start) · 98 unmodified lines
117118 dtb_size = fdt_totalsize((void *)&__appended_dtb);
118119
119120 /* last four bytes is always image size in little endian */
120− image_size = le32_to_cpup((void *)&__image_end - 4);
121+ image_size = get_unaligned_le32((void *)&__image_end - 4);
121122
122123 /* copy dtb to where the booted kernel will expect it */
123124 memcpy((void *)VMLINUX_LOAD_ADDRESS_ULL + image_size,
arch/mips/cavium-octeon/octeon-irq.c+1−1
@@ -1444,7 +1444,7 @@ static void octeon_irq_setup_secondary_ciu2(void) · 1443 unmodified lines
14441444 static int __init octeon_irq_init_ciu(
14451445 struct device_node *ciu_node, struct device_node *parent)
14461446 {
1447− unsigned int i, r;
1447+ int i, r;
14481448 struct irq_chip *chip;
14491449 struct irq_chip *chip_edge;
14501450 struct irq_chip *chip_mbox;
arch/mips/include/asm/highmem.h+1−0
@@ -51,6 +51,7 @@ extern void kmap_flush_tlb(unsigned long addr); · 50 unmodified lines
5151
5252 #define flush_cache_kmaps() BUG_ON(cpu_has_dc_aliases)
5353
54+#define arch_kmap_local_set_pte(mm, vaddr, ptep, ptev) set_pte(ptep, ptev)
5455 #define arch_kmap_local_post_map(vaddr, pteval) local_flush_tlb_one(vaddr)
5556 #define arch_kmap_local_post_unmap(vaddr) local_flush_tlb_one(vaddr)
5657
arch/mips/kernel/binfmt_elfn32.c+7−0
@@ -103,4 +103,11 @@ jiffies_to_old_timeval32(unsigned long jiffies, struct old_timeval32 *value) · 102 unmodified lines
103103 #undef ns_to_kernel_old_timeval
104104 #define ns_to_kernel_old_timeval ns_to_old_timeval32
105105
106+/*
107+ * Some data types as stored in coredump.
108+ */
109+#define user_long_t compat_long_t
110+#define user_siginfo_t compat_siginfo_t
111+#define copy_siginfo_to_external copy_siginfo_to_external32
112+
106113 #include "../../../fs/binfmt_elf.c"
arch/mips/kernel/binfmt_elfo32.c+7−0
@@ -106,4 +106,11 @@ jiffies_to_old_timeval32(unsigned long jiffies, struct old_timeval32 *value) · 105 unmodified lines
106106 #undef ns_to_kernel_old_timeval
107107 #define ns_to_kernel_old_timeval ns_to_old_timeval32
108108
109+/*
110+ * Some data types as stored in coredump.
111+ */
112+#define user_long_t compat_long_t
113+#define user_siginfo_t compat_siginfo_t
114+#define copy_siginfo_to_external copy_siginfo_to_external32
115+
109116 #include "../../../fs/binfmt_elf.c"
arch/mips/kernel/relocate.c+8−2
@@ -187,8 +187,14 @@ static int __init relocate_exception_table(long offset) · 186 unmodified lines
187187 static inline __init unsigned long rotate_xor(unsigned long hash,
188188 const void *area, size_t size)
189189 {
190− size_t i;
191− unsigned long *ptr = (unsigned long *)area;
190+ const typeof(hash) *ptr = PTR_ALIGN(area, sizeof(hash));
191+ size_t diff, i;
192+
193+ diff = (void *)ptr - area;
194+ if (unlikely(size < diff + sizeof(hash)))
195+ return hash;
196+
197+ size = ALIGN_DOWN(size - diff, sizeof(hash));
192198
193199 for (i = 0; i < size / sizeof(hash); i++) {
194200 /* Rotate by odd number of bits and XOR. */
arch/openrisc/include/asm/io.h+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 void __iomem *ioremap(phys_addr_t offset, unsigned long size);
3232
3333 #define iounmap iounmap
34−extern void iounmap(void *addr);
34+extern void iounmap(void __iomem *addr);
3535
3636 #include <asm-generic/io.h>
3737
arch/openrisc/mm/ioremap.c+1−1
@@ -77,7 +77,7 @@ void __iomem *__ref ioremap(phys_addr_t addr, unsigned long size) · 76 unmodified lines
7777 }
7878 EXPORT_SYMBOL(ioremap);
7979
80−void iounmap(void *addr)
80+void iounmap(void __iomem *addr)
8181 {
8282 /* If the page is from the fixmap pool then we just clear out
8383 * the fixmap mapping.
arch/parisc/Kconfig+2−3
@@ -202,9 +202,8 @@ config PREFETCH · 201 unmodified lines
202202 depends on PA8X00 || PA7200
203203
204204 config MLONGCALLS
205− bool "Enable the -mlong-calls compiler option for big kernels"
206− default y if !MODULES || UBSAN || FTRACE
207− default n
205+ def_bool y if !MODULES || UBSAN || FTRACE
206+ bool "Enable the -mlong-calls compiler option for big kernels" if MODULES && !UBSAN && !FTRACE
208207 depends on PA8X00
209208 help
210209 If you configure the kernel to include many drivers built-in instead
arch/parisc/include/asm/irq.h+0−3
@@ -47,7 +47,4 @@ extern unsigned long txn_affinity_addr(unsigned int irq, int cpu); · 46 unmodified lines
4747 extern int cpu_claim_irq(unsigned int irq, struct irq_chip *, void *);
4848 extern int cpu_check_affinity(struct irq_data *d, const struct cpumask *dest);
4949
50−/* soft power switch support (power.c) */
51−extern struct tasklet_struct power_tasklet;
52−
5350 #endif /* _ASM_PARISC_IRQ_H */
arch/parisc/kernel/entry.S+10−3
@@ -997,10 +997,17 @@ intr_do_preempt: · 996 unmodified lines
997997 bb,<,n %r20, 31 - PSW_SM_I, intr_restore
998998 nop
999999
1000+ /* ssm PSW_SM_I done later in intr_restore */
1001+#ifdef CONFIG_MLONGCALLS
1002+ ldil L%intr_restore, %r2
1003+ load32 preempt_schedule_irq, %r1
1004+ bv %r0(%r1)
1005+ ldo R%intr_restore(%r2), %r2
1006+#else
1007+ ldil L%intr_restore, %r1
10001008 BL preempt_schedule_irq, %r2
1001− nop
1002−
1003− b,n intr_restore /* ssm PSW_SM_I done by intr_restore */
1009+ ldo R%intr_restore(%r1), %r2
1010+#endif
10041011 #endif /* CONFIG_PREEMPTION */
10051012
10061013 /*
arch/powerpc/include/asm/book3s/64/kup.h+11−5
@@ -199,25 +199,31 @@ DECLARE_STATIC_KEY_FALSE(uaccess_flush_key); · 198 unmodified lines
199199
200200 #ifdef CONFIG_PPC_PKEY
201201
202+extern u64 __ro_after_init default_uamor;
203+extern u64 __ro_after_init default_amr;
204+extern u64 __ro_after_init default_iamr;
205+
202206 #include <asm/mmu.h>
203207 #include <asm/ptrace.h>
204208
205−/*
206− * For kernel thread that doesn't have thread.regs return
207− * default AMR/IAMR values.
209+/* usage of kthread_use_mm() should inherit the
210+ * AMR value of the operating address space. But, the AMR value is
211+ * thread-specific and we inherit the address space and not thread
212+ * access restrictions. Because of this ignore AMR value when accessing
213+ * userspace via kernel thread.
208214 */
209215 static inline u64 current_thread_amr(void)
210216 {
211217 if (current->thread.regs)
212218 return current->thread.regs->amr;
213− return AMR_KUAP_BLOCKED;
219+ return default_amr;
214220 }
215221
216222 static inline u64 current_thread_iamr(void)
217223 {
218224 if (current->thread.regs)
219225 return current->thread.regs->iamr;
220− return AMR_KUEP_BLOCKED;
226+ return default_iamr;
221227 }
222228 #endif /* CONFIG_PPC_PKEY */
223229
arch/powerpc/include/asm/book3s/64/pkeys.h+0−4
@@ -5,10 +5,6 @@ · 4 unmodified lines
55
66 #include <asm/book3s/64/hash-pkey.h>
77
8−extern u64 __ro_after_init default_uamor;
9−extern u64 __ro_after_init default_amr;
10−extern u64 __ro_after_init default_iamr;
11−
128 static inline u64 vmflag_to_pte_pkey_bits(u64 vm_flags)
139 {
1410 if (!mmu_has_feature(MMU_FTR_PKEY))
arch/powerpc/include/asm/exception-64s.h+13−0
@@ -63,6 +63,12 @@ · 62 unmodified lines
6363 nop; \
6464 nop;
6565
66+#define SCV_ENTRY_FLUSH_SLOT \
67+ SCV_ENTRY_FLUSH_FIXUP_SECTION; \
68+ nop; \
69+ nop; \
70+ nop;
71+
6672 /*
6773 * r10 must be free to use, r13 must be paca
6874 */
@@ -70,6 +76,13 @@ · 1 unmodified line
7076 STF_ENTRY_BARRIER_SLOT; \
7177 ENTRY_FLUSH_SLOT
7278
79+/*
80+ * r10, ctr must be free to use, r13 must be paca
81+ */
82+#define SCV_INTERRUPT_TO_KERNEL \
83+ STF_ENTRY_BARRIER_SLOT; \
84+ SCV_ENTRY_FLUSH_SLOT
85+
7386 /*
7487 * Macros for annotating the expected destination of (h)rfid
7588 *
arch/powerpc/include/asm/feature-fixups.h+10−0
@@ -240,6 +240,14 @@ label##3: \ · 239 unmodified lines
240240 FTR_ENTRY_OFFSET 957b-958b; \
241241 .popsection;
242242
243+#define SCV_ENTRY_FLUSH_FIXUP_SECTION \
244+957: \
245+ .pushsection __scv_entry_flush_fixup,"a"; \
246+ .align 2; \
247+958: \
248+ FTR_ENTRY_OFFSET 957b-958b; \
249+ .popsection;
250+
243251 #define RFI_FLUSH_FIXUP_SECTION \
244252 951: \
245253 .pushsection __rfi_flush_fixup,"a"; \
@@ -273,10 +281,12 @@ label##3: \ · 27 unmodified lines
273281
274282 extern long stf_barrier_fallback;
275283 extern long entry_flush_fallback;
284+extern long scv_entry_flush_fallback;
276285 extern long __start___stf_entry_barrier_fixup, __stop___stf_entry_barrier_fixup;
277286 extern long __start___stf_exit_barrier_fixup, __stop___stf_exit_barrier_fixup;
278287 extern long __start___uaccess_flush_fixup, __stop___uaccess_flush_fixup;
279288 extern long __start___entry_flush_fixup, __stop___entry_flush_fixup;
289+extern long __start___scv_entry_flush_fixup, __stop___scv_entry_flush_fixup;
280290 extern long __start___rfi_flush_fixup, __stop___rfi_flush_fixup;
281291 extern long __start___barrier_nospec_fixup, __stop___barrier_nospec_fixup;
282292 extern long __start__btb_flush_fixup, __stop__btb_flush_fixup;
arch/powerpc/include/asm/highmem.h+2−0
@@ -58,6 +58,8 @@ extern pte_t *pkmap_page_table; · 57 unmodified lines
5858
5959 #define flush_cache_kmaps() flush_cache_all()
6060
61+#define arch_kmap_local_set_pte(mm, vaddr, ptep, ptev) \
62+ __set_pte_at(mm, vaddr, ptep, ptev, 1)
6163 #define arch_kmap_local_post_map(vaddr, pteval) \
6264 local_flush_tlb_page(NULL, vaddr)
6365 #define arch_kmap_local_post_unmap(vaddr) \
arch/powerpc/include/asm/vdso/gettimeofday.h+15−1
@@ -103,6 +103,8 @@ int gettimeofday_fallback(struct __kernel_old_timeval *_tv, struct timezone *_tz · 102 unmodified lines
103103 return do_syscall_2(__NR_gettimeofday, (unsigned long)_tv, (unsigned long)_tz);
104104 }
105105
106+#ifdef __powerpc64__
107+
106108 static __always_inline
107109 int clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
108110 {
@@ -115,10 +117,22 @@ int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts) · 6 unmodified lines
115117 return do_syscall_2(__NR_clock_getres, _clkid, (unsigned long)_ts);
116118 }
117119
118−#ifdef CONFIG_VDSO32
120+#else
119121
120122 #define BUILD_VDSO32 1
121123
124+static __always_inline
125+int clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
126+{
127+ return do_syscall_2(__NR_clock_gettime64, _clkid, (unsigned long)_ts);
128+}
129+
130+static __always_inline
131+int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
132+{
133+ return do_syscall_2(__NR_clock_getres_time64, _clkid, (unsigned long)_ts);
134+}
135+
122136 static __always_inline
123137 int clock_gettime32_fallback(clockid_t _clkid, struct old_timespec32 *_ts)
124138 {
arch/powerpc/kernel/Makefile+2−2
@@ -51,7 +51,7 @@ obj-y += ptrace/ · 50 unmodified lines
5151 obj-$(CONFIG_PPC64) += setup_64.o \
5252 paca.o nvram_64.o note.o syscall_64.o
5353 obj-$(CONFIG_COMPAT) += sys_ppc32.o signal_32.o
54−obj-$(CONFIG_VDSO32) += vdso32/
54+obj-$(CONFIG_VDSO32) += vdso32_wrapper.o
5555 obj-$(CONFIG_PPC_WATCHDOG) += watchdog.o
5656 obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
5757 obj-$(CONFIG_PPC_DAWR) += dawr.o
@@ -60,7 +60,7 @@ obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_power.o · 2 unmodified lines
6060 obj-$(CONFIG_PPC_BOOK3S_64) += mce.o mce_power.o
6161 obj-$(CONFIG_PPC_BOOK3E_64) += exceptions-64e.o idle_book3e.o
6262 obj-$(CONFIG_PPC_BARRIER_NOSPEC) += security.o
63−obj-$(CONFIG_PPC64) += vdso64/
63+obj-$(CONFIG_PPC64) += vdso64_wrapper.o
6464 obj-$(CONFIG_ALTIVEC) += vecemu.o
6565 obj-$(CONFIG_PPC_BOOK3S_IDLE) += idle_book3s.o
6666 procfs-y := proc_powerpc.o
arch/powerpc/kernel/entry_64.S+1−1
@@ -75,7 +75,7 @@ BEGIN_FTR_SECTION · 74 unmodified lines
7575 bne .Ltabort_syscall
7676 END_FTR_SECTION_IFSET(CPU_FTR_TM)
7777 #endif
78− INTERRUPT_TO_KERNEL
78+ SCV_INTERRUPT_TO_KERNEL
7979 mr r10,r1
8080 ld r1,PACAKSAVE(r13)
8181 std r10,0(r1)
arch/powerpc/kernel/exceptions-64s.S+19−0
@@ -2993,6 +2993,25 @@ TRAMP_REAL_BEGIN(entry_flush_fallback) · 2992 unmodified lines
29932993 ld r11,PACA_EXRFI+EX_R11(r13)
29942994 blr
29952995
2996+/*
2997+ * The SCV entry flush happens with interrupts enabled, so it must disable
2998+ * to prevent EXRFI being clobbered by NMIs (e.g., soft_nmi_common). r10
2999+ * (containing LR) does not need to be preserved here because scv entry
3000+ * puts 0 in the pt_regs, CTR can be clobbered for the same reason.
3001+ */
3002+TRAMP_REAL_BEGIN(scv_entry_flush_fallback)
3003+ li r10,0
3004+ mtmsrd r10,1
3005+ lbz r10,PACAIRQHAPPENED(r13)
3006+ ori r10,r10,PACA_IRQ_HARD_DIS
3007+ stb r10,PACAIRQHAPPENED(r13)
3008+ std r11,PACA_EXRFI+EX_R11(r13)
3009+ L1D_DISPLACEMENT_FLUSH
3010+ ld r11,PACA_EXRFI+EX_R11(r13)
3011+ li r10,MSR_RI
3012+ mtmsrd r10,1
3013+ blr
3014+
29963015 TRAMP_REAL_BEGIN(rfi_flush_fallback)
29973016 SET_SCRATCH0(r13);
29983017 GET_PACA(r13);
arch/powerpc/kernel/head_book3s_32.S+9−0
@@ -260,10 +260,19 @@ __secondary_hold_acknowledge: · 259 unmodified lines
260260 MachineCheck:
261261 EXCEPTION_PROLOG_0
262262 #ifdef CONFIG_PPC_CHRP
263+#ifdef CONFIG_VMAP_STACK
264+ mtspr SPRN_SPRG_SCRATCH2,r1
265+ mfspr r1, SPRN_SPRG_THREAD
266+ lwz r1, RTAS_SP(r1)
267+ cmpwi cr1, r1, 0
268+ bne cr1, 7f
269+ mfspr r1, SPRN_SPRG_SCRATCH2
270+#else
263271 mfspr r11, SPRN_SPRG_THREAD
264272 lwz r11, RTAS_SP(r11)
265273 cmpwi cr1, r11, 0
266274 bne cr1, 7f
275+#endif
267276 #endif /* CONFIG_PPC_CHRP */
268277 EXCEPTION_PROLOG_1 for_rtas=1
269278 7: EXCEPTION_PROLOG_2
arch/powerpc/kernel/irq.c+16−12
@@ -180,13 +180,18 @@ void notrace restore_interrupts(void) · 179 unmodified lines
180180
181181 void replay_soft_interrupts(void)
182182 {
183+ struct pt_regs regs;
184+
183185 /*
184− * We use local_paca rather than get_paca() to avoid all
185− * the debug_smp_processor_id() business in this low level
186− * function
186+ * Be careful here, calling these interrupt handlers can cause
187+ * softirqs to be raised, which they may run when calling irq_exit,
188+ * which will cause local_irq_enable() to be run, which can then
189+ * recurse into this function. Don't keep any state across
190+ * interrupt handler calls which may change underneath us.
191+ *
192+ * We use local_paca rather than get_paca() to avoid all the
193+ * debug_smp_processor_id() business in this low level function.
187194 */
188− unsigned char happened = local_paca->irq_happened;
189− struct pt_regs regs;
190195
191196 ppc_save_regs(&regs);
192197 regs.softe = IRQS_ENABLED;
@@ -209,7 +214,7 @@ again: · 16 unmodified lines
209214 * This is a higher priority interrupt than the others, so
210215 * replay it first.
211216 */
212− if (IS_ENABLED(CONFIG_PPC_BOOK3S) && (happened & PACA_IRQ_HMI)) {
217+ if (IS_ENABLED(CONFIG_PPC_BOOK3S) && (local_paca->irq_happened & PACA_IRQ_HMI)) {
213218 local_paca->irq_happened &= ~PACA_IRQ_HMI;
214219 regs.trap = 0xe60;
215220 handle_hmi_exception(&regs);
@@ -217,7 +222,7 @@ again: · 1 unmodified line
217222 hard_irq_disable();
218223 }
219224
220− if (happened & PACA_IRQ_DEC) {
225+ if (local_paca->irq_happened & PACA_IRQ_DEC) {
221226 local_paca->irq_happened &= ~PACA_IRQ_DEC;
222227 regs.trap = 0x900;
223228 timer_interrupt(&regs);
@@ -225,7 +230,7 @@ again: · 1 unmodified line
225230 hard_irq_disable();
226231 }
227232
228− if (happened & PACA_IRQ_EE) {
233+ if (local_paca->irq_happened & PACA_IRQ_EE) {
229234 local_paca->irq_happened &= ~PACA_IRQ_EE;
230235 regs.trap = 0x500;
231236 do_IRQ(&regs);
@@ -233,7 +238,7 @@ again: · 1 unmodified line
233238 hard_irq_disable();
234239 }
235240
236− if (IS_ENABLED(CONFIG_PPC_DOORBELL) && (happened & PACA_IRQ_DBELL)) {
241+ if (IS_ENABLED(CONFIG_PPC_DOORBELL) && (local_paca->irq_happened & PACA_IRQ_DBELL)) {
237242 local_paca->irq_happened &= ~PACA_IRQ_DBELL;
238243 if (IS_ENABLED(CONFIG_PPC_BOOK3E))
239244 regs.trap = 0x280;
@@ -245,7 +250,7 @@ again: · 5 unmodified lines
245250 }
246251
247252 /* Book3E does not support soft-masking PMI interrupts */
248− if (IS_ENABLED(CONFIG_PPC_BOOK3S) && (happened & PACA_IRQ_PMI)) {
253+ if (IS_ENABLED(CONFIG_PPC_BOOK3S) && (local_paca->irq_happened & PACA_IRQ_PMI)) {
249254 local_paca->irq_happened &= ~PACA_IRQ_PMI;
250255 regs.trap = 0xf00;
251256 performance_monitor_exception(&regs);
@@ -253,8 +258,7 @@ again: · 1 unmodified line
253258 hard_irq_disable();
254259 }
255260
256− happened = local_paca->irq_happened;
257− if (happened & ~PACA_IRQ_HARD_DIS) {
261+ if (local_paca->irq_happened & ~PACA_IRQ_HARD_DIS) {
258262 /*
259263 * We are responding to the next interrupt, so interrupt-off
260264 * latencies should be reset here.
arch/powerpc/kernel/vdso32/Makefile+1−4
@@ -30,7 +30,7 @@ CC32FLAGS += -m32 · 29 unmodified lines
3030 KBUILD_CFLAGS := $(filter-out -mcmodel=medium -mabi=elfv1 -mabi=elfv2 -mcall-aixdesc,$(KBUILD_CFLAGS))
3131 endif
3232
33−targets := $(obj-vdso32) vdso32.so.dbg
33+targets := $(obj-vdso32) vdso32.so.dbg vgettimeofday.o
3434 obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
3535
3636 GCOV_PROFILE := n
@@ -46,9 +46,6 @@ obj-y += vdso32_wrapper.o · 9 unmodified lines
4646 targets += vdso32.lds
4747 CPPFLAGS_vdso32.lds += -P -C -Upowerpc
4848
49−# Force dependency (incbin is bad)
50−$(obj)/vdso32_wrapper.o : $(obj)/vdso32.so.dbg
51−
5249 # link rule for the .so file, .lds has to be first
5350 $(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32) $(obj)/vgettimeofday.o FORCE
5451 $(call if_changed,vdso32ld_and_check)
arch/powerpc/kernel/vdso32_wrapper.Srenamed from arch/powerpc/kernel/vdso32/vdso32_wrapper.S+0−0

File renamed without changes.

arch/powerpc/kernel/vdso64/Makefile+1−7
@@ -17,7 +17,7 @@ endif · 16 unmodified lines
1717
1818 # Build rules
1919
20−targets := $(obj-vdso64) vdso64.so.dbg
20+targets := $(obj-vdso64) vdso64.so.dbg vgettimeofday.o
2121 obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))
2222
2323 GCOV_PROFILE := n
@@ -29,15 +29,9 @@ ccflags-y := -shared -fno-common -fno-builtin -nostdlib \ · 5 unmodified lines
2929 -Wl,-soname=linux-vdso64.so.1 -Wl,--hash-style=both
3030 asflags-y := -D__VDSO64__ -s
3131
32−obj-y += vdso64_wrapper.o
3332 targets += vdso64.lds
3433 CPPFLAGS_vdso64.lds += -P -C -U$(ARCH)
3534
36−$(obj)/vgettimeofday.o: %.o: %.c FORCE
37−
38−# Force dependency (incbin is bad)
39−$(obj)/vdso64_wrapper.o : $(obj)/vdso64.so.dbg
40−
4135 # link rule for the .so file, .lds has to be first
4236 $(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64) $(obj)/vgettimeofday.o FORCE
4337 $(call if_changed,vdso64ld_and_check)
arch/powerpc/kernel/vdso64/sigtramp.S+10−1
@@ -15,11 +15,20 @@ · 14 unmodified lines
1515
1616 .text
1717
18+/*
19+ * __kernel_start_sigtramp_rt64 and __kernel_sigtramp_rt64 together
20+ * are one function split in two parts. The kernel jumps to the former
21+ * and the signal handler indirectly (by blr) returns to the latter.
22+ * __kernel_sigtramp_rt64 needs to point to the return address so
23+ * glibc can correctly identify the trampoline stack frame.
24+ */
1825 .balign 8
1926 .balign IFETCH_ALIGN_BYTES
20−V_FUNCTION_BEGIN(__kernel_sigtramp_rt64)
27+V_FUNCTION_BEGIN(__kernel_start_sigtramp_rt64)
2128 .Lsigrt_start:
2229 bctrl /* call the handler */
30+V_FUNCTION_END(__kernel_start_sigtramp_rt64)
31+V_FUNCTION_BEGIN(__kernel_sigtramp_rt64)
2332 addi r1, r1, __SIGNAL_FRAMESIZE
2433 li r0,__NR_rt_sigreturn
2534 sc
arch/powerpc/kernel/vdso64/vdso64.lds.S+1−1
@@ -131,4 +131,4 @@ VERSION · 130 unmodified lines
131131 /*
132132 * Make the sigreturn code visible to the kernel.
133133 */
134−VDSO_sigtramp_rt64 = __kernel_sigtramp_rt64;
134+VDSO_sigtramp_rt64 = __kernel_start_sigtramp_rt64;
arch/powerpc/kernel/vdso64_wrapper.Srenamed from arch/powerpc/kernel/vdso64/vdso64_wrapper.S+0−0

File renamed without changes.

arch/powerpc/kernel/vmlinux.lds.S+16−1
@@ -85,7 +85,7 @@ SECTIONS · 84 unmodified lines
8585 ALIGN_FUNCTION();
8686 #endif
8787 /* careful! __ftr_alt_* sections need to be close to .text */
88− *(.text.hot TEXT_MAIN .text.fixup .text.unlikely .fixup __ftr_alt_* .ref.text);
88+ *(.text.hot .text.hot.* TEXT_MAIN .text.fixup .text.unlikely .text.unlikely.* .fixup __ftr_alt_* .ref.text);
8989 #ifdef CONFIG_PPC64
9090 *(.tramp.ftrace.text);
9191 #endif
@@ -145,6 +145,13 @@ SECTIONS · 53 unmodified lines
145145 __stop___entry_flush_fixup = .;
146146 }
147147
148+ . = ALIGN(8);
149+ __scv_entry_flush_fixup : AT(ADDR(__scv_entry_flush_fixup) - LOAD_OFFSET) {
150+ __start___scv_entry_flush_fixup = .;
151+ *(__scv_entry_flush_fixup)
152+ __stop___scv_entry_flush_fixup = .;
153+ }
154+
148155 . = ALIGN(8);
149156 __stf_exit_barrier_fixup : AT(ADDR(__stf_exit_barrier_fixup) - LOAD_OFFSET) {
150157 __start___stf_exit_barrier_fixup = .;
@@ -187,6 +194,12 @@ SECTIONS · 36 unmodified lines
187194 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
188195 _sinittext = .;
189196 INIT_TEXT
197+
198+ /*
199+ *.init.text might be RO so we must ensure this section ends on
200+ * a page boundary.
201+ */
202+ . = ALIGN(PAGE_SIZE);
190203 _einittext = .;
191204 #ifdef CONFIG_PPC64
192205 *(.tramp.ftrace.init);
@@ -200,6 +213,8 @@ SECTIONS · 7 unmodified lines
200213 EXIT_TEXT
201214 }
202215
216+ . = ALIGN(PAGE_SIZE);
217+
203218 INIT_DATA_SECTION(16)
204219
205220 . = ALIGN(8);
arch/powerpc/lib/feature-fixups.c+21−3
@@ -290,9 +290,6 @@ void do_entry_flush_fixups(enum l1d_flush_type types) · 289 unmodified lines
290290 long *start, *end;
291291 int i;
292292
293− start = PTRRELOC(&__start___entry_flush_fixup);
294− end = PTRRELOC(&__stop___entry_flush_fixup);
295−
296293 instrs[0] = 0x60000000; /* nop */
297294 instrs[1] = 0x60000000; /* nop */
298295 instrs[2] = 0x60000000; /* nop */
@@ -312,6 +309,8 @@ void do_entry_flush_fixups(enum l1d_flush_type types) · 13 unmodified lines
312309 if (types & L1D_FLUSH_MTTRIG)
313310 instrs[i++] = 0x7c12dba6; /* mtspr TRIG2,r0 (SPR #882) */
314311
312+ start = PTRRELOC(&__start___entry_flush_fixup);
313+ end = PTRRELOC(&__stop___entry_flush_fixup);
315314 for (i = 0; start < end; start++, i++) {
316315 dest = (void *)start + *start;
317316
@@ -328,6 +327,25 @@ void do_entry_flush_fixups(enum l1d_flush_type types) · 10 unmodified lines
328327 patch_instruction((struct ppc_inst *)(dest + 2), ppc_inst(instrs[2]));
329328 }
330329
330+ start = PTRRELOC(&__start___scv_entry_flush_fixup);
331+ end = PTRRELOC(&__stop___scv_entry_flush_fixup);
332+ for (; start < end; start++, i++) {
333+ dest = (void *)start + *start;
334+
335+ pr_devel("patching dest %lx\n", (unsigned long)dest);
336+
337+ patch_instruction((struct ppc_inst *)dest, ppc_inst(instrs[0]));
338+
339+ if (types == L1D_FLUSH_FALLBACK)
340+ patch_branch((struct ppc_inst *)(dest + 1), (unsigned long)&scv_entry_flush_fallback,
341+ BRANCH_SET_LINK);
342+ else
343+ patch_instruction((struct ppc_inst *)(dest + 1), ppc_inst(instrs[1]));
344+
345+ patch_instruction((struct ppc_inst *)(dest + 2), ppc_inst(instrs[2]));
346+ }
347+
348+
331349 printk(KERN_DEBUG "entry-flush: patched %d locations (%s flush)\n", i,
332350 (types == L1D_FLUSH_NONE) ? "no" :
333351 (types == L1D_FLUSH_FALLBACK) ? "fallback displacement" :
arch/powerpc/lib/sstep.c+8−6
@@ -818,13 +818,15 @@ void emulate_vsx_store(struct instruction_op *op, const union vsx_reg *reg, · 817 unmodified lines
818818 break;
819819 if (rev) {
820820 /* reverse 32 bytes */
821− buf.d[0] = byterev_8(reg->d[3]);
822− buf.d[1] = byterev_8(reg->d[2]);
823− buf.d[2] = byterev_8(reg->d[1]);
824− buf.d[3] = byterev_8(reg->d[0]);
825− reg = &buf;
821+ union vsx_reg buf32[2];
822+ buf32[0].d[0] = byterev_8(reg[1].d[1]);
823+ buf32[0].d[1] = byterev_8(reg[1].d[0]);
824+ buf32[1].d[0] = byterev_8(reg[0].d[1]);
825+ buf32[1].d[1] = byterev_8(reg[0].d[0]);
826+ memcpy(mem, buf32, size);
827+ } else {
828+ memcpy(mem, reg, size);
826829 }
827− memcpy(mem, reg, size);
828830 break;
829831 case 16:
830832 /* stxv, stxvx, stxvl, stxvll */
arch/powerpc/mm/book3s64/pkeys.c+1−0
@@ -31,6 +31,7 @@ static u32 initial_allocation_mask __ro_after_init; · 30 unmodified lines
3131 u64 default_amr __ro_after_init = ~0x0UL;
3232 u64 default_iamr __ro_after_init = 0x5555555555555555UL;
3333 u64 default_uamor __ro_after_init;
34+EXPORT_SYMBOL(default_amr);
3435 /*
3536 * Key used to implement PROT_EXEC mmap. Denies READ/WRITE
3637 * We pick key 2 because 0 is special key and 1 is reserved as per ISA.
arch/riscv/Kconfig+6−2
@@ -137,7 +137,7 @@ config PA_BITS · 136 unmodified lines
137137
138138 config PAGE_OFFSET
139139 hex
140− default 0xC0000000 if 32BIT && MAXPHYSMEM_2GB
140+ default 0xC0000000 if 32BIT && MAXPHYSMEM_1GB
141141 default 0x80000000 if 64BIT && !MMU
142142 default 0xffffffff80000000 if 64BIT && MAXPHYSMEM_2GB
143143 default 0xffffffe000000000 if 64BIT && MAXPHYSMEM_128GB
@@ -247,11 +247,15 @@ config MODULE_SECTIONS · 103 unmodified lines
247247
248248 choice
249249 prompt "Maximum Physical Memory"
250− default MAXPHYSMEM_2GB if 32BIT
250+ default MAXPHYSMEM_1GB if 32BIT
251251 default MAXPHYSMEM_2GB if 64BIT && CMODEL_MEDLOW
252252 default MAXPHYSMEM_128GB if 64BIT && CMODEL_MEDANY
253253
254+ config MAXPHYSMEM_1GB
255+ depends on 32BIT
256+ bool "1GiB"
254257 config MAXPHYSMEM_2GB
258+ depends on 64BIT && CMODEL_MEDLOW
255259 bool "2GiB"
256260 config MAXPHYSMEM_128GB
257261 depends on 64BIT && CMODEL_MEDANY
arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts+1−0
@@ -88,6 +88,7 @@ · 87 unmodified lines
8888 phy-mode = "gmii";
8989 phy-handle = <&phy0>;
9090 phy0: ethernet-phy@0 {
91+ compatible = "ethernet-phy-id0007.0771";
9192 reg = <0>;
9293 };
9394 };
arch/riscv/configs/defconfig+2−0
@@ -64,6 +64,8 @@ CONFIG_HW_RANDOM=y · 63 unmodified lines
6464 CONFIG_HW_RANDOM_VIRTIO=y
6565 CONFIG_SPI=y
6666 CONFIG_SPI_SIFIVE=y
67+CONFIG_GPIOLIB=y
68+CONFIG_GPIO_SIFIVE=y
6769 # CONFIG_PTP_1588_CLOCK is not set
6870 CONFIG_POWER_RESET=y
6971 CONFIG_DRM=y
arch/riscv/include/asm/page.h+4−1
@@ -135,7 +135,10 @@ extern phys_addr_t __phys_addr_symbol(unsigned long x); · 134 unmodified lines
135135
136136 #endif /* __ASSEMBLY__ */
137137
138−#define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
138+#define virt_addr_valid(vaddr) ({ \
139+ unsigned long _addr = (unsigned long)vaddr; \
140+ (unsigned long)(_addr) >= PAGE_OFFSET && pfn_valid(virt_to_pfn(_addr)); \
141+})
139142
140143 #define VM_DATA_DEFAULT_FLAGS VM_DATA_FLAGS_NON_EXEC
141144
arch/riscv/include/asm/pgtable.h+0−1
@@ -99,7 +99,6 @@ · 98 unmodified lines
9999 | _PAGE_DIRTY)
100100
101101 #define PAGE_KERNEL __pgprot(_PAGE_KERNEL)
102−#define PAGE_KERNEL_EXEC __pgprot(_PAGE_KERNEL | _PAGE_EXEC)
103102 #define PAGE_KERNEL_READ __pgprot(_PAGE_KERNEL & ~_PAGE_WRITE)
104103 #define PAGE_KERNEL_EXEC __pgprot(_PAGE_KERNEL | _PAGE_EXEC)
105104 #define PAGE_KERNEL_READ_EXEC __pgprot((_PAGE_KERNEL & ~_PAGE_WRITE) \
arch/riscv/include/asm/set_memory.h+3−3
@@ -32,14 +32,14 @@ bool kernel_page_present(struct page *page); · 31 unmodified lines
3232
3333 #endif /* __ASSEMBLY__ */
3434
35−#ifdef CONFIG_ARCH_HAS_STRICT_KERNEL_RWX
35+#ifdef CONFIG_STRICT_KERNEL_RWX
3636 #ifdef CONFIG_64BIT
3737 #define SECTION_ALIGN (1 << 21)
3838 #else
3939 #define SECTION_ALIGN (1 << 22)
4040 #endif
41−#else /* !CONFIG_ARCH_HAS_STRICT_KERNEL_RWX */
41+#else /* !CONFIG_STRICT_KERNEL_RWX */
4242 #define SECTION_ALIGN L1_CACHE_BYTES
43−#endif /* CONFIG_ARCH_HAS_STRICT_KERNEL_RWX */
43+#endif /* CONFIG_STRICT_KERNEL_RWX */
4444
4545 #endif /* _ASM_RISCV_SET_MEMORY_H */
arch/riscv/include/asm/vdso.h+1−1
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010
1111 #include <linux/types.h>
1212
13−#ifndef GENERIC_TIME_VSYSCALL
13+#ifndef CONFIG_GENERIC_TIME_VSYSCALL
1414 struct vdso_data {
1515 };
1616 #endif
arch/riscv/kernel/cacheinfo.c+10−1
@@ -26,7 +26,16 @@ cache_get_priv_group(struct cacheinfo *this_leaf) · 25 unmodified lines
2626
2727 static struct cacheinfo *get_cacheinfo(u32 level, enum cache_type type)
2828 {
29− struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(smp_processor_id());
29+ /*
30+ * Using raw_smp_processor_id() elides a preemptability check, but this
31+ * is really indicative of a larger problem: the cacheinfo UABI assumes
32+ * that cores have a homonogenous view of the cache hierarchy. That
33+ * happens to be the case for the current set of RISC-V systems, but
34+ * likely won't be true in general. Since there's no way to provide
35+ * correct information for these systems via the current UABI we're
36+ * just eliding the check for now.
37+ */
38+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(raw_smp_processor_id());
3039 struct cacheinfo *this_leaf;
3140 int index;
3241
arch/riscv/kernel/entry.S+13−11
@@ -124,15 +124,15 @@ skip_context_tracking: · 123 unmodified lines
124124 REG_L a1, (a1)
125125 jr a1
126126 1:
127−#ifdef CONFIG_TRACE_IRQFLAGS
128− call trace_hardirqs_on
129−#endif
130127 /*
131128 * Exceptions run with interrupts enabled or disabled depending on the
132129 * state of SR_PIE in m/sstatus.
133130 */
134131 andi t0, s1, SR_PIE
135132 beqz t0, 1f
133+#ifdef CONFIG_TRACE_IRQFLAGS
134+ call trace_hardirqs_on
135+#endif
136136 csrs CSR_STATUS, SR_IE
137137
138138 1:
@@ -155,6 +155,15 @@ skip_context_tracking: · 16 unmodified lines
155155 tail do_trap_unknown
156156
157157 handle_syscall:
158+#ifdef CONFIG_RISCV_M_MODE
159+ /*
160+ * When running is M-Mode (no MMU config), MPIE does not get set.
161+ * As a result, we need to force enable interrupts here because
162+ * handle_exception did not do set SR_IE as it always sees SR_PIE
163+ * being cleared.
164+ */
165+ csrs CSR_STATUS, SR_IE
166+#endif
158167 #if defined(CONFIG_TRACE_IRQFLAGS) || defined(CONFIG_CONTEXT_TRACKING)
159168 /* Recover a0 - a7 for system calls */
160169 REG_L a0, PT_A0(sp)
@@ -186,14 +195,7 @@ check_syscall_nr: · 25 unmodified lines
186195 * Syscall number held in a7.
187196 * If syscall number is above allowed value, redirect to ni_syscall.
188197 */
189− bge a7, t0, 1f
190− /*
191− * Check if syscall is rejected by tracer, i.e., a7 == -1.
192− * If yes, we pretend it was executed.
193− */
194− li t1, -1
195− beq a7, t1, ret_from_syscall_rejected
196− blt a7, t1, 1f
198+ bgeu a7, t0, 1f
197199 /* Call syscall */
198200 la s0, sys_call_table
199201 slli t0, a7, RISCV_LGPTR
arch/riscv/kernel/setup.c+16−12
@@ -127,7 +127,9 @@ static void __init init_resources(void) · 126 unmodified lines
127127 {
128128 struct memblock_region *region = NULL;
129129 struct resource *res = NULL;
130− int ret = 0;
130+ struct resource *mem_res = NULL;
131+ size_t mem_res_sz = 0;
132+ int ret = 0, i = 0;
131133
132134 code_res.start = __pa_symbol(_text);
133135 code_res.end = __pa_symbol(_etext) - 1;
@@ -145,16 +147,17 @@ static void __init init_resources(void) · 11 unmodified lines
145147 bss_res.end = __pa_symbol(__bss_stop) - 1;
146148 bss_res.flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
147149
150+ mem_res_sz = (memblock.memory.cnt + memblock.reserved.cnt) * sizeof(*mem_res);
151+ mem_res = memblock_alloc(mem_res_sz, SMP_CACHE_BYTES);
152+ if (!mem_res)
153+ panic("%s: Failed to allocate %zu bytes\n", __func__, mem_res_sz);
148154 /*
149155 * Start by adding the reserved regions, if they overlap
150156 * with /memory regions, insert_resource later on will take
151157 * care of it.
152158 */
153159 for_each_reserved_mem_region(region) {
154− res = memblock_alloc(sizeof(struct resource), SMP_CACHE_BYTES);
155− if (!res)
156− panic("%s: Failed to allocate %zu bytes\n", __func__,
157− sizeof(struct resource));
160+ res = &mem_res[i++];
158161
159162 res->name = "Reserved";
160163 res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
@@ -171,8 +174,10 @@ static void __init init_resources(void) · 10 unmodified lines
171174 * Ignore any other reserved regions within
172175 * system memory.
173176 */
174− if (memblock_is_memory(res->start))
177+ if (memblock_is_memory(res->start)) {
178+ memblock_free((phys_addr_t) res, sizeof(struct resource));
175179 continue;
180+ }
176181
177182 ret = add_resource(&iomem_resource, res);
178183 if (ret < 0)
@@ -181,10 +186,7 @@ static void __init init_resources(void) · 2 unmodified lines
181186
182187 /* Add /memory regions to the resource tree */
183188 for_each_mem_region(region) {
184− res = memblock_alloc(sizeof(struct resource), SMP_CACHE_BYTES);
185− if (!res)
186− panic("%s: Failed to allocate %zu bytes\n", __func__,
187− sizeof(struct resource));
189+ res = &mem_res[i++];
188190
189191 if (unlikely(memblock_is_nomap(region))) {
190192 res->name = "Reserved";
@@ -205,9 +207,9 @@ static void __init init_resources(void) · 14 unmodified lines
205207 return;
206208
207209 error:
208− memblock_free((phys_addr_t) res, sizeof(struct resource));
209210 /* Better an empty resource tree than an inconsistent one */
210211 release_child_resources(&iomem_resource);
212+ memblock_free((phys_addr_t) mem_res, mem_res_sz);
211213 }
212214
213215
@@ -291,6 +293,8 @@ void free_initmem(void) · 77 unmodified lines
291293 unsigned long init_begin = (unsigned long)__init_begin;
292294 unsigned long init_end = (unsigned long)__init_end;
293295
294− set_memory_rw_nx(init_begin, (init_end - init_begin) >> PAGE_SHIFT);
296+ if (IS_ENABLED(CONFIG_STRICT_KERNEL_RWX))
297+ set_memory_rw_nx(init_begin, (init_end - init_begin) >> PAGE_SHIFT);
298+
295299 free_initmem_default(POISON_FREE_INITMEM);
296300 }
arch/riscv/kernel/stacktrace.c+2−3
@@ -14,7 +14,7 @@ · 13 unmodified lines
1414
1515 #include <asm/stacktrace.h>
1616
17−register unsigned long sp_in_global __asm__("sp");
17+register const unsigned long sp_in_global __asm__("sp");
1818
1919 #ifdef CONFIG_FRAME_POINTER
2020
@@ -28,9 +28,8 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs, · 7 unmodified lines
2828 sp = user_stack_pointer(regs);
2929 pc = instruction_pointer(regs);
3030 } else if (task == NULL || task == current) {
31− const register unsigned long current_sp = sp_in_global;
3231 fp = (unsigned long)__builtin_frame_address(0);
33− sp = current_sp;
32+ sp = sp_in_global;
3433 pc = (unsigned long)walk_stackframe;
3534 } else {
3635 /* task blocked in __switch_to */
arch/riscv/kernel/time.c+3−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 * Copyright (C) 2017 SiFive
55 */
66
7+#include <linux/of_clk.h>
78 #include <linux/clocksource.h>
89 #include <linux/delay.h>
910 #include <asm/sbi.h>
@@ -24,6 +25,8 @@ void __init time_init(void) · 14 unmodified lines
2425 riscv_timebase = prop;
2526
2627 lpj_fine = riscv_timebase / HZ;
28+
29+ of_clk_init(NULL);
2730 timer_probe();
2831 }
2932
arch/riscv/kernel/vdso.c+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 #include <linux/binfmts.h>
1313 #include <linux/err.h>
1414 #include <asm/page.h>
15−#ifdef GENERIC_TIME_VSYSCALL
15+#ifdef CONFIG_GENERIC_TIME_VSYSCALL
1616 #include <vdso/datapage.h>
1717 #else
1818 #include <asm/vdso.h>
arch/riscv/mm/init.c+15−3
@@ -157,9 +157,10 @@ disable: · 156 unmodified lines
157157 void __init setup_bootmem(void)
158158 {
159159 phys_addr_t mem_start = 0;
160− phys_addr_t start, end = 0;
160+ phys_addr_t start, dram_end, end = 0;
161161 phys_addr_t vmlinux_end = __pa_symbol(&_end);
162162 phys_addr_t vmlinux_start = __pa_symbol(&_start);
163+ phys_addr_t max_mapped_addr = __pa(~(ulong)0);
163164 u64 i;
164165
165166 /* Find the memory region containing the kernel */
@@ -181,10 +182,21 @@ void __init setup_bootmem(void) · 15 unmodified lines
181182 /* Reserve from the start of the kernel to the end of the kernel */
182183 memblock_reserve(vmlinux_start, vmlinux_end - vmlinux_start);
183184
184− max_pfn = PFN_DOWN(memblock_end_of_DRAM());
185+ dram_end = memblock_end_of_DRAM();
186+
187+ /*
188+ * memblock allocator is not aware of the fact that last 4K bytes of
189+ * the addressable memory can not be mapped because of IS_ERR_VALUE
190+ * macro. Make sure that last 4k bytes are not usable by memblock
191+ * if end of dram is equal to maximum addressable memory.
192+ */
193+ if (max_mapped_addr == (dram_end - 1))
194+ memblock_set_current_limit(max_mapped_addr - 4096);
195+
196+ max_pfn = PFN_DOWN(dram_end);
185197 max_low_pfn = max_pfn;
186198 dma32_phys_limit = min(4UL * SZ_1G, (unsigned long)PFN_PHYS(max_low_pfn));
187− set_max_mapnr(max_low_pfn);
199+ set_max_mapnr(max_low_pfn - ARCH_PFN_OFFSET);
188200
189201 #ifdef CONFIG_BLK_DEV_INITRD
190202 setup_initrd();
arch/riscv/mm/kasan_init.c+2−2
@@ -93,8 +93,8 @@ void __init kasan_init(void) · 92 unmodified lines
9393 VMALLOC_END));
9494
9595 for_each_mem_range(i, &_start, &_end) {
96− void *start = (void *)_start;
97− void *end = (void *)_end;
96+ void *start = (void *)__va(_start);
97+ void *end = (void *)__va(_end);
9898
9999 if (start >= end)
100100 break;
arch/s390/boot/uv.c+1−1
@@ -35,7 +35,7 @@ void uv_query_info(void) · 34 unmodified lines
3535 uv_info.guest_cpu_stor_len = uvcb.cpu_stor_len;
3636 uv_info.max_sec_stor_addr = ALIGN(uvcb.max_guest_stor_addr, PAGE_SIZE);
3737 uv_info.max_num_sec_conf = uvcb.max_num_sec_conf;
38− uv_info.max_guest_cpus = uvcb.max_guest_cpus;
38+ uv_info.max_guest_cpu_id = uvcb.max_guest_cpu_id;
3939 }
4040
4141 #ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST
arch/s390/include/asm/uv.h+2−2
@@ -96,7 +96,7 @@ struct uv_cb_qui { · 95 unmodified lines
9696 u32 max_num_sec_conf;
9797 u64 max_guest_stor_addr;
9898 u8 reserved88[158 - 136];
99− u16 max_guest_cpus;
99+ u16 max_guest_cpu_id;
100100 u8 reserveda0[200 - 160];
101101 } __packed __aligned(8);
102102
@@ -273,7 +273,7 @@ struct uv_info { · 170 unmodified lines
273273 unsigned long guest_cpu_stor_len;
274274 unsigned long max_sec_stor_addr;
275275 unsigned int max_num_sec_conf;
276− unsigned short max_guest_cpus;
276+ unsigned short max_guest_cpu_id;
277277 };
278278
279279 extern struct uv_info uv_info;
arch/s390/kernel/uv.c+1−1
@@ -368,7 +368,7 @@ static ssize_t uv_query_max_guest_cpus(struct kobject *kobj, · 367 unmodified lines
368368 struct kobj_attribute *attr, char *page)
369369 {
370370 return scnprintf(page, PAGE_SIZE, "%d\n",
371− uv_info.max_guest_cpus);
371+ uv_info.max_guest_cpu_id + 1);
372372 }
373373
374374 static struct kobj_attribute uv_query_max_guest_cpus_attr =
arch/sh/Kconfig+0−1
@@ -29,7 +29,6 @@ config SUPERH · 28 unmodified lines
2929 select HAVE_ARCH_KGDB
3030 select HAVE_ARCH_SECCOMP_FILTER
3131 select HAVE_ARCH_TRACEHOOK
32− select HAVE_COPY_THREAD_TLS
3332 select HAVE_DEBUG_BUGVERBOSE
3433 select HAVE_DEBUG_KMEMLEAK
3534 select HAVE_DYNAMIC_FTRACE
arch/sh/boards/mach-sh03/rtc.c+0−1
@@ -11,7 +11,6 @@ · 10 unmodified lines
1111 #include <linux/sched.h>
1212 #include <linux/time.h>
1313 #include <linux/bcd.h>
14−#include <linux/rtc.h>
1514 #include <linux/spinlock.h>
1615 #include <linux/io.h>
1716 #include <linux/rtc.h>
arch/sh/configs/landisk_defconfig+4−5
@@ -27,13 +27,12 @@ CONFIG_NETFILTER=y · 26 unmodified lines
2727 CONFIG_ATALK=m
2828 CONFIG_BLK_DEV_LOOP=y
2929 CONFIG_BLK_DEV_RAM=y
30−CONFIG_IDE=y
31−CONFIG_BLK_DEV_IDECD=y
32−CONFIG_BLK_DEV_OFFBOARD=y
33−CONFIG_BLK_DEV_GENERIC=y
34−CONFIG_BLK_DEV_AEC62XX=y
30+CONFIG_ATA=y
31+CONFIG_ATA_GENERIC=y
32+CONFIG_PATA_ATP867X=y
3533 CONFIG_SCSI=y
3634 CONFIG_BLK_DEV_SD=y
35+CONFIG_BLK_DEV_SR=y
3736 CONFIG_SCSI_MULTI_LUN=y
3837 CONFIG_MD=y
3938 CONFIG_BLK_DEV_MD=m
arch/sh/configs/microdev_defconfig+0−2
@@ -20,8 +20,6 @@ CONFIG_IP_PNP=y · 19 unmodified lines
2020 # CONFIG_IPV6 is not set
2121 # CONFIG_FW_LOADER is not set
2222 CONFIG_BLK_DEV_RAM=y
23−CONFIG_IDE=y
24−CONFIG_BLK_DEV_IDECD=y
2523 CONFIG_NETDEVICES=y
2624 CONFIG_NET_ETHERNET=y
2725 CONFIG_SMC91X=y
arch/sh/configs/sdk7780_defconfig+2−4
@@ -44,16 +44,14 @@ CONFIG_NET_SCHED=y · 43 unmodified lines
4444 CONFIG_PARPORT=y
4545 CONFIG_BLK_DEV_LOOP=y
4646 CONFIG_BLK_DEV_RAM=y
47−CONFIG_IDE=y
48−CONFIG_BLK_DEV_IDECD=y
49−CONFIG_BLK_DEV_PLATFORM=y
50−CONFIG_BLK_DEV_GENERIC=y
5147 CONFIG_BLK_DEV_SD=y
5248 CONFIG_BLK_DEV_SR=y
5349 CONFIG_CHR_DEV_SG=y
5450 CONFIG_SCSI_SPI_ATTRS=y
5551 CONFIG_SCSI_FC_ATTRS=y
5652 CONFIG_ATA=y
53+CONFIG_ATA_GENERIC=y
54+CONFIG_PATA_PLATFORM=y
5755 CONFIG_MD=y
5856 CONFIG_BLK_DEV_DM=y
5957 CONFIG_NETDEVICES=y
arch/sh/configs/sdk7786_defconfig+0−3
@@ -116,9 +116,6 @@ CONFIG_MTD_UBI_GLUEBI=m · 115 unmodified lines
116116 CONFIG_BLK_DEV_LOOP=y
117117 CONFIG_BLK_DEV_CRYPTOLOOP=y
118118 CONFIG_BLK_DEV_RAM=y
119−CONFIG_IDE=y
120−CONFIG_BLK_DEV_IDECD=y
121−CONFIG_BLK_DEV_PLATFORM=y
122119 CONFIG_BLK_DEV_SD=y
123120 CONFIG_BLK_DEV_SR=y
124121 CONFIG_SCSI_MULTI_LUN=y
arch/sh/configs/se7750_defconfig+0−1
@@ -29,7 +29,6 @@ CONFIG_MTD_BLOCK=y · 28 unmodified lines
2929 CONFIG_MTD_CFI=y
3030 CONFIG_MTD_CFI_AMDSTD=y
3131 CONFIG_MTD_ROM=y
32−CONFIG_IDE=y
3332 CONFIG_SCSI=y
3433 CONFIG_NETDEVICES=y
3534 CONFIG_NET_ETHERNET=y
arch/sh/configs/sh03_defconfig+0−3
@@ -39,9 +39,6 @@ CONFIG_IP_PNP_RARP=y · 38 unmodified lines
3939 CONFIG_BLK_DEV_LOOP=y
4040 CONFIG_BLK_DEV_NBD=y
4141 CONFIG_BLK_DEV_RAM=y
42−CONFIG_IDE=y
43−CONFIG_BLK_DEV_IDECD=m
44−CONFIG_BLK_DEV_IDETAPE=m
4542 CONFIG_SCSI=m
4643 CONFIG_BLK_DEV_SD=m
4744 CONFIG_BLK_DEV_SR=m
arch/sh/drivers/dma/Kconfig+1−2
@@ -63,8 +63,7 @@ config PVR2_DMA · 62 unmodified lines
6363
6464 config G2_DMA
6565 tristate "G2 Bus DMA support"
66− depends on SH_DREAMCAST
67− select SH_DMA_API
66+ depends on SH_DREAMCAST && SH_DMA_API
6867 help
6968 This enables support for the DMA controller for the Dreamcast's
7069 G2 bus. Drivers that want this will generally enable this on
arch/sh/include/asm/gpio.h+0−1
@@ -16,7 +16,6 @@ · 15 unmodified lines
1616 #include <cpu/gpio.h>
1717 #endif
1818
19−#define ARCH_NR_GPIOS 512
2019 #include <asm-generic/gpio.h>
2120
2221 #ifdef CONFIG_GPIOLIB
arch/sh/kernel/cpu/sh3/entry.S+0−1
@@ -14,7 +14,6 @@ · 13 unmodified lines
1414 #include <cpu/mmu_context.h>
1515 #include <asm/page.h>
1616 #include <asm/cache.h>
17−#include <asm/thread_info.h>
1817
1918 ! NOTE:
2019 ! GNU as (as of 2.9.1) changes bf/s into bt/s and bra, when the address
arch/sh/mm/Kconfig+1−1
@@ -105,7 +105,7 @@ config VSYSCALL · 104 unmodified lines
105105 (the default value) say Y.
106106
107107 config NUMA
108− bool "Non Uniform Memory Access (NUMA) Support"
108+ bool "Non-Uniform Memory Access (NUMA) Support"
109109 depends on MMU && SYS_SUPPORTS_NUMA
110110 select ARCH_WANT_NUMA_VARIABLE_LOCALITY
111111 default n
arch/sh/mm/asids-debugfs.c+2−13
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 #include <asm/processor.h>
2727 #include <asm/mmu_context.h>
2828
29−static int asids_seq_show(struct seq_file *file, void *iter)
29+static int asids_debugfs_show(struct seq_file *file, void *iter)
3030 {
3131 struct task_struct *p;
3232
@@ -48,18 +48,7 @@ static int asids_seq_show(struct seq_file *file, void *iter) · 15 unmodified lines
4848 return 0;
4949 }
5050
51−static int asids_debugfs_open(struct inode *inode, struct file *file)
52−{
53− return single_open(file, asids_seq_show, inode->i_private);
54−}
55−
56−static const struct file_operations asids_debugfs_fops = {
57− .owner = THIS_MODULE,
58− .open = asids_debugfs_open,
59− .read = seq_read,
60− .llseek = seq_lseek,
61− .release = single_release,
62−};
51+DEFINE_SHOW_ATTRIBUTE(asids_debugfs);
6352
6453 static int __init asids_debugfs_init(void)
6554 {
arch/sh/mm/cache-debugfs.c+2−13
@@ -22,7 +22,7 @@ enum cache_type { · 21 unmodified lines
2222 CACHE_TYPE_UNIFIED,
2323 };
2424
25−static int cache_seq_show(struct seq_file *file, void *iter)
25+static int cache_debugfs_show(struct seq_file *file, void *iter)
2626 {
2727 unsigned int cache_type = (unsigned int)file->private;
2828 struct cache_info *cache;
@@ -94,18 +94,7 @@ static int cache_seq_show(struct seq_file *file, void *iter) · 65 unmodified lines
9494 return 0;
9595 }
9696
97−static int cache_debugfs_open(struct inode *inode, struct file *file)
98−{
99− return single_open(file, cache_seq_show, inode->i_private);
100−}
101−
102−static const struct file_operations cache_debugfs_fops = {
103− .owner = THIS_MODULE,
104− .open = cache_debugfs_open,
105− .read = seq_read,
106− .llseek = seq_lseek,
107− .release = single_release,
108−};
97+DEFINE_SHOW_ATTRIBUTE(cache_debugfs);
10998
11099 static int __init cache_debugfs_init(void)
111100 {
arch/sh/mm/pmb.c+2−13
@@ -812,7 +812,7 @@ bool __in_29bit_mode(void) · 811 unmodified lines
812812 return (__raw_readl(PMB_PASCR) & PASCR_SE) == 0;
813813 }
814814
815−static int pmb_seq_show(struct seq_file *file, void *iter)
815+static int pmb_debugfs_show(struct seq_file *file, void *iter)
816816 {
817817 int i;
818818
@@ -846,18 +846,7 @@ static int pmb_seq_show(struct seq_file *file, void *iter) · 27 unmodified lines
846846 return 0;
847847 }
848848
849−static int pmb_debugfs_open(struct inode *inode, struct file *file)
850−{
851− return single_open(file, pmb_seq_show, NULL);
852−}
853−
854−static const struct file_operations pmb_debugfs_fops = {
855− .owner = THIS_MODULE,
856− .open = pmb_debugfs_open,
857− .read = seq_read,
858− .llseek = seq_lseek,
859− .release = single_release,
860−};
849+DEFINE_SHOW_ATTRIBUTE(pmb_debugfs);
861850
862851 static int __init pmb_debugfs_init(void)
863852 {
arch/sparc/include/asm/Kbuild+0−2
@@ -1,6 +1,4 @@
11 # SPDX-License-Identifier: GPL-2.0
2−# User exported sparc header files
3−
42 generated-y += syscall_table_32.h
53 generated-y += syscall_table_64.h
64 generated-y += syscall_table_c32.h
arch/sparc/include/asm/highmem.h+5−4
@@ -50,10 +50,11 @@ extern pte_t *pkmap_page_table; · 49 unmodified lines
5050
5151 #define flush_cache_kmaps() flush_cache_all()
5252
53−/* FIXME: Use __flush_tlb_one(vaddr) instead of flush_cache_all() -- Anton */
54−#define arch_kmap_local_post_map(vaddr, pteval) flush_cache_all()
55−#define arch_kmap_local_post_unmap(vaddr) flush_cache_all()
56−
53+/* FIXME: Use __flush_*_one(vaddr) instead of flush_*_all() -- Anton */
54+#define arch_kmap_local_pre_map(vaddr, pteval) flush_cache_all()
55+#define arch_kmap_local_pre_unmap(vaddr) flush_cache_all()
56+#define arch_kmap_local_post_map(vaddr, pteval) flush_tlb_all()
57+#define arch_kmap_local_post_unmap(vaddr) flush_tlb_all()
5758
5859 #endif /* __KERNEL__ */
5960
arch/um/Kconfig+0−1
@@ -15,7 +15,6 @@ config UML · 14 unmodified lines
1515 select HAVE_DEBUG_KMEMLEAK
1616 select HAVE_DEBUG_BUGVERBOSE
1717 select NO_DMA
18− select ARCH_HAS_SET_MEMORY
1918 select GENERIC_IRQ_SHOW
2019 select GENERIC_CPU_DEVICES
2120 select HAVE_GCC_PLUGINS
arch/um/drivers/ubd_kern.c+3−3
@@ -375,11 +375,11 @@ break_loop: · 374 unmodified lines
375375 file = NULL;
376376
377377 backing_file = strsep(&str, ",:");
378− if (*backing_file == '\0')
378+ if (backing_file && *backing_file == '\0')
379379 backing_file = NULL;
380380
381381 serial = strsep(&str, ",:");
382− if (*serial == '\0')
382+ if (serial && *serial == '\0')
383383 serial = NULL;
384384
385385 if (backing_file && ubd_dev->no_cow) {
@@ -1241,7 +1241,7 @@ static int __init ubd_driver_init(void){ · 855 unmodified lines
12411241 /* Letting ubd=sync be like using ubd#s= instead of ubd#= is
12421242 * enough. So use anyway the io thread. */
12431243 }
1244− stack = alloc_stack(0);
1244+ stack = alloc_stack(0, 0);
12451245 io_pid = start_io_thread(stack + PAGE_SIZE - sizeof(void *),
12461246 &thread_fd);
12471247 if(io_pid < 0){
arch/um/drivers/virtio_uml.c+2−1
@@ -1084,6 +1084,7 @@ static void virtio_uml_release_dev(struct device *d) · 1083 unmodified lines
10841084 }
10851085
10861086 os_close_file(vu_dev->sock);
1087+ kfree(vu_dev);
10871088 }
10881089
10891090 /* Platform device */
@@ -1097,7 +1098,7 @@ static int virtio_uml_probe(struct platform_device *pdev) · 7 unmodified lines
10971098 if (!pdata)
10981099 return -EINVAL;
10991100
1100− vu_dev = devm_kzalloc(&pdev->dev, sizeof(*vu_dev), GFP_KERNEL);
1101+ vu_dev = kzalloc(sizeof(*vu_dev), GFP_KERNEL);
11011102 if (!vu_dev)
11021103 return -ENOMEM;
11031104
arch/um/include/asm/io.h+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 #define ioremap ioremap
66 static inline void __iomem *ioremap(phys_addr_t offset, size_t size)
77 {
8− return (void __iomem *)(unsigned long)offset;
8+ return NULL;
99 }
1010
1111 #define iounmap iounmap
arch/um/include/asm/pgtable.h+0−3
@@ -55,15 +55,12 @@ extern unsigned long end_iomem; · 54 unmodified lines
5555 #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
5656 #define __PAGE_KERNEL_EXEC \
5757 (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
58−#define __PAGE_KERNEL_RO \
59− (_PAGE_PRESENT | _PAGE_DIRTY | _PAGE_ACCESSED)
6058 #define PAGE_NONE __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED)
6159 #define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
6260 #define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
6361 #define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
6462 #define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
6563 #define PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL_EXEC)
66−#define PAGE_KERNEL_RO __pgprot(__PAGE_KERNEL_RO)
6764
6865 /*
6966 * The i386 can't do page protection for execute, and considers that the same
arch/um/include/asm/set_memory.h+0−1
@@ -1 +0,0 @@
1−#include <asm-generic/set_memory.h>
arch/um/include/shared/kern_util.h+1−1
@@ -19,7 +19,7 @@ extern int kmalloc_ok; · 18 unmodified lines
1919 #define UML_ROUND_UP(addr) \
2020 ((((unsigned long) addr) + PAGE_SIZE - 1) & PAGE_MASK)
2121
22−extern unsigned long alloc_stack(int atomic);
22+extern unsigned long alloc_stack(int order, int atomic);
2323 extern void free_stack(unsigned long stack, int order);
2424
2525 struct pt_regs;
arch/um/kernel/kmsg_dump.c+7−2
@@ -1,6 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0
22 #include <linux/kmsg_dump.h>
33 #include <linux/console.h>
4+#include <linux/string.h>
45 #include <shared/init.h>
56 #include <shared/kern.h>
67 #include <os.h>
@@ -16,8 +17,12 @@ static void kmsg_dumper_stdout(struct kmsg_dumper *dumper, · 9 unmodified lines
1617 if (!console_trylock())
1718 return;
1819
19− for_each_console(con)
20− break;
20+ for_each_console(con) {
21+ if(strcmp(con->name, "tty") == 0 &&
22+ (con->flags & (CON_ENABLED | CON_CONSDEV)) != 0) {
23+ break;
24+ }
25+ }
2126
2227 console_unlock();
2328
arch/um/kernel/process.c+4−7
@@ -32,7 +32,6 @@ · 31 unmodified lines
3232 #include <os.h>
3333 #include <skas.h>
3434 #include <linux/time-internal.h>
35−#include <asm/set_memory.h>
3635
3736 /*
3837 * This is a per-cpu array. A processor only modifies its entry and it only
@@ -63,18 +62,16 @@ void free_stack(unsigned long stack, int order) · 24 unmodified lines
6362 free_pages(stack, order);
6463 }
6564
66−unsigned long alloc_stack(int atomic)
65+unsigned long alloc_stack(int order, int atomic)
6766 {
68− unsigned long addr;
67+ unsigned long page;
6968 gfp_t flags = GFP_KERNEL;
7069
7170 if (atomic)
7271 flags = GFP_ATOMIC;
73− addr = __get_free_pages(flags, 1);
72+ page = __get_free_pages(flags, order);
7473
75− set_memory_ro(addr, 1);
76−
77− return addr + PAGE_SIZE;
74+ return page;
7875 }
7976
8077 static inline void set_current(struct task_struct *task)
arch/um/kernel/time.c+31−19
@@ -535,6 +535,31 @@ invalid_number: · 534 unmodified lines
535535
536536 return 1;
537537 }
538+
539+static void time_travel_set_start(void)
540+{
541+ if (time_travel_start_set)
542+ return;
543+
544+ switch (time_travel_mode) {
545+ case TT_MODE_EXTERNAL:
546+ time_travel_start = time_travel_ext_req(UM_TIMETRAVEL_GET_TOD, -1);
547+ /* controller gave us the *current* time, so adjust by that */
548+ time_travel_ext_get_time();
549+ time_travel_start -= time_travel_time;
550+ break;
551+ case TT_MODE_INFCPU:
552+ case TT_MODE_BASIC:
553+ if (!time_travel_start_set)
554+ time_travel_start = os_persistent_clock_emulation();
555+ break;
556+ case TT_MODE_OFF:
557+ /* we just read the host clock with os_persistent_clock_emulation() */
558+ break;
559+ }
560+
561+ time_travel_start_set = true;
562+}
538563 #else /* CONFIG_UML_TIME_TRAVEL_SUPPORT */
539564 #define time_travel_start_set 0
540565 #define time_travel_start 0
@@ -553,6 +578,10 @@ static void time_travel_set_interval(unsigned long long interval) · 12 unmodified lines
553578 {
554579 }
555580
581+static inline void time_travel_set_start(void)
582+{
583+}
584+
556585 /* fail link if this actually gets used */
557586 extern u64 time_travel_ext_req(u32 op, u64 time);
558587
@@ -731,6 +760,8 @@ void read_persistent_clock64(struct timespec64 *ts) · 172 unmodified lines
731760 {
732761 long long nsecs;
733762
763+ time_travel_set_start();
764+
734765 if (time_travel_mode != TT_MODE_OFF)
735766 nsecs = time_travel_start + time_travel_time;
736767 else
@@ -742,25 +773,6 @@ void read_persistent_clock64(struct timespec64 *ts) · 5 unmodified lines
742773
743774 void __init time_init(void)
744775 {
745−#ifdef CONFIG_UML_TIME_TRAVEL_SUPPORT
746− switch (time_travel_mode) {
747− case TT_MODE_EXTERNAL:
748− time_travel_start = time_travel_ext_req(UM_TIMETRAVEL_GET_TOD, -1);
749− /* controller gave us the *current* time, so adjust by that */
750− time_travel_ext_get_time();
751− time_travel_start -= time_travel_time;
752− break;
753− case TT_MODE_INFCPU:
754− case TT_MODE_BASIC:
755− if (!time_travel_start_set)
756− time_travel_start = os_persistent_clock_emulation();
757− break;
758− case TT_MODE_OFF:
759− /* we just read the host clock with os_persistent_clock_emulation() */
760− break;
761− }
762−#endif
763−
764776 timer_set_signal_handler();
765777 late_time_init = um_timer_setup;
766778 }
arch/um/kernel/tlb.c+0−54
@@ -608,57 +608,3 @@ void force_flush_all(void) · 607 unmodified lines
608608 vma = vma->vm_next;
609609 }
610610 }
611−
612−struct page_change_data {
613− unsigned int set_mask, clear_mask;
614−};
615−
616−static int change_page_range(pte_t *ptep, unsigned long addr, void *data)
617−{
618− struct page_change_data *cdata = data;
619− pte_t pte = READ_ONCE(*ptep);
620−
621− pte_clear_bits(pte, cdata->clear_mask);
622− pte_set_bits(pte, cdata->set_mask);
623−
624− set_pte(ptep, pte);
625− return 0;
626−}
627−
628−static int change_memory(unsigned long start, unsigned long pages,
629− unsigned int set_mask, unsigned int clear_mask)
630−{
631− unsigned long size = pages * PAGE_SIZE;
632− struct page_change_data data;
633− int ret;
634−
635− data.set_mask = set_mask;
636− data.clear_mask = clear_mask;
637−
638− ret = apply_to_page_range(&init_mm, start, size, change_page_range,
639− &data);
640−
641− flush_tlb_kernel_range(start, start + size);
642−
643− return ret;
644−}
645−
646−int set_memory_ro(unsigned long addr, int numpages)
647−{
648− return change_memory(addr, numpages, 0, _PAGE_RW);
649−}
650−
651−int set_memory_rw(unsigned long addr, int numpages)
652−{
653− return change_memory(addr, numpages, _PAGE_RW, 0);
654−}
655−
656−int set_memory_nx(unsigned long addr, int numpages)
657−{
658− return -EOPNOTSUPP;
659−}
660−
661−int set_memory_x(unsigned long addr, int numpages)
662−{
663− return -EOPNOTSUPP;
664−}
arch/um/kernel/um_arch.c+19−3
@@ -26,7 +26,8 @@ · 25 unmodified lines
2626 #include <mem_user.h>
2727 #include <os.h>
2828
29−#define DEFAULT_COMMAND_LINE "root=98:0"
29+#define DEFAULT_COMMAND_LINE_ROOT "root=98:0"
30+#define DEFAULT_COMMAND_LINE_CONSOLE "console=tty"
3031
3132 /* Changed in add_arg and setup_arch, which run before SMP is started */
3233 static char __initdata command_line[COMMAND_LINE_SIZE] = { 0 };
@@ -109,7 +110,8 @@ unsigned long end_vm; · 76 unmodified lines
109110 int ncpus = 1;
110111
111112 /* Set in early boot */
112−static int have_root __initdata = 0;
113+static int have_root __initdata;
114+static int have_console __initdata;
113115
114116 /* Set in uml_mem_setup and modified in linux_main */
115117 long long physmem_size = 32 * 1024 * 1024;
@@ -161,6 +163,17 @@ __uml_setup("debug", no_skas_debug_setup, · 45 unmodified lines
161163 " this flag is not needed to run gdb on UML in skas mode\n\n"
162164 );
163165
166+static int __init uml_console_setup(char *line, int *add)
167+{
168+ have_console = 1;
169+ return 0;
170+}
171+
172+__uml_setup("console=", uml_console_setup,
173+"console=<preferred console>\n"
174+" Specify the preferred console output driver\n\n"
175+);
176+
164177 static int __init Usage(char *line, int *add)
165178 {
166179 const char **p;
@@ -264,7 +277,10 @@ int __init linux_main(int argc, char **argv) · 97 unmodified lines
264277 add_arg(argv[i]);
265278 }
266279 if (have_root == 0)
267− add_arg(DEFAULT_COMMAND_LINE);
280+ add_arg(DEFAULT_COMMAND_LINE_ROOT);
281+
282+ if (have_console == 0)
283+ add_arg(DEFAULT_COMMAND_LINE_CONSOLE);
268284
269285 host_task_size = os_get_top_address();
270286 /*
arch/um/os-Linux/helper.c+2−2
@@ -45,7 +45,7 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv) · 44 unmodified lines
4545 unsigned long stack, sp;
4646 int pid, fds[2], ret, n;
4747
48− stack = alloc_stack(__cant_sleep());
48+ stack = alloc_stack(0, __cant_sleep());
4949 if (stack == 0)
5050 return -ENOMEM;
5151
@@ -116,7 +116,7 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags, · 64 unmodified lines
116116 unsigned long stack, sp;
117117 int pid, status, err;
118118
119− stack = alloc_stack(__cant_sleep());
119+ stack = alloc_stack(0, __cant_sleep());
120120 if (stack == 0)
121121 return -ENOMEM;
122122
arch/um/os-Linux/time.c+14−1
@@ -104,5 +104,18 @@ long long os_nsecs(void) · 103 unmodified lines
104104 */
105105 void os_idle_sleep(void)
106106 {
107− pause();
107+ struct itimerspec its;
108+ sigset_t set, old;
109+
110+ /* block SIGALRM while we analyze the timer state */
111+ sigemptyset(&set);
112+ sigaddset(&set, SIGALRM);
113+ sigprocmask(SIG_BLOCK, &set, &old);
114+
115+ /* check the timer, and if it'll fire then wait for it */
116+ timer_gettime(event_high_res_timer, &its);
117+ if (its.it_value.tv_sec || its.it_value.tv_nsec)
118+ sigsuspend(&old);
119+ /* either way, restore the signal mask */
120+ sigprocmask(SIG_UNBLOCK, &set, NULL);
108121 }
arch/x86/Kconfig+1−0
@@ -19,6 +19,7 @@ config X86_32 · 18 unmodified lines
1919 select KMAP_LOCAL
2020 select MODULES_USE_ELF_REL
2121 select OLD_SIGACTION
22+ select ARCH_SPLIT_ARG64
2223
2324 config X86_64
2425 def_bool y
arch/x86/Makefile+3−0
@@ -50,6 +50,9 @@ export BITS · 49 unmodified lines
5050 KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
5151 KBUILD_CFLAGS += $(call cc-option,-mno-avx,)
5252
53+# Intel CET isn't enabled in the kernel
54+KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
55+
5356 ifeq ($(CONFIG_X86_32),y)
5457 BITS := 32
5558 UTS_MACHINE := i386
arch/x86/entry/common.c+7−3
@@ -73,10 +73,8 @@ static __always_inline void do_syscall_32_irqs_on(struct pt_regs *regs, · 72 unmodified lines
7373 unsigned int nr)
7474 {
7575 if (likely(nr < IA32_NR_syscalls)) {
76− instrumentation_begin();
7776 nr = array_index_nospec(nr, IA32_NR_syscalls);
7877 regs->ax = ia32_sys_call_table[nr](regs);
79− instrumentation_end();
8078 }
8179 }
8280
@@ -91,8 +89,11 @@ __visible noinstr void do_int80_syscall_32(struct pt_regs *regs) · 8 unmodified lines
9189 * or may not be necessary, but it matches the old asm behavior.
9290 */
9391 nr = (unsigned int)syscall_enter_from_user_mode(regs, nr);
92+ instrumentation_begin();
9493
9594 do_syscall_32_irqs_on(regs, nr);
95+
96+ instrumentation_end();
9697 syscall_exit_to_user_mode(regs);
9798 }
9899
@@ -121,11 +122,12 @@ static noinstr bool __do_fast_syscall_32(struct pt_regs *regs) · 22 unmodified lines
121122 res = get_user(*(u32 *)&regs->bp,
122123 (u32 __user __force *)(unsigned long)(u32)regs->sp);
123124 }
124− instrumentation_end();
125125
126126 if (res) {
127127 /* User code screwed up. */
128128 regs->ax = -EFAULT;
129+
130+ instrumentation_end();
129131 syscall_exit_to_user_mode(regs);
130132 return false;
131133 }
@@ -135,6 +137,8 @@ static noinstr bool __do_fast_syscall_32(struct pt_regs *regs) · 3 unmodified lines
135137
136138 /* Now this is just like a normal syscall. */
137139 do_syscall_32_irqs_on(regs, nr);
140+
141+ instrumentation_end();
138142 syscall_exit_to_user_mode(regs);
139143 return true;
140144 }
arch/x86/entry/thunk_64.S+5−10
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 #include <asm/export.h>
1111
1212 /* rdi: arg1 ... normal C conventions. rax is saved/restored. */
13− .macro THUNK name, func, put_ret_addr_in_rdi=0
13+ .macro THUNK name, func
1414 SYM_FUNC_START_NOALIGN(\name)
1515 pushq %rbp
1616 movq %rsp, %rbp
@@ -25,13 +25,8 @@ SYM_FUNC_START_NOALIGN(\name) · 8 unmodified lines
2525 pushq %r10
2626 pushq %r11
2727
28− .if \put_ret_addr_in_rdi
29− /* 8(%rbp) is return addr on stack */
30− movq 8(%rbp), %rdi
31− .endif
32−
3328 call \func
34− jmp .L_restore
29+ jmp __thunk_restore
3530 SYM_FUNC_END(\name)
3631 _ASM_NOKPROBE(\name)
3732 .endm
@@ -44,7 +39,7 @@ SYM_FUNC_END(\name) · 6 unmodified lines
4439 #endif
4540
4641 #ifdef CONFIG_PREEMPTION
47−SYM_CODE_START_LOCAL_NOALIGN(.L_restore)
42+SYM_CODE_START_LOCAL_NOALIGN(__thunk_restore)
4843 popq %r11
4944 popq %r10
5045 popq %r9
@@ -56,6 +51,6 @@ SYM_CODE_START_LOCAL_NOALIGN(.L_restore) · 5 unmodified lines
5651 popq %rdi
5752 popq %rbp
5853 ret
59− _ASM_NOKPROBE(.L_restore)
60−SYM_CODE_END(.L_restore)
54+ _ASM_NOKPROBE(__thunk_restore)
55+SYM_CODE_END(__thunk_restore)
6156 #endif
arch/x86/hyperv/hv_init.c+30−3
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <asm/hyperv-tlfs.h>
1717 #include <asm/mshyperv.h>
1818 #include <asm/idtentry.h>
19+#include <linux/kexec.h>
1920 #include <linux/version.h>
2021 #include <linux/vmalloc.h>
2122 #include <linux/mm.h>
@@ -26,6 +27,8 @@ · 4 unmodified lines
2627 #include <linux/syscore_ops.h>
2728 #include <clocksource/hyperv_timer.h>
2829
30+int hyperv_init_cpuhp;
31+
2932 void *hv_hypercall_pg;
3033 EXPORT_SYMBOL_GPL(hv_hypercall_pg);
3134
@@ -312,6 +315,25 @@ static struct syscore_ops hv_syscore_ops = { · 280 unmodified lines
312315 .resume = hv_resume,
313316 };
314317
318+static void (* __initdata old_setup_percpu_clockev)(void);
319+
320+static void __init hv_stimer_setup_percpu_clockev(void)
321+{
322+ /*
323+ * Ignore any errors in setting up stimer clockevents
324+ * as we can run with the LAPIC timer as a fallback.
325+ */
326+ (void)hv_stimer_alloc();
327+
328+ /*
329+ * Still register the LAPIC timer, because the direct-mode STIMER is
330+ * not supported by old versions of Hyper-V. This also allows users
331+ * to switch to LAPIC timer via /sys, if they want to.
332+ */
333+ if (old_setup_percpu_clockev)
334+ old_setup_percpu_clockev();
335+}
336+
315337 /*
316338 * This function is to be invoked early in the boot sequence after the
317339 * hypervisor has been detected.
@@ -390,10 +412,14 @@ void __init hyperv_init(void) · 72 unmodified lines
390412 wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
391413
392414 /*
393− * Ignore any errors in setting up stimer clockevents
394− * as we can run with the LAPIC timer as a fallback.
415+ * hyperv_init() is called before LAPIC is initialized: see
416+ * apic_intr_mode_init() -> x86_platform.apic_post_init() and
417+ * apic_bsp_setup() -> setup_local_APIC(). The direct-mode STIMER
418+ * depends on LAPIC, so hv_stimer_alloc() should be called from
419+ * x86_init.timers.setup_percpu_clockev.
395420 */
396− (void)hv_stimer_alloc();
421+ old_setup_percpu_clockev = x86_init.timers.setup_percpu_clockev;
422+ x86_init.timers.setup_percpu_clockev = hv_stimer_setup_percpu_clockev;
397423
398424 hv_apic_init();
399425
@@ -401,6 +427,7 @@ void __init hyperv_init(void) · 1 unmodified line
401427
402428 register_syscore_ops(&hv_syscore_ops);
403429
430+ hyperv_init_cpuhp = cpuhp;
404431 return;
405432
406433 remove_cpuhp_state:
arch/x86/hyperv/mmu.c+9−3
@@ -66,11 +66,17 @@ static void hyperv_flush_tlb_others(const struct cpumask *cpus, · 65 unmodified lines
6666 if (!hv_hypercall_pg)
6767 goto do_native;
6868
69− if (cpumask_empty(cpus))
70− return;
71−
7269 local_irq_save(flags);
7370
71+ /*
72+ * Only check the mask _after_ interrupt has been disabled to avoid the
73+ * mask changing under our feet.
74+ */
75+ if (cpumask_empty(cpus)) {
76+ local_irq_restore(flags);
77+ return;
78+ }
79+
7480 flush_pcpu = (struct hv_tlb_flush **)
7581 this_cpu_ptr(hyperv_pcpu_input_arg);
7682
arch/x86/include/asm/apic.h+0−10
@@ -197,16 +197,6 @@ static inline bool apic_needs_pit(void) { return true; } · 196 unmodified lines
197197 #endif /* !CONFIG_X86_LOCAL_APIC */
198198
199199 #ifdef CONFIG_X86_X2APIC
200−/*
201− * Make previous memory operations globally visible before
202− * sending the IPI through x2apic wrmsr. We need a serializing instruction or
203− * mfence for this.
204− */
205−static inline void x2apic_wrmsr_fence(void)
206−{
207− asm volatile("mfence" : : : "memory");
208−}
209−
210200 static inline void native_apic_msr_write(u32 reg, u32 v)
211201 {
212202 if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR ||
arch/x86/include/asm/barrier.h+18−0
@@ -84,4 +84,22 @@ do { \ · 83 unmodified lines
8484
8585 #include <asm-generic/barrier.h>
8686
87+/*
88+ * Make previous memory operations globally visible before
89+ * a WRMSR.
90+ *
91+ * MFENCE makes writes visible, but only affects load/store
92+ * instructions. WRMSR is unfortunately not a load/store
93+ * instruction and is unaffected by MFENCE. The LFENCE ensures
94+ * that the WRMSR is not reordered.
95+ *
96+ * Most WRMSRs are full serializing instructions themselves and
97+ * do not require this barrier. This is only required for the
98+ * IA32_TSC_DEADLINE and X2APIC MSRs.
99+ */
100+static inline void weak_wrmsr_fence(void)
101+{
102+ asm volatile("mfence; lfence" : : : "memory");
103+}
104+
87105 #endif /* _ASM_X86_BARRIER_H */
arch/x86/include/asm/entry-common.h+0−2
@@ -43,8 +43,6 @@ static __always_inline void arch_check_user_regs(struct pt_regs *regs) · 42 unmodified lines
4343 }
4444 #define arch_check_user_regs arch_check_user_regs
4545
46−#define ARCH_SYSCALL_EXIT_WORK (_TIF_SINGLESTEP)
47−
4846 static inline void arch_exit_to_user_mode_prepare(struct pt_regs *regs,
4947 unsigned long ti_work)
5048 {
arch/x86/include/asm/fpu/api.h+13−2
@@ -16,14 +16,25 @@ · 15 unmodified lines
1616 * Use kernel_fpu_begin/end() if you intend to use FPU in kernel context. It
1717 * disables preemption so be careful if you intend to use it for long periods
1818 * of time.
19− * If you intend to use the FPU in softirq you need to check first with
19+ * If you intend to use the FPU in irq/softirq you need to check first with
2020 * irq_fpu_usable() if it is possible.
2121 */
22−extern void kernel_fpu_begin(void);
22+
23+/* Kernel FPU states to initialize in kernel_fpu_begin_mask() */
24+#define KFPU_387 _BITUL(0) /* 387 state will be initialized */
25+#define KFPU_MXCSR _BITUL(1) /* MXCSR will be initialized */
26+
27+extern void kernel_fpu_begin_mask(unsigned int kfpu_mask);
2328 extern void kernel_fpu_end(void);
2429 extern bool irq_fpu_usable(void);
2530 extern void fpregs_mark_activate(void);
2631
32+/* Code that is unaware of kernel_fpu_begin_mask() can use this */
33+static inline void kernel_fpu_begin(void)
34+{
35+ kernel_fpu_begin_mask(KFPU_387 | KFPU_MXCSR);
36+}
37+
2738 /*
2839 * Use fpregs_lock() while editing CPU's FPU registers or fpu->state.
2940 * A context switch will (and softirq might) save CPU's FPU registers to
arch/x86/include/asm/idtentry.h+1−0
@@ -613,6 +613,7 @@ DECLARE_IDTENTRY_VC(X86_TRAP_VC, exc_vmm_communication); · 612 unmodified lines
613613
614614 #ifdef CONFIG_XEN_PV
615615 DECLARE_IDTENTRY_XENCB(X86_TRAP_OTHER, exc_xen_hypervisor_callback);
616+DECLARE_IDTENTRY_RAW(X86_TRAP_OTHER, exc_xen_unknown_trap);
616617 #endif
617618
618619 /* Device interrupts common/spurious */
arch/x86/include/asm/intel-family.h+1−0
@@ -97,6 +97,7 @@ · 96 unmodified lines
9797
9898 #define INTEL_FAM6_LAKEFIELD 0x8A
9999 #define INTEL_FAM6_ALDERLAKE 0x97
100+#define INTEL_FAM6_ALDERLAKE_L 0x9A
100101
101102 /* "Small Core" Processors (Atom) */
102103
arch/x86/include/asm/kvm_host.h+17−2
@@ -1010,9 +1010,21 @@ struct kvm_arch { · 1009 unmodified lines
10101010 */
10111011 bool tdp_mmu_enabled;
10121012
1013− /* List of struct tdp_mmu_pages being used as roots */
1013+ /*
1014+ * List of struct kvmp_mmu_pages being used as roots.
1015+ * All struct kvm_mmu_pages in the list should have
1016+ * tdp_mmu_page set.
1017+ * All struct kvm_mmu_pages in the list should have a positive
1018+ * root_count except when a thread holds the MMU lock and is removing
1019+ * an entry from the list.
1020+ */
10141021 struct list_head tdp_mmu_roots;
1015− /* List of struct tdp_mmu_pages not being used as roots */
1022+
1023+ /*
1024+ * List of struct kvmp_mmu_pages not being used as roots.
1025+ * All struct kvm_mmu_pages in the list should have
1026+ * tdp_mmu_page set and a root_count of 0.
1027+ */
10161028 struct list_head tdp_mmu_pages;
10171029 };
10181030
@@ -1287,6 +1299,8 @@ struct kvm_x86_ops { · 268 unmodified lines
12871299 void (*migrate_timers)(struct kvm_vcpu *vcpu);
12881300 void (*msr_filter_changed)(struct kvm_vcpu *vcpu);
12891301 int (*complete_emulated_msr)(struct kvm_vcpu *vcpu, int err);
1302+
1303+ void (*vcpu_deliver_sipi_vector)(struct kvm_vcpu *vcpu, u8 vector);
12901304 };
12911305
12921306 struct kvm_x86_nested_ops {
@@ -1468,6 +1482,7 @@ int kvm_fast_pio(struct kvm_vcpu *vcpu, int size, unsigned short port, int in); · 175 unmodified lines
14681482 int kvm_emulate_cpuid(struct kvm_vcpu *vcpu);
14691483 int kvm_emulate_halt(struct kvm_vcpu *vcpu);
14701484 int kvm_vcpu_halt(struct kvm_vcpu *vcpu);
1485+int kvm_emulate_ap_reset_hold(struct kvm_vcpu *vcpu);
14711486 int kvm_emulate_wbinvd(struct kvm_vcpu *vcpu);
14721487
14731488 void kvm_get_segment(struct kvm_vcpu *vcpu, struct kvm_segment *var, int seg);
arch/x86/include/asm/mshyperv.h+2−0
@@ -74,6 +74,8 @@ static inline void hv_disable_stimer0_percpu_irq(int irq) {} · 73 unmodified lines
7474
7575
7676 #if IS_ENABLED(CONFIG_HYPERV)
77+extern int hyperv_init_cpuhp;
78+
7779 extern void *hv_hypercall_pg;
7880 extern void __percpu **hyperv_pcpu_input_arg;
7981
arch/x86/include/asm/msr.h+2−2
@@ -86,7 +86,7 @@ static inline void do_trace_rdpmc(unsigned int msr, u64 val, int failed) {} · 85 unmodified lines
8686 * think of extending them - you will be slapped with a stinking trout or a frozen
8787 * shark will reach you, wherever you are! You've been warned.
8888 */
89−static inline unsigned long long notrace __rdmsr(unsigned int msr)
89+static __always_inline unsigned long long __rdmsr(unsigned int msr)
9090 {
9191 DECLARE_ARGS(val, low, high);
9292
@@ -98,7 +98,7 @@ static inline unsigned long long notrace __rdmsr(unsigned int msr) · 5 unmodified lines
9898 return EAX_EDX_VAL(val, low, high);
9999 }
100100
101−static inline void notrace __wrmsr(unsigned int msr, u32 low, u32 high)
101+static __always_inline void __wrmsr(unsigned int msr, u32 low, u32 high)
102102 {
103103 asm volatile("1: wrmsr\n"
104104 "2:\n"
arch/x86/include/asm/topology.h+2−2
@@ -110,6 +110,8 @@ extern const struct cpumask *cpu_coregroup_mask(int cpu); · 109 unmodified lines
110110 #define topology_die_id(cpu) (cpu_data(cpu).cpu_die_id)
111111 #define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id)
112112
113+extern unsigned int __max_die_per_package;
114+
113115 #ifdef CONFIG_SMP
114116 #define topology_die_cpumask(cpu) (per_cpu(cpu_die_map, cpu))
115117 #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu))
@@ -118,8 +120,6 @@ extern const struct cpumask *cpu_coregroup_mask(int cpu); · 2 unmodified lines
118120 extern unsigned int __max_logical_packages;
119121 #define topology_max_packages() (__max_logical_packages)
120122
121−extern unsigned int __max_die_per_package;
122−
123123 static inline int topology_max_die_per_package(void)
124124 {
125125 return __max_die_per_package;
arch/x86/kernel/apic/apic.c+4−0
@@ -41,6 +41,7 @@ · 40 unmodified lines
4141 #include <asm/perf_event.h>
4242 #include <asm/x86_init.h>
4343 #include <linux/atomic.h>
44+#include <asm/barrier.h>
4445 #include <asm/mpspec.h>
4546 #include <asm/i8259.h>
4647 #include <asm/proto.h>
@@ -477,6 +478,9 @@ static int lapic_next_deadline(unsigned long delta, · 430 unmodified lines
477478 {
478479 u64 tsc;
479480
481+ /* This MSR is special and need a special fence: */
482+ weak_wrmsr_fence();
483+
480484 tsc = rdtsc();
481485 wrmsrl(MSR_IA32_TSC_DEADLINE, tsc + (((u64) delta) * TSC_DIVISOR));
482486 return 0;
arch/x86/kernel/apic/x2apic_cluster.c+4−2
@@ -29,7 +29,8 @@ static void x2apic_send_IPI(int cpu, int vector) · 28 unmodified lines
2929 {
3030 u32 dest = per_cpu(x86_cpu_to_logical_apicid, cpu);
3131
32− x2apic_wrmsr_fence();
32+ /* x2apic MSRs are special and need a special fence: */
33+ weak_wrmsr_fence();
3334 __x2apic_send_IPI_dest(dest, vector, APIC_DEST_LOGICAL);
3435 }
3536
@@ -41,7 +42,8 @@ __x2apic_send_IPI_mask(const struct cpumask *mask, int vector, int apic_dest) · 5 unmodified lines
4142 unsigned long flags;
4243 u32 dest;
4344
44− x2apic_wrmsr_fence();
45+ /* x2apic MSRs are special and need a special fence: */
46+ weak_wrmsr_fence();
4547 local_irq_save(flags);
4648
4749 tmpmsk = this_cpu_cpumask_var_ptr(ipi_mask);
arch/x86/kernel/apic/x2apic_phys.c+6−3
@@ -43,7 +43,8 @@ static void x2apic_send_IPI(int cpu, int vector) · 42 unmodified lines
4343 {
4444 u32 dest = per_cpu(x86_cpu_to_apicid, cpu);
4545
46− x2apic_wrmsr_fence();
46+ /* x2apic MSRs are special and need a special fence: */
47+ weak_wrmsr_fence();
4748 __x2apic_send_IPI_dest(dest, vector, APIC_DEST_PHYSICAL);
4849 }
4950
@@ -54,7 +55,8 @@ __x2apic_send_IPI_mask(const struct cpumask *mask, int vector, int apic_dest) · 4 unmodified lines
5455 unsigned long this_cpu;
5556 unsigned long flags;
5657
57− x2apic_wrmsr_fence();
58+ /* x2apic MSRs are special and need a special fence: */
59+ weak_wrmsr_fence();
5860
5961 local_irq_save(flags);
6062
@@ -125,7 +127,8 @@ void __x2apic_send_IPI_shorthand(int vector, u32 which) · 64 unmodified lines
125127 {
126128 unsigned long cfg = __prepare_ICR(which, vector, 0);
127129
128− x2apic_wrmsr_fence();
130+ /* x2apic MSRs are special and need a special fence: */
131+ weak_wrmsr_fence();
129132 native_x2apic_icr_write(cfg, 0);
130133 }
131134
arch/x86/kernel/cpu/amd.c+2−2
@@ -542,12 +542,12 @@ static void bsp_init_amd(struct cpuinfo_x86 *c) · 541 unmodified lines
542542 u32 ecx;
543543
544544 ecx = cpuid_ecx(0x8000001e);
545− nodes_per_socket = ((ecx >> 8) & 7) + 1;
545+ __max_die_per_package = nodes_per_socket = ((ecx >> 8) & 7) + 1;
546546 } else if (boot_cpu_has(X86_FEATURE_NODEID_MSR)) {
547547 u64 value;
548548
549549 rdmsrl(MSR_FAM10H_NODE_ID, value);
550− nodes_per_socket = ((value >> 3) & 7) + 1;
550+ __max_die_per_package = nodes_per_socket = ((value >> 3) & 7) + 1;
551551 }
552552
553553 if (!boot_cpu_has(X86_FEATURE_AMD_SSBD) &&
arch/x86/kernel/cpu/intel.c+1−0
@@ -1159,6 +1159,7 @@ static const struct x86_cpu_id split_lock_cpu_ids[] __initconst = { · 1158 unmodified lines
11591159 X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE, 1),
11601160 X86_MATCH_INTEL_FAM6_MODEL(SAPPHIRERAPIDS_X, 1),
11611161 X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE, 1),
1162+ X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_L, 1),
11621163 {}
11631164 };
11641165
arch/x86/kernel/cpu/mce/core.c+4−3
@@ -1992,10 +1992,9 @@ static __always_inline void exc_machine_check_kernel(struct pt_regs *regs) · 1991 unmodified lines
19921992 * that out because it's an indirect call. Annotate it.
19931993 */
19941994 instrumentation_begin();
1995− trace_hardirqs_off_finish();
1995+
19961996 machine_check_vector(regs);
1997− if (regs->flags & X86_EFLAGS_IF)
1998− trace_hardirqs_on_prepare();
1997+
19991998 instrumentation_end();
20001999 irqentry_nmi_exit(regs, irq_state);
20012000 }
@@ -2004,7 +2003,9 @@ static __always_inline void exc_machine_check_user(struct pt_regs *regs) · 2 unmodified lines
20042003 {
20052004 irqentry_enter_from_user_mode(regs);
20062005 instrumentation_begin();
2006+
20072007 machine_check_vector(regs);
2008+
20082009 instrumentation_end();
20092010 irqentry_exit_to_user_mode(regs);
20102011 }
arch/x86/kernel/cpu/mshyperv.c+18−0
@@ -135,14 +135,32 @@ static void hv_machine_shutdown(void) · 134 unmodified lines
135135 {
136136 if (kexec_in_progress && hv_kexec_handler)
137137 hv_kexec_handler();
138+
139+ /*
140+ * Call hv_cpu_die() on all the CPUs, otherwise later the hypervisor
141+ * corrupts the old VP Assist Pages and can crash the kexec kernel.
142+ */
143+ if (kexec_in_progress && hyperv_init_cpuhp > 0)
144+ cpuhp_remove_state(hyperv_init_cpuhp);
145+
146+ /* The function calls stop_other_cpus(). */
138147 native_machine_shutdown();
148+
149+ /* Disable the hypercall page when there is only 1 active CPU. */
150+ if (kexec_in_progress)
151+ hyperv_cleanup();
139152 }
140153
141154 static void hv_machine_crash_shutdown(struct pt_regs *regs)
142155 {
143156 if (hv_crash_handler)
144157 hv_crash_handler(regs);
158+
159+ /* The function calls crash_smp_send_stop(). */
145160 native_machine_crash_shutdown(regs);
161+
162+ /* Disable the hypercall page when there is only 1 active CPU. */
163+ hyperv_cleanup();
146164 }
147165 #endif /* CONFIG_KEXEC_CORE */
148166 #endif /* CONFIG_HYPERV */
arch/x86/kernel/cpu/mtrr/generic.c+3−3
@@ -167,9 +167,6 @@ static u8 mtrr_type_lookup_variable(u64 start, u64 end, u64 *partial_end, · 166 unmodified lines
167167 *repeat = 0;
168168 *uniform = 1;
169169
170− /* Make end inclusive instead of exclusive */
171− end--;
172−
173170 prev_match = MTRR_TYPE_INVALID;
174171 for (i = 0; i < num_var_ranges; ++i) {
175172 unsigned short start_state, end_state, inclusive;
@@ -261,6 +258,9 @@ u8 mtrr_type_lookup(u64 start, u64 end, u8 *uniform) · 85 unmodified lines
261258 int repeat;
262259 u64 partial_end;
263260
261+ /* Make end inclusive instead of exclusive */
262+ end--;
263+
264264 if (!mtrr_state_set)
265265 return MTRR_TYPE_INVALID;
266266
arch/x86/kernel/cpu/resctrl/rdtgroup.c+49−68
@@ -525,89 +525,70 @@ static void rdtgroup_remove(struct rdtgroup *rdtgrp) · 524 unmodified lines
525525 kfree(rdtgrp);
526526 }
527527
528−struct task_move_callback {
529− struct callback_head work;
530− struct rdtgroup *rdtgrp;
531−};
532−
533−static void move_myself(struct callback_head *head)
528+static void _update_task_closid_rmid(void *task)
534529 {
535− struct task_move_callback *callback;
536− struct rdtgroup *rdtgrp;
537−
538− callback = container_of(head, struct task_move_callback, work);
539− rdtgrp = callback->rdtgrp;
540−
541530 /*
542− * If resource group was deleted before this task work callback
543− * was invoked, then assign the task to root group and free the
544− * resource group.
531+ * If the task is still current on this CPU, update PQR_ASSOC MSR.
532+ * Otherwise, the MSR is updated when the task is scheduled in.
545533 */
546− if (atomic_dec_and_test(&rdtgrp->waitcount) &&
547− (rdtgrp->flags & RDT_DELETED)) {
548− current->closid = 0;
549− current->rmid = 0;
550− rdtgroup_remove(rdtgrp);
551− }
552−
553− if (unlikely(current->flags & PF_EXITING))
554− goto out;
555−
556− preempt_disable();
557− /* update PQR_ASSOC MSR to make resource group go into effect */
558− resctrl_sched_in();
559− preempt_enable();
534+ if (task == current)
535+ resctrl_sched_in();
536+}
560537
561−out:
562− kfree(callback);
538+static void update_task_closid_rmid(struct task_struct *t)
539+{
540+ if (IS_ENABLED(CONFIG_SMP) && task_curr(t))
541+ smp_call_function_single(task_cpu(t), _update_task_closid_rmid, t, 1);
542+ else
543+ _update_task_closid_rmid(t);
563544 }
564545
565546 static int __rdtgroup_move_task(struct task_struct *tsk,
566547 struct rdtgroup *rdtgrp)
567548 {
568− struct task_move_callback *callback;
569− int ret;
570−
571− callback = kzalloc(sizeof(*callback), GFP_KERNEL);
572− if (!callback)
573− return -ENOMEM;
574− callback->work.func = move_myself;
575− callback->rdtgrp = rdtgrp;
549+ /* If the task is already in rdtgrp, no need to move the task. */
550+ if ((rdtgrp->type == RDTCTRL_GROUP && tsk->closid == rdtgrp->closid &&
551+ tsk->rmid == rdtgrp->mon.rmid) ||
552+ (rdtgrp->type == RDTMON_GROUP && tsk->rmid == rdtgrp->mon.rmid &&
553+ tsk->closid == rdtgrp->mon.parent->closid))
554+ return 0;
576555
577556 /*
578− * Take a refcount, so rdtgrp cannot be freed before the
579− * callback has been invoked.
557+ * Set the task's closid/rmid before the PQR_ASSOC MSR can be
558+ * updated by them.
559+ *
560+ * For ctrl_mon groups, move both closid and rmid.
561+ * For monitor groups, can move the tasks only from
562+ * their parent CTRL group.
580563 */
581− atomic_inc(&rdtgrp->waitcount);
582− ret = task_work_add(tsk, &callback->work, TWA_RESUME);
583− if (ret) {
584− /*
585− * Task is exiting. Drop the refcount and free the callback.
586− * No need to check the refcount as the group cannot be
587− * deleted before the write function unlocks rdtgroup_mutex.
588− */
589− atomic_dec(&rdtgrp->waitcount);
590− kfree(callback);
591− rdt_last_cmd_puts("Task exited\n");
592− } else {
593− /*
594− * For ctrl_mon groups move both closid and rmid.
595− * For monitor groups, can move the tasks only from
596− * their parent CTRL group.
597− */
598− if (rdtgrp->type == RDTCTRL_GROUP) {
599− tsk->closid = rdtgrp->closid;
564+
565+ if (rdtgrp->type == RDTCTRL_GROUP) {
566+ tsk->closid = rdtgrp->closid;
567+ tsk->rmid = rdtgrp->mon.rmid;
568+ } else if (rdtgrp->type == RDTMON_GROUP) {
569+ if (rdtgrp->mon.parent->closid == tsk->closid) {
600570 tsk->rmid = rdtgrp->mon.rmid;
601− } else if (rdtgrp->type == RDTMON_GROUP) {
602− if (rdtgrp->mon.parent->closid == tsk->closid) {
603− tsk->rmid = rdtgrp->mon.rmid;
604− } else {
605− rdt_last_cmd_puts("Can't move task to different control group\n");
606− ret = -EINVAL;
607− }
571+ } else {
572+ rdt_last_cmd_puts("Can't move task to different control group\n");
573+ return -EINVAL;
608574 }
609575 }
610− return ret;
576+
577+ /*
578+ * Ensure the task's closid and rmid are written before determining if
579+ * the task is current that will decide if it will be interrupted.
580+ */
581+ barrier();
582+
583+ /*
584+ * By now, the task's closid and rmid are set. If the task is current
585+ * on a CPU, the PQR_ASSOC MSR needs to be updated to make the resource
586+ * group go into effect. If the task is not current, the MSR will be
587+ * updated when the task is scheduled in.
588+ */
589+ update_task_closid_rmid(tsk);
590+
591+ return 0;
611592 }
612593
613594 static bool is_closid_match(struct task_struct *t, struct rdtgroup *r)
arch/x86/kernel/cpu/sgx/driver.c+3−0
@@ -72,6 +72,9 @@ static int sgx_release(struct inode *inode, struct file *file) · 71 unmodified lines
7272 synchronize_srcu(&encl->srcu);
7373 mmu_notifier_unregister(&encl_mm->mmu_notifier, encl_mm->mm);
7474 kfree(encl_mm);
75+
76+ /* 'encl_mm' is gone, put encl_mm->encl reference: */
77+ kref_put(&encl->refcount, sgx_encl_release);
7578 }
7679
7780 kref_put(&encl->refcount, sgx_encl_release);
arch/x86/kernel/cpu/sgx/encl.c+5−0
@@ -481,6 +481,9 @@ static void sgx_mmu_notifier_free(struct mmu_notifier *mn) · 480 unmodified lines
481481 {
482482 struct sgx_encl_mm *encl_mm = container_of(mn, struct sgx_encl_mm, mmu_notifier);
483483
484+ /* 'encl_mm' is going away, put encl_mm->encl reference: */
485+ kref_put(&encl_mm->encl->refcount, sgx_encl_release);
486+
484487 kfree(encl_mm);
485488 }
486489
@@ -534,6 +537,8 @@ int sgx_encl_mm_add(struct sgx_encl *encl, struct mm_struct *mm) · 47 unmodified lines
534537 if (!encl_mm)
535538 return -ENOMEM;
536539
540+ /* Grab a refcount for the encl_mm->encl reference: */
541+ kref_get(&encl->refcount);
537542 encl_mm->encl = encl;
538543 encl_mm->mm = mm;
539544 encl_mm->mmu_notifier.ops = &sgx_mmu_notifier_ops;
arch/x86/kernel/cpu/topology.c+1−1
@@ -25,10 +25,10 @@ · 24 unmodified lines
2525 #define BITS_SHIFT_NEXT_LEVEL(eax) ((eax) & 0x1f)
2626 #define LEVEL_MAX_SIBLINGS(ebx) ((ebx) & 0xffff)
2727
28−#ifdef CONFIG_SMP
2928 unsigned int __max_die_per_package __read_mostly = 1;
3029 EXPORT_SYMBOL(__max_die_per_package);
3130
31+#ifdef CONFIG_SMP
3232 /*
3333 * Check if given CPUID extended toplogy "leaf" is implemented
3434 */
arch/x86/kernel/fpu/core.c+5−4
@@ -121,7 +121,7 @@ int copy_fpregs_to_fpstate(struct fpu *fpu) · 120 unmodified lines
121121 }
122122 EXPORT_SYMBOL(copy_fpregs_to_fpstate);
123123
124−void kernel_fpu_begin(void)
124+void kernel_fpu_begin_mask(unsigned int kfpu_mask)
125125 {
126126 preempt_disable();
127127
@@ -141,13 +141,14 @@ void kernel_fpu_begin(void) · 13 unmodified lines
141141 }
142142 __cpu_invalidate_fpregs_state();
143143
144− if (boot_cpu_has(X86_FEATURE_XMM))
144+ /* Put sane initial values into the control registers. */
145+ if (likely(kfpu_mask & KFPU_MXCSR) && boot_cpu_has(X86_FEATURE_XMM))
145146 ldmxcsr(MXCSR_DEFAULT);
146147
147− if (boot_cpu_has(X86_FEATURE_FPU))
148+ if (unlikely(kfpu_mask & KFPU_387) && boot_cpu_has(X86_FEATURE_FPU))
148149 asm volatile ("fninit");
149150 }
150−EXPORT_SYMBOL_GPL(kernel_fpu_begin);
151+EXPORT_SYMBOL_GPL(kernel_fpu_begin_mask);
151152
152153 void kernel_fpu_end(void)
153154 {
arch/x86/kernel/hw_breakpoint.c+40−21
@@ -269,6 +269,20 @@ static inline bool within_cpu_entry(unsigned long addr, unsigned long end) · 268 unmodified lines
269269 CPU_ENTRY_AREA_TOTAL_SIZE))
270270 return true;
271271
272+ /*
273+ * When FSGSBASE is enabled, paranoid_entry() fetches the per-CPU
274+ * GSBASE value via __per_cpu_offset or pcpu_unit_offsets.
275+ */
276+#ifdef CONFIG_SMP
277+ if (within_area(addr, end, (unsigned long)__per_cpu_offset,
278+ sizeof(unsigned long) * nr_cpu_ids))
279+ return true;
280+#else
281+ if (within_area(addr, end, (unsigned long)&pcpu_unit_offsets,
282+ sizeof(pcpu_unit_offsets)))
283+ return true;
284+#endif
285+
272286 for_each_possible_cpu(cpu) {
273287 /* The original rw GDT is being used after load_direct_gdt() */
274288 if (within_area(addr, end, (unsigned long)get_cpu_gdt_rw(cpu),
@@ -293,6 +307,14 @@ static inline bool within_cpu_entry(unsigned long addr, unsigned long end) · 18 unmodified lines
293307 (unsigned long)&per_cpu(cpu_tlbstate, cpu),
294308 sizeof(struct tlb_state)))
295309 return true;
310+
311+ /*
312+ * When in guest (X86_FEATURE_HYPERVISOR), local_db_save()
313+ * will read per-cpu cpu_dr7 before clear dr7 register.
314+ */
315+ if (within_area(addr, end, (unsigned long)&per_cpu(cpu_dr7, cpu),
316+ sizeof(cpu_dr7)))
317+ return true;
296318 }
297319
298320 return false;
@@ -491,15 +513,12 @@ static int hw_breakpoint_handler(struct die_args *args) · 192 unmodified lines
491513 struct perf_event *bp;
492514 unsigned long *dr6_p;
493515 unsigned long dr6;
516+ bool bpx;
494517
495518 /* The DR6 value is pointed by args->err */
496519 dr6_p = (unsigned long *)ERR_PTR(args->err);
497520 dr6 = *dr6_p;
498521
499− /* If it's a single step, TRAP bits are random */
500− if (dr6 & DR_STEP)
501− return NOTIFY_DONE;
502−
503522 /* Do an early return if no trap bits are set in DR6 */
504523 if ((dr6 & DR_TRAP_BITS) == 0)
505524 return NOTIFY_DONE;
@@ -509,28 +528,29 @@ static int hw_breakpoint_handler(struct die_args *args) · 3 unmodified lines
509528 if (likely(!(dr6 & (DR_TRAP0 << i))))
510529 continue;
511530
531+ bp = this_cpu_read(bp_per_reg[i]);
532+ if (!bp)
533+ continue;
534+
535+ bpx = bp->hw.info.type == X86_BREAKPOINT_EXECUTE;
536+
512537 /*
513− * The counter may be concurrently released but that can only
514− * occur from a call_rcu() path. We can then safely fetch
515− * the breakpoint, use its callback, touch its counter
516− * while we are in an rcu_read_lock() path.
538+ * TF and data breakpoints are traps and can be merged, however
539+ * instruction breakpoints are faults and will be raised
540+ * separately.
541+ *
542+ * However DR6 can indicate both TF and instruction
543+ * breakpoints. In that case take TF as that has precedence and
544+ * delay the instruction breakpoint for the next exception.
517545 */
518− rcu_read_lock();
546+ if (bpx && (dr6 & DR_STEP))
547+ continue;
519548
520− bp = this_cpu_read(bp_per_reg[i]);
521549 /*
522550 * Reset the 'i'th TRAP bit in dr6 to denote completion of
523551 * exception handling
524552 */
525553 (*dr6_p) &= ~(DR_TRAP0 << i);
526− /*
527− * bp can be NULL due to lazy debug register switching
528− * or due to concurrent perf counter removing.
529− */
530− if (!bp) {
531− rcu_read_unlock();
532− break;
533− }
534554
535555 perf_bp_event(bp, args->regs);
536556
@@ -538,11 +558,10 @@ static int hw_breakpoint_handler(struct die_args *args) · 1 unmodified line
538558 * Set up resume flag to avoid breakpoint recursion when
539559 * returning back to origin.
540560 */
541− if (bp->hw.info.type == X86_BREAKPOINT_EXECUTE)
561+ if (bpx)
542562 args->regs->flags |= X86_EFLAGS_RF;
543−
544− rcu_read_unlock();
545563 }
564+
546565 /*
547566 * Further processing in do_debug() is needed for a) user-space
548567 * breakpoints (to generate signals) and b) when the system has
arch/x86/kernel/sev-es-shared.c+2−2
@@ -305,14 +305,14 @@ static enum es_result vc_ioio_exitinfo(struct es_em_ctxt *ctxt, u64 *exitinfo) · 304 unmodified lines
305305 case 0xe4:
306306 case 0xe5:
307307 *exitinfo |= IOIO_TYPE_IN;
308− *exitinfo |= (u64)insn->immediate.value << 16;
308+ *exitinfo |= (u8)insn->immediate.value << 16;
309309 break;
310310
311311 /* OUT immediate opcodes */
312312 case 0xe6:
313313 case 0xe7:
314314 *exitinfo |= IOIO_TYPE_OUT;
315− *exitinfo |= (u64)insn->immediate.value << 16;
315+ *exitinfo |= (u8)insn->immediate.value << 16;
316316 break;
317317
318318 /* IN register opcodes */
arch/x86/kernel/sev-es.c+13−1
@@ -225,7 +225,7 @@ static inline u64 sev_es_rd_ghcb_msr(void) · 224 unmodified lines
225225 return __rdmsr(MSR_AMD64_SEV_ES_GHCB);
226226 }
227227
228−static inline void sev_es_wr_ghcb_msr(u64 val)
228+static __always_inline void sev_es_wr_ghcb_msr(u64 val)
229229 {
230230 u32 low, high;
231231
@@ -286,6 +286,12 @@ static enum es_result vc_write_mem(struct es_em_ctxt *ctxt, · 54 unmodified lines
286286 u16 d2;
287287 u8 d1;
288288
289+ /* If instruction ran in kernel mode and the I/O buffer is in kernel space */
290+ if (!user_mode(ctxt->regs) && !access_ok(target, size)) {
291+ memcpy(dst, buf, size);
292+ return ES_OK;
293+ }
294+
289295 switch (size) {
290296 case 1:
291297 memcpy(&d1, buf, 1);
@@ -335,6 +341,12 @@ static enum es_result vc_read_mem(struct es_em_ctxt *ctxt, · 43 unmodified lines
335341 u16 d2;
336342 u8 d1;
337343
344+ /* If instruction ran in kernel mode and the I/O buffer is in kernel space */
345+ if (!user_mode(ctxt->regs) && !access_ok(s, size)) {
346+ memcpy(buf, src, size);
347+ return ES_OK;
348+ }
349+
338350 switch (size) {
339351 case 1:
340352 if (get_user(d1, s))
arch/x86/kernel/smpboot.c+20−0
@@ -56,6 +56,7 @@ · 55 unmodified lines
5656 #include <linux/numa.h>
5757 #include <linux/pgtable.h>
5858 #include <linux/overflow.h>
59+#include <linux/syscore_ops.h>
5960
6061 #include <asm/acpi.h>
6162 #include <asm/desc.h>
@@ -1832,6 +1833,7 @@ void arch_set_max_freq_ratio(bool turbo_disabled) · 1770 unmodified lines
18321833 arch_max_freq_ratio = turbo_disabled ? SCHED_CAPACITY_SCALE :
18331834 arch_turbo_freq_ratio;
18341835 }
1836+EXPORT_SYMBOL_GPL(arch_set_max_freq_ratio);
18351837
18361838 static bool turbo_disabled(void)
18371839 {
@@ -2083,6 +2085,23 @@ static void init_counter_refs(void) · 245 unmodified lines
20832085 this_cpu_write(arch_prev_mperf, mperf);
20842086 }
20852087
2088+#ifdef CONFIG_PM_SLEEP
2089+static struct syscore_ops freq_invariance_syscore_ops = {
2090+ .resume = init_counter_refs,
2091+};
2092+
2093+static void register_freq_invariance_syscore_ops(void)
2094+{
2095+ /* Bail out if registered already. */
2096+ if (freq_invariance_syscore_ops.node.prev)
2097+ return;
2098+
2099+ register_syscore_ops(&freq_invariance_syscore_ops);
2100+}
2101+#else
2102+static inline void register_freq_invariance_syscore_ops(void) {}
2103+#endif
2104+
20862105 static void init_freq_invariance(bool secondary, bool cppc_ready)
20872106 {
20882107 bool ret = false;
@@ -2109,6 +2128,7 @@ static void init_freq_invariance(bool secondary, bool cppc_ready) · 20 unmodified lines
21092128 if (ret) {
21102129 init_counter_refs();
21112130 static_branch_enable(&arch_scale_freq_key);
2131+ register_freq_invariance_syscore_ops();
21122132 pr_info("Estimated ratio of average max frequency by base frequency (times 1024): %llu\n", arch_max_freq_ratio);
21132133 } else {
21142134 pr_debug("Couldn't determine max cpu frequency, necessary for scale-invariant accounting.\n");
arch/x86/kernel/step.c+8−2
@@ -127,12 +127,17 @@ static int enable_single_step(struct task_struct *child) · 126 unmodified lines
127127 regs->flags |= X86_EFLAGS_TF;
128128
129129 /*
130− * Always set TIF_SINGLESTEP - this guarantees that
131− * we single-step system calls etc.. This will also
130+ * Always set TIF_SINGLESTEP. This will also
132131 * cause us to set TF when returning to user mode.
133132 */
134133 set_tsk_thread_flag(child, TIF_SINGLESTEP);
135134
135+ /*
136+ * Ensure that a trap is triggered once stepping out of a system
137+ * call prior to executing any user instruction.
138+ */
139+ set_task_syscall_work(child, SYSCALL_EXIT_TRAP);
140+
136141 oflags = regs->flags;
137142
138143 /* Set TF on the kernel stack.. */
@@ -230,6 +235,7 @@ void user_disable_single_step(struct task_struct *child) · 91 unmodified lines
230235
231236 /* Always clear TIF_SINGLESTEP... */
232237 clear_tsk_thread_flag(child, TIF_SINGLESTEP);
238+ clear_task_syscall_work(child, SYSCALL_EXIT_TRAP);
233239
234240 /* But touch TF only if it was set by us.. */
235241 if (test_and_clear_tsk_thread_flag(child, TIF_FORCED_TF))
arch/x86/kvm/cpuid.c+1−1
@@ -321,7 +321,7 @@ int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu, · 320 unmodified lines
321321 if (cpuid->nent < vcpu->arch.cpuid_nent)
322322 goto out;
323323 r = -EFAULT;
324− if (copy_to_user(entries, &vcpu->arch.cpuid_entries,
324+ if (copy_to_user(entries, vcpu->arch.cpuid_entries,
325325 vcpu->arch.cpuid_nent * sizeof(struct kvm_cpuid_entry2)))
326326 goto out;
327327 return 0;
arch/x86/kvm/emulate.c+2−0
@@ -2879,6 +2879,8 @@ static int em_sysenter(struct x86_emulate_ctxt *ctxt) · 2878 unmodified lines
28792879 ops->get_msr(ctxt, MSR_IA32_SYSENTER_ESP, &msr_data);
28802880 *reg_write(ctxt, VCPU_REGS_RSP) = (efer & EFER_LMA) ? msr_data :
28812881 (u32)msr_data;
2882+ if (efer & EFER_LMA)
2883+ ctxt->mode = X86EMUL_MODE_PROT64;
28822884
28832885 return X86EMUL_CONTINUE;
28842886 }
arch/x86/kvm/kvm_cache_regs.h+25−26
@@ -9,31 +9,6 @@ · 8 unmodified lines
99 (X86_CR4_PVI | X86_CR4_DE | X86_CR4_PCE | X86_CR4_OSFXSR \
1010 | X86_CR4_OSXMMEXCPT | X86_CR4_PGE | X86_CR4_TSD | X86_CR4_FSGSBASE)
1111
12−static inline bool kvm_register_is_available(struct kvm_vcpu *vcpu,
13− enum kvm_reg reg)
14−{
15− return test_bit(reg, (unsigned long *)&vcpu->arch.regs_avail);
16−}
17−
18−static inline bool kvm_register_is_dirty(struct kvm_vcpu *vcpu,
19− enum kvm_reg reg)
20−{
21− return test_bit(reg, (unsigned long *)&vcpu->arch.regs_dirty);
22−}
23−
24−static inline void kvm_register_mark_available(struct kvm_vcpu *vcpu,
25− enum kvm_reg reg)
26−{
27− __set_bit(reg, (unsigned long *)&vcpu->arch.regs_avail);
28−}
29−
30−static inline void kvm_register_mark_dirty(struct kvm_vcpu *vcpu,
31− enum kvm_reg reg)
32−{
33− __set_bit(reg, (unsigned long *)&vcpu->arch.regs_avail);
34− __set_bit(reg, (unsigned long *)&vcpu->arch.regs_dirty);
35−}
36−
3712 #define BUILD_KVM_GPR_ACCESSORS(lname, uname) \
3813 static __always_inline unsigned long kvm_##lname##_read(struct kvm_vcpu *vcpu)\
3914 { \
@@ -43,7 +18,6 @@ static __always_inline void kvm_##lname##_write(struct kvm_vcpu *vcpu, \ · 3 unmodified lines
4318 unsigned long val) \
4419 { \
4520 vcpu->arch.regs[VCPU_REGS_##uname] = val; \
46− kvm_register_mark_dirty(vcpu, VCPU_REGS_##uname); \
4721 }
4822 BUILD_KVM_GPR_ACCESSORS(rax, RAX)
4923 BUILD_KVM_GPR_ACCESSORS(rbx, RBX)
@@ -63,6 +37,31 @@ BUILD_KVM_GPR_ACCESSORS(r14, R14) · 13 unmodified lines
6337 BUILD_KVM_GPR_ACCESSORS(r15, R15)
6438 #endif
6539
40+static inline bool kvm_register_is_available(struct kvm_vcpu *vcpu,
41+ enum kvm_reg reg)
42+{
43+ return test_bit(reg, (unsigned long *)&vcpu->arch.regs_avail);
44+}
45+
46+static inline bool kvm_register_is_dirty(struct kvm_vcpu *vcpu,
47+ enum kvm_reg reg)
48+{
49+ return test_bit(reg, (unsigned long *)&vcpu->arch.regs_dirty);
50+}
51+
52+static inline void kvm_register_mark_available(struct kvm_vcpu *vcpu,
53+ enum kvm_reg reg)
54+{
55+ __set_bit(reg, (unsigned long *)&vcpu->arch.regs_avail);
56+}
57+
58+static inline void kvm_register_mark_dirty(struct kvm_vcpu *vcpu,
59+ enum kvm_reg reg)
60+{
61+ __set_bit(reg, (unsigned long *)&vcpu->arch.regs_avail);
62+ __set_bit(reg, (unsigned long *)&vcpu->arch.regs_dirty);
63+}
64+
6665 static inline unsigned long kvm_register_read(struct kvm_vcpu *vcpu, int reg)
6766 {
6867 if (WARN_ON_ONCE((unsigned int)reg >= NR_VCPU_REGS))
arch/x86/kvm/lapic.c+2−2
@@ -674,7 +674,7 @@ static bool pv_eoi_get_pending(struct kvm_vcpu *vcpu) · 673 unmodified lines
674674 (unsigned long long)vcpu->arch.pv_eoi.msr_val);
675675 return false;
676676 }
677− return val & 0x1;
677+ return val & KVM_PV_EOI_ENABLED;
678678 }
679679
680680 static void pv_eoi_set_pending(struct kvm_vcpu *vcpu)
@@ -2898,7 +2898,7 @@ void kvm_apic_accept_events(struct kvm_vcpu *vcpu) · 2217 unmodified lines
28982898 /* evaluate pending_events before reading the vector */
28992899 smp_rmb();
29002900 sipi_vector = apic->sipi_vector;
2901− kvm_vcpu_deliver_sipi_vector(vcpu, sipi_vector);
2901+ kvm_x86_ops.vcpu_deliver_sipi_vector(vcpu, sipi_vector);
29022902 vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
29032903 }
29042904 }
arch/x86/kvm/mmu.h+9−2
@@ -44,12 +44,19 @@ · 43 unmodified lines
4444 #define PT32_ROOT_LEVEL 2
4545 #define PT32E_ROOT_LEVEL 3
4646
47−static inline u64 rsvd_bits(int s, int e)
47+static __always_inline u64 rsvd_bits(int s, int e)
4848 {
49+ BUILD_BUG_ON(__builtin_constant_p(e) && __builtin_constant_p(s) && e < s);
50+
51+ if (__builtin_constant_p(e))
52+ BUILD_BUG_ON(e > 63);
53+ else
54+ e &= 63;
55+
4956 if (e < s)
5057 return 0;
5158
52− return ((1ULL << (e - s + 1)) - 1) << s;
59+ return ((2ULL << (e - s)) - 1) << s;
5360 }
5461
5562 void kvm_mmu_set_mmio_spte_mask(u64 mmio_value, u64 access_mask);
arch/x86/kvm/mmu/mmu.c+30−23
@@ -3493,26 +3493,25 @@ static bool mmio_info_in_cache(struct kvm_vcpu *vcpu, u64 addr, bool direct) · 3492 unmodified lines
34933493 * Return the level of the lowest level SPTE added to sptes.
34943494 * That SPTE may be non-present.
34953495 */
3496−static int get_walk(struct kvm_vcpu *vcpu, u64 addr, u64 *sptes)
3496+static int get_walk(struct kvm_vcpu *vcpu, u64 addr, u64 *sptes, int *root_level)
34973497 {
34983498 struct kvm_shadow_walk_iterator iterator;
3499− int leaf = vcpu->arch.mmu->root_level;
3499+ int leaf = -1;
35003500 u64 spte;
35013501
3502−
35033502 walk_shadow_page_lockless_begin(vcpu);
35043503
3505− for (shadow_walk_init(&iterator, vcpu, addr);
3504+ for (shadow_walk_init(&iterator, vcpu, addr),
3505+ *root_level = iterator.level;
35063506 shadow_walk_okay(&iterator);
35073507 __shadow_walk_next(&iterator, spte)) {
35083508 leaf = iterator.level;
35093509 spte = mmu_spte_get_lockless(iterator.sptep);
35103510
3511− sptes[leaf - 1] = spte;
3511+ sptes[leaf] = spte;
35123512
35133513 if (!is_shadow_present_pte(spte))
35143514 break;
3515−
35163515 }
35173516
35183517 walk_shadow_page_lockless_end(vcpu);
@@ -3520,14 +3519,12 @@ static int get_walk(struct kvm_vcpu *vcpu, u64 addr, u64 *sptes) · 1 unmodified line
35203519 return leaf;
35213520 }
35223521
3523−/* return true if reserved bit is detected on spte. */
3522+/* return true if reserved bit(s) are detected on a valid, non-MMIO SPTE. */
35243523 static bool get_mmio_spte(struct kvm_vcpu *vcpu, u64 addr, u64 *sptep)
35253524 {
3526− u64 sptes[PT64_ROOT_MAX_LEVEL];
3525+ u64 sptes[PT64_ROOT_MAX_LEVEL + 1];
35273526 struct rsvd_bits_validate *rsvd_check;
3528− int root = vcpu->arch.mmu->shadow_root_level;
3529− int leaf;
3530− int level;
3527+ int root, leaf, level;
35313528 bool reserved = false;
35323529
35333530 if (!VALID_PAGE(vcpu->arch.mmu->root_hpa)) {
@@ -3536,35 +3533,45 @@ static bool get_mmio_spte(struct kvm_vcpu *vcpu, u64 addr, u64 *sptep) · 2 unmodified lines
35363533 }
35373534
35383535 if (is_tdp_mmu_root(vcpu->kvm, vcpu->arch.mmu->root_hpa))
3539− leaf = kvm_tdp_mmu_get_walk(vcpu, addr, sptes);
3536+ leaf = kvm_tdp_mmu_get_walk(vcpu, addr, sptes, &root);
35403537 else
3541− leaf = get_walk(vcpu, addr, sptes);
3538+ leaf = get_walk(vcpu, addr, sptes, &root);
3539+
3540+ if (unlikely(leaf < 0)) {
3541+ *sptep = 0ull;
3542+ return reserved;
3543+ }
3544+
3545+ *sptep = sptes[leaf];
3546+
3547+ /*
3548+ * Skip reserved bits checks on the terminal leaf if it's not a valid
3549+ * SPTE. Note, this also (intentionally) skips MMIO SPTEs, which, by
3550+ * design, always have reserved bits set. The purpose of the checks is
3551+ * to detect reserved bits on non-MMIO SPTEs. i.e. buggy SPTEs.
3552+ */
3553+ if (!is_shadow_present_pte(sptes[leaf]))
3554+ leaf++;
35423555
35433556 rsvd_check = &vcpu->arch.mmu->shadow_zero_check;
35443557
3545− for (level = root; level >= leaf; level--) {
3546− if (!is_shadow_present_pte(sptes[level - 1]))
3547− break;
3558+ for (level = root; level >= leaf; level--)
35483559 /*
35493560 * Use a bitwise-OR instead of a logical-OR to aggregate the
35503561 * reserved bit and EPT's invalid memtype/XWR checks to avoid
35513562 * adding a Jcc in the loop.
35523563 */
3553− reserved |= __is_bad_mt_xwr(rsvd_check, sptes[level - 1]) |
3554− __is_rsvd_bits_set(rsvd_check, sptes[level - 1],
3555− level);
3556− }
3564+ reserved |= __is_bad_mt_xwr(rsvd_check, sptes[level]) |
3565+ __is_rsvd_bits_set(rsvd_check, sptes[level], level);
35573566
35583567 if (reserved) {
35593568 pr_err("%s: detect reserved bits on spte, addr 0x%llx, dump hierarchy:\n",
35603569 __func__, addr);
35613570 for (level = root; level >= leaf; level--)
35623571 pr_err("------ spte 0x%llx level %d.\n",
3563− sptes[level - 1], level);
3572+ sptes[level], level);
35643573 }
35653574
3566− *sptep = sptes[leaf - 1];
3567−
35683575 return reserved;
35693576 }
35703577
arch/x86/kvm/mmu/tdp_mmu.c+57−62
@@ -44,7 +44,48 @@ void kvm_mmu_uninit_tdp_mmu(struct kvm *kvm) · 43 unmodified lines
4444 WARN_ON(!list_empty(&kvm->arch.tdp_mmu_roots));
4545 }
4646
47−#define for_each_tdp_mmu_root(_kvm, _root) \
47+static void tdp_mmu_put_root(struct kvm *kvm, struct kvm_mmu_page *root)
48+{
49+ if (kvm_mmu_put_root(kvm, root))
50+ kvm_tdp_mmu_free_root(kvm, root);
51+}
52+
53+static inline bool tdp_mmu_next_root_valid(struct kvm *kvm,
54+ struct kvm_mmu_page *root)
55+{
56+ lockdep_assert_held(&kvm->mmu_lock);
57+
58+ if (list_entry_is_head(root, &kvm->arch.tdp_mmu_roots, link))
59+ return false;
60+
61+ kvm_mmu_get_root(kvm, root);
62+ return true;
63+
64+}
65+
66+static inline struct kvm_mmu_page *tdp_mmu_next_root(struct kvm *kvm,
67+ struct kvm_mmu_page *root)
68+{
69+ struct kvm_mmu_page *next_root;
70+
71+ next_root = list_next_entry(root, link);
72+ tdp_mmu_put_root(kvm, root);
73+ return next_root;
74+}
75+
76+/*
77+ * Note: this iterator gets and puts references to the roots it iterates over.
78+ * This makes it safe to release the MMU lock and yield within the loop, but
79+ * if exiting the loop early, the caller must drop the reference to the most
80+ * recent root. (Unless keeping a live reference is desirable.)
81+ */
82+#define for_each_tdp_mmu_root_yield_safe(_kvm, _root) \
83+ for (_root = list_first_entry(&_kvm->arch.tdp_mmu_roots, \
84+ typeof(*_root), link); \
85+ tdp_mmu_next_root_valid(_kvm, _root); \
86+ _root = tdp_mmu_next_root(_kvm, _root))
87+
88+#define for_each_tdp_mmu_root(_kvm, _root) \
4889 list_for_each_entry(_root, &_kvm->arch.tdp_mmu_roots, link)
4990
5091 bool is_tdp_mmu_root(struct kvm *kvm, hpa_t hpa)
@@ -447,18 +488,9 @@ bool kvm_tdp_mmu_zap_gfn_range(struct kvm *kvm, gfn_t start, gfn_t end) · 396 unmodified lines
447488 struct kvm_mmu_page *root;
448489 bool flush = false;
449490
450− for_each_tdp_mmu_root(kvm, root) {
451− /*
452− * Take a reference on the root so that it cannot be freed if
453− * this thread releases the MMU lock and yields in this loop.
454− */
455− kvm_mmu_get_root(kvm, root);
456−
491+ for_each_tdp_mmu_root_yield_safe(kvm, root)
457492 flush |= zap_gfn_range(kvm, root, start, end, true);
458493
459− kvm_mmu_put_root(kvm, root);
460− }
461−
462494 return flush;
463495 }
464496
@@ -619,13 +651,7 @@ static int kvm_tdp_mmu_handle_hva_range(struct kvm *kvm, unsigned long start, · 154 unmodified lines
619651 int ret = 0;
620652 int as_id;
621653
622− for_each_tdp_mmu_root(kvm, root) {
623− /*
624− * Take a reference on the root so that it cannot be freed if
625− * this thread releases the MMU lock and yields in this loop.
626− */
627− kvm_mmu_get_root(kvm, root);
628−
654+ for_each_tdp_mmu_root_yield_safe(kvm, root) {
629655 as_id = kvm_mmu_page_as_id(root);
630656 slots = __kvm_memslots(kvm, as_id);
631657 kvm_for_each_memslot(memslot, slots) {
@@ -647,8 +673,6 @@ static int kvm_tdp_mmu_handle_hva_range(struct kvm *kvm, unsigned long start, · 15 unmodified lines
647673 ret |= handler(kvm, memslot, root, gfn_start,
648674 gfn_end, data);
649675 }
650−
651− kvm_mmu_put_root(kvm, root);
652676 }
653677
654678 return ret;
@@ -838,21 +862,13 @@ bool kvm_tdp_mmu_wrprot_slot(struct kvm *kvm, struct kvm_memory_slot *slot, · 183 unmodified lines
838862 int root_as_id;
839863 bool spte_set = false;
840864
841− for_each_tdp_mmu_root(kvm, root) {
865+ for_each_tdp_mmu_root_yield_safe(kvm, root) {
842866 root_as_id = kvm_mmu_page_as_id(root);
843867 if (root_as_id != slot->as_id)
844868 continue;
845869
846− /*
847− * Take a reference on the root so that it cannot be freed if
848− * this thread releases the MMU lock and yields in this loop.
849− */
850− kvm_mmu_get_root(kvm, root);
851−
852870 spte_set |= wrprot_gfn_range(kvm, root, slot->base_gfn,
853871 slot->base_gfn + slot->npages, min_level);
854−
855− kvm_mmu_put_root(kvm, root);
856872 }
857873
858874 return spte_set;
@@ -906,21 +922,13 @@ bool kvm_tdp_mmu_clear_dirty_slot(struct kvm *kvm, struct kvm_memory_slot *slot) · 47 unmodified lines
906922 int root_as_id;
907923 bool spte_set = false;
908924
909− for_each_tdp_mmu_root(kvm, root) {
925+ for_each_tdp_mmu_root_yield_safe(kvm, root) {
910926 root_as_id = kvm_mmu_page_as_id(root);
911927 if (root_as_id != slot->as_id)
912928 continue;
913929
914− /*
915− * Take a reference on the root so that it cannot be freed if
916− * this thread releases the MMU lock and yields in this loop.
917− */
918− kvm_mmu_get_root(kvm, root);
919−
920930 spte_set |= clear_dirty_gfn_range(kvm, root, slot->base_gfn,
921931 slot->base_gfn + slot->npages);
922−
923− kvm_mmu_put_root(kvm, root);
924932 }
925933
926934 return spte_set;
@@ -1029,28 +1037,20 @@ bool kvm_tdp_mmu_slot_set_dirty(struct kvm *kvm, struct kvm_memory_slot *slot) · 102 unmodified lines
10291037 int root_as_id;
10301038 bool spte_set = false;
10311039
1032− for_each_tdp_mmu_root(kvm, root) {
1040+ for_each_tdp_mmu_root_yield_safe(kvm, root) {
10331041 root_as_id = kvm_mmu_page_as_id(root);
10341042 if (root_as_id != slot->as_id)
10351043 continue;
10361044
1037− /*
1038− * Take a reference on the root so that it cannot be freed if
1039− * this thread releases the MMU lock and yields in this loop.
1040− */
1041− kvm_mmu_get_root(kvm, root);
1042−
10431045 spte_set |= set_dirty_gfn_range(kvm, root, slot->base_gfn,
10441046 slot->base_gfn + slot->npages);
1045−
1046− kvm_mmu_put_root(kvm, root);
10471047 }
10481048 return spte_set;
10491049 }
10501050
10511051 /*
1052− * Clear non-leaf entries (and free associated page tables) which could
1053− * be replaced by large mappings, for GFNs within the slot.
1052+ * Clear leaf entries which could be replaced by large mappings, for
1053+ * GFNs within the slot.
10541054 */
10551055 static void zap_collapsible_spte_range(struct kvm *kvm,
10561056 struct kvm_mmu_page *root,
@@ -1062,7 +1062,7 @@ static void zap_collapsible_spte_range(struct kvm *kvm, · 5 unmodified lines
10621062
10631063 tdp_root_for_each_pte(iter, root, start, end) {
10641064 if (!is_shadow_present_pte(iter.old_spte) ||
1065− is_last_spte(iter.old_spte, iter.level))
1065+ !is_last_spte(iter.old_spte, iter.level))
10661066 continue;
10671067
10681068 pfn = spte_to_pfn(iter.old_spte);
@@ -1089,21 +1089,13 @@ void kvm_tdp_mmu_zap_collapsible_sptes(struct kvm *kvm, · 20 unmodified lines
10891089 struct kvm_mmu_page *root;
10901090 int root_as_id;
10911091
1092− for_each_tdp_mmu_root(kvm, root) {
1092+ for_each_tdp_mmu_root_yield_safe(kvm, root) {
10931093 root_as_id = kvm_mmu_page_as_id(root);
10941094 if (root_as_id != slot->as_id)
10951095 continue;
10961096
1097− /*
1098− * Take a reference on the root so that it cannot be freed if
1099− * this thread releases the MMU lock and yields in this loop.
1100− */
1101− kvm_mmu_get_root(kvm, root);
1102−
11031097 zap_collapsible_spte_range(kvm, root, slot->base_gfn,
11041098 slot->base_gfn + slot->npages);
1105−
1106− kvm_mmu_put_root(kvm, root);
11071099 }
11081100 }
11091101
@@ -1160,16 +1152,19 @@ bool kvm_tdp_mmu_write_protect_gfn(struct kvm *kvm, · 50 unmodified lines
11601152 * Return the level of the lowest level SPTE added to sptes.
11611153 * That SPTE may be non-present.
11621154 */
1163−int kvm_tdp_mmu_get_walk(struct kvm_vcpu *vcpu, u64 addr, u64 *sptes)
1155+int kvm_tdp_mmu_get_walk(struct kvm_vcpu *vcpu, u64 addr, u64 *sptes,
1156+ int *root_level)
11641157 {
11651158 struct tdp_iter iter;
11661159 struct kvm_mmu *mmu = vcpu->arch.mmu;
1167− int leaf = vcpu->arch.mmu->shadow_root_level;
11681160 gfn_t gfn = addr >> PAGE_SHIFT;
1161+ int leaf = -1;
1162+
1163+ *root_level = vcpu->arch.mmu->shadow_root_level;
11691164
11701165 tdp_mmu_for_each_pte(iter, mmu, gfn, gfn + 1) {
11711166 leaf = iter.level;
1172− sptes[leaf - 1] = iter.old_spte;
1167+ sptes[leaf] = iter.old_spte;
11731168 }
11741169
11751170 return leaf;
arch/x86/kvm/mmu/tdp_mmu.h+3−1
@@ -44,5 +44,7 @@ void kvm_tdp_mmu_zap_collapsible_sptes(struct kvm *kvm, · 43 unmodified lines
4444 bool kvm_tdp_mmu_write_protect_gfn(struct kvm *kvm,
4545 struct kvm_memory_slot *slot, gfn_t gfn);
4646
47−int kvm_tdp_mmu_get_walk(struct kvm_vcpu *vcpu, u64 addr, u64 *sptes);
47+int kvm_tdp_mmu_get_walk(struct kvm_vcpu *vcpu, u64 addr, u64 *sptes,
48+ int *root_level);
49+
4850 #endif /* __KVM_X86_MMU_TDP_MMU_H */
arch/x86/kvm/svm/nested.c+14−10
@@ -199,6 +199,10 @@ static bool nested_svm_vmrun_msrpm(struct vcpu_svm *svm) · 198 unmodified lines
199199 static bool svm_get_nested_state_pages(struct kvm_vcpu *vcpu)
200200 {
201201 struct vcpu_svm *svm = to_svm(vcpu);
202+
203+ if (WARN_ON(!is_guest_mode(vcpu)))
204+ return true;
205+
202206 if (!nested_svm_vmrun_msrpm(svm)) {
203207 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
204208 vcpu->run->internal.suberror =
@@ -227,6 +231,7 @@ static bool nested_vmcb_check_controls(struct vmcb_control_area *control) · 22 unmodified lines
227231
228232 static bool nested_vmcb_checks(struct vcpu_svm *svm, struct vmcb *vmcb12)
229233 {
234+ struct kvm_vcpu *vcpu = &svm->vcpu;
230235 bool vmcb12_lma;
231236
232237 if ((vmcb12->save.efer & EFER_SVME) == 0)
@@ -240,18 +245,10 @@ static bool nested_vmcb_checks(struct vcpu_svm *svm, struct vmcb *vmcb12) · 7 unmodified lines
240245
241246 vmcb12_lma = (vmcb12->save.efer & EFER_LME) && (vmcb12->save.cr0 & X86_CR0_PG);
242247
243− if (!vmcb12_lma) {
244− if (vmcb12->save.cr4 & X86_CR4_PAE) {
245− if (vmcb12->save.cr3 & MSR_CR3_LEGACY_PAE_RESERVED_MASK)
246− return false;
247− } else {
248− if (vmcb12->save.cr3 & MSR_CR3_LEGACY_RESERVED_MASK)
249− return false;
250− }
251− } else {
248+ if (vmcb12_lma) {
252249 if (!(vmcb12->save.cr4 & X86_CR4_PAE) ||
253250 !(vmcb12->save.cr0 & X86_CR0_PE) ||
254− (vmcb12->save.cr3 & MSR_CR3_LONG_MBZ_MASK))
251+ (vmcb12->save.cr3 & vcpu->arch.cr3_lm_rsvd_bits))
255252 return false;
256253 }
257254 if (!kvm_is_valid_cr4(&svm->vcpu, vmcb12->save.cr4))
@@ -595,6 +592,8 @@ int nested_svm_vmexit(struct vcpu_svm *svm) · 337 unmodified lines
595592 svm->nested.vmcb12_gpa = 0;
596593 WARN_ON_ONCE(svm->nested.nested_run_pending);
597594
595+ kvm_clear_request(KVM_REQ_GET_NESTED_STATE_PAGES, &svm->vcpu);
596+
598597 /* in case we halted in L2 */
599598 svm->vcpu.arch.mp_state = KVM_MP_STATE_RUNNABLE;
600599
@@ -754,6 +753,7 @@ void svm_leave_nested(struct vcpu_svm *svm) · 153 unmodified lines
754753 leave_guest_mode(&svm->vcpu);
755754 copy_vmcb_control_area(&vmcb->control, &hsave->control);
756755 nested_svm_uninit_mmu_context(&svm->vcpu);
756+ vmcb_mark_all_dirty(svm->vmcb);
757757 }
758758
759759 kvm_clear_request(KVM_REQ_GET_NESTED_STATE_PAGES, &svm->vcpu);
@@ -1194,6 +1194,10 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu, · 434 unmodified lines
11941194 * in the registers, the save area of the nested state instead
11951195 * contains saved L1 state.
11961196 */
1197+
1198+ svm->nested.nested_run_pending =
1199+ !!(kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING);
1200+
11971201 copy_vmcb_control_area(&hsave->control, &svm->vmcb->control);
11981202 hsave->save = *save;
11991203
arch/x86/kvm/svm/sev.c+39−17
@@ -342,6 +342,8 @@ static struct page **sev_pin_memory(struct kvm *kvm, unsigned long uaddr, · 341 unmodified lines
342342 unsigned long first, last;
343343 int ret;
344344
345+ lockdep_assert_held(&kvm->lock);
346+
345347 if (ulen == 0 || uaddr + ulen < uaddr)
346348 return ERR_PTR(-EINVAL);
347349
@@ -1119,12 +1121,20 @@ int svm_register_enc_region(struct kvm *kvm, · 771 unmodified lines
11191121 if (!region)
11201122 return -ENOMEM;
11211123
1124+ mutex_lock(&kvm->lock);
11221125 region->pages = sev_pin_memory(kvm, range->addr, range->size, &region->npages, 1);
11231126 if (IS_ERR(region->pages)) {
11241127 ret = PTR_ERR(region->pages);
1128+ mutex_unlock(&kvm->lock);
11251129 goto e_free;
11261130 }
11271131
1132+ region->uaddr = range->addr;
1133+ region->size = range->size;
1134+
1135+ list_add_tail(&region->list, &sev->regions_list);
1136+ mutex_unlock(&kvm->lock);
1137+
11281138 /*
11291139 * The guest may change the memory encryption attribute from C=0 -> C=1
11301140 * or vice versa for this memory range. Lets make sure caches are
@@ -1133,13 +1143,6 @@ int svm_register_enc_region(struct kvm *kvm, · 2 unmodified lines
11331143 */
11341144 sev_clflush_pages(region->pages, region->npages);
11351145
1136− region->uaddr = range->addr;
1137− region->size = range->size;
1138−
1139− mutex_lock(&kvm->lock);
1140− list_add_tail(&region->list, &sev->regions_list);
1141− mutex_unlock(&kvm->lock);
1142−
11431146 return ret;
11441147
11451148 e_free:
@@ -1415,16 +1418,13 @@ static void sev_es_sync_to_ghcb(struct vcpu_svm *svm) · 269 unmodified lines
14151418 * to be returned:
14161419 * GPRs RAX, RBX, RCX, RDX
14171420 *
1418− * Copy their values to the GHCB if they are dirty.
1421+ * Copy their values, even if they may not have been written during the
1422+ * VM-Exit. It's the guest's responsibility to not consume random data.
14191423 */
1420− if (kvm_register_is_dirty(vcpu, VCPU_REGS_RAX))
1421− ghcb_set_rax(ghcb, vcpu->arch.regs[VCPU_REGS_RAX]);
1422− if (kvm_register_is_dirty(vcpu, VCPU_REGS_RBX))
1423− ghcb_set_rbx(ghcb, vcpu->arch.regs[VCPU_REGS_RBX]);
1424− if (kvm_register_is_dirty(vcpu, VCPU_REGS_RCX))
1425− ghcb_set_rcx(ghcb, vcpu->arch.regs[VCPU_REGS_RCX]);
1426− if (kvm_register_is_dirty(vcpu, VCPU_REGS_RDX))
1427− ghcb_set_rdx(ghcb, vcpu->arch.regs[VCPU_REGS_RDX]);
1424+ ghcb_set_rax(ghcb, vcpu->arch.regs[VCPU_REGS_RAX]);
1425+ ghcb_set_rbx(ghcb, vcpu->arch.regs[VCPU_REGS_RBX]);
1426+ ghcb_set_rcx(ghcb, vcpu->arch.regs[VCPU_REGS_RCX]);
1427+ ghcb_set_rdx(ghcb, vcpu->arch.regs[VCPU_REGS_RDX]);
14281428 }
14291429
14301430 static void sev_es_sync_from_ghcb(struct vcpu_svm *svm)
@@ -1563,6 +1563,7 @@ static int sev_es_validate_vmgexit(struct vcpu_svm *svm) · 132 unmodified lines
15631563 goto vmgexit_err;
15641564 break;
15651565 case SVM_VMGEXIT_NMI_COMPLETE:
1566+ case SVM_VMGEXIT_AP_HLT_LOOP:
15661567 case SVM_VMGEXIT_AP_JUMP_TABLE:
15671568 case SVM_VMGEXIT_UNSUPPORTED_EVENT:
15681569 break;
@@ -1888,6 +1889,9 @@ int sev_handle_vmgexit(struct vcpu_svm *svm) · 319 unmodified lines
18881889 case SVM_VMGEXIT_NMI_COMPLETE:
18891890 ret = svm_invoke_exit_handler(svm, SVM_EXIT_IRET);
18901891 break;
1892+ case SVM_VMGEXIT_AP_HLT_LOOP:
1893+ ret = kvm_emulate_ap_reset_hold(&svm->vcpu);
1894+ break;
18911895 case SVM_VMGEXIT_AP_JUMP_TABLE: {
18921896 struct kvm_sev_info *sev = &to_kvm_svm(svm->vcpu.kvm)->sev_info;
18931897
@@ -2001,7 +2005,7 @@ void sev_es_vcpu_load(struct vcpu_svm *svm, int cpu) · 107 unmodified lines
20012005 * of which one step is to perform a VMLOAD. Since hardware does not
20022006 * perform a VMSAVE on VMRUN, the host savearea must be updated.
20032007 */
2004− asm volatile(__ex("vmsave") : : "a" (__sme_page_pa(sd->save_area)) : "memory");
2008+ asm volatile(__ex("vmsave %0") : : "a" (__sme_page_pa(sd->save_area)) : "memory");
20052009
20062010 /*
20072011 * Certain MSRs are restored on VMEXIT, only save ones that aren't
@@ -2040,3 +2044,21 @@ void sev_es_vcpu_put(struct vcpu_svm *svm) · 32 unmodified lines
20402044 wrmsrl(host_save_user_msrs[i].index, svm->host_user_msrs[i]);
20412045 }
20422046 }
2047+
2048+void sev_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector)
2049+{
2050+ struct vcpu_svm *svm = to_svm(vcpu);
2051+
2052+ /* First SIPI: Use the values as initially set by the VMM */
2053+ if (!svm->received_first_sipi) {
2054+ svm->received_first_sipi = true;
2055+ return;
2056+ }
2057+
2058+ /*
2059+ * Subsequent SIPI: Return from an AP Reset Hold VMGEXIT, where
2060+ * the guest will set the CS and RIP. Set SW_EXIT_INFO_2 to a
2061+ * non-zero value.
2062+ */
2063+ ghcb_set_sw_exit_info_2(svm->ghcb, 1);
2064+}
arch/x86/kvm/svm/svm.c+17−2
@@ -454,6 +454,11 @@ static int has_svm(void) · 453 unmodified lines
454454 return 0;
455455 }
456456
457+ if (sev_active()) {
458+ pr_info("KVM is unsupported when running as an SEV guest\n");
459+ return 0;
460+ }
461+
457462 return 1;
458463 }
459464
@@ -3677,8 +3682,6 @@ static fastpath_t svm_exit_handlers_fastpath(struct kvm_vcpu *vcpu) · 3217 unmodified lines
36773682 return EXIT_FASTPATH_NONE;
36783683 }
36793684
3680−void __svm_vcpu_run(unsigned long vmcb_pa, unsigned long *regs);
3681−
36823685 static noinstr void svm_vcpu_enter_exit(struct kvm_vcpu *vcpu,
36833686 struct vcpu_svm *svm)
36843687 {
@@ -3741,6 +3744,8 @@ static __no_kcsan fastpath_t svm_vcpu_run(struct kvm_vcpu *vcpu) · 56 unmodified lines
37413744 {
37423745 struct vcpu_svm *svm = to_svm(vcpu);
37433746
3747+ trace_kvm_entry(vcpu);
3748+
37443749 svm->vmcb->save.rax = vcpu->arch.regs[VCPU_REGS_RAX];
37453750 svm->vmcb->save.rsp = vcpu->arch.regs[VCPU_REGS_RSP];
37463751 svm->vmcb->save.rip = vcpu->arch.regs[VCPU_REGS_RIP];
@@ -4384,6 +4389,14 @@ static bool svm_apic_init_signal_blocked(struct kvm_vcpu *vcpu) · 637 unmodified lines
43844389 (vmcb_is_intercept(&svm->vmcb->control, INTERCEPT_INIT));
43854390 }
43864391
4392+static void svm_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector)
4393+{
4394+ if (!sev_es_guest(vcpu->kvm))
4395+ return kvm_vcpu_deliver_sipi_vector(vcpu, vector);
4396+
4397+ sev_vcpu_deliver_sipi_vector(vcpu, vector);
4398+}
4399+
43874400 static void svm_vm_destroy(struct kvm *kvm)
43884401 {
43894402 avic_vm_destroy(kvm);
@@ -4526,6 +4539,8 @@ static struct kvm_x86_ops svm_x86_ops __initdata = { · 136 unmodified lines
45264539
45274540 .msr_filter_changed = svm_msr_filter_changed,
45284541 .complete_emulated_msr = svm_complete_emulated_msr,
4542+
4543+ .vcpu_deliver_sipi_vector = svm_vcpu_deliver_sipi_vector,
45294544 };
45304545
45314546 static struct kvm_x86_init_ops svm_init_ops __initdata = {
arch/x86/kvm/svm/svm.h+2−3
@@ -185,6 +185,7 @@ struct vcpu_svm { · 184 unmodified lines
185185 struct vmcb_save_area *vmsa;
186186 struct ghcb *ghcb;
187187 struct kvm_host_map ghcb_map;
188+ bool received_first_sipi;
188189
189190 /* SEV-ES scratch area support */
190191 void *ghcb_sa;
@@ -402,9 +403,6 @@ static inline bool gif_set(struct vcpu_svm *svm) · 211 unmodified lines
402403 }
403404
404405 /* svm.c */
405−#define MSR_CR3_LEGACY_RESERVED_MASK 0xfe7U
406−#define MSR_CR3_LEGACY_PAE_RESERVED_MASK 0x7U
407−#define MSR_CR3_LONG_MBZ_MASK 0xfff0000000000000U
408406 #define MSR_INVALID 0xffffffffU
409407
410408 extern int sev;
@@ -591,6 +589,7 @@ void sev_es_init_vmcb(struct vcpu_svm *svm); · 180 unmodified lines
591589 void sev_es_create_vcpu(struct vcpu_svm *svm);
592590 void sev_es_vcpu_load(struct vcpu_svm *svm, int cpu);
593591 void sev_es_vcpu_put(struct vcpu_svm *svm);
592+void sev_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector);
594593
595594 /* vmenter.S */
596595
arch/x86/kvm/vmx/nested.c+35−11
@@ -3124,13 +3124,9 @@ static int nested_vmx_check_vmentry_hw(struct kvm_vcpu *vcpu) · 3123 unmodified lines
31243124 return 0;
31253125 }
31263126
3127−static bool nested_get_vmcs12_pages(struct kvm_vcpu *vcpu)
3127+static bool nested_get_evmcs_page(struct kvm_vcpu *vcpu)
31283128 {
3129− struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
31303129 struct vcpu_vmx *vmx = to_vmx(vcpu);
3131− struct kvm_host_map *map;
3132− struct page *page;
3133− u64 hpa;
31343130
31353131 /*
31363132 * hv_evmcs may end up being not mapped after migration (when
@@ -3153,6 +3149,17 @@ static bool nested_get_vmcs12_pages(struct kvm_vcpu *vcpu) · 16 unmodified lines
31533149 }
31543150 }
31553151
3152+ return true;
3153+}
3154+
3155+static bool nested_get_vmcs12_pages(struct kvm_vcpu *vcpu)
3156+{
3157+ struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
3158+ struct vcpu_vmx *vmx = to_vmx(vcpu);
3159+ struct kvm_host_map *map;
3160+ struct page *page;
3161+ u64 hpa;
3162+
31563163 if (nested_cpu_has2(vmcs12, SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) {
31573164 /*
31583165 * Translate L1 physical address to host physical
@@ -3221,6 +3228,18 @@ static bool nested_get_vmcs12_pages(struct kvm_vcpu *vcpu) · 62 unmodified lines
32213228 exec_controls_setbit(vmx, CPU_BASED_USE_MSR_BITMAPS);
32223229 else
32233230 exec_controls_clearbit(vmx, CPU_BASED_USE_MSR_BITMAPS);
3231+
3232+ return true;
3233+}
3234+
3235+static bool vmx_get_nested_state_pages(struct kvm_vcpu *vcpu)
3236+{
3237+ if (!nested_get_evmcs_page(vcpu))
3238+ return false;
3239+
3240+ if (is_guest_mode(vcpu) && !nested_get_vmcs12_pages(vcpu))
3241+ return false;
3242+
32243243 return true;
32253244 }
32263245
@@ -4442,6 +4461,8 @@ void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 vm_exit_reason, · 1215 unmodified lines
44424461 /* trying to cancel vmlaunch/vmresume is a bug */
44434462 WARN_ON_ONCE(vmx->nested.nested_run_pending);
44444463
4464+ kvm_clear_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcpu);
4465+
44454466 /* Service the TLB flush request for L2 before switching to L1. */
44464467 if (kvm_check_request(KVM_REQ_TLB_FLUSH_CURRENT, vcpu))
44474468 kvm_vcpu_flush_tlb_current(vcpu);
@@ -6075,11 +6096,14 @@ static int vmx_get_nested_state(struct kvm_vcpu *vcpu, · 1627 unmodified lines
60756096 if (is_guest_mode(vcpu)) {
60766097 sync_vmcs02_to_vmcs12(vcpu, vmcs12);
60776098 sync_vmcs02_to_vmcs12_rare(vcpu, vmcs12);
6078− } else if (!vmx->nested.need_vmcs12_to_shadow_sync) {
6079− if (vmx->nested.hv_evmcs)
6080− copy_enlightened_to_vmcs12(vmx);
6081− else if (enable_shadow_vmcs)
6082− copy_shadow_to_vmcs12(vmx);
6099+ } else {
6100+ copy_vmcs02_to_vmcs12_rare(vcpu, get_vmcs12(vcpu));
6101+ if (!vmx->nested.need_vmcs12_to_shadow_sync) {
6102+ if (vmx->nested.hv_evmcs)
6103+ copy_enlightened_to_vmcs12(vmx);
6104+ else if (enable_shadow_vmcs)
6105+ copy_shadow_to_vmcs12(vmx);
6106+ }
60836107 }
60846108
60856109 BUILD_BUG_ON(sizeof(user_vmx_nested_state->vmcs12) < VMCS12_SIZE);
@@ -6600,7 +6624,7 @@ struct kvm_x86_nested_ops vmx_nested_ops = { · 514 unmodified lines
66006624 .hv_timer_pending = nested_vmx_preemption_timer_pending,
66016625 .get_state = vmx_get_nested_state,
66026626 .set_state = vmx_set_nested_state,
6603− .get_nested_state_pages = nested_get_vmcs12_pages,
6627+ .get_nested_state_pages = vmx_get_nested_state_pages,
66046628 .write_log_dirty = nested_vmx_write_pml_buffer,
66056629 .enable_evmcs = nested_enable_evmcs,
66066630 .get_evmcs_version = nested_get_evmcs_version,
arch/x86/kvm/vmx/pmu_intel.c+5−1
@@ -29,7 +29,7 @@ static struct kvm_event_hw_type_mapping intel_arch_events[] = { · 28 unmodified lines
2929 [4] = { 0x2e, 0x41, PERF_COUNT_HW_CACHE_MISSES },
3030 [5] = { 0xc4, 0x00, PERF_COUNT_HW_BRANCH_INSTRUCTIONS },
3131 [6] = { 0xc5, 0x00, PERF_COUNT_HW_BRANCH_MISSES },
32− [7] = { 0x00, 0x30, PERF_COUNT_HW_REF_CPU_CYCLES },
32+ [7] = { 0x00, 0x03, PERF_COUNT_HW_REF_CPU_CYCLES },
3333 };
3434
3535 /* mapping between fixed pmc index and intel_arch_events array */
@@ -345,7 +345,9 @@ static void intel_pmu_refresh(struct kvm_vcpu *vcpu) · 309 unmodified lines
345345
346346 pmu->nr_arch_gp_counters = min_t(int, eax.split.num_counters,
347347 x86_pmu.num_counters_gp);
348+ eax.split.bit_width = min_t(int, eax.split.bit_width, x86_pmu.bit_width_gp);
348349 pmu->counter_bitmask[KVM_PMC_GP] = ((u64)1 << eax.split.bit_width) - 1;
350+ eax.split.mask_length = min_t(int, eax.split.mask_length, x86_pmu.events_mask_len);
349351 pmu->available_event_types = ~entry->ebx &
350352 ((1ull << eax.split.mask_length) - 1);
351353
@@ -355,6 +357,8 @@ static void intel_pmu_refresh(struct kvm_vcpu *vcpu) · 3 unmodified lines
355357 pmu->nr_arch_fixed_counters =
356358 min_t(int, edx.split.num_counters_fixed,
357359 x86_pmu.num_counters_fixed);
360+ edx.split.bit_width_fixed = min_t(int,
361+ edx.split.bit_width_fixed, x86_pmu.bit_width_fixed);
358362 pmu->counter_bitmask[KVM_PMC_FIXED] =
359363 ((u64)1 << edx.split.bit_width_fixed) - 1;
360364 }
arch/x86/kvm/vmx/vmx.c+17−4
@@ -6653,6 +6653,8 @@ reenter_guest: · 6652 unmodified lines
66536653 if (vmx->emulation_required)
66546654 return EXIT_FASTPATH_NONE;
66556655
6656+ trace_kvm_entry(vcpu);
6657+
66566658 if (vmx->ple_window_dirty) {
66576659 vmx->ple_window_dirty = false;
66586660 vmcs_write32(PLE_WINDOW, vmx->ple_window);
@@ -6858,11 +6860,20 @@ static int vmx_create_vcpu(struct kvm_vcpu *vcpu) · 199 unmodified lines
68586860 switch (index) {
68596861 case MSR_IA32_TSX_CTRL:
68606862 /*
6861− * No need to pass TSX_CTRL_CPUID_CLEAR through, so
6862− * let's avoid changing CPUID bits under the host
6863− * kernel's feet.
6863+ * TSX_CTRL_CPUID_CLEAR is handled in the CPUID
6864+ * interception. Keep the host value unchanged to avoid
6865+ * changing CPUID bits under the host kernel's feet.
6866+ *
6867+ * hle=0, rtm=0, tsx_ctrl=1 can be found with some
6868+ * combinations of new kernel and old userspace. If
6869+ * those guests run on a tsx=off host, do allow guests
6870+ * to use TSX_CTRL, but do not change the value on the
6871+ * host so that TSX remains always disabled.
68646872 */
6865− vmx->guest_uret_msrs[j].mask = ~(u64)TSX_CTRL_CPUID_CLEAR;
6873+ if (boot_cpu_has(X86_FEATURE_RTM))
6874+ vmx->guest_uret_msrs[j].mask = ~(u64)TSX_CTRL_CPUID_CLEAR;
6875+ else
6876+ vmx->guest_uret_msrs[j].mask = 0;
68666877 break;
68676878 default:
68686879 vmx->guest_uret_msrs[j].mask = -1ull;
@@ -7707,6 +7718,8 @@ static struct kvm_x86_ops vmx_x86_ops __initdata = { · 838 unmodified lines
77077718 .msr_filter_changed = vmx_msr_filter_changed,
77087719 .complete_emulated_msr = kvm_complete_insn_gp,
77097720 .cpu_dirty_log_size = vmx_cpu_dirty_log_size,
7721+
7722+ .vcpu_deliver_sipi_vector = kvm_vcpu_deliver_sipi_vector,
77107723 };
77117724
77127725 static __init int hardware_setup(void)
arch/x86/kvm/x86.c+47−17
@@ -105,6 +105,7 @@ static u64 __read_mostly cr4_reserved_bits = CR4_RESERVED_BITS; · 104 unmodified lines
105105
106106 static void update_cr8_intercept(struct kvm_vcpu *vcpu);
107107 static void process_nmi(struct kvm_vcpu *vcpu);
108+static void process_smi(struct kvm_vcpu *vcpu);
108109 static void enter_smm(struct kvm_vcpu *vcpu);
109110 static void __kvm_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags);
110111 static void store_regs(struct kvm_vcpu *vcpu);
@@ -1393,16 +1394,24 @@ static u64 kvm_get_arch_capabilities(void) · 1282 unmodified lines
13931394 if (!boot_cpu_has_bug(X86_BUG_MDS))
13941395 data |= ARCH_CAP_MDS_NO;
13951396
1396− /*
1397− * On TAA affected systems:
1398− * - nothing to do if TSX is disabled on the host.
1399− * - we emulate TSX_CTRL if present on the host.
1400− * This lets the guest use VERW to clear CPU buffers.
1401− */
1402− if (!boot_cpu_has(X86_FEATURE_RTM))
1403− data &= ~(ARCH_CAP_TAA_NO | ARCH_CAP_TSX_CTRL_MSR);
1404− else if (!boot_cpu_has_bug(X86_BUG_TAA))
1397+ if (!boot_cpu_has(X86_FEATURE_RTM)) {
1398+ /*
1399+ * If RTM=0 because the kernel has disabled TSX, the host might
1400+ * have TAA_NO or TSX_CTRL. Clear TAA_NO (the guest sees RTM=0
1401+ * and therefore knows that there cannot be TAA) but keep
1402+ * TSX_CTRL: some buggy userspaces leave it set on tsx=on hosts,
1403+ * and we want to allow migrating those guests to tsx=off hosts.
1404+ */
1405+ data &= ~ARCH_CAP_TAA_NO;
1406+ } else if (!boot_cpu_has_bug(X86_BUG_TAA)) {
14051407 data |= ARCH_CAP_TAA_NO;
1408+ } else {
1409+ /*
1410+ * Nothing to do here; we emulate TSX_CTRL if present on the
1411+ * host so the guest can choose between disabling TSX or
1412+ * using VERW to clear CPU buffers.
1413+ */
1414+ }
14061415
14071416 return data;
14081417 }
@@ -4230,6 +4239,9 @@ static void kvm_vcpu_ioctl_x86_get_vcpu_events(struct kvm_vcpu *vcpu, · 2821 unmodified lines
42304239 {
42314240 process_nmi(vcpu);
42324241
4242+ if (kvm_check_request(KVM_REQ_SMI, vcpu))
4243+ process_smi(vcpu);
4244+
42334245 /*
42344246 * In guest mode, payload delivery should be deferred,
42354247 * so that the L1 hypervisor can intercept #PF before
@@ -7976,17 +7988,22 @@ void kvm_arch_exit(void) · 3740 unmodified lines
79767988 kmem_cache_destroy(x86_fpu_cache);
79777989 }
79787990
7979−int kvm_vcpu_halt(struct kvm_vcpu *vcpu)
7991+static int __kvm_vcpu_halt(struct kvm_vcpu *vcpu, int state, int reason)
79807992 {
79817993 ++vcpu->stat.halt_exits;
79827994 if (lapic_in_kernel(vcpu)) {
7983− vcpu->arch.mp_state = KVM_MP_STATE_HALTED;
7995+ vcpu->arch.mp_state = state;
79847996 return 1;
79857997 } else {
7986− vcpu->run->exit_reason = KVM_EXIT_HLT;
7998+ vcpu->run->exit_reason = reason;
79877999 return 0;
79888000 }
79898001 }
8002+
8003+int kvm_vcpu_halt(struct kvm_vcpu *vcpu)
8004+{
8005+ return __kvm_vcpu_halt(vcpu, KVM_MP_STATE_HALTED, KVM_EXIT_HLT);
8006+}
79908007 EXPORT_SYMBOL_GPL(kvm_vcpu_halt);
79918008
79928009 int kvm_emulate_halt(struct kvm_vcpu *vcpu)
@@ -8000,6 +8017,14 @@ int kvm_emulate_halt(struct kvm_vcpu *vcpu) · 7 unmodified lines
80008017 }
80018018 EXPORT_SYMBOL_GPL(kvm_emulate_halt);
80028019
8020+int kvm_emulate_ap_reset_hold(struct kvm_vcpu *vcpu)
8021+{
8022+ int ret = kvm_skip_emulated_instruction(vcpu);
8023+
8024+ return __kvm_vcpu_halt(vcpu, KVM_MP_STATE_AP_RESET_HOLD, KVM_EXIT_AP_RESET_HOLD) && ret;
8025+}
8026+EXPORT_SYMBOL_GPL(kvm_emulate_ap_reset_hold);
8027+
80038028 #ifdef CONFIG_X86_64
80048029 static int kvm_pv_clock_pairing(struct kvm_vcpu *vcpu, gpa_t paddr,
80058030 unsigned long clock_type)
@@ -8973,8 +8998,6 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) · 967 unmodified lines
89738998 kvm_x86_ops.request_immediate_exit(vcpu);
89748999 }
89759000
8976− trace_kvm_entry(vcpu);
8977−
89789001 fpregs_assert_state_consistent();
89799002 if (test_thread_flag(TIF_NEED_FPU_LOAD))
89809003 switch_fpu_return();
@@ -9094,6 +9117,7 @@ static inline int vcpu_block(struct kvm *kvm, struct kvm_vcpu *vcpu) · 113 unmodified lines
90949117 kvm_apic_accept_events(vcpu);
90959118 switch(vcpu->arch.mp_state) {
90969119 case KVM_MP_STATE_HALTED:
9120+ case KVM_MP_STATE_AP_RESET_HOLD:
90979121 vcpu->arch.pv.pv_unhalted = false;
90989122 vcpu->arch.mp_state =
90999123 KVM_MP_STATE_RUNNABLE;
@@ -9520,8 +9544,9 @@ int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu, · 420 unmodified lines
95209544 kvm_load_guest_fpu(vcpu);
95219545
95229546 kvm_apic_accept_events(vcpu);
9523− if (vcpu->arch.mp_state == KVM_MP_STATE_HALTED &&
9524− vcpu->arch.pv.pv_unhalted)
9547+ if ((vcpu->arch.mp_state == KVM_MP_STATE_HALTED ||
9548+ vcpu->arch.mp_state == KVM_MP_STATE_AP_RESET_HOLD) &&
9549+ vcpu->arch.pv.pv_unhalted)
95259550 mp_state->mp_state = KVM_MP_STATE_RUNNABLE;
95269551 else
95279552 mp_state->mp_state = vcpu->arch.mp_state;
@@ -9599,6 +9624,8 @@ static bool kvm_is_valid_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs) · 71 unmodified lines
95999624 */
96009625 if (!(sregs->cr4 & X86_CR4_PAE) || !(sregs->efer & EFER_LMA))
96019626 return false;
9627+ if (sregs->cr3 & vcpu->arch.cr3_lm_rsvd_bits)
9628+ return false;
96029629 } else {
96039630 /*
96049631 * Not in 64-bit mode: EFER.LMA is clear and the code
@@ -9976,6 +10003,7 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) · 371 unmodified lines
997610003 fx_init(vcpu);
997710004
997810005 vcpu->arch.maxphyaddr = cpuid_query_maxphyaddr(vcpu);
10006+ vcpu->arch.cr3_lm_rsvd_bits = rsvd_bits(cpuid_maxphyaddr(vcpu), 63);
997910007
998010008 vcpu->arch.pat = MSR_IA32_CR_PAT_DEFAULT;
998110009
@@ -10152,6 +10180,7 @@ void kvm_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector) · 170 unmodified lines
1015210180 kvm_set_segment(vcpu, &cs, VCPU_SREG_CS);
1015310181 kvm_rip_write(vcpu, 0);
1015410182 }
10183+EXPORT_SYMBOL_GPL(kvm_vcpu_deliver_sipi_vector);
1015510184
1015610185 int kvm_arch_hardware_enable(void)
1015710186 {
@@ -10476,7 +10505,7 @@ void __user * __x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, · 318 unmodified lines
1047610505 return 0;
1047710506
1047810507 old_npages = slot->npages;
10479− hva = 0;
10508+ hva = slot->userspace_addr;
1048010509 }
1048110510
1048210511 for (i = 0; i < KVM_ADDRESS_SPACE_NUM; i++) {
@@ -11538,6 +11567,7 @@ int kvm_sev_es_string_io(struct kvm_vcpu *vcpu, unsigned int size, · 1055 unmodified lines
1153811567 }
1153911568 EXPORT_SYMBOL_GPL(kvm_sev_es_string_io);
1154011569
11570+EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_entry);
1154111571 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_exit);
1154211572 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_fast_mmio);
1154311573 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_inj_virq);
arch/x86/kvm/x86.h+2−0
@@ -425,6 +425,8 @@ bool kvm_msr_allowed(struct kvm_vcpu *vcpu, u32 index, u32 type); · 424 unmodified lines
425425 __reserved_bits |= X86_CR4_UMIP; \
426426 if (!__cpu_has(__c, X86_FEATURE_VMX)) \
427427 __reserved_bits |= X86_CR4_VMXE; \
428+ if (!__cpu_has(__c, X86_FEATURE_PCID)) \
429+ __reserved_bits |= X86_CR4_PCIDE; \
428430 __reserved_bits; \
429431 })
430432
arch/x86/lib/mmx_32.c+15−5
@@ -26,6 +26,16 @@ · 25 unmodified lines
2626 #include <asm/fpu/api.h>
2727 #include <asm/asm.h>
2828
29+/*
30+ * Use KFPU_387. MMX instructions are not affected by MXCSR,
31+ * but both AMD and Intel documentation states that even integer MMX
32+ * operations will result in #MF if an exception is pending in FCW.
33+ *
34+ * EMMS is not needed afterwards because, after calling kernel_fpu_end(),
35+ * any subsequent user of the 387 stack will reinitialize it using
36+ * KFPU_387.
37+ */
38+
2939 void *_mmx_memcpy(void *to, const void *from, size_t len)
3040 {
3141 void *p;
@@ -37,7 +47,7 @@ void *_mmx_memcpy(void *to, const void *from, size_t len) · 5 unmodified lines
3747 p = to;
3848 i = len >> 6; /* len/64 */
3949
40− kernel_fpu_begin();
50+ kernel_fpu_begin_mask(KFPU_387);
4151
4252 __asm__ __volatile__ (
4353 "1: prefetch (%0)\n" /* This set is 28 bytes */
@@ -127,7 +137,7 @@ static void fast_clear_page(void *page) · 83 unmodified lines
127137 {
128138 int i;
129139
130− kernel_fpu_begin();
140+ kernel_fpu_begin_mask(KFPU_387);
131141
132142 __asm__ __volatile__ (
133143 " pxor %%mm0, %%mm0\n" : :
@@ -160,7 +170,7 @@ static void fast_copy_page(void *to, void *from) · 26 unmodified lines
160170 {
161171 int i;
162172
163− kernel_fpu_begin();
173+ kernel_fpu_begin_mask(KFPU_387);
164174
165175 /*
166176 * maybe the prefetch stuff can go before the expensive fnsave...
@@ -247,7 +257,7 @@ static void fast_clear_page(void *page) · 80 unmodified lines
247257 {
248258 int i;
249259
250− kernel_fpu_begin();
260+ kernel_fpu_begin_mask(KFPU_387);
251261
252262 __asm__ __volatile__ (
253263 " pxor %%mm0, %%mm0\n" : :
@@ -282,7 +292,7 @@ static void fast_copy_page(void *to, void *from) · 28 unmodified lines
282292 {
283293 int i;
284294
285− kernel_fpu_begin();
295+ kernel_fpu_begin_mask(KFPU_387);
286296
287297 __asm__ __volatile__ (
288298 "1: prefetch (%0)\n"
arch/x86/mm/mem_encrypt.c+1−0
@@ -382,6 +382,7 @@ bool sev_active(void) · 381 unmodified lines
382382 {
383383 return sev_status & MSR_AMD64_SEV_ENABLED;
384384 }
385+EXPORT_SYMBOL_GPL(sev_active);
385386
386387 /* Needs to be called from non-instrumentable code */
387388 bool noinstr sev_es_active(void)
arch/x86/mm/pgtable.c+2−0
@@ -829,6 +829,8 @@ int pud_free_pmd_page(pud_t *pud, unsigned long addr) · 828 unmodified lines
829829 }
830830
831831 free_page((unsigned long)pmd_sv);
832+
833+ pgtable_pmd_page_dtor(virt_to_page(pmd));
832834 free_page((unsigned long)pmd);
833835
834836 return 1;
arch/x86/pci/init.c+11−4
@@ -9,16 +9,23 @@ · 8 unmodified lines
99 in the right sequence from here. */
1010 static __init int pci_arch_init(void)
1111 {
12− int type;
13−
14− x86_create_pci_msi_domain();
12+ int type, pcbios = 1;
1513
1614 type = pci_direct_probe();
1715
1816 if (!(pci_probe & PCI_PROBE_NOEARLY))
1917 pci_mmcfg_early_init();
2018
21− if (x86_init.pci.arch_init && !x86_init.pci.arch_init())
19+ if (x86_init.pci.arch_init)
20+ pcbios = x86_init.pci.arch_init();
21+
22+ /*
23+ * Must happen after x86_init.pci.arch_init(). Xen sets up the
24+ * x86_init.irqs.create_pci_msi_domain there.
25+ */
26+ x86_create_pci_msi_domain();
27+
28+ if (!pcbios)
2229 return 0;
2330
2431 pci_pcbios_init();
arch/x86/platform/efi/efi_64.c+0−19
@@ -115,31 +115,12 @@ void efi_sync_low_kernel_mappings(void) · 114 unmodified lines
115115 pud_t *pud_k, *pud_efi;
116116 pgd_t *efi_pgd = efi_mm.pgd;
117117
118− /*
119− * We can share all PGD entries apart from the one entry that
120− * covers the EFI runtime mapping space.
121− *
122− * Make sure the EFI runtime region mappings are guaranteed to
123− * only span a single PGD entry and that the entry also maps
124− * other important kernel regions.
125− */
126− MAYBE_BUILD_BUG_ON(pgd_index(EFI_VA_END) != pgd_index(MODULES_END));
127− MAYBE_BUILD_BUG_ON((EFI_VA_START & PGDIR_MASK) !=
128− (EFI_VA_END & PGDIR_MASK));
129−
130118 pgd_efi = efi_pgd + pgd_index(PAGE_OFFSET);
131119 pgd_k = pgd_offset_k(PAGE_OFFSET);
132120
133121 num_entries = pgd_index(EFI_VA_END) - pgd_index(PAGE_OFFSET);
134122 memcpy(pgd_efi, pgd_k, sizeof(pgd_t) * num_entries);
135123
136− /*
137− * As with PGDs, we share all P4D entries apart from the one entry
138− * that covers the EFI runtime mapping space.
139− */
140− BUILD_BUG_ON(p4d_index(EFI_VA_END) != p4d_index(MODULES_END));
141− BUILD_BUG_ON((EFI_VA_START & P4D_MASK) != (EFI_VA_END & P4D_MASK));
142−
143124 pgd_efi = efi_pgd + pgd_index(EFI_VA_END);
144125 pgd_k = pgd_offset_k(EFI_VA_END);
145126 p4d_efi = p4d_offset(pgd_efi, 0);
arch/x86/xen/enlighten_hvm.c+12−3
@@ -164,10 +164,10 @@ static int xen_cpu_up_prepare_hvm(unsigned int cpu) · 163 unmodified lines
164164 else
165165 per_cpu(xen_vcpu_id, cpu) = cpu;
166166 rc = xen_vcpu_setup(cpu);
167− if (rc)
167+ if (rc || !xen_have_vector_callback)
168168 return rc;
169169
170− if (xen_have_vector_callback && xen_feature(XENFEAT_hvm_safe_pvclock))
170+ if (xen_feature(XENFEAT_hvm_safe_pvclock))
171171 xen_setup_timer(cpu);
172172
173173 rc = xen_smp_intr_init(cpu);
@@ -188,6 +188,8 @@ static int xen_cpu_dead_hvm(unsigned int cpu) · 14 unmodified lines
188188 return 0;
189189 }
190190
191+static bool no_vector_callback __initdata;
192+
191193 static void __init xen_hvm_guest_init(void)
192194 {
193195 if (xen_pv_domain())
@@ -207,7 +209,7 @@ static void __init xen_hvm_guest_init(void) · 13 unmodified lines
207209
208210 xen_panic_handler_init();
209211
210− if (xen_feature(XENFEAT_hvm_callback_vector))
212+ if (!no_vector_callback && xen_feature(XENFEAT_hvm_callback_vector))
211213 xen_have_vector_callback = 1;
212214
213215 xen_hvm_smp_init();
@@ -233,6 +235,13 @@ static __init int xen_parse_nopv(char *arg) · 19 unmodified lines
233235 }
234236 early_param("xen_nopv", xen_parse_nopv);
235237
238+static __init int xen_parse_no_vector_callback(char *arg)
239+{
240+ no_vector_callback = true;
241+ return 0;
242+}
243+early_param("xen_no_vector_callback", xen_parse_no_vector_callback);
244+
236245 bool __init xen_hvm_need_lapic(void)
237246 {
238247 if (xen_pv_domain())
arch/x86/xen/enlighten_pv.c+14−1
@@ -583,6 +583,13 @@ DEFINE_IDTENTRY_RAW(xenpv_exc_debug) · 582 unmodified lines
583583 exc_debug(regs);
584584 }
585585
586+DEFINE_IDTENTRY_RAW(exc_xen_unknown_trap)
587+{
588+ /* This should never happen and there is no way to handle it. */
589+ pr_err("Unknown trap in Xen PV mode.");
590+ BUG();
591+}
592+
586593 struct trap_array_entry {
587594 void (*orig)(void);
588595 void (*xen)(void);
@@ -631,6 +638,7 @@ static bool __ref get_trap_addr(void **addr, unsigned int ist) · 42 unmodified lines
631638 {
632639 unsigned int nr;
633640 bool ist_okay = false;
641+ bool found = false;
634642
635643 /*
636644 * Replace trap handler addresses by Xen specific ones.
@@ -645,6 +653,7 @@ static bool __ref get_trap_addr(void **addr, unsigned int ist) · 8 unmodified lines
645653 if (*addr == entry->orig) {
646654 *addr = entry->xen;
647655 ist_okay = entry->ist_okay;
656+ found = true;
648657 break;
649658 }
650659 }
@@ -655,9 +664,13 @@ static bool __ref get_trap_addr(void **addr, unsigned int ist) · 4 unmodified lines
655664 nr = (*addr - (void *)early_idt_handler_array[0]) /
656665 EARLY_IDT_HANDLER_SIZE;
657666 *addr = (void *)xen_early_idt_handler_array[nr];
667+ found = true;
658668 }
659669
660− if (WARN_ON(ist != 0 && !ist_okay))
670+ if (!found)
671+ *addr = (void *)xen_asm_exc_xen_unknown_trap;
672+
673+ if (WARN_ON(found && ist != 0 && !ist_okay))
661674 return false;
662675
663676 return true;
arch/x86/xen/smp_hvm.c+19−10
@@ -33,9 +33,11 @@ static void __init xen_hvm_smp_prepare_cpus(unsigned int max_cpus) · 32 unmodified lines
3333 int cpu;
3434
3535 native_smp_prepare_cpus(max_cpus);
36− WARN_ON(xen_smp_intr_init(0));
3736
38− xen_init_lock_cpu(0);
37+ if (xen_have_vector_callback) {
38+ WARN_ON(xen_smp_intr_init(0));
39+ xen_init_lock_cpu(0);
40+ }
3941
4042 for_each_possible_cpu(cpu) {
4143 if (cpu == 0)
@@ -50,9 +52,11 @@ static void __init xen_hvm_smp_prepare_cpus(unsigned int max_cpus) · 8 unmodified lines
5052 static void xen_hvm_cpu_die(unsigned int cpu)
5153 {
5254 if (common_cpu_die(cpu) == 0) {
53− xen_smp_intr_free(cpu);
54− xen_uninit_lock_cpu(cpu);
55− xen_teardown_timer(cpu);
55+ if (xen_have_vector_callback) {
56+ xen_smp_intr_free(cpu);
57+ xen_uninit_lock_cpu(cpu);
58+ xen_teardown_timer(cpu);
59+ }
5660 }
5761 }
5862 #else
@@ -64,14 +68,19 @@ static void xen_hvm_cpu_die(unsigned int cpu) · 5 unmodified lines
6468
6569 void __init xen_hvm_smp_init(void)
6670 {
67− if (!xen_have_vector_callback)
71+ smp_ops.smp_prepare_boot_cpu = xen_hvm_smp_prepare_boot_cpu;
72+ smp_ops.smp_prepare_cpus = xen_hvm_smp_prepare_cpus;
73+ smp_ops.smp_cpus_done = xen_smp_cpus_done;
74+ smp_ops.cpu_die = xen_hvm_cpu_die;
75+
76+ if (!xen_have_vector_callback) {
77+#ifdef CONFIG_PARAVIRT_SPINLOCKS
78+ nopvspin = true;
79+#endif
6880 return;
81+ }
6982
70− smp_ops.smp_prepare_cpus = xen_hvm_smp_prepare_cpus;
7183 smp_ops.smp_send_reschedule = xen_smp_send_reschedule;
72− smp_ops.cpu_die = xen_hvm_cpu_die;
7384 smp_ops.send_call_func_ipi = xen_smp_send_call_function_ipi;
7485 smp_ops.send_call_func_single_ipi = xen_smp_send_call_function_single_ipi;
75− smp_ops.smp_prepare_boot_cpu = xen_hvm_smp_prepare_boot_cpu;
76− smp_ops.smp_cpus_done = xen_smp_cpus_done;
7786 }
arch/x86/xen/xen-asm.S+1−0
@@ -178,6 +178,7 @@ xen_pv_trap asm_exc_simd_coprocessor_error · 177 unmodified lines
178178 #ifdef CONFIG_IA32_EMULATION
179179 xen_pv_trap entry_INT80_compat
180180 #endif
181+xen_pv_trap asm_exc_xen_unknown_trap
181182 xen_pv_trap asm_exc_xen_hypervisor_callback
182183
183184 __INIT
block/blk-cgroup.c+13−5
@@ -1016,6 +1016,8 @@ static void blkcg_css_offline(struct cgroup_subsys_state *css) · 1015 unmodified lines
10161016 */
10171017 void blkcg_destroy_blkgs(struct blkcg *blkcg)
10181018 {
1019+ might_sleep();
1020+
10191021 spin_lock_irq(&blkcg->lock);
10201022
10211023 while (!hlist_empty(&blkcg->blkg_list)) {
@@ -1023,14 +1025,20 @@ void blkcg_destroy_blkgs(struct blkcg *blkcg) · 1 unmodified line
10231025 struct blkcg_gq, blkcg_node);
10241026 struct request_queue *q = blkg->q;
10251027
1026− if (spin_trylock(&q->queue_lock)) {
1027− blkg_destroy(blkg);
1028− spin_unlock(&q->queue_lock);
1029− } else {
1028+ if (need_resched() || !spin_trylock(&q->queue_lock)) {
1029+ /*
1030+ * Given that the system can accumulate a huge number
1031+ * of blkgs in pathological cases, check to see if we
1032+ * need to rescheduling to avoid softlockup.
1033+ */
10301034 spin_unlock_irq(&blkcg->lock);
1031− cpu_relax();
1035+ cond_resched();
10321036 spin_lock_irq(&blkcg->lock);
1037+ continue;
10331038 }
1039+
1040+ blkg_destroy(blkg);
1041+ spin_unlock(&q->queue_lock);
10341042 }
10351043
10361044 spin_unlock_irq(&blkcg->lock);
block/blk-iocost.c+11−5
@@ -2551,8 +2551,8 @@ static void ioc_rqos_throttle(struct rq_qos *rqos, struct bio *bio) · 2550 unmodified lines
25512551 bool use_debt, ioc_locked;
25522552 unsigned long flags;
25532553
2554− /* bypass IOs if disabled or for root cgroup */
2555− if (!ioc->enabled || !iocg->level)
2554+ /* bypass IOs if disabled, still initializing, or for root cgroup */
2555+ if (!ioc->enabled || !iocg || !iocg->level)
25562556 return;
25572557
25582558 /* calculate the absolute vtime cost */
@@ -2679,14 +2679,14 @@ static void ioc_rqos_merge(struct rq_qos *rqos, struct request *rq, · 120 unmodified lines
26792679 struct bio *bio)
26802680 {
26812681 struct ioc_gq *iocg = blkg_to_iocg(bio->bi_blkg);
2682− struct ioc *ioc = iocg->ioc;
2682+ struct ioc *ioc = rqos_to_ioc(rqos);
26832683 sector_t bio_end = bio_end_sector(bio);
26842684 struct ioc_now now;
26852685 u64 vtime, abs_cost, cost;
26862686 unsigned long flags;
26872687
2688− /* bypass if disabled or for root cgroup */
2689− if (!ioc->enabled || !iocg->level)
2688+ /* bypass if disabled, still initializing, or for root cgroup */
2689+ if (!ioc->enabled || !iocg || !iocg->level)
26902690 return;
26912691
26922692 abs_cost = calc_vtime_cost(bio, iocg, true);
@@ -2863,6 +2863,12 @@ static int blk_iocost_init(struct request_queue *q) · 170 unmodified lines
28632863 ioc_refresh_params(ioc, true);
28642864 spin_unlock_irq(&ioc->lock);
28652865
2866+ /*
2867+ * rqos must be added before activation to allow iocg_pd_init() to
2868+ * lookup the ioc from q. This means that the rqos methods may get
2869+ * called before policy activation completion, can't assume that the
2870+ * target bio has an iocg associated and need to test for NULL iocg.
2871+ */
28662872 rq_qos_add(q, rqos);
28672873 ret = blkcg_activate_policy(q, &blkcg_policy_iocost);
28682874 if (ret) {
block/blk-mq-debugfs.c+1−0
@@ -246,6 +246,7 @@ static const char *const hctx_flag_name[] = { · 245 unmodified lines
246246 HCTX_FLAG_NAME(BLOCKING),
247247 HCTX_FLAG_NAME(NO_SCHED),
248248 HCTX_FLAG_NAME(STACKING),
249+ HCTX_FLAG_NAME(TAG_HCTX_SHARED),
249250 };
250251 #undef HCTX_FLAG_NAME
251252
block/blk-mq.h+1−1
@@ -304,7 +304,7 @@ static inline bool hctx_may_queue(struct blk_mq_hw_ctx *hctx, · 303 unmodified lines
304304 struct request_queue *q = hctx->queue;
305305 struct blk_mq_tag_set *set = q->tag_set;
306306
307− if (!test_bit(BLK_MQ_S_TAG_ACTIVE, &q->queue_flags))
307+ if (!test_bit(QUEUE_FLAG_HCTX_ACTIVE, &q->queue_flags))
308308 return true;
309309 users = atomic_read(&set->active_queues_shared_sbitmap);
310310 } else {
block/genhd.c+10−6
@@ -45,10 +45,11 @@ static void disk_release_events(struct gendisk *disk); · 44 unmodified lines
4545 void set_capacity(struct gendisk *disk, sector_t sectors)
4646 {
4747 struct block_device *bdev = disk->part0;
48+ unsigned long flags;
4849
49− spin_lock(&bdev->bd_size_lock);
50+ spin_lock_irqsave(&bdev->bd_size_lock, flags);
5051 i_size_write(bdev->bd_inode, (loff_t)sectors << SECTOR_SHIFT);
51− spin_unlock(&bdev->bd_size_lock);
52+ spin_unlock_irqrestore(&bdev->bd_size_lock, flags);
5253 }
5354 EXPORT_SYMBOL(set_capacity);
5455
@@ -246,15 +247,18 @@ struct block_device *disk_part_iter_next(struct disk_part_iter *piter) · 191 unmodified lines
246247 part = rcu_dereference(ptbl->part[piter->idx]);
247248 if (!part)
248249 continue;
250+ piter->part = bdgrab(part);
251+ if (!piter->part)
252+ continue;
249253 if (!bdev_nr_sectors(part) &&
250254 !(piter->flags & DISK_PITER_INCL_EMPTY) &&
251255 !(piter->flags & DISK_PITER_INCL_EMPTY_PART0 &&
252− piter->idx == 0))
256+ piter->idx == 0)) {
257+ bdput(piter->part);
258+ piter->part = NULL;
253259 continue;
260+ }
254261
255− piter->part = bdgrab(part);
256− if (!piter->part)
257− continue;
258262 piter->idx += inc;
259263 break;
260264 }
block/partitions/core.c+5−3
@@ -88,9 +88,11 @@ static int (*check_part[])(struct parsed_partitions *) = { · 87 unmodified lines
8888
8989 static void bdev_set_nr_sectors(struct block_device *bdev, sector_t sectors)
9090 {
91− spin_lock(&bdev->bd_size_lock);
91+ unsigned long flags;
92+
93+ spin_lock_irqsave(&bdev->bd_size_lock, flags);
9294 i_size_write(bdev->bd_inode, (loff_t)sectors << SECTOR_SHIFT);
93− spin_unlock(&bdev->bd_size_lock);
95+ spin_unlock_irqrestore(&bdev->bd_size_lock, flags);
9496 }
9597
9698 static struct parsed_partitions *allocate_partitions(struct gendisk *hd)
@@ -384,7 +386,7 @@ static struct block_device *add_partition(struct gendisk *disk, int partno, · 287 unmodified lines
384386
385387 err = blk_alloc_devt(bdev, &devt);
386388 if (err)
387− goto out_bdput;
389+ goto out_put;
388390 pdev->devt = devt;
389391
390392 /* delay uevent until 'holders' subdir is created */
crypto/asymmetric_keys/asym_tpm.c+1−1
@@ -354,7 +354,7 @@ static uint32_t derive_pub_key(const void *pub_key, uint32_t len, uint8_t *buf) · 353 unmodified lines
354354 memcpy(cur, e, sizeof(e));
355355 cur += sizeof(e);
356356 /* Zero parameters to satisfy set_pub_key ABI. */
357− memset(cur, 0, SETKEY_PARAMS_SIZE);
357+ memzero_explicit(cur, SETKEY_PARAMS_SIZE);
358358
359359 return cur - buf;
360360 }
crypto/asymmetric_keys/public_key.c+2−1
@@ -356,7 +356,8 @@ int public_key_verify_signature(const struct public_key *pkey, · 355 unmodified lines
356356 if (ret)
357357 goto error_free_key;
358358
359− if (strcmp(sig->pkey_algo, "sm2") == 0 && sig->data_size) {
359+ if (sig->pkey_algo && strcmp(sig->pkey_algo, "sm2") == 0 &&
360+ sig->data_size) {
360361 ret = cert_sig_digest_update(sig, tfm);
361362 if (ret)
362363 goto error_free_key;
crypto/ecdh.c+2−1
@@ -39,7 +39,8 @@ static int ecdh_set_secret(struct crypto_kpp *tfm, const void *buf, · 38 unmodified lines
3939 struct ecdh params;
4040 unsigned int ndigits;
4141
42− if (crypto_ecdh_decode_key(buf, len, &params) < 0)
42+ if (crypto_ecdh_decode_key(buf, len, &params) < 0 ||
43+ params.key_size > sizeof(ctx->private_key))
4344 return -EINVAL;
4445
4546 ndigits = ecdh_supported_curve(params.curve_id);
crypto/xor.c+2−0
@@ -107,6 +107,8 @@ do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2) · 106 unmodified lines
107107 preempt_enable();
108108
109109 // bytes/ns == GB/s, multiply by 1000 to get MB/s [not MiB/s]
110+ if (!min)
111+ min = 1;
110112 speed = (1000 * REPS * BENCH_SIZE) / (unsigned int)ktime_to_ns(min);
111113 tmpl->speed = speed;
112114
drivers/acpi/Kconfig+0−6
@@ -395,9 +395,6 @@ config ACPI_CONTAINER · 394 unmodified lines
395395
396396 This helps support hotplug of nodes, CPUs, and memory.
397397
398− To compile this driver as a module, choose M here:
399− the module will be called container.
400−
401398 config ACPI_HOTPLUG_MEMORY
402399 bool "Memory Hotplug"
403400 depends on MEMORY_HOTPLUG
@@ -411,9 +408,6 @@ config ACPI_HOTPLUG_MEMORY · 7 unmodified lines
411408 removing memory devices at runtime, you need not enable
412409 this driver.
413410
414− To compile this driver as a module, choose M here:
415− the module will be called acpi_memhotplug.
416−
417411 config ACPI_HOTPLUG_IOAPIC
418412 bool
419413 depends on PCI
drivers/acpi/acpica/nsrepair2.c+13−4
@@ -495,8 +495,9 @@ acpi_ns_repair_HID(struct acpi_evaluate_info *info, · 494 unmodified lines
495495 union acpi_operand_object **return_object_ptr)
496496 {
497497 union acpi_operand_object *return_object = *return_object_ptr;
498− char *dest;
498+ union acpi_operand_object *new_string;
499499 char *source;
500+ char *dest;
500501
501502 ACPI_FUNCTION_NAME(ns_repair_HID);
502503
@@ -517,6 +518,13 @@ acpi_ns_repair_HID(struct acpi_evaluate_info *info, · 14 unmodified lines
517518 return_ACPI_STATUS(AE_OK);
518519 }
519520
521+ /* It is simplest to always create a new string object */
522+
523+ new_string = acpi_ut_create_string_object(return_object->string.length);
524+ if (!new_string) {
525+ return_ACPI_STATUS(AE_NO_MEMORY);
526+ }
527+
520528 /*
521529 * Remove a leading asterisk if present. For some unknown reason, there
522530 * are many machines in the field that contains IDs like this.
@@ -526,7 +534,7 @@ acpi_ns_repair_HID(struct acpi_evaluate_info *info, · 3 unmodified lines
526534 source = return_object->string.pointer;
527535 if (*source == '*') {
528536 source++;
529− return_object->string.length--;
537+ new_string->string.length--;
530538
531539 ACPI_DEBUG_PRINT((ACPI_DB_REPAIR,
532540 "%s: Removed invalid leading asterisk\n",
@@ -541,11 +549,12 @@ acpi_ns_repair_HID(struct acpi_evaluate_info *info, · 8 unmodified lines
541549 * "NNNN####" where N is an uppercase letter or decimal digit, and
542550 * # is a hex digit.
543551 */
544− for (dest = return_object->string.pointer; *source; dest++, source++) {
552+ for (dest = new_string->string.pointer; *source; dest++, source++) {
545553 *dest = (char)toupper((int)*source);
546554 }
547− return_object->string.pointer[return_object->string.length] = 0;
548555
556+ acpi_ut_remove_reference(return_object);
557+ *return_object_ptr = new_string;
549558 return_ACPI_STATUS(AE_OK);
550559 }
551560
drivers/acpi/arm64/iort.c+12−2
@@ -1107,6 +1107,11 @@ static int nc_dma_get_range(struct device *dev, u64 *size) · 1106 unmodified lines
11071107
11081108 ncomp = (struct acpi_iort_named_component *)node->node_data;
11091109
1110+ if (!ncomp->memory_address_limit) {
1111+ pr_warn(FW_BUG "Named component missing memory address limit\n");
1112+ return -EINVAL;
1113+ }
1114+
11101115 *size = ncomp->memory_address_limit >= 64 ? U64_MAX :
11111116 1ULL<<ncomp->memory_address_limit;
11121117
@@ -1126,6 +1131,11 @@ static int rc_dma_get_range(struct device *dev, u64 *size) · 13 unmodified lines
11261131
11271132 rc = (struct acpi_iort_root_complex *)node->node_data;
11281133
1134+ if (!rc->memory_address_limit) {
1135+ pr_warn(FW_BUG "Root complex missing memory address limit\n");
1136+ return -EINVAL;
1137+ }
1138+
11291139 *size = rc->memory_address_limit >= 64 ? U64_MAX :
11301140 1ULL<<rc->memory_address_limit;
11311141
@@ -1173,8 +1183,8 @@ void iort_dma_setup(struct device *dev, u64 *dma_addr, u64 *dma_size) · 41 unmodified lines
11731183 end = dmaaddr + size - 1;
11741184 mask = DMA_BIT_MASK(ilog2(end) + 1);
11751185 dev->bus_dma_limit = end;
1176− dev->coherent_dma_mask = mask;
1177− *dev->dma_mask = mask;
1186+ dev->coherent_dma_mask = min(dev->coherent_dma_mask, mask);
1187+ *dev->dma_mask = min(*dev->dma_mask, mask);
11781188 }
11791189
11801190 *dma_addr = dmaaddr;
drivers/acpi/device_sysfs.c+6−14
@@ -251,20 +251,12 @@ int __acpi_device_uevent_modalias(struct acpi_device *adev, · 250 unmodified lines
251251 if (add_uevent_var(env, "MODALIAS="))
252252 return -ENOMEM;
253253
254− len = create_pnp_modalias(adev, &env->buf[env->buflen - 1],
255− sizeof(env->buf) - env->buflen);
256− if (len < 0)
257− return len;
258−
259− env->buflen += len;
260− if (!adev->data.of_compatible)
261− return 0;
262−
263− if (len > 0 && add_uevent_var(env, "MODALIAS="))
264− return -ENOMEM;
265−
266− len = create_of_modalias(adev, &env->buf[env->buflen - 1],
267− sizeof(env->buf) - env->buflen);
254+ if (adev->data.of_compatible)
255+ len = create_of_modalias(adev, &env->buf[env->buflen - 1],
256+ sizeof(env->buf) - env->buflen);
257+ else
258+ len = create_pnp_modalias(adev, &env->buf[env->buflen - 1],
259+ sizeof(env->buf) - env->buflen);
268260 if (len < 0)
269261 return len;
270262
drivers/acpi/internal.h+1−1
@@ -97,7 +97,7 @@ void acpi_scan_table_handler(u32 event, void *table, void *context); · 96 unmodified lines
9797 extern struct list_head acpi_bus_id_list;
9898
9999 struct acpi_device_bus_id {
100− char bus_id[15];
100+ const char *bus_id;
101101 unsigned int instance_no;
102102 struct list_head node;
103103 };
drivers/acpi/nfit/core.c+28−47
@@ -2269,40 +2269,24 @@ static const struct attribute_group *acpi_nfit_region_attribute_groups[] = { · 2268 unmodified lines
22692269
22702270 /* enough info to uniquely specify an interleave set */
22712271 struct nfit_set_info {
2272− struct nfit_set_info_map {
2273− u64 region_offset;
2274− u32 serial_number;
2275− u32 pad;
2276− } mapping[0];
2272+ u64 region_offset;
2273+ u32 serial_number;
2274+ u32 pad;
22772275 };
22782276
22792277 struct nfit_set_info2 {
2280− struct nfit_set_info_map2 {
2281− u64 region_offset;
2282− u32 serial_number;
2283− u16 vendor_id;
2284− u16 manufacturing_date;
2285− u8 manufacturing_location;
2286− u8 reserved[31];
2287− } mapping[0];
2278+ u64 region_offset;
2279+ u32 serial_number;
2280+ u16 vendor_id;
2281+ u16 manufacturing_date;
2282+ u8 manufacturing_location;
2283+ u8 reserved[31];
22882284 };
22892285
2290−static size_t sizeof_nfit_set_info(int num_mappings)
2291−{
2292− return sizeof(struct nfit_set_info)
2293− + num_mappings * sizeof(struct nfit_set_info_map);
2294−}
2295−
2296−static size_t sizeof_nfit_set_info2(int num_mappings)
2297−{
2298− return sizeof(struct nfit_set_info2)
2299− + num_mappings * sizeof(struct nfit_set_info_map2);
2300−}
2301−
23022286 static int cmp_map_compat(const void *m0, const void *m1)
23032287 {
2304− const struct nfit_set_info_map *map0 = m0;
2305− const struct nfit_set_info_map *map1 = m1;
2288+ const struct nfit_set_info *map0 = m0;
2289+ const struct nfit_set_info *map1 = m1;
23062290
23072291 return memcmp(&map0->region_offset, &map1->region_offset,
23082292 sizeof(u64));
@@ -2310,8 +2294,8 @@ static int cmp_map_compat(const void *m0, const void *m1) · 1 unmodified line
23102294
23112295 static int cmp_map(const void *m0, const void *m1)
23122296 {
2313− const struct nfit_set_info_map *map0 = m0;
2314− const struct nfit_set_info_map *map1 = m1;
2297+ const struct nfit_set_info *map0 = m0;
2298+ const struct nfit_set_info *map1 = m1;
23152299
23162300 if (map0->region_offset < map1->region_offset)
23172301 return -1;
@@ -2322,8 +2306,8 @@ static int cmp_map(const void *m0, const void *m1) · 4 unmodified lines
23222306
23232307 static int cmp_map2(const void *m0, const void *m1)
23242308 {
2325− const struct nfit_set_info_map2 *map0 = m0;
2326− const struct nfit_set_info_map2 *map1 = m1;
2309+ const struct nfit_set_info2 *map0 = m0;
2310+ const struct nfit_set_info2 *map1 = m1;
23272311
23282312 if (map0->region_offset < map1->region_offset)
23292313 return -1;
@@ -2361,22 +2345,22 @@ static int acpi_nfit_init_interleave_set(struct acpi_nfit_desc *acpi_desc, · 31 unmodified lines
23612345 return -ENOMEM;
23622346 import_guid(&nd_set->type_guid, spa->range_guid);
23632347
2364− info = devm_kzalloc(dev, sizeof_nfit_set_info(nr), GFP_KERNEL);
2348+ info = devm_kcalloc(dev, nr, sizeof(*info), GFP_KERNEL);
23652349 if (!info)
23662350 return -ENOMEM;
23672351
2368− info2 = devm_kzalloc(dev, sizeof_nfit_set_info2(nr), GFP_KERNEL);
2352+ info2 = devm_kcalloc(dev, nr, sizeof(*info2), GFP_KERNEL);
23692353 if (!info2)
23702354 return -ENOMEM;
23712355
23722356 for (i = 0; i < nr; i++) {
23732357 struct nd_mapping_desc *mapping = &ndr_desc->mapping[i];
2374− struct nfit_set_info_map *map = &info->mapping[i];
2375− struct nfit_set_info_map2 *map2 = &info2->mapping[i];
23762358 struct nvdimm *nvdimm = mapping->nvdimm;
23772359 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm);
2378− struct acpi_nfit_memory_map *memdev = memdev_from_spa(acpi_desc,
2379− spa->range_index, i);
2360+ struct nfit_set_info *map = &info[i];
2361+ struct nfit_set_info2 *map2 = &info2[i];
2362+ struct acpi_nfit_memory_map *memdev =
2363+ memdev_from_spa(acpi_desc, spa->range_index, i);
23802364 struct acpi_nfit_control_region *dcr = nfit_mem->dcr;
23812365
23822366 if (!memdev || !nfit_mem->dcr) {
@@ -2395,23 +2379,20 @@ static int acpi_nfit_init_interleave_set(struct acpi_nfit_desc *acpi_desc, · 12 unmodified lines
23952379 }
23962380
23972381 /* v1.1 namespaces */
2398− sort(&info->mapping[0], nr, sizeof(struct nfit_set_info_map),
2399− cmp_map, NULL);
2400− nd_set->cookie1 = nd_fletcher64(info, sizeof_nfit_set_info(nr), 0);
2382+ sort(info, nr, sizeof(*info), cmp_map, NULL);
2383+ nd_set->cookie1 = nd_fletcher64(info, sizeof(*info) * nr, 0);
24012384
24022385 /* v1.2 namespaces */
2403− sort(&info2->mapping[0], nr, sizeof(struct nfit_set_info_map2),
2404− cmp_map2, NULL);
2405− nd_set->cookie2 = nd_fletcher64(info2, sizeof_nfit_set_info2(nr), 0);
2386+ sort(info2, nr, sizeof(*info2), cmp_map2, NULL);
2387+ nd_set->cookie2 = nd_fletcher64(info2, sizeof(*info2) * nr, 0);
24062388
24072389 /* support v1.1 namespaces created with the wrong sort order */
2408− sort(&info->mapping[0], nr, sizeof(struct nfit_set_info_map),
2409− cmp_map_compat, NULL);
2410− nd_set->altcookie = nd_fletcher64(info, sizeof_nfit_set_info(nr), 0);
2390+ sort(info, nr, sizeof(*info), cmp_map_compat, NULL);
2391+ nd_set->altcookie = nd_fletcher64(info, sizeof(*info) * nr, 0);
24112392
24122393 /* record the result of the sort for the mapping position */
24132394 for (i = 0; i < nr; i++) {
2414− struct nfit_set_info_map2 *map2 = &info2->mapping[i];
2395+ struct nfit_set_info2 *map2 = &info2[i];
24152396 int j;
24162397
24172398 for (j = 0; j < nr; j++) {
drivers/acpi/scan.c+21−6
@@ -486,6 +486,7 @@ static void acpi_device_del(struct acpi_device *device) · 485 unmodified lines
486486 acpi_device_bus_id->instance_no--;
487487 else {
488488 list_del(&acpi_device_bus_id->node);
489+ kfree_const(acpi_device_bus_id->bus_id);
489490 kfree(acpi_device_bus_id);
490491 }
491492 break;
@@ -585,6 +586,8 @@ static int acpi_get_device_data(acpi_handle handle, struct acpi_device **device, · 93 unmodified lines
585586 if (!device)
586587 return -EINVAL;
587588
589+ *device = NULL;
590+
588591 status = acpi_get_data_full(handle, acpi_scan_drop_device,
589592 (void **)device, callback);
590593 if (ACPI_FAILURE(status) || !*device) {
@@ -674,7 +677,14 @@ int acpi_device_add(struct acpi_device *device, · 83 unmodified lines
674677 }
675678 if (!found) {
676679 acpi_device_bus_id = new_bus_id;
677− strcpy(acpi_device_bus_id->bus_id, acpi_device_hid(device));
680+ acpi_device_bus_id->bus_id =
681+ kstrdup_const(acpi_device_hid(device), GFP_KERNEL);
682+ if (!acpi_device_bus_id->bus_id) {
683+ pr_err(PREFIX "Memory allocation error for bus id\n");
684+ result = -ENOMEM;
685+ goto err_free_new_bus_id;
686+ }
687+
678688 acpi_device_bus_id->instance_no = 0;
679689 list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list);
680690 }
@@ -709,6 +719,11 @@ int acpi_device_add(struct acpi_device *device, · 28 unmodified lines
709719 if (device->parent)
710720 list_del(&device->node);
711721 list_del(&device->wakeup_list);
722+
723+ err_free_new_bus_id:
724+ if (!found)
725+ kfree(new_bus_id);
726+
712727 mutex_unlock(&acpi_device_lock);
713728
714729 err_detach:
@@ -2108,12 +2123,12 @@ void acpi_walk_dep_device_list(acpi_handle handle) · 1393 unmodified lines
21082123 list_for_each_entry_safe(dep, tmp, &acpi_dep_list, node) {
21092124 if (dep->supplier == handle) {
21102125 acpi_bus_get_device(dep->consumer, &adev);
2111− if (!adev)
2112− continue;
21132126
2114− adev->dep_unmet--;
2115− if (!adev->dep_unmet)
2116− acpi_bus_attach(adev, true);
2127+ if (adev) {
2128+ adev->dep_unmet--;
2129+ if (!adev->dep_unmet)
2130+ acpi_bus_attach(adev, true);
2131+ }
21172132
21182133 list_del(&dep->node);
21192134 kfree(dep);
drivers/acpi/thermal.c+33−13
@@ -174,6 +174,8 @@ struct acpi_thermal { · 173 unmodified lines
174174 struct thermal_zone_device *thermal_zone;
175175 int kelvin_offset; /* in millidegrees */
176176 struct work_struct thermal_check_work;
177+ struct mutex thermal_check_lock;
178+ refcount_t thermal_check_count;
177179 };
178180
179181 /* --------------------------------------------------------------------------
@@ -495,14 +497,6 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz) · 315 unmodified lines
495497 return 0;
496498 }
497499
498−static void acpi_thermal_check(void *data)
499−{
500− struct acpi_thermal *tz = data;
501−
502− thermal_zone_device_update(tz->thermal_zone,
503− THERMAL_EVENT_UNSPECIFIED);
504−}
505−
506500 /* sys I/F for generic thermal sysfs support */
507501
508502 static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp)
@@ -900,6 +894,12 @@ static void acpi_thermal_unregister_thermal_zone(struct acpi_thermal *tz) · 391 unmodified lines
900894 Driver Interface
901895 -------------------------------------------------------------------------- */
902896
897+static void acpi_queue_thermal_check(struct acpi_thermal *tz)
898+{
899+ if (!work_pending(&tz->thermal_check_work))
900+ queue_work(acpi_thermal_pm_queue, &tz->thermal_check_work);
901+}
902+
903903 static void acpi_thermal_notify(struct acpi_device *device, u32 event)
904904 {
905905 struct acpi_thermal *tz = acpi_driver_data(device);
@@ -910,17 +910,17 @@ static void acpi_thermal_notify(struct acpi_device *device, u32 event) · 4 unmodified lines
910910
911911 switch (event) {
912912 case ACPI_THERMAL_NOTIFY_TEMPERATURE:
913− acpi_thermal_check(tz);
913+ acpi_queue_thermal_check(tz);
914914 break;
915915 case ACPI_THERMAL_NOTIFY_THRESHOLDS:
916916 acpi_thermal_trips_update(tz, ACPI_TRIPS_REFRESH_THRESHOLDS);
917− acpi_thermal_check(tz);
917+ acpi_queue_thermal_check(tz);
918918 acpi_bus_generate_netlink_event(device->pnp.device_class,
919919 dev_name(&device->dev), event, 0);
920920 break;
921921 case ACPI_THERMAL_NOTIFY_DEVICES:
922922 acpi_thermal_trips_update(tz, ACPI_TRIPS_REFRESH_DEVICES);
923− acpi_thermal_check(tz);
923+ acpi_queue_thermal_check(tz);
924924 acpi_bus_generate_netlink_event(device->pnp.device_class,
925925 dev_name(&device->dev), event, 0);
926926 break;
@@ -1020,7 +1020,25 @@ static void acpi_thermal_check_fn(struct work_struct *work) · 93 unmodified lines
10201020 {
10211021 struct acpi_thermal *tz = container_of(work, struct acpi_thermal,
10221022 thermal_check_work);
1023− acpi_thermal_check(tz);
1023+
1024+ /*
1025+ * In general, it is not sufficient to check the pending bit, because
1026+ * subsequent instances of this function may be queued after one of them
1027+ * has started running (e.g. if _TMP sleeps). Avoid bailing out if just
1028+ * one of them is running, though, because it may have done the actual
1029+ * check some time ago, so allow at least one of them to block on the
1030+ * mutex while another one is running the update.
1031+ */
1032+ if (!refcount_dec_not_one(&tz->thermal_check_count))
1033+ return;
1034+
1035+ mutex_lock(&tz->thermal_check_lock);
1036+
1037+ thermal_zone_device_update(tz->thermal_zone, THERMAL_EVENT_UNSPECIFIED);
1038+
1039+ refcount_inc(&tz->thermal_check_count);
1040+
1041+ mutex_unlock(&tz->thermal_check_lock);
10241042 }
10251043
10261044 static int acpi_thermal_add(struct acpi_device *device)
@@ -1052,6 +1070,8 @@ static int acpi_thermal_add(struct acpi_device *device) · 25 unmodified lines
10521070 if (result)
10531071 goto free_memory;
10541072
1073+ refcount_set(&tz->thermal_check_count, 3);
1074+ mutex_init(&tz->thermal_check_lock);
10551075 INIT_WORK(&tz->thermal_check_work, acpi_thermal_check_fn);
10561076
10571077 pr_info(PREFIX "%s [%s] (%ld C)\n", acpi_device_name(device),
@@ -1117,7 +1137,7 @@ static int acpi_thermal_resume(struct device *dev) · 59 unmodified lines
11171137 tz->state.active |= tz->trips.active[i].flags.enabled;
11181138 }
11191139
1120− queue_work(acpi_thermal_pm_queue, &tz->thermal_check_work);
1140+ acpi_queue_thermal_check(tz);
11211141
11221142 return AE_OK;
11231143 }
drivers/acpi/x86/s2idle.c+1−13
@@ -105,18 +105,8 @@ static void lpi_device_get_constraints_amd(void) · 104 unmodified lines
105105
106106 for (i = 0; i < out_obj->package.count; i++) {
107107 union acpi_object *package = &out_obj->package.elements[i];
108− struct lpi_device_info_amd info = { };
109108
110− if (package->type == ACPI_TYPE_INTEGER) {
111− switch (i) {
112− case 0:
113− info.revision = package->integer.value;
114− break;
115− case 1:
116− info.count = package->integer.value;
117− break;
118− }
119− } else if (package->type == ACPI_TYPE_PACKAGE) {
109+ if (package->type == ACPI_TYPE_PACKAGE) {
120110 lpi_constraints_table = kcalloc(package->package.count,
121111 sizeof(*lpi_constraints_table),
122112 GFP_KERNEL);
@@ -135,12 +125,10 @@ static void lpi_device_get_constraints_amd(void) · 12 unmodified lines
135125
136126 for (k = 0; k < info_obj->package.count; ++k) {
137127 union acpi_object *obj = &info_obj->package.elements[k];
138− union acpi_object *obj_new;
139128
140129 list = &lpi_constraints_table[lpi_constraints_table_size];
141130 list->min_dstate = -1;
142131
143− obj_new = &obj[k];
144132 switch (k) {
145133 case 0:
146134 dev_info.enabled = obj->integer.value;
drivers/atm/idt77252.c+1−1
@@ -3607,7 +3607,7 @@ static int idt77252_init_one(struct pci_dev *pcidev, · 3606 unmodified lines
36073607
36083608 if ((err = dma_set_mask_and_coherent(&pcidev->dev, DMA_BIT_MASK(32)))) {
36093609 printk("idt77252: can't enable DMA for PCI device at %s\n", pci_name(pcidev));
3610− return err;
3610+ goto err_out_disable_pdev;
36113611 }
36123612
36133613 card = kzalloc(sizeof(struct idt77252_dev), GFP_KERNEL);
drivers/base/core.c+39−14
@@ -208,6 +208,16 @@ int device_links_read_lock_held(void) · 207 unmodified lines
208208 #endif
209209 #endif /* !CONFIG_SRCU */
210210
211+static bool device_is_ancestor(struct device *dev, struct device *target)
212+{
213+ while (target->parent) {
214+ target = target->parent;
215+ if (dev == target)
216+ return true;
217+ }
218+ return false;
219+}
220+
211221 /**
212222 * device_is_dependent - Check if one device depends on another one
213223 * @dev: Device to check dependencies for.
@@ -221,7 +231,12 @@ int device_is_dependent(struct device *dev, void *target) · 7 unmodified lines
221231 struct device_link *link;
222232 int ret;
223233
224− if (dev == target)
234+ /*
235+ * The "ancestors" check is needed to catch the case when the target
236+ * device has not been completely initialized yet and it is still
237+ * missing from the list of children of its parent device.
238+ */
239+ if (dev == target || device_is_ancestor(dev, target))
225240 return 1;
226241
227242 ret = device_for_each_child(dev, target, device_is_dependent);
@@ -456,7 +471,9 @@ static int devlink_add_symlinks(struct device *dev, · 228 unmodified lines
456471 struct device *con = link->consumer;
457472 char *buf;
458473
459− len = max(strlen(dev_name(sup)), strlen(dev_name(con)));
474+ len = max(strlen(dev_bus_name(sup)) + strlen(dev_name(sup)),
475+ strlen(dev_bus_name(con)) + strlen(dev_name(con)));
476+ len += strlen(":");
460477 len += strlen("supplier:") + 1;
461478 buf = kzalloc(len, GFP_KERNEL);
462479 if (!buf)
@@ -470,12 +487,12 @@ static int devlink_add_symlinks(struct device *dev, · 7 unmodified lines
470487 if (ret)
471488 goto err_con;
472489
473− snprintf(buf, len, "consumer:%s", dev_name(con));
490+ snprintf(buf, len, "consumer:%s:%s", dev_bus_name(con), dev_name(con));
474491 ret = sysfs_create_link(&sup->kobj, &link->link_dev.kobj, buf);
475492 if (ret)
476493 goto err_con_dev;
477494
478− snprintf(buf, len, "supplier:%s", dev_name(sup));
495+ snprintf(buf, len, "supplier:%s:%s", dev_bus_name(sup), dev_name(sup));
479496 ret = sysfs_create_link(&con->kobj, &link->link_dev.kobj, buf);
480497 if (ret)
481498 goto err_sup_dev;
@@ -483,7 +500,7 @@ static int devlink_add_symlinks(struct device *dev, · 1 unmodified line
483500 goto out;
484501
485502 err_sup_dev:
486− snprintf(buf, len, "consumer:%s", dev_name(con));
503+ snprintf(buf, len, "consumer:%s:%s", dev_bus_name(con), dev_name(con));
487504 sysfs_remove_link(&sup->kobj, buf);
488505 err_con_dev:
489506 sysfs_remove_link(&link->link_dev.kobj, "consumer");
@@ -506,7 +523,9 @@ static void devlink_remove_symlinks(struct device *dev, · 16 unmodified lines
506523 sysfs_remove_link(&link->link_dev.kobj, "consumer");
507524 sysfs_remove_link(&link->link_dev.kobj, "supplier");
508525
509− len = max(strlen(dev_name(sup)), strlen(dev_name(con)));
526+ len = max(strlen(dev_bus_name(sup)) + strlen(dev_name(sup)),
527+ strlen(dev_bus_name(con)) + strlen(dev_name(con)));
528+ len += strlen(":");
510529 len += strlen("supplier:") + 1;
511530 buf = kzalloc(len, GFP_KERNEL);
512531 if (!buf) {
@@ -514,9 +533,9 @@ static void devlink_remove_symlinks(struct device *dev, · 1 unmodified line
514533 return;
515534 }
516535
517− snprintf(buf, len, "supplier:%s", dev_name(sup));
536+ snprintf(buf, len, "supplier:%s:%s", dev_bus_name(sup), dev_name(sup));
518537 sysfs_remove_link(&con->kobj, buf);
519− snprintf(buf, len, "consumer:%s", dev_name(con));
538+ snprintf(buf, len, "consumer:%s:%s", dev_bus_name(con), dev_name(con));
520539 sysfs_remove_link(&sup->kobj, buf);
521540 kfree(buf);
522541 }
@@ -737,8 +756,9 @@ struct device_link *device_link_add(struct device *consumer, · 214 unmodified lines
737756
738757 link->link_dev.class = &devlink_class;
739758 device_set_pm_not_required(&link->link_dev);
740− dev_set_name(&link->link_dev, "%s--%s",
741− dev_name(supplier), dev_name(consumer));
759+ dev_set_name(&link->link_dev, "%s:%s--%s:%s",
760+ dev_bus_name(supplier), dev_name(supplier),
761+ dev_bus_name(consumer), dev_name(consumer));
742762 if (device_register(&link->link_dev)) {
743763 put_device(consumer);
744764 put_device(supplier);
@@ -1808,9 +1828,7 @@ const char *dev_driver_string(const struct device *dev) · 1063 unmodified lines
18081828 * never change once they are set, so they don't need special care.
18091829 */
18101830 drv = READ_ONCE(dev->driver);
1811− return drv ? drv->name :
1812− (dev->bus ? dev->bus->name :
1813− (dev->class ? dev->class->name : ""));
1831+ return drv ? drv->name : dev_bus_name(dev);
18141832 }
18151833 EXPORT_SYMBOL(dev_driver_string);
18161834
@@ -4414,6 +4432,12 @@ static inline bool fwnode_is_primary(struct fwnode_handle *fwnode) · 2597 unmodified lines
44144432 *
44154433 * Set the device's firmware node pointer to @fwnode, but if a secondary
44164434 * firmware node of the device is present, preserve it.
4435+ *
4436+ * Valid fwnode cases are:
4437+ * - primary --> secondary --> -ENODEV
4438+ * - primary --> NULL
4439+ * - secondary --> -ENODEV
4440+ * - NULL
44174441 */
44184442 void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode)
44194443 {
@@ -4432,8 +4456,9 @@ void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode) · 12 unmodified lines
44324456 } else {
44334457 if (fwnode_is_primary(fn)) {
44344458 dev->fwnode = fn->secondary;
4459+ /* Set fn->secondary = NULL, so fn remains the primary fwnode */
44354460 if (!(parent && fn == parent->fwnode))
4436− fn->secondary = ERR_PTR(-ENODEV);
4461+ fn->secondary = NULL;
44374462 } else {
44384463 dev->fwnode = NULL;
44394464 }
drivers/base/dd.c+2−7
@@ -370,13 +370,6 @@ static void driver_bound(struct device *dev) · 369 unmodified lines
370370
371371 device_pm_check_callbacks(dev);
372372
373− /*
374− * Reorder successfully probed devices to the end of the device list.
375− * This ensures that suspend/resume order matches probe order, which
376− * is usually what drivers rely on.
377− */
378− device_pm_move_to_tail(dev);
379−
380373 /*
381374 * Make sure the device is no longer in one of the deferred lists and
382375 * kick off retrying all pending devices
@@ -619,6 +612,8 @@ dev_groups_failed: · 236 unmodified lines
619612 else if (drv->remove)
620613 drv->remove(dev);
621614 probe_failed:
615+ kfree(dev->dma_range_map);
616+ dev->dma_range_map = NULL;
622617 if (dev->bus)
623618 blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
624619 BUS_NOTIFY_DRIVER_NOT_BOUND, dev);
drivers/base/platform.c+2−0
@@ -366,6 +366,8 @@ int devm_platform_get_irqs_affinity(struct platform_device *dev, · 365 unmodified lines
366366 return -ERANGE;
367367
368368 nvec = platform_irq_count(dev);
369+ if (nvec < 0)
370+ return nvec;
369371
370372 if (nvec < minvec)
371373 return -ENOSPC;
drivers/base/regmap/regmap-debugfs.c+7−2
@@ -582,8 +582,12 @@ void regmap_debugfs_init(struct regmap *map) · 581 unmodified lines
582582 devname = dev_name(map->dev);
583583
584584 if (name) {
585− map->debugfs_name = kasprintf(GFP_KERNEL, "%s-%s",
585+ if (!map->debugfs_name) {
586+ map->debugfs_name = kasprintf(GFP_KERNEL, "%s-%s",
586587 devname, name);
588+ if (!map->debugfs_name)
589+ return;
590+ }
587591 name = map->debugfs_name;
588592 } else {
589593 name = devname;
@@ -591,9 +595,10 @@ void regmap_debugfs_init(struct regmap *map) · 1 unmodified line
591595
592596 if (!strcmp(name, "dummy")) {
593597 kfree(map->debugfs_name);
594−
595598 map->debugfs_name = kasprintf(GFP_KERNEL, "dummy%d",
596599 dummy_index);
600+ if (!map->debugfs_name)
601+ return;
597602 name = map->debugfs_name;
598603 dummy_index++;
599604 }
drivers/block/Kconfig+1−0
@@ -445,6 +445,7 @@ config BLK_DEV_RBD · 444 unmodified lines
445445 config BLK_DEV_RSXX
446446 tristate "IBM Flash Adapter 900GB Full Height PCIe Device Driver"
447447 depends on PCI
448+ select CRC32
448449 help
449450 Device driver for IBM's high speed PCIe SSD
450451 storage device: Flash Adapter 900GB Full Height.
drivers/block/nbd.c+8−0
@@ -1022,6 +1022,12 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg, · 1021 unmodified lines
10221022 if (!sock)
10231023 return err;
10241024
1025+ /*
1026+ * We need to make sure we don't get any errant requests while we're
1027+ * reallocating the ->socks array.
1028+ */
1029+ blk_mq_freeze_queue(nbd->disk->queue);
1030+
10251031 if (!netlink && !nbd->task_setup &&
10261032 !test_bit(NBD_RT_BOUND, &config->runtime_flags))
10271033 nbd->task_setup = current;
@@ -1060,10 +1066,12 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg, · 32 unmodified lines
10601066 nsock->cookie = 0;
10611067 socks[config->num_connections++] = nsock;
10621068 atomic_inc(&config->live_connections);
1069+ blk_mq_unfreeze_queue(nbd->disk->queue);
10631070
10641071 return 0;
10651072
10661073 put_socket:
1074+ blk_mq_unfreeze_queue(nbd->disk->queue);
10671075 sockfd_put(sock);
10681076 return err;
10691077 }
drivers/block/null_blk/zoned.c+9−7
@@ -6,7 +6,10 @@ · 5 unmodified lines
66 #define CREATE_TRACE_POINTS
77 #include "trace.h"
88
9−#define MB_TO_SECTS(mb) (((sector_t)mb * SZ_1M) >> SECTOR_SHIFT)
9+static inline sector_t mb_to_sects(unsigned long mb)
10+{
11+ return ((sector_t)mb * SZ_1M) >> SECTOR_SHIFT;
12+}
1013
1114 static inline unsigned int null_zone_no(struct nullb_device *dev, sector_t sect)
1215 {
@@ -77,12 +80,11 @@ int null_init_zoned_dev(struct nullb_device *dev, struct request_queue *q) · 64 unmodified lines
7780 return -EINVAL;
7881 }
7982
80− zone_capacity_sects = MB_TO_SECTS(dev->zone_capacity);
81− dev_capacity_sects = MB_TO_SECTS(dev->size);
82− dev->zone_size_sects = MB_TO_SECTS(dev->zone_size);
83− dev->nr_zones = dev_capacity_sects >> ilog2(dev->zone_size_sects);
84− if (dev_capacity_sects & (dev->zone_size_sects - 1))
85− dev->nr_zones++;
83+ zone_capacity_sects = mb_to_sects(dev->zone_capacity);
84+ dev_capacity_sects = mb_to_sects(dev->size);
85+ dev->zone_size_sects = mb_to_sects(dev->zone_size);
86+ dev->nr_zones = round_up(dev_capacity_sects, dev->zone_size_sects)
87+ >> ilog2(dev->zone_size_sects);
8688
8789 dev->zones = kvmalloc_array(dev->nr_zones, sizeof(struct nullb_zone),
8890 GFP_KERNEL | __GFP_ZERO);
drivers/block/rnbd/Kconfig+1−0
@@ -7,6 +7,7 @@ config BLK_DEV_RNBD_CLIENT · 6 unmodified lines
77 tristate "RDMA Network Block Device driver client"
88 depends on INFINIBAND_RTRS_CLIENT
99 select BLK_DEV_RNBD
10+ select SG_POOL
1011 help
1112 RNBD client is a network block device driver using rdma transport.
1213
drivers/block/rnbd/README+1−0
@@ -90,3 +90,4 @@ Kleber Souza <kleber.souza@profitbricks.com> · 89 unmodified lines
9090 Lutz Pogrell <lutz.pogrell@cloud.ionos.com>
9191 Milind Dumbare <Milind.dumbare@gmail.com>
9292 Roman Penyaev <roman.penyaev@profitbricks.com>
93+Swapnil Ingle <ingleswapnil@gmail.com>
drivers/block/rnbd/rnbd-clt.c+9−9
@@ -375,12 +375,19 @@ static struct rnbd_iu *rnbd_get_iu(struct rnbd_clt_session *sess, · 374 unmodified lines
375375 init_waitqueue_head(&iu->comp.wait);
376376 iu->comp.errno = INT_MAX;
377377
378+ if (sg_alloc_table(&iu->sgt, 1, GFP_KERNEL)) {
379+ rnbd_put_permit(sess, permit);
380+ kfree(iu);
381+ return NULL;
382+ }
383+
378384 return iu;
379385 }
380386
381387 static void rnbd_put_iu(struct rnbd_clt_session *sess, struct rnbd_iu *iu)
382388 {
383389 if (atomic_dec_and_test(&iu->refcount)) {
390+ sg_free_table(&iu->sgt);
384391 rnbd_put_permit(sess, iu->permit);
385392 kfree(iu);
386393 }
@@ -487,8 +494,6 @@ static int send_msg_close(struct rnbd_clt_dev *dev, u32 device_id, bool wait) · 100 unmodified lines
487494 iu->buf = NULL;
488495 iu->dev = dev;
489496
490− sg_alloc_table(&iu->sgt, 1, GFP_KERNEL);
491−
492497 msg.hdr.type = cpu_to_le16(RNBD_MSG_CLOSE);
493498 msg.device_id = cpu_to_le32(device_id);
494499
@@ -502,7 +507,6 @@ static int send_msg_close(struct rnbd_clt_dev *dev, u32 device_id, bool wait) · 7 unmodified lines
502507 err = errno;
503508 }
504509
505− sg_free_table(&iu->sgt);
506510 rnbd_put_iu(sess, iu);
507511 return err;
508512 }
@@ -575,7 +579,6 @@ static int send_msg_open(struct rnbd_clt_dev *dev, bool wait) · 66 unmodified lines
575579 iu->buf = rsp;
576580 iu->dev = dev;
577581
578− sg_alloc_table(&iu->sgt, 1, GFP_KERNEL);
579582 sg_init_one(iu->sgt.sgl, rsp, sizeof(*rsp));
580583
581584 msg.hdr.type = cpu_to_le16(RNBD_MSG_OPEN);
@@ -594,7 +597,6 @@ static int send_msg_open(struct rnbd_clt_dev *dev, bool wait) · 12 unmodified lines
594597 err = errno;
595598 }
596599
597− sg_free_table(&iu->sgt);
598600 rnbd_put_iu(sess, iu);
599601 return err;
600602 }
@@ -622,8 +624,6 @@ static int send_msg_sess_info(struct rnbd_clt_session *sess, bool wait) · 21 unmodified lines
622624
623625 iu->buf = rsp;
624626 iu->sess = sess;
625−
626− sg_alloc_table(&iu->sgt, 1, GFP_KERNEL);
627627 sg_init_one(iu->sgt.sgl, rsp, sizeof(*rsp));
628628
629629 msg.hdr.type = cpu_to_le16(RNBD_MSG_SESS_INFO);
@@ -650,7 +650,6 @@ put_iu: · 20 unmodified lines
650650 } else {
651651 err = errno;
652652 }
653− sg_free_table(&iu->sgt);
654653 rnbd_put_iu(sess, iu);
655654 return err;
656655 }
@@ -1698,7 +1697,8 @@ static void rnbd_destroy_sessions(void) · 1041 unmodified lines
16981697 */
16991698
17001699 list_for_each_entry_safe(sess, sn, &sess_list, list) {
1701− WARN_ON(!rnbd_clt_get_sess(sess));
1700+ if (!rnbd_clt_get_sess(sess))
1701+ continue;
17021702 close_rtrs(sess);
17031703 list_for_each_entry_safe(dev, tn, &sess->devs_list, list) {
17041704 /*
drivers/block/rnbd/rnbd-srv.c+5−3
@@ -338,10 +338,12 @@ static int rnbd_srv_link_ev(struct rtrs_srv *rtrs, · 337 unmodified lines
338338
339339 void rnbd_srv_sess_dev_force_close(struct rnbd_srv_sess_dev *sess_dev)
340340 {
341− mutex_lock(&sess_dev->sess->lock);
342− rnbd_srv_destroy_dev_session_sysfs(sess_dev);
343− mutex_unlock(&sess_dev->sess->lock);
341+ struct rnbd_srv_session *sess = sess_dev->sess;
342+
344343 sess_dev->keep_id = true;
344+ mutex_lock(&sess->lock);
345+ rnbd_srv_destroy_dev_session_sysfs(sess_dev);
346+ mutex_unlock(&sess->lock);
345347 }
346348
347349 static int process_msg_close(struct rtrs_srv *rtrs,
drivers/block/xen-blkfront.c+7−13
@@ -945,7 +945,8 @@ static void blkif_set_queue_limits(struct blkfront_info *info) · 944 unmodified lines
945945 if (info->feature_discard) {
946946 blk_queue_flag_set(QUEUE_FLAG_DISCARD, rq);
947947 blk_queue_max_discard_sectors(rq, get_capacity(gd));
948− rq->limits.discard_granularity = info->discard_granularity;
948+ rq->limits.discard_granularity = info->discard_granularity ?:
949+ info->physical_sector_size;
949950 rq->limits.discard_alignment = info->discard_alignment;
950951 if (info->feature_secdiscard)
951952 blk_queue_flag_set(QUEUE_FLAG_SECERASE, rq);
@@ -2179,19 +2180,12 @@ static void blkfront_closing(struct blkfront_info *info) · 1227 unmodified lines
21792180
21802181 static void blkfront_setup_discard(struct blkfront_info *info)
21812182 {
2182− int err;
2183− unsigned int discard_granularity;
2184− unsigned int discard_alignment;
2185−
21862183 info->feature_discard = 1;
2187− err = xenbus_gather(XBT_NIL, info->xbdev->otherend,
2188− "discard-granularity", "%u", &discard_granularity,
2189− "discard-alignment", "%u", &discard_alignment,
2190− NULL);
2191− if (!err) {
2192− info->discard_granularity = discard_granularity;
2193− info->discard_alignment = discard_alignment;
2194− }
2184+ info->discard_granularity = xenbus_read_unsigned(info->xbdev->otherend,
2185+ "discard-granularity",
2186+ 0);
2187+ info->discard_alignment = xenbus_read_unsigned(info->xbdev->otherend,
2188+ "discard-alignment", 0);
21952189 info->feature_secdiscard =
21962190 !!xenbus_read_unsigned(info->xbdev->otherend, "discard-secure",
21972191 0);
drivers/bus/arm-integrator-lm.c+1−0
@@ -54,6 +54,7 @@ static int integrator_lm_populate(int num, struct device *dev) · 53 unmodified lines
5454 ret = of_platform_default_populate(child, NULL, dev);
5555 if (ret) {
5656 dev_err(dev, "failed to populate module\n");
57+ of_node_put(child);
5758 return ret;
5859 }
5960 }
drivers/bus/simple-pm-bus.c+2−1
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616
1717 static int simple_pm_bus_probe(struct platform_device *pdev)
1818 {
19+ const struct of_dev_auxdata *lookup = dev_get_platdata(&pdev->dev);
1920 struct device_node *np = pdev->dev.of_node;
2021
2122 dev_dbg(&pdev->dev, "%s\n", __func__);
@@ -23,7 +24,7 @@ static int simple_pm_bus_probe(struct platform_device *pdev) · 1 unmodified line
2324 pm_runtime_enable(&pdev->dev);
2425
2526 if (np)
26− of_platform_populate(np, NULL, NULL, &pdev->dev);
27+ of_platform_populate(np, NULL, lookup, &pdev->dev);
2728
2829 return 0;
2930 }
drivers/clk/imx/Kconfig+0−2
@@ -6,8 +6,6 @@ config MXC_CLK · 5 unmodified lines
66
77 config MXC_CLK_SCU
88 tristate
9− depends on ARCH_MXC
10− depends on IMX_SCU && HAVE_ARM_SMCCC
119
1210 config CLK_IMX1
1311 def_bool SOC_IMX1
drivers/clk/mmp/clk-audio.c+4−2
@@ -392,7 +392,8 @@ static int mmp2_audio_clk_remove(struct platform_device *pdev) · 391 unmodified lines
392392 return 0;
393393 }
394394
395−static int __maybe_unused mmp2_audio_clk_suspend(struct device *dev)
395+#ifdef CONFIG_PM
396+static int mmp2_audio_clk_suspend(struct device *dev)
396397 {
397398 struct mmp2_audio_clk *priv = dev_get_drvdata(dev);
398399
@@ -404,7 +405,7 @@ static int __maybe_unused mmp2_audio_clk_suspend(struct device *dev) · 5 unmodified lines
404405 return 0;
405406 }
406407
407−static int __maybe_unused mmp2_audio_clk_resume(struct device *dev)
408+static int mmp2_audio_clk_resume(struct device *dev)
408409 {
409410 struct mmp2_audio_clk *priv = dev_get_drvdata(dev);
410411
@@ -415,6 +416,7 @@ static int __maybe_unused mmp2_audio_clk_resume(struct device *dev) · 4 unmodified lines
415416
416417 return 0;
417418 }
419+#endif
418420
419421 static const struct dev_pm_ops mmp2_audio_clk_pm_ops = {
420422 SET_RUNTIME_PM_OPS(mmp2_audio_clk_suspend, mmp2_audio_clk_resume, NULL)
drivers/clk/qcom/gcc-sc7180.c+3−18
@@ -891,21 +891,6 @@ static struct clk_branch gcc_boot_rom_ahb_clk = { · 890 unmodified lines
891891 },
892892 };
893893
894−static struct clk_branch gcc_camera_ahb_clk = {
895− .halt_reg = 0xb008,
896− .halt_check = BRANCH_HALT,
897− .hwcg_reg = 0xb008,
898− .hwcg_bit = 1,
899− .clkr = {
900− .enable_reg = 0xb008,
901− .enable_mask = BIT(0),
902− .hw.init = &(struct clk_init_data){
903− .name = "gcc_camera_ahb_clk",
904− .ops = &clk_branch2_ops,
905− },
906− },
907−};
908−
909894 static struct clk_branch gcc_camera_hf_axi_clk = {
910895 .halt_reg = 0xb020,
911896 .halt_check = BRANCH_HALT,
@@ -2317,7 +2302,6 @@ static struct clk_regmap *gcc_sc7180_clocks[] = { · 1405 unmodified lines
23172302 [GCC_AGGRE_UFS_PHY_AXI_CLK] = &gcc_aggre_ufs_phy_axi_clk.clkr,
23182303 [GCC_AGGRE_USB3_PRIM_AXI_CLK] = &gcc_aggre_usb3_prim_axi_clk.clkr,
23192304 [GCC_BOOT_ROM_AHB_CLK] = &gcc_boot_rom_ahb_clk.clkr,
2320− [GCC_CAMERA_AHB_CLK] = &gcc_camera_ahb_clk.clkr,
23212305 [GCC_CAMERA_HF_AXI_CLK] = &gcc_camera_hf_axi_clk.clkr,
23222306 [GCC_CAMERA_THROTTLE_HF_AXI_CLK] = &gcc_camera_throttle_hf_axi_clk.clkr,
23232307 [GCC_CAMERA_XO_CLK] = &gcc_camera_xo_clk.clkr,
@@ -2519,11 +2503,12 @@ static int gcc_sc7180_probe(struct platform_device *pdev) · 195 unmodified lines
25192503
25202504 /*
25212505 * Keep the clocks always-ON
2522− * GCC_CPUSS_GNOC_CLK, GCC_VIDEO_AHB_CLK, GCC_DISP_AHB_CLK
2523− * GCC_GPU_CFG_AHB_CLK
2506+ * GCC_CPUSS_GNOC_CLK, GCC_VIDEO_AHB_CLK, GCC_CAMERA_AHB_CLK,
2507+ * GCC_DISP_AHB_CLK, GCC_GPU_CFG_AHB_CLK
25242508 */
25252509 regmap_update_bits(regmap, 0x48004, BIT(0), BIT(0));
25262510 regmap_update_bits(regmap, 0x0b004, BIT(0), BIT(0));
2511+ regmap_update_bits(regmap, 0x0b008, BIT(0), BIT(0));
25272512 regmap_update_bits(regmap, 0x0b00c, BIT(0), BIT(0));
25282513 regmap_update_bits(regmap, 0x71004, BIT(0), BIT(0));
25292514
drivers/clk/qcom/gcc-sm8250.c+2−2
@@ -722,7 +722,7 @@ static struct clk_rcg2 gcc_sdcc2_apps_clk_src = { · 721 unmodified lines
722722 .name = "gcc_sdcc2_apps_clk_src",
723723 .parent_data = gcc_parent_data_4,
724724 .num_parents = 5,
725− .ops = &clk_rcg2_ops,
725+ .ops = &clk_rcg2_floor_ops,
726726 },
727727 };
728728
@@ -745,7 +745,7 @@ static struct clk_rcg2 gcc_sdcc4_apps_clk_src = { · 16 unmodified lines
745745 .name = "gcc_sdcc4_apps_clk_src",
746746 .parent_data = gcc_parent_data_0,
747747 .num_parents = 3,
748− .ops = &clk_rcg2_ops,
748+ .ops = &clk_rcg2_floor_ops,
749749 },
750750 };
751751
drivers/clk/sunxi-ng/ccu_mp.c+1−1
@@ -108,7 +108,7 @@ static unsigned long ccu_mp_round_rate(struct ccu_mux_internal *mux, · 107 unmodified lines
108108 max_m = cmp->m.max ?: 1 << cmp->m.width;
109109 max_p = cmp->p.max ?: 1 << ((1 << cmp->p.width) - 1);
110110
111− if (!(clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT)) {
111+ if (!clk_hw_can_set_rate_parent(&cmp->common.hw)) {
112112 ccu_mp_find_best(*parent_rate, rate, max_m, max_p, &m, &p);
113113 rate = *parent_rate / p / m;
114114 } else {
drivers/clk/tegra/clk-tegra30.c+2−0
@@ -1256,6 +1256,8 @@ static struct tegra_clk_init_table init_table[] __initdata = { · 1255 unmodified lines
12561256 { TEGRA30_CLK_I2S3_SYNC, TEGRA30_CLK_CLK_MAX, 24000000, 0 },
12571257 { TEGRA30_CLK_I2S4_SYNC, TEGRA30_CLK_CLK_MAX, 24000000, 0 },
12581258 { TEGRA30_CLK_VIMCLK_SYNC, TEGRA30_CLK_CLK_MAX, 24000000, 0 },
1259+ { TEGRA30_CLK_HDA, TEGRA30_CLK_PLL_P, 102000000, 0 },
1260+ { TEGRA30_CLK_HDA2CODEC_2X, TEGRA30_CLK_PLL_P, 48000000, 0 },
12591261 /* must be the last entry */
12601262 { TEGRA30_CLK_CLK_MAX, TEGRA30_CLK_CLK_MAX, 0, 0 },
12611263 };
drivers/counter/ti-eqep.c+0−35
@@ -235,36 +235,6 @@ static ssize_t ti_eqep_position_ceiling_write(struct counter_device *counter, · 234 unmodified lines
235235 return len;
236236 }
237237
238−static ssize_t ti_eqep_position_floor_read(struct counter_device *counter,
239− struct counter_count *count,
240− void *ext_priv, char *buf)
241−{
242− struct ti_eqep_cnt *priv = counter->priv;
243− u32 qposinit;
244−
245− regmap_read(priv->regmap32, QPOSINIT, &qposinit);
246−
247− return sprintf(buf, "%u\n", qposinit);
248−}
249−
250−static ssize_t ti_eqep_position_floor_write(struct counter_device *counter,
251− struct counter_count *count,
252− void *ext_priv, const char *buf,
253− size_t len)
254−{
255− struct ti_eqep_cnt *priv = counter->priv;
256− int err;
257− u32 res;
258−
259− err = kstrtouint(buf, 0, &res);
260− if (err < 0)
261− return err;
262−
263− regmap_write(priv->regmap32, QPOSINIT, res);
264−
265− return len;
266−}
267−
268238 static ssize_t ti_eqep_position_enable_read(struct counter_device *counter,
269239 struct counter_count *count,
270240 void *ext_priv, char *buf)
@@ -301,11 +271,6 @@ static struct counter_count_ext ti_eqep_position_ext[] = { · 30 unmodified lines
301271 .read = ti_eqep_position_ceiling_read,
302272 .write = ti_eqep_position_ceiling_write,
303273 },
304− {
305− .name = "floor",
306− .read = ti_eqep_position_floor_read,
307− .write = ti_eqep_position_floor_write,
308− },
309274 {
310275 .name = "enable",
311276 .read = ti_eqep_position_enable_read,
drivers/cpufreq/acpi-cpufreq.c+103−12
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #include <linux/uaccess.h>
2727
2828 #include <acpi/processor.h>
29+#include <acpi/cppc_acpi.h>
2930
3031 #include <asm/msr.h>
3132 #include <asm/processor.h>
@@ -53,6 +54,7 @@ struct acpi_cpufreq_data { · 21 unmodified lines
5354 unsigned int resume;
5455 unsigned int cpu_feature;
5556 unsigned int acpi_perf_cpu;
57+ unsigned int first_perf_state;
5658 cpumask_var_t freqdomain_cpus;
5759 void (*cpu_freq_write)(struct acpi_pct_register *reg, u32 val);
5860 u32 (*cpu_freq_read)(struct acpi_pct_register *reg);
@@ -221,10 +223,10 @@ static unsigned extract_msr(struct cpufreq_policy *policy, u32 msr) · 162 unmodified lines
221223
222224 perf = to_perf_data(data);
223225
224− cpufreq_for_each_entry(pos, policy->freq_table)
226+ cpufreq_for_each_entry(pos, policy->freq_table + data->first_perf_state)
225227 if (msr == perf->states[pos->driver_data].status)
226228 return pos->frequency;
227− return policy->freq_table[0].frequency;
229+ return policy->freq_table[data->first_perf_state].frequency;
228230 }
229231
230232 static unsigned extract_freq(struct cpufreq_policy *policy, u32 val)
@@ -363,6 +365,7 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu) · 132 unmodified lines
363365 struct cpufreq_policy *policy;
364366 unsigned int freq;
365367 unsigned int cached_freq;
368+ unsigned int state;
366369
367370 pr_debug("%s (%d)\n", __func__, cpu);
368371
@@ -374,7 +377,11 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu) · 5 unmodified lines
374377 if (unlikely(!data || !policy->freq_table))
375378 return 0;
376379
377− cached_freq = policy->freq_table[to_perf_data(data)->state].frequency;
380+ state = to_perf_data(data)->state;
381+ if (state < data->first_perf_state)
382+ state = data->first_perf_state;
383+
384+ cached_freq = policy->freq_table[state].frequency;
378385 freq = extract_freq(policy, get_cur_val(cpumask_of(cpu), data));
379386 if (freq != cached_freq) {
380387 /*
@@ -628,16 +635,54 @@ static int acpi_cpufreq_blacklist(struct cpuinfo_x86 *c) · 247 unmodified lines
628635 }
629636 #endif
630637
638+#ifdef CONFIG_ACPI_CPPC_LIB
639+static u64 get_max_boost_ratio(unsigned int cpu)
640+{
641+ struct cppc_perf_caps perf_caps;
642+ u64 highest_perf, nominal_perf;
643+ int ret;
644+
645+ if (acpi_pstate_strict)
646+ return 0;
647+
648+ ret = cppc_get_perf_caps(cpu, &perf_caps);
649+ if (ret) {
650+ pr_debug("CPU%d: Unable to get performance capabilities (%d)\n",
651+ cpu, ret);
652+ return 0;
653+ }
654+
655+ highest_perf = perf_caps.highest_perf;
656+ nominal_perf = perf_caps.nominal_perf;
657+
658+ if (!highest_perf || !nominal_perf) {
659+ pr_debug("CPU%d: highest or nominal performance missing\n", cpu);
660+ return 0;
661+ }
662+
663+ if (highest_perf < nominal_perf) {
664+ pr_debug("CPU%d: nominal performance above highest\n", cpu);
665+ return 0;
666+ }
667+
668+ return div_u64(highest_perf << SCHED_CAPACITY_SHIFT, nominal_perf);
669+}
670+#else
671+static inline u64 get_max_boost_ratio(unsigned int cpu) { return 0; }
672+#endif
673+
631674 static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
632675 {
633− unsigned int i;
634− unsigned int valid_states = 0;
635− unsigned int cpu = policy->cpu;
676+ struct cpufreq_frequency_table *freq_table;
677+ struct acpi_processor_performance *perf;
636678 struct acpi_cpufreq_data *data;
679+ unsigned int cpu = policy->cpu;
680+ struct cpuinfo_x86 *c = &cpu_data(cpu);
681+ unsigned int valid_states = 0;
637682 unsigned int result = 0;
638− struct cpuinfo_x86 *c = &cpu_data(policy->cpu);
639− struct acpi_processor_performance *perf;
640− struct cpufreq_frequency_table *freq_table;
683+ unsigned int state_count;
684+ u64 max_boost_ratio;
685+ unsigned int i;
641686 #ifdef CONFIG_SMP
642687 static int blacklisted;
643688 #endif
@@ -750,8 +795,28 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) · 106 unmodified lines
750795 goto err_unreg;
751796 }
752797
753− freq_table = kcalloc(perf->state_count + 1, sizeof(*freq_table),
754− GFP_KERNEL);
798+ state_count = perf->state_count + 1;
799+
800+ max_boost_ratio = get_max_boost_ratio(cpu);
801+ if (max_boost_ratio) {
802+ /*
803+ * Make a room for one more entry to represent the highest
804+ * available "boost" frequency.
805+ */
806+ state_count++;
807+ valid_states++;
808+ data->first_perf_state = valid_states;
809+ } else {
810+ /*
811+ * If the maximum "boost" frequency is unknown, ask the arch
812+ * scale-invariance code to use the "nominal" performance for
813+ * CPU utilization scaling so as to prevent the schedutil
814+ * governor from selecting inadequate CPU frequencies.
815+ */
816+ arch_set_max_freq_ratio(true);
817+ }
818+
819+ freq_table = kcalloc(state_count, sizeof(*freq_table), GFP_KERNEL);
755820 if (!freq_table) {
756821 result = -ENOMEM;
757822 goto err_unreg;
@@ -785,6 +850,30 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) · 27 unmodified lines
785850 valid_states++;
786851 }
787852 freq_table[valid_states].frequency = CPUFREQ_TABLE_END;
853+
854+ if (max_boost_ratio) {
855+ unsigned int state = data->first_perf_state;
856+ unsigned int freq = freq_table[state].frequency;
857+
858+ /*
859+ * Because the loop above sorts the freq_table entries in the
860+ * descending order, freq is the maximum frequency in the table.
861+ * Assume that it corresponds to the CPPC nominal frequency and
862+ * use it to populate the frequency field of the extra "boost"
863+ * frequency entry.
864+ */
865+ freq_table[0].frequency = freq * max_boost_ratio >> SCHED_CAPACITY_SHIFT;
866+ /*
867+ * The purpose of the extra "boost" frequency entry is to make
868+ * the rest of cpufreq aware of the real maximum frequency, but
869+ * the way to request it is the same as for the first_perf_state
870+ * entry that is expected to cover the entire range of "boost"
871+ * frequencies of the CPU, so copy the driver_data value from
872+ * that entry.
873+ */
874+ freq_table[0].driver_data = freq_table[state].driver_data;
875+ }
876+
788877 policy->freq_table = freq_table;
789878 perf->state = 0;
790879
@@ -858,8 +947,10 @@ static void acpi_cpufreq_cpu_ready(struct cpufreq_policy *policy) · 67 unmodified lines
858947 {
859948 struct acpi_processor_performance *perf = per_cpu_ptr(acpi_perf_data,
860949 policy->cpu);
950+ struct acpi_cpufreq_data *data = policy->driver_data;
951+ unsigned int freq = policy->freq_table[data->first_perf_state].frequency;
861952
862− if (perf->states[0].core_frequency * 1000 != policy->cpuinfo.max_freq)
953+ if (perf->states[0].core_frequency * 1000 != freq)
863954 pr_warn(FW_WARN "P-state 0 is not max freq\n");
864955 }
865956
drivers/cpufreq/intel_pstate.c+3−12
@@ -76,11 +76,6 @@ static inline int ceiling_fp(int32_t x) · 75 unmodified lines
7676 return ret;
7777 }
7878
79−static inline int32_t percent_fp(int percent)
80−{
81− return div_fp(percent, 100);
82−}
83−
8479 static inline u64 mul_ext_fp(u64 x, u64 y)
8580 {
8681 return (x * y) >> EXT_FRAC_BITS;
@@ -91,11 +86,6 @@ static inline u64 div_ext_fp(u64 x, u64 y) · 4 unmodified lines
9186 return div64_u64(x << EXT_FRAC_BITS, y);
9287 }
9388
94−static inline int32_t percent_ext_fp(int percent)
95−{
96− return div_ext_fp(percent, 100);
97−}
98−
9989 /**
10090 * struct sample - Store performance sample
10191 * @core_avg_perf: Ratio of APERF/MPERF which is the actual average
@@ -2653,12 +2643,13 @@ static void intel_cpufreq_adjust_perf(unsigned int cpunum, · 2551 unmodified lines
26532643 unsigned long capacity)
26542644 {
26552645 struct cpudata *cpu = all_cpu_data[cpunum];
2646+ u64 hwp_cap = READ_ONCE(cpu->hwp_cap_cached);
26562647 int old_pstate = cpu->pstate.current_pstate;
26572648 int cap_pstate, min_pstate, max_pstate, target_pstate;
26582649
26592650 update_turbo_state();
2660− cap_pstate = global.turbo_disabled ? cpu->pstate.max_pstate :
2661− cpu->pstate.turbo_pstate;
2651+ cap_pstate = global.turbo_disabled ? HWP_GUARANTEED_PERF(hwp_cap) :
2652+ HWP_HIGHEST_PERF(hwp_cap);
26622653
26632654 /* Optimization: Avoid unnecessary divisions. */
26642655
drivers/cpufreq/powernow-k8.c+3−6
@@ -878,9 +878,9 @@ static int get_transition_latency(struct powernow_k8_data *data) · 877 unmodified lines
878878
879879 /* Take a frequency, and issue the fid/vid transition command */
880880 static int transition_frequency_fidvid(struct powernow_k8_data *data,
881− unsigned int index)
881+ unsigned int index,
882+ struct cpufreq_policy *policy)
882883 {
883− struct cpufreq_policy *policy;
884884 u32 fid = 0;
885885 u32 vid = 0;
886886 int res;
@@ -912,9 +912,6 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data, · 25 unmodified lines
912912 freqs.old = find_khz_freq_from_fid(data->currfid);
913913 freqs.new = find_khz_freq_from_fid(fid);
914914
915− policy = cpufreq_cpu_get(smp_processor_id());
916− cpufreq_cpu_put(policy);
917−
918915 cpufreq_freq_transition_begin(policy, &freqs);
919916 res = transition_fid_vid(data, fid, vid);
920917 cpufreq_freq_transition_end(policy, &freqs, res);
@@ -969,7 +966,7 @@ static long powernowk8_target_fn(void *arg) · 48 unmodified lines
969966
970967 powernow_k8_acpi_pst_values(data, newstate);
971968
972− ret = transition_frequency_fidvid(data, newstate);
969+ ret = transition_frequency_fidvid(data, newstate, pol);
973970
974971 if (ret) {
975972 pr_err("transition frequency failed\n");
drivers/crypto/Kconfig+1−0
@@ -366,6 +366,7 @@ if CRYPTO_DEV_OMAP · 365 unmodified lines
366366 config CRYPTO_DEV_OMAP_SHAM
367367 tristate "Support for OMAP MD5/SHA1/SHA2 hw accelerator"
368368 depends on ARCH_OMAP2PLUS
369+ select CRYPTO_ENGINE
369370 select CRYPTO_SHA1
370371 select CRYPTO_MD5
371372 select CRYPTO_SHA256
drivers/crypto/marvell/cesa/cesa.h+2−2
@@ -300,11 +300,11 @@ struct mv_cesa_tdma_desc { · 299 unmodified lines
300300 __le32 byte_cnt;
301301 union {
302302 __le32 src;
303− dma_addr_t src_dma;
303+ u32 src_dma;
304304 };
305305 union {
306306 __le32 dst;
307− dma_addr_t dst_dma;
307+ u32 dst_dma;
308308 };
309309 __le32 next_dma;
310310
drivers/dma-buf/dma-buf.c+17−4
@@ -76,10 +76,6 @@ static void dma_buf_release(struct dentry *dentry) · 75 unmodified lines
7676
7777 dmabuf->ops->release(dmabuf);
7878
79− mutex_lock(&db_list.lock);
80− list_del(&dmabuf->list_node);
81− mutex_unlock(&db_list.lock);
82−
8379 if (dmabuf->resv == (struct dma_resv *)&dmabuf[1])
8480 dma_resv_fini(dmabuf->resv);
8581
@@ -88,6 +84,22 @@ static void dma_buf_release(struct dentry *dentry) · 2 unmodified lines
8884 kfree(dmabuf);
8985 }
9086
87+static int dma_buf_file_release(struct inode *inode, struct file *file)
88+{
89+ struct dma_buf *dmabuf;
90+
91+ if (!is_dma_buf_file(file))
92+ return -EINVAL;
93+
94+ dmabuf = file->private_data;
95+
96+ mutex_lock(&db_list.lock);
97+ list_del(&dmabuf->list_node);
98+ mutex_unlock(&db_list.lock);
99+
100+ return 0;
101+}
102+
91103 static const struct dentry_operations dma_buf_dentry_ops = {
92104 .d_dname = dmabuffs_dname,
93105 .d_release = dma_buf_release,
@@ -413,6 +425,7 @@ static void dma_buf_show_fdinfo(struct seq_file *m, struct file *file) · 319 unmodified lines
413425 }
414426
415427 static const struct file_operations dma_buf_fops = {
428+ .release = dma_buf_file_release,
416429 .mmap = dma_buf_mmap_internal,
417430 .llseek = dma_buf_llseek,
418431 .poll = dma_buf_poll,
drivers/dma-buf/heaps/cma_heap.c+3−0
@@ -251,6 +251,9 @@ static void cma_heap_dma_buf_release(struct dma_buf *dmabuf) · 250 unmodified lines
251251 buffer->vaddr = NULL;
252252 }
253253
254+ /* free page list */
255+ kfree(buffer->pages);
256+ /* release memory */
254257 cma_release(cma_heap->cma, buffer->cma_pages, buffer->pagecount);
255258 kfree(buffer);
256259 }
drivers/dma/dmaengine.c+0−1
@@ -1110,7 +1110,6 @@ static void __dma_async_device_channel_unregister(struct dma_device *device, · 1109 unmodified lines
11101110 "%s called while %d clients hold a reference\n",
11111111 __func__, chan->client_count);
11121112 mutex_lock(&dma_list_mutex);
1113− list_del(&chan->device_node);
11141113 device->chancnt--;
11151114 chan->dev->chan = NULL;
11161115 mutex_unlock(&dma_list_mutex);
drivers/dma/dw-edma/dw-edma-core.c+2−2
@@ -86,12 +86,12 @@ static struct dw_edma_chunk *dw_edma_alloc_chunk(struct dw_edma_desc *desc) · 85 unmodified lines
8686
8787 if (desc->chunk) {
8888 /* Create and add new element into the linked list */
89− desc->chunks_alloc++;
90− list_add_tail(&chunk->list, &desc->chunk->list);
9189 if (!dw_edma_alloc_burst(chunk)) {
9290 kfree(chunk);
9391 return NULL;
9492 }
93+ desc->chunks_alloc++;
94+ list_add_tail(&chunk->list, &desc->chunk->list);
9595 } else {
9696 /* List head */
9797 chunk->burst = NULL;
drivers/dma/dw/core.c+0−6
@@ -982,11 +982,8 @@ static int dwc_alloc_chan_resources(struct dma_chan *chan) · 981 unmodified lines
982982
983983 dev_vdbg(chan2dev(chan), "%s\n", __func__);
984984
985− pm_runtime_get_sync(dw->dma.dev);
986−
987985 /* ASSERT: channel is idle */
988986 if (dma_readl(dw, CH_EN) & dwc->mask) {
989− pm_runtime_put_sync_suspend(dw->dma.dev);
990987 dev_dbg(chan2dev(chan), "DMA channel not idle?\n");
991988 return -EIO;
992989 }
@@ -1003,7 +1000,6 @@ static int dwc_alloc_chan_resources(struct dma_chan *chan) · 10 unmodified lines
10031000 * We need controller-specific data to set up slave transfers.
10041001 */
10051002 if (chan->private && !dw_dma_filter(chan, chan->private)) {
1006− pm_runtime_put_sync_suspend(dw->dma.dev);
10071003 dev_warn(chan2dev(chan), "Wrong controller-specific data\n");
10081004 return -EINVAL;
10091005 }
@@ -1047,8 +1043,6 @@ static void dwc_free_chan_resources(struct dma_chan *chan) · 37 unmodified lines
10471043 if (!dw->in_use)
10481044 do_dw_dma_off(dw);
10491045
1050− pm_runtime_put_sync_suspend(dw->dma.dev);
1051−
10521046 dev_vdbg(chan2dev(chan), "%s: done\n", __func__);
10531047 }
10541048
drivers/dma/idxd/device.c+22−1
@@ -398,17 +398,31 @@ static inline bool idxd_is_enabled(struct idxd_device *idxd) · 397 unmodified lines
398398 return false;
399399 }
400400
401+static inline bool idxd_device_is_halted(struct idxd_device *idxd)
402+{
403+ union gensts_reg gensts;
404+
405+ gensts.bits = ioread32(idxd->reg_base + IDXD_GENSTATS_OFFSET);
406+
407+ return (gensts.state == IDXD_DEVICE_STATE_HALT);
408+}
409+
401410 /*
402411 * This is function is only used for reset during probe and will
403412 * poll for completion. Once the device is setup with interrupts,
404413 * all commands will be done via interrupt completion.
405414 */
406−void idxd_device_init_reset(struct idxd_device *idxd)
415+int idxd_device_init_reset(struct idxd_device *idxd)
407416 {
408417 struct device *dev = &idxd->pdev->dev;
409418 union idxd_command_reg cmd;
410419 unsigned long flags;
411420
421+ if (idxd_device_is_halted(idxd)) {
422+ dev_warn(&idxd->pdev->dev, "Device is HALTED!\n");
423+ return -ENXIO;
424+ }
425+
412426 memset(&cmd, 0, sizeof(cmd));
413427 cmd.cmd = IDXD_CMD_RESET_DEVICE;
414428 dev_dbg(dev, "%s: sending reset for init.\n", __func__);
@@ -419,6 +433,7 @@ void idxd_device_init_reset(struct idxd_device *idxd) · 4 unmodified lines
419433 IDXD_CMDSTS_ACTIVE)
420434 cpu_relax();
421435 spin_unlock_irqrestore(&idxd->dev_lock, flags);
436+ return 0;
422437 }
423438
424439 static void idxd_cmd_exec(struct idxd_device *idxd, int cmd_code, u32 operand,
@@ -428,6 +443,12 @@ static void idxd_cmd_exec(struct idxd_device *idxd, int cmd_code, u32 operand, · 3 unmodified lines
428443 DECLARE_COMPLETION_ONSTACK(done);
429444 unsigned long flags;
430445
446+ if (idxd_device_is_halted(idxd)) {
447+ dev_warn(&idxd->pdev->dev, "Device is HALTED!\n");
448+ *status = IDXD_CMDSTS_HW_ERR;
449+ return;
450+ }
451+
431452 memset(&cmd, 0, sizeof(cmd));
432453 cmd.cmd = cmd_code;
433454 cmd.operand = operand;
drivers/dma/idxd/dma.c+4−1
@@ -205,5 +205,8 @@ int idxd_register_dma_channel(struct idxd_wq *wq) · 204 unmodified lines
205205
206206 void idxd_unregister_dma_channel(struct idxd_wq *wq)
207207 {
208− dma_async_device_channel_unregister(&wq->idxd->dma_dev, &wq->dma_chan);
208+ struct dma_chan *chan = &wq->dma_chan;
209+
210+ dma_async_device_channel_unregister(&wq->idxd->dma_dev, chan);
211+ list_del(&chan->device_node);
209212 }
drivers/dma/idxd/idxd.h+1−1
@@ -326,7 +326,7 @@ void idxd_mask_msix_vector(struct idxd_device *idxd, int vec_id); · 325 unmodified lines
326326 void idxd_unmask_msix_vector(struct idxd_device *idxd, int vec_id);
327327
328328 /* device control */
329−void idxd_device_init_reset(struct idxd_device *idxd);
329+int idxd_device_init_reset(struct idxd_device *idxd);
330330 int idxd_device_enable(struct idxd_device *idxd);
331331 int idxd_device_disable(struct idxd_device *idxd);
332332 void idxd_device_reset(struct idxd_device *idxd);
drivers/dma/idxd/init.c+4−1
@@ -335,7 +335,10 @@ static int idxd_probe(struct idxd_device *idxd) · 334 unmodified lines
335335 int rc;
336336
337337 dev_dbg(dev, "%s entered and resetting device\n", __func__);
338− idxd_device_init_reset(idxd);
338+ rc = idxd_device_init_reset(idxd);
339+ if (rc < 0)
340+ return rc;
341+
339342 dev_dbg(dev, "IDXD reset complete\n");
340343
341344 if (IS_ENABLED(CONFIG_INTEL_IDXD_SVM)) {
drivers/dma/idxd/irq.c+71−51
@@ -111,19 +111,14 @@ irqreturn_t idxd_irq_handler(int vec, void *data) · 110 unmodified lines
111111 return IRQ_WAKE_THREAD;
112112 }
113113
114−irqreturn_t idxd_misc_thread(int vec, void *data)
114+static int process_misc_interrupts(struct idxd_device *idxd, u32 cause)
115115 {
116− struct idxd_irq_entry *irq_entry = data;
117− struct idxd_device *idxd = irq_entry->idxd;
118116 struct device *dev = &idxd->pdev->dev;
119117 union gensts_reg gensts;
120− u32 cause, val = 0;
118+ u32 val = 0;
121119 int i;
122120 bool err = false;
123121
124− cause = ioread32(idxd->reg_base + IDXD_INTCAUSE_OFFSET);
125− iowrite32(cause, idxd->reg_base + IDXD_INTCAUSE_OFFSET);
126−
127122 if (cause & IDXD_INTC_ERR) {
128123 spin_lock_bh(&idxd->dev_lock);
129124 for (i = 0; i < 4; i++)
@@ -181,7 +176,7 @@ irqreturn_t idxd_misc_thread(int vec, void *data) · 51 unmodified lines
181176 val);
182177
183178 if (!err)
184− goto out;
179+ return 0;
185180
186181 /*
187182 * This case should rarely happen and typically is due to software
@@ -211,37 +206,58 @@ irqreturn_t idxd_misc_thread(int vec, void *data) · 23 unmodified lines
211206 gensts.reset_type == IDXD_DEVICE_RESET_FLR ?
212207 "FLR" : "system reset");
213208 spin_unlock_bh(&idxd->dev_lock);
209+ return -ENXIO;
214210 }
215211 }
216212
217− out:
213+ return 0;
214+}
215+
216+irqreturn_t idxd_misc_thread(int vec, void *data)
217+{
218+ struct idxd_irq_entry *irq_entry = data;
219+ struct idxd_device *idxd = irq_entry->idxd;
220+ int rc;
221+ u32 cause;
222+
223+ cause = ioread32(idxd->reg_base + IDXD_INTCAUSE_OFFSET);
224+ if (cause)
225+ iowrite32(cause, idxd->reg_base + IDXD_INTCAUSE_OFFSET);
226+
227+ while (cause) {
228+ rc = process_misc_interrupts(idxd, cause);
229+ if (rc < 0)
230+ break;
231+ cause = ioread32(idxd->reg_base + IDXD_INTCAUSE_OFFSET);
232+ if (cause)
233+ iowrite32(cause, idxd->reg_base + IDXD_INTCAUSE_OFFSET);
234+ }
235+
218236 idxd_unmask_msix_vector(idxd, irq_entry->id);
219237 return IRQ_HANDLED;
220238 }
221239
222−static bool process_fault(struct idxd_desc *desc, u64 fault_addr)
240+static inline bool match_fault(struct idxd_desc *desc, u64 fault_addr)
223241 {
224242 /*
225243 * Completion address can be bad as well. Check fault address match for descriptor
226244 * and completion address.
227245 */
228− if ((u64)desc->hw == fault_addr ||
229− (u64)desc->completion == fault_addr) {
230− idxd_dma_complete_txd(desc, IDXD_COMPLETE_DEV_FAIL);
246+ if ((u64)desc->hw == fault_addr || (u64)desc->completion == fault_addr) {
247+ struct idxd_device *idxd = desc->wq->idxd;
248+ struct device *dev = &idxd->pdev->dev;
249+
250+ dev_warn(dev, "desc with fault address: %#llx\n", fault_addr);
231251 return true;
232252 }
233253
234254 return false;
235255 }
236256
237−static bool complete_desc(struct idxd_desc *desc)
257+static inline void complete_desc(struct idxd_desc *desc, enum idxd_complete_type reason)
238258 {
239− if (desc->completion->status) {
240− idxd_dma_complete_txd(desc, IDXD_COMPLETE_NORMAL);
241− return true;
242− }
243−
244− return false;
259+ idxd_dma_complete_txd(desc, reason);
260+ idxd_free_desc(desc->wq, desc);
245261 }
246262
247263 static int irq_process_pending_llist(struct idxd_irq_entry *irq_entry,
@@ -251,25 +267,25 @@ static int irq_process_pending_llist(struct idxd_irq_entry *irq_entry, · 3 unmodified lines
251267 struct idxd_desc *desc, *t;
252268 struct llist_node *head;
253269 int queued = 0;
254− bool completed = false;
255270 unsigned long flags;
271+ enum idxd_complete_type reason;
256272
257273 *processed = 0;
258274 head = llist_del_all(&irq_entry->pending_llist);
259275 if (!head)
260276 goto out;
261277
262− llist_for_each_entry_safe(desc, t, head, llnode) {
263− if (wtype == IRQ_WORK_NORMAL)
264− completed = complete_desc(desc);
265− else if (wtype == IRQ_WORK_PROCESS_FAULT)
266− completed = process_fault(desc, data);
278+ if (wtype == IRQ_WORK_NORMAL)
279+ reason = IDXD_COMPLETE_NORMAL;
280+ else
281+ reason = IDXD_COMPLETE_DEV_FAIL;
267282
268− if (completed) {
269− idxd_free_desc(desc->wq, desc);
283+ llist_for_each_entry_safe(desc, t, head, llnode) {
284+ if (desc->completion->status) {
285+ if ((desc->completion->status & DSA_COMP_STATUS_MASK) != DSA_COMP_SUCCESS)
286+ match_fault(desc, data);
287+ complete_desc(desc, reason);
270288 (*processed)++;
271− if (wtype == IRQ_WORK_PROCESS_FAULT)
272− break;
273289 } else {
274290 spin_lock_irqsave(&irq_entry->list_lock, flags);
275291 list_add_tail(&desc->list,
@@ -287,42 +303,46 @@ static int irq_process_work_list(struct idxd_irq_entry *irq_entry, · 11 unmodified lines
287303 enum irq_work_type wtype,
288304 int *processed, u64 data)
289305 {
290− struct list_head *node, *next;
291306 int queued = 0;
292− bool completed = false;
293307 unsigned long flags;
308+ LIST_HEAD(flist);
309+ struct idxd_desc *desc, *n;
310+ enum idxd_complete_type reason;
294311
295312 *processed = 0;
296− spin_lock_irqsave(&irq_entry->list_lock, flags);
297− if (list_empty(&irq_entry->work_list))
298− goto out;
299−
300− list_for_each_safe(node, next, &irq_entry->work_list) {
301− struct idxd_desc *desc =
302− container_of(node, struct idxd_desc, list);
313+ if (wtype == IRQ_WORK_NORMAL)
314+ reason = IDXD_COMPLETE_NORMAL;
315+ else
316+ reason = IDXD_COMPLETE_DEV_FAIL;
303317
318+ /*
319+ * This lock protects list corruption from access of list outside of the irq handler
320+ * thread.
321+ */
322+ spin_lock_irqsave(&irq_entry->list_lock, flags);
323+ if (list_empty(&irq_entry->work_list)) {
304324 spin_unlock_irqrestore(&irq_entry->list_lock, flags);
305− if (wtype == IRQ_WORK_NORMAL)
306− completed = complete_desc(desc);
307− else if (wtype == IRQ_WORK_PROCESS_FAULT)
308− completed = process_fault(desc, data);
325+ return 0;
326+ }
309327
310− if (completed) {
311− spin_lock_irqsave(&irq_entry->list_lock, flags);
328+ list_for_each_entry_safe(desc, n, &irq_entry->work_list, list) {
329+ if (desc->completion->status) {
312330 list_del(&desc->list);
313− spin_unlock_irqrestore(&irq_entry->list_lock, flags);
314− idxd_free_desc(desc->wq, desc);
315331 (*processed)++;
316− if (wtype == IRQ_WORK_PROCESS_FAULT)
317− return queued;
332+ list_add_tail(&desc->list, &flist);
318333 } else {
319334 queued++;
320335 }
321− spin_lock_irqsave(&irq_entry->list_lock, flags);
322336 }
323337
324− out:
325338 spin_unlock_irqrestore(&irq_entry->list_lock, flags);
339+
340+ list_for_each_entry(desc, &flist, list) {
341+ if ((desc->completion->status & DSA_COMP_STATUS_MASK) != DSA_COMP_SUCCESS)
342+ match_fault(desc, data);
343+ complete_desc(desc, reason);
344+ }
345+
326346 return queued;
327347 }
328348
drivers/dma/idxd/sysfs.c+2−2
@@ -434,7 +434,7 @@ int idxd_register_driver(void) · 433 unmodified lines
434434 return 0;
435435
436436 drv_fail:
437− for (; i > 0; i--)
437+ while (--i >= 0)
438438 driver_unregister(&idxd_drvs[i]->drv);
439439 return rc;
440440 }
@@ -1840,7 +1840,7 @@ int idxd_register_bus_type(void) · 1399 unmodified lines
18401840 return 0;
18411841
18421842 bus_err:
1843− for (; i > 0; i--)
1843+ while (--i >= 0)
18441844 bus_unregister(idxd_bus_types[i]);
18451845 return rc;
18461846 }
drivers/dma/mediatek/mtk-hsdma.c+1−0
@@ -1007,6 +1007,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev) · 1006 unmodified lines
10071007 return 0;
10081008
10091009 err_free:
1010+ mtk_hsdma_hw_deinit(hsdma);
10101011 of_dma_controller_free(pdev->dev.of_node);
10111012 err_unregister:
10121013 dma_async_device_unregister(dd);
drivers/dma/milbeaut-xdmac.c+3−1
@@ -350,7 +350,7 @@ static int milbeaut_xdmac_probe(struct platform_device *pdev) · 349 unmodified lines
350350
351351 ret = dma_async_device_register(ddev);
352352 if (ret)
353− return ret;
353+ goto disable_xdmac;
354354
355355 ret = of_dma_controller_register(dev->of_node,
356356 of_dma_simple_xlate, mdev);
@@ -363,6 +363,8 @@ static int milbeaut_xdmac_probe(struct platform_device *pdev) · 6 unmodified lines
363363
364364 unregister_dmac:
365365 dma_async_device_unregister(ddev);
366+disable_xdmac:
367+ disable_xdmac(mdev);
366368 return ret;
367369 }
368370
drivers/dma/qcom/bam_dma.c+1−5
@@ -630,7 +630,7 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan, · 629 unmodified lines
630630 GFP_NOWAIT);
631631
632632 if (!async_desc)
633− goto err_out;
633+ return NULL;
634634
635635 if (flags & DMA_PREP_FENCE)
636636 async_desc->flags |= DESC_FLAG_NWD;
@@ -670,10 +670,6 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan, · 33 unmodified lines
670670 }
671671
672672 return vchan_tx_prep(&bchan->vc, &async_desc->vd, flags);
673−
674−err_out:
675− kfree(async_desc);
676− return NULL;
677673 }
678674
679675 /**
drivers/dma/qcom/gpi.c+5−5
@@ -1416,7 +1416,7 @@ static int gpi_alloc_ring(struct gpi_ring *ring, u32 elements, · 1415 unmodified lines
14161416 len = 1 << bit;
14171417 ring->alloc_size = (len + (len - 1));
14181418 dev_dbg(gpii->gpi_dev->dev,
1419− "#el:%u el_size:%u len:%u actual_len:%llu alloc_size:%lu\n",
1419+ "#el:%u el_size:%u len:%u actual_len:%llu alloc_size:%zu\n",
14201420 elements, el_size, (elements * el_size), len,
14211421 ring->alloc_size);
14221422
@@ -1424,7 +1424,7 @@ static int gpi_alloc_ring(struct gpi_ring *ring, u32 elements, · 1 unmodified line
14241424 ring->alloc_size,
14251425 &ring->dma_handle, GFP_KERNEL);
14261426 if (!ring->pre_aligned) {
1427− dev_err(gpii->gpi_dev->dev, "could not alloc size:%lu mem for ring\n",
1427+ dev_err(gpii->gpi_dev->dev, "could not alloc size:%zu mem for ring\n",
14281428 ring->alloc_size);
14291429 return -ENOMEM;
14301430 }
@@ -1444,8 +1444,8 @@ static int gpi_alloc_ring(struct gpi_ring *ring, u32 elements, · 13 unmodified lines
14441444 smp_wmb();
14451445
14461446 dev_dbg(gpii->gpi_dev->dev,
1447− "phy_pre:0x%0llx phy_alig:0x%0llx len:%u el_size:%u elements:%u\n",
1448− ring->dma_handle, ring->phys_addr, ring->len,
1447+ "phy_pre:%pad phy_alig:%pa len:%u el_size:%u elements:%u\n",
1448+ &ring->dma_handle, &ring->phys_addr, ring->len,
14491449 ring->el_size, ring->elements);
14501450
14511451 return 0;
@@ -1948,7 +1948,7 @@ static int gpi_ch_init(struct gchan *gchan) · 496 unmodified lines
19481948 return ret;
19491949
19501950 error_start_chan:
1951− for (i = i - 1; i >= 0; i++) {
1951+ for (i = i - 1; i >= 0; i--) {
19521952 gpi_stop_chan(&gpii->gchan[i]);
19531953 gpi_send_cmd(gpii, gchan, GPI_CH_CMD_RESET);
19541954 }
drivers/dma/stm32-mdma.c+1−1
@@ -199,7 +199,7 @@ · 198 unmodified lines
199199 #define STM32_MDMA_MAX_CHANNELS 63
200200 #define STM32_MDMA_MAX_REQUESTS 256
201201 #define STM32_MDMA_MAX_BURST 128
202−#define STM32_MDMA_VERY_HIGH_PRIORITY 0x11
202+#define STM32_MDMA_VERY_HIGH_PRIORITY 0x3
203203
204204 enum stm32_mdma_trigger_mode {
205205 STM32_MDMA_BUFFER,
drivers/dma/ti/k3-udma.c+5−4
@@ -2401,7 +2401,8 @@ static int bcdma_alloc_chan_resources(struct dma_chan *chan) · 2400 unmodified lines
24012401 dev_err(ud->ddev.dev,
24022402 "Descriptor pool allocation failed\n");
24032403 uc->use_dma_pool = false;
2404− return -ENOMEM;
2404+ ret = -ENOMEM;
2405+ goto err_res_free;
24052406 }
24062407
24072408 uc->use_dma_pool = true;
@@ -4698,9 +4699,9 @@ static int pktdma_setup_resources(struct udma_dev *ud) · 2290 unmodified lines
46984699 ud->tchan_tpl.levels = 1;
46994700 }
47004701
4701− ud->tchan_tpl.levels = ud->tchan_tpl.levels;
4702− ud->tchan_tpl.start_idx[0] = ud->tchan_tpl.start_idx[0];
4703− ud->tchan_tpl.start_idx[1] = ud->tchan_tpl.start_idx[1];
4702+ ud->rchan_tpl.levels = ud->tchan_tpl.levels;
4703+ ud->rchan_tpl.start_idx[0] = ud->tchan_tpl.start_idx[0];
4704+ ud->rchan_tpl.start_idx[1] = ud->tchan_tpl.start_idx[1];
47044705
47054706 ud->tchan_map = devm_kmalloc_array(dev, BITS_TO_LONGS(ud->tchan_cnt),
47064707 sizeof(unsigned long), GFP_KERNEL);
drivers/dma/xilinx/xilinx_dma.c+8−3
@@ -2781,7 +2781,7 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev, · 2780 unmodified lines
27812781 has_dre = false;
27822782
27832783 if (!has_dre)
2784− xdev->common.copy_align = fls(width - 1);
2784+ xdev->common.copy_align = (enum dmaengine_alignment)fls(width - 1);
27852785
27862786 if (of_device_is_compatible(node, "xlnx,axi-vdma-mm2s-channel") ||
27872787 of_device_is_compatible(node, "xlnx,axi-dma-mm2s-channel") ||
@@ -2900,7 +2900,8 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev, · 112 unmodified lines
29002900 static int xilinx_dma_child_probe(struct xilinx_dma_device *xdev,
29012901 struct device_node *node)
29022902 {
2903− int ret, i, nr_channels = 1;
2903+ int ret, i;
2904+ u32 nr_channels = 1;
29042905
29052906 ret = of_property_read_u32(node, "dma-channels", &nr_channels);
29062907 if (xdev->dma_config->dmatype == XDMA_TYPE_AXIMCDMA && ret < 0)
@@ -3112,7 +3113,11 @@ static int xilinx_dma_probe(struct platform_device *pdev) · 205 unmodified lines
31123113 }
31133114
31143115 /* Register the DMA engine with the core */
3115− dma_async_device_register(&xdev->common);
3116+ err = dma_async_device_register(&xdev->common);
3117+ if (err) {
3118+ dev_err(xdev->dev, "failed to register the dma device\n");
3119+ goto error;
3120+ }
31163121
31173122 err = of_dma_controller_register(node, of_dma_xilinx_xlate,
31183123 xdev);
drivers/firmware/efi/apple-properties.c+9−4
@@ -3,8 +3,9 @@ · 2 unmodified lines
33 * apple-properties.c - EFI device properties on Macs
44 * Copyright (C) 2016 Lukas Wunner <lukas@wunner.de>
55 *
6− * Note, all properties are considered as u8 arrays.
7− * To get a value of any of them the caller must use device_property_read_u8_array().
6+ * Properties are stored either as:
7+ * u8 arrays which can be retrieved with device_property_read_u8_array() or
8+ * booleans which can be queried with device_property_present().
89 */
910
1011 #define pr_fmt(fmt) "apple-properties: " fmt
@@ -88,8 +89,12 @@ static void __init unmarshal_key_value_pairs(struct dev_header *dev_header, · 77 unmodified lines
8889
8990 entry_data = ptr + key_len + sizeof(val_len);
9091 entry_len = val_len - sizeof(val_len);
91− entry[i] = PROPERTY_ENTRY_U8_ARRAY_LEN(key, entry_data,
92− entry_len);
92+ if (entry_len)
93+ entry[i] = PROPERTY_ENTRY_U8_ARRAY_LEN(key, entry_data,
94+ entry_len);
95+ else
96+ entry[i] = PROPERTY_ENTRY_BOOL(key);
97+
9398 if (dump_properties) {
9499 dev_info(dev, "property: %s\n", key);
95100 print_hex_dump(KERN_INFO, pr_fmt(), DUMP_PREFIX_OFFSET,
drivers/firmware/imx/Kconfig+1−0
@@ -13,6 +13,7 @@ config IMX_DSP · 12 unmodified lines
1313 config IMX_SCU
1414 bool "IMX SCU Protocol driver"
1515 depends on IMX_MBOX
16+ select SOC_BUS
1617 help
1718 The System Controller Firmware (SCFW) is a low-level system function
1819 which runs on a dedicated Cortex-M core to provide power, clock, and
drivers/gpio/Kconfig+6−2
@@ -441,8 +441,9 @@ config GPIO_MXC · 440 unmodified lines
441441 select GENERIC_IRQ_CHIP
442442
443443 config GPIO_MXS
444− def_bool y
444+ bool "Freescale MXS GPIO support" if COMPILE_TEST
445445 depends on ARCH_MXS || COMPILE_TEST
446+ default y if ARCH_MXS
446447 select GPIO_GENERIC
447448 select GENERIC_IRQ_CHIP
448449
@@ -521,7 +522,8 @@ config GPIO_SAMA5D2_PIOBU · 72 unmodified lines
521522
522523 config GPIO_SIFIVE
523524 bool "SiFive GPIO support"
524− depends on OF_GPIO && IRQ_DOMAIN_HIERARCHY
525+ depends on OF_GPIO
526+ select IRQ_DOMAIN_HIERARCHY
525527 select GPIO_GENERIC
526528 select GPIOLIB_IRQCHIP
527529 select REGMAP_MMIO
@@ -597,6 +599,8 @@ config GPIO_TEGRA · 69 unmodified lines
597599 default ARCH_TEGRA
598600 depends on ARCH_TEGRA || COMPILE_TEST
599601 depends on OF_GPIO
602+ select GPIOLIB_IRQCHIP
603+ select IRQ_DOMAIN_HIERARCHY
600604 help
601605 Say yes here to support GPIO pins on NVIDIA Tegra SoCs.
602606
drivers/gpio/gpio-ep93xx.c+118−98
@@ -25,6 +25,9 @@ · 24 unmodified lines
2525 /* Maximum value for gpio line identifiers */
2626 #define EP93XX_GPIO_LINE_MAX 63
2727
28+/* Number of GPIO chips in EP93XX */
29+#define EP93XX_GPIO_CHIP_NUM 8
30+
2831 /* Maximum value for irq capable line identifiers */
2932 #define EP93XX_GPIO_LINE_MAX_IRQ 23
3033
@@ -34,74 +37,75 @@ · 3 unmodified lines
3437 */
3538 #define EP93XX_GPIO_F_IRQ_BASE 80
3639
37−struct ep93xx_gpio {
38− void __iomem *base;
39− struct gpio_chip gc[8];
40+struct ep93xx_gpio_irq_chip {
41+ struct irq_chip ic;
42+ u8 irq_offset;
43+ u8 int_unmasked;
44+ u8 int_enabled;
45+ u8 int_type1;
46+ u8 int_type2;
47+ u8 int_debounce;
4048 };
4149
42−/*************************************************************************
43− * Interrupt handling for EP93xx on-chip GPIOs
44− *************************************************************************/
45−static unsigned char gpio_int_unmasked[3];
46−static unsigned char gpio_int_enabled[3];
47−static unsigned char gpio_int_type1[3];
48−static unsigned char gpio_int_type2[3];
49−static unsigned char gpio_int_debounce[3];
50−
51−/* Port ordering is: A B F */
52−static const u8 int_type1_register_offset[3] = { 0x90, 0xac, 0x4c };
53−static const u8 int_type2_register_offset[3] = { 0x94, 0xb0, 0x50 };
54−static const u8 eoi_register_offset[3] = { 0x98, 0xb4, 0x54 };
55−static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x58 };
56−static const u8 int_debounce_register_offset[3] = { 0xa8, 0xc4, 0x64 };
57−
58−static void ep93xx_gpio_update_int_params(struct ep93xx_gpio *epg, unsigned port)
59−{
60− BUG_ON(port > 2);
50+struct ep93xx_gpio_chip {
51+ struct gpio_chip gc;
52+ struct ep93xx_gpio_irq_chip *eic;
53+};
6154
62− writeb_relaxed(0, epg->base + int_en_register_offset[port]);
55+struct ep93xx_gpio {
56+ void __iomem *base;
57+ struct ep93xx_gpio_chip gc[EP93XX_GPIO_CHIP_NUM];
58+};
6359
64− writeb_relaxed(gpio_int_type2[port],
65− epg->base + int_type2_register_offset[port]);
60+#define to_ep93xx_gpio_chip(x) container_of(x, struct ep93xx_gpio_chip, gc)
6661
67− writeb_relaxed(gpio_int_type1[port],
68− epg->base + int_type1_register_offset[port]);
62+static struct ep93xx_gpio_irq_chip *to_ep93xx_gpio_irq_chip(struct gpio_chip *gc)
63+{
64+ struct ep93xx_gpio_chip *egc = to_ep93xx_gpio_chip(gc);
6965
70− writeb(gpio_int_unmasked[port] & gpio_int_enabled[port],
71− epg->base + int_en_register_offset[port]);
66+ return egc->eic;
7267 }
7368
74−static int ep93xx_gpio_port(struct gpio_chip *gc)
69+/*************************************************************************
70+ * Interrupt handling for EP93xx on-chip GPIOs
71+ *************************************************************************/
72+#define EP93XX_INT_TYPE1_OFFSET 0x00
73+#define EP93XX_INT_TYPE2_OFFSET 0x04
74+#define EP93XX_INT_EOI_OFFSET 0x08
75+#define EP93XX_INT_EN_OFFSET 0x0c
76+#define EP93XX_INT_STATUS_OFFSET 0x10
77+#define EP93XX_INT_RAW_STATUS_OFFSET 0x14
78+#define EP93XX_INT_DEBOUNCE_OFFSET 0x18
79+
80+static void ep93xx_gpio_update_int_params(struct ep93xx_gpio *epg,
81+ struct ep93xx_gpio_irq_chip *eic)
7582 {
76− struct ep93xx_gpio *epg = gpiochip_get_data(gc);
77− int port = 0;
83+ writeb_relaxed(0, epg->base + eic->irq_offset + EP93XX_INT_EN_OFFSET);
7884
79− while (port < ARRAY_SIZE(epg->gc) && gc != &epg->gc[port])
80− port++;
85+ writeb_relaxed(eic->int_type2,
86+ epg->base + eic->irq_offset + EP93XX_INT_TYPE2_OFFSET);
8187
82− /* This should not happen but is there as a last safeguard */
83− if (port == ARRAY_SIZE(epg->gc)) {
84− pr_crit("can't find the GPIO port\n");
85− return 0;
86− }
88+ writeb_relaxed(eic->int_type1,
89+ epg->base + eic->irq_offset + EP93XX_INT_TYPE1_OFFSET);
8790
88− return port;
91+ writeb_relaxed(eic->int_unmasked & eic->int_enabled,
92+ epg->base + eic->irq_offset + EP93XX_INT_EN_OFFSET);
8993 }
9094
9195 static void ep93xx_gpio_int_debounce(struct gpio_chip *gc,
9296 unsigned int offset, bool enable)
9397 {
9498 struct ep93xx_gpio *epg = gpiochip_get_data(gc);
95− int port = ep93xx_gpio_port(gc);
99+ struct ep93xx_gpio_irq_chip *eic = to_ep93xx_gpio_irq_chip(gc);
96100 int port_mask = BIT(offset);
97101
98102 if (enable)
99− gpio_int_debounce[port] |= port_mask;
103+ eic->int_debounce |= port_mask;
100104 else
101− gpio_int_debounce[port] &= ~port_mask;
105+ eic->int_debounce &= ~port_mask;
102106
103− writeb(gpio_int_debounce[port],
104− epg->base + int_debounce_register_offset[port]);
107+ writeb(eic->int_debounce,
108+ epg->base + eic->irq_offset + EP93XX_INT_DEBOUNCE_OFFSET);
105109 }
106110
107111 static void ep93xx_gpio_ab_irq_handler(struct irq_desc *desc)
@@ -122,12 +126,12 @@ static void ep93xx_gpio_ab_irq_handler(struct irq_desc *desc) · 14 unmodified lines
122126 */
123127 stat = readb(epg->base + EP93XX_GPIO_A_INT_STATUS);
124128 for_each_set_bit(offset, &stat, 8)
125− generic_handle_irq(irq_find_mapping(epg->gc[0].irq.domain,
129+ generic_handle_irq(irq_find_mapping(epg->gc[0].gc.irq.domain,
126130 offset));
127131
128132 stat = readb(epg->base + EP93XX_GPIO_B_INT_STATUS);
129133 for_each_set_bit(offset, &stat, 8)
130− generic_handle_irq(irq_find_mapping(epg->gc[1].irq.domain,
134+ generic_handle_irq(irq_find_mapping(epg->gc[1].gc.irq.domain,
131135 offset));
132136
133137 chained_irq_exit(irqchip, desc);
@@ -153,52 +157,52 @@ static void ep93xx_gpio_f_irq_handler(struct irq_desc *desc) · 19 unmodified lines
153157 static void ep93xx_gpio_irq_ack(struct irq_data *d)
154158 {
155159 struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
160+ struct ep93xx_gpio_irq_chip *eic = to_ep93xx_gpio_irq_chip(gc);
156161 struct ep93xx_gpio *epg = gpiochip_get_data(gc);
157− int port = ep93xx_gpio_port(gc);
158162 int port_mask = BIT(d->irq & 7);
159163
160164 if (irqd_get_trigger_type(d) == IRQ_TYPE_EDGE_BOTH) {
161− gpio_int_type2[port] ^= port_mask; /* switch edge direction */
162− ep93xx_gpio_update_int_params(epg, port);
165+ eic->int_type2 ^= port_mask; /* switch edge direction */
166+ ep93xx_gpio_update_int_params(epg, eic);
163167 }
164168
165− writeb(port_mask, epg->base + eoi_register_offset[port]);
169+ writeb(port_mask, epg->base + eic->irq_offset + EP93XX_INT_EOI_OFFSET);
166170 }
167171
168172 static void ep93xx_gpio_irq_mask_ack(struct irq_data *d)
169173 {
170174 struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
175+ struct ep93xx_gpio_irq_chip *eic = to_ep93xx_gpio_irq_chip(gc);
171176 struct ep93xx_gpio *epg = gpiochip_get_data(gc);
172− int port = ep93xx_gpio_port(gc);
173177 int port_mask = BIT(d->irq & 7);
174178
175179 if (irqd_get_trigger_type(d) == IRQ_TYPE_EDGE_BOTH)
176− gpio_int_type2[port] ^= port_mask; /* switch edge direction */
180+ eic->int_type2 ^= port_mask; /* switch edge direction */
177181
178− gpio_int_unmasked[port] &= ~port_mask;
179− ep93xx_gpio_update_int_params(epg, port);
182+ eic->int_unmasked &= ~port_mask;
183+ ep93xx_gpio_update_int_params(epg, eic);
180184
181− writeb(port_mask, epg->base + eoi_register_offset[port]);
185+ writeb(port_mask, epg->base + eic->irq_offset + EP93XX_INT_EOI_OFFSET);
182186 }
183187
184188 static void ep93xx_gpio_irq_mask(struct irq_data *d)
185189 {
186190 struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
191+ struct ep93xx_gpio_irq_chip *eic = to_ep93xx_gpio_irq_chip(gc);
187192 struct ep93xx_gpio *epg = gpiochip_get_data(gc);
188− int port = ep93xx_gpio_port(gc);
189193
190− gpio_int_unmasked[port] &= ~BIT(d->irq & 7);
191− ep93xx_gpio_update_int_params(epg, port);
194+ eic->int_unmasked &= ~BIT(d->irq & 7);
195+ ep93xx_gpio_update_int_params(epg, eic);
192196 }
193197
194198 static void ep93xx_gpio_irq_unmask(struct irq_data *d)
195199 {
196200 struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
201+ struct ep93xx_gpio_irq_chip *eic = to_ep93xx_gpio_irq_chip(gc);
197202 struct ep93xx_gpio *epg = gpiochip_get_data(gc);
198− int port = ep93xx_gpio_port(gc);
199203
200− gpio_int_unmasked[port] |= BIT(d->irq & 7);
201− ep93xx_gpio_update_int_params(epg, port);
204+ eic->int_unmasked |= BIT(d->irq & 7);
205+ ep93xx_gpio_update_int_params(epg, eic);
202206 }
203207
204208 /*
@@ -209,8 +213,8 @@ static void ep93xx_gpio_irq_unmask(struct irq_data *d) · 4 unmodified lines
209213 static int ep93xx_gpio_irq_type(struct irq_data *d, unsigned int type)
210214 {
211215 struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
216+ struct ep93xx_gpio_irq_chip *eic = to_ep93xx_gpio_irq_chip(gc);
212217 struct ep93xx_gpio *epg = gpiochip_get_data(gc);
213− int port = ep93xx_gpio_port(gc);
214218 int offset = d->irq & 7;
215219 int port_mask = BIT(offset);
216220 irq_flow_handler_t handler;
@@ -219,32 +223,32 @@ static int ep93xx_gpio_irq_type(struct irq_data *d, unsigned int type) · 2 unmodified lines
219223
220224 switch (type) {
221225 case IRQ_TYPE_EDGE_RISING:
222− gpio_int_type1[port] |= port_mask;
223− gpio_int_type2[port] |= port_mask;
226+ eic->int_type1 |= port_mask;
227+ eic->int_type2 |= port_mask;
224228 handler = handle_edge_irq;
225229 break;
226230 case IRQ_TYPE_EDGE_FALLING:
227− gpio_int_type1[port] |= port_mask;
228− gpio_int_type2[port] &= ~port_mask;
231+ eic->int_type1 |= port_mask;
232+ eic->int_type2 &= ~port_mask;
229233 handler = handle_edge_irq;
230234 break;
231235 case IRQ_TYPE_LEVEL_HIGH:
232− gpio_int_type1[port] &= ~port_mask;
233− gpio_int_type2[port] |= port_mask;
236+ eic->int_type1 &= ~port_mask;
237+ eic->int_type2 |= port_mask;
234238 handler = handle_level_irq;
235239 break;
236240 case IRQ_TYPE_LEVEL_LOW:
237− gpio_int_type1[port] &= ~port_mask;
238− gpio_int_type2[port] &= ~port_mask;
241+ eic->int_type1 &= ~port_mask;
242+ eic->int_type2 &= ~port_mask;
239243 handler = handle_level_irq;
240244 break;
241245 case IRQ_TYPE_EDGE_BOTH:
242− gpio_int_type1[port] |= port_mask;
246+ eic->int_type1 |= port_mask;
243247 /* set initial polarity based on current input level */
244248 if (gc->get(gc, offset))
245− gpio_int_type2[port] &= ~port_mask; /* falling */
249+ eic->int_type2 &= ~port_mask; /* falling */
246250 else
247− gpio_int_type2[port] |= port_mask; /* rising */
251+ eic->int_type2 |= port_mask; /* rising */
248252 handler = handle_edge_irq;
249253 break;
250254 default:
@@ -253,22 +257,13 @@ static int ep93xx_gpio_irq_type(struct irq_data *d, unsigned int type) · 2 unmodified lines
253257
254258 irq_set_handler_locked(d, handler);
255259
256− gpio_int_enabled[port] |= port_mask;
260+ eic->int_enabled |= port_mask;
257261
258− ep93xx_gpio_update_int_params(epg, port);
262+ ep93xx_gpio_update_int_params(epg, eic);
259263
260264 return 0;
261265 }
262266
263−static struct irq_chip ep93xx_gpio_irq_chip = {
264− .name = "GPIO",
265− .irq_ack = ep93xx_gpio_irq_ack,
266− .irq_mask_ack = ep93xx_gpio_irq_mask_ack,
267− .irq_mask = ep93xx_gpio_irq_mask,
268− .irq_unmask = ep93xx_gpio_irq_unmask,
269− .irq_set_type = ep93xx_gpio_irq_type,
270−};
271−
272267 /*************************************************************************
273268 * gpiolib interface for EP93xx on-chip GPIOs
274269 *************************************************************************/
@@ -276,17 +271,19 @@ struct ep93xx_gpio_bank { · 1 unmodified line
276271 const char *label;
277272 int data;
278273 int dir;
274+ int irq;
279275 int base;
280276 bool has_irq;
281277 bool has_hierarchical_irq;
282278 unsigned int irq_base;
283279 };
284280
285−#define EP93XX_GPIO_BANK(_label, _data, _dir, _base, _has_irq, _has_hier, _irq_base) \
281+#define EP93XX_GPIO_BANK(_label, _data, _dir, _irq, _base, _has_irq, _has_hier, _irq_base) \
286282 { \
287283 .label = _label, \
288284 .data = _data, \
289285 .dir = _dir, \
286+ .irq = _irq, \
290287 .base = _base, \
291288 .has_irq = _has_irq, \
292289 .has_hierarchical_irq = _has_hier, \
@@ -295,16 +292,16 @@ struct ep93xx_gpio_bank { · 2 unmodified lines
295292
296293 static struct ep93xx_gpio_bank ep93xx_gpio_banks[] = {
297294 /* Bank A has 8 IRQs */
298− EP93XX_GPIO_BANK("A", 0x00, 0x10, 0, true, false, 64),
295+ EP93XX_GPIO_BANK("A", 0x00, 0x10, 0x90, 0, true, false, 64),
299296 /* Bank B has 8 IRQs */
300− EP93XX_GPIO_BANK("B", 0x04, 0x14, 8, true, false, 72),
301− EP93XX_GPIO_BANK("C", 0x08, 0x18, 40, false, false, 0),
302− EP93XX_GPIO_BANK("D", 0x0c, 0x1c, 24, false, false, 0),
303− EP93XX_GPIO_BANK("E", 0x20, 0x24, 32, false, false, 0),
297+ EP93XX_GPIO_BANK("B", 0x04, 0x14, 0xac, 8, true, false, 72),
298+ EP93XX_GPIO_BANK("C", 0x08, 0x18, 0x00, 40, false, false, 0),
299+ EP93XX_GPIO_BANK("D", 0x0c, 0x1c, 0x00, 24, false, false, 0),
300+ EP93XX_GPIO_BANK("E", 0x20, 0x24, 0x00, 32, false, false, 0),
304301 /* Bank F has 8 IRQs */
305− EP93XX_GPIO_BANK("F", 0x30, 0x34, 16, false, true, 0),
306− EP93XX_GPIO_BANK("G", 0x38, 0x3c, 48, false, false, 0),
307− EP93XX_GPIO_BANK("H", 0x40, 0x44, 56, false, false, 0),
302+ EP93XX_GPIO_BANK("F", 0x30, 0x34, 0x4c, 16, false, true, 0),
303+ EP93XX_GPIO_BANK("G", 0x38, 0x3c, 0x00, 48, false, false, 0),
304+ EP93XX_GPIO_BANK("H", 0x40, 0x44, 0x00, 56, false, false, 0),
308305 };
309306
310307 static int ep93xx_gpio_set_config(struct gpio_chip *gc, unsigned offset,
@@ -326,13 +323,23 @@ static int ep93xx_gpio_f_to_irq(struct gpio_chip *gc, unsigned offset) · 15 unmodified lines
326323 return EP93XX_GPIO_F_IRQ_BASE + offset;
327324 }
328325
329−static int ep93xx_gpio_add_bank(struct gpio_chip *gc,
326+static void ep93xx_init_irq_chip(struct device *dev, struct irq_chip *ic)
327+{
328+ ic->irq_ack = ep93xx_gpio_irq_ack;
329+ ic->irq_mask_ack = ep93xx_gpio_irq_mask_ack;
330+ ic->irq_mask = ep93xx_gpio_irq_mask;
331+ ic->irq_unmask = ep93xx_gpio_irq_unmask;
332+ ic->irq_set_type = ep93xx_gpio_irq_type;
333+}
334+
335+static int ep93xx_gpio_add_bank(struct ep93xx_gpio_chip *egc,
330336 struct platform_device *pdev,
331337 struct ep93xx_gpio *epg,
332338 struct ep93xx_gpio_bank *bank)
333339 {
334340 void __iomem *data = epg->base + bank->data;
335341 void __iomem *dir = epg->base + bank->dir;
342+ struct gpio_chip *gc = &egc->gc;
336343 struct device *dev = &pdev->dev;
337344 struct gpio_irq_chip *girq;
338345 int err;
@@ -346,8 +353,21 @@ static int ep93xx_gpio_add_bank(struct gpio_chip *gc, · 7 unmodified lines
346353
347354 girq = &gc->irq;
348355 if (bank->has_irq || bank->has_hierarchical_irq) {
356+ struct irq_chip *ic;
357+
349358 gc->set_config = ep93xx_gpio_set_config;
350− girq->chip = &ep93xx_gpio_irq_chip;
359+ egc->eic = devm_kcalloc(dev, 1,
360+ sizeof(*egc->eic),
361+ GFP_KERNEL);
362+ if (!egc->eic)
363+ return -ENOMEM;
364+ egc->eic->irq_offset = bank->irq;
365+ ic = &egc->eic->ic;
366+ ic->name = devm_kasprintf(dev, GFP_KERNEL, "gpio-irq-%s", bank->label);
367+ if (!ic->name)
368+ return -ENOMEM;
369+ ep93xx_init_irq_chip(dev, ic);
370+ girq->chip = ic;
351371 }
352372
353373 if (bank->has_irq) {
@@ -389,7 +409,7 @@ static int ep93xx_gpio_add_bank(struct gpio_chip *gc, · 35 unmodified lines
389409 gpio_irq = EP93XX_GPIO_F_IRQ_BASE + i;
390410 irq_set_chip_data(gpio_irq, &epg->gc[5]);
391411 irq_set_chip_and_handler(gpio_irq,
392− &ep93xx_gpio_irq_chip,
412+ girq->chip,
393413 handle_level_irq);
394414 irq_clear_status_flags(gpio_irq, IRQ_NOREQUEST);
395415 }
@@ -415,7 +435,7 @@ static int ep93xx_gpio_probe(struct platform_device *pdev) · 19 unmodified lines
415435 return PTR_ERR(epg->base);
416436
417437 for (i = 0; i < ARRAY_SIZE(ep93xx_gpio_banks); i++) {
418− struct gpio_chip *gc = &epg->gc[i];
438+ struct ep93xx_gpio_chip *gc = &epg->gc[i];
419439 struct ep93xx_gpio_bank *bank = &ep93xx_gpio_banks[i];
420440
421441 if (ep93xx_gpio_add_bank(gc, pdev, epg, bank))
drivers/gpio/gpio-mvebu.c+8−11
@@ -676,20 +676,17 @@ static void mvebu_pwm_get_state(struct pwm_chip *chip, · 675 unmodified lines
676676 else
677677 state->duty_cycle = 1;
678678
679+ val = (unsigned long long) u; /* on duration */
679680 regmap_read(mvpwm->regs, mvebu_pwmreg_blink_off_duration(mvpwm), &u);
680− val = (unsigned long long) u * NSEC_PER_SEC;
681+ val += (unsigned long long) u; /* period = on + off duration */
682+ val *= NSEC_PER_SEC;
681683 do_div(val, mvpwm->clk_rate);
682− if (val < state->duty_cycle) {
684+ if (val > UINT_MAX)
685+ state->period = UINT_MAX;
686+ else if (val)
687+ state->period = val;
688+ else
683689 state->period = 1;
684− } else {
685− val -= state->duty_cycle;
686− if (val > UINT_MAX)
687− state->period = UINT_MAX;
688− else if (val)
689− state->period = val;
690− else
691− state->period = 1;
692− }
693690
694691 regmap_read(mvchip->regs, GPIO_BLINK_EN_OFF + mvchip->offset, &u);
695692 if (u)
drivers/gpio/gpiolib-cdev.c+75−72
@@ -776,6 +776,8 @@ static void edge_detector_stop(struct line *line) · 775 unmodified lines
776776 cancel_delayed_work_sync(&line->work);
777777 WRITE_ONCE(line->sw_debounced, 0);
778778 WRITE_ONCE(line->eflags, 0);
779+ if (line->desc)
780+ WRITE_ONCE(line->desc->debounce_period_us, 0);
779781 /* do not change line->level - see comment in debounced_value() */
780782 }
781783
@@ -1979,6 +1981,21 @@ struct gpio_chardev_data { · 1197 unmodified lines
19791981 #endif
19801982 };
19811983
1984+static int chipinfo_get(struct gpio_chardev_data *cdev, void __user *ip)
1985+{
1986+ struct gpio_device *gdev = cdev->gdev;
1987+ struct gpiochip_info chipinfo;
1988+
1989+ memset(&chipinfo, 0, sizeof(chipinfo));
1990+
1991+ strscpy(chipinfo.name, dev_name(&gdev->dev), sizeof(chipinfo.name));
1992+ strscpy(chipinfo.label, gdev->label, sizeof(chipinfo.label));
1993+ chipinfo.lines = gdev->ngpio;
1994+ if (copy_to_user(ip, &chipinfo, sizeof(chipinfo)))
1995+ return -EFAULT;
1996+ return 0;
1997+}
1998+
19821999 #ifdef CONFIG_GPIO_CDEV_V1
19832000 /*
19842001 * returns 0 if the versions match, else the previously selected ABI version
@@ -1993,6 +2010,41 @@ static int lineinfo_ensure_abi_version(struct gpio_chardev_data *cdata, · 8 unmodified lines
19932010
19942011 return abiv;
19952012 }
2013+
2014+static int lineinfo_get_v1(struct gpio_chardev_data *cdev, void __user *ip,
2015+ bool watch)
2016+{
2017+ struct gpio_desc *desc;
2018+ struct gpioline_info lineinfo;
2019+ struct gpio_v2_line_info lineinfo_v2;
2020+
2021+ if (copy_from_user(&lineinfo, ip, sizeof(lineinfo)))
2022+ return -EFAULT;
2023+
2024+ /* this doubles as a range check on line_offset */
2025+ desc = gpiochip_get_desc(cdev->gdev->chip, lineinfo.line_offset);
2026+ if (IS_ERR(desc))
2027+ return PTR_ERR(desc);
2028+
2029+ if (watch) {
2030+ if (lineinfo_ensure_abi_version(cdev, 1))
2031+ return -EPERM;
2032+
2033+ if (test_and_set_bit(lineinfo.line_offset, cdev->watched_lines))
2034+ return -EBUSY;
2035+ }
2036+
2037+ gpio_desc_to_lineinfo(desc, &lineinfo_v2);
2038+ gpio_v2_line_info_to_v1(&lineinfo_v2, &lineinfo);
2039+
2040+ if (copy_to_user(ip, &lineinfo, sizeof(lineinfo))) {
2041+ if (watch)
2042+ clear_bit(lineinfo.line_offset, cdev->watched_lines);
2043+ return -EFAULT;
2044+ }
2045+
2046+ return 0;
2047+}
19962048 #endif
19972049
19982050 static int lineinfo_get(struct gpio_chardev_data *cdev, void __user *ip,
@@ -2030,6 +2082,22 @@ static int lineinfo_get(struct gpio_chardev_data *cdev, void __user *ip, · 31 unmodified lines
20302082 return 0;
20312083 }
20322084
2085+static int lineinfo_unwatch(struct gpio_chardev_data *cdev, void __user *ip)
2086+{
2087+ __u32 offset;
2088+
2089+ if (copy_from_user(&offset, ip, sizeof(offset)))
2090+ return -EFAULT;
2091+
2092+ if (offset >= cdev->gdev->ngpio)
2093+ return -EINVAL;
2094+
2095+ if (!test_and_clear_bit(offset, cdev->watched_lines))
2096+ return -EBUSY;
2097+
2098+ return 0;
2099+}
2100+
20332101 /*
20342102 * gpio_ioctl() - ioctl handler for the GPIO chardev
20352103 */
@@ -2037,80 +2105,24 @@ static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 1 unmodified line
20372105 {
20382106 struct gpio_chardev_data *cdev = file->private_data;
20392107 struct gpio_device *gdev = cdev->gdev;
2040− struct gpio_chip *gc = gdev->chip;
20412108 void __user *ip = (void __user *)arg;
2042− __u32 offset;
20432109
20442110 /* We fail any subsequent ioctl():s when the chip is gone */
2045− if (!gc)
2111+ if (!gdev->chip)
20462112 return -ENODEV;
20472113
20482114 /* Fill in the struct and pass to userspace */
20492115 if (cmd == GPIO_GET_CHIPINFO_IOCTL) {
2050− struct gpiochip_info chipinfo;
2051−
2052− memset(&chipinfo, 0, sizeof(chipinfo));
2053−
2054− strscpy(chipinfo.name, dev_name(&gdev->dev),
2055− sizeof(chipinfo.name));
2056− strscpy(chipinfo.label, gdev->label,
2057− sizeof(chipinfo.label));
2058− chipinfo.lines = gdev->ngpio;
2059− if (copy_to_user(ip, &chipinfo, sizeof(chipinfo)))
2060− return -EFAULT;
2061− return 0;
2116+ return chipinfo_get(cdev, ip);
20622117 #ifdef CONFIG_GPIO_CDEV_V1
2063− } else if (cmd == GPIO_GET_LINEINFO_IOCTL) {
2064− struct gpio_desc *desc;
2065− struct gpioline_info lineinfo;
2066− struct gpio_v2_line_info lineinfo_v2;
2067−
2068− if (copy_from_user(&lineinfo, ip, sizeof(lineinfo)))
2069− return -EFAULT;
2070−
2071− /* this doubles as a range check on line_offset */
2072− desc = gpiochip_get_desc(gc, lineinfo.line_offset);
2073− if (IS_ERR(desc))
2074− return PTR_ERR(desc);
2075−
2076− gpio_desc_to_lineinfo(desc, &lineinfo_v2);
2077− gpio_v2_line_info_to_v1(&lineinfo_v2, &lineinfo);
2078−
2079− if (copy_to_user(ip, &lineinfo, sizeof(lineinfo)))
2080− return -EFAULT;
2081− return 0;
20822118 } else if (cmd == GPIO_GET_LINEHANDLE_IOCTL) {
20832119 return linehandle_create(gdev, ip);
20842120 } else if (cmd == GPIO_GET_LINEEVENT_IOCTL) {
20852121 return lineevent_create(gdev, ip);
2086− } else if (cmd == GPIO_GET_LINEINFO_WATCH_IOCTL) {
2087− struct gpio_desc *desc;
2088− struct gpioline_info lineinfo;
2089− struct gpio_v2_line_info lineinfo_v2;
2090−
2091− if (copy_from_user(&lineinfo, ip, sizeof(lineinfo)))
2092− return -EFAULT;
2093−
2094− /* this doubles as a range check on line_offset */
2095− desc = gpiochip_get_desc(gc, lineinfo.line_offset);
2096− if (IS_ERR(desc))
2097− return PTR_ERR(desc);
2098−
2099− if (lineinfo_ensure_abi_version(cdev, 1))
2100− return -EPERM;
2101−
2102− if (test_and_set_bit(lineinfo.line_offset, cdev->watched_lines))
2103− return -EBUSY;
2104−
2105− gpio_desc_to_lineinfo(desc, &lineinfo_v2);
2106− gpio_v2_line_info_to_v1(&lineinfo_v2, &lineinfo);
2107−
2108− if (copy_to_user(ip, &lineinfo, sizeof(lineinfo))) {
2109− clear_bit(lineinfo.line_offset, cdev->watched_lines);
2110− return -EFAULT;
2111− }
2112−
2113− return 0;
2122+ } else if (cmd == GPIO_GET_LINEINFO_IOCTL ||
2123+ cmd == GPIO_GET_LINEINFO_WATCH_IOCTL) {
2124+ return lineinfo_get_v1(cdev, ip,
2125+ cmd == GPIO_GET_LINEINFO_WATCH_IOCTL);
21142126 #endif /* CONFIG_GPIO_CDEV_V1 */
21152127 } else if (cmd == GPIO_V2_GET_LINEINFO_IOCTL ||
21162128 cmd == GPIO_V2_GET_LINEINFO_WATCH_IOCTL) {
@@ -2119,16 +2131,7 @@ static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 2 unmodified lines
21192131 } else if (cmd == GPIO_V2_GET_LINE_IOCTL) {
21202132 return linereq_create(gdev, ip);
21212133 } else if (cmd == GPIO_GET_LINEINFO_UNWATCH_IOCTL) {
2122− if (copy_from_user(&offset, ip, sizeof(offset)))
2123− return -EFAULT;
2124−
2125− if (offset >= cdev->gdev->ngpio)
2126− return -EINVAL;
2127−
2128− if (!test_and_clear_bit(offset, cdev->watched_lines))
2129− return -EBUSY;
2130−
2131− return 0;
2134+ return lineinfo_unwatch(cdev, ip);
21322135 }
21332136 return -EINVAL;
21342137 }
drivers/gpio/gpiolib.c+12−3
@@ -603,7 +603,11 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data, · 602 unmodified lines
603603 ret = gdev->id;
604604 goto err_free_gdev;
605605 }
606− dev_set_name(&gdev->dev, GPIOCHIP_NAME "%d", gdev->id);
606+
607+ ret = dev_set_name(&gdev->dev, GPIOCHIP_NAME "%d", gdev->id);
608+ if (ret)
609+ goto err_free_ida;
610+
607611 device_initialize(&gdev->dev);
608612 dev_set_drvdata(&gdev->dev, gdev);
609613 if (gc->parent && gc->parent->driver)
@@ -617,7 +621,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data, · 7 unmodified lines
617621 gdev->descs = kcalloc(gc->ngpio, sizeof(gdev->descs[0]), GFP_KERNEL);
618622 if (!gdev->descs) {
619623 ret = -ENOMEM;
620− goto err_free_ida;
624+ goto err_free_dev_name;
621625 }
622626
623627 if (gc->ngpio == 0) {
@@ -768,6 +772,8 @@ err_free_label: · 144 unmodified lines
768772 kfree_const(gdev->label);
769773 err_free_descs:
770774 kfree(gdev->descs);
775+err_free_dev_name:
776+ kfree(dev_name(&gdev->dev));
771777 err_free_ida:
772778 ida_free(&gpio_ida, gdev->id);
773779 err_free_gdev:
@@ -1489,6 +1495,9 @@ static int gpiochip_add_irqchip(struct gpio_chip *gc, · 715 unmodified lines
14891495 type = IRQ_TYPE_NONE;
14901496 }
14911497
1498+ if (gc->to_irq)
1499+ chip_warn(gc, "to_irq is redefined in %s and you shouldn't rely on it\n", __func__);
1500+
14921501 gc->to_irq = gpiochip_to_irq;
14931502 gc->irq.default_type = type;
14941503 gc->irq.lock_key = lock_key;
@@ -2548,7 +2557,7 @@ int gpiod_get_array_value_complex(bool raw, bool can_sleep, · 1053 unmodified lines
25482557 struct gpio_chip *gc = desc_array[i]->gdev->chip;
25492558 unsigned long fastpath[2 * BITS_TO_LONGS(FASTPATH_NGPIO)];
25502559 unsigned long *mask, *bits;
2551− int first, j, ret;
2560+ int first, j;
25522561
25532562 if (likely(gc->ngpio <= FASTPATH_NGPIO)) {
25542563 mask = fastpath;
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c+6−10
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #include <linux/sched/task.h>
2727
2828 #include "amdgpu_object.h"
29+#include "amdgpu_gem.h"
2930 #include "amdgpu_vm.h"
3031 #include "amdgpu_amdkfd.h"
3132 #include "amdgpu_dma_buf.h"
@@ -1152,7 +1153,7 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu( · 1120 unmodified lines
11521153 struct sg_table *sg = NULL;
11531154 uint64_t user_addr = 0;
11541155 struct amdgpu_bo *bo;
1155− struct amdgpu_bo_param bp;
1156+ struct drm_gem_object *gobj;
11561157 u32 domain, alloc_domain;
11571158 u64 alloc_flags;
11581159 int ret;
@@ -1220,19 +1221,14 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu( · 61 unmodified lines
12201221 pr_debug("\tcreate BO VA 0x%llx size 0x%llx domain %s\n",
12211222 va, size, domain_string(alloc_domain));
12221223
1223− memset(&bp, 0, sizeof(bp));
1224− bp.size = size;
1225− bp.byte_align = 1;
1226− bp.domain = alloc_domain;
1227− bp.flags = alloc_flags;
1228− bp.type = bo_type;
1229− bp.resv = NULL;
1230− ret = amdgpu_bo_create(adev, &bp, &bo);
1224+ ret = amdgpu_gem_object_create(adev, size, 1, alloc_domain, alloc_flags,
1225+ bo_type, NULL, &gobj);
12311226 if (ret) {
12321227 pr_debug("Failed to create BO on domain %s. ret %d\n",
1233− domain_string(alloc_domain), ret);
1228+ domain_string(alloc_domain), ret);
12341229 goto err_bo_create;
12351230 }
1231+ bo = gem_to_amdgpu_bo(gobj);
12361232 if (bo_type == ttm_bo_type_sg) {
12371233 bo->tbo.sg = sg;
12381234 bo->tbo.ttm->sg = sg;
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c+36−17
@@ -112,6 +112,7 @@ int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev) · 111 unmodified lines
112112 union igp_info {
113113 struct atom_integrated_system_info_v1_11 v11;
114114 struct atom_integrated_system_info_v1_12 v12;
115+ struct atom_integrated_system_info_v2_1 v21;
115116 };
116117
117118 union umc_info {
@@ -209,24 +210,42 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev, · 91 unmodified lines
209210 if (adev->flags & AMD_IS_APU) {
210211 igp_info = (union igp_info *)
211212 (mode_info->atom_context->bios + data_offset);
212− switch (crev) {
213− case 11:
214− mem_channel_number = igp_info->v11.umachannelnumber;
215− /* channel width is 64 */
216− if (vram_width)
217− *vram_width = mem_channel_number * 64;
218− mem_type = igp_info->v11.memorytype;
219− if (vram_type)
220− *vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
213+ switch (frev) {
214+ case 1:
215+ switch (crev) {
216+ case 11:
217+ case 12:
218+ mem_channel_number = igp_info->v11.umachannelnumber;
219+ if (!mem_channel_number)
220+ mem_channel_number = 1;
221+ /* channel width is 64 */
222+ if (vram_width)
223+ *vram_width = mem_channel_number * 64;
224+ mem_type = igp_info->v11.memorytype;
225+ if (vram_type)
226+ *vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
227+ break;
228+ default:
229+ return -EINVAL;
230+ }
221231 break;
222− case 12:
223− mem_channel_number = igp_info->v12.umachannelnumber;
224− /* channel width is 64 */
225− if (vram_width)
226− *vram_width = mem_channel_number * 64;
227− mem_type = igp_info->v12.memorytype;
228− if (vram_type)
229− *vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
232+ case 2:
233+ switch (crev) {
234+ case 1:
235+ case 2:
236+ mem_channel_number = igp_info->v21.umachannelnumber;
237+ if (!mem_channel_number)
238+ mem_channel_number = 1;
239+ /* channel width is 64 */
240+ if (vram_width)
241+ *vram_width = mem_channel_number * 64;
242+ mem_type = igp_info->v21.memorytype;
243+ if (vram_type)
244+ *vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
245+ break;
246+ default:
247+ return -EINVAL;
248+ }
230249 break;
231250 default:
232251 return -EINVAL;
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+3−4
@@ -81,7 +81,6 @@ MODULE_FIRMWARE("amdgpu/navi10_gpu_info.bin"); · 80 unmodified lines
8181 MODULE_FIRMWARE("amdgpu/navi14_gpu_info.bin");
8282 MODULE_FIRMWARE("amdgpu/navi12_gpu_info.bin");
8383 MODULE_FIRMWARE("amdgpu/vangogh_gpu_info.bin");
84−MODULE_FIRMWARE("amdgpu/green_sardine_gpu_info.bin");
8584
8685 #define AMDGPU_RESUME_MS 2000
8786
@@ -2548,11 +2547,11 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev) · 2460 unmodified lines
25482547 if (adev->gmc.xgmi.num_physical_nodes > 1)
25492548 amdgpu_xgmi_remove_device(adev);
25502549
2551− amdgpu_amdkfd_device_fini(adev);
2552−
25532550 amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
25542551 amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
25552552
2553+ amdgpu_amdkfd_device_fini(adev);
2554+
25562555 /* need to disable SMC first */
25572556 for (i = 0; i < adev->num_ip_blocks; i++) {
25582557 if (!adev->ip_blocks[i].status.hw)
@@ -3034,7 +3033,7 @@ bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type) · 475 unmodified lines
30343033 #endif
30353034 default:
30363035 if (amdgpu_dc > 0)
3037− DRM_INFO("Display Core has been requested via kernel parameter "
3036+ DRM_INFO_ONCE("Display Core has been requested via kernel parameter "
30383037 "but isn't supported by ASIC, ignoring\n");
30393038 return false;
30403039 }
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c+6−2
@@ -926,8 +926,10 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev, · 925 unmodified lines
926926 struct drm_file *file_priv,
927927 const struct drm_mode_fb_cmd2 *mode_cmd)
928928 {
929− struct drm_gem_object *obj;
930929 struct amdgpu_framebuffer *amdgpu_fb;
930+ struct drm_gem_object *obj;
931+ struct amdgpu_bo *bo;
932+ uint32_t domains;
931933 int ret;
932934
933935 obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]);
@@ -938,7 +940,9 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev, · 4 unmodified lines
938940 }
939941
940942 /* Handle is imported dma-buf, so cannot be migrated to VRAM for scanout */
941− if (obj->import_attach) {
943+ bo = gem_to_amdgpu_bo(obj);
944+ domains = amdgpu_display_supported_domains(drm_to_adev(dev), bo->flags);
945+ if (obj->import_attach && !(domains & AMDGPU_GEM_DOMAIN_GTT)) {
942946 drm_dbg_kms(dev, "Cannot create framebuffer from imported dma_buf\n");
943947 return ERR_PTR(-EINVAL);
944948 }
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c+2−0
@@ -1085,6 +1085,8 @@ static const struct pci_device_id pciidlist[] = { · 1084 unmodified lines
10851085
10861086 /* Renoir */
10871087 {0x1002, 0x1636, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RENOIR|AMD_IS_APU},
1088+ {0x1002, 0x1638, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RENOIR|AMD_IS_APU},
1089+ {0x1002, 0x164C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RENOIR|AMD_IS_APU},
10881090
10891091 /* Navi12 */
10901092 {0x1002, 0x7360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI12},
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c+1−1
@@ -269,8 +269,8 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data, · 268 unmodified lines
269269 resv = vm->root.base.bo->tbo.base.resv;
270270 }
271271
272−retry:
273272 initial_domain = (u32)(0xffffffff & args->in.domains);
273+retry:
274274 r = amdgpu_gem_object_create(adev, size, args->in.alignment,
275275 initial_domain,
276276 flags, ttm_bo_type_device, resv, &gobj);
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c+1−1
@@ -897,7 +897,7 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain, · 896 unmodified lines
897897 return -EINVAL;
898898
899899 /* A shared bo cannot be migrated to VRAM */
900− if (bo->prime_shared_count) {
900+ if (bo->prime_shared_count || bo->tbo.base.import_attach) {
901901 if (domain & AMDGPU_GEM_DOMAIN_GTT)
902902 domain = AMDGPU_GEM_DOMAIN_GTT;
903903 else
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c+17−8
@@ -563,7 +563,7 @@ static int psp_asd_load(struct psp_context *psp) · 562 unmodified lines
563563 * add workaround to bypass it for sriov now.
564564 * TODO: add version check to make it common
565565 */
566− if (amdgpu_sriov_vf(psp->adev) || !psp->asd_fw)
566+ if (amdgpu_sriov_vf(psp->adev) || !psp->asd_ucode_size)
567567 return 0;
568568
569569 cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);
@@ -1315,8 +1315,12 @@ static int psp_hdcp_terminate(struct psp_context *psp) · 745 unmodified lines
13151315 if (amdgpu_sriov_vf(psp->adev))
13161316 return 0;
13171317
1318− if (!psp->hdcp_context.hdcp_initialized)
1319− return 0;
1318+ if (!psp->hdcp_context.hdcp_initialized) {
1319+ if (psp->hdcp_context.hdcp_shared_buf)
1320+ goto out;
1321+ else
1322+ return 0;
1323+ }
13201324
13211325 ret = psp_hdcp_unload(psp);
13221326 if (ret)
@@ -1324,6 +1328,7 @@ static int psp_hdcp_terminate(struct psp_context *psp) · 1 unmodified line
13241328
13251329 psp->hdcp_context.hdcp_initialized = false;
13261330
1331+out:
13271332 /* free hdcp shared memory */
13281333 amdgpu_bo_free_kernel(&psp->hdcp_context.hdcp_shared_bo,
13291334 &psp->hdcp_context.hdcp_shared_mc_addr,
@@ -1462,8 +1467,12 @@ static int psp_dtm_terminate(struct psp_context *psp) · 132 unmodified lines
14621467 if (amdgpu_sriov_vf(psp->adev))
14631468 return 0;
14641469
1465− if (!psp->dtm_context.dtm_initialized)
1466− return 0;
1470+ if (!psp->dtm_context.dtm_initialized) {
1471+ if (psp->dtm_context.dtm_shared_buf)
1472+ goto out;
1473+ else
1474+ return 0;
1475+ }
14671476
14681477 ret = psp_dtm_unload(psp);
14691478 if (ret)
@@ -1471,6 +1480,7 @@ static int psp_dtm_terminate(struct psp_context *psp) · 1 unmodified line
14711480
14721481 psp->dtm_context.dtm_initialized = false;
14731482
1483+out:
14741484 /* free hdcp shared memory */
14751485 amdgpu_bo_free_kernel(&psp->dtm_context.dtm_shared_bo,
14761486 &psp->dtm_context.dtm_shared_mc_addr,
@@ -2589,11 +2599,10 @@ static int parse_ta_bin_descriptor(struct psp_context *psp, · 1112 unmodified lines
25892599
25902600 switch (desc->fw_type) {
25912601 case TA_FW_TYPE_PSP_ASD:
2592− psp->asd_fw_version = le32_to_cpu(desc->fw_version);
2602+ psp->asd_fw_version = le32_to_cpu(desc->fw_version);
25932603 psp->asd_feature_version = le32_to_cpu(desc->fw_version);
2594− psp->asd_ucode_size = le32_to_cpu(desc->size_bytes);
2604+ psp->asd_ucode_size = le32_to_cpu(desc->size_bytes);
25952605 psp->asd_start_addr = ucode_start_addr;
2596− psp->asd_fw = psp->ta_fw;
25972606 break;
25982607 case TA_FW_TYPE_PSP_XGMI:
25992608 psp->ta_xgmi_ucode_version = le32_to_cpu(desc->fw_version);
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c+4−4
@@ -1518,7 +1518,7 @@ static int amdgpu_ras_badpages_read(struct amdgpu_device *adev, · 1517 unmodified lines
15181518 struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
15191519 struct ras_err_handler_data *data;
15201520 int i = 0;
1521− int ret = 0;
1521+ int ret = 0, status;
15221522
15231523 if (!con || !con->eh_data || !bps || !count)
15241524 return -EINVAL;
@@ -1543,12 +1543,12 @@ static int amdgpu_ras_badpages_read(struct amdgpu_device *adev, · 18 unmodified lines
15431543 .size = AMDGPU_GPU_PAGE_SIZE,
15441544 .flags = AMDGPU_RAS_RETIRE_PAGE_RESERVED,
15451545 };
1546− ret = amdgpu_vram_mgr_query_page_status(
1546+ status = amdgpu_vram_mgr_query_page_status(
15471547 ttm_manager_type(&adev->mman.bdev, TTM_PL_VRAM),
15481548 data->bps[i].retired_page);
1549− if (ret == -EBUSY)
1549+ if (status == -EBUSY)
15501550 (*bps)[i].flags = AMDGPU_RAS_RETIRE_PAGE_PENDING;
1551− else if (ret == -ENOENT)
1551+ else if (status == -ENOENT)
15521552 (*bps)[i].flags = AMDGPU_RAS_RETIRE_PAGE_FAULT;
15531553 }
15541554
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c+7−1
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 #define EEPROM_I2C_TARGET_ADDR_VEGA20 0xA0
3131 #define EEPROM_I2C_TARGET_ADDR_ARCTURUS 0xA8
3232 #define EEPROM_I2C_TARGET_ADDR_ARCTURUS_D342 0xA0
33+#define EEPROM_I2C_TARGET_ADDR_SIENNA_CICHLID 0xA0
3334
3435 /*
3536 * The 2 macros bellow represent the actual size in bytes that
@@ -62,7 +63,8 @@ · 26 unmodified lines
6263 static bool __is_ras_eeprom_supported(struct amdgpu_device *adev)
6364 {
6465 if ((adev->asic_type == CHIP_VEGA20) ||
65− (adev->asic_type == CHIP_ARCTURUS))
66+ (adev->asic_type == CHIP_ARCTURUS) ||
67+ (adev->asic_type == CHIP_SIENNA_CICHLID))
6668 return true;
6769
6870 return false;
@@ -100,6 +102,10 @@ static bool __get_eeprom_i2c_addr(struct amdgpu_device *adev, · 31 unmodified lines
100102 case CHIP_ARCTURUS:
101103 return __get_eeprom_i2c_addr_arct(adev, i2c_addr);
102104
105+ case CHIP_SIENNA_CICHLID:
106+ *i2c_addr = EEPROM_I2C_TARGET_ADDR_SIENNA_CICHLID;
107+ break;
108+
103109 default:
104110 return false;
105111 }
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c+65−5
@@ -99,6 +99,14 @@ · 98 unmodified lines
9999 #define mmGCR_GENERAL_CNTL_Sienna_Cichlid 0x1580
100100 #define mmGCR_GENERAL_CNTL_Sienna_Cichlid_BASE_IDX 0
101101
102+#define mmCGTS_TCC_DISABLE_Vangogh 0x5006
103+#define mmCGTS_TCC_DISABLE_Vangogh_BASE_IDX 1
104+#define mmCGTS_USER_TCC_DISABLE_Vangogh 0x5007
105+#define mmCGTS_USER_TCC_DISABLE_Vangogh_BASE_IDX 1
106+#define mmGOLDEN_TSC_COUNT_UPPER_Vangogh 0x0025
107+#define mmGOLDEN_TSC_COUNT_UPPER_Vangogh_BASE_IDX 1
108+#define mmGOLDEN_TSC_COUNT_LOWER_Vangogh 0x0026
109+#define mmGOLDEN_TSC_COUNT_LOWER_Vangogh_BASE_IDX 1
102110 #define mmSPI_CONFIG_CNTL_1_Vangogh 0x2441
103111 #define mmSPI_CONFIG_CNTL_1_Vangogh_BASE_IDX 1
104112 #define mmVGT_TF_MEMORY_BASE_HI_Vangogh 0x2261
@@ -115,6 +123,8 @@ · 10 unmodified lines
115123 #define mmVGT_ESGS_RING_SIZE_Vangogh_BASE_IDX 1
116124 #define mmSPI_CONFIG_CNTL_Vangogh 0x2440
117125 #define mmSPI_CONFIG_CNTL_Vangogh_BASE_IDX 1
126+#define mmGCR_GENERAL_CNTL_Vangogh 0x1580
127+#define mmGCR_GENERAL_CNTL_Vangogh_BASE_IDX 0
118128
119129 #define mmCP_HYP_PFP_UCODE_ADDR 0x5814
120130 #define mmCP_HYP_PFP_UCODE_ADDR_BASE_IDX 1
@@ -160,6 +170,9 @@ · 39 unmodified lines
160170 #define mmGCVM_L2_CGTT_CLK_CTRL_Sienna_Cichlid 0x15db
161171 #define mmGCVM_L2_CGTT_CLK_CTRL_Sienna_Cichlid_BASE_IDX 0
162172
173+#define mmGC_THROTTLE_CTRL_Sienna_Cichlid 0x2030
174+#define mmGC_THROTTLE_CTRL_Sienna_Cichlid_BASE_IDX 0
175+
163176 MODULE_FIRMWARE("amdgpu/navi10_ce.bin");
164177 MODULE_FIRMWARE("amdgpu/navi10_pfp.bin");
165178 MODULE_FIRMWARE("amdgpu/navi10_me.bin");
@@ -3237,7 +3250,7 @@ static const struct soc15_reg_golden golden_settings_gc_10_3_vangogh[] = · 3071 unmodified lines
32373250 SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_DEBUG4, 0xffffffff, 0x00800000),
32383251 SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_EXCEPTION_CONTROL, 0x7fff0f1f, 0x00b80000),
32393252 SOC15_REG_GOLDEN_VALUE(GC, 0, mmGB_ADDR_CONFIG, 0x0c1807ff, 0x00000142),
3240− SOC15_REG_GOLDEN_VALUE(GC, 0, mmGCR_GENERAL_CNTL, 0x1ff1ffff, 0x00000500),
3253+ SOC15_REG_GOLDEN_VALUE(GC, 0, mmGCR_GENERAL_CNTL_Vangogh, 0x1ff1ffff, 0x00000500),
32413254 SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL1_PIPE_STEER, 0x000000ff, 0x000000e4),
32423255 SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL2_PIPE_STEER_0, 0x77777777, 0x32103210),
32433256 SOC15_REG_GOLDEN_VALUE(GC, 0, mmGL2_PIPE_STEER_1, 0x77777777, 0x32103210),
@@ -3324,6 +3337,7 @@ static void gfx_v10_0_ring_emit_de_meta(struct amdgpu_ring *ring, bool resume); · 80 unmodified lines
33243337 static void gfx_v10_0_ring_emit_frame_cntl(struct amdgpu_ring *ring, bool start, bool secure);
33253338 static u32 gfx_v10_3_get_disabled_sa(struct amdgpu_device *adev);
33263339 static void gfx_v10_3_program_pbb_mode(struct amdgpu_device *adev);
3340+static void gfx_v10_3_set_power_brake_sequence(struct amdgpu_device *adev);
33273341
33283342 static void gfx10_kiq_set_resources(struct amdgpu_ring *kiq_ring, uint64_t queue_mask)
33293343 {
@@ -4926,8 +4940,18 @@ static void gfx_v10_0_tcp_harvest(struct amdgpu_device *adev) · 1596 unmodified lines
49264940 static void gfx_v10_0_get_tcc_info(struct amdgpu_device *adev)
49274941 {
49284942 /* TCCs are global (not instanced). */
4929− uint32_t tcc_disable = RREG32_SOC15(GC, 0, mmCGTS_TCC_DISABLE) |
4930− RREG32_SOC15(GC, 0, mmCGTS_USER_TCC_DISABLE);
4943+ uint32_t tcc_disable;
4944+
4945+ switch (adev->asic_type) {
4946+ case CHIP_VANGOGH:
4947+ tcc_disable = RREG32_SOC15(GC, 0, mmCGTS_TCC_DISABLE_Vangogh) |
4948+ RREG32_SOC15(GC, 0, mmCGTS_USER_TCC_DISABLE_Vangogh);
4949+ break;
4950+ default:
4951+ tcc_disable = RREG32_SOC15(GC, 0, mmCGTS_TCC_DISABLE) |
4952+ RREG32_SOC15(GC, 0, mmCGTS_USER_TCC_DISABLE);
4953+ break;
4954+ }
49314955
49324956 adev->gfx.config.tcc_disabled_mask =
49334957 REG_GET_FIELD(tcc_disable, CGTS_TCC_DISABLE, TCC_DISABLE) |
@@ -7192,6 +7216,9 @@ static int gfx_v10_0_hw_init(void *handle) · 2258 unmodified lines
71927216 if (adev->asic_type == CHIP_SIENNA_CICHLID)
71937217 gfx_v10_3_program_pbb_mode(adev);
71947218
7219+ if (adev->asic_type >= CHIP_SIENNA_CICHLID)
7220+ gfx_v10_3_set_power_brake_sequence(adev);
7221+
71957222 return r;
71967223 }
71977224
@@ -7377,8 +7404,16 @@ static uint64_t gfx_v10_0_get_gpu_clock_counter(struct amdgpu_device *adev) · 179 unmodified lines
73777404
73787405 amdgpu_gfx_off_ctrl(adev, false);
73797406 mutex_lock(&adev->gfx.gpu_clock_mutex);
7380− clock = (uint64_t)RREG32_SOC15(SMUIO, 0, mmGOLDEN_TSC_COUNT_LOWER) |
7381− ((uint64_t)RREG32_SOC15(SMUIO, 0, mmGOLDEN_TSC_COUNT_UPPER) << 32ULL);
7407+ switch (adev->asic_type) {
7408+ case CHIP_VANGOGH:
7409+ clock = (uint64_t)RREG32_SOC15(SMUIO, 0, mmGOLDEN_TSC_COUNT_LOWER_Vangogh) |
7410+ ((uint64_t)RREG32_SOC15(SMUIO, 0, mmGOLDEN_TSC_COUNT_UPPER_Vangogh) << 32ULL);
7411+ break;
7412+ default:
7413+ clock = (uint64_t)RREG32_SOC15(SMUIO, 0, mmGOLDEN_TSC_COUNT_LOWER) |
7414+ ((uint64_t)RREG32_SOC15(SMUIO, 0, mmGOLDEN_TSC_COUNT_UPPER) << 32ULL);
7415+ break;
7416+ }
73827417 mutex_unlock(&adev->gfx.gpu_clock_mutex);
73837418 amdgpu_gfx_off_ctrl(adev, true);
73847419 return clock;
@@ -9169,6 +9204,31 @@ static void gfx_v10_3_program_pbb_mode(struct amdgpu_device *adev) · 1784 unmodified lines
91699204 }
91709205 }
91719206
9207+static void gfx_v10_3_set_power_brake_sequence(struct amdgpu_device *adev)
9208+{
9209+ WREG32_SOC15(GC, 0, mmGRBM_GFX_INDEX,
9210+ (0x1 << GRBM_GFX_INDEX__SA_BROADCAST_WRITES__SHIFT) |
9211+ (0x1 << GRBM_GFX_INDEX__INSTANCE_BROADCAST_WRITES__SHIFT) |
9212+ (0x1 << GRBM_GFX_INDEX__SE_BROADCAST_WRITES__SHIFT));
9213+
9214+ WREG32_SOC15(GC, 0, mmGC_CAC_IND_INDEX, ixPWRBRK_STALL_PATTERN_CTRL);
9215+ WREG32_SOC15(GC, 0, mmGC_CAC_IND_DATA,
9216+ (0x1 << PWRBRK_STALL_PATTERN_CTRL__PWRBRK_STEP_INTERVAL__SHIFT) |
9217+ (0x12 << PWRBRK_STALL_PATTERN_CTRL__PWRBRK_BEGIN_STEP__SHIFT) |
9218+ (0x13 << PWRBRK_STALL_PATTERN_CTRL__PWRBRK_END_STEP__SHIFT) |
9219+ (0xf << PWRBRK_STALL_PATTERN_CTRL__PWRBRK_THROTTLE_PATTERN_BIT_NUMS__SHIFT));
9220+
9221+ WREG32_SOC15(GC, 0, mmGC_THROTTLE_CTRL_Sienna_Cichlid,
9222+ (0x1 << GC_THROTTLE_CTRL__PWRBRK_STALL_EN__SHIFT) |
9223+ (0x1 << GC_THROTTLE_CTRL__PATTERN_MODE__SHIFT) |
9224+ (0x5 << GC_THROTTLE_CTRL__RELEASE_STEP_INTERVAL__SHIFT));
9225+
9226+ WREG32_SOC15(GC, 0, mmDIDT_IND_INDEX, ixDIDT_SQ_THROTTLE_CTRL);
9227+
9228+ WREG32_SOC15(GC, 0, mmDIDT_IND_DATA,
9229+ (0x1 << DIDT_SQ_THROTTLE_CTRL__PWRBRK_STALL_EN__SHIFT));
9230+}
9231+
91729232 const struct amdgpu_ip_block_version gfx_v10_0_ip_block =
91739233 {
91749234 .type = AMD_IP_BLOCK_TYPE_GFX,
drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c+62−24
@@ -310,7 +310,7 @@ static void mmhub_v2_3_setup_vmid_config(struct amdgpu_device *adev) · 309 unmodified lines
310310 /* Send no-retry XNACK on fault to suppress VM fault storm. */
311311 tmp = REG_SET_FIELD(tmp, MMVM_CONTEXT1_CNTL,
312312 RETRY_PERMISSION_OR_INVALID_PAGE_FAULT,
313− !amdgpu_noretry);
313+ !adev->gmc.noretry);
314314 WREG32_SOC15_OFFSET(MMHUB, 0, mmMMVM_CONTEXT1_CNTL,
315315 i * hub->ctx_distance, tmp);
316316 WREG32_SOC15_OFFSET(MMHUB, 0, mmMMVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32,
@@ -491,12 +491,11 @@ mmhub_v2_3_update_medium_grain_clock_gating(struct amdgpu_device *adev, · 174 unmodified lines
491491 {
492492 uint32_t def, data, def1, data1;
493493
494− def = data = RREG32_SOC15(MMHUB, 0, mmMM_ATC_L2_MISC_CG);
494+ def = data = RREG32_SOC15(MMHUB, 0, mmMM_ATC_L2_CGTT_CLK_CTRL);
495495 def1 = data1 = RREG32_SOC15(MMHUB, 0, mmDAGB0_CNTL_MISC2);
496496
497497 if (enable && (adev->cg_flags & AMD_CG_SUPPORT_MC_MGCG)) {
498− data |= MM_ATC_L2_MISC_CG__ENABLE_MASK;
499−
498+ data &= ~MM_ATC_L2_CGTT_CLK_CTRL__SOFT_OVERRIDE_MASK;
500499 data1 &= ~(DAGB0_CNTL_MISC2__DISABLE_WRREQ_CG_MASK |
501500 DAGB0_CNTL_MISC2__DISABLE_WRRET_CG_MASK |
502501 DAGB0_CNTL_MISC2__DISABLE_RDREQ_CG_MASK |
@@ -505,8 +504,7 @@ mmhub_v2_3_update_medium_grain_clock_gating(struct amdgpu_device *adev, · 2 unmodified lines
505504 DAGB0_CNTL_MISC2__DISABLE_TLBRD_CG_MASK);
506505
507506 } else {
508− data &= ~MM_ATC_L2_MISC_CG__ENABLE_MASK;
509−
507+ data |= MM_ATC_L2_CGTT_CLK_CTRL__SOFT_OVERRIDE_MASK;
510508 data1 |= (DAGB0_CNTL_MISC2__DISABLE_WRREQ_CG_MASK |
511509 DAGB0_CNTL_MISC2__DISABLE_WRRET_CG_MASK |
512510 DAGB0_CNTL_MISC2__DISABLE_RDREQ_CG_MASK |
@@ -516,7 +514,7 @@ mmhub_v2_3_update_medium_grain_clock_gating(struct amdgpu_device *adev, · 3 unmodified lines
516514 }
517515
518516 if (def != data)
519− WREG32_SOC15(MMHUB, 0, mmMM_ATC_L2_MISC_CG, data);
517+ WREG32_SOC15(MMHUB, 0, mmMM_ATC_L2_CGTT_CLK_CTRL, data);
520518 if (def1 != data1)
521519 WREG32_SOC15(MMHUB, 0, mmDAGB0_CNTL_MISC2, data1);
522520 }
@@ -525,17 +523,44 @@ static void · 2 unmodified lines
525523 mmhub_v2_3_update_medium_grain_light_sleep(struct amdgpu_device *adev,
526524 bool enable)
527525 {
528− uint32_t def, data;
529−
530− def = data = RREG32_SOC15(MMHUB, 0, mmMM_ATC_L2_MISC_CG);
531−
532− if (enable && (adev->cg_flags & AMD_CG_SUPPORT_MC_LS))
533− data |= MM_ATC_L2_MISC_CG__MEM_LS_ENABLE_MASK;
534− else
535− data &= ~MM_ATC_L2_MISC_CG__MEM_LS_ENABLE_MASK;
526+ uint32_t def, data, def1, data1, def2, data2;
527+
528+ def = data = RREG32_SOC15(MMHUB, 0, mmMM_ATC_L2_CGTT_CLK_CTRL);
529+ def1 = data1 = RREG32_SOC15(MMHUB, 0, mmDAGB0_WR_CGTT_CLK_CTRL);
530+ def2 = data2 = RREG32_SOC15(MMHUB, 0, mmDAGB0_RD_CGTT_CLK_CTRL);
531+
532+ if (enable && (adev->cg_flags & AMD_CG_SUPPORT_MC_LS)) {
533+ data &= ~MM_ATC_L2_CGTT_CLK_CTRL__MGLS_OVERRIDE_MASK;
534+ data1 &= !(DAGB0_WR_CGTT_CLK_CTRL__LS_OVERRIDE_MASK |
535+ DAGB0_WR_CGTT_CLK_CTRL__LS_OVERRIDE_WRITE_MASK |
536+ DAGB0_WR_CGTT_CLK_CTRL__LS_OVERRIDE_READ_MASK |
537+ DAGB0_WR_CGTT_CLK_CTRL__LS_OVERRIDE_RETURN_MASK |
538+ DAGB0_WR_CGTT_CLK_CTRL__LS_OVERRIDE_REGISTER_MASK);
539+ data2 &= !(DAGB0_RD_CGTT_CLK_CTRL__LS_OVERRIDE_MASK |
540+ DAGB0_RD_CGTT_CLK_CTRL__LS_OVERRIDE_WRITE_MASK |
541+ DAGB0_RD_CGTT_CLK_CTRL__LS_OVERRIDE_READ_MASK |
542+ DAGB0_RD_CGTT_CLK_CTRL__LS_OVERRIDE_RETURN_MASK |
543+ DAGB0_RD_CGTT_CLK_CTRL__LS_OVERRIDE_REGISTER_MASK);
544+ } else {
545+ data |= MM_ATC_L2_CGTT_CLK_CTRL__MGLS_OVERRIDE_MASK;
546+ data1 |= (DAGB0_WR_CGTT_CLK_CTRL__LS_OVERRIDE_MASK |
547+ DAGB0_WR_CGTT_CLK_CTRL__LS_OVERRIDE_WRITE_MASK |
548+ DAGB0_WR_CGTT_CLK_CTRL__LS_OVERRIDE_READ_MASK |
549+ DAGB0_WR_CGTT_CLK_CTRL__LS_OVERRIDE_RETURN_MASK |
550+ DAGB0_WR_CGTT_CLK_CTRL__LS_OVERRIDE_REGISTER_MASK);
551+ data2 |= (DAGB0_RD_CGTT_CLK_CTRL__LS_OVERRIDE_MASK |
552+ DAGB0_RD_CGTT_CLK_CTRL__LS_OVERRIDE_WRITE_MASK |
553+ DAGB0_RD_CGTT_CLK_CTRL__LS_OVERRIDE_READ_MASK |
554+ DAGB0_RD_CGTT_CLK_CTRL__LS_OVERRIDE_RETURN_MASK |
555+ DAGB0_RD_CGTT_CLK_CTRL__LS_OVERRIDE_REGISTER_MASK);
556+ }
536557
537558 if (def != data)
538− WREG32_SOC15(MMHUB, 0, mmMM_ATC_L2_MISC_CG, data);
559+ WREG32_SOC15(MMHUB, 0, mmMM_ATC_L2_CGTT_CLK_CTRL, data);
560+ if (def1 != data1)
561+ WREG32_SOC15(MMHUB, 0, mmDAGB0_WR_CGTT_CLK_CTRL, data1);
562+ if (def2 != data2)
563+ WREG32_SOC15(MMHUB, 0, mmDAGB0_RD_CGTT_CLK_CTRL, data2);
539564 }
540565
541566 static int mmhub_v2_3_set_clockgating(struct amdgpu_device *adev,
@@ -554,26 +579,39 @@ static int mmhub_v2_3_set_clockgating(struct amdgpu_device *adev, · 12 unmodified lines
554579
555580 static void mmhub_v2_3_get_clockgating(struct amdgpu_device *adev, u32 *flags)
556581 {
557− int data, data1;
582+ int data, data1, data2, data3;
558583
559584 if (amdgpu_sriov_vf(adev))
560585 *flags = 0;
561586
562− data = RREG32_SOC15(MMHUB, 0, mmMM_ATC_L2_MISC_CG);
563− data1 = RREG32_SOC15(MMHUB, 0, mmDAGB0_CNTL_MISC2);
587+ data = RREG32_SOC15(MMHUB, 0, mmDAGB0_CNTL_MISC2);
588+ data1 = RREG32_SOC15(MMHUB, 0, mmMM_ATC_L2_CGTT_CLK_CTRL);
589+ data2 = RREG32_SOC15(MMHUB, 0, mmDAGB0_WR_CGTT_CLK_CTRL);
590+ data3 = RREG32_SOC15(MMHUB, 0, mmDAGB0_RD_CGTT_CLK_CTRL);
564591
565592 /* AMD_CG_SUPPORT_MC_MGCG */
566− if ((data & MM_ATC_L2_MISC_CG__ENABLE_MASK) &&
567− !(data1 & (DAGB0_CNTL_MISC2__DISABLE_WRREQ_CG_MASK |
593+ if (!(data & (DAGB0_CNTL_MISC2__DISABLE_WRREQ_CG_MASK |
568594 DAGB0_CNTL_MISC2__DISABLE_WRRET_CG_MASK |
569595 DAGB0_CNTL_MISC2__DISABLE_RDREQ_CG_MASK |
570596 DAGB0_CNTL_MISC2__DISABLE_RDRET_CG_MASK |
571597 DAGB0_CNTL_MISC2__DISABLE_TLBWR_CG_MASK |
572− DAGB0_CNTL_MISC2__DISABLE_TLBRD_CG_MASK)))
573− *flags |= AMD_CG_SUPPORT_MC_MGCG;
598+ DAGB0_CNTL_MISC2__DISABLE_TLBRD_CG_MASK))
599+ && !(data1 & MM_ATC_L2_CGTT_CLK_CTRL__SOFT_OVERRIDE_MASK)) {
600+ *flags |= AMD_CG_SUPPORT_MC_MGCG;
601+ }
574602
575603 /* AMD_CG_SUPPORT_MC_LS */
576− if (data & MM_ATC_L2_MISC_CG__MEM_LS_ENABLE_MASK)
604+ if (!(data1 & MM_ATC_L2_CGTT_CLK_CTRL__MGLS_OVERRIDE_MASK)
605+ && !(data2 & (DAGB0_WR_CGTT_CLK_CTRL__LS_OVERRIDE_MASK |
606+ DAGB0_WR_CGTT_CLK_CTRL__LS_OVERRIDE_WRITE_MASK |
607+ DAGB0_WR_CGTT_CLK_CTRL__LS_OVERRIDE_READ_MASK |
608+ DAGB0_WR_CGTT_CLK_CTRL__LS_OVERRIDE_RETURN_MASK |
609+ DAGB0_WR_CGTT_CLK_CTRL__LS_OVERRIDE_REGISTER_MASK))
610+ && !(data3 & (DAGB0_RD_CGTT_CLK_CTRL__LS_OVERRIDE_MASK |
611+ DAGB0_RD_CGTT_CLK_CTRL__LS_OVERRIDE_WRITE_MASK |
612+ DAGB0_RD_CGTT_CLK_CTRL__LS_OVERRIDE_READ_MASK |
613+ DAGB0_RD_CGTT_CLK_CTRL__LS_OVERRIDE_RETURN_MASK |
614+ DAGB0_RD_CGTT_CLK_CTRL__LS_OVERRIDE_REGISTER_MASK)))
577615 *flags |= AMD_CG_SUPPORT_MC_LS;
578616 }
579617
drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h+1−1
@@ -47,7 +47,7 @@ enum psp_gfx_crtl_cmd_id · 46 unmodified lines
4747 GFX_CTRL_CMD_ID_DISABLE_INT = 0x00060000, /* disable PSP-to-Gfx interrupt */
4848 GFX_CTRL_CMD_ID_MODE1_RST = 0x00070000, /* trigger the Mode 1 reset */
4949 GFX_CTRL_CMD_ID_GBR_IH_SET = 0x00080000, /* set Gbr IH_RB_CNTL registers */
50− GFX_CTRL_CMD_ID_CONSUME_CMD = 0x000A0000, /* send interrupt to psp for updating write pointer of vf */
50+ GFX_CTRL_CMD_ID_CONSUME_CMD = 0x00090000, /* send interrupt to psp for updating write pointer of vf */
5151 GFX_CTRL_CMD_ID_DESTROY_GPCOM_RING = 0x000C0000, /* destroy GPCOM ring */
5252
5353 GFX_CTRL_CMD_ID_MAX = 0x000F0000, /* max command ID */
drivers/gpu/drm/amd/amdgpu/soc15.c+2−1
@@ -1239,7 +1239,8 @@ static int soc15_common_early_init(void *handle) · 1238 unmodified lines
12391239 break;
12401240 case CHIP_RENOIR:
12411241 adev->asic_funcs = &soc15_asic_funcs;
1242− if (adev->pdev->device == 0x1636)
1242+ if ((adev->pdev->device == 0x1636) ||
1243+ (adev->pdev->device == 0x164c))
12431244 adev->apu_flags |= AMD_APU_IS_RENOIR;
12441245 else
12451246 adev->apu_flags |= AMD_APU_IS_GREEN_SARDINE;
drivers/gpu/drm/amd/amdkfd/kfd_crat.c+7−4
@@ -1040,11 +1040,14 @@ static int kfd_create_vcrat_image_cpu(void *pcrat_image, size_t *size) · 1039 unmodified lines
10401040 (struct crat_subtype_iolink *)sub_type_hdr);
10411041 if (ret < 0)
10421042 return ret;
1043− crat_table->length += (sub_type_hdr->length * entries);
1044− crat_table->total_entries += entries;
10451043
1046− sub_type_hdr = (typeof(sub_type_hdr))((char *)sub_type_hdr +
1047− sub_type_hdr->length * entries);
1044+ if (entries) {
1045+ crat_table->length += (sub_type_hdr->length * entries);
1046+ crat_table->total_entries += entries;
1047+
1048+ sub_type_hdr = (typeof(sub_type_hdr))((char *)sub_type_hdr +
1049+ sub_type_hdr->length * entries);
1050+ }
10481051 #else
10491052 pr_info("IO link not available for non x86 platforms\n");
10501053 #endif
drivers/gpu/drm/amd/display/Kconfig+1−1
@@ -6,7 +6,7 @@ config DRM_AMD_DC · 5 unmodified lines
66 bool "AMD DC - Enable new display engine"
77 default y
88 select SND_HDA_COMPONENT if SND_HDA_CORE
9− select DRM_AMD_DC_DCN if (X86 || PPC64 || (ARM64 && KERNEL_MODE_NEON)) && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS)
9+ select DRM_AMD_DC_DCN if (X86 || PPC64) && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS)
1010 help
1111 Choose this option if you want to use the new display engine
1212 support for AMDGPU. This adds required support for Vega and
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+29−161
@@ -939,41 +939,6 @@ static void mmhub_read_system_context(struct amdgpu_device *adev, struct dc_phy_ · 938 unmodified lines
939939 }
940940 #endif
941941
942−#ifdef CONFIG_DEBUG_FS
943−static int create_crtc_crc_properties(struct amdgpu_display_manager *dm)
944−{
945− dm->crc_win_x_start_property =
946− drm_property_create_range(adev_to_drm(dm->adev),
947− DRM_MODE_PROP_ATOMIC,
948− "AMD_CRC_WIN_X_START", 0, U16_MAX);
949− if (!dm->crc_win_x_start_property)
950− return -ENOMEM;
951−
952− dm->crc_win_y_start_property =
953− drm_property_create_range(adev_to_drm(dm->adev),
954− DRM_MODE_PROP_ATOMIC,
955− "AMD_CRC_WIN_Y_START", 0, U16_MAX);
956− if (!dm->crc_win_y_start_property)
957− return -ENOMEM;
958−
959− dm->crc_win_x_end_property =
960− drm_property_create_range(adev_to_drm(dm->adev),
961− DRM_MODE_PROP_ATOMIC,
962− "AMD_CRC_WIN_X_END", 0, U16_MAX);
963− if (!dm->crc_win_x_end_property)
964− return -ENOMEM;
965−
966− dm->crc_win_y_end_property =
967− drm_property_create_range(adev_to_drm(dm->adev),
968− DRM_MODE_PROP_ATOMIC,
969− "AMD_CRC_WIN_Y_END", 0, U16_MAX);
970− if (!dm->crc_win_y_end_property)
971− return -ENOMEM;
972−
973− return 0;
974−}
975−#endif
976−
977942 static int amdgpu_dm_init(struct amdgpu_device *adev)
978943 {
979944 struct dc_init_data init_data;
@@ -1120,10 +1085,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) · 140 unmodified lines
11201085
11211086 dc_init_callbacks(adev->dm.dc, &init_params);
11221087 }
1123−#endif
1124−#ifdef CONFIG_DEBUG_FS
1125− if (create_crtc_crc_properties(&adev->dm))
1126− DRM_ERROR("amdgpu: failed to create crc property.\n");
11271088 #endif
11281089 if (amdgpu_dm_initialize_drm_device(adev)) {
11291090 DRM_ERROR(
@@ -1872,8 +1833,8 @@ static void emulated_link_detect(struct dc_link *link) · 742 unmodified lines
18721833 link->type = dc_connection_none;
18731834 prev_sink = link->local_sink;
18741835
1875− if (prev_sink != NULL)
1876− dc_sink_retain(prev_sink);
1836+ if (prev_sink)
1837+ dc_sink_release(prev_sink);
18771838
18781839 switch (link->connector_signal) {
18791840 case SIGNAL_TYPE_HDMI_TYPE_A: {
@@ -1973,7 +1934,7 @@ static void dm_gpureset_commit_state(struct dc_state *dc_state, · 93 unmodified lines
19731934 dc_commit_updates_for_stream(
19741935 dm->dc, bundle->surface_updates,
19751936 dc_state->stream_status->plane_count,
1976− dc_state->streams[k], &bundle->stream_update, dc_state);
1937+ dc_state->streams[k], &bundle->stream_update);
19771938 }
19781939
19791940 cleanup:
@@ -2004,8 +1965,7 @@ static void dm_set_dpms_off(struct dc_link *link) · 24 unmodified lines
20041965
20051966 stream_update.stream = stream_state;
20061967 dc_commit_updates_for_stream(stream_state->ctx->dc, NULL, 0,
2007− stream_state, &stream_update,
2008− stream_state->ctx->dc->current_state);
1968+ stream_state, &stream_update);
20091969 mutex_unlock(&adev->dm.dc_lock);
20101970 }
20111971
@@ -2369,8 +2329,10 @@ void amdgpu_dm_update_connector_after_detect( · 357 unmodified lines
23692329 * TODO: check if we still need the S3 mode update workaround.
23702330 * If yes, put it here.
23712331 */
2372− if (aconnector->dc_sink)
2332+ if (aconnector->dc_sink) {
23732333 amdgpu_dm_update_freesync_caps(connector, NULL);
2334+ dc_sink_release(aconnector->dc_sink);
2335+ }
23742336
23752337 aconnector->dc_sink = sink;
23762338 dc_sink_retain(aconnector->dc_sink);
@@ -2386,9 +2348,6 @@ void amdgpu_dm_update_connector_after_detect( · 9 unmodified lines
23862348
23872349 drm_connector_update_edid_property(connector,
23882350 aconnector->edid);
2389− aconnector->num_modes = drm_add_edid_modes(connector, aconnector->edid);
2390− drm_connector_list_update(connector);
2391−
23922351 if (aconnector->dc_link->aux_mode)
23932352 drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux,
23942353 aconnector->edid);
@@ -5334,64 +5293,12 @@ dm_crtc_duplicate_state(struct drm_crtc *crtc) · 2939 unmodified lines
53345293 state->crc_src = cur->crc_src;
53355294 state->cm_has_degamma = cur->cm_has_degamma;
53365295 state->cm_is_degamma_srgb = cur->cm_is_degamma_srgb;
5337−#ifdef CONFIG_DEBUG_FS
5338− state->crc_window = cur->crc_window;
5339−#endif
5296+
53405297 /* TODO Duplicate dc_stream after objects are stream object is flattened */
53415298
53425299 return &state->base;
53435300 }
53445301
5345−#ifdef CONFIG_DEBUG_FS
5346−static int amdgpu_dm_crtc_atomic_set_property(struct drm_crtc *crtc,
5347− struct drm_crtc_state *crtc_state,
5348− struct drm_property *property,
5349− uint64_t val)
5350−{
5351− struct drm_device *dev = crtc->dev;
5352− struct amdgpu_device *adev = drm_to_adev(dev);
5353− struct dm_crtc_state *dm_new_state =
5354− to_dm_crtc_state(crtc_state);
5355−
5356− if (property == adev->dm.crc_win_x_start_property)
5357− dm_new_state->crc_window.x_start = val;
5358− else if (property == adev->dm.crc_win_y_start_property)
5359− dm_new_state->crc_window.y_start = val;
5360− else if (property == adev->dm.crc_win_x_end_property)
5361− dm_new_state->crc_window.x_end = val;
5362− else if (property == adev->dm.crc_win_y_end_property)
5363− dm_new_state->crc_window.y_end = val;
5364− else
5365− return -EINVAL;
5366−
5367− return 0;
5368−}
5369−
5370−static int amdgpu_dm_crtc_atomic_get_property(struct drm_crtc *crtc,
5371− const struct drm_crtc_state *state,
5372− struct drm_property *property,
5373− uint64_t *val)
5374−{
5375− struct drm_device *dev = crtc->dev;
5376− struct amdgpu_device *adev = drm_to_adev(dev);
5377− struct dm_crtc_state *dm_state =
5378− to_dm_crtc_state(state);
5379−
5380− if (property == adev->dm.crc_win_x_start_property)
5381− *val = dm_state->crc_window.x_start;
5382− else if (property == adev->dm.crc_win_y_start_property)
5383− *val = dm_state->crc_window.y_start;
5384− else if (property == adev->dm.crc_win_x_end_property)
5385− *val = dm_state->crc_window.x_end;
5386− else if (property == adev->dm.crc_win_y_end_property)
5387− *val = dm_state->crc_window.y_end;
5388− else
5389− return -EINVAL;
5390−
5391− return 0;
5392−}
5393−#endif
5394−
53955302 static inline int dm_set_vupdate_irq(struct drm_crtc *crtc, bool enable)
53965303 {
53975304 enum dc_irq_source irq_source;
@@ -5458,10 +5365,6 @@ static const struct drm_crtc_funcs amdgpu_dm_crtc_funcs = { · 60 unmodified lines
54585365 .enable_vblank = dm_enable_vblank,
54595366 .disable_vblank = dm_disable_vblank,
54605367 .get_vblank_timestamp = drm_crtc_vblank_helper_get_vblank_timestamp,
5461−#ifdef CONFIG_DEBUG_FS
5462− .atomic_set_property = amdgpu_dm_crtc_atomic_set_property,
5463− .atomic_get_property = amdgpu_dm_crtc_atomic_get_property,
5464−#endif
54655368 };
54665369
54675370 static enum drm_connector_status
@@ -6663,25 +6566,6 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, · 1195 unmodified lines
66636566 return 0;
66646567 }
66656568
6666−#ifdef CONFIG_DEBUG_FS
6667−static void attach_crtc_crc_properties(struct amdgpu_display_manager *dm,
6668− struct amdgpu_crtc *acrtc)
6669−{
6670− drm_object_attach_property(&acrtc->base.base,
6671− dm->crc_win_x_start_property,
6672− 0);
6673− drm_object_attach_property(&acrtc->base.base,
6674− dm->crc_win_y_start_property,
6675− 0);
6676− drm_object_attach_property(&acrtc->base.base,
6677− dm->crc_win_x_end_property,
6678− 0);
6679− drm_object_attach_property(&acrtc->base.base,
6680− dm->crc_win_y_end_property,
6681− 0);
6682−}
6683−#endif
6684−
66856569 static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
66866570 struct drm_plane *plane,
66876571 uint32_t crtc_index)
@@ -6729,9 +6613,7 @@ static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, · 41 unmodified lines
67296613 drm_crtc_enable_color_mgmt(&acrtc->base, MAX_COLOR_LUT_ENTRIES,
67306614 true, MAX_COLOR_LUT_ENTRIES);
67316615 drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LEGACY_LUT_ENTRIES);
6732−#ifdef CONFIG_DEBUG_FS
6733− attach_crtc_crc_properties(dm, acrtc);
6734−#endif
6616+
67356617 return 0;
67366618
67376619 fail:
@@ -7666,7 +7548,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, · 928 unmodified lines
76667548 struct drm_crtc *pcrtc,
76677549 bool wait_for_vblank)
76687550 {
7669− uint32_t i;
7551+ int i;
76707552 uint64_t timestamp_ns;
76717553 struct drm_plane *plane;
76727554 struct drm_plane_state *old_plane_state, *new_plane_state;
@@ -7707,7 +7589,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, · 34 unmodified lines
77077589 amdgpu_dm_commit_cursors(state);
77087590
77097591 /* update planes when needed */
7710− for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
7592+ for_each_oldnew_plane_in_state_reverse(state, plane, old_plane_state, new_plane_state, i) {
77117593 struct drm_crtc *crtc = new_plane_state->crtc;
77127594 struct drm_crtc_state *new_crtc_state;
77137595 struct drm_framebuffer *fb = new_plane_state->fb;
@@ -7930,8 +7812,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, · 216 unmodified lines
79307812 bundle->surface_updates,
79317813 planes_count,
79327814 acrtc_state->stream,
7933− &bundle->stream_update,
7934− dc_state);
7815+ &bundle->stream_update);
79357816
79367817 /**
79377818 * Enable or disable the interrupts on the backend.
@@ -8267,13 +8148,13 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 329 unmodified lines
82678148 struct dm_connector_state *dm_new_con_state = to_dm_connector_state(new_con_state);
82688149 struct dm_connector_state *dm_old_con_state = to_dm_connector_state(old_con_state);
82698150 struct amdgpu_crtc *acrtc = to_amdgpu_crtc(dm_new_con_state->base.crtc);
8270− struct dc_surface_update dummy_updates[MAX_SURFACES];
8151+ struct dc_surface_update surface_updates[MAX_SURFACES];
82718152 struct dc_stream_update stream_update;
82728153 struct dc_info_packet hdr_packet;
82738154 struct dc_stream_status *status = NULL;
82748155 bool abm_changed, hdr_changed, scaling_changed;
82758156
8276− memset(&dummy_updates, 0, sizeof(dummy_updates));
8157+ memset(&surface_updates, 0, sizeof(surface_updates));
82778158 memset(&stream_update, 0, sizeof(stream_update));
82788159
82798160 if (acrtc) {
@@ -8330,16 +8211,15 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 50 unmodified lines
83308211 * To fix this, DC should permit updating only stream properties.
83318212 */
83328213 for (j = 0; j < status->plane_count; j++)
8333− dummy_updates[j].surface = status->plane_states[0];
8214+ surface_updates[j].surface = status->plane_states[j];
83348215
83358216
83368217 mutex_lock(&dm->dc_lock);
83378218 dc_commit_updates_for_stream(dm->dc,
8338− dummy_updates,
8219+ surface_updates,
83398220 status->plane_count,
83408221 dm_new_crtc_state->stream,
8341− &stream_update,
8342− dc_state);
8222+ &stream_update);
83438223 mutex_unlock(&dm->dc_lock);
83448224 }
83458225
@@ -8368,7 +8248,6 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 22 unmodified lines
83688248 */
83698249 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
83708250 struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
8371− bool configure_crc = false;
83728251
83738252 dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
83748253
@@ -8378,30 +8257,21 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 3 unmodified lines
83788257 dc_stream_retain(dm_new_crtc_state->stream);
83798258 acrtc->dm_irq_params.stream = dm_new_crtc_state->stream;
83808259 manage_dm_interrupts(adev, acrtc, true);
8381− }
8260+
83828261 #ifdef CONFIG_DEBUG_FS
8383− if (new_crtc_state->active &&
8384− amdgpu_dm_is_valid_crc_source(dm_new_crtc_state->crc_src)) {
83858262 /**
83868263 * Frontend may have changed so reapply the CRC capture
83878264 * settings for the stream.
83888265 */
83898266 dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
8390− dm_old_crtc_state = to_dm_crtc_state(old_crtc_state);
8391−
8392− if (amdgpu_dm_crc_window_is_default(dm_new_crtc_state)) {
8393− if (!old_crtc_state->active || drm_atomic_crtc_needs_modeset(new_crtc_state))
8394− configure_crc = true;
8395− } else {
8396− if (amdgpu_dm_crc_window_changed(dm_new_crtc_state, dm_old_crtc_state))
8397− configure_crc = true;
8398− }
83998267
8400− if (configure_crc)
8268+ if (amdgpu_dm_is_valid_crc_source(dm_new_crtc_state->crc_src)) {
84018269 amdgpu_dm_crtc_configure_crc_source(
8402− crtc, dm_new_crtc_state, dm_new_crtc_state->crc_src);
8403− }
8270+ crtc, dm_new_crtc_state,
8271+ dm_new_crtc_state->crc_src);
8272+ }
84048273 #endif
8274+ }
84058275 }
84068276
84078277 for_each_new_crtc_in_state(state, crtc, new_crtc_state, j)
@@ -8486,14 +8356,14 @@ static int dm_force_atomic_commit(struct drm_connector *connector) · 78 unmodified lines
84868356
84878357 ret = PTR_ERR_OR_ZERO(conn_state);
84888358 if (ret)
8489− goto err;
8359+ goto out;
84908360
84918361 /* Attach crtc to drm_atomic_state*/
84928362 crtc_state = drm_atomic_get_crtc_state(state, &disconnected_acrtc->base);
84938363
84948364 ret = PTR_ERR_OR_ZERO(crtc_state);
84958365 if (ret)
8496− goto err;
8366+ goto out;
84978367
84988368 /* force a restore */
84998369 crtc_state->mode_changed = true;
@@ -8503,17 +8373,15 @@ static int dm_force_atomic_commit(struct drm_connector *connector) · 3 unmodified lines
85038373
85048374 ret = PTR_ERR_OR_ZERO(plane_state);
85058375 if (ret)
8506− goto err;
8507−
8376+ goto out;
85088377
85098378 /* Call commit internally with the state we just constructed */
85108379 ret = drm_atomic_commit(state);
8511− if (!ret)
8512− return 0;
85138380
8514−err:
8515− DRM_ERROR("Restoring old state failed with %i\n", ret);
8381+out:
85168382 drm_atomic_state_put(state);
8383+ if (ret)
8384+ DRM_ERROR("Restoring old state failed with %i\n", ret);
85178385
85188386 return ret;
85198387 }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h+0−38
@@ -336,32 +336,6 @@ struct amdgpu_display_manager { · 335 unmodified lines
336336 */
337337 const struct gpu_info_soc_bounding_box_v1_0 *soc_bounding_box;
338338
339−#ifdef CONFIG_DEBUG_FS
340− /**
341− * @crc_win_x_start_property:
342− *
343− * X start of the crc calculation window
344− */
345− struct drm_property *crc_win_x_start_property;
346− /**
347− * @crc_win_y_start_property:
348− *
349− * Y start of the crc calculation window
350− */
351− struct drm_property *crc_win_y_start_property;
352− /**
353− * @crc_win_x_end_property:
354− *
355− * X end of the crc calculation window
356− */
357− struct drm_property *crc_win_x_end_property;
358− /**
359− * @crc_win_y_end_property:
360− *
361− * Y end of the crc calculation window
362− */
363− struct drm_property *crc_win_y_end_property;
364−#endif
365339 /**
366340 * @mst_encoders:
367341 *
@@ -448,15 +422,6 @@ struct dm_plane_state { · 80 unmodified lines
448422 struct dc_plane_state *dc_state;
449423 };
450424
451−#ifdef CONFIG_DEBUG_FS
452−struct crc_rec {
453− uint16_t x_start;
454− uint16_t y_start;
455− uint16_t x_end;
456− uint16_t y_end;
457− };
458−#endif
459−
460425 struct dm_crtc_state {
461426 struct drm_crtc_state base;
462427 struct dc_stream_state *stream;
@@ -479,9 +444,6 @@ struct dm_crtc_state { · 16 unmodified lines
479444 struct dc_info_packet vrr_infopacket;
480445
481446 int abm_level;
482−#ifdef CONFIG_DEBUG_FS
483− struct crc_rec crc_window;
484−#endif
485447 };
486448
487449 #define to_dm_crtc_state(x) container_of(x, struct dm_crtc_state, base)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c+1−53
@@ -81,41 +81,6 @@ const char *const *amdgpu_dm_crtc_get_crc_sources(struct drm_crtc *crtc, · 80 unmodified lines
8181 return pipe_crc_sources;
8282 }
8383
84−static void amdgpu_dm_set_crc_window_default(struct dm_crtc_state *dm_crtc_state)
85−{
86− dm_crtc_state->crc_window.x_start = 0;
87− dm_crtc_state->crc_window.y_start = 0;
88− dm_crtc_state->crc_window.x_end = 0;
89− dm_crtc_state->crc_window.y_end = 0;
90−}
91−
92−bool amdgpu_dm_crc_window_is_default(struct dm_crtc_state *dm_crtc_state)
93−{
94− bool ret = true;
95−
96− if ((dm_crtc_state->crc_window.x_start != 0) ||
97− (dm_crtc_state->crc_window.y_start != 0) ||
98− (dm_crtc_state->crc_window.x_end != 0) ||
99− (dm_crtc_state->crc_window.y_end != 0))
100− ret = false;
101−
102− return ret;
103−}
104−
105−bool amdgpu_dm_crc_window_changed(struct dm_crtc_state *dm_new_crtc_state,
106− struct dm_crtc_state *dm_old_crtc_state)
107−{
108− bool ret = false;
109−
110− if ((dm_new_crtc_state->crc_window.x_start != dm_old_crtc_state->crc_window.x_start) ||
111− (dm_new_crtc_state->crc_window.y_start != dm_old_crtc_state->crc_window.y_start) ||
112− (dm_new_crtc_state->crc_window.x_end != dm_old_crtc_state->crc_window.x_end) ||
113− (dm_new_crtc_state->crc_window.y_end != dm_old_crtc_state->crc_window.y_end))
114− ret = true;
115−
116− return ret;
117−}
118−
11984 int
12085 amdgpu_dm_crtc_verify_crc_source(struct drm_crtc *crtc, const char *src_name,
12186 size_t *values_cnt)
@@ -140,7 +105,6 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc, · 18 unmodified lines
140105 struct dc_stream_state *stream_state = dm_crtc_state->stream;
141106 bool enable = amdgpu_dm_is_valid_crc_source(source);
142107 int ret = 0;
143− struct crc_params *crc_window = NULL, tmp_window;
144108
145109 /* Configuration will be deferred to stream enable. */
146110 if (!stream_state)
@@ -150,24 +114,8 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc, · 3 unmodified lines
150114
151115 /* Enable CRTC CRC generation if necessary. */
152116 if (dm_is_crc_source_crtc(source) || source == AMDGPU_DM_PIPE_CRC_SOURCE_NONE) {
153− if (!enable)
154− amdgpu_dm_set_crc_window_default(dm_crtc_state);
155−
156− if (!amdgpu_dm_crc_window_is_default(dm_crtc_state)) {
157− crc_window = &tmp_window;
158−
159− tmp_window.windowa_x_start = dm_crtc_state->crc_window.x_start;
160− tmp_window.windowa_y_start = dm_crtc_state->crc_window.y_start;
161− tmp_window.windowa_x_end = dm_crtc_state->crc_window.x_end;
162− tmp_window.windowa_y_end = dm_crtc_state->crc_window.y_end;
163− tmp_window.windowb_x_start = dm_crtc_state->crc_window.x_start;
164− tmp_window.windowb_y_start = dm_crtc_state->crc_window.y_start;
165− tmp_window.windowb_x_end = dm_crtc_state->crc_window.x_end;
166− tmp_window.windowb_y_end = dm_crtc_state->crc_window.y_end;
167− }
168−
169117 if (!dc_stream_configure_crc(stream_state->ctx->dc,
170− stream_state, crc_window, enable, enable)) {
118+ stream_state, NULL, enable, enable)) {
171119 ret = -EINVAL;
172120 goto unlock;
173121 }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h+0−3
@@ -47,9 +47,6 @@ static inline bool amdgpu_dm_is_valid_crc_source(enum amdgpu_dm_pipe_crc_source · 46 unmodified lines
4747
4848 /* amdgpu_dm_crc.c */
4949 #ifdef CONFIG_DEBUG_FS
50−bool amdgpu_dm_crc_window_is_default(struct dm_crtc_state *dm_crtc_state);
51−bool amdgpu_dm_crc_window_changed(struct dm_crtc_state *dm_new_crtc_state,
52− struct dm_crtc_state *dm_old_crtc_state);
5350 int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc,
5451 struct dm_crtc_state *dm_crtc_state,
5552 enum amdgpu_dm_pipe_crc_source source);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c+5−1
@@ -833,6 +833,9 @@ bool compute_mst_dsc_configs_for_state(struct drm_atomic_state *state, · 832 unmodified lines
833833 if (computed_streams[i])
834834 continue;
835835
836+ if (dcn20_remove_stream_from_ctx(stream->ctx->dc, dc_state, stream) != DC_OK)
837+ return false;
838+
836839 mutex_lock(&aconnector->mst_mgr.lock);
837840 if (!compute_mst_dsc_configs_for_link(state, dc_state, stream->link)) {
838841 mutex_unlock(&aconnector->mst_mgr.lock);
@@ -850,7 +853,8 @@ bool compute_mst_dsc_configs_for_state(struct drm_atomic_state *state, · 11 unmodified lines
850853 stream = dc_state->streams[i];
851854
852855 if (stream->timing.flags.DSC == 1)
853− dc_stream_add_dsc_to_resource(stream->ctx->dc, dc_state, stream);
856+ if (dc_stream_add_dsc_to_resource(stream->ctx->dc, dc_state, stream) != DC_OK)
857+ return false;
854858 }
855859
856860 return true;
drivers/gpu/drm/amd/display/dc/calcs/Makefile+0−4
@@ -33,10 +33,6 @@ ifdef CONFIG_PPC64 · 32 unmodified lines
3333 calcs_ccflags := -mhard-float -maltivec
3434 endif
3535
36−ifdef CONFIG_ARM64
37−calcs_rcflags := -mgeneral-regs-only
38−endif
39−
4036 ifdef CONFIG_CC_IS_GCC
4137 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
4238 IS_OLD_GCC = 1
drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile+0−21
@@ -104,13 +104,6 @@ ifdef CONFIG_PPC64 · 103 unmodified lines
104104 CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn21/rn_clk_mgr.o := $(call cc-option,-mno-gnu-attribute)
105105 endif
106106
107−# prevent build errors:
108−# ...: '-mgeneral-regs-only' is incompatible with the use of floating-point types
109−# this file is unused on arm64, just like on ppc64
110−ifdef CONFIG_ARM64
111−CFLAGS_REMOVE_$(AMDDALPATH)/dc/clk_mgr/dcn21/rn_clk_mgr.o := -mgeneral-regs-only
112−endif
113−
114107 AMD_DAL_CLK_MGR_DCN21 = $(addprefix $(AMDDALPATH)/dc/clk_mgr/dcn21/,$(CLK_MGR_DCN21))
115108
116109 AMD_DISPLAY_FILES += $(AMD_DAL_CLK_MGR_DCN21)
@@ -125,13 +118,6 @@ ifdef CONFIG_PPC64 · 8 unmodified lines
125118 CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn30/dcn30_clk_mgr.o := $(call cc-option,-mno-gnu-attribute)
126119 endif
127120
128−# prevent build errors:
129−# ...: '-mgeneral-regs-only' is incompatible with the use of floating-point types
130−# this file is unused on arm64, just like on ppc64
131−ifdef CONFIG_ARM64
132−CFLAGS_REMOVE_$(AMDDALPATH)/dc/clk_mgr/dcn30/dcn30_clk_mgr.o := -mgeneral-regs-only
133−endif
134−
135121 AMD_DAL_CLK_MGR_DCN30 = $(addprefix $(AMDDALPATH)/dc/clk_mgr/dcn30/,$(CLK_MGR_DCN30))
136122
137123 AMD_DISPLAY_FILES += $(AMD_DAL_CLK_MGR_DCN30)
@@ -146,13 +132,6 @@ ifdef CONFIG_PPC64 · 8 unmodified lines
146132 CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn301/vg_clk_mgr.o := $(call cc-option,-mno-gnu-attribute)
147133 endif
148134
149−# prevent build errors:
150−# ...: '-mgeneral-regs-only' is incompatible with the use of floating-point types
151−# this file is unused on arm64, just like on ppc64
152−ifdef CONFIG_ARM64
153−CFLAGS_REMOVE_$(AMDDALPATH)/dc/clk_mgr/dcn301/vg_clk_mgr.o := -mgeneral-regs-only
154−endif
155−
156135 AMD_DAL_CLK_MGR_DCN301 = $(addprefix $(AMDDALPATH)/dc/clk_mgr/dcn301/,$(CLK_MGR_DCN301))
157136
158137 AMD_DISPLAY_FILES += $(AMD_DAL_CLK_MGR_DCN301)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c+4−2
@@ -251,6 +251,7 @@ static void dcn3_update_clocks(struct clk_mgr *clk_mgr_base, · 250 unmodified lines
251251 struct dmcu *dmcu = clk_mgr_base->ctx->dc->res_pool->dmcu;
252252 bool force_reset = false;
253253 bool update_uclk = false;
254+ bool p_state_change_support;
254255
255256 if (dc->work_arounds.skip_clock_update || !clk_mgr->smu_present)
256257 return;
@@ -291,8 +292,9 @@ static void dcn3_update_clocks(struct clk_mgr *clk_mgr_base, · 34 unmodified lines
291292 clk_mgr_base->clks.socclk_khz = new_clocks->socclk_khz;
292293
293294 clk_mgr_base->clks.prev_p_state_change_support = clk_mgr_base->clks.p_state_change_support;
294− if (should_update_pstate_support(safe_to_lower, new_clocks->p_state_change_support, clk_mgr_base->clks.p_state_change_support)) {
295− clk_mgr_base->clks.p_state_change_support = new_clocks->p_state_change_support;
295+ p_state_change_support = new_clocks->p_state_change_support || (display_count == 0);
296+ if (should_update_pstate_support(safe_to_lower, p_state_change_support, clk_mgr_base->clks.p_state_change_support)) {
297+ clk_mgr_base->clks.p_state_change_support = p_state_change_support;
296298
297299 /* to disable P-State switching, set UCLK min = max */
298300 if (!clk_mgr_base->clks.p_state_change_support)
drivers/gpu/drm/amd/display/dc/core/dc.c+19−8
@@ -2679,8 +2679,7 @@ void dc_commit_updates_for_stream(struct dc *dc, · 2678 unmodified lines
26792679 struct dc_surface_update *srf_updates,
26802680 int surface_count,
26812681 struct dc_stream_state *stream,
2682− struct dc_stream_update *stream_update,
2683− struct dc_state *state)
2682+ struct dc_stream_update *stream_update)
26842683 {
26852684 const struct dc_stream_status *stream_status;
26862685 enum surface_update_type update_type;
@@ -2699,6 +2698,12 @@ void dc_commit_updates_for_stream(struct dc *dc, · 12 unmodified lines
26992698
27002699
27012700 if (update_type >= UPDATE_TYPE_FULL) {
2701+ struct dc_plane_state *new_planes[MAX_SURFACES];
2702+
2703+ memset(new_planes, 0, sizeof(new_planes));
2704+
2705+ for (i = 0; i < surface_count; i++)
2706+ new_planes[i] = srf_updates[i].surface;
27022707
27032708 /* initialize scratch memory for building context */
27042709 context = dc_create_state(dc);
@@ -2707,15 +2712,21 @@ void dc_commit_updates_for_stream(struct dc *dc, · 2 unmodified lines
27072712 return;
27082713 }
27092714
2710− dc_resource_state_copy_construct(state, context);
2715+ dc_resource_state_copy_construct(
2716+ dc->current_state, context);
27112717
2712− for (i = 0; i < dc->res_pool->pipe_count; i++) {
2713− struct pipe_ctx *new_pipe = &context->res_ctx.pipe_ctx[i];
2714− struct pipe_ctx *old_pipe = &dc->current_state->res_ctx.pipe_ctx[i];
2718+ /*remove old surfaces from context */
2719+ if (!dc_rem_all_planes_for_stream(dc, stream, context)) {
2720+ DC_ERROR("Failed to remove streams for new validate context!\n");
2721+ return;
2722+ }
27152723
2716− if (new_pipe->plane_state && new_pipe->plane_state != old_pipe->plane_state)
2717− new_pipe->plane_state->force_full_update = true;
2724+ /* add surface to context */
2725+ if (!dc_add_all_planes_for_stream(dc, stream, new_planes, surface_count, context)) {
2726+ DC_ERROR("Failed to add streams for new validate context!\n");
2727+ return;
27182728 }
2729+
27192730 }
27202731
27212732
drivers/gpu/drm/amd/display/dc/core/dc_link.c+6−1
@@ -2487,9 +2487,14 @@ enum dc_status dc_link_validate_mode_timing( · 2486 unmodified lines
24872487 static struct abm *get_abm_from_stream_res(const struct dc_link *link)
24882488 {
24892489 int i;
2490− struct dc *dc = link->ctx->dc;
2490+ struct dc *dc = NULL;
24912491 struct abm *abm = NULL;
24922492
2493+ if (!link || !link->ctx)
2494+ return NULL;
2495+
2496+ dc = link->ctx->dc;
2497+
24932498 for (i = 0; i < MAX_PIPES; i++) {
24942499 struct pipe_ctx pipe_ctx = dc->current_state->res_ctx.pipe_ctx[i];
24952500 struct dc_stream_state *stream = pipe_ctx.stream;
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c+15−6
@@ -892,13 +892,13 @@ static uint32_t translate_training_aux_read_interval(uint32_t dpcd_aux_read_inte · 891 unmodified lines
892892
893893 switch (dpcd_aux_read_interval) {
894894 case 0x01:
895− aux_rd_interval_us = 400;
895+ aux_rd_interval_us = 4000;
896896 break;
897897 case 0x02:
898− aux_rd_interval_us = 4000;
898+ aux_rd_interval_us = 8000;
899899 break;
900900 case 0x03:
901− aux_rd_interval_us = 8000;
901+ aux_rd_interval_us = 12000;
902902 break;
903903 case 0x04:
904904 aux_rd_interval_us = 16000;
@@ -2399,6 +2399,9 @@ static bool decide_dp_link_settings(struct dc_link *link, struct dc_link_setting · 1494 unmodified lines
23992399 initial_link_setting;
24002400 uint32_t link_bw;
24012401
2402+ if (req_bw > dc_link_bandwidth_kbps(link, &link->verified_link_cap))
2403+ return false;
2404+
24022405 /* search for the minimum link setting that:
24032406 * 1. is supported according to the link training result
24042407 * 2. could support the b/w requested by the timing
@@ -3045,14 +3048,14 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd · 640 unmodified lines
30453048 for (i = 0; i < MAX_PIPES; i++) {
30463049 pipe_ctx = &link->dc->current_state->res_ctx.pipe_ctx[i];
30473050 if (pipe_ctx && pipe_ctx->stream && !pipe_ctx->stream->dpms_off &&
3048− pipe_ctx->stream->link == link)
3051+ pipe_ctx->stream->link == link && !pipe_ctx->prev_odm_pipe)
30493052 core_link_disable_stream(pipe_ctx);
30503053 }
30513054
30523055 for (i = 0; i < MAX_PIPES; i++) {
30533056 pipe_ctx = &link->dc->current_state->res_ctx.pipe_ctx[i];
30543057 if (pipe_ctx && pipe_ctx->stream && !pipe_ctx->stream->dpms_off &&
3055− pipe_ctx->stream->link == link)
3058+ pipe_ctx->stream->link == link && !pipe_ctx->prev_odm_pipe)
30563059 core_link_enable_stream(link->dc->current_state, pipe_ctx);
30573060 }
30583061
@@ -3992,7 +3995,7 @@ bool dc_link_dp_set_test_pattern( · 933 unmodified lines
39923995 unsigned int cust_pattern_size)
39933996 {
39943997 struct pipe_ctx *pipes = link->dc->current_state->res_ctx.pipe_ctx;
3995− struct pipe_ctx *pipe_ctx = &pipes[0];
3998+ struct pipe_ctx *pipe_ctx = NULL;
39963999 unsigned int lane;
39974000 unsigned int i;
39984001 unsigned char link_qual_pattern[LANE_COUNT_DP_MAX] = {0};
@@ -4002,12 +4005,18 @@ bool dc_link_dp_set_test_pattern( · 3 unmodified lines
40024005 memset(&training_pattern, 0, sizeof(training_pattern));
40034006
40044007 for (i = 0; i < MAX_PIPES; i++) {
4008+ if (pipes[i].stream == NULL)
4009+ continue;
4010+
40054011 if (pipes[i].stream->link == link && !pipes[i].top_pipe && !pipes[i].prev_odm_pipe) {
40064012 pipe_ctx = &pipes[i];
40074013 break;
40084014 }
40094015 }
40104016
4017+ if (pipe_ctx == NULL)
4018+ return false;
4019+
40114020 /* Reset CRTC Test Pattern if it is currently running and request is VideoMode */
40124021 if (link->test_pattern_enabled && test_pattern ==
40134022 DP_TEST_PATTERN_VIDEO_MODE) {
drivers/gpu/drm/amd/display/dc/dc_stream.h+1−2
@@ -283,8 +283,7 @@ void dc_commit_updates_for_stream(struct dc *dc, · 282 unmodified lines
283283 struct dc_surface_update *srf_updates,
284284 int surface_count,
285285 struct dc_stream_state *stream,
286− struct dc_stream_update *stream_update,
287− struct dc_state *state);
286+ struct dc_stream_update *stream_update);
288287 /*
289288 * Log the current stream state.
290289 */
drivers/gpu/drm/amd/display/dc/dcn10/Makefile+0−7
@@ -31,11 +31,4 @@ DCN10 = dcn10_init.o dcn10_resource.o dcn10_ipp.o dcn10_hw_sequencer.o \ · 30 unmodified lines
3131
3232 AMD_DAL_DCN10 = $(addprefix $(AMDDALPATH)/dc/dcn10/,$(DCN10))
3333
34−# fix:
35−# ...: '-mgeneral-regs-only' is incompatible with the use of floating-point types
36−# aarch64 does not support soft-float, so use hard-float and handle this in code
37−ifdef CONFIG_ARM64
38−CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn10/dcn10_resource.o := -mgeneral-regs-only
39−endif
40−
4134 AMD_DISPLAY_FILES += $(AMD_DAL_DCN10)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c+14−4
@@ -647,8 +647,13 @@ static void power_on_plane( · 646 unmodified lines
647647 if (REG(DC_IP_REQUEST_CNTL)) {
648648 REG_SET(DC_IP_REQUEST_CNTL, 0,
649649 IP_REQUEST_EN, 1);
650− hws->funcs.dpp_pg_control(hws, plane_id, true);
651− hws->funcs.hubp_pg_control(hws, plane_id, true);
650+
651+ if (hws->funcs.dpp_pg_control)
652+ hws->funcs.dpp_pg_control(hws, plane_id, true);
653+
654+ if (hws->funcs.hubp_pg_control)
655+ hws->funcs.hubp_pg_control(hws, plane_id, true);
656+
652657 REG_SET(DC_IP_REQUEST_CNTL, 0,
653658 IP_REQUEST_EN, 0);
654659 DC_LOG_DEBUG(
@@ -1082,8 +1087,13 @@ void dcn10_plane_atomic_power_down(struct dc *dc, · 427 unmodified lines
10821087 if (REG(DC_IP_REQUEST_CNTL)) {
10831088 REG_SET(DC_IP_REQUEST_CNTL, 0,
10841089 IP_REQUEST_EN, 1);
1085− hws->funcs.dpp_pg_control(hws, dpp->inst, false);
1086− hws->funcs.hubp_pg_control(hws, hubp->inst, false);
1090+
1091+ if (hws->funcs.dpp_pg_control)
1092+ hws->funcs.dpp_pg_control(hws, dpp->inst, false);
1093+
1094+ if (hws->funcs.hubp_pg_control)
1095+ hws->funcs.hubp_pg_control(hws, hubp->inst, false);
1096+
10871097 dpp->funcs->dpp_reset(dpp);
10881098 REG_SET(DC_IP_REQUEST_CNTL, 0,
10891099 IP_REQUEST_EN, 0);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c+1−1
@@ -470,7 +470,7 @@ void mpc1_cursor_lock(struct mpc *mpc, int opp_id, bool lock) · 469 unmodified lines
470470 unsigned int mpc1_get_mpc_out_mux(struct mpc *mpc, int opp_id)
471471 {
472472 struct dcn10_mpc *mpc10 = TO_DCN10_MPC(mpc);
473− uint32_t val = 0;
473+ uint32_t val = 0xf;
474474
475475 if (opp_id < MAX_OPP && REG(MUX[opp_id]))
476476 REG_GET(MUX[opp_id], MPC_OUT_MUX, &val);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c+2−9
@@ -608,8 +608,8 @@ static const struct dc_debug_options debug_defaults_drv = { · 607 unmodified lines
608608 .disable_pplib_clock_request = false,
609609 .disable_pplib_wm_range = false,
610610 .pplib_wm_report_mode = WM_REPORT_DEFAULT,
611− .pipe_split_policy = MPC_SPLIT_DYNAMIC,
612− .force_single_disp_pipe_split = true,
611+ .pipe_split_policy = MPC_SPLIT_AVOID,
612+ .force_single_disp_pipe_split = false,
613613 .disable_dcc = DCC_ENABLE,
614614 .voltage_align_fclk = true,
615615 .disable_stereo_support = true,
@@ -1534,15 +1534,8 @@ static bool dcn10_resource_construct( · 918 unmodified lines
15341534 memcpy(dc->dcn_ip, &dcn10_ip_defaults, sizeof(dcn10_ip_defaults));
15351535 memcpy(dc->dcn_soc, &dcn10_soc_defaults, sizeof(dcn10_soc_defaults));
15361536
1537−#if defined(CONFIG_ARM64)
1538− /* Aarch64 does not support -msoft-float/-mfloat-abi=soft */
1539− DC_FP_START();
1540− dcn10_resource_construct_fp(dc);
1541− DC_FP_END();
1542−#else
15431537 /* Other architectures we build for build this with soft-float */
15441538 dcn10_resource_construct_fp(dc);
1545−#endif
15461539
15471540 pool->base.pp_smu = dcn10_pp_smu_create(ctx);
15481541
drivers/gpu/drm/amd/display/dc/dcn20/Makefile+0−4
@@ -17,10 +17,6 @@ ifdef CONFIG_PPC64 · 16 unmodified lines
1717 CFLAGS_$(AMDDALPATH)/dc/dcn20/dcn20_resource.o := -mhard-float -maltivec
1818 endif
1919
20−ifdef CONFIG_ARM64
21−CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn20/dcn20_resource.o := -mgeneral-regs-only
22−endif
23−
2420 ifdef CONFIG_CC_IS_GCC
2521 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
2622 IS_OLD_GCC = 1
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c+7−2
@@ -1062,8 +1062,13 @@ static void dcn20_power_on_plane( · 1061 unmodified lines
10621062 if (REG(DC_IP_REQUEST_CNTL)) {
10631063 REG_SET(DC_IP_REQUEST_CNTL, 0,
10641064 IP_REQUEST_EN, 1);
1065− dcn20_dpp_pg_control(hws, pipe_ctx->plane_res.dpp->inst, true);
1066− dcn20_hubp_pg_control(hws, pipe_ctx->plane_res.hubp->inst, true);
1065+
1066+ if (hws->funcs.dpp_pg_control)
1067+ hws->funcs.dpp_pg_control(hws, pipe_ctx->plane_res.dpp->inst, true);
1068+
1069+ if (hws->funcs.hubp_pg_control)
1070+ hws->funcs.hubp_pg_control(hws, pipe_ctx->plane_res.hubp->inst, true);
1071+
10671072 REG_SET(DC_IP_REQUEST_CNTL, 0,
10681073 IP_REQUEST_EN, 0);
10691074 DC_LOG_DEBUG(
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c+6−5
@@ -297,8 +297,8 @@ static struct _vcs_dpi_soc_bounding_box_st dcn2_0_soc = { · 296 unmodified lines
297297 },
298298 },
299299 .num_states = 5,
300− .sr_exit_time_us = 11.6,
301− .sr_enter_plus_exit_time_us = 13.9,
300+ .sr_exit_time_us = 8.6,
301+ .sr_enter_plus_exit_time_us = 10.9,
302302 .urgent_latency_us = 4.0,
303303 .urgent_latency_pixel_data_only_us = 4.0,
304304 .urgent_latency_pixel_mixed_with_vm_data_us = 4.0,
@@ -2517,8 +2517,7 @@ struct pipe_ctx *dcn20_find_secondary_pipe(struct dc *dc, · 2212 unmodified lines
25172517 * if this primary pipe has a bottom pipe in prev. state
25182518 * and if the bottom pipe is still available (which it should be),
25192519 * pick that pipe as secondary
2520− * Same logic applies for ODM pipes. Since mpo is not allowed with odm
2521− * check in else case.
2520+ * Same logic applies for ODM pipes
25222521 */
25232522 if (dc->current_state->res_ctx.pipe_ctx[primary_pipe->pipe_idx].bottom_pipe) {
25242523 preferred_pipe_idx = dc->current_state->res_ctx.pipe_ctx[primary_pipe->pipe_idx].bottom_pipe->pipe_idx;
@@ -2526,7 +2525,9 @@ struct pipe_ctx *dcn20_find_secondary_pipe(struct dc *dc, · 1 unmodified line
25262525 secondary_pipe = &res_ctx->pipe_ctx[preferred_pipe_idx];
25272526 secondary_pipe->pipe_idx = preferred_pipe_idx;
25282527 }
2529− } else if (dc->current_state->res_ctx.pipe_ctx[primary_pipe->pipe_idx].next_odm_pipe) {
2528+ }
2529+ if (secondary_pipe == NULL &&
2530+ dc->current_state->res_ctx.pipe_ctx[primary_pipe->pipe_idx].next_odm_pipe) {
25302531 preferred_pipe_idx = dc->current_state->res_ctx.pipe_ctx[primary_pipe->pipe_idx].next_odm_pipe->pipe_idx;
25312532 if (res_ctx->pipe_ctx[preferred_pipe_idx].stream == NULL) {
25322533 secondary_pipe = &res_ctx->pipe_ctx[preferred_pipe_idx];
drivers/gpu/drm/amd/display/dc/dcn21/Makefile+0−4
@@ -13,10 +13,6 @@ ifdef CONFIG_PPC64 · 12 unmodified lines
1313 CFLAGS_$(AMDDALPATH)/dc/dcn21/dcn21_resource.o := -mhard-float -maltivec
1414 endif
1515
16−ifdef CONFIG_ARM64
17−CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn21/dcn21_resource.o := -mgeneral-regs-only
18−endif
19−
2016 ifdef CONFIG_CC_IS_GCC
2117 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
2218 IS_OLD_GCC = 1
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c+11−1
@@ -296,7 +296,7 @@ struct _vcs_dpi_soc_bounding_box_st dcn2_1_soc = { · 295 unmodified lines
296296 .num_banks = 8,
297297 .num_chans = 4,
298298 .vmm_page_size_bytes = 4096,
299− .dram_clock_change_latency_us = 23.84,
299+ .dram_clock_change_latency_us = 11.72,
300300 .return_bus_width_bytes = 64,
301301 .dispclk_dppclk_vco_speed_mhz = 3600,
302302 .xfc_bus_transport_time_us = 4,
@@ -906,6 +906,8 @@ enum dcn20_clk_src_array_id { · 603 unmodified lines
906906 DCN20_CLK_SRC_PLL0,
907907 DCN20_CLK_SRC_PLL1,
908908 DCN20_CLK_SRC_PLL2,
909+ DCN20_CLK_SRC_PLL3,
910+ DCN20_CLK_SRC_PLL4,
909911 DCN20_CLK_SRC_TOTAL_DCN21
910912 };
911913
@@ -2030,6 +2032,14 @@ static bool dcn21_resource_construct( · 1118 unmodified lines
20302032 dcn21_clock_source_create(ctx, ctx->dc_bios,
20312033 CLOCK_SOURCE_COMBO_PHY_PLL2,
20322034 &clk_src_regs[2], false);
2035+ pool->base.clock_sources[DCN20_CLK_SRC_PLL3] =
2036+ dcn21_clock_source_create(ctx, ctx->dc_bios,
2037+ CLOCK_SOURCE_COMBO_PHY_PLL3,
2038+ &clk_src_regs[3], false);
2039+ pool->base.clock_sources[DCN20_CLK_SRC_PLL4] =
2040+ dcn21_clock_source_create(ctx, ctx->dc_bios,
2041+ CLOCK_SOURCE_COMBO_PHY_PLL4,
2042+ &clk_src_regs[4], false);
20332043
20342044 pool->base.clk_src_count = DCN20_CLK_SRC_TOTAL_DCN21;
20352045
drivers/gpu/drm/amd/display/dc/dcn30/Makefile+4−7
@@ -32,8 +32,8 @@ DCN30 = dcn30_init.o dcn30_hubbub.o dcn30_hubp.o dcn30_dpp.o dcn30_optc.o \ · 31 unmodified lines
3232
3333
3434 ifdef CONFIG_X86
35−CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mhard-float -msse
36−CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mhard-float -msse
35+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -msse
36+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -msse
3737 endif
3838
3939 ifdef CONFIG_PPC64
@@ -41,15 +41,12 @@ CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mhard-float -maltivec · 1 unmodified line
4141 CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mhard-float -maltivec
4242 endif
4343
44−ifdef CONFIG_ARM64
45−CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mgeneral-regs-only
46−CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mgeneral-regs-only
47−endif
48−
4944 ifdef CONFIG_CC_IS_GCC
5045 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
5146 IS_OLD_GCC = 1
5247 endif
48+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o += -mhard-float
49+CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o += -mhard-float
5350 endif
5451
5552 ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn301/Makefile+2−5
@@ -14,21 +14,18 @@ DCN301 = dcn301_init.o dcn301_resource.o dcn301_dccg.o \ · 13 unmodified lines
1414 dcn301_dio_link_encoder.o dcn301_hwseq.o dcn301_panel_cntl.o dcn301_hubbub.o
1515
1616 ifdef CONFIG_X86
17−CFLAGS_$(AMDDALPATH)/dc/dcn301/dcn301_resource.o := -mhard-float -msse
17+CFLAGS_$(AMDDALPATH)/dc/dcn301/dcn301_resource.o := -msse
1818 endif
1919
2020 ifdef CONFIG_PPC64
2121 CFLAGS_$(AMDDALPATH)/dc/dcn301/dcn301_resource.o := -mhard-float -maltivec
2222 endif
2323
24−ifdef CONFIG_ARM64
25−CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn301/dcn301_resource.o := -mgeneral-regs-only
26−endif
27−
2824 ifdef CONFIG_CC_IS_GCC
2925 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
3026 IS_OLD_GCC = 1
3127 endif
28+CFLAGS_$(AMDDALPATH)/dc/dcn301/dcn301_resource.o += -mhard-float
3229 endif
3330
3431 ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c+1−0
@@ -1731,6 +1731,7 @@ static struct resource_funcs dcn301_res_pool_funcs = { · 1730 unmodified lines
17311731 .populate_dml_pipes = dcn30_populate_dml_pipes_from_context,
17321732 .acquire_idle_pipe_for_layer = dcn20_acquire_idle_pipe_for_layer,
17331733 .add_stream_to_ctx = dcn30_add_stream_to_ctx,
1734+ .add_dsc_to_stream_resource = dcn20_add_dsc_to_stream_resource,
17341735 .remove_stream_from_ctx = dcn20_remove_stream_from_ctx,
17351736 .populate_dml_writeback_from_context = dcn30_populate_dml_writeback_from_context,
17361737 .set_mcif_arb_params = dcn30_set_mcif_arb_params,
drivers/gpu/drm/amd/display/dc/dcn302/Makefile+2−5
@@ -13,21 +13,18 @@ · 12 unmodified lines
1313 DCN3_02 = dcn302_init.o dcn302_hwseq.o dcn302_resource.o
1414
1515 ifdef CONFIG_X86
16−CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mhard-float -msse
16+CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -msse
1717 endif
1818
1919 ifdef CONFIG_PPC64
2020 CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mhard-float -maltivec
2121 endif
2222
23−ifdef CONFIG_ARM64
24−CFLAGS_REMOVE_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mgeneral-regs-only
25−endif
26−
2723 ifdef CONFIG_CC_IS_GCC
2824 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
2925 IS_OLD_GCC = 1
3026 endif
27+CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o += -mhard-float
3128 endif
3229
3330 ifdef CONFIG_X86
drivers/gpu/drm/amd/display/dc/dml/Makefile+0−4
@@ -33,10 +33,6 @@ ifdef CONFIG_PPC64 · 32 unmodified lines
3333 dml_ccflags := -mhard-float -maltivec
3434 endif
3535
36−ifdef CONFIG_ARM64
37−dml_rcflags := -mgeneral-regs-only
38−endif
39−
4036 ifdef CONFIG_CC_IS_GCC
4137 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
4238 IS_OLD_GCC = 1
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c+6−5
@@ -2635,14 +2635,15 @@ static void dml20v2_DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndP · 2634 unmodified lines
26352635 }
26362636
26372637 if (mode_lib->vba.DRAMClockChangeSupportsVActive &&
2638− mode_lib->vba.MinActiveDRAMClockChangeMargin > 60 &&
2639− mode_lib->vba.PrefetchMode[mode_lib->vba.VoltageLevel][mode_lib->vba.maxMpcComb] == 0) {
2638+ mode_lib->vba.MinActiveDRAMClockChangeMargin > 60) {
26402639 mode_lib->vba.DRAMClockChangeWatermark += 25;
26412640
26422641 for (k = 0; k < mode_lib->vba.NumberOfActivePlanes; ++k) {
2643− if (mode_lib->vba.DRAMClockChangeWatermark >
2644− dml_max(mode_lib->vba.StutterEnterPlusExitWatermark, mode_lib->vba.UrgentWatermark))
2645− mode_lib->vba.MinTTUVBlank[k] += 25;
2642+ if (mode_lib->vba.PrefetchMode[mode_lib->vba.VoltageLevel][mode_lib->vba.maxMpcComb] == 0) {
2643+ if (mode_lib->vba.DRAMClockChangeWatermark >
2644+ dml_max(mode_lib->vba.StutterEnterPlusExitWatermark, mode_lib->vba.UrgentWatermark))
2645+ mode_lib->vba.MinTTUVBlank[k] += 25;
2646+ }
26462647 }
26472648
26482649 mode_lib->vba.DRAMClockChangeSupport[0][0] = dm_dram_clock_change_vactive;
drivers/gpu/drm/amd/display/dc/dsc/Makefile+0−4
@@ -10,10 +10,6 @@ ifdef CONFIG_PPC64 · 9 unmodified lines
1010 dsc_ccflags := -mhard-float -maltivec
1111 endif
1212
13−ifdef CONFIG_ARM64
14−dsc_rcflags := -mgeneral-regs-only
15−endif
16−
1713 ifdef CONFIG_CC_IS_GCC
1814 ifeq ($(call cc-ifversion, -lt, 0701, y), y)
1915 IS_OLD_GCC = 1
drivers/gpu/drm/amd/display/dc/os_types.h+0−4
@@ -55,10 +55,6 @@ · 54 unmodified lines
5555 #include <asm/fpu/api.h>
5656 #define DC_FP_START() kernel_fpu_begin()
5757 #define DC_FP_END() kernel_fpu_end()
58−#elif defined(CONFIG_ARM64)
59−#include <asm/neon.h>
60−#define DC_FP_START() kernel_neon_begin()
61−#define DC_FP_END() kernel_neon_end()
6258 #elif defined(CONFIG_PPC64)
6359 #include <asm/switch_to.h>
6460 #include <asm/cputable.h>
drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h+1−0
@@ -553,6 +553,7 @@ struct pptable_funcs { · 552 unmodified lines
553553 *clock_req);
554554 uint32_t (*get_fan_control_mode)(struct smu_context *smu);
555555 int (*set_fan_control_mode)(struct smu_context *smu, uint32_t mode);
556+ int (*set_fan_speed_percent)(struct smu_context *smu, uint32_t speed);
556557 int (*set_fan_speed_rpm)(struct smu_context *smu, uint32_t speed);
557558 int (*set_xgmi_pstate)(struct smu_context *smu, uint32_t pstate);
558559 int (*gfx_off_control)(struct smu_context *smu, bool enable);
drivers/gpu/drm/amd/pm/inc/smu_v11_0.h+3−0
@@ -203,6 +203,9 @@ int · 202 unmodified lines
203203 smu_v11_0_set_fan_control_mode(struct smu_context *smu,
204204 uint32_t mode);
205205
206+int
207+smu_v11_0_set_fan_speed_percent(struct smu_context *smu, uint32_t speed);
208+
206209 int smu_v11_0_set_fan_speed_rpm(struct smu_context *smu,
207210 uint32_t speed);
208211
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c+151−15
@@ -251,7 +251,7 @@ static int smu10_set_hard_min_gfxclk_by_freq(struct pp_hwmgr *hwmgr, uint32_t cl · 250 unmodified lines
251251 smu10_data->gfx_actual_soft_min_freq = clock;
252252 smum_send_msg_to_smc_with_parameter(hwmgr,
253253 PPSMC_MSG_SetHardMinGfxClk,
254− smu10_data->gfx_actual_soft_min_freq,
254+ clock,
255255 NULL);
256256 }
257257 return 0;
@@ -558,7 +558,8 @@ static int smu10_hwmgr_backend_init(struct pp_hwmgr *hwmgr) · 300 unmodified lines
558558
559559 /* enable the pp_od_clk_voltage sysfs file */
560560 hwmgr->od_enabled = 1;
561−
561+ /* disabled fine grain tuning function by default */
562+ data->fine_grain_enabled = 0;
562563 return result;
563564 }
564565
@@ -597,6 +598,7 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · 32 unmodified lines
597598 uint32_t min_mclk = hwmgr->display_config->min_mem_set_clock/100;
598599 uint32_t index_fclk = data->clock_vol_info.vdd_dep_on_fclk->count - 1;
599600 uint32_t index_socclk = data->clock_vol_info.vdd_dep_on_socclk->count - 1;
601+ uint32_t fine_grain_min_freq = 0, fine_grain_max_freq = 0;
600602
601603 if (hwmgr->smu_version < 0x1E3700) {
602604 pr_info("smu firmware version too old, can not set dpm level\n");
@@ -613,6 +615,14 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · 10 unmodified lines
613615 switch (level) {
614616 case AMD_DPM_FORCED_LEVEL_HIGH:
615617 case AMD_DPM_FORCED_LEVEL_PROFILE_PEAK:
618+ data->fine_grain_enabled = 0;
619+
620+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &fine_grain_min_freq);
621+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &fine_grain_max_freq);
622+
623+ data->gfx_actual_soft_min_freq = fine_grain_min_freq;
624+ data->gfx_actual_soft_max_freq = fine_grain_max_freq;
625+
616626 smum_send_msg_to_smc_with_parameter(hwmgr,
617627 PPSMC_MSG_SetHardMinGfxClk,
618628 data->gfx_max_freq_limit/100,
@@ -648,6 +658,14 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · 29 unmodified lines
648658 NULL);
649659 break;
650660 case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK:
661+ data->fine_grain_enabled = 0;
662+
663+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &fine_grain_min_freq);
664+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &fine_grain_max_freq);
665+
666+ data->gfx_actual_soft_min_freq = fine_grain_min_freq;
667+ data->gfx_actual_soft_max_freq = fine_grain_max_freq;
668+
651669 smum_send_msg_to_smc_with_parameter(hwmgr,
652670 PPSMC_MSG_SetHardMinGfxClk,
653671 min_sclk,
@@ -658,6 +676,14 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · 4 unmodified lines
658676 NULL);
659677 break;
660678 case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK:
679+ data->fine_grain_enabled = 0;
680+
681+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &fine_grain_min_freq);
682+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &fine_grain_max_freq);
683+
684+ data->gfx_actual_soft_min_freq = fine_grain_min_freq;
685+ data->gfx_actual_soft_max_freq = fine_grain_max_freq;
686+
661687 smum_send_msg_to_smc_with_parameter(hwmgr,
662688 PPSMC_MSG_SetHardMinFclkByFreq,
663689 min_mclk,
@@ -668,6 +694,14 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · 4 unmodified lines
668694 NULL);
669695 break;
670696 case AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD:
697+ data->fine_grain_enabled = 0;
698+
699+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &fine_grain_min_freq);
700+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &fine_grain_max_freq);
701+
702+ data->gfx_actual_soft_min_freq = fine_grain_min_freq;
703+ data->gfx_actual_soft_max_freq = fine_grain_max_freq;
704+
671705 smum_send_msg_to_smc_with_parameter(hwmgr,
672706 PPSMC_MSG_SetHardMinGfxClk,
673707 SMU10_UMD_PSTATE_GFXCLK,
@@ -703,6 +737,14 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · 29 unmodified lines
703737 NULL);
704738 break;
705739 case AMD_DPM_FORCED_LEVEL_AUTO:
740+ data->fine_grain_enabled = 0;
741+
742+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &fine_grain_min_freq);
743+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &fine_grain_max_freq);
744+
745+ data->gfx_actual_soft_min_freq = fine_grain_min_freq;
746+ data->gfx_actual_soft_max_freq = fine_grain_max_freq;
747+
706748 smum_send_msg_to_smc_with_parameter(hwmgr,
707749 PPSMC_MSG_SetHardMinGfxClk,
708750 min_sclk,
@@ -741,6 +783,14 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · 32 unmodified lines
741783 NULL);
742784 break;
743785 case AMD_DPM_FORCED_LEVEL_LOW:
786+ data->fine_grain_enabled = 0;
787+
788+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &fine_grain_min_freq);
789+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &fine_grain_max_freq);
790+
791+ data->gfx_actual_soft_min_freq = fine_grain_min_freq;
792+ data->gfx_actual_soft_max_freq = fine_grain_max_freq;
793+
744794 smum_send_msg_to_smc_with_parameter(hwmgr,
745795 PPSMC_MSG_SetHardMinGfxClk,
746796 data->gfx_min_freq_limit/100,
@@ -759,6 +809,7 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · 12 unmodified lines
759809 NULL);
760810 break;
761811 case AMD_DPM_FORCED_LEVEL_MANUAL:
812+ data->fine_grain_enabled = 1;
762813 case AMD_DPM_FORCED_LEVEL_PROFILE_EXIT:
763814 default:
764815 break;
@@ -948,6 +999,8 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr, · 183 unmodified lines
948999 struct smu10_voltage_dependency_table *mclk_table =
9491000 data->clock_vol_info.vdd_dep_on_fclk;
9501001 uint32_t i, now, size = 0;
1002+ uint32_t min_freq, max_freq = 0;
1003+ uint32_t ret = 0;
9511004
9521005 switch (type) {
9531006 case PP_SCLK:
@@ -983,18 +1036,28 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr, · 29 unmodified lines
9831036 break;
9841037 case OD_SCLK:
9851038 if (hwmgr->od_enabled) {
986− size = sprintf(buf, "%s:\n", "OD_SCLK");
1039+ ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &min_freq);
1040+ if (ret)
1041+ return ret;
1042+ ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &max_freq);
1043+ if (ret)
1044+ return ret;
9871045
1046+ size = sprintf(buf, "%s:\n", "OD_SCLK");
9881047 size += sprintf(buf + size, "0: %10uMhz\n",
989− (data->gfx_actual_soft_min_freq > 0) ? data->gfx_actual_soft_min_freq : data->gfx_min_freq_limit/100);
990− size += sprintf(buf + size, "1: %10uMhz\n", data->gfx_max_freq_limit/100);
1048+ (data->gfx_actual_soft_min_freq > 0) ? data->gfx_actual_soft_min_freq : min_freq);
1049+ size += sprintf(buf + size, "1: %10uMhz\n",
1050+ (data->gfx_actual_soft_max_freq > 0) ? data->gfx_actual_soft_max_freq : max_freq);
9911051 }
9921052 break;
9931053 case OD_RANGE:
9941054 if (hwmgr->od_enabled) {
995− uint32_t min_freq, max_freq = 0;
996− smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &min_freq);
997− smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &max_freq);
1055+ ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &min_freq);
1056+ if (ret)
1057+ return ret;
1058+ ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &max_freq);
1059+ if (ret)
1060+ return ret;
9981061
9991062 size = sprintf(buf, "%s:\n", "OD_RANGE");
10001063 size += sprintf(buf + size, "SCLK: %7uMHz %10uMHz\n",
@@ -1414,23 +1477,96 @@ static int smu10_set_fine_grain_clk_vol(struct pp_hwmgr *hwmgr, · 413 unmodified lines
14141477 enum PP_OD_DPM_TABLE_COMMAND type,
14151478 long *input, uint32_t size)
14161479 {
1480+ uint32_t min_freq, max_freq = 0;
1481+ struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend);
1482+ int ret = 0;
1483+
14171484 if (!hwmgr->od_enabled) {
14181485 pr_err("Fine grain not support\n");
14191486 return -EINVAL;
14201487 }
14211488
1422− if (size != 2) {
1423− pr_err("Input parameter number not correct\n");
1489+ if (!smu10_data->fine_grain_enabled) {
1490+ pr_err("Fine grain not started\n");
14241491 return -EINVAL;
14251492 }
14261493
14271494 if (type == PP_OD_EDIT_SCLK_VDDC_TABLE) {
1428− if (input[0] == 0)
1429− smu10_set_hard_min_gfxclk_by_freq(hwmgr, input[1]);
1430− else if (input[0] == 1)
1431− smu10_set_soft_max_gfxclk_by_freq(hwmgr, input[1]);
1432− else
1495+ if (size != 2) {
1496+ pr_err("Input parameter number not correct\n");
14331497 return -EINVAL;
1498+ }
1499+
1500+ if (input[0] == 0) {
1501+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &min_freq);
1502+ if (input[1] < min_freq) {
1503+ pr_err("Fine grain setting minimum sclk (%ld) MHz is less than the minimum allowed (%d) MHz\n",
1504+ input[1], min_freq);
1505+ return -EINVAL;
1506+ }
1507+ smu10_data->gfx_actual_soft_min_freq = input[1];
1508+ } else if (input[0] == 1) {
1509+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &max_freq);
1510+ if (input[1] > max_freq) {
1511+ pr_err("Fine grain setting maximum sclk (%ld) MHz is greater than the maximum allowed (%d) MHz\n",
1512+ input[1], max_freq);
1513+ return -EINVAL;
1514+ }
1515+ smu10_data->gfx_actual_soft_max_freq = input[1];
1516+ } else {
1517+ return -EINVAL;
1518+ }
1519+ } else if (type == PP_OD_RESTORE_DEFAULT_TABLE) {
1520+ if (size != 0) {
1521+ pr_err("Input parameter number not correct\n");
1522+ return -EINVAL;
1523+ }
1524+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMinGfxclkFrequency, &min_freq);
1525+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxGfxclkFrequency, &max_freq);
1526+
1527+ smu10_data->gfx_actual_soft_min_freq = min_freq;
1528+ smu10_data->gfx_actual_soft_max_freq = max_freq;
1529+
1530+ ret = smum_send_msg_to_smc_with_parameter(hwmgr,
1531+ PPSMC_MSG_SetHardMinGfxClk,
1532+ min_freq,
1533+ NULL);
1534+ if (ret)
1535+ return ret;
1536+
1537+ ret = smum_send_msg_to_smc_with_parameter(hwmgr,
1538+ PPSMC_MSG_SetSoftMaxGfxClk,
1539+ max_freq,
1540+ NULL);
1541+ if (ret)
1542+ return ret;
1543+ } else if (type == PP_OD_COMMIT_DPM_TABLE) {
1544+ if (size != 0) {
1545+ pr_err("Input parameter number not correct\n");
1546+ return -EINVAL;
1547+ }
1548+
1549+ if (smu10_data->gfx_actual_soft_min_freq > smu10_data->gfx_actual_soft_max_freq) {
1550+ pr_err("The setting minimun sclk (%d) MHz is greater than the setting maximum sclk (%d) MHz\n",
1551+ smu10_data->gfx_actual_soft_min_freq, smu10_data->gfx_actual_soft_max_freq);
1552+ return -EINVAL;
1553+ }
1554+
1555+ ret = smum_send_msg_to_smc_with_parameter(hwmgr,
1556+ PPSMC_MSG_SetHardMinGfxClk,
1557+ smu10_data->gfx_actual_soft_min_freq,
1558+ NULL);
1559+ if (ret)
1560+ return ret;
1561+
1562+ ret = smum_send_msg_to_smc_with_parameter(hwmgr,
1563+ PPSMC_MSG_SetSoftMaxGfxClk,
1564+ smu10_data->gfx_actual_soft_max_freq,
1565+ NULL);
1566+ if (ret)
1567+ return ret;
1568+ } else {
1569+ return -EINVAL;
14341570 }
14351571
14361572 return 0;
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.h+3−0
@@ -283,6 +283,7 @@ struct smu10_hwmgr { · 282 unmodified lines
283283 uint32_t vclk_soft_min;
284284 uint32_t dclk_soft_min;
285285 uint32_t gfx_actual_soft_min_freq;
286+ uint32_t gfx_actual_soft_max_freq;
286287 uint32_t gfx_min_freq_limit;
287288 uint32_t gfx_max_freq_limit; /* in 10Khz*/
288289
@@ -299,6 +300,8 @@ struct smu10_hwmgr { · 10 unmodified lines
299300 bool need_min_deep_sleep_dcefclk;
300301 uint32_t deep_sleep_dcefclk;
301302 uint32_t num_active_display;
303+
304+ bool fine_grain_enabled;
302305 };
303306
304307 struct pp_hwmgr;
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c+2−7
@@ -2151,19 +2151,14 @@ int smu_get_fan_speed_percent(struct smu_context *smu, uint32_t *speed) · 2150 unmodified lines
21512151 int smu_set_fan_speed_percent(struct smu_context *smu, uint32_t speed)
21522152 {
21532153 int ret = 0;
2154− uint32_t rpm;
21552154
21562155 if (!smu->pm_enabled || !smu->adev->pm.dpm_enabled)
21572156 return -EOPNOTSUPP;
21582157
21592158 mutex_lock(&smu->mutex);
21602159
2161− if (smu->ppt_funcs->set_fan_speed_rpm) {
2162− if (speed > 100)
2163− speed = 100;
2164− rpm = speed * smu->fan_max_rpm / 100;
2165− ret = smu->ppt_funcs->set_fan_speed_rpm(smu, rpm);
2166− }
2160+ if (smu->ppt_funcs->set_fan_speed_percent)
2161+ ret = smu->ppt_funcs->set_fan_speed_percent(smu, speed);
21672162
21682163 mutex_unlock(&smu->mutex);
21692164
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c+1−0
@@ -2326,6 +2326,7 @@ static const struct pptable_funcs arcturus_ppt_funcs = { · 2325 unmodified lines
23262326 .display_clock_voltage_request = smu_v11_0_display_clock_voltage_request,
23272327 .get_fan_control_mode = smu_v11_0_get_fan_control_mode,
23282328 .set_fan_control_mode = smu_v11_0_set_fan_control_mode,
2329+ .set_fan_speed_percent = smu_v11_0_set_fan_speed_percent,
23292330 .set_fan_speed_rpm = smu_v11_0_set_fan_speed_rpm,
23302331 .set_xgmi_pstate = smu_v11_0_set_xgmi_pstate,
23312332 .gfx_off_control = smu_v11_0_gfx_off_control,
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c+1−0
@@ -2456,6 +2456,7 @@ static const struct pptable_funcs navi10_ppt_funcs = { · 2455 unmodified lines
24562456 .display_clock_voltage_request = smu_v11_0_display_clock_voltage_request,
24572457 .get_fan_control_mode = smu_v11_0_get_fan_control_mode,
24582458 .set_fan_control_mode = smu_v11_0_set_fan_control_mode,
2459+ .set_fan_speed_percent = smu_v11_0_set_fan_speed_percent,
24592460 .set_fan_speed_rpm = smu_v11_0_set_fan_speed_rpm,
24602461 .set_xgmi_pstate = smu_v11_0_set_xgmi_pstate,
24612462 .gfx_off_control = smu_v11_0_gfx_off_control,
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c+2−1
@@ -2372,7 +2372,7 @@ static void sienna_cichlid_fill_i2c_req(SwI2cRequest_t *req, bool write, · 2371 unmodified lines
23722372 {
23732373 int i;
23742374
2375− req->I2CcontrollerPort = 0;
2375+ req->I2CcontrollerPort = 1;
23762376 req->I2CSpeed = 2;
23772377 req->SlaveAddress = address;
23782378 req->NumCmds = numbytes;
@@ -2802,6 +2802,7 @@ static const struct pptable_funcs sienna_cichlid_ppt_funcs = { · 423 unmodified lines
28022802 .display_clock_voltage_request = smu_v11_0_display_clock_voltage_request,
28032803 .get_fan_control_mode = smu_v11_0_get_fan_control_mode,
28042804 .set_fan_control_mode = smu_v11_0_set_fan_control_mode,
2805+ .set_fan_speed_percent = smu_v11_0_set_fan_speed_percent,
28052806 .set_fan_speed_rpm = smu_v11_0_set_fan_speed_rpm,
28062807 .set_xgmi_pstate = smu_v11_0_set_xgmi_pstate,
28072808 .gfx_off_control = smu_v11_0_gfx_off_control,
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c+30−1
@@ -1173,6 +1173,35 @@ smu_v11_0_set_fan_static_mode(struct smu_context *smu, uint32_t mode) · 1172 unmodified lines
11731173 return 0;
11741174 }
11751175
1176+int
1177+smu_v11_0_set_fan_speed_percent(struct smu_context *smu, uint32_t speed)
1178+{
1179+ struct amdgpu_device *adev = smu->adev;
1180+ uint32_t duty100, duty;
1181+ uint64_t tmp64;
1182+
1183+ if (speed > 100)
1184+ speed = 100;
1185+
1186+ if (smu_v11_0_auto_fan_control(smu, 0))
1187+ return -EINVAL;
1188+
1189+ duty100 = REG_GET_FIELD(RREG32_SOC15(THM, 0, mmCG_FDO_CTRL1),
1190+ CG_FDO_CTRL1, FMAX_DUTY100);
1191+ if (!duty100)
1192+ return -EINVAL;
1193+
1194+ tmp64 = (uint64_t)speed * duty100;
1195+ do_div(tmp64, 100);
1196+ duty = (uint32_t)tmp64;
1197+
1198+ WREG32_SOC15(THM, 0, mmCG_FDO_CTRL0,
1199+ REG_SET_FIELD(RREG32_SOC15(THM, 0, mmCG_FDO_CTRL0),
1200+ CG_FDO_CTRL0, FDO_STATIC_DUTY, duty));
1201+
1202+ return smu_v11_0_set_fan_static_mode(smu, FDO_PWM_MODE_STATIC);
1203+}
1204+
11761205 int
11771206 smu_v11_0_set_fan_control_mode(struct smu_context *smu,
11781207 uint32_t mode)
@@ -1181,7 +1210,7 @@ smu_v11_0_set_fan_control_mode(struct smu_context *smu, · 2 unmodified lines
11811210
11821211 switch (mode) {
11831212 case AMD_FAN_CTRL_NONE:
1184− ret = smu_v11_0_set_fan_speed_rpm(smu, smu->fan_max_rpm);
1213+ ret = smu_v11_0_set_fan_speed_percent(smu, 100);
11851214 break;
11861215 case AMD_FAN_CTRL_MANUAL:
11871216 ret = smu_v11_0_auto_fan_control(smu, 0);
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c+5−1
@@ -252,7 +252,8 @@ static int vangogh_get_smu_metrics_data(struct smu_context *smu, · 251 unmodified lines
252252 *value = metrics->UvdActivity;
253253 break;
254254 case METRICS_AVERAGE_SOCKETPOWER:
255− *value = metrics->CurrentSocketPower;
255+ *value = (metrics->CurrentSocketPower << 8) /
256+ 1000 ;
256257 break;
257258 case METRICS_TEMPERATURE_EDGE:
258259 *value = metrics->GfxTemperature / 100 *
@@ -590,14 +591,17 @@ static ssize_t vangogh_get_gpu_metrics(struct smu_context *smu, · 331 unmodified lines
590591 gpu_metrics->average_socket_power = metrics.CurrentSocketPower;
591592 gpu_metrics->average_cpu_power = metrics.Power[0];
592593 gpu_metrics->average_soc_power = metrics.Power[1];
594+ gpu_metrics->average_gfx_power = metrics.Power[2];
593595 memcpy(&gpu_metrics->average_core_power[0],
594596 &metrics.CorePower[0],
595597 sizeof(uint16_t) * 8);
596598
597599 gpu_metrics->average_gfxclk_frequency = metrics.GfxclkFrequency;
598600 gpu_metrics->average_socclk_frequency = metrics.SocclkFrequency;
601+ gpu_metrics->average_uclk_frequency = metrics.MemclkFrequency;
599602 gpu_metrics->average_fclk_frequency = metrics.MemclkFrequency;
600603 gpu_metrics->average_vclk_frequency = metrics.VclkFrequency;
604+ gpu_metrics->average_dclk_frequency = metrics.DclkFrequency;
601605
602606 memcpy(&gpu_metrics->current_coreclk[0],
603607 &metrics.CoreFrequency[0],
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c+2−1
@@ -188,6 +188,7 @@ static int renoir_get_dpm_clk_limited(struct smu_context *smu, enum smu_clk_type · 187 unmodified lines
188188 return -EINVAL;
189189 *freq = clk_table->SocClocks[dpm_level].Freq;
190190 break;
191+ case SMU_UCLK:
191192 case SMU_MCLK:
192193 if (dpm_level >= NUM_FCLK_DPM_LEVELS)
193194 return -EINVAL;
@@ -1120,7 +1121,7 @@ static ssize_t renoir_get_gpu_metrics(struct smu_context *smu, · 926 unmodified lines
11201121 static int renoir_gfx_state_change_set(struct smu_context *smu, uint32_t state)
11211122 {
11221123
1123− return smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GpuChangeState, state, NULL);
1124+ return 0;
11241125 }
11251126
11261127 static const struct pptable_funcs renoir_ppt_funcs = {
drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c+1−0
@@ -225,6 +225,7 @@ int smu_v12_0_set_soft_freq_limited_range(struct smu_context *smu, enum smu_clk_ · 224 unmodified lines
225225 break;
226226 case SMU_FCLK:
227227 case SMU_MCLK:
228+ case SMU_UCLK:
228229 ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetHardMinFclkByFreq, min, NULL);
229230 if (ret)
230231 return ret;
drivers/gpu/drm/bridge/lontium-lt9611uxc.c+45−12
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <linux/regmap.h>
1515 #include <linux/regulator/consumer.h>
1616 #include <linux/wait.h>
17+#include <linux/workqueue.h>
1718
1819 #include <sound/hdmi-codec.h>
1920
@@ -36,6 +37,7 @@ struct lt9611uxc { · 16 unmodified lines
3637 struct mutex ocm_lock;
3738
3839 struct wait_queue_head wq;
40+ struct work_struct work;
3941
4042 struct device_node *dsi0_node;
4143 struct device_node *dsi1_node;
@@ -52,6 +54,8 @@ struct lt9611uxc { · 10 unmodified lines
5254
5355 bool hpd_supported;
5456 bool edid_read;
57+ /* can be accessed from different threads, so protect this with ocm_lock */
58+ bool hdmi_connected;
5559 uint8_t fw_version;
5660 };
5761
@@ -143,21 +147,41 @@ static irqreturn_t lt9611uxc_irq_thread_handler(int irq, void *dev_id) · 85 unmodified lines
143147 if (irq_status)
144148 regmap_write(lt9611uxc->regmap, 0xb022, 0);
145149
146− lt9611uxc_unlock(lt9611uxc);
147−
148− if (irq_status & BIT(0))
150+ if (irq_status & BIT(0)) {
149151 lt9611uxc->edid_read = !!(hpd_status & BIT(0));
152+ wake_up_all(&lt9611uxc->wq);
153+ }
150154
151155 if (irq_status & BIT(1)) {
152− if (lt9611uxc->connector.dev)
153− drm_kms_helper_hotplug_event(lt9611uxc->connector.dev);
154− else
155− drm_bridge_hpd_notify(&lt9611uxc->bridge, !!(hpd_status & BIT(1)));
156+ lt9611uxc->hdmi_connected = hpd_status & BIT(1);
157+ schedule_work(&lt9611uxc->work);
156158 }
157159
160+ lt9611uxc_unlock(lt9611uxc);
161+
158162 return IRQ_HANDLED;
159163 }
160164
165+static void lt9611uxc_hpd_work(struct work_struct *work)
166+{
167+ struct lt9611uxc *lt9611uxc = container_of(work, struct lt9611uxc, work);
168+ bool connected;
169+
170+ if (lt9611uxc->connector.dev)
171+ drm_kms_helper_hotplug_event(lt9611uxc->connector.dev);
172+ else {
173+
174+ mutex_lock(&lt9611uxc->ocm_lock);
175+ connected = lt9611uxc->hdmi_connected;
176+ mutex_unlock(&lt9611uxc->ocm_lock);
177+
178+ drm_bridge_hpd_notify(&lt9611uxc->bridge,
179+ connected ?
180+ connector_status_connected :
181+ connector_status_disconnected);
182+ }
183+}
184+
161185 static void lt9611uxc_reset(struct lt9611uxc *lt9611uxc)
162186 {
163187 gpiod_set_value_cansleep(lt9611uxc->reset_gpio, 1);
@@ -445,18 +469,21 @@ static enum drm_connector_status lt9611uxc_bridge_detect(struct drm_bridge *brid · 281 unmodified lines
445469 struct lt9611uxc *lt9611uxc = bridge_to_lt9611uxc(bridge);
446470 unsigned int reg_val = 0;
447471 int ret;
448− int connected = 1;
472+ bool connected = true;
473+
474+ lt9611uxc_lock(lt9611uxc);
449475
450476 if (lt9611uxc->hpd_supported) {
451− lt9611uxc_lock(lt9611uxc);
452477 ret = regmap_read(lt9611uxc->regmap, 0xb023, &reg_val);
453− lt9611uxc_unlock(lt9611uxc);
454478
455479 if (ret)
456480 dev_err(lt9611uxc->dev, "failed to read hpd status: %d\n", ret);
457481 else
458482 connected = reg_val & BIT(1);
459483 }
484+ lt9611uxc->hdmi_connected = connected;
485+
486+ lt9611uxc_unlock(lt9611uxc);
460487
461488 return connected ? connector_status_connected :
462489 connector_status_disconnected;
@@ -465,7 +492,7 @@ static enum drm_connector_status lt9611uxc_bridge_detect(struct drm_bridge *brid · 2 unmodified lines
465492 static int lt9611uxc_wait_for_edid(struct lt9611uxc *lt9611uxc)
466493 {
467494 return wait_event_interruptible_timeout(lt9611uxc->wq, lt9611uxc->edid_read,
468− msecs_to_jiffies(100));
495+ msecs_to_jiffies(500));
469496 }
470497
471498 static int lt9611uxc_get_edid_block(void *data, u8 *buf, unsigned int block, size_t len)
@@ -503,7 +530,10 @@ static struct edid *lt9611uxc_bridge_get_edid(struct drm_bridge *bridge, · 31 unmodified lines
503530 ret = lt9611uxc_wait_for_edid(lt9611uxc);
504531 if (ret < 0) {
505532 dev_err(lt9611uxc->dev, "wait for EDID failed: %d\n", ret);
506− return ERR_PTR(ret);
533+ return NULL;
534+ } else if (ret == 0) {
535+ dev_err(lt9611uxc->dev, "wait for EDID timeout\n");
536+ return NULL;
507537 }
508538
509539 return drm_do_get_edid(connector, lt9611uxc_get_edid_block, lt9611uxc);
@@ -926,6 +956,8 @@ retry: · 416 unmodified lines
926956 lt9611uxc->fw_version = ret;
927957
928958 init_waitqueue_head(&lt9611uxc->wq);
959+ INIT_WORK(&lt9611uxc->work, lt9611uxc_hpd_work);
960+
929961 ret = devm_request_threaded_irq(dev, client->irq, NULL,
930962 lt9611uxc_irq_thread_handler,
931963 IRQF_ONESHOT, "lt9611uxc", lt9611uxc);
@@ -962,6 +994,7 @@ static int lt9611uxc_remove(struct i2c_client *client) · 30 unmodified lines
962994 struct lt9611uxc *lt9611uxc = i2c_get_clientdata(client);
963995
964996 disable_irq(client->irq);
997+ flush_scheduled_work();
965998 lt9611uxc_audio_exit(lt9611uxc);
966999 drm_bridge_remove(&lt9611uxc->bridge);
9671000
drivers/gpu/drm/drm_atomic_helper.c+1−1
@@ -3021,7 +3021,7 @@ int drm_atomic_helper_set_config(struct drm_mode_set *set, · 3020 unmodified lines
30213021
30223022 ret = handle_conflicting_encoders(state, true);
30233023 if (ret)
3024− return ret;
3024+ goto fail;
30253025
30263026 ret = drm_atomic_commit(state);
30273027
drivers/gpu/drm/drm_dp_mst_topology.c+19−6
@@ -3629,14 +3629,26 @@ static int drm_dp_send_up_ack_reply(struct drm_dp_mst_topology_mgr *mgr, · 3628 unmodified lines
36293629 return 0;
36303630 }
36313631
3632−static int drm_dp_get_vc_payload_bw(u8 dp_link_bw, u8 dp_link_count)
3632+/**
3633+ * drm_dp_get_vc_payload_bw - get the VC payload BW for an MST link
3634+ * @link_rate: link rate in 10kbits/s units
3635+ * @link_lane_count: lane count
3636+ *
3637+ * Calculate the total bandwidth of a MultiStream Transport link. The returned
3638+ * value is in units of PBNs/(timeslots/1 MTP). This value can be used to
3639+ * convert the number of PBNs required for a given stream to the number of
3640+ * timeslots this stream requires in each MTP.
3641+ */
3642+int drm_dp_get_vc_payload_bw(int link_rate, int link_lane_count)
36333643 {
3634− if (dp_link_bw == 0 || dp_link_count == 0)
3635− DRM_DEBUG_KMS("invalid link bandwidth in DPCD: %x (link count: %d)\n",
3636− dp_link_bw, dp_link_count);
3644+ if (link_rate == 0 || link_lane_count == 0)
3645+ DRM_DEBUG_KMS("invalid link rate/lane count: (%d / %d)\n",
3646+ link_rate, link_lane_count);
36373647
3638− return dp_link_bw * dp_link_count / 2;
3648+ /* See DP v2.0 2.6.4.2, VCPayload_Bandwidth_for_OneTimeSlotPer_MTP_Allocation */
3649+ return link_rate * link_lane_count / 54000;
36393650 }
3651+EXPORT_SYMBOL(drm_dp_get_vc_payload_bw);
36403652
36413653 /**
36423654 * drm_dp_read_mst_cap() - check whether or not a sink supports MST
@@ -3692,7 +3704,7 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms · 49 unmodified lines
36923704 goto out_unlock;
36933705 }
36943706
3695− mgr->pbn_div = drm_dp_get_vc_payload_bw(mgr->dpcd[1],
3707+ mgr->pbn_div = drm_dp_get_vc_payload_bw(drm_dp_bw_code_to_link_rate(mgr->dpcd[1]),
36963708 mgr->dpcd[2] & DP_MAX_LANE_COUNT_MASK);
36973709 if (mgr->pbn_div == 0) {
36983710 ret = -EINVAL;
@@ -4212,6 +4224,7 @@ drm_dp_mst_detect_port(struct drm_connector *connector, · 513 unmodified lines
42124224
42134225 switch (port->pdt) {
42144226 case DP_PEER_DEVICE_NONE:
4227+ break;
42154228 case DP_PEER_DEVICE_MST_BRANCHING:
42164229 if (!port->mcs)
42174230 ret = connector_status_connected;
drivers/gpu/drm/drm_gem_vram_helper.c+11−3
@@ -387,9 +387,16 @@ static int drm_gem_vram_kmap_locked(struct drm_gem_vram_object *gbo, · 386 unmodified lines
387387 if (gbo->vmap_use_count > 0)
388388 goto out;
389389
390− ret = ttm_bo_vmap(&gbo->bo, &gbo->map);
391− if (ret)
392− return ret;
390+ /*
391+ * VRAM helpers unmap the BO only on demand. So the previous
392+ * page mapping might still be around. Only vmap if the there's
393+ * no mapping present.
394+ */
395+ if (dma_buf_map_is_null(&gbo->map)) {
396+ ret = ttm_bo_vmap(&gbo->bo, &gbo->map);
397+ if (ret)
398+ return ret;
399+ }
393400
394401 out:
395402 ++gbo->vmap_use_count;
@@ -577,6 +584,7 @@ static void drm_gem_vram_bo_driver_move_notify(struct drm_gem_vram_object *gbo, · 181 unmodified lines
577584 return;
578585
579586 ttm_bo_vunmap(bo, &gbo->map);
587+ dma_buf_map_clear(&gbo->map); /* explicitly clear mapping for next vmap call */
580588 }
581589
582590 static int drm_gem_vram_bo_driver_move(struct drm_gem_vram_object *gbo,
drivers/gpu/drm/drm_plane.c+8−1
@@ -1163,7 +1163,14 @@ retry: · 1162 unmodified lines
11631163 if (ret)
11641164 goto out;
11651165
1166− if (old_fb->format != fb->format) {
1166+ /*
1167+ * Only check the FOURCC format code, excluding modifiers. This is
1168+ * enough for all legacy drivers. Atomic drivers have their own
1169+ * checks in their ->atomic_check implementation, which will
1170+ * return -EINVAL if any hw or driver constraint is violated due
1171+ * to modifier changes.
1172+ */
1173+ if (old_fb->format->format != fb->format->format) {
11671174 DRM_DEBUG_KMS("Page flip is not allowed to change frame buffer format.\n");
11681175 ret = -EINVAL;
11691176 goto out;
drivers/gpu/drm/drm_syncobj.c+5−3
@@ -388,19 +388,18 @@ int drm_syncobj_find_fence(struct drm_file *file_private, · 387 unmodified lines
388388 return -ENOENT;
389389
390390 *fence = drm_syncobj_fence_get(syncobj);
391− drm_syncobj_put(syncobj);
392391
393392 if (*fence) {
394393 ret = dma_fence_chain_find_seqno(fence, point);
395394 if (!ret)
396− return 0;
395+ goto out;
397396 dma_fence_put(*fence);
398397 } else {
399398 ret = -EINVAL;
400399 }
401400
402401 if (!(flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT))
403− return ret;
402+ goto out;
404403
405404 memset(&wait, 0, sizeof(wait));
406405 wait.task = current;
@@ -432,6 +431,9 @@ int drm_syncobj_find_fence(struct drm_file *file_private, · 25 unmodified lines
432431 if (wait.node.next)
433432 drm_syncobj_remove_wait(syncobj, &wait);
434433
434+out:
435+ drm_syncobj_put(syncobj);
436+
435437 return ret;
436438 }
437439 EXPORT_SYMBOL(drm_syncobj_find_fence);
drivers/gpu/drm/i915/Makefile+1−0
@@ -38,6 +38,7 @@ i915-y += i915_drv.o \ · 37 unmodified lines
3838 i915_config.o \
3939 i915_irq.o \
4040 i915_getparam.o \
41+ i915_mitigations.o \
4142 i915_params.o \
4243 i915_pci.o \
4344 i915_scatterlist.o \
drivers/gpu/drm/i915/display/icl_dsi.c+0−4
@@ -1616,10 +1616,6 @@ static void gen11_dsi_get_power_domains(struct intel_encoder *encoder, · 1615 unmodified lines
16161616
16171617 get_dsi_io_power_domains(i915,
16181618 enc_to_intel_dsi(encoder));
1619−
1620− if (crtc_state->dsc.compression_enable)
1621− intel_display_power_get(i915,
1622− intel_dsc_power_domain(crtc_state));
16231619 }
16241620
16251621 static bool gen11_dsi_get_hw_state(struct intel_encoder *encoder,
drivers/gpu/drm/i915/display/intel_ddi.c+31−21
@@ -2754,13 +2754,15 @@ static void icl_mg_phy_ddi_vswing_sequence(struct intel_encoder *encoder, · 2753 unmodified lines
27542754 int n_entries, ln;
27552755 u32 val;
27562756
2757+ if (enc_to_dig_port(encoder)->tc_mode == TC_PORT_TBT_ALT)
2758+ return;
2759+
27572760 ddi_translations = icl_get_mg_buf_trans(encoder, crtc_state, &n_entries);
2758− /* The table does not have values for level 3 and level 9. */
2759− if (level >= n_entries || level == 3 || level == 9) {
2761+ if (level >= n_entries) {
27602762 drm_dbg_kms(&dev_priv->drm,
27612763 "DDI translation not found for level %d. Using %d instead.",
2762− level, n_entries - 2);
2763− level = n_entries - 2;
2764+ level, n_entries - 1);
2765+ level = n_entries - 1;
27642766 }
27652767
27662768 /* Set MG_TX_LINK_PARAMS cri_use_fs32 to 0. */
@@ -2891,6 +2893,9 @@ tgl_dkl_phy_ddi_vswing_sequence(struct intel_encoder *encoder, · 124 unmodified lines
28912893 u32 val, dpcnt_mask, dpcnt_val;
28922894 int n_entries, ln;
28932895
2896+ if (enc_to_dig_port(encoder)->tc_mode == TC_PORT_TBT_ALT)
2897+ return;
2898+
28942899 ddi_translations = tgl_get_dkl_buf_trans(encoder, crtc_state, &n_entries);
28952900
28962901 if (level >= n_entries)
@@ -3532,6 +3537,23 @@ static void intel_ddi_disable_fec_state(struct intel_encoder *encoder, · 635 unmodified lines
35323537 intel_de_posting_read(dev_priv, dp_tp_ctl_reg(encoder, crtc_state));
35333538 }
35343539
3540+static void intel_ddi_power_up_lanes(struct intel_encoder *encoder,
3541+ const struct intel_crtc_state *crtc_state)
3542+{
3543+ struct drm_i915_private *i915 = to_i915(encoder->base.dev);
3544+ struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
3545+ enum phy phy = intel_port_to_phy(i915, encoder->port);
3546+
3547+ if (intel_phy_is_combo(i915, phy)) {
3548+ bool lane_reversal =
3549+ dig_port->saved_port_bits & DDI_BUF_PORT_REVERSAL;
3550+
3551+ intel_combo_phy_power_up_lanes(i915, phy, false,
3552+ crtc_state->lane_count,
3553+ lane_reversal);
3554+ }
3555+}
3556+
35353557 static void tgl_ddi_pre_enable_dp(struct intel_atomic_state *state,
35363558 struct intel_encoder *encoder,
35373559 const struct intel_crtc_state *crtc_state,
@@ -3621,14 +3643,7 @@ static void tgl_ddi_pre_enable_dp(struct intel_atomic_state *state, · 83 unmodified lines
36213643 * 7.f Combo PHY: Configure PORT_CL_DW10 Static Power Down to power up
36223644 * the used lanes of the DDI.
36233645 */
3624− if (intel_phy_is_combo(dev_priv, phy)) {
3625− bool lane_reversal =
3626− dig_port->saved_port_bits & DDI_BUF_PORT_REVERSAL;
3627−
3628− intel_combo_phy_power_up_lanes(dev_priv, phy, false,
3629− crtc_state->lane_count,
3630− lane_reversal);
3631− }
3646+ intel_ddi_power_up_lanes(encoder, crtc_state);
36323647
36333648 /*
36343649 * 7.g Configure and enable DDI_BUF_CTL
@@ -3713,19 +3728,12 @@ static void hsw_ddi_pre_enable_dp(struct intel_atomic_state *state, · 78 unmodified lines
37133728 else
37143729 intel_prepare_dp_ddi_buffers(encoder, crtc_state);
37153730
3716− if (intel_phy_is_combo(dev_priv, phy)) {
3717− bool lane_reversal =
3718− dig_port->saved_port_bits & DDI_BUF_PORT_REVERSAL;
3719−
3720− intel_combo_phy_power_up_lanes(dev_priv, phy, false,
3721− crtc_state->lane_count,
3722− lane_reversal);
3723− }
3731+ intel_ddi_power_up_lanes(encoder, crtc_state);
37243732
37253733 intel_ddi_init_dp_buf_reg(encoder, crtc_state);
37263734 if (!is_mst)
37273735 intel_dp_set_power(intel_dp, DP_SET_POWER_D0);
3728− intel_dp_configure_protocol_converter(intel_dp);
3736+ intel_dp_configure_protocol_converter(intel_dp, crtc_state);
37293737 intel_dp_sink_set_decompression_state(intel_dp, crtc_state,
37303738 true);
37313739 intel_dp_sink_set_fec_ready(intel_dp, crtc_state);
@@ -4206,6 +4214,8 @@ static void intel_enable_ddi_hdmi(struct intel_atomic_state *state, · 474 unmodified lines
42064214 intel_de_write(dev_priv, reg, val);
42074215 }
42084216
4217+ intel_ddi_power_up_lanes(encoder, crtc_state);
4218+
42094219 /* In HDMI/DVI mode, the port width, and swing/emphasis values
42104220 * are ignored so nothing special needs to be done besides
42114221 * enabling the port.
drivers/gpu/drm/i915/display/intel_display.c+4−5
@@ -2309,7 +2309,7 @@ intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb, · 2308 unmodified lines
23092309 */
23102310 ret = i915_vma_pin_fence(vma);
23112311 if (ret != 0 && INTEL_GEN(dev_priv) < 4) {
2312− i915_gem_object_unpin_from_display_plane(vma);
2312+ i915_vma_unpin(vma);
23132313 vma = ERR_PTR(ret);
23142314 goto err;
23152315 }
@@ -2327,12 +2327,9 @@ err: · 11 unmodified lines
23272327
23282328 void intel_unpin_fb_vma(struct i915_vma *vma, unsigned long flags)
23292329 {
2330− i915_gem_object_lock(vma->obj, NULL);
23312330 if (flags & PLANE_HAS_FENCE)
23322331 i915_vma_unpin_fence(vma);
2333− i915_gem_object_unpin_from_display_plane(vma);
2334− i915_gem_object_unlock(vma->obj);
2335−
2332+ i915_vma_unpin(vma);
23362333 i915_vma_put(vma);
23372334 }
23382335
@@ -4807,6 +4804,8 @@ u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state, · 2468 unmodified lines
48074804 plane_color_ctl |= PLANE_COLOR_YUV_RANGE_CORRECTION_DISABLE;
48084805 } else if (fb->format->is_yuv) {
48094806 plane_color_ctl |= PLANE_COLOR_INPUT_CSC_ENABLE;
4807+ if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
4808+ plane_color_ctl |= PLANE_COLOR_YUV_RANGE_CORRECTION_DISABLE;
48104809 }
48114810
48124811 return plane_color_ctl;
drivers/gpu/drm/i915/display/intel_display_types.h+3−0
@@ -1436,6 +1436,9 @@ struct intel_dp { · 1435 unmodified lines
14361436 bool ycbcr_444_to_420;
14371437 } dfp;
14381438
1439+ /* To control wakeup latency, e.g. for irq-driven dp aux transfers. */
1440+ struct pm_qos_request pm_qos;
1441+
14391442 /* Display stream compression testing */
14401443 bool force_dsc_en;
14411444
drivers/gpu/drm/i915/display/intel_dp.c+12−25
@@ -1489,7 +1489,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp, · 1488 unmodified lines
14891489 * lowest possible wakeup latency and so prevent the cpu from going into
14901490 * deep sleep states.
14911491 */
1492− cpu_latency_qos_update_request(&i915->pm_qos, 0);
1492+ cpu_latency_qos_update_request(&intel_dp->pm_qos, 0);
14931493
14941494 intel_dp_check_edp(intel_dp);
14951495
@@ -1622,7 +1622,7 @@ done: · 126 unmodified lines
16221622
16231623 ret = recv_bytes;
16241624 out:
1625− cpu_latency_qos_update_request(&i915->pm_qos, PM_QOS_DEFAULT_VALUE);
1625+ cpu_latency_qos_update_request(&intel_dp->pm_qos, PM_QOS_DEFAULT_VALUE);
16261626
16271627 if (vdd)
16281628 edp_panel_vdd_off(intel_dp, false);
@@ -1898,6 +1898,9 @@ static i915_reg_t tgl_aux_data_reg(struct intel_dp *intel_dp, int index) · 269 unmodified lines
18981898 static void
18991899 intel_dp_aux_fini(struct intel_dp *intel_dp)
19001900 {
1901+ if (cpu_latency_qos_request_active(&intel_dp->pm_qos))
1902+ cpu_latency_qos_remove_request(&intel_dp->pm_qos);
1903+
19011904 kfree(intel_dp->aux.name);
19021905 }
19031906
@@ -1950,6 +1953,7 @@ intel_dp_aux_init(struct intel_dp *intel_dp) · 46 unmodified lines
19501953 encoder->base.name);
19511954
19521955 intel_dp->aux.transfer = intel_dp_aux_transfer;
1956+ cpu_latency_qos_add_request(&intel_dp->pm_qos, PM_QOS_DEFAULT_VALUE);
19531957 }
19541958
19551959 bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp)
@@ -4010,7 +4014,8 @@ static void intel_dp_enable_port(struct intel_dp *intel_dp, · 2054 unmodified lines
40104014 intel_de_posting_read(dev_priv, intel_dp->output_reg);
40114015 }
40124016
4013−void intel_dp_configure_protocol_converter(struct intel_dp *intel_dp)
4017+void intel_dp_configure_protocol_converter(struct intel_dp *intel_dp,
4018+ const struct intel_crtc_state *crtc_state)
40144019 {
40154020 struct drm_i915_private *i915 = dp_to_i915(intel_dp);
40164021 u8 tmp;
@@ -4029,8 +4034,8 @@ void intel_dp_configure_protocol_converter(struct intel_dp *intel_dp) · 12 unmodified lines
40294034 drm_dbg_kms(&i915->drm, "Failed to set protocol converter HDMI mode to %s\n",
40304035 enableddisabled(intel_dp->has_hdmi_sink));
40314036
4032− tmp = intel_dp->dfp.ycbcr_444_to_420 ?
4033− DP_CONVERSION_TO_YCBCR420_ENABLE : 0;
4037+ tmp = crtc_state->output_format == INTEL_OUTPUT_FORMAT_YCBCR444 &&
4038+ intel_dp->dfp.ycbcr_444_to_420 ? DP_CONVERSION_TO_YCBCR420_ENABLE : 0;
40344039
40354040 if (drm_dp_dpcd_writeb(&intel_dp->aux,
40364041 DP_PROTOCOL_CONVERTER_CONTROL_1, tmp) != 1)
@@ -4084,7 +4089,7 @@ static void intel_enable_dp(struct intel_atomic_state *state, · 47 unmodified lines
40844089 }
40854090
40864091 intel_dp_set_power(intel_dp, DP_SET_POWER_D0);
4087− intel_dp_configure_protocol_converter(intel_dp);
4092+ intel_dp_configure_protocol_converter(intel_dp, pipe_config);
40884093 intel_dp_start_link_train(intel_dp, pipe_config);
40894094 intel_dp_stop_link_train(intel_dp, pipe_config);
40904095
@@ -4632,24 +4637,6 @@ ivb_cpu_edp_set_signal_levels(struct intel_dp *intel_dp, · 541 unmodified lines
46324637 intel_de_posting_read(dev_priv, intel_dp->output_reg);
46334638 }
46344639
4635−void intel_dp_set_signal_levels(struct intel_dp *intel_dp,
4636− const struct intel_crtc_state *crtc_state)
4637−{
4638− struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
4639− u8 train_set = intel_dp->train_set[0];
4640−
4641− drm_dbg_kms(&dev_priv->drm, "Using vswing level %d%s\n",
4642− train_set & DP_TRAIN_VOLTAGE_SWING_MASK,
4643− train_set & DP_TRAIN_MAX_SWING_REACHED ? " (max)" : "");
4644− drm_dbg_kms(&dev_priv->drm, "Using pre-emphasis level %d%s\n",
4645− (train_set & DP_TRAIN_PRE_EMPHASIS_MASK) >>
4646− DP_TRAIN_PRE_EMPHASIS_SHIFT,
4647− train_set & DP_TRAIN_MAX_PRE_EMPHASIS_REACHED ?
4648− " (max)" : "");
4649−
4650− intel_dp->set_signal_levels(intel_dp, crtc_state);
4651−}
4652−
46534640 void
46544641 intel_dp_program_link_training_pattern(struct intel_dp *intel_dp,
46554642 const struct intel_crtc_state *crtc_state,
@@ -5698,7 +5685,7 @@ static void intel_dp_process_phy_request(struct intel_dp *intel_dp, · 1042 unmodified lines
56985685
56995686 intel_dp_autotest_phy_ddi_disable(intel_dp, crtc_state);
57005687
5701− intel_dp_set_signal_levels(intel_dp, crtc_state);
5688+ intel_dp_set_signal_levels(intel_dp, crtc_state, DP_PHY_DPRX);
57025689
57035690 intel_dp_phy_pattern_update(intel_dp, crtc_state);
57045691
drivers/gpu/drm/i915/display/intel_dp.h+2−4
@@ -51,7 +51,8 @@ int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp, · 50 unmodified lines
5151 int intel_dp_retrain_link(struct intel_encoder *encoder,
5252 struct drm_modeset_acquire_ctx *ctx);
5353 void intel_dp_set_power(struct intel_dp *intel_dp, u8 mode);
54−void intel_dp_configure_protocol_converter(struct intel_dp *intel_dp);
54+void intel_dp_configure_protocol_converter(struct intel_dp *intel_dp,
55+ const struct intel_crtc_state *crtc_state);
5556 void intel_dp_sink_set_decompression_state(struct intel_dp *intel_dp,
5657 const struct intel_crtc_state *crtc_state,
5758 bool enable);
@@ -95,9 +96,6 @@ void · 37 unmodified lines
9596 intel_dp_program_link_training_pattern(struct intel_dp *intel_dp,
9697 const struct intel_crtc_state *crtc_state,
9798 u8 dp_train_pat);
98−void
99−intel_dp_set_signal_levels(struct intel_dp *intel_dp,
100− const struct intel_crtc_state *crtc_state);
10199 void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock,
102100 u8 *link_bw, u8 *rate_select);
103101 bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp);
drivers/gpu/drm/i915/display/intel_dp_link_training.c+23−2
@@ -334,6 +334,27 @@ intel_dp_set_link_train(struct intel_dp *intel_dp, · 333 unmodified lines
334334 return drm_dp_dpcd_write(&intel_dp->aux, reg, buf, len) == len;
335335 }
336336
337+void intel_dp_set_signal_levels(struct intel_dp *intel_dp,
338+ const struct intel_crtc_state *crtc_state,
339+ enum drm_dp_phy dp_phy)
340+{
341+ struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
342+ u8 train_set = intel_dp->train_set[0];
343+ char phy_name[10];
344+
345+ drm_dbg_kms(&dev_priv->drm, "Using vswing level %d%s, pre-emphasis level %d%s, at %s\n",
346+ train_set & DP_TRAIN_VOLTAGE_SWING_MASK,
347+ train_set & DP_TRAIN_MAX_SWING_REACHED ? " (max)" : "",
348+ (train_set & DP_TRAIN_PRE_EMPHASIS_MASK) >>
349+ DP_TRAIN_PRE_EMPHASIS_SHIFT,
350+ train_set & DP_TRAIN_MAX_PRE_EMPHASIS_REACHED ?
351+ " (max)" : "",
352+ intel_dp_phy_name(dp_phy, phy_name, sizeof(phy_name)));
353+
354+ if (intel_dp_phy_is_downstream_of_source(intel_dp, dp_phy))
355+ intel_dp->set_signal_levels(intel_dp, crtc_state);
356+}
357+
337358 static bool
338359 intel_dp_reset_link_train(struct intel_dp *intel_dp,
339360 const struct intel_crtc_state *crtc_state,
@@ -341,7 +362,7 @@ intel_dp_reset_link_train(struct intel_dp *intel_dp, · 1 unmodified line
341362 u8 dp_train_pat)
342363 {
343364 memset(intel_dp->train_set, 0, sizeof(intel_dp->train_set));
344− intel_dp_set_signal_levels(intel_dp, crtc_state);
365+ intel_dp_set_signal_levels(intel_dp, crtc_state, dp_phy);
345366 return intel_dp_set_link_train(intel_dp, crtc_state, dp_phy, dp_train_pat);
346367 }
347368
@@ -355,7 +376,7 @@ intel_dp_update_link_train(struct intel_dp *intel_dp, · 7 unmodified lines
355376 DP_TRAINING_LANE0_SET_PHY_REPEATER(dp_phy);
356377 int ret;
357378
358− intel_dp_set_signal_levels(intel_dp, crtc_state);
379+ intel_dp_set_signal_levels(intel_dp, crtc_state, dp_phy);
359380
360381 ret = drm_dp_dpcd_write(&intel_dp->aux, reg,
361382 intel_dp->train_set, crtc_state->lane_count);
drivers/gpu/drm/i915/display/intel_dp_link_training.h+3−0
@@ -17,6 +17,9 @@ void intel_dp_get_adjust_train(struct intel_dp *intel_dp, · 16 unmodified lines
1717 const struct intel_crtc_state *crtc_state,
1818 enum drm_dp_phy dp_phy,
1919 const u8 link_status[DP_LINK_STATUS_SIZE]);
20+void intel_dp_set_signal_levels(struct intel_dp *intel_dp,
21+ const struct intel_crtc_state *crtc_state,
22+ enum drm_dp_phy dp_phy);
2023 void intel_dp_start_link_train(struct intel_dp *intel_dp,
2124 const struct intel_crtc_state *crtc_state);
2225 void intel_dp_stop_link_train(struct intel_dp *intel_dp,
drivers/gpu/drm/i915/display/intel_dp_mst.c+3−1
@@ -69,7 +69,9 @@ static int intel_dp_mst_compute_link_config(struct intel_encoder *encoder, · 68 unmodified lines
6969
7070 slots = drm_dp_atomic_find_vcpi_slots(state, &intel_dp->mst_mgr,
7171 connector->port,
72− crtc_state->pbn, 0);
72+ crtc_state->pbn,
73+ drm_dp_get_vc_payload_bw(crtc_state->port_clock,
74+ crtc_state->lane_count));
7375 if (slots == -EDEADLK)
7476 return slots;
7577 if (slots >= 0)
drivers/gpu/drm/i915/display/intel_hdcp.c+9−0
@@ -2210,6 +2210,7 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state, · 2209 unmodified lines
22102210 if (content_protection_type_changed) {
22112211 mutex_lock(&hdcp->mutex);
22122212 hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED;
2213+ drm_connector_get(&connector->base);
22132214 schedule_work(&hdcp->prop_work);
22142215 mutex_unlock(&hdcp->mutex);
22152216 }
@@ -2221,6 +2222,14 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state, · 5 unmodified lines
22212222 desired_and_not_enabled =
22222223 hdcp->value != DRM_MODE_CONTENT_PROTECTION_ENABLED;
22232224 mutex_unlock(&hdcp->mutex);
2225+ /*
2226+ * If HDCP already ENABLED and CP property is DESIRED, schedule
2227+ * prop_work to update correct CP property to user space.
2228+ */
2229+ if (!desired_and_not_enabled && !content_protection_type_changed) {
2230+ drm_connector_get(&connector->base);
2231+ schedule_work(&hdcp->prop_work);
2232+ }
22242233 }
22252234
22262235 if (desired_and_not_enabled || content_protection_type_changed)
drivers/gpu/drm/i915/display/intel_overlay.c+10−11
@@ -182,6 +182,7 @@ struct intel_overlay { · 181 unmodified lines
182182 struct intel_crtc *crtc;
183183 struct i915_vma *vma;
184184 struct i915_vma *old_vma;
185+ struct intel_frontbuffer *frontbuffer;
185186 bool active;
186187 bool pfit_active;
187188 u32 pfit_vscale_ratio; /* shifted-point number, (1<<12) == 1.0 */
@@ -282,21 +283,19 @@ static void intel_overlay_flip_prepare(struct intel_overlay *overlay, · 94 unmodified lines
282283 struct i915_vma *vma)
283284 {
284285 enum pipe pipe = overlay->crtc->pipe;
285− struct intel_frontbuffer *from = NULL, *to = NULL;
286+ struct intel_frontbuffer *frontbuffer = NULL;
286287
287288 drm_WARN_ON(&overlay->i915->drm, overlay->old_vma);
288289
289− if (overlay->vma)
290− from = intel_frontbuffer_get(overlay->vma->obj);
291290 if (vma)
292− to = intel_frontbuffer_get(vma->obj);
291+ frontbuffer = intel_frontbuffer_get(vma->obj);
293292
294− intel_frontbuffer_track(from, to, INTEL_FRONTBUFFER_OVERLAY(pipe));
293+ intel_frontbuffer_track(overlay->frontbuffer, frontbuffer,
294+ INTEL_FRONTBUFFER_OVERLAY(pipe));
295295
296− if (to)
297− intel_frontbuffer_put(to);
298− if (from)
299− intel_frontbuffer_put(from);
296+ if (overlay->frontbuffer)
297+ intel_frontbuffer_put(overlay->frontbuffer);
298+ overlay->frontbuffer = frontbuffer;
300299
301300 intel_frontbuffer_flip_prepare(overlay->i915,
302301 INTEL_FRONTBUFFER_OVERLAY(pipe));
@@ -359,7 +358,7 @@ static void intel_overlay_release_old_vma(struct intel_overlay *overlay) · 56 unmodified lines
359358 intel_frontbuffer_flip_complete(overlay->i915,
360359 INTEL_FRONTBUFFER_OVERLAY(overlay->crtc->pipe));
361360
362− i915_gem_object_unpin_from_display_plane(vma);
361+ i915_vma_unpin(vma);
363362 i915_vma_put(vma);
364363 }
365364
@@ -860,7 +859,7 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay, · 494 unmodified lines
860859 return 0;
861860
862861 out_unpin:
863− i915_gem_object_unpin_from_display_plane(vma);
862+ i915_vma_unpin(vma);
864863 out_pin_section:
865864 atomic_dec(&dev_priv->gpu_error.pending_fb_pin);
866865
drivers/gpu/drm/i915/display/intel_panel.c+5−4
@@ -1650,16 +1650,13 @@ static int lpt_setup_backlight(struct intel_connector *connector, enum pipe unus · 1649 unmodified lines
16501650 val = pch_get_backlight(connector);
16511651 else
16521652 val = lpt_get_backlight(connector);
1653− val = intel_panel_compute_brightness(connector, val);
1654− panel->backlight.level = clamp(val, panel->backlight.min,
1655− panel->backlight.max);
16561653
16571654 if (cpu_mode) {
16581655 drm_dbg_kms(&dev_priv->drm,
16591656 "CPU backlight register was enabled, switching to PCH override\n");
16601657
16611658 /* Write converted CPU PWM value to PCH override register */
1662− lpt_set_backlight(connector->base.state, panel->backlight.level);
1659+ lpt_set_backlight(connector->base.state, val);
16631660 intel_de_write(dev_priv, BLC_PWM_PCH_CTL1,
16641661 pch_ctl1 | BLM_PCH_OVERRIDE_ENABLE);
16651662
@@ -1667,6 +1664,10 @@ static int lpt_setup_backlight(struct intel_connector *connector, enum pipe unus · 1 unmodified line
16671664 cpu_ctl2 & ~BLM_PWM_ENABLE);
16681665 }
16691666
1667+ val = intel_panel_compute_brightness(connector, val);
1668+ panel->backlight.level = clamp(val, panel->backlight.min,
1669+ panel->backlight.max);
1670+
16701671 return 0;
16711672 }
16721673
drivers/gpu/drm/i915/display/intel_sprite.c+10−55
@@ -618,13 +618,19 @@ skl_program_scaler(struct intel_plane *plane, · 617 unmodified lines
618618
619619 /* Preoffset values for YUV to RGB Conversion */
620620 #define PREOFF_YUV_TO_RGB_HI 0x1800
621−#define PREOFF_YUV_TO_RGB_ME 0x1F00
621+#define PREOFF_YUV_TO_RGB_ME 0x0000
622622 #define PREOFF_YUV_TO_RGB_LO 0x1800
623623
624624 #define ROFF(x) (((x) & 0xffff) << 16)
625625 #define GOFF(x) (((x) & 0xffff) << 0)
626626 #define BOFF(x) (((x) & 0xffff) << 16)
627627
628+/*
629+ * Programs the input color space conversion stage for ICL HDR planes.
630+ * Note that it is assumed that this stage always happens after YUV
631+ * range correction. Thus, the input to this stage is assumed to be
632+ * in full-range YCbCr.
633+ */
628634 static void
629635 icl_program_input_csc(struct intel_plane *plane,
630636 const struct intel_crtc_state *crtc_state,
@@ -672,52 +678,7 @@ icl_program_input_csc(struct intel_plane *plane, · 41 unmodified lines
672678 0x0, 0x7800, 0x7F10,
673679 },
674680 };
675−
676− /* Matrix for Limited Range to Full Range Conversion */
677− static const u16 input_csc_matrix_lr[][9] = {
678− /*
679− * BT.601 Limted range YCbCr -> full range RGB
680− * The matrix required is :
681− * [1.164384, 0.000, 1.596027,
682− * 1.164384, -0.39175, -0.812813,
683− * 1.164384, 2.017232, 0.0000]
684− */
685− [DRM_COLOR_YCBCR_BT601] = {
686− 0x7CC8, 0x7950, 0x0,
687− 0x8D00, 0x7950, 0x9C88,
688− 0x0, 0x7950, 0x6810,
689− },
690− /*
691− * BT.709 Limited range YCbCr -> full range RGB
692− * The matrix required is :
693− * [1.164384, 0.000, 1.792741,
694− * 1.164384, -0.213249, -0.532909,
695− * 1.164384, 2.112402, 0.0000]
696− */
697− [DRM_COLOR_YCBCR_BT709] = {
698− 0x7E58, 0x7950, 0x0,
699− 0x8888, 0x7950, 0xADA8,
700− 0x0, 0x7950, 0x6870,
701− },
702− /*
703− * BT.2020 Limited range YCbCr -> full range RGB
704− * The matrix required is :
705− * [1.164, 0.000, 1.678,
706− * 1.164, -0.1873, -0.6504,
707− * 1.164, 2.1417, 0.0000]
708− */
709− [DRM_COLOR_YCBCR_BT2020] = {
710− 0x7D70, 0x7950, 0x0,
711− 0x8A68, 0x7950, 0xAC00,
712− 0x0, 0x7950, 0x6890,
713− },
714− };
715− const u16 *csc;
716−
717− if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
718− csc = input_csc_matrix[plane_state->hw.color_encoding];
719− else
720− csc = input_csc_matrix_lr[plane_state->hw.color_encoding];
681+ const u16 *csc = input_csc_matrix[plane_state->hw.color_encoding];
721682
722683 intel_de_write_fw(dev_priv, PLANE_INPUT_CSC_COEFF(pipe, plane_id, 0),
723684 ROFF(csc[0]) | GOFF(csc[1]));
@@ -734,14 +695,8 @@ icl_program_input_csc(struct intel_plane *plane, · 10 unmodified lines
734695
735696 intel_de_write_fw(dev_priv, PLANE_INPUT_CSC_PREOFF(pipe, plane_id, 0),
736697 PREOFF_YUV_TO_RGB_HI);
737− if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
738− intel_de_write_fw(dev_priv,
739− PLANE_INPUT_CSC_PREOFF(pipe, plane_id, 1),
740− 0);
741− else
742− intel_de_write_fw(dev_priv,
743− PLANE_INPUT_CSC_PREOFF(pipe, plane_id, 1),
744− PREOFF_YUV_TO_RGB_ME);
698+ intel_de_write_fw(dev_priv, PLANE_INPUT_CSC_PREOFF(pipe, plane_id, 1),
699+ PREOFF_YUV_TO_RGB_ME);
745700 intel_de_write_fw(dev_priv, PLANE_INPUT_CSC_PREOFF(pipe, plane_id, 2),
746701 PREOFF_YUV_TO_RGB_LO);
747702 intel_de_write_fw(dev_priv,
drivers/gpu/drm/i915/display/intel_tc.c+37−30
@@ -23,36 +23,6 @@ static const char *tc_port_mode_name(enum tc_port_mode mode) · 22 unmodified lines
2323 return names[mode];
2424 }
2525
26−static void
27−tc_port_load_fia_params(struct drm_i915_private *i915,
28− struct intel_digital_port *dig_port)
29−{
30− enum port port = dig_port->base.port;
31− enum tc_port tc_port = intel_port_to_tc(i915, port);
32− u32 modular_fia;
33−
34− if (INTEL_INFO(i915)->display.has_modular_fia) {
35− modular_fia = intel_uncore_read(&i915->uncore,
36− PORT_TX_DFLEXDPSP(FIA1));
37− drm_WARN_ON(&i915->drm, modular_fia == 0xffffffff);
38− modular_fia &= MODULAR_FIA_MASK;
39− } else {
40− modular_fia = 0;
41− }
42−
43− /*
44− * Each Modular FIA instance houses 2 TC ports. In SOC that has more
45− * than two TC ports, there are multiple instances of Modular FIA.
46− */
47− if (modular_fia) {
48− dig_port->tc_phy_fia = tc_port / 2;
49− dig_port->tc_phy_fia_idx = tc_port % 2;
50− } else {
51− dig_port->tc_phy_fia = FIA1;
52− dig_port->tc_phy_fia_idx = tc_port;
53− }
54−}
55−
5626 static enum intel_display_power_domain
5727 tc_cold_get_power_domain(struct intel_digital_port *dig_port)
5828 {
@@ -646,6 +616,43 @@ void intel_tc_port_put_link(struct intel_digital_port *dig_port) · 587 unmodified lines
646616 mutex_unlock(&dig_port->tc_lock);
647617 }
648618
619+static bool
620+tc_has_modular_fia(struct drm_i915_private *i915, struct intel_digital_port *dig_port)
621+{
622+ intel_wakeref_t wakeref;
623+ u32 val;
624+
625+ if (!INTEL_INFO(i915)->display.has_modular_fia)
626+ return false;
627+
628+ wakeref = tc_cold_block(dig_port);
629+ val = intel_uncore_read(&i915->uncore, PORT_TX_DFLEXDPSP(FIA1));
630+ tc_cold_unblock(dig_port, wakeref);
631+
632+ drm_WARN_ON(&i915->drm, val == 0xffffffff);
633+
634+ return val & MODULAR_FIA_MASK;
635+}
636+
637+static void
638+tc_port_load_fia_params(struct drm_i915_private *i915, struct intel_digital_port *dig_port)
639+{
640+ enum port port = dig_port->base.port;
641+ enum tc_port tc_port = intel_port_to_tc(i915, port);
642+
643+ /*
644+ * Each Modular FIA instance houses 2 TC ports. In SOC that has more
645+ * than two TC ports, there are multiple instances of Modular FIA.
646+ */
647+ if (tc_has_modular_fia(i915, dig_port)) {
648+ dig_port->tc_phy_fia = tc_port / 2;
649+ dig_port->tc_phy_fia_idx = tc_port % 2;
650+ } else {
651+ dig_port->tc_phy_fia = FIA1;
652+ dig_port->tc_phy_fia_idx = tc_port;
653+ }
654+}
655+
649656 void intel_tc_port_init(struct intel_digital_port *dig_port, bool is_legacy)
650657 {
651658 struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
drivers/gpu/drm/i915/display/vlv_dsi.c+13−3
@@ -812,10 +812,20 @@ static void intel_dsi_pre_enable(struct intel_atomic_state *state, · 811 unmodified lines
812812 intel_dsi_prepare(encoder, pipe_config);
813813
814814 intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_POWER_ON);
815− intel_dsi_msleep(intel_dsi, intel_dsi->panel_on_delay);
816815
817− /* Deassert reset */
818− intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DEASSERT_RESET);
816+ /*
817+ * Give the panel time to power-on and then deassert its reset.
818+ * Depending on the VBT MIPI sequences version the deassert-seq
819+ * may contain the necessary delay, intel_dsi_msleep() will skip
820+ * the delay in that case. If there is no deassert-seq, then an
821+ * unconditional msleep is used to give the panel time to power-on.
822+ */
823+ if (dev_priv->vbt.dsi.sequence[MIPI_SEQ_DEASSERT_RESET]) {
824+ intel_dsi_msleep(intel_dsi, intel_dsi->panel_on_delay);
825+ intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DEASSERT_RESET);
826+ } else {
827+ msleep(intel_dsi->panel_on_delay);
828+ }
819829
820830 if (IS_GEMINILAKE(dev_priv)) {
821831 glk_cold_boot = glk_dsi_enable_io(encoder);
drivers/gpu/drm/i915/gem/i915_gem_domain.c+0−45
@@ -387,48 +387,6 @@ err: · 386 unmodified lines
387387 return vma;
388388 }
389389
390−static void i915_gem_object_bump_inactive_ggtt(struct drm_i915_gem_object *obj)
391−{
392− struct drm_i915_private *i915 = to_i915(obj->base.dev);
393− struct i915_vma *vma;
394−
395− if (list_empty(&obj->vma.list))
396− return;
397−
398− mutex_lock(&i915->ggtt.vm.mutex);
399− spin_lock(&obj->vma.lock);
400− for_each_ggtt_vma(vma, obj) {
401− if (!drm_mm_node_allocated(&vma->node))
402− continue;
403−
404− GEM_BUG_ON(vma->vm != &i915->ggtt.vm);
405− list_move_tail(&vma->vm_link, &vma->vm->bound_list);
406− }
407− spin_unlock(&obj->vma.lock);
408− mutex_unlock(&i915->ggtt.vm.mutex);
409−
410− if (i915_gem_object_is_shrinkable(obj)) {
411− unsigned long flags;
412−
413− spin_lock_irqsave(&i915->mm.obj_lock, flags);
414−
415− if (obj->mm.madv == I915_MADV_WILLNEED &&
416− !atomic_read(&obj->mm.shrink_pin))
417− list_move_tail(&obj->mm.link, &i915->mm.shrink_list);
418−
419− spin_unlock_irqrestore(&i915->mm.obj_lock, flags);
420− }
421−}
422−
423−void
424−i915_gem_object_unpin_from_display_plane(struct i915_vma *vma)
425−{
426− /* Bump the LRU to try and avoid premature eviction whilst flipping */
427− i915_gem_object_bump_inactive_ggtt(vma->obj);
428−
429− i915_vma_unpin(vma);
430−}
431−
432390 /**
433391 * Moves a single object to the CPU read, and possibly write domain.
434392 * @obj: object to act on
@@ -569,9 +527,6 @@ i915_gem_set_domain_ioctl(struct drm_device *dev, void *data, · 134 unmodified lines
569527 else
570528 err = i915_gem_object_set_to_cpu_domain(obj, write_domain);
571529
572− /* And bump the LRU for this access */
573− i915_gem_object_bump_inactive_ggtt(obj);
574−
575530 i915_gem_object_unlock(obj);
576531
577532 if (write_domain)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c+3−1
@@ -1046,7 +1046,7 @@ static void reloc_gpu_flush(struct i915_execbuffer *eb, struct reloc_cache *cach · 1045 unmodified lines
10461046 GEM_BUG_ON(cache->rq_size >= obj->base.size / sizeof(u32));
10471047 cache->rq_cmd[cache->rq_size] = MI_BATCH_BUFFER_END;
10481048
1049− __i915_gem_object_flush_map(obj, 0, sizeof(u32) * (cache->rq_size + 1));
1049+ i915_gem_object_flush_map(obj);
10501050 i915_gem_object_unpin_map(obj);
10511051
10521052 intel_gt_chipset_flush(cache->rq->engine->gt);
@@ -1296,6 +1296,8 @@ static int __reloc_gpu_alloc(struct i915_execbuffer *eb, · 243 unmodified lines
12961296 goto err_pool;
12971297 }
12981298
1299+ memset32(cmd, 0, pool->obj->base.size / sizeof(u32));
1300+
12991301 batch = i915_vma_instance(pool->obj, vma->vm, NULL);
13001302 if (IS_ERR(batch)) {
13011303 err = PTR_ERR(batch);
drivers/gpu/drm/i915/gem/i915_gem_object.h+0−1
@@ -486,7 +486,6 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj, · 485 unmodified lines
486486 u32 alignment,
487487 const struct i915_ggtt_view *view,
488488 unsigned int flags);
489−void i915_gem_object_unpin_from_display_plane(struct i915_vma *vma);
490489
491490 void i915_gem_object_make_unshrinkable(struct drm_i915_gem_object *obj);
492491 void i915_gem_object_make_shrinkable(struct drm_i915_gem_object *obj);
drivers/gpu/drm/i915/gt/gen7_renderclear.c+106−63
@@ -7,8 +7,6 @@ · 6 unmodified lines
77 #include "i915_drv.h"
88 #include "intel_gpu_commands.h"
99
10−#define MAX_URB_ENTRIES 64
11−#define STATE_SIZE (4 * 1024)
1210 #define GT3_INLINE_DATA_DELAYS 0x1E00
1311 #define batch_advance(Y, CS) GEM_BUG_ON((Y)->end != (CS))
1412
@@ -34,38 +32,59 @@ struct batch_chunk { · 19 unmodified lines
3432 };
3533
3634 struct batch_vals {
37− u32 max_primitives;
38− u32 max_urb_entries;
39− u32 cmd_size;
40− u32 state_size;
35+ u32 max_threads;
4136 u32 state_start;
42− u32 batch_size;
37+ u32 surface_start;
4338 u32 surface_height;
4439 u32 surface_width;
45− u32 scratch_size;
46− u32 max_size;
40+ u32 size;
4741 };
4842
43+static inline int num_primitives(const struct batch_vals *bv)
44+{
45+ /*
46+ * We need to saturate the GPU with work in order to dispatch
47+ * a shader on every HW thread, and clear the thread-local registers.
48+ * In short, we have to dispatch work faster than the shaders can
49+ * run in order to fill the EU and occupy each HW thread.
50+ */
51+ return bv->max_threads;
52+}
53+
4954 static void
5055 batch_get_defaults(struct drm_i915_private *i915, struct batch_vals *bv)
5156 {
5257 if (IS_HASWELL(i915)) {
53− bv->max_primitives = 280;
54− bv->max_urb_entries = MAX_URB_ENTRIES;
58+ switch (INTEL_INFO(i915)->gt) {
59+ default:
60+ case 1:
61+ bv->max_threads = 70;
62+ break;
63+ case 2:
64+ bv->max_threads = 140;
65+ break;
66+ case 3:
67+ bv->max_threads = 280;
68+ break;
69+ }
5570 bv->surface_height = 16 * 16;
5671 bv->surface_width = 32 * 2 * 16;
5772 } else {
58− bv->max_primitives = 128;
59− bv->max_urb_entries = MAX_URB_ENTRIES / 2;
73+ switch (INTEL_INFO(i915)->gt) {
74+ default:
75+ case 1: /* including vlv */
76+ bv->max_threads = 36;
77+ break;
78+ case 2:
79+ bv->max_threads = 128;
80+ break;
81+ }
6082 bv->surface_height = 16 * 8;
6183 bv->surface_width = 32 * 16;
6284 }
63− bv->cmd_size = bv->max_primitives * 4096;
64− bv->state_size = STATE_SIZE;
65− bv->state_start = bv->cmd_size;
66− bv->batch_size = bv->cmd_size + bv->state_size;
67− bv->scratch_size = bv->surface_height * bv->surface_width;
68− bv->max_size = bv->batch_size + bv->scratch_size;
85+ bv->state_start = round_up(SZ_1K + num_primitives(bv) * 64, SZ_4K);
86+ bv->surface_start = bv->state_start + SZ_4K;
87+ bv->size = bv->surface_start + bv->surface_height * bv->surface_width;
6988 }
7089
7190 static void batch_init(struct batch_chunk *bc,
@@ -155,7 +174,8 @@ static u32 · 83 unmodified lines
155174 gen7_fill_binding_table(struct batch_chunk *state,
156175 const struct batch_vals *bv)
157176 {
158− u32 surface_start = gen7_fill_surface_state(state, bv->batch_size, bv);
177+ u32 surface_start =
178+ gen7_fill_surface_state(state, bv->surface_start, bv);
159179 u32 *cs = batch_alloc_items(state, 32, 8);
160180 u32 offset = batch_offset(state, cs);
161181
@@ -214,9 +234,9 @@ static void · 52 unmodified lines
214234 gen7_emit_state_base_address(struct batch_chunk *batch,
215235 u32 surface_state_base)
216236 {
217− u32 *cs = batch_alloc_items(batch, 0, 12);
237+ u32 *cs = batch_alloc_items(batch, 0, 10);
218238
219− *cs++ = STATE_BASE_ADDRESS | (12 - 2);
239+ *cs++ = STATE_BASE_ADDRESS | (10 - 2);
220240 /* general */
221241 *cs++ = batch_addr(batch) | BASE_ADDRESS_MODIFY;
222242 /* surface */
@@ -233,8 +253,6 @@ gen7_emit_state_base_address(struct batch_chunk *batch, · 10 unmodified lines
233253 *cs++ = BASE_ADDRESS_MODIFY;
234254 *cs++ = 0;
235255 *cs++ = BASE_ADDRESS_MODIFY;
236− *cs++ = 0;
237− *cs++ = 0;
238256 batch_advance(batch, cs);
239257 }
240258
@@ -244,8 +262,7 @@ gen7_emit_vfe_state(struct batch_chunk *batch, · 3 unmodified lines
244262 u32 urb_size, u32 curbe_size,
245263 u32 mode)
246264 {
247− u32 urb_entries = bv->max_urb_entries;
248− u32 threads = bv->max_primitives - 1;
265+ u32 threads = bv->max_threads - 1;
249266 u32 *cs = batch_alloc_items(batch, 32, 8);
250267
251268 *cs++ = MEDIA_VFE_STATE | (8 - 2);
@@ -254,7 +271,7 @@ gen7_emit_vfe_state(struct batch_chunk *batch, · 2 unmodified lines
254271 *cs++ = 0;
255272
256273 /* number of threads & urb entries for GPGPU vs Media Mode */
257− *cs++ = threads << 16 | urb_entries << 8 | mode << 2;
274+ *cs++ = threads << 16 | 1 << 8 | mode << 2;
258275
259276 *cs++ = 0;
260277
@@ -293,17 +310,12 @@ gen7_emit_media_object(struct batch_chunk *batch, · 32 unmodified lines
293310 {
294311 unsigned int x_offset = (media_object_index % 16) * 64;
295312 unsigned int y_offset = (media_object_index / 16) * 16;
296− unsigned int inline_data_size;
297− unsigned int media_batch_size;
298− unsigned int i;
313+ unsigned int pkt = 6 + 3;
299314 u32 *cs;
300315
301− inline_data_size = 112 * 8;
302− media_batch_size = inline_data_size + 6;
303−
304− cs = batch_alloc_items(batch, 8, media_batch_size);
316+ cs = batch_alloc_items(batch, 8, pkt);
305317
306− *cs++ = MEDIA_OBJECT | (media_batch_size - 2);
318+ *cs++ = MEDIA_OBJECT | (pkt - 2);
307319
308320 /* interface descriptor offset */
309321 *cs++ = 0;
@@ -317,25 +329,44 @@ gen7_emit_media_object(struct batch_chunk *batch, · 7 unmodified lines
317329 *cs++ = 0;
318330
319331 /* inline */
320− *cs++ = (y_offset << 16) | (x_offset);
332+ *cs++ = y_offset << 16 | x_offset;
321333 *cs++ = 0;
322334 *cs++ = GT3_INLINE_DATA_DELAYS;
323− for (i = 3; i < inline_data_size; i++)
324− *cs++ = 0;
325335
326336 batch_advance(batch, cs);
327337 }
328338
329339 static void gen7_emit_pipeline_flush(struct batch_chunk *batch)
330340 {
331− u32 *cs = batch_alloc_items(batch, 0, 5);
341+ u32 *cs = batch_alloc_items(batch, 0, 4);
332342
333− *cs++ = GFX_OP_PIPE_CONTROL(5);
334− *cs++ = PIPE_CONTROL_STATE_CACHE_INVALIDATE |
335− PIPE_CONTROL_GLOBAL_GTT_IVB;
343+ *cs++ = GFX_OP_PIPE_CONTROL(4);
344+ *cs++ = PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH |
345+ PIPE_CONTROL_DEPTH_CACHE_FLUSH |
346+ PIPE_CONTROL_DC_FLUSH_ENABLE |
347+ PIPE_CONTROL_CS_STALL;
336348 *cs++ = 0;
337349 *cs++ = 0;
350+
351+ batch_advance(batch, cs);
352+}
353+
354+static void gen7_emit_pipeline_invalidate(struct batch_chunk *batch)
355+{
356+ u32 *cs = batch_alloc_items(batch, 0, 8);
357+
358+ /* ivb: Stall before STATE_CACHE_INVALIDATE */
359+ *cs++ = GFX_OP_PIPE_CONTROL(4);
360+ *cs++ = PIPE_CONTROL_STALL_AT_SCOREBOARD |
361+ PIPE_CONTROL_CS_STALL;
362+ *cs++ = 0;
363+ *cs++ = 0;
364+
365+ *cs++ = GFX_OP_PIPE_CONTROL(4);
366+ *cs++ = PIPE_CONTROL_STATE_CACHE_INVALIDATE;
338367 *cs++ = 0;
368+ *cs++ = 0;
369+
339370 batch_advance(batch, cs);
340371 }
341372
@@ -344,34 +375,46 @@ static void emit_batch(struct i915_vma * const vma, · 2 unmodified lines
344375 const struct batch_vals *bv)
345376 {
346377 struct drm_i915_private *i915 = vma->vm->i915;
347− unsigned int desc_count = 64;
348− const u32 urb_size = 112;
378+ const unsigned int desc_count = 1;
379+ const unsigned int urb_size = 1;
349380 struct batch_chunk cmds, state;
350− u32 interface_descriptor;
381+ u32 descriptors;
351382 unsigned int i;
352383
353− batch_init(&cmds, vma, start, 0, bv->cmd_size);
354− batch_init(&state, vma, start, bv->state_start, bv->state_size);
355−
356− interface_descriptor =
357− gen7_fill_interface_descriptor(&state, bv,
358− IS_HASWELL(i915) ?
359− &cb_kernel_hsw :
360− &cb_kernel_ivb,
361− desc_count);
384+ batch_init(&cmds, vma, start, 0, bv->state_start);
385+ batch_init(&state, vma, start, bv->state_start, SZ_4K);
386+
387+ descriptors = gen7_fill_interface_descriptor(&state, bv,
388+ IS_HASWELL(i915) ?
389+ &cb_kernel_hsw :
390+ &cb_kernel_ivb,
391+ desc_count);
392+
393+ /* Reset inherited context registers */
394+ gen7_emit_pipeline_invalidate(&cmds);
395+ batch_add(&cmds, MI_LOAD_REGISTER_IMM(2));
396+ batch_add(&cmds, i915_mmio_reg_offset(CACHE_MODE_0_GEN7));
397+ batch_add(&cmds, 0xffff0000);
398+ batch_add(&cmds, i915_mmio_reg_offset(CACHE_MODE_1));
399+ batch_add(&cmds, 0xffff0000 | PIXEL_SUBSPAN_COLLECT_OPT_DISABLE);
362400 gen7_emit_pipeline_flush(&cmds);
401+
402+ /* Switch to the media pipeline and our base address */
403+ gen7_emit_pipeline_invalidate(&cmds);
363404 batch_add(&cmds, PIPELINE_SELECT | PIPELINE_SELECT_MEDIA);
364405 batch_add(&cmds, MI_NOOP);
365− gen7_emit_state_base_address(&cmds, interface_descriptor);
406+ gen7_emit_pipeline_invalidate(&cmds);
407+
366408 gen7_emit_pipeline_flush(&cmds);
409+ gen7_emit_state_base_address(&cmds, descriptors);
410+ gen7_emit_pipeline_invalidate(&cmds);
367411
412+ /* Set the clear-residual kernel state */
368413 gen7_emit_vfe_state(&cmds, bv, urb_size - 1, 0, 0);
414+ gen7_emit_interface_descriptor_load(&cmds, descriptors, desc_count);
369415
370− gen7_emit_interface_descriptor_load(&cmds,
371− interface_descriptor,
372− desc_count);
373−
374− for (i = 0; i < bv->max_primitives; i++)
416+ /* Execute the kernel on all HW threads */
417+ for (i = 0; i < num_primitives(bv); i++)
375418 gen7_emit_media_object(&cmds, i);
376419
377420 batch_add(&cmds, MI_BATCH_BUFFER_END);
@@ -385,15 +428,15 @@ int gen7_setup_clear_gpr_bb(struct intel_engine_cs * const engine, · 7 unmodified lines
385428
386429 batch_get_defaults(engine->i915, &bv);
387430 if (!vma)
388− return bv.max_size;
431+ return bv.size;
389432
390− GEM_BUG_ON(vma->obj->base.size < bv.max_size);
433+ GEM_BUG_ON(vma->obj->base.size < bv.size);
391434
392435 batch = i915_gem_object_pin_map(vma->obj, I915_MAP_WC);
393436 if (IS_ERR(batch))
394437 return PTR_ERR(batch);
395438
396− emit_batch(vma, memset(batch, 0, bv.max_size), &bv);
439+ emit_batch(vma, memset(batch, 0, bv.size), &bv);
397440
398441 i915_gem_object_flush_map(vma->obj);
399442 __i915_gem_object_release_map(vma->obj);
drivers/gpu/drm/i915/gt/intel_breadcrumbs.c+28−28
@@ -134,11 +134,6 @@ static bool remove_signaling_context(struct intel_breadcrumbs *b, · 133 unmodified lines
134134 return true;
135135 }
136136
137−static inline bool __request_completed(const struct i915_request *rq)
138−{
139− return i915_seqno_passed(__hwsp_seqno(rq), rq->fence.seqno);
140−}
141−
142137 __maybe_unused static bool
143138 check_signal_order(struct intel_context *ce, struct i915_request *rq)
144139 {
@@ -192,18 +187,6 @@ static void add_retire(struct intel_breadcrumbs *b, struct intel_timeline *tl) · 47 unmodified lines
192187 intel_engine_add_retire(b->irq_engine, tl);
193188 }
194189
195−static bool __signal_request(struct i915_request *rq)
196−{
197− GEM_BUG_ON(test_bit(I915_FENCE_FLAG_SIGNAL, &rq->fence.flags));
198−
199− if (!__dma_fence_signal(&rq->fence)) {
200− i915_request_put(rq);
201− return false;
202− }
203−
204− return true;
205−}
206−
207190 static struct llist_node *
208191 slist_add(struct llist_node *node, struct llist_node *head)
209192 {
@@ -257,7 +240,7 @@ static void signal_irq_work(struct irq_work *work) · 47 unmodified lines
257240 list_for_each_entry_rcu(rq, &ce->signals, signal_link) {
258241 bool release;
259242
260− if (!__request_completed(rq))
243+ if (!__i915_request_is_complete(rq))
261244 break;
262245
263246 if (!test_and_clear_bit(I915_FENCE_FLAG_SIGNAL,
@@ -274,9 +257,11 @@ static void signal_irq_work(struct irq_work *work) · 10 unmodified lines
274257 release = remove_signaling_context(b, ce);
275258 spin_unlock(&ce->signal_lock);
276259
277− if (__signal_request(rq))
260+ if (__dma_fence_signal(&rq->fence))
278261 /* We own signal_node now, xfer to local list */
279262 signal = slist_add(&rq->signal_node, signal);
263+ else
264+ i915_request_put(rq);
280265
281266 if (release) {
282267 add_retire(b, ce->timeline);
@@ -363,6 +348,17 @@ void intel_breadcrumbs_free(struct intel_breadcrumbs *b) · 80 unmodified lines
363348 kfree(b);
364349 }
365350
351+static void irq_signal_request(struct i915_request *rq,
352+ struct intel_breadcrumbs *b)
353+{
354+ if (!__dma_fence_signal(&rq->fence))
355+ return;
356+
357+ i915_request_get(rq);
358+ if (llist_add(&rq->signal_node, &b->signaled_requests))
359+ irq_work_queue(&b->irq_work);
360+}
361+
366362 static void insert_breadcrumb(struct i915_request *rq)
367363 {
368364 struct intel_breadcrumbs *b = READ_ONCE(rq->engine)->breadcrumbs;
@@ -372,17 +368,13 @@ static void insert_breadcrumb(struct i915_request *rq) · 3 unmodified lines
372368 if (test_bit(I915_FENCE_FLAG_SIGNAL, &rq->fence.flags))
373369 return;
374370
375− i915_request_get(rq);
376−
377371 /*
378372 * If the request is already completed, we can transfer it
379373 * straight onto a signaled list, and queue the irq worker for
380374 * its signal completion.
381375 */
382− if (__request_completed(rq)) {
383− if (__signal_request(rq) &&
384− llist_add(&rq->signal_node, &b->signaled_requests))
385− irq_work_queue(&b->irq_work);
376+ if (__i915_request_is_complete(rq)) {
377+ irq_signal_request(rq, b);
386378 return;
387379 }
388380
@@ -413,6 +405,8 @@ static void insert_breadcrumb(struct i915_request *rq) · 24 unmodified lines
413405 break;
414406 }
415407 }
408+
409+ i915_request_get(rq);
416410 list_add_rcu(&rq->signal_link, pos);
417411 GEM_BUG_ON(!check_signal_order(ce, rq));
418412 GEM_BUG_ON(test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &rq->fence.flags));
@@ -453,19 +447,25 @@ bool i915_request_enable_breadcrumb(struct i915_request *rq) · 34 unmodified lines
453447
454448 void i915_request_cancel_breadcrumb(struct i915_request *rq)
455449 {
450+ struct intel_breadcrumbs *b = READ_ONCE(rq->engine)->breadcrumbs;
456451 struct intel_context *ce = rq->context;
457452 bool release;
458453
459− if (!test_and_clear_bit(I915_FENCE_FLAG_SIGNAL, &rq->fence.flags))
454+ spin_lock(&ce->signal_lock);
455+ if (!test_and_clear_bit(I915_FENCE_FLAG_SIGNAL, &rq->fence.flags)) {
456+ spin_unlock(&ce->signal_lock);
460457 return;
458+ }
461459
462− spin_lock(&ce->signal_lock);
463460 list_del_rcu(&rq->signal_link);
464− release = remove_signaling_context(rq->engine->breadcrumbs, ce);
461+ release = remove_signaling_context(b, ce);
465462 spin_unlock(&ce->signal_lock);
466463 if (release)
467464 intel_context_put(ce);
468465
466+ if (__i915_request_is_complete(rq))
467+ irq_signal_request(rq, b);
468+
469469 i915_request_put(rq);
470470 }
471471
drivers/gpu/drm/i915/gt/intel_ggtt.c+35−12
@@ -526,16 +526,39 @@ static int init_ggtt(struct i915_ggtt *ggtt) · 525 unmodified lines
526526
527527 mutex_init(&ggtt->error_mutex);
528528 if (ggtt->mappable_end) {
529− /* Reserve a mappable slot for our lockless error capture */
530− ret = drm_mm_insert_node_in_range(&ggtt->vm.mm,
531− &ggtt->error_capture,
532− PAGE_SIZE, 0,
533− I915_COLOR_UNEVICTABLE,
534− 0, ggtt->mappable_end,
535− DRM_MM_INSERT_LOW);
536− if (ret)
537− return ret;
529+ /*
530+ * Reserve a mappable slot for our lockless error capture.
531+ *
532+ * We strongly prefer taking address 0x0 in order to protect
533+ * other critical buffers against accidental overwrites,
534+ * as writing to address 0 is a very common mistake.
535+ *
536+ * Since 0 may already be in use by the system (e.g. the BIOS
537+ * framebuffer), we let the reservation fail quietly and hope
538+ * 0 remains reserved always.
539+ *
540+ * If we fail to reserve 0, and then fail to find any space
541+ * for an error-capture, remain silent. We can afford not
542+ * to reserve an error_capture node as we have fallback
543+ * paths, and we trust that 0 will remain reserved. However,
544+ * the only likely reason for failure to insert is a driver
545+ * bug, which we expect to cause other failures...
546+ */
547+ ggtt->error_capture.size = I915_GTT_PAGE_SIZE;
548+ ggtt->error_capture.color = I915_COLOR_UNEVICTABLE;
549+ if (drm_mm_reserve_node(&ggtt->vm.mm, &ggtt->error_capture))
550+ drm_mm_insert_node_in_range(&ggtt->vm.mm,
551+ &ggtt->error_capture,
552+ ggtt->error_capture.size, 0,
553+ ggtt->error_capture.color,
554+ 0, ggtt->mappable_end,
555+ DRM_MM_INSERT_LOW);
538556 }
557+ if (drm_mm_node_allocated(&ggtt->error_capture))
558+ drm_dbg(&ggtt->vm.i915->drm,
559+ "Reserved GGTT:[%llx, %llx] for use by error capture\n",
560+ ggtt->error_capture.start,
561+ ggtt->error_capture.start + ggtt->error_capture.size);
539562
540563 /*
541564 * The upper portion of the GuC address space has a sizeable hole
@@ -548,9 +571,9 @@ static int init_ggtt(struct i915_ggtt *ggtt) · 6 unmodified lines
548571
549572 /* Clear any non-preallocated blocks */
550573 drm_mm_for_each_hole(entry, &ggtt->vm.mm, hole_start, hole_end) {
551− drm_dbg_kms(&ggtt->vm.i915->drm,
552− "clearing unused GTT space: [%lx, %lx]\n",
553− hole_start, hole_end);
574+ drm_dbg(&ggtt->vm.i915->drm,
575+ "clearing unused GTT space: [%lx, %lx]\n",
576+ hole_start, hole_end);
554577 ggtt->vm.clear_range(&ggtt->vm, hole_start,
555578 hole_end - hole_start);
556579 }
drivers/gpu/drm/i915/gt/intel_lrc.c+3−0
@@ -3988,6 +3988,9 @@ err: · 3987 unmodified lines
39883988 static void lrc_destroy_wa_ctx(struct intel_engine_cs *engine)
39893989 {
39903990 i915_vma_unpin_and_release(&engine->wa_ctx.vma, 0);
3991+
3992+ /* Called on error unwind, clear all flags to prevent further use */
3993+ memset(&engine->wa_ctx, 0, sizeof(engine->wa_ctx));
39913994 }
39923995
39933996 typedef u32 *(*wa_bb_func_t)(struct intel_engine_cs *engine, u32 *batch);
drivers/gpu/drm/i915/gt/intel_ring_submission.c+4−2
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include "gen6_ppgtt.h"
3333 #include "gen7_renderclear.h"
3434 #include "i915_drv.h"
35+#include "i915_mitigations.h"
3536 #include "intel_breadcrumbs.h"
3637 #include "intel_context.h"
3738 #include "intel_gt.h"
@@ -886,7 +887,8 @@ static int switch_context(struct i915_request *rq) · 848 unmodified lines
886887 GEM_BUG_ON(HAS_EXECLISTS(engine->i915));
887888
888889 if (engine->wa_ctx.vma && ce != engine->kernel_context) {
889− if (engine->wa_ctx.vma->private != ce) {
890+ if (engine->wa_ctx.vma->private != ce &&
891+ i915_mitigate_clear_residuals()) {
890892 ret = clear_residuals(rq);
891893 if (ret)
892894 return ret;
@@ -1290,7 +1292,7 @@ int intel_ring_submission_setup(struct intel_engine_cs *engine) · 397 unmodified lines
12901292
12911293 GEM_BUG_ON(timeline->hwsp_ggtt != engine->status_page.vma);
12921294
1293− if (IS_HASWELL(engine->i915) && engine->class == RENDER_CLASS) {
1295+ if (IS_GEN(engine->i915, 7) && engine->class == RENDER_CLASS) {
12941296 err = gen7_ctx_switch_bb_init(engine);
12951297 if (err)
12961298 goto err_ring_unpin;
drivers/gpu/drm/i915/gt/intel_timeline.c+4−6
@@ -126,6 +126,10 @@ static void __rcu_cacheline_free(struct rcu_head *rcu) · 125 unmodified lines
126126 struct intel_timeline_cacheline *cl =
127127 container_of(rcu, typeof(*cl), rcu);
128128
129+ /* Must wait until after all *rq->hwsp are complete before removing */
130+ i915_gem_object_unpin_map(cl->hwsp->vma->obj);
131+ __idle_hwsp_free(cl->hwsp, ptr_unmask_bits(cl->vaddr, CACHELINE_BITS));
132+
129133 i915_active_fini(&cl->active);
130134 kfree(cl);
131135 }
@@ -133,11 +137,6 @@ static void __rcu_cacheline_free(struct rcu_head *rcu) · 1 unmodified line
133137 static void __idle_cacheline_free(struct intel_timeline_cacheline *cl)
134138 {
135139 GEM_BUG_ON(!i915_active_is_idle(&cl->active));
136−
137− i915_gem_object_unpin_map(cl->hwsp->vma->obj);
138− i915_vma_put(cl->hwsp->vma);
139− __idle_hwsp_free(cl->hwsp, ptr_unmask_bits(cl->vaddr, CACHELINE_BITS));
140−
141140 call_rcu(&cl->rcu, __rcu_cacheline_free);
142141 }
143142
@@ -179,7 +178,6 @@ cacheline_alloc(struct intel_timeline_hwsp *hwsp, unsigned int cacheline) · 35 unmodified lines
179178 return ERR_CAST(vaddr);
180179 }
181180
182− i915_vma_get(hwsp->vma);
183181 cl->hwsp = hwsp;
184182 cl->vaddr = page_pack_bits(vaddr, cacheline);
185183
drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c+1−0
@@ -53,6 +53,7 @@ void intel_uc_fw_change_status(struct intel_uc_fw *uc_fw, · 52 unmodified lines
5353 fw_def(ELKHARTLAKE, 0, guc_def(ehl, 49, 0, 1), huc_def(ehl, 9, 0, 0)) \
5454 fw_def(ICELAKE, 0, guc_def(icl, 49, 0, 1), huc_def(icl, 9, 0, 0)) \
5555 fw_def(COMETLAKE, 5, guc_def(cml, 49, 0, 1), huc_def(cml, 4, 0, 0)) \
56+ fw_def(COMETLAKE, 0, guc_def(kbl, 49, 0, 1), huc_def(kbl, 4, 0, 0)) \
5657 fw_def(COFFEELAKE, 0, guc_def(kbl, 49, 0, 1), huc_def(kbl, 4, 0, 0)) \
5758 fw_def(GEMINILAKE, 0, guc_def(glk, 49, 0, 1), huc_def(glk, 4, 0, 0)) \
5859 fw_def(KABYLAKE, 0, guc_def(kbl, 49, 0, 1), huc_def(kbl, 4, 0, 0)) \
drivers/gpu/drm/i915/gvt/display.c+57−24
@@ -217,6 +217,15 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) · 216 unmodified lines
217217 DDI_BUF_CTL_ENABLE);
218218 vgpu_vreg_t(vgpu, DDI_BUF_CTL(port)) |= DDI_BUF_IS_IDLE;
219219 }
220+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) &=
221+ ~(PORTA_HOTPLUG_ENABLE | PORTA_HOTPLUG_STATUS_MASK);
222+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) &=
223+ ~(PORTB_HOTPLUG_ENABLE | PORTB_HOTPLUG_STATUS_MASK);
224+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) &=
225+ ~(PORTC_HOTPLUG_ENABLE | PORTC_HOTPLUG_STATUS_MASK);
226+ /* No hpd_invert set in vgpu vbt, need to clear invert mask */
227+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) &= ~BXT_DDI_HPD_INVERT_MASK;
228+ vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) &= ~BXT_DE_PORT_HOTPLUG_MASK;
220229
221230 vgpu_vreg_t(vgpu, BXT_P_CR_GT_DISP_PWRON) &= ~(BIT(0) | BIT(1));
222231 vgpu_vreg_t(vgpu, BXT_PORT_CL1CM_DW0(DPIO_PHY0)) &=
@@ -273,6 +282,8 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) · 50 unmodified lines
273282 vgpu_vreg_t(vgpu, TRANS_DDI_FUNC_CTL(TRANSCODER_EDP)) |=
274283 (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DP_SST |
275284 TRANS_DDI_FUNC_ENABLE);
285+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) |=
286+ PORTA_HOTPLUG_ENABLE;
276287 vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) |=
277288 GEN8_DE_PORT_HOTPLUG(HPD_PORT_A);
278289 }
@@ -301,6 +312,8 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) · 22 unmodified lines
301312 (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DP_SST |
302313 (PORT_B << TRANS_DDI_PORT_SHIFT) |
303314 TRANS_DDI_FUNC_ENABLE);
315+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) |=
316+ PORTB_HOTPLUG_ENABLE;
304317 vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) |=
305318 GEN8_DE_PORT_HOTPLUG(HPD_PORT_B);
306319 }
@@ -329,6 +342,8 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) · 22 unmodified lines
329342 (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DP_SST |
330343 (PORT_B << TRANS_DDI_PORT_SHIFT) |
331344 TRANS_DDI_FUNC_ENABLE);
345+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) |=
346+ PORTC_HOTPLUG_ENABLE;
332347 vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) |=
333348 GEN8_DE_PORT_HOTPLUG(HPD_PORT_C);
334349 }
@@ -661,44 +676,62 @@ void intel_vgpu_emulate_hotplug(struct intel_vgpu *vgpu, bool connected) · 326 unmodified lines
661676 PORTD_HOTPLUG_STATUS_MASK;
662677 intel_vgpu_trigger_virtual_event(vgpu, DP_D_HOTPLUG);
663678 } else if (IS_BROXTON(i915)) {
664− if (connected) {
665− if (intel_vgpu_has_monitor_on_port(vgpu, PORT_A)) {
679+ if (intel_vgpu_has_monitor_on_port(vgpu, PORT_A)) {
680+ if (connected) {
666681 vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) |=
667682 GEN8_DE_PORT_HOTPLUG(HPD_PORT_A);
683+ } else {
684+ vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) &=
685+ ~GEN8_DE_PORT_HOTPLUG(HPD_PORT_A);
668686 }
669− if (intel_vgpu_has_monitor_on_port(vgpu, PORT_B)) {
670− vgpu_vreg_t(vgpu, SFUSE_STRAP) |=
671− SFUSE_STRAP_DDIB_DETECTED;
687+ vgpu_vreg_t(vgpu, GEN8_DE_PORT_IIR) |=
688+ GEN8_DE_PORT_HOTPLUG(HPD_PORT_A);
689+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) &=
690+ ~PORTA_HOTPLUG_STATUS_MASK;
691+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) |=
692+ PORTA_HOTPLUG_LONG_DETECT;
693+ intel_vgpu_trigger_virtual_event(vgpu, DP_A_HOTPLUG);
694+ }
695+ if (intel_vgpu_has_monitor_on_port(vgpu, PORT_B)) {
696+ if (connected) {
672697 vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) |=
673698 GEN8_DE_PORT_HOTPLUG(HPD_PORT_B);
674− }
675− if (intel_vgpu_has_monitor_on_port(vgpu, PORT_C)) {
676699 vgpu_vreg_t(vgpu, SFUSE_STRAP) |=
677− SFUSE_STRAP_DDIC_DETECTED;
678− vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) |=
679− GEN8_DE_PORT_HOTPLUG(HPD_PORT_C);
680− }
681− } else {
682− if (intel_vgpu_has_monitor_on_port(vgpu, PORT_A)) {
700+ SFUSE_STRAP_DDIB_DETECTED;
701+ } else {
683702 vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) &=
684− ~GEN8_DE_PORT_HOTPLUG(HPD_PORT_A);
685− }
686− if (intel_vgpu_has_monitor_on_port(vgpu, PORT_B)) {
703+ ~GEN8_DE_PORT_HOTPLUG(HPD_PORT_B);
687704 vgpu_vreg_t(vgpu, SFUSE_STRAP) &=
688705 ~SFUSE_STRAP_DDIB_DETECTED;
689− vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) &=
690− ~GEN8_DE_PORT_HOTPLUG(HPD_PORT_B);
691706 }
692− if (intel_vgpu_has_monitor_on_port(vgpu, PORT_C)) {
693− vgpu_vreg_t(vgpu, SFUSE_STRAP) &=
694− ~SFUSE_STRAP_DDIC_DETECTED;
707+ vgpu_vreg_t(vgpu, GEN8_DE_PORT_IIR) |=
708+ GEN8_DE_PORT_HOTPLUG(HPD_PORT_B);
709+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) &=
710+ ~PORTB_HOTPLUG_STATUS_MASK;
711+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) |=
712+ PORTB_HOTPLUG_LONG_DETECT;
713+ intel_vgpu_trigger_virtual_event(vgpu, DP_B_HOTPLUG);
714+ }
715+ if (intel_vgpu_has_monitor_on_port(vgpu, PORT_C)) {
716+ if (connected) {
717+ vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) |=
718+ GEN8_DE_PORT_HOTPLUG(HPD_PORT_C);
719+ vgpu_vreg_t(vgpu, SFUSE_STRAP) |=
720+ SFUSE_STRAP_DDIC_DETECTED;
721+ } else {
695722 vgpu_vreg_t(vgpu, GEN8_DE_PORT_ISR) &=
696723 ~GEN8_DE_PORT_HOTPLUG(HPD_PORT_C);
724+ vgpu_vreg_t(vgpu, SFUSE_STRAP) &=
725+ ~SFUSE_STRAP_DDIC_DETECTED;
697726 }
727+ vgpu_vreg_t(vgpu, GEN8_DE_PORT_IIR) |=
728+ GEN8_DE_PORT_HOTPLUG(HPD_PORT_C);
729+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) &=
730+ ~PORTC_HOTPLUG_STATUS_MASK;
731+ vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) |=
732+ PORTC_HOTPLUG_LONG_DETECT;
733+ intel_vgpu_trigger_virtual_event(vgpu, DP_C_HOTPLUG);
698734 }
699− vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) |=
700− PORTB_HOTPLUG_STATUS_MASK;
701− intel_vgpu_trigger_virtual_event(vgpu, DP_B_HOTPLUG);
702735 }
703736 }
704737
drivers/gpu/drm/i915/gvt/vgpu.c+2−3
@@ -437,10 +437,9 @@ static struct intel_vgpu *__intel_gvt_create_vgpu(struct intel_gvt *gvt, · 436 unmodified lines
437437 if (ret)
438438 goto out_clean_sched_policy;
439439
440− if (IS_BROADWELL(dev_priv))
440+ if (IS_BROADWELL(dev_priv) || IS_BROXTON(dev_priv))
441441 ret = intel_gvt_hypervisor_set_edid(vgpu, PORT_B);
442− /* FixMe: Re-enable APL/BXT once vfio_edid enabled */
443− else if (!IS_BROXTON(dev_priv))
442+ else
444443 ret = intel_gvt_hypervisor_set_edid(vgpu, PORT_D);
445444 if (ret)
446445 goto out_clean_sched_policy;
drivers/gpu/drm/i915/i915_active.c+15−13
@@ -631,24 +631,26 @@ static int flush_lazy_signals(struct i915_active *ref) · 630 unmodified lines
631631
632632 int __i915_active_wait(struct i915_active *ref, int state)
633633 {
634− int err;
635−
636634 might_sleep();
637635
638− if (!i915_active_acquire_if_busy(ref))
639− return 0;
640−
641636 /* Any fence added after the wait begins will not be auto-signaled */
642− err = flush_lazy_signals(ref);
643− i915_active_release(ref);
644− if (err)
645− return err;
637+ if (i915_active_acquire_if_busy(ref)) {
638+ int err;
646639
647− if (!i915_active_is_idle(ref) &&
648− ___wait_var_event(ref, i915_active_is_idle(ref),
649− state, 0, 0, schedule()))
650− return -EINTR;
640+ err = flush_lazy_signals(ref);
641+ i915_active_release(ref);
642+ if (err)
643+ return err;
651644
645+ if (___wait_var_event(ref, i915_active_is_idle(ref),
646+ state, 0, 0, schedule()))
647+ return -EINTR;
648+ }
649+
650+ /*
651+ * After the wait is complete, the caller may free the active.
652+ * We have to flush any concurrent retirement before returning.
653+ */
652654 flush_work(&ref->work);
653655 return 0;
654656 }
drivers/gpu/drm/i915/i915_cmd_parser.c+9−18
@@ -1166,7 +1166,7 @@ static u32 *copy_batch(struct drm_i915_gem_object *dst_obj, · 1165 unmodified lines
11661166 }
11671167 }
11681168 if (IS_ERR(src)) {
1169− unsigned long x, n;
1169+ unsigned long x, n, remain;
11701170 void *ptr;
11711171
11721172 /*
@@ -1177,14 +1177,15 @@ static u32 *copy_batch(struct drm_i915_gem_object *dst_obj, · 4 unmodified lines
11771177 * We don't care about copying too much here as we only
11781178 * validate up to the end of the batch.
11791179 */
1180+ remain = length;
11801181 if (!(dst_obj->cache_coherent & I915_BO_CACHE_COHERENT_FOR_READ))
1181− length = round_up(length,
1182+ remain = round_up(remain,
11821183 boot_cpu_data.x86_clflush_size);
11831184
11841185 ptr = dst;
11851186 x = offset_in_page(offset);
1186− for (n = offset >> PAGE_SHIFT; length; n++) {
1187− int len = min(length, PAGE_SIZE - x);
1187+ for (n = offset >> PAGE_SHIFT; remain; n++) {
1188+ int len = min(remain, PAGE_SIZE - x);
11881189
11891190 src = kmap_atomic(i915_gem_object_get_page(src_obj, n));
11901191 if (needs_clflush)
@@ -1193,13 +1194,15 @@ static u32 *copy_batch(struct drm_i915_gem_object *dst_obj, · 2 unmodified lines
11931194 kunmap_atomic(src);
11941195
11951196 ptr += len;
1196− length -= len;
1197+ remain -= len;
11971198 x = 0;
11981199 }
11991200 }
12001201
12011202 i915_gem_object_unpin_pages(src_obj);
12021203
1204+ memset32(dst + length, 0, (dst_obj->base.size - length) / sizeof(u32));
1205+
12031206 /* dst_obj is returned with vmap pinned */
12041207 return dst;
12051208 }
@@ -1392,11 +1395,6 @@ static unsigned long *alloc_whitelist(u32 batch_length) · 186 unmodified lines
13921395
13931396 #define LENGTH_BIAS 2
13941397
1395−static bool shadow_needs_clflush(struct drm_i915_gem_object *obj)
1396−{
1397− return !(obj->cache_coherent & I915_BO_CACHE_COHERENT_FOR_WRITE);
1398−}
1399−
14001398 /**
14011399 * intel_engine_cmd_parser() - parse a batch buffer for privilege violations
14021400 * @engine: the engine on which the batch is to execute
@@ -1538,16 +1536,9 @@ int intel_engine_cmd_parser(struct intel_engine_cs *engine, · 135 unmodified lines
15381536 ret = 0; /* allow execution */
15391537 }
15401538 }
1541−
1542− if (shadow_needs_clflush(shadow->obj))
1543− drm_clflush_virt_range(batch_end, 8);
15441539 }
15451540
1546− if (shadow_needs_clflush(shadow->obj)) {
1547− void *ptr = page_mask_bits(shadow->obj->mm.mapping);
1548−
1549− drm_clflush_virt_range(ptr, (void *)(cmd + 1) - ptr);
1550− }
1541+ i915_gem_object_flush_map(shadow->obj);
15511542
15521543 if (!IS_ERR_OR_NULL(jump_whitelist))
15531544 kfree(jump_whitelist);
drivers/gpu/drm/i915/i915_drv.c+4−5
@@ -578,8 +578,6 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv) · 577 unmodified lines
578578
579579 pci_set_master(pdev);
580580
581− cpu_latency_qos_add_request(&dev_priv->pm_qos, PM_QOS_DEFAULT_VALUE);
582−
583581 intel_gt_init_workarounds(dev_priv);
584582
585583 /* On the 945G/GM, the chipset reports the MSI capability on the
@@ -626,7 +624,6 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv) · 40 unmodified lines
626624 err_msi:
627625 if (pdev->msi_enabled)
628626 pci_disable_msi(pdev);
629− cpu_latency_qos_remove_request(&dev_priv->pm_qos);
630627 err_mem_regions:
631628 intel_memory_regions_driver_release(dev_priv);
632629 err_ggtt:
@@ -648,8 +645,6 @@ static void i915_driver_hw_remove(struct drm_i915_private *dev_priv) · 15 unmodified lines
648645
649646 if (pdev->msi_enabled)
650647 pci_disable_msi(pdev);
651−
652− cpu_latency_qos_remove_request(&dev_priv->pm_qos);
653648 }
654649
655650 /**
@@ -1052,6 +1047,8 @@ static void intel_shutdown_encoders(struct drm_i915_private *dev_priv) · 396 unmodified lines
10521047
10531048 void i915_driver_shutdown(struct drm_i915_private *i915)
10541049 {
1050+ disable_rpm_wakeref_asserts(&i915->runtime_pm);
1051+
10551052 i915_gem_suspend(i915);
10561053
10571054 drm_kms_helper_poll_disable(&i915->drm);
@@ -1065,6 +1062,8 @@ void i915_driver_shutdown(struct drm_i915_private *i915) · 7 unmodified lines
10651062
10661063 intel_suspend_encoders(i915);
10671064 intel_shutdown_encoders(i915);
1065+
1066+ enable_rpm_wakeref_asserts(&i915->runtime_pm);
10681067 }
10691068
10701069 static bool suspend_to_idle(struct drm_i915_private *dev_priv)
drivers/gpu/drm/i915/i915_drv.h+1−4
@@ -891,9 +891,6 @@ struct drm_i915_private { · 890 unmodified lines
891891
892892 bool display_irqs_enabled;
893893
894− /* To control wakeup latency, e.g. for irq-driven dp aux transfers. */
895− struct pm_qos_request pm_qos;
896−
897894 /* Sideband mailbox protection */
898895 struct mutex sb_lock;
899896 struct pm_qos_request sb_qos;
@@ -1349,7 +1346,7 @@ intel_subplatform(const struct intel_runtime_info *info, enum intel_platform p) · 449 unmodified lines
13491346 {
13501347 const unsigned int pi = __platform_mask_index(info, p);
13511348
1352− return info->platform_mask[pi] & INTEL_SUBPLATFORM_BITS;
1349+ return info->platform_mask[pi] & ((1 << INTEL_SUBPLATFORM_BITS) - 1);
13531350 }
13541351
13551352 static __always_inline bool
drivers/gpu/drm/i915/i915_mitigations.c+146−0
@@ -0,0 +1,146 @@
1+// SPDX-License-Identifier: MIT
2+/*
3+ * Copyright © 2021 Intel Corporation
4+ */
5+
6+#include <linux/kernel.h>
7+#include <linux/moduleparam.h>
8+#include <linux/slab.h>
9+#include <linux/string.h>
10+
11+#include "i915_drv.h"
12+#include "i915_mitigations.h"
13+
14+static unsigned long mitigations __read_mostly = ~0UL;
15+
16+enum {
17+ CLEAR_RESIDUALS = 0,
18+};
19+
20+static const char * const names[] = {
21+ [CLEAR_RESIDUALS] = "residuals",
22+};
23+
24+bool i915_mitigate_clear_residuals(void)
25+{
26+ return READ_ONCE(mitigations) & BIT(CLEAR_RESIDUALS);
27+}
28+
29+static int mitigations_set(const char *val, const struct kernel_param *kp)
30+{
31+ unsigned long new = ~0UL;
32+ char *str, *sep, *tok;
33+ bool first = true;
34+ int err = 0;
35+
36+ BUILD_BUG_ON(ARRAY_SIZE(names) >= BITS_PER_TYPE(mitigations));
37+
38+ str = kstrdup(val, GFP_KERNEL);
39+ if (!str)
40+ return -ENOMEM;
41+
42+ for (sep = str; (tok = strsep(&sep, ","));) {
43+ bool enable = true;
44+ int i;
45+
46+ /* Be tolerant of leading/trailing whitespace */
47+ tok = strim(tok);
48+
49+ if (first) {
50+ first = false;
51+
52+ if (!strcmp(tok, "auto"))
53+ continue;
54+
55+ new = 0;
56+ if (!strcmp(tok, "off"))
57+ continue;
58+ }
59+
60+ if (*tok == '!') {
61+ enable = !enable;
62+ tok++;
63+ }
64+
65+ if (!strncmp(tok, "no", 2)) {
66+ enable = !enable;
67+ tok += 2;
68+ }
69+
70+ if (*tok == '\0')
71+ continue;
72+
73+ for (i = 0; i < ARRAY_SIZE(names); i++) {
74+ if (!strcmp(tok, names[i])) {
75+ if (enable)
76+ new |= BIT(i);
77+ else
78+ new &= ~BIT(i);
79+ break;
80+ }
81+ }
82+ if (i == ARRAY_SIZE(names)) {
83+ pr_err("Bad \"%s.mitigations=%s\", '%s' is unknown\n",
84+ DRIVER_NAME, val, tok);
85+ err = -EINVAL;
86+ break;
87+ }
88+ }
89+ kfree(str);
90+ if (err)
91+ return err;
92+
93+ WRITE_ONCE(mitigations, new);
94+ return 0;
95+}
96+
97+static int mitigations_get(char *buffer, const struct kernel_param *kp)
98+{
99+ unsigned long local = READ_ONCE(mitigations);
100+ int count, i;
101+ bool enable;
102+
103+ if (!local)
104+ return scnprintf(buffer, PAGE_SIZE, "%s\n", "off");
105+
106+ if (local & BIT(BITS_PER_LONG - 1)) {
107+ count = scnprintf(buffer, PAGE_SIZE, "%s,", "auto");
108+ enable = false;
109+ } else {
110+ enable = true;
111+ count = 0;
112+ }
113+
114+ for (i = 0; i < ARRAY_SIZE(names); i++) {
115+ if ((local & BIT(i)) != enable)
116+ continue;
117+
118+ count += scnprintf(buffer + count, PAGE_SIZE - count,
119+ "%s%s,", enable ? "" : "!", names[i]);
120+ }
121+
122+ buffer[count - 1] = '\n';
123+ return count;
124+}
125+
126+static const struct kernel_param_ops ops = {
127+ .set = mitigations_set,
128+ .get = mitigations_get,
129+};
130+
131+module_param_cb_unsafe(mitigations, &ops, NULL, 0600);
132+MODULE_PARM_DESC(mitigations,
133+"Selectively enable security mitigations for all Intel® GPUs in the system.\n"
134+"\n"
135+" auto -- enables all mitigations required for the platform [default]\n"
136+" off -- disables all mitigations\n"
137+"\n"
138+"Individual mitigations can be enabled by passing a comma-separated string,\n"
139+"e.g. mitigations=residuals to enable only clearing residuals or\n"
140+"mitigations=auto,noresiduals to disable only the clear residual mitigation.\n"
141+"Either '!' or 'no' may be used to switch from enabling the mitigation to\n"
142+"disabling it.\n"
143+"\n"
144+"Active mitigations for Ivybridge, Baytrail, Haswell:\n"
145+" residuals -- clear all thread-local registers between contexts"
146+);
drivers/gpu/drm/i915/i915_mitigations.h+13−0
@@ -0,0 +1,13 @@
1+/* SPDX-License-Identifier: MIT */
2+/*
3+ * Copyright © 2021 Intel Corporation
4+ */
5+
6+#ifndef __I915_MITIGATIONS_H__
7+#define __I915_MITIGATIONS_H__
8+
9+#include <linux/types.h>
10+
11+bool i915_mitigate_clear_residuals(void);
12+
13+#endif /* __I915_MITIGATIONS_H__ */
drivers/gpu/drm/i915/i915_pmu.c+16−14
@@ -184,13 +184,24 @@ static u64 get_rc6(struct intel_gt *gt) · 183 unmodified lines
184184 return val;
185185 }
186186
187−static void park_rc6(struct drm_i915_private *i915)
187+static void init_rc6(struct i915_pmu *pmu)
188188 {
189− struct i915_pmu *pmu = &i915->pmu;
189+ struct drm_i915_private *i915 = container_of(pmu, typeof(*i915), pmu);
190+ intel_wakeref_t wakeref;
190191
191− if (pmu->enable & config_enabled_mask(I915_PMU_RC6_RESIDENCY))
192+ with_intel_runtime_pm(i915->gt.uncore->rpm, wakeref) {
192193 pmu->sample[__I915_SAMPLE_RC6].cur = __get_rc6(&i915->gt);
194+ pmu->sample[__I915_SAMPLE_RC6_LAST_REPORTED].cur =
195+ pmu->sample[__I915_SAMPLE_RC6].cur;
196+ pmu->sleep_last = ktime_get();
197+ }
198+}
193199
200+static void park_rc6(struct drm_i915_private *i915)
201+{
202+ struct i915_pmu *pmu = &i915->pmu;
203+
204+ pmu->sample[__I915_SAMPLE_RC6].cur = __get_rc6(&i915->gt);
194205 pmu->sleep_last = ktime_get();
195206 }
196207
@@ -201,6 +212,7 @@ static u64 get_rc6(struct intel_gt *gt) · 4 unmodified lines
201212 return __get_rc6(gt);
202213 }
203214
215+static void init_rc6(struct i915_pmu *pmu) { }
204216 static void park_rc6(struct drm_i915_private *i915) {}
205217
206218 #endif
@@ -612,10 +624,8 @@ static void i915_pmu_enable(struct perf_event *event) · 405 unmodified lines
612624 container_of(event->pmu, typeof(*i915), pmu.base);
613625 unsigned int bit = event_enabled_bit(event);
614626 struct i915_pmu *pmu = &i915->pmu;
615− intel_wakeref_t wakeref;
616627 unsigned long flags;
617628
618− wakeref = intel_runtime_pm_get(&i915->runtime_pm);
619629 spin_lock_irqsave(&pmu->lock, flags);
620630
621631 /*
@@ -626,13 +636,6 @@ static void i915_pmu_enable(struct perf_event *event) · 4 unmodified lines
626636 GEM_BUG_ON(bit >= ARRAY_SIZE(pmu->enable_count));
627637 GEM_BUG_ON(pmu->enable_count[bit] == ~0);
628638
629− if (pmu->enable_count[bit] == 0 &&
630− config_enabled_mask(I915_PMU_RC6_RESIDENCY) & BIT_ULL(bit)) {
631− pmu->sample[__I915_SAMPLE_RC6_LAST_REPORTED].cur = 0;
632− pmu->sample[__I915_SAMPLE_RC6].cur = __get_rc6(&i915->gt);
633− pmu->sleep_last = ktime_get();
634− }
635−
636639 pmu->enable |= BIT_ULL(bit);
637640 pmu->enable_count[bit]++;
638641
@@ -673,8 +676,6 @@ static void i915_pmu_enable(struct perf_event *event) · 34 unmodified lines
673676 * an existing non-zero value.
674677 */
675678 local64_set(&event->hw.prev_count, __i915_pmu_event_read(event));
676−
677− intel_runtime_pm_put(&i915->runtime_pm, wakeref);
678679 }
679680
680681 static void i915_pmu_disable(struct perf_event *event)
@@ -1130,6 +1131,7 @@ void i915_pmu_register(struct drm_i915_private *i915) · 449 unmodified lines
11301131 hrtimer_init(&pmu->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
11311132 pmu->timer.function = i915_sample;
11321133 pmu->cpuhp.cpu = -1;
1134+ init_rc6(pmu);
11331135
11341136 if (!is_igp(i915)) {
11351137 pmu->name = kasprintf(GFP_KERNEL,
drivers/gpu/drm/i915/i915_request.h+32−5
@@ -434,7 +434,7 @@ static inline u32 hwsp_seqno(const struct i915_request *rq) · 433 unmodified lines
434434
435435 static inline bool __i915_request_has_started(const struct i915_request *rq)
436436 {
437− return i915_seqno_passed(hwsp_seqno(rq), rq->fence.seqno - 1);
437+ return i915_seqno_passed(__hwsp_seqno(rq), rq->fence.seqno - 1);
438438 }
439439
440440 /**
@@ -465,11 +465,19 @@ static inline bool __i915_request_has_started(const struct i915_request *rq) · 24 unmodified lines
465465 */
466466 static inline bool i915_request_started(const struct i915_request *rq)
467467 {
468+ bool result;
469+
468470 if (i915_request_signaled(rq))
469471 return true;
470472
471− /* Remember: started but may have since been preempted! */
472− return __i915_request_has_started(rq);
473+ result = true;
474+ rcu_read_lock(); /* the HWSP may be freed at runtime */
475+ if (likely(!i915_request_signaled(rq)))
476+ /* Remember: started but may have since been preempted! */
477+ result = __i915_request_has_started(rq);
478+ rcu_read_unlock();
479+
480+ return result;
473481 }
474482
475483 /**
@@ -482,10 +490,16 @@ static inline bool i915_request_started(const struct i915_request *rq) · 6 unmodified lines
482490 */
483491 static inline bool i915_request_is_running(const struct i915_request *rq)
484492 {
493+ bool result;
494+
485495 if (!i915_request_is_active(rq))
486496 return false;
487497
488− return __i915_request_has_started(rq);
498+ rcu_read_lock();
499+ result = __i915_request_has_started(rq) && i915_request_is_active(rq);
500+ rcu_read_unlock();
501+
502+ return result;
489503 }
490504
491505 /**
@@ -509,12 +523,25 @@ static inline bool i915_request_is_ready(const struct i915_request *rq) · 17 unmodified lines
509523 return !list_empty(&rq->sched.link);
510524 }
511525
526+static inline bool __i915_request_is_complete(const struct i915_request *rq)
527+{
528+ return i915_seqno_passed(__hwsp_seqno(rq), rq->fence.seqno);
529+}
530+
512531 static inline bool i915_request_completed(const struct i915_request *rq)
513532 {
533+ bool result;
534+
514535 if (i915_request_signaled(rq))
515536 return true;
516537
517− return i915_seqno_passed(hwsp_seqno(rq), rq->fence.seqno);
538+ result = true;
539+ rcu_read_lock(); /* the HWSP may be freed at runtime */
540+ if (likely(!i915_request_signaled(rq)))
541+ result = __i915_request_is_complete(rq);
542+ rcu_read_unlock();
543+
544+ return result;
518545 }
519546
520547 static inline void i915_request_mark_complete(struct i915_request *rq)
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c+1−1
@@ -1880,7 +1880,7 @@ static int igt_cs_tlb(void *arg) · 1879 unmodified lines
18801880 vma = i915_vma_instance(out, vm, NULL);
18811881 if (IS_ERR(vma)) {
18821882 err = PTR_ERR(vma);
1883− goto out_put_batch;
1883+ goto out_put_out;
18841884 }
18851885
18861886 err = i915_vma_pin(vma, 0, 0,
drivers/gpu/drm/msm/adreno/a2xx_gpu.c+4−2
@@ -534,8 +534,10 @@ struct msm_gpu *a2xx_gpu_init(struct drm_device *dev) · 533 unmodified lines
534534
535535 if (!gpu->aspace) {
536536 dev_err(dev->dev, "No memory protection without MMU\n");
537− ret = -ENXIO;
538− goto fail;
537+ if (!allow_vram_carveout) {
538+ ret = -ENXIO;
539+ goto fail;
540+ }
539541 }
540542
541543 return gpu;
drivers/gpu/drm/msm/adreno/a3xx_gpu.c+4−2
@@ -564,8 +564,10 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev) · 563 unmodified lines
564564 * implement a cmdstream validator.
565565 */
566566 DRM_DEV_ERROR(dev->dev, "No memory protection without IOMMU\n");
567− ret = -ENXIO;
568− goto fail;
567+ if (!allow_vram_carveout) {
568+ ret = -ENXIO;
569+ goto fail;
570+ }
569571 }
570572
571573 icc_path = devm_of_icc_get(&pdev->dev, "gfx-mem");
drivers/gpu/drm/msm/adreno/a4xx_gpu.c+4−2
@@ -692,8 +692,10 @@ struct msm_gpu *a4xx_gpu_init(struct drm_device *dev) · 691 unmodified lines
692692 * implement a cmdstream validator.
693693 */
694694 DRM_DEV_ERROR(dev->dev, "No memory protection without IOMMU\n");
695− ret = -ENXIO;
696− goto fail;
695+ if (!allow_vram_carveout) {
696+ ret = -ENXIO;
697+ goto fail;
698+ }
697699 }
698700
699701 icc_path = devm_of_icc_get(&pdev->dev, "gfx-mem");
drivers/gpu/drm/msm/adreno/adreno_device.c+4−0
@@ -18,6 +18,10 @@ bool snapshot_debugbus = false; · 17 unmodified lines
1818 MODULE_PARM_DESC(snapshot_debugbus, "Include debugbus sections in GPU devcoredump (if not fused off)");
1919 module_param_named(snapshot_debugbus, snapshot_debugbus, bool, 0600);
2020
21+bool allow_vram_carveout = false;
22+MODULE_PARM_DESC(allow_vram_carveout, "Allow using VRAM Carveout, in place of IOMMU");
23+module_param_named(allow_vram_carveout, allow_vram_carveout, bool, 0600);
24+
2125 static const struct adreno_info gpulist[] = {
2226 {
2327 .rev = ADRENO_REV(2, 0, 0, 0),
drivers/gpu/drm/msm/adreno/adreno_gpu.c+12−9
@@ -191,8 +191,6 @@ adreno_iommu_create_address_space(struct msm_gpu *gpu, · 190 unmodified lines
191191 struct platform_device *pdev)
192192 {
193193 struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
194− struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu);
195− struct io_pgtable_domain_attr pgtbl_cfg;
196194 struct iommu_domain *iommu;
197195 struct msm_mmu *mmu;
198196 struct msm_gem_address_space *aspace;
@@ -202,13 +200,18 @@ adreno_iommu_create_address_space(struct msm_gpu *gpu, · 3 unmodified lines
202200 if (!iommu)
203201 return NULL;
204202
205− /*
206− * This allows GPU to set the bus attributes required to use system
207− * cache on behalf of the iommu page table walker.
208− */
209− if (!IS_ERR(a6xx_gpu->htw_llc_slice)) {
210− pgtbl_cfg.quirks = IO_PGTABLE_QUIRK_ARM_OUTER_WBWA;
211− iommu_domain_set_attr(iommu, DOMAIN_ATTR_IO_PGTABLE_CFG, &pgtbl_cfg);
203+
204+ if (adreno_is_a6xx(adreno_gpu)) {
205+ struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu);
206+ struct io_pgtable_domain_attr pgtbl_cfg;
207+ /*
208+ * This allows GPU to set the bus attributes required to use system
209+ * cache on behalf of the iommu page table walker.
210+ */
211+ if (!IS_ERR(a6xx_gpu->htw_llc_slice)) {
212+ pgtbl_cfg.quirks = IO_PGTABLE_QUIRK_ARM_OUTER_WBWA;
213+ iommu_domain_set_attr(iommu, DOMAIN_ATTR_IO_PGTABLE_CFG, &pgtbl_cfg);
214+ }
212215 }
213216
214217 mmu = msm_iommu_new(&pdev->dev, iommu);
drivers/gpu/drm/msm/adreno/adreno_gpu.h+6−0
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #include "adreno_pm4.xml.h"
1919
2020 extern bool snapshot_debugbus;
21+extern bool allow_vram_carveout;
2122
2223 enum {
2324 ADRENO_FW_PM4 = 0,
@@ -211,6 +212,11 @@ static inline int adreno_is_a540(struct adreno_gpu *gpu) · 187 unmodified lines
211212 return gpu->revn == 540;
212213 }
213214
215+static inline bool adreno_is_a6xx(struct adreno_gpu *gpu)
216+{
217+ return ((gpu->revn < 700 && gpu->revn > 599));
218+}
219+
214220 static inline int adreno_is_a618(struct adreno_gpu *gpu)
215221 {
216222 return gpu->revn == 618;
drivers/gpu/drm/msm/dp/dp_display.c+7−0
@@ -693,6 +693,13 @@ static int dp_irq_hpd_handle(struct dp_display_private *dp, u32 data) · 692 unmodified lines
693693 return 0;
694694 }
695695
696+ if (state == ST_CONNECT_PENDING) {
697+ /* wait until ST_CONNECTED */
698+ dp_add_event(dp, EV_IRQ_HPD_INT, 0, 1); /* delay = 1 */
699+ mutex_unlock(&dp->event_mutex);
700+ return 0;
701+ }
702+
696703 ret = dp_display_usbpd_attention_cb(&dp->pdev->dev);
697704 if (ret == -ECONNRESET) { /* cable unplugged */
698705 dp->core_initialized = false;
drivers/gpu/drm/msm/dp/dp_panel.c+9−3
@@ -167,12 +167,18 @@ int dp_panel_read_sink_caps(struct dp_panel *dp_panel, · 166 unmodified lines
167167 panel = container_of(dp_panel, struct dp_panel_private, dp_panel);
168168
169169 rc = dp_panel_read_dpcd(dp_panel);
170+ if (rc) {
171+ DRM_ERROR("read dpcd failed %d\n", rc);
172+ return rc;
173+ }
174+
170175 bw_code = drm_dp_link_rate_to_bw_code(dp_panel->link_info.rate);
171− if (rc || !is_link_rate_valid(bw_code) ||
176+ if (!is_link_rate_valid(bw_code) ||
172177 !is_lane_count_valid(dp_panel->link_info.num_lanes) ||
173178 (bw_code > dp_panel->max_bw_code)) {
174− DRM_ERROR("read dpcd failed %d\n", rc);
175− return rc;
179+ DRM_ERROR("Illegal link rate=%d lane=%d\n", dp_panel->link_info.rate,
180+ dp_panel->link_info.num_lanes);
181+ return -EINVAL;
176182 }
177183
178184 if (dp_panel->dfp_present) {
drivers/gpu/drm/msm/msm_drv.c+4−4
@@ -457,14 +457,14 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv) · 456 unmodified lines
457457
458458 drm_mode_config_init(ddev);
459459
460− /* Bind all our sub-components: */
461− ret = component_bind_all(dev, ddev);
460+ ret = msm_init_vram(ddev);
462461 if (ret)
463462 goto err_destroy_mdss;
464463
465− ret = msm_init_vram(ddev);
464+ /* Bind all our sub-components: */
465+ ret = component_bind_all(dev, ddev);
466466 if (ret)
467− goto err_msm_uninit;
467+ goto err_destroy_mdss;
468468
469469 dma_set_max_seg_size(dev, UINT_MAX);
470470
drivers/gpu/drm/msm/msm_gem.c+9−4
@@ -96,6 +96,8 @@ static struct page **get_pages(struct drm_gem_object *obj) · 95 unmodified lines
9696 {
9797 struct msm_gem_object *msm_obj = to_msm_bo(obj);
9898
99+ WARN_ON(!msm_gem_is_locked(obj));
100+
99101 if (!msm_obj->pages) {
100102 struct drm_device *dev = obj->dev;
101103 struct page **p;
@@ -988,6 +990,8 @@ void msm_gem_free_object(struct drm_gem_object *obj) · 886 unmodified lines
988990 if (msm_obj->pages)
989991 kvfree(msm_obj->pages);
990992
993+ put_iova_vmas(obj);
994+
991995 /* dma_buf_detach() grabs resv lock, so we need to unlock
992996 * prior to drm_prime_gem_destroy
993997 */
@@ -997,11 +1001,10 @@ void msm_gem_free_object(struct drm_gem_object *obj) · 3 unmodified lines
9971001 } else {
9981002 msm_gem_vunmap(obj);
9991003 put_pages(obj);
1004+ put_iova_vmas(obj);
10001005 msm_gem_unlock(obj);
10011006 }
10021007
1003− put_iova_vmas(obj);
1004−
10051008 drm_gem_object_release(obj);
10061009
10071010 kfree(msm_obj);
@@ -1115,6 +1118,8 @@ static struct drm_gem_object *_msm_gem_new(struct drm_device *dev, · 107 unmodified lines
11151118 struct msm_gem_vma *vma;
11161119 struct page **pages;
11171120
1121+ drm_gem_private_object_init(dev, obj, size);
1122+
11181123 msm_gem_lock(obj);
11191124
11201125 vma = add_vma(obj, NULL);
@@ -1126,9 +1131,9 @@ static struct drm_gem_object *_msm_gem_new(struct drm_device *dev, · 5 unmodified lines
11261131
11271132 to_msm_bo(obj)->vram_node = &vma->node;
11281133
1129− drm_gem_private_object_init(dev, obj, size);
1130−
1134+ msm_gem_lock(obj);
11311135 pages = get_pages(obj);
1136+ msm_gem_unlock(obj);
11321137 if (IS_ERR(pages)) {
11331138 ret = PTR_ERR(pages);
11341139 goto fail;
drivers/gpu/drm/nouveau/dispnv50/Kbuild+1−0
@@ -37,6 +37,7 @@ nouveau-y += dispnv50/wimmc37b.o · 36 unmodified lines
3737 nouveau-y += dispnv50/wndw.o
3838 nouveau-y += dispnv50/wndwc37e.o
3939 nouveau-y += dispnv50/wndwc57e.o
40+nouveau-y += dispnv50/wndwc67e.o
4041
4142 nouveau-y += dispnv50/base.o
4243 nouveau-y += dispnv50/base507c.o
drivers/gpu/drm/nouveau/dispnv50/base507c.c+5−1
@@ -88,7 +88,11 @@ base507c_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) · 87 unmodified lines
8888 NVVAL(NV507C, SET_CONVERSION, OFS, 0x64));
8989 } else {
9090 PUSH_MTHD(push, NV507C, SET_PROCESSING,
91− NVDEF(NV507C, SET_PROCESSING, USE_GAIN_OFS, DISABLE));
91+ NVDEF(NV507C, SET_PROCESSING, USE_GAIN_OFS, DISABLE),
92+
93+ SET_CONVERSION,
94+ NVVAL(NV507C, SET_CONVERSION, GAIN, 0) |
95+ NVVAL(NV507C, SET_CONVERSION, OFS, 0));
9296 }
9397
9498 PUSH_MTHD(push, NV507C, SURFACE_SET_OFFSET(0, 0), asyw->image.offset[0] >> 8);
drivers/gpu/drm/nouveau/dispnv50/base827c.c+5−1
@@ -49,7 +49,11 @@ base827c_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) · 48 unmodified lines
4949 NVVAL(NV827C, SET_CONVERSION, OFS, 0x64));
5050 } else {
5151 PUSH_MTHD(push, NV827C, SET_PROCESSING,
52− NVDEF(NV827C, SET_PROCESSING, USE_GAIN_OFS, DISABLE));
52+ NVDEF(NV827C, SET_PROCESSING, USE_GAIN_OFS, DISABLE),
53+
54+ SET_CONVERSION,
55+ NVVAL(NV827C, SET_CONVERSION, GAIN, 0) |
56+ NVVAL(NV827C, SET_CONVERSION, OFS, 0));
5357 }
5458
5559 PUSH_MTHD(push, NV827C, SURFACE_SET_OFFSET(0, 0), asyw->image.offset[0] >> 8,
drivers/gpu/drm/nouveau/dispnv50/core.c+1−0
@@ -42,6 +42,7 @@ nv50_core_new(struct nouveau_drm *drm, struct nv50_core **pcore) · 41 unmodified lines
4242 int version;
4343 int (*new)(struct nouveau_drm *, s32, struct nv50_core **);
4444 } cores[] = {
45+ { GA102_DISP_CORE_CHANNEL_DMA, 0, corec57d_new },
4546 { TU102_DISP_CORE_CHANNEL_DMA, 0, corec57d_new },
4647 { GV100_DISP_CORE_CHANNEL_DMA, 0, corec37d_new },
4748 { GP102_DISP_CORE_CHANNEL_DMA, 0, core917d_new },
drivers/gpu/drm/nouveau/dispnv50/curs.c+1−0
@@ -31,6 +31,7 @@ nv50_curs_new(struct nouveau_drm *drm, int head, struct nv50_wndw **pwndw) · 30 unmodified lines
3131 int version;
3232 int (*new)(struct nouveau_drm *, int, s32, struct nv50_wndw **);
3333 } curses[] = {
34+ { GA102_DISP_CURSOR, 0, cursc37a_new },
3435 { TU102_DISP_CURSOR, 0, cursc37a_new },
3536 { GV100_DISP_CURSOR, 0, cursc37a_new },
3637 { GK104_DISP_CURSOR, 0, curs907a_new },
drivers/gpu/drm/nouveau/dispnv50/disp.c+10−2
@@ -222,7 +222,7 @@ nv50_dmac_wait(struct nvif_push *push, u32 size) · 221 unmodified lines
222222
223223 int
224224 nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
225− const s32 *oclass, u8 head, void *data, u32 size, u64 syncbuf,
225+ const s32 *oclass, u8 head, void *data, u32 size, s64 syncbuf,
226226 struct nv50_dmac *dmac)
227227 {
228228 struct nouveau_cli *cli = (void *)device->object.client;
@@ -271,7 +271,7 @@ nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp, · 42 unmodified lines
271271 if (ret)
272272 return ret;
273273
274− if (!syncbuf)
274+ if (syncbuf < 0)
275275 return 0;
276276
277277 ret = nvif_object_ctor(&dmac->base.user, "kmsSyncCtxDma", NV50_DISP_HANDLE_SYNCBUF,
@@ -2663,6 +2663,14 @@ nv50_display_create(struct drm_device *dev) · 2385 unmodified lines
26632663 else
26642664 nouveau_display(dev)->format_modifiers = disp50xx_modifiers;
26652665
2666+ if (disp->disp->object.oclass >= GK104_DISP) {
2667+ dev->mode_config.cursor_width = 256;
2668+ dev->mode_config.cursor_height = 256;
2669+ } else {
2670+ dev->mode_config.cursor_width = 64;
2671+ dev->mode_config.cursor_height = 64;
2672+ }
2673+
26662674 /* create crtc objects to represent the hw heads */
26672675 if (disp->disp->object.oclass >= GV100_DISP)
26682676 crtcs = nvif_rd32(&device->object, 0x610060) & 0xff;
drivers/gpu/drm/nouveau/dispnv50/disp.h+1−1
@@ -95,7 +95,7 @@ struct nv50_outp_atom { · 94 unmodified lines
9595
9696 int nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
9797 const s32 *oclass, u8 head, void *data, u32 size,
98− u64 syncbuf, struct nv50_dmac *dmac);
98+ s64 syncbuf, struct nv50_dmac *dmac);
9999 void nv50_dmac_destroy(struct nv50_dmac *);
100100
101101 /*
drivers/gpu/drm/nouveau/dispnv50/head917d.c+27−1
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include "head.h"
2323 #include "core.h"
2424
25+#include "nvif/push.h"
2526 #include <nvif/push507c.h>
2627
2728 #include <nvhw/class/cl917d.h>
@@ -73,6 +74,31 @@ head917d_base(struct nv50_head *head, struct nv50_head_atom *asyh) · 45 unmodified lines
7374 return 0;
7475 }
7576
77+static int
78+head917d_curs_set(struct nv50_head *head, struct nv50_head_atom *asyh)
79+{
80+ struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
81+ const int i = head->base.index;
82+ int ret;
83+
84+ ret = PUSH_WAIT(push, 5);
85+ if (ret)
86+ return ret;
87+
88+ PUSH_MTHD(push, NV917D, HEAD_SET_CONTROL_CURSOR(i),
89+ NVDEF(NV917D, HEAD_SET_CONTROL_CURSOR, ENABLE, ENABLE) |
90+ NVVAL(NV917D, HEAD_SET_CONTROL_CURSOR, FORMAT, asyh->curs.format) |
91+ NVVAL(NV917D, HEAD_SET_CONTROL_CURSOR, SIZE, asyh->curs.layout) |
92+ NVVAL(NV917D, HEAD_SET_CONTROL_CURSOR, HOT_SPOT_X, 0) |
93+ NVVAL(NV917D, HEAD_SET_CONTROL_CURSOR, HOT_SPOT_Y, 0) |
94+ NVDEF(NV917D, HEAD_SET_CONTROL_CURSOR, COMPOSITION, ALPHA_BLEND),
95+
96+ HEAD_SET_OFFSET_CURSOR(i), asyh->curs.offset >> 8);
97+
98+ PUSH_MTHD(push, NV917D, HEAD_SET_CONTEXT_DMA_CURSOR(i), asyh->curs.handle);
99+ return 0;
100+}
101+
76102 int
77103 head917d_curs_layout(struct nv50_head *head, struct nv50_wndw_atom *asyw,
78104 struct nv50_head_atom *asyh)
@@ -101,7 +127,7 @@ head917d = { · 22 unmodified lines
101127 .core_clr = head907d_core_clr,
102128 .curs_layout = head917d_curs_layout,
103129 .curs_format = head507d_curs_format,
104− .curs_set = head907d_curs_set,
130+ .curs_set = head917d_curs_set,
105131 .curs_clr = head907d_curs_clr,
106132 .base = head917d_base,
107133 .ovly = head907d_ovly,
drivers/gpu/drm/nouveau/dispnv50/wimm.c+1−0
@@ -31,6 +31,7 @@ nv50_wimm_init(struct nouveau_drm *drm, struct nv50_wndw *wndw) · 30 unmodified lines
3131 int version;
3232 int (*init)(struct nouveau_drm *, s32, struct nv50_wndw *);
3333 } wimms[] = {
34+ { GA102_DISP_WINDOW_IMM_CHANNEL_DMA, 0, wimmc37b_init },
3435 { TU102_DISP_WINDOW_IMM_CHANNEL_DMA, 0, wimmc37b_init },
3536 { GV100_DISP_WINDOW_IMM_CHANNEL_DMA, 0, wimmc37b_init },
3637 {}
drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c+1−1
@@ -76,7 +76,7 @@ wimmc37b_init_(const struct nv50_wimm_func *func, struct nouveau_drm *drm, · 75 unmodified lines
7676 int ret;
7777
7878 ret = nv50_dmac_create(&drm->client.device, &disp->disp->object,
79− &oclass, 0, &args, sizeof(args), 0,
79+ &oclass, 0, &args, sizeof(args), -1,
8080 &wndw->wimm);
8181 if (ret) {
8282 NV_ERROR(drm, "wimm%04x allocation failed: %d\n", oclass, ret);
drivers/gpu/drm/nouveau/dispnv50/wndw.c+14−4
@@ -702,6 +702,11 @@ nv50_wndw_init(struct nv50_wndw *wndw) · 701 unmodified lines
702702 nvif_notify_get(&wndw->notify);
703703 }
704704
705+static const u64 nv50_cursor_format_modifiers[] = {
706+ DRM_FORMAT_MOD_LINEAR,
707+ DRM_FORMAT_MOD_INVALID,
708+};
709+
705710 int
706711 nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev,
707712 enum drm_plane_type type, const char *name, int index,
@@ -713,6 +718,7 @@ nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev, · 5 unmodified lines
713718 struct nvif_mmu *mmu = &drm->client.mmu;
714719 struct nv50_disp *disp = nv50_disp(dev);
715720 struct nv50_wndw *wndw;
721+ const u64 *format_modifiers;
716722 int nformat;
717723 int ret;
718724
@@ -728,10 +734,13 @@ nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev, · 9 unmodified lines
728734
729735 for (nformat = 0; format[nformat]; nformat++);
730736
731− ret = drm_universal_plane_init(dev, &wndw->plane, heads, &nv50_wndw,
732− format, nformat,
733− nouveau_display(dev)->format_modifiers,
734− type, "%s-%d", name, index);
737+ if (type == DRM_PLANE_TYPE_CURSOR)
738+ format_modifiers = nv50_cursor_format_modifiers;
739+ else
740+ format_modifiers = nouveau_display(dev)->format_modifiers;
741+
742+ ret = drm_universal_plane_init(dev, &wndw->plane, heads, &nv50_wndw, format, nformat,
743+ format_modifiers, type, "%s-%d", name, index);
735744 if (ret) {
736745 kfree(*pwndw);
737746 *pwndw = NULL;
@@ -784,6 +793,7 @@ nv50_wndw_new(struct nouveau_drm *drm, enum drm_plane_type type, int index, · 46 unmodified lines
784793 int (*new)(struct nouveau_drm *, enum drm_plane_type,
785794 int, s32, struct nv50_wndw **);
786795 } wndws[] = {
796+ { GA102_DISP_WINDOW_CHANNEL_DMA, 0, wndwc67e_new },
787797 { TU102_DISP_WINDOW_CHANNEL_DMA, 0, wndwc57e_new },
788798 { GV100_DISP_WINDOW_CHANNEL_DMA, 0, wndwc37e_new },
789799 {}
drivers/gpu/drm/nouveau/dispnv50/wndw.h+8−0
@@ -129,6 +129,14 @@ int wndwc37e_update(struct nv50_wndw *, u32 *); · 128 unmodified lines
129129
130130 int wndwc57e_new(struct nouveau_drm *, enum drm_plane_type, int, s32,
131131 struct nv50_wndw **);
132+bool wndwc57e_ilut(struct nv50_wndw *, struct nv50_wndw_atom *, int);
133+int wndwc57e_ilut_set(struct nv50_wndw *, struct nv50_wndw_atom *);
134+int wndwc57e_ilut_clr(struct nv50_wndw *);
135+int wndwc57e_csc_set(struct nv50_wndw *, struct nv50_wndw_atom *);
136+int wndwc57e_csc_clr(struct nv50_wndw *);
137+
138+int wndwc67e_new(struct nouveau_drm *, enum drm_plane_type, int, s32,
139+ struct nv50_wndw **);
132140
133141 int nv50_wndw_new(struct nouveau_drm *, enum drm_plane_type, int index,
134142 struct nv50_wndw **);
drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c+5−5
@@ -80,7 +80,7 @@ wndwc57e_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) · 79 unmodified lines
8080 return 0;
8181 }
8282
83−static int
83+int
8484 wndwc57e_csc_clr(struct nv50_wndw *wndw)
8585 {
8686 struct nvif_push *push = wndw->wndw.push;
@@ -98,7 +98,7 @@ wndwc57e_csc_clr(struct nv50_wndw *wndw) · 11 unmodified lines
9898 return 0;
9999 }
100100
101−static int
101+int
102102 wndwc57e_csc_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
103103 {
104104 struct nvif_push *push = wndw->wndw.push;
@@ -111,7 +111,7 @@ wndwc57e_csc_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) · 6 unmodified lines
111111 return 0;
112112 }
113113
114−static int
114+int
115115 wndwc57e_ilut_clr(struct nv50_wndw *wndw)
116116 {
117117 struct nvif_push *push = wndw->wndw.push;
@@ -124,7 +124,7 @@ wndwc57e_ilut_clr(struct nv50_wndw *wndw) · 6 unmodified lines
124124 return 0;
125125 }
126126
127−static int
127+int
128128 wndwc57e_ilut_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
129129 {
130130 struct nvif_push *push = wndw->wndw.push;
@@ -179,7 +179,7 @@ wndwc57e_ilut_load(struct drm_color_lut *in, int size, void __iomem *mem) · 48 unmodified lines
179179 writew(readw(mem - 4), mem + 4);
180180 }
181181
182−static bool
182+bool
183183 wndwc57e_ilut(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, int size)
184184 {
185185 if (size = size ? size : 1024, size != 256 && size != 1024)
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c+106−0
@@ -0,0 +1,106 @@
1+/*
2+ * Copyright 2021 Red Hat 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+#include "wndw.h"
23+#include "atom.h"
24+
25+#include <nvif/pushc37b.h>
26+
27+#include <nvhw/class/clc57e.h>
28+
29+static int
30+wndwc67e_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
31+{
32+ struct nvif_push *push = wndw->wndw.push;
33+ int ret;
34+
35+ if ((ret = PUSH_WAIT(push, 17)))
36+ return ret;
37+
38+ PUSH_MTHD(push, NVC57E, SET_PRESENT_CONTROL,
39+ NVVAL(NVC57E, SET_PRESENT_CONTROL, MIN_PRESENT_INTERVAL, asyw->image.interval) |
40+ NVVAL(NVC57E, SET_PRESENT_CONTROL, BEGIN_MODE, asyw->image.mode) |
41+ NVDEF(NVC57E, SET_PRESENT_CONTROL, TIMESTAMP_MODE, DISABLE));
42+
43+ PUSH_MTHD(push, NVC57E, SET_SIZE,
44+ NVVAL(NVC57E, SET_SIZE, WIDTH, asyw->image.w) |
45+ NVVAL(NVC57E, SET_SIZE, HEIGHT, asyw->image.h),
46+
47+ SET_STORAGE,
48+ NVVAL(NVC57E, SET_STORAGE, BLOCK_HEIGHT, asyw->image.blockh),
49+
50+ SET_PARAMS,
51+ NVVAL(NVC57E, SET_PARAMS, FORMAT, asyw->image.format) |
52+ NVDEF(NVC57E, SET_PARAMS, CLAMP_BEFORE_BLEND, DISABLE) |
53+ NVDEF(NVC57E, SET_PARAMS, SWAP_UV, DISABLE) |
54+ NVDEF(NVC57E, SET_PARAMS, FMT_ROUNDING_MODE, ROUND_TO_NEAREST),
55+
56+ SET_PLANAR_STORAGE(0),
57+ NVVAL(NVC57E, SET_PLANAR_STORAGE, PITCH, asyw->image.blocks[0]) |
58+ NVVAL(NVC57E, SET_PLANAR_STORAGE, PITCH, asyw->image.pitch[0] >> 6));
59+
60+ PUSH_MTHD(push, NVC57E, SET_CONTEXT_DMA_ISO(0), asyw->image.handle, 1);
61+ PUSH_MTHD(push, NVC57E, SET_OFFSET(0), asyw->image.offset[0] >> 8);
62+
63+ PUSH_MTHD(push, NVC57E, SET_POINT_IN(0),
64+ NVVAL(NVC57E, SET_POINT_IN, X, asyw->state.src_x >> 16) |
65+ NVVAL(NVC57E, SET_POINT_IN, Y, asyw->state.src_y >> 16));
66+
67+ PUSH_MTHD(push, NVC57E, SET_SIZE_IN,
68+ NVVAL(NVC57E, SET_SIZE_IN, WIDTH, asyw->state.src_w >> 16) |
69+ NVVAL(NVC57E, SET_SIZE_IN, HEIGHT, asyw->state.src_h >> 16));
70+
71+ PUSH_MTHD(push, NVC57E, SET_SIZE_OUT,
72+ NVVAL(NVC57E, SET_SIZE_OUT, WIDTH, asyw->state.crtc_w) |
73+ NVVAL(NVC57E, SET_SIZE_OUT, HEIGHT, asyw->state.crtc_h));
74+ return 0;
75+}
76+
77+static const struct nv50_wndw_func
78+wndwc67e = {
79+ .acquire = wndwc37e_acquire,
80+ .release = wndwc37e_release,
81+ .sema_set = wndwc37e_sema_set,
82+ .sema_clr = wndwc37e_sema_clr,
83+ .ntfy_set = wndwc37e_ntfy_set,
84+ .ntfy_clr = wndwc37e_ntfy_clr,
85+ .ntfy_reset = corec37d_ntfy_init,
86+ .ntfy_wait_begun = base507c_ntfy_wait_begun,
87+ .ilut = wndwc57e_ilut,
88+ .ilut_identity = true,
89+ .ilut_size = 1024,
90+ .xlut_set = wndwc57e_ilut_set,
91+ .xlut_clr = wndwc57e_ilut_clr,
92+ .csc = base907c_csc,
93+ .csc_set = wndwc57e_csc_set,
94+ .csc_clr = wndwc57e_csc_clr,
95+ .image_set = wndwc67e_image_set,
96+ .image_clr = wndwc37e_image_clr,
97+ .blend_set = wndwc37e_blend_set,
98+ .update = wndwc37e_update,
99+};
100+
101+int
102+wndwc67e_new(struct nouveau_drm *drm, enum drm_plane_type type, int index,
103+ s32 oclass, struct nv50_wndw **pwndw)
104+{
105+ return wndwc37e_new_(&wndwc67e, drm, type, index, oclass, BIT(index >> 1), pwndw);
106+}
drivers/gpu/drm/nouveau/include/nvhw/class/cl917d.h+4−0
@@ -66,6 +66,10 @@ · 65 unmodified lines
6666 #define NV917D_HEAD_SET_CONTROL_CURSOR_COMPOSITION_ALPHA_BLEND (0x00000000)
6767 #define NV917D_HEAD_SET_CONTROL_CURSOR_COMPOSITION_PREMULT_ALPHA_BLEND (0x00000001)
6868 #define NV917D_HEAD_SET_CONTROL_CURSOR_COMPOSITION_XOR (0x00000002)
69+#define NV917D_HEAD_SET_OFFSET_CURSOR(a) (0x00000484 + (a)*0x00000300)
70+#define NV917D_HEAD_SET_OFFSET_CURSOR_ORIGIN 31:0
71+#define NV917D_HEAD_SET_CONTEXT_DMA_CURSOR(a) (0x0000048C + (a)*0x00000300)
72+#define NV917D_HEAD_SET_CONTEXT_DMA_CURSOR_HANDLE 31:0
6973 #define NV917D_HEAD_SET_DITHER_CONTROL(a) (0x000004A0 + (a)*0x00000300)
7074 #define NV917D_HEAD_SET_DITHER_CONTROL_ENABLE 0:0
7175 #define NV917D_HEAD_SET_DITHER_CONTROL_ENABLE_DISABLE (0x00000000)
drivers/gpu/drm/nouveau/include/nvif/cl0080.h+1−0
@@ -33,6 +33,7 @@ struct nv_device_info_v0 { · 32 unmodified lines
3333 #define NV_DEVICE_INFO_V0_PASCAL 0x0a
3434 #define NV_DEVICE_INFO_V0_VOLTA 0x0b
3535 #define NV_DEVICE_INFO_V0_TURING 0x0c
36+#define NV_DEVICE_INFO_V0_AMPERE 0x0d
3637 __u8 family;
3738 __u8 pad06[2];
3839 __u64 ram_size;
drivers/gpu/drm/nouveau/include/nvif/class.h+5−0
@@ -88,6 +88,7 @@ · 87 unmodified lines
8888 #define GP102_DISP /* cl5070.h */ 0x00009870
8989 #define GV100_DISP /* cl5070.h */ 0x0000c370
9090 #define TU102_DISP /* cl5070.h */ 0x0000c570
91+#define GA102_DISP /* cl5070.h */ 0x0000c670
9192
9293 #define GV100_DISP_CAPS 0x0000c373
9394
@@ -103,6 +104,7 @@ · 9 unmodified lines
103104 #define GK104_DISP_CURSOR /* cl507a.h */ 0x0000917a
104105 #define GV100_DISP_CURSOR /* cl507a.h */ 0x0000c37a
105106 #define TU102_DISP_CURSOR /* cl507a.h */ 0x0000c57a
107+#define GA102_DISP_CURSOR /* cl507a.h */ 0x0000c67a
106108
107109 #define NV50_DISP_OVERLAY /* cl507b.h */ 0x0000507b
108110 #define G82_DISP_OVERLAY /* cl507b.h */ 0x0000827b
@@ -112,6 +114,7 @@ · 3 unmodified lines
112114
113115 #define GV100_DISP_WINDOW_IMM_CHANNEL_DMA /* clc37b.h */ 0x0000c37b
114116 #define TU102_DISP_WINDOW_IMM_CHANNEL_DMA /* clc37b.h */ 0x0000c57b
117+#define GA102_DISP_WINDOW_IMM_CHANNEL_DMA /* clc37b.h */ 0x0000c67b
115118
116119 #define NV50_DISP_BASE_CHANNEL_DMA /* cl507c.h */ 0x0000507c
117120 #define G82_DISP_BASE_CHANNEL_DMA /* cl507c.h */ 0x0000827c
@@ -135,6 +138,7 @@ · 17 unmodified lines
135138 #define GP102_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000987d
136139 #define GV100_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000c37d
137140 #define TU102_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000c57d
141+#define GA102_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000c67d
138142
139143 #define NV50_DISP_OVERLAY_CHANNEL_DMA /* cl507e.h */ 0x0000507e
140144 #define G82_DISP_OVERLAY_CHANNEL_DMA /* cl507e.h */ 0x0000827e
@@ -145,6 +149,7 @@ · 4 unmodified lines
145149
146150 #define GV100_DISP_WINDOW_CHANNEL_DMA /* clc37e.h */ 0x0000c37e
147151 #define TU102_DISP_WINDOW_CHANNEL_DMA /* clc37e.h */ 0x0000c57e
152+#define GA102_DISP_WINDOW_CHANNEL_DMA /* clc37e.h */ 0x0000c67e
148153
149154 #define NV50_TESLA 0x00005097
150155 #define G82_TESLA 0x00008297
drivers/gpu/drm/nouveau/include/nvif/push.h+108−108
@@ -123,131 +123,131 @@ PUSH_KICK(struct nvif_push *push) · 122 unmodified lines
123123 } while(0)
124124 #endif
125125
126−#define PUSH_1(X,f,ds,n,c,o,p,s,mA,dA) do { \
127− PUSH_##o##_HDR((p), s, mA, (c)+(n)); \
128− PUSH_##f(X, (p), X##mA, 1, o, (dA), ds, ""); \
126+#define PUSH_1(X,f,ds,n,o,p,s,mA,dA) do { \
127+ PUSH_##o##_HDR((p), s, mA, (ds)+(n)); \
128+ PUSH_##f(X, (p), X##mA, 1, o, (dA), ds, ""); \
129129 } while(0)
130−#define PUSH_2(X,f,ds,n,c,o,p,s,mB,dB,mA,dA,a...) do { \
131− PUSH_ASSERT((mB) - (mA) == (1?PUSH_##o##_INC), "mthd1"); \
132− PUSH_1(X, DATA_, 1, ds, (c)+(n), o, (p), s, X##mA, (dA), ##a); \
133− PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \
130+#define PUSH_2(X,f,ds,n,o,p,s,mB,dB,mA,dA,a...) do { \
131+ PUSH_ASSERT((mB) - (mA) == (1?PUSH_##o##_INC), "mthd1"); \
132+ PUSH_1(X, DATA_, 1, (ds) + (n), o, (p), s, X##mA, (dA), ##a); \
133+ PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \
134134 } while(0)
135−#define PUSH_3(X,f,ds,n,c,o,p,s,mB,dB,mA,dA,a...) do { \
136− PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd2"); \
137− PUSH_2(X, DATA_, 1, ds, (c)+(n), o, (p), s, X##mA, (dA), ##a); \
138− PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \
135+#define PUSH_3(X,f,ds,n,o,p,s,mB,dB,mA,dA,a...) do { \
136+ PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd2"); \
137+ PUSH_2(X, DATA_, 1, (ds) + (n), o, (p), s, X##mA, (dA), ##a); \
138+ PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \
139139 } while(0)
140−#define PUSH_4(X,f,ds,n,c,o,p,s,mB,dB,mA,dA,a...) do { \
141− PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd3"); \
142− PUSH_3(X, DATA_, 1, ds, (c)+(n), o, (p), s, X##mA, (dA), ##a); \
143− PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \
140+#define PUSH_4(X,f,ds,n,o,p,s,mB,dB,mA,dA,a...) do { \
141+ PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd3"); \
142+ PUSH_3(X, DATA_, 1, (ds) + (n), o, (p), s, X##mA, (dA), ##a); \
143+ PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \
144144 } while(0)
145−#define PUSH_5(X,f,ds,n,c,o,p,s,mB,dB,mA,dA,a...) do { \
146− PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd4"); \
147− PUSH_4(X, DATA_, 1, ds, (c)+(n), o, (p), s, X##mA, (dA), ##a); \
148− PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \
145+#define PUSH_5(X,f,ds,n,o,p,s,mB,dB,mA,dA,a...) do { \
146+ PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd4"); \
147+ PUSH_4(X, DATA_, 1, (ds) + (n), o, (p), s, X##mA, (dA), ##a); \
148+ PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \
149149 } while(0)
150−#define PUSH_6(X,f,ds,n,c,o,p,s,mB,dB,mA,dA,a...) do { \
151− PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd5"); \
152− PUSH_5(X, DATA_, 1, ds, (c)+(n), o, (p), s, X##mA, (dA), ##a); \
153− PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \
150+#define PUSH_6(X,f,ds,n,o,p,s,mB,dB,mA,dA,a...) do { \
151+ PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd5"); \
152+ PUSH_5(X, DATA_, 1, (ds) + (n), o, (p), s, X##mA, (dA), ##a); \
153+ PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \
154154 } while(0)
155−#define PUSH_7(X,f,ds,n,c,o,p,s,mB,dB,mA,dA,a...) do { \
156− PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd6"); \
157− PUSH_6(X, DATA_, 1, ds, (c)+(n), o, (p), s, X##mA, (dA), ##a); \
158− PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \
155+#define PUSH_7(X,f,ds,n,o,p,s,mB,dB,mA,dA,a...) do { \
156+ PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd6"); \
157+ PUSH_6(X, DATA_, 1, (ds) + (n), o, (p), s, X##mA, (dA), ##a); \
158+ PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \
159159 } while(0)
160−#define PUSH_8(X,f,ds,n,c,o,p,s,mB,dB,mA,dA,a...) do { \
161− PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd7"); \
162− PUSH_7(X, DATA_, 1, ds, (c)+(n), o, (p), s, X##mA, (dA), ##a); \
163− PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \
160+#define PUSH_8(X,f,ds,n,o,p,s,mB,dB,mA,dA,a...) do { \
161+ PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd7"); \
162+ PUSH_7(X, DATA_, 1, (ds) + (n), o, (p), s, X##mA, (dA), ##a); \
163+ PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \
164164 } while(0)
165−#define PUSH_9(X,f,ds,n,c,o,p,s,mB,dB,mA,dA,a...) do { \
166− PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd8"); \
167− PUSH_8(X, DATA_, 1, ds, (c)+(n), o, (p), s, X##mA, (dA), ##a); \
168− PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \
165+#define PUSH_9(X,f,ds,n,o,p,s,mB,dB,mA,dA,a...) do { \
166+ PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd8"); \
167+ PUSH_8(X, DATA_, 1, (ds) + (n), o, (p), s, X##mA, (dA), ##a); \
168+ PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \
169169 } while(0)
170−#define PUSH_10(X,f,ds,n,c,o,p,s,mB,dB,mA,dA,a...) do { \
171− PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd9"); \
172− PUSH_9(X, DATA_, 1, ds, (c)+(n), o, (p), s, X##mA, (dA), ##a); \
173− PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \
170+#define PUSH_10(X,f,ds,n,o,p,s,mB,dB,mA,dA,a...) do { \
171+ PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd9"); \
172+ PUSH_9(X, DATA_, 1, (ds) + (n), o, (p), s, X##mA, (dA), ##a); \
173+ PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \
174174 } while(0)
175175
176−#define PUSH_1D(X,o,p,s,mA,dA) \
177− PUSH_1(X, DATA_, 1, 1, 0, o, (p), s, X##mA, (dA))
178−#define PUSH_2D(X,o,p,s,mA,dA,mB,dB) \
179− PUSH_2(X, DATA_, 1, 1, 0, o, (p), s, X##mB, (dB), \
180− X##mA, (dA))
181−#define PUSH_3D(X,o,p,s,mA,dA,mB,dB,mC,dC) \
182− PUSH_3(X, DATA_, 1, 1, 0, o, (p), s, X##mC, (dC), \
183− X##mB, (dB), \
184− X##mA, (dA))
185−#define PUSH_4D(X,o,p,s,mA,dA,mB,dB,mC,dC,mD,dD) \
186− PUSH_4(X, DATA_, 1, 1, 0, o, (p), s, X##mD, (dD), \
187− X##mC, (dC), \
188− X##mB, (dB), \
189− X##mA, (dA))
190−#define PUSH_5D(X,o,p,s,mA,dA,mB,dB,mC,dC,mD,dD,mE,dE) \
191− PUSH_5(X, DATA_, 1, 1, 0, o, (p), s, X##mE, (dE), \
192− X##mD, (dD), \
193− X##mC, (dC), \
194− X##mB, (dB), \
195− X##mA, (dA))
176+#define PUSH_1D(X,o,p,s,mA,dA) \
177+ PUSH_1(X, DATA_, 1, 0, o, (p), s, X##mA, (dA))
178+#define PUSH_2D(X,o,p,s,mA,dA,mB,dB) \
179+ PUSH_2(X, DATA_, 1, 0, o, (p), s, X##mB, (dB), \
180+ X##mA, (dA))
181+#define PUSH_3D(X,o,p,s,mA,dA,mB,dB,mC,dC) \
182+ PUSH_3(X, DATA_, 1, 0, o, (p), s, X##mC, (dC), \
183+ X##mB, (dB), \
184+ X##mA, (dA))
185+#define PUSH_4D(X,o,p,s,mA,dA,mB,dB,mC,dC,mD,dD) \
186+ PUSH_4(X, DATA_, 1, 0, o, (p), s, X##mD, (dD), \
187+ X##mC, (dC), \
188+ X##mB, (dB), \
189+ X##mA, (dA))
190+#define PUSH_5D(X,o,p,s,mA,dA,mB,dB,mC,dC,mD,dD,mE,dE) \
191+ PUSH_5(X, DATA_, 1, 0, o, (p), s, X##mE, (dE), \
192+ X##mD, (dD), \
193+ X##mC, (dC), \
194+ X##mB, (dB), \
195+ X##mA, (dA))
196196 #define PUSH_6D(X,o,p,s,mA,dA,mB,dB,mC,dC,mD,dD,mE,dE,mF,dF) \
197− PUSH_6(X, DATA_, 1, 1, 0, o, (p), s, X##mF, (dF), \
198− X##mE, (dE), \
199− X##mD, (dD), \
200− X##mC, (dC), \
201− X##mB, (dB), \
202− X##mA, (dA))
197+ PUSH_6(X, DATA_, 1, 0, o, (p), s, X##mF, (dF), \
198+ X##mE, (dE), \
199+ X##mD, (dD), \
200+ X##mC, (dC), \
201+ X##mB, (dB), \
202+ X##mA, (dA))
203203 #define PUSH_7D(X,o,p,s,mA,dA,mB,dB,mC,dC,mD,dD,mE,dE,mF,dF,mG,dG) \
204− PUSH_7(X, DATA_, 1, 1, 0, o, (p), s, X##mG, (dG), \
205− X##mF, (dF), \
206− X##mE, (dE), \
207− X##mD, (dD), \
208− X##mC, (dC), \
209− X##mB, (dB), \
210− X##mA, (dA))
204+ PUSH_7(X, DATA_, 1, 0, o, (p), s, X##mG, (dG), \
205+ X##mF, (dF), \
206+ X##mE, (dE), \
207+ X##mD, (dD), \
208+ X##mC, (dC), \
209+ X##mB, (dB), \
210+ X##mA, (dA))
211211 #define PUSH_8D(X,o,p,s,mA,dA,mB,dB,mC,dC,mD,dD,mE,dE,mF,dF,mG,dG,mH,dH) \
212− PUSH_8(X, DATA_, 1, 1, 0, o, (p), s, X##mH, (dH), \
213− X##mG, (dG), \
214− X##mF, (dF), \
215− X##mE, (dE), \
216− X##mD, (dD), \
217− X##mC, (dC), \
218− X##mB, (dB), \
219− X##mA, (dA))
212+ PUSH_8(X, DATA_, 1, 0, o, (p), s, X##mH, (dH), \
213+ X##mG, (dG), \
214+ X##mF, (dF), \
215+ X##mE, (dE), \
216+ X##mD, (dD), \
217+ X##mC, (dC), \
218+ X##mB, (dB), \
219+ X##mA, (dA))
220220 #define PUSH_9D(X,o,p,s,mA,dA,mB,dB,mC,dC,mD,dD,mE,dE,mF,dF,mG,dG,mH,dH,mI,dI) \
221− PUSH_9(X, DATA_, 1, 1, 0, o, (p), s, X##mI, (dI), \
222− X##mH, (dH), \
223− X##mG, (dG), \
224− X##mF, (dF), \
225− X##mE, (dE), \
226− X##mD, (dD), \
227− X##mC, (dC), \
228− X##mB, (dB), \
229− X##mA, (dA))
221+ PUSH_9(X, DATA_, 1, 0, o, (p), s, X##mI, (dI), \
222+ X##mH, (dH), \
223+ X##mG, (dG), \
224+ X##mF, (dF), \
225+ X##mE, (dE), \
226+ X##mD, (dD), \
227+ X##mC, (dC), \
228+ X##mB, (dB), \
229+ X##mA, (dA))
230230 #define PUSH_10D(X,o,p,s,mA,dA,mB,dB,mC,dC,mD,dD,mE,dE,mF,dF,mG,dG,mH,dH,mI,dI,mJ,dJ) \
231− PUSH_10(X, DATA_, 1, 1, 0, o, (p), s, X##mJ, (dJ), \
232− X##mI, (dI), \
233− X##mH, (dH), \
234− X##mG, (dG), \
235− X##mF, (dF), \
236− X##mE, (dE), \
237− X##mD, (dD), \
238− X##mC, (dC), \
239− X##mB, (dB), \
240− X##mA, (dA))
231+ PUSH_10(X, DATA_, 1, 0, o, (p), s, X##mJ, (dJ), \
232+ X##mI, (dI), \
233+ X##mH, (dH), \
234+ X##mG, (dG), \
235+ X##mF, (dF), \
236+ X##mE, (dE), \
237+ X##mD, (dD), \
238+ X##mC, (dC), \
239+ X##mB, (dB), \
240+ X##mA, (dA))
241241
242−#define PUSH_1P(X,o,p,s,mA,dp,ds) \
243− PUSH_1(X, DATAp, ds, ds, 0, o, (p), s, X##mA, (dp))
244−#define PUSH_2P(X,o,p,s,mA,dA,mB,dp,ds) \
245− PUSH_2(X, DATAp, ds, ds, 0, o, (p), s, X##mB, (dp), \
246− X##mA, (dA))
247−#define PUSH_3P(X,o,p,s,mA,dA,mB,dB,mC,dp,ds) \
248− PUSH_3(X, DATAp, ds, ds, 0, o, (p), s, X##mC, (dp), \
249− X##mB, (dB), \
250− X##mA, (dA))
242+#define PUSH_1P(X,o,p,s,mA,dp,ds) \
243+ PUSH_1(X, DATAp, ds, 0, o, (p), s, X##mA, (dp))
244+#define PUSH_2P(X,o,p,s,mA,dA,mB,dp,ds) \
245+ PUSH_2(X, DATAp, ds, 0, o, (p), s, X##mB, (dp), \
246+ X##mA, (dA))
247+#define PUSH_3P(X,o,p,s,mA,dA,mB,dB,mC,dp,ds) \
248+ PUSH_3(X, DATAp, ds, 0, o, (p), s, X##mC, (dp), \
249+ X##mB, (dB), \
250+ X##mA, (dA))
251251
252252 #define PUSH_(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,IMPL,...) IMPL
253253 #define PUSH(A...) PUSH_(A, PUSH_10P, PUSH_10D, \
drivers/gpu/drm/nouveau/include/nvkm/core/device.h+1−0
@@ -120,6 +120,7 @@ struct nvkm_device { · 119 unmodified lines
120120 GP100 = 0x130,
121121 GV100 = 0x140,
122122 TU100 = 0x160,
123+ GA100 = 0x170,
123124 } card_type;
124125 u32 chipset;
125126 u8 chiprev;
drivers/gpu/drm/nouveau/include/nvkm/engine/disp.h+1−0
@@ -37,4 +37,5 @@ int gp100_disp_new(struct nvkm_device *, int, struct nvkm_disp **); · 36 unmodified lines
3737 int gp102_disp_new(struct nvkm_device *, int, struct nvkm_disp **);
3838 int gv100_disp_new(struct nvkm_device *, int, struct nvkm_disp **);
3939 int tu102_disp_new(struct nvkm_device *, int, struct nvkm_disp **);
40+int ga102_disp_new(struct nvkm_device *, int, struct nvkm_disp **);
4041 #endif
drivers/gpu/drm/nouveau/include/nvkm/subdev/devinit.h+1−0
@@ -32,4 +32,5 @@ int gm107_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **); · 31 unmodified lines
3232 int gm200_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
3333 int gv100_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
3434 int tu102_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
35+int ga100_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
3536 #endif
drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h+2−0
@@ -86,6 +86,8 @@ int gp100_fb_new(struct nvkm_device *, int, struct nvkm_fb **); · 85 unmodified lines
8686 int gp102_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
8787 int gp10b_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
8888 int gv100_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
89+int ga100_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
90+int ga102_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
8991
9092 #include <subdev/bios.h>
9193 #include <subdev/bios/ramcfg.h>
drivers/gpu/drm/nouveau/include/nvkm/subdev/gpio.h+1−0
@@ -37,4 +37,5 @@ int nv50_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **); · 36 unmodified lines
3737 int g94_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **);
3838 int gf119_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **);
3939 int gk104_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **);
40+int ga102_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **);
4041 #endif
drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h+1−0
@@ -92,6 +92,7 @@ int g94_i2c_new(struct nvkm_device *, int, struct nvkm_i2c **); · 91 unmodified lines
9292 int gf117_i2c_new(struct nvkm_device *, int, struct nvkm_i2c **);
9393 int gf119_i2c_new(struct nvkm_device *, int, struct nvkm_i2c **);
9494 int gk104_i2c_new(struct nvkm_device *, int, struct nvkm_i2c **);
95+int gk110_i2c_new(struct nvkm_device *, int, struct nvkm_i2c **);
9596 int gm200_i2c_new(struct nvkm_device *, int, struct nvkm_i2c **);
9697
9798 static inline int
drivers/gpu/drm/nouveau/include/nvkm/subdev/mc.h+1−0
@@ -32,4 +32,5 @@ int gk20a_mc_new(struct nvkm_device *, int, struct nvkm_mc **); · 31 unmodified lines
3232 int gp100_mc_new(struct nvkm_device *, int, struct nvkm_mc **);
3333 int gp10b_mc_new(struct nvkm_device *, int, struct nvkm_mc **);
3434 int tu102_mc_new(struct nvkm_device *, int, struct nvkm_mc **);
35+int ga100_mc_new(struct nvkm_device *, int, struct nvkm_mc **);
3536 #endif
drivers/gpu/drm/nouveau/nouveau_backlight.c+1−0
@@ -256,6 +256,7 @@ nouveau_backlight_init(struct drm_connector *connector) · 255 unmodified lines
256256 case NV_DEVICE_INFO_V0_PASCAL:
257257 case NV_DEVICE_INFO_V0_VOLTA:
258258 case NV_DEVICE_INFO_V0_TURING:
259+ case NV_DEVICE_INFO_V0_AMPERE: //XXX: not confirmed
259260 ret = nv50_backlight_init(nv_encoder, &props, &ops);
260261 break;
261262 default:
drivers/gpu/drm/nouveau/nouveau_bo.c+29−6
@@ -547,7 +547,7 @@ nouveau_bo_sync_for_device(struct nouveau_bo *nvbo) · 546 unmodified lines
547547 {
548548 struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev);
549549 struct ttm_tt *ttm_dma = (struct ttm_tt *)nvbo->bo.ttm;
550− int i;
550+ int i, j;
551551
552552 if (!ttm_dma)
553553 return;
@@ -556,10 +556,21 @@ nouveau_bo_sync_for_device(struct nouveau_bo *nvbo) · 2 unmodified lines
556556 if (nvbo->force_coherent)
557557 return;
558558
559− for (i = 0; i < ttm_dma->num_pages; i++)
559+ for (i = 0; i < ttm_dma->num_pages; ++i) {
560+ struct page *p = ttm_dma->pages[i];
561+ size_t num_pages = 1;
562+
563+ for (j = i + 1; j < ttm_dma->num_pages; ++j) {
564+ if (++p != ttm_dma->pages[j])
565+ break;
566+
567+ ++num_pages;
568+ }
560569 dma_sync_single_for_device(drm->dev->dev,
561570 ttm_dma->dma_address[i],
562− PAGE_SIZE, DMA_TO_DEVICE);
571+ num_pages * PAGE_SIZE, DMA_TO_DEVICE);
572+ i += num_pages;
573+ }
563574 }
564575
565576 void
@@ -567,7 +578,7 @@ nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo) · 1 unmodified line
567578 {
568579 struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev);
569580 struct ttm_tt *ttm_dma = (struct ttm_tt *)nvbo->bo.ttm;
570− int i;
581+ int i, j;
571582
572583 if (!ttm_dma)
573584 return;
@@ -576,9 +587,21 @@ nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo) · 2 unmodified lines
576587 if (nvbo->force_coherent)
577588 return;
578589
579− for (i = 0; i < ttm_dma->num_pages; i++)
590+ for (i = 0; i < ttm_dma->num_pages; ++i) {
591+ struct page *p = ttm_dma->pages[i];
592+ size_t num_pages = 1;
593+
594+ for (j = i + 1; j < ttm_dma->num_pages; ++j) {
595+ if (++p != ttm_dma->pages[j])
596+ break;
597+
598+ ++num_pages;
599+ }
600+
580601 dma_sync_single_for_cpu(drm->dev->dev, ttm_dma->dma_address[i],
581− PAGE_SIZE, DMA_FROM_DEVICE);
602+ num_pages * PAGE_SIZE, DMA_FROM_DEVICE);
603+ i += num_pages;
604+ }
582605 }
583606
584607 void nouveau_bo_add_io_reserve_lru(struct ttm_buffer_object *bo)
drivers/gpu/drm/nouveau/nouveau_svm.c+4−0
@@ -315,6 +315,10 @@ nouveau_svmm_init(struct drm_device *dev, void *data, · 314 unmodified lines
315315 struct drm_nouveau_svm_init *args = data;
316316 int ret;
317317
318+ /* We need to fail if svm is disabled */
319+ if (!cli->drm->svm)
320+ return -ENOSYS;
321+
318322 /* Allocate tracking for SVM-enabled VMM. */
319323 if (!(svmm = kzalloc(sizeof(*svmm), GFP_KERNEL)))
320324 return -ENOMEM;
drivers/gpu/drm/nouveau/nvif/disp.c+1−0
@@ -35,6 +35,7 @@ nvif_disp_ctor(struct nvif_device *device, const char *name, s32 oclass, · 34 unmodified lines
3535 struct nvif_disp *disp)
3636 {
3737 static const struct nvif_mclass disps[] = {
38+ { GA102_DISP, -1 },
3839 { TU102_DISP, -1 },
3940 { GV100_DISP, -1 },
4041 { GP102_DISP, -1 },
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c+78−9
@@ -1815,7 +1815,7 @@ nvf0_chipset = { · 1814 unmodified lines
18151815 .fb = gk110_fb_new,
18161816 .fuse = gf100_fuse_new,
18171817 .gpio = gk104_gpio_new,
1818− .i2c = gk104_i2c_new,
1818+ .i2c = gk110_i2c_new,
18191819 .ibus = gk104_ibus_new,
18201820 .iccsense = gf100_iccsense_new,
18211821 .imem = nv50_instmem_new,
@@ -1853,7 +1853,7 @@ nvf1_chipset = { · 31 unmodified lines
18531853 .fb = gk110_fb_new,
18541854 .fuse = gf100_fuse_new,
18551855 .gpio = gk104_gpio_new,
1856− .i2c = gk104_i2c_new,
1856+ .i2c = gk110_i2c_new,
18571857 .ibus = gk104_ibus_new,
18581858 .iccsense = gf100_iccsense_new,
18591859 .imem = nv50_instmem_new,
@@ -1891,7 +1891,7 @@ nv106_chipset = { · 31 unmodified lines
18911891 .fb = gk110_fb_new,
18921892 .fuse = gf100_fuse_new,
18931893 .gpio = gk104_gpio_new,
1894− .i2c = gk104_i2c_new,
1894+ .i2c = gk110_i2c_new,
18951895 .ibus = gk104_ibus_new,
18961896 .iccsense = gf100_iccsense_new,
18971897 .imem = nv50_instmem_new,
@@ -1929,7 +1929,7 @@ nv108_chipset = { · 31 unmodified lines
19291929 .fb = gk110_fb_new,
19301930 .fuse = gf100_fuse_new,
19311931 .gpio = gk104_gpio_new,
1932− .i2c = gk104_i2c_new,
1932+ .i2c = gk110_i2c_new,
19331933 .ibus = gk104_ibus_new,
19341934 .iccsense = gf100_iccsense_new,
19351935 .imem = nv50_instmem_new,
@@ -1967,7 +1967,7 @@ nv117_chipset = { · 31 unmodified lines
19671967 .fb = gm107_fb_new,
19681968 .fuse = gm107_fuse_new,
19691969 .gpio = gk104_gpio_new,
1970− .i2c = gk104_i2c_new,
1970+ .i2c = gk110_i2c_new,
19711971 .ibus = gk104_ibus_new,
19721972 .iccsense = gf100_iccsense_new,
19731973 .imem = nv50_instmem_new,
@@ -2003,7 +2003,7 @@ nv118_chipset = { · 29 unmodified lines
20032003 .fb = gm107_fb_new,
20042004 .fuse = gm107_fuse_new,
20052005 .gpio = gk104_gpio_new,
2006− .i2c = gk104_i2c_new,
2006+ .i2c = gk110_i2c_new,
20072007 .ibus = gk104_ibus_new,
20082008 .iccsense = gf100_iccsense_new,
20092009 .imem = nv50_instmem_new,
@@ -2652,6 +2652,61 @@ nv168_chipset = { · 642 unmodified lines
26522652 .sec2 = tu102_sec2_new,
26532653 };
26542654
2655+static const struct nvkm_device_chip
2656+nv170_chipset = {
2657+ .name = "GA100",
2658+ .bar = tu102_bar_new,
2659+ .bios = nvkm_bios_new,
2660+ .devinit = ga100_devinit_new,
2661+ .fb = ga100_fb_new,
2662+ .gpio = gk104_gpio_new,
2663+ .i2c = gm200_i2c_new,
2664+ .ibus = gm200_ibus_new,
2665+ .imem = nv50_instmem_new,
2666+ .mc = ga100_mc_new,
2667+ .mmu = tu102_mmu_new,
2668+ .pci = gp100_pci_new,
2669+ .timer = gk20a_timer_new,
2670+};
2671+
2672+static const struct nvkm_device_chip
2673+nv172_chipset = {
2674+ .name = "GA102",
2675+ .bar = tu102_bar_new,
2676+ .bios = nvkm_bios_new,
2677+ .devinit = ga100_devinit_new,
2678+ .fb = ga102_fb_new,
2679+ .gpio = ga102_gpio_new,
2680+ .i2c = gm200_i2c_new,
2681+ .ibus = gm200_ibus_new,
2682+ .imem = nv50_instmem_new,
2683+ .mc = ga100_mc_new,
2684+ .mmu = tu102_mmu_new,
2685+ .pci = gp100_pci_new,
2686+ .timer = gk20a_timer_new,
2687+ .disp = ga102_disp_new,
2688+ .dma = gv100_dma_new,
2689+};
2690+
2691+static const struct nvkm_device_chip
2692+nv174_chipset = {
2693+ .name = "GA104",
2694+ .bar = tu102_bar_new,
2695+ .bios = nvkm_bios_new,
2696+ .devinit = ga100_devinit_new,
2697+ .fb = ga102_fb_new,
2698+ .gpio = ga102_gpio_new,
2699+ .i2c = gm200_i2c_new,
2700+ .ibus = gm200_ibus_new,
2701+ .imem = nv50_instmem_new,
2702+ .mc = ga100_mc_new,
2703+ .mmu = tu102_mmu_new,
2704+ .pci = gp100_pci_new,
2705+ .timer = gk20a_timer_new,
2706+ .disp = ga102_disp_new,
2707+ .dma = gv100_dma_new,
2708+};
2709+
26552710 static int
26562711 nvkm_device_event_ctor(struct nvkm_object *object, void *data, u32 size,
26572712 struct nvkm_notify *notify)
@@ -3063,6 +3118,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func, · 405 unmodified lines
30633118 case 0x130: device->card_type = GP100; break;
30643119 case 0x140: device->card_type = GV100; break;
30653120 case 0x160: device->card_type = TU100; break;
3121+ case 0x170: device->card_type = GA100; break;
30663122 default:
30673123 break;
30683124 }
@@ -3160,10 +3216,23 @@ nvkm_device_ctor(const struct nvkm_device_func *func, · 91 unmodified lines
31603216 case 0x166: device->chip = &nv166_chipset; break;
31613217 case 0x167: device->chip = &nv167_chipset; break;
31623218 case 0x168: device->chip = &nv168_chipset; break;
3219+ case 0x172: device->chip = &nv172_chipset; break;
3220+ case 0x174: device->chip = &nv174_chipset; break;
31633221 default:
3164− nvdev_error(device, "unknown chipset (%08x)\n", boot0);
3165− ret = -ENODEV;
3166− goto done;
3222+ if (nvkm_boolopt(device->cfgopt, "NvEnableUnsupportedChipsets", false)) {
3223+ switch (device->chipset) {
3224+ case 0x170: device->chip = &nv170_chipset; break;
3225+ default:
3226+ break;
3227+ }
3228+ }
3229+
3230+ if (!device->chip) {
3231+ nvdev_error(device, "unknown chipset (%08x)\n", boot0);
3232+ ret = -ENODEV;
3233+ goto done;
3234+ }
3235+ break;
31673236 }
31683237
31693238 nvdev_info(device, "NVIDIA %s (%08x)\n",
drivers/gpu/drm/nouveau/nvkm/engine/device/user.c+1−0
@@ -176,6 +176,7 @@ nvkm_udevice_info(struct nvkm_udevice *udev, void *data, u32 size) · 175 unmodified lines
176176 case GP100: args->v0.family = NV_DEVICE_INFO_V0_PASCAL; break;
177177 case GV100: args->v0.family = NV_DEVICE_INFO_V0_VOLTA; break;
178178 case TU100: args->v0.family = NV_DEVICE_INFO_V0_TURING; break;
179+ case GA100: args->v0.family = NV_DEVICE_INFO_V0_AMPERE; break;
179180 default:
180181 args->v0.family = 0;
181182 break;
drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild+3−0
@@ -17,6 +17,7 @@ nvkm-y += nvkm/engine/disp/gp100.o · 16 unmodified lines
1717 nvkm-y += nvkm/engine/disp/gp102.o
1818 nvkm-y += nvkm/engine/disp/gv100.o
1919 nvkm-y += nvkm/engine/disp/tu102.o
20+nvkm-y += nvkm/engine/disp/ga102.o
2021 nvkm-y += nvkm/engine/disp/vga.o
2122
2223 nvkm-y += nvkm/engine/disp/head.o
@@ -42,6 +43,7 @@ nvkm-y += nvkm/engine/disp/sorgm200.o · 19 unmodified lines
4243 nvkm-y += nvkm/engine/disp/sorgp100.o
4344 nvkm-y += nvkm/engine/disp/sorgv100.o
4445 nvkm-y += nvkm/engine/disp/sortu102.o
46+nvkm-y += nvkm/engine/disp/sorga102.o
4547
4648 nvkm-y += nvkm/engine/disp/outp.o
4749 nvkm-y += nvkm/engine/disp/dp.o
@@ -75,6 +77,7 @@ nvkm-y += nvkm/engine/disp/rootgp100.o · 27 unmodified lines
7577 nvkm-y += nvkm/engine/disp/rootgp102.o
7678 nvkm-y += nvkm/engine/disp/rootgv100.o
7779 nvkm-y += nvkm/engine/disp/roottu102.o
80+nvkm-y += nvkm/engine/disp/rootga102.o
7881
7982 nvkm-y += nvkm/engine/disp/capsgv100.o
8083
drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c+27−6
@@ -33,6 +33,12 @@ · 32 unmodified lines
3333
3434 #include <nvif/event.h>
3535
36+/* IED scripts are no longer used by UEFI/RM from Ampere, but have been updated for
37+ * the x86 option ROM. However, the relevant VBIOS table versions weren't modified,
38+ * so we're unable to detect this in a nice way.
39+ */
40+#define AMPERE_IED_HACK(disp) ((disp)->engine.subdev.device->card_type >= GA100)
41+
3642 struct lt_state {
3743 struct nvkm_dp *dp;
3844 u8 stat[6];
@@ -238,6 +244,19 @@ nvkm_dp_train_links(struct nvkm_dp *dp) · 199 unmodified lines
238244 dp->dpcd[DPCD_RC02] &= ~DPCD_RC02_TPS3_SUPPORTED;
239245 lt.pc2 = dp->dpcd[DPCD_RC02] & DPCD_RC02_TPS3_SUPPORTED;
240246
247+ if (AMPERE_IED_HACK(disp) && (lnkcmp = lt.dp->info.script[0])) {
248+ /* Execute BeforeLinkTraining script from DP Info table. */
249+ while (ior->dp.bw < nvbios_rd08(bios, lnkcmp))
250+ lnkcmp += 3;
251+ lnkcmp = nvbios_rd16(bios, lnkcmp + 1);
252+
253+ nvbios_init(&dp->outp.disp->engine.subdev, lnkcmp,
254+ init.outp = &dp->outp.info;
255+ init.or = ior->id;
256+ init.link = ior->asy.link;
257+ );
258+ }
259+
241260 /* Set desired link configuration on the source. */
242261 if ((lnkcmp = lt.dp->info.lnkcmp)) {
243262 if (dp->version < 0x30) {
@@ -316,12 +335,14 @@ nvkm_dp_train_init(struct nvkm_dp *dp) · 72 unmodified lines
316335 );
317336 }
318337
319− /* Execute BeforeLinkTraining script from DP Info table. */
320− nvbios_init(&dp->outp.disp->engine.subdev, dp->info.script[0],
321− init.outp = &dp->outp.info;
322− init.or = dp->outp.ior->id;
323− init.link = dp->outp.ior->asy.link;
324− );
338+ if (!AMPERE_IED_HACK(dp->outp.disp)) {
339+ /* Execute BeforeLinkTraining script from DP Info table. */
340+ nvbios_init(&dp->outp.disp->engine.subdev, dp->info.script[0],
341+ init.outp = &dp->outp.info;
342+ init.or = dp->outp.ior->id;
343+ init.link = dp->outp.ior->asy.link;
344+ );
345+ }
325346 }
326347
327348 static const struct dp_rates {
drivers/gpu/drm/nouveau/nvkm/engine/disp/ga102.c+46−0
@@ -0,0 +1,46 @@
1+/*
2+ * Copyright 2021 Red Hat 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+#include "nv50.h"
23+#include "head.h"
24+#include "ior.h"
25+#include "channv50.h"
26+#include "rootnv50.h"
27+
28+static const struct nv50_disp_func
29+ga102_disp = {
30+ .init = tu102_disp_init,
31+ .fini = gv100_disp_fini,
32+ .intr = gv100_disp_intr,
33+ .uevent = &gv100_disp_chan_uevent,
34+ .super = gv100_disp_super,
35+ .root = &ga102_disp_root_oclass,
36+ .wndw = { .cnt = gv100_disp_wndw_cnt },
37+ .head = { .cnt = gv100_head_cnt, .new = gv100_head_new },
38+ .sor = { .cnt = gv100_sor_cnt, .new = ga102_sor_new },
39+ .ramht_size = 0x2000,
40+};
41+
42+int
43+ga102_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp)
44+{
45+ return nv50_disp_new_(&ga102_disp, device, index, pdisp);
46+}
drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h+4−0
@@ -150,6 +150,8 @@ void gv100_sor_dp_audio(struct nvkm_ior *, int, bool); · 149 unmodified lines
150150 void gv100_sor_dp_audio_sym(struct nvkm_ior *, int, u16, u32);
151151 void gv100_sor_dp_watermark(struct nvkm_ior *, int, u8);
152152
153+void tu102_sor_dp_vcpi(struct nvkm_ior *, int, u8, u8, u16, u16);
154+
153155 void g84_hdmi_ctrl(struct nvkm_ior *, int, bool, u8, u8, u8 *, u8 , u8 *, u8);
154156 void gt215_hdmi_ctrl(struct nvkm_ior *, int, bool, u8, u8, u8 *, u8 , u8 *, u8);
155157 void gf119_hdmi_ctrl(struct nvkm_ior *, int, bool, u8, u8, u8 *, u8 , u8 *, u8);
@@ -207,4 +209,6 @@ int gv100_sor_cnt(struct nvkm_disp *, unsigned long *); · 51 unmodified lines
207209 int gv100_sor_new(struct nvkm_disp *, int);
208210
209211 int tu102_sor_new(struct nvkm_disp *, int);
212+
213+int ga102_sor_new(struct nvkm_disp *, int);
210214 #endif
drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h+2−0
@@ -86,6 +86,8 @@ void gv100_disp_intr(struct nv50_disp *); · 85 unmodified lines
8686 void gv100_disp_super(struct work_struct *);
8787 int gv100_disp_wndw_cnt(struct nvkm_disp *, unsigned long *);
8888
89+int tu102_disp_init(struct nv50_disp *);
90+
8991 void nv50_disp_dptmds_war_2(struct nv50_disp *, struct dcb_output *);
9092 void nv50_disp_dptmds_war_3(struct nv50_disp *, struct dcb_output *);
9193 void nv50_disp_update_sppll1(struct nv50_disp *);
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootga102.c+52−0
@@ -0,0 +1,52 @@
1+/*
2+ * Copyright 2021 Red Hat 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+#include "rootnv50.h"
23+#include "channv50.h"
24+
25+#include <nvif/class.h>
26+
27+static const struct nv50_disp_root_func
28+ga102_disp_root = {
29+ .user = {
30+ {{-1,-1,GV100_DISP_CAPS }, gv100_disp_caps_new },
31+ {{0,0,GA102_DISP_CURSOR }, gv100_disp_curs_new },
32+ {{0,0,GA102_DISP_WINDOW_IMM_CHANNEL_DMA}, gv100_disp_wimm_new },
33+ {{0,0,GA102_DISP_CORE_CHANNEL_DMA }, gv100_disp_core_new },
34+ {{0,0,GA102_DISP_WINDOW_CHANNEL_DMA }, gv100_disp_wndw_new },
35+ {}
36+ },
37+};
38+
39+static int
40+ga102_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
41+ void *data, u32 size, struct nvkm_object **pobject)
42+{
43+ return nv50_disp_root_new_(&ga102_disp_root, disp, oclass, data, size, pobject);
44+}
45+
46+const struct nvkm_disp_oclass
47+ga102_disp_root_oclass = {
48+ .base.oclass = GA102_DISP,
49+ .base.minver = -1,
50+ .base.maxver = -1,
51+ .ctor = ga102_disp_root_new,
52+};
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h+1−0
@@ -41,4 +41,5 @@ extern const struct nvkm_disp_oclass gp100_disp_root_oclass; · 40 unmodified lines
4141 extern const struct nvkm_disp_oclass gp102_disp_root_oclass;
4242 extern const struct nvkm_disp_oclass gv100_disp_root_oclass;
4343 extern const struct nvkm_disp_oclass tu102_disp_root_oclass;
44+extern const struct nvkm_disp_oclass ga102_disp_root_oclass;
4445 #endif
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorga102.c+140−0
@@ -0,0 +1,140 @@
1+/*
2+ * Copyright 2021 Red Hat 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+#include "ior.h"
23+
24+#include <subdev/timer.h>
25+
26+static int
27+ga102_sor_dp_links(struct nvkm_ior *sor, struct nvkm_i2c_aux *aux)
28+{
29+ struct nvkm_device *device = sor->disp->engine.subdev.device;
30+ const u32 soff = nv50_ior_base(sor);
31+ const u32 loff = nv50_sor_link(sor);
32+ u32 dpctrl = 0x00000000;
33+ u32 clksor = 0x00000000;
34+
35+ switch (sor->dp.bw) {
36+ case 0x06: clksor |= 0x00000000; break;
37+ case 0x0a: clksor |= 0x00040000; break;
38+ case 0x14: clksor |= 0x00080000; break;
39+ case 0x1e: clksor |= 0x000c0000; break;
40+ default:
41+ WARN_ON(1);
42+ return -EINVAL;
43+ }
44+
45+ dpctrl |= ((1 << sor->dp.nr) - 1) << 16;
46+ if (sor->dp.mst)
47+ dpctrl |= 0x40000000;
48+ if (sor->dp.ef)
49+ dpctrl |= 0x00004000;
50+
51+ nvkm_mask(device, 0x612300 + soff, 0x007c0000, clksor);
52+
53+ /*XXX*/
54+ nvkm_msec(device, 40, NVKM_DELAY);
55+ nvkm_mask(device, 0x612300 + soff, 0x00030000, 0x00010000);
56+ nvkm_mask(device, 0x61c10c + loff, 0x00000003, 0x00000001);
57+
58+ nvkm_mask(device, 0x61c10c + loff, 0x401f4000, dpctrl);
59+ return 0;
60+}
61+
62+static void
63+ga102_sor_clock(struct nvkm_ior *sor)
64+{
65+ struct nvkm_device *device = sor->disp->engine.subdev.device;
66+ u32 div2 = 0;
67+ if (sor->asy.proto == TMDS) {
68+ if (sor->tmds.high_speed)
69+ div2 = 1;
70+ }
71+ nvkm_wr32(device, 0x00ec08 + (sor->id * 0x10), 0x00000000);
72+ nvkm_wr32(device, 0x00ec04 + (sor->id * 0x10), div2);
73+}
74+
75+static const struct nvkm_ior_func
76+ga102_sor_hda = {
77+ .route = {
78+ .get = gm200_sor_route_get,
79+ .set = gm200_sor_route_set,
80+ },
81+ .state = gv100_sor_state,
82+ .power = nv50_sor_power,
83+ .clock = ga102_sor_clock,
84+ .hdmi = {
85+ .ctrl = gv100_hdmi_ctrl,
86+ .scdc = gm200_hdmi_scdc,
87+ },
88+ .dp = {
89+ .lanes = { 0, 1, 2, 3 },
90+ .links = ga102_sor_dp_links,
91+ .power = g94_sor_dp_power,
92+ .pattern = gm107_sor_dp_pattern,
93+ .drive = gm200_sor_dp_drive,
94+ .vcpi = tu102_sor_dp_vcpi,
95+ .audio = gv100_sor_dp_audio,
96+ .audio_sym = gv100_sor_dp_audio_sym,
97+ .watermark = gv100_sor_dp_watermark,
98+ },
99+ .hda = {
100+ .hpd = gf119_hda_hpd,
101+ .eld = gf119_hda_eld,
102+ .device_entry = gv100_hda_device_entry,
103+ },
104+};
105+
106+static const struct nvkm_ior_func
107+ga102_sor = {
108+ .route = {
109+ .get = gm200_sor_route_get,
110+ .set = gm200_sor_route_set,
111+ },
112+ .state = gv100_sor_state,
113+ .power = nv50_sor_power,
114+ .clock = ga102_sor_clock,
115+ .hdmi = {
116+ .ctrl = gv100_hdmi_ctrl,
117+ .scdc = gm200_hdmi_scdc,
118+ },
119+ .dp = {
120+ .lanes = { 0, 1, 2, 3 },
121+ .links = ga102_sor_dp_links,
122+ .power = g94_sor_dp_power,
123+ .pattern = gm107_sor_dp_pattern,
124+ .drive = gm200_sor_dp_drive,
125+ .vcpi = tu102_sor_dp_vcpi,
126+ .audio = gv100_sor_dp_audio,
127+ .audio_sym = gv100_sor_dp_audio_sym,
128+ .watermark = gv100_sor_dp_watermark,
129+ },
130+};
131+
132+int
133+ga102_sor_new(struct nvkm_disp *disp, int id)
134+{
135+ struct nvkm_device *device = disp->engine.subdev.device;
136+ u32 hda = nvkm_rd32(device, 0x08a15c);
137+ if (hda & BIT(id))
138+ return nvkm_ior_new_(&ga102_sor_hda, disp, SOR, id);
139+ return nvkm_ior_new_(&ga102_sor, disp, SOR, id);
140+}
drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323
2424 #include <subdev/timer.h>
2525
26−static void
26+void
2727 tu102_sor_dp_vcpi(struct nvkm_ior *sor, int head,
2828 u8 slot, u8 slot_nr, u16 pbn, u16 aligned)
2929 {
drivers/gpu/drm/nouveau/nvkm/engine/disp/tu102.c+1−1
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828 #include <core/gpuobj.h>
2929 #include <subdev/timer.h>
3030
31−static int
31+int
3232 tu102_disp_init(struct nv50_disp *disp)
3333 {
3434 struct nvkm_device *device = disp->base.engine.subdev.device;
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c+1−1
@@ -75,7 +75,7 @@ shadow_image(struct nvkm_bios *bios, int idx, u32 offset, struct shadow *mthd) · 74 unmodified lines
7575 nvkm_debug(subdev, "%08x: type %02x, %d bytes\n",
7676 image.base, image.type, image.size);
7777
78− if (!shadow_fetch(bios, mthd, image.size)) {
78+ if (!shadow_fetch(bios, mthd, image.base + image.size)) {
7979 nvkm_debug(subdev, "%08x: fetch failed\n", image.base);
8080 return 0;
8181 }
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowramin.c+3−0
@@ -64,6 +64,9 @@ pramin_init(struct nvkm_bios *bios, const char *name) · 63 unmodified lines
6464 return NULL;
6565
6666 /* we can't get the bios image pointer without PDISP */
67+ if (device->card_type >= GA100)
68+ addr = device->chipset == 0x170; /*XXX: find the fuse reg for this */
69+ else
6770 if (device->card_type >= GM100)
6871 addr = nvkm_rd32(device, 0x021c04);
6972 else
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/Kbuild+1−0
@@ -15,3 +15,4 @@ nvkm-y += nvkm/subdev/devinit/gm107.o · 14 unmodified lines
1515 nvkm-y += nvkm/subdev/devinit/gm200.o
1616 nvkm-y += nvkm/subdev/devinit/gv100.o
1717 nvkm-y += nvkm/subdev/devinit/tu102.o
18+nvkm-y += nvkm/subdev/devinit/ga100.o
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/ga100.c+76−0
@@ -0,0 +1,76 @@
1+/*
2+ * Copyright 2021 Red Hat 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+#include "nv50.h"
23+
24+#include <subdev/bios.h>
25+#include <subdev/bios/pll.h>
26+#include <subdev/clk/pll.h>
27+
28+static int
29+ga100_devinit_pll_set(struct nvkm_devinit *init, u32 type, u32 freq)
30+{
31+ struct nvkm_subdev *subdev = &init->subdev;
32+ struct nvkm_device *device = subdev->device;
33+ struct nvbios_pll info;
34+ int head = type - PLL_VPLL0;
35+ int N, fN, M, P;
36+ int ret;
37+
38+ ret = nvbios_pll_parse(device->bios, type, &info);
39+ if (ret)
40+ return ret;
41+
42+ ret = gt215_pll_calc(subdev, &info, freq, &N, &fN, &M, &P);
43+ if (ret < 0)
44+ return ret;
45+
46+ switch (info.type) {
47+ case PLL_VPLL0:
48+ case PLL_VPLL1:
49+ case PLL_VPLL2:
50+ case PLL_VPLL3:
51+ nvkm_wr32(device, 0x00ef00 + (head * 0x40), 0x02080004);
52+ nvkm_wr32(device, 0x00ef18 + (head * 0x40), (N << 16) | fN);
53+ nvkm_wr32(device, 0x00ef04 + (head * 0x40), (P << 16) | M);
54+ nvkm_wr32(device, 0x00e9c0 + (head * 0x04), 0x00000001);
55+ break;
56+ default:
57+ nvkm_warn(subdev, "%08x/%dKhz unimplemented\n", type, freq);
58+ ret = -EINVAL;
59+ break;
60+ }
61+
62+ return ret;
63+}
64+
65+static const struct nvkm_devinit_func
66+ga100_devinit = {
67+ .init = nv50_devinit_init,
68+ .post = tu102_devinit_post,
69+ .pll_set = ga100_devinit_pll_set,
70+};
71+
72+int
73+ga100_devinit_new(struct nvkm_device *device, int index, struct nvkm_devinit **pinit)
74+{
75+ return nv50_devinit_new_(&ga100_devinit, device, index, pinit);
76+}
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/priv.h+1−0
@@ -19,4 +19,5 @@ void nvkm_devinit_ctor(const struct nvkm_devinit_func *, struct nvkm_device *, · 18 unmodified lines
1919 int index, struct nvkm_devinit *);
2020
2121 int nv04_devinit_post(struct nvkm_devinit *, bool);
22+int tu102_devinit_post(struct nvkm_devinit *, bool);
2223 #endif
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/tu102.c+1−1
@@ -65,7 +65,7 @@ tu102_devinit_pll_set(struct nvkm_devinit *init, u32 type, u32 freq) · 64 unmodified lines
6565 return ret;
6666 }
6767
68−static int
68+int
6969 tu102_devinit_post(struct nvkm_devinit *base, bool post)
7070 {
7171 struct nv50_devinit *init = nv50_devinit(base);
drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild+3−0
@@ -32,6 +32,8 @@ nvkm-y += nvkm/subdev/fb/gp100.o · 31 unmodified lines
3232 nvkm-y += nvkm/subdev/fb/gp102.o
3333 nvkm-y += nvkm/subdev/fb/gp10b.o
3434 nvkm-y += nvkm/subdev/fb/gv100.o
35+nvkm-y += nvkm/subdev/fb/ga100.o
36+nvkm-y += nvkm/subdev/fb/ga102.o
3537
3638 nvkm-y += nvkm/subdev/fb/ram.o
3739 nvkm-y += nvkm/subdev/fb/ramnv04.o
@@ -52,6 +54,7 @@ nvkm-y += nvkm/subdev/fb/ramgk104.o · 14 unmodified lines
5254 nvkm-y += nvkm/subdev/fb/ramgm107.o
5355 nvkm-y += nvkm/subdev/fb/ramgm200.o
5456 nvkm-y += nvkm/subdev/fb/ramgp100.o
57+nvkm-y += nvkm/subdev/fb/ramga102.o
5558 nvkm-y += nvkm/subdev/fb/sddr2.o
5659 nvkm-y += nvkm/subdev/fb/sddr3.o
5760 nvkm-y += nvkm/subdev/fb/gddr3.o
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ga100.c+40−0
@@ -0,0 +1,40 @@
1+/*
2+ * Copyright 2021 Red Hat 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+#include "gf100.h"
23+#include "ram.h"
24+
25+static const struct nvkm_fb_func
26+ga100_fb = {
27+ .dtor = gf100_fb_dtor,
28+ .oneinit = gf100_fb_oneinit,
29+ .init = gp100_fb_init,
30+ .init_page = gv100_fb_init_page,
31+ .init_unkn = gp100_fb_init_unkn,
32+ .ram_new = gp100_ram_new,
33+ .default_bigpage = 16,
34+};
35+
36+int
37+ga100_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb)
38+{
39+ return gp102_fb_new_(&ga100_fb, device, index, pfb);
40+}
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ga102.c+40−0
@@ -0,0 +1,40 @@
1+/*
2+ * Copyright 2021 Red Hat 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+#include "gf100.h"
23+#include "ram.h"
24+
25+static const struct nvkm_fb_func
26+ga102_fb = {
27+ .dtor = gf100_fb_dtor,
28+ .oneinit = gf100_fb_oneinit,
29+ .init = gp100_fb_init,
30+ .init_page = gv100_fb_init_page,
31+ .init_unkn = gp100_fb_init_unkn,
32+ .ram_new = ga102_ram_new,
33+ .default_bigpage = 16,
34+};
35+
36+int
37+ga102_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb)
38+{
39+ return gp102_fb_new_(&ga102_fb, device, index, pfb);
40+}
drivers/gpu/drm/nouveau/nvkm/subdev/fb/gv100.c+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 #include "gf100.h"
2323 #include "ram.h"
2424
25−static int
25+int
2626 gv100_fb_init_page(struct nvkm_fb *fb)
2727 {
2828 return (fb->page == 16) ? 0 : -EINVAL;
drivers/gpu/drm/nouveau/nvkm/subdev/fb/priv.h+2−0
@@ -82,4 +82,6 @@ int gp102_fb_new_(const struct nvkm_fb_func *, struct nvkm_device *, int, · 81 unmodified lines
8282 struct nvkm_fb **);
8383 bool gp102_fb_vpr_scrub_required(struct nvkm_fb *);
8484 int gp102_fb_vpr_scrub(struct nvkm_fb *);
85+
86+int gv100_fb_init_page(struct nvkm_fb *);
8587 #endif
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h+1−0
@@ -70,4 +70,5 @@ int gk104_ram_new(struct nvkm_fb *, struct nvkm_ram **); · 69 unmodified lines
7070 int gm107_ram_new(struct nvkm_fb *, struct nvkm_ram **);
7171 int gm200_ram_new(struct nvkm_fb *, struct nvkm_ram **);
7272 int gp100_ram_new(struct nvkm_fb *, struct nvkm_ram **);
73+int ga102_ram_new(struct nvkm_fb *, struct nvkm_ram **);
7374 #endif
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramga102.c+40−0
@@ -0,0 +1,40 @@
1+/*
2+ * Copyright 2021 Red Hat 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+#include "ram.h"
23+
24+#include <subdev/bios.h>
25+#include <subdev/bios/init.h>
26+#include <subdev/bios/rammap.h>
27+
28+static const struct nvkm_ram_func
29+ga102_ram = {
30+};
31+
32+int
33+ga102_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram)
34+{
35+ struct nvkm_device *device = fb->subdev.device;
36+ enum nvkm_ram_type type = nvkm_fb_bios_memtype(device->bios);
37+ u32 size = nvkm_rd32(device, 0x1183a4);
38+
39+ return nvkm_ram_new_(&ga102_ram, fb, type, (u64)size << 20, pram);
40+}
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/Kbuild+1−0
@@ -5,3 +5,4 @@ nvkm-y += nvkm/subdev/gpio/nv50.o · 4 unmodified lines
55 nvkm-y += nvkm/subdev/gpio/g94.o
66 nvkm-y += nvkm/subdev/gpio/gf119.o
77 nvkm-y += nvkm/subdev/gpio/gk104.o
8+nvkm-y += nvkm/subdev/gpio/ga102.o
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/ga102.c+118−0
@@ -0,0 +1,118 @@
1+/*
2+ * Copyright 2021 Red Hat 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+#include "priv.h"
23+
24+static void
25+ga102_gpio_reset(struct nvkm_gpio *gpio, u8 match)
26+{
27+ struct nvkm_device *device = gpio->subdev.device;
28+ struct nvkm_bios *bios = device->bios;
29+ u8 ver, len;
30+ u16 entry;
31+ int ent = -1;
32+
33+ while ((entry = dcb_gpio_entry(bios, 0, ++ent, &ver, &len))) {
34+ u32 data = nvbios_rd32(bios, entry);
35+ u8 line = (data & 0x0000003f);
36+ u8 defs = !!(data & 0x00000080);
37+ u8 func = (data & 0x0000ff00) >> 8;
38+ u8 unk0 = (data & 0x00ff0000) >> 16;
39+ u8 unk1 = (data & 0x1f000000) >> 24;
40+
41+ if ( func == DCB_GPIO_UNUSED ||
42+ (match != DCB_GPIO_UNUSED && match != func))
43+ continue;
44+
45+ nvkm_gpio_set(gpio, 0, func, line, defs);
46+
47+ nvkm_mask(device, 0x021200 + (line * 4), 0xff, unk0);
48+ if (unk1--)
49+ nvkm_mask(device, 0x00d740 + (unk1 * 4), 0xff, line);
50+ }
51+}
52+
53+static int
54+ga102_gpio_drive(struct nvkm_gpio *gpio, int line, int dir, int out)
55+{
56+ struct nvkm_device *device = gpio->subdev.device;
57+ u32 data = ((dir ^ 1) << 13) | (out << 12);
58+ nvkm_mask(device, 0x021200 + (line * 4), 0x00003000, data);
59+ nvkm_mask(device, 0x00d604, 0x00000001, 0x00000001); /* update? */
60+ return 0;
61+}
62+
63+static int
64+ga102_gpio_sense(struct nvkm_gpio *gpio, int line)
65+{
66+ struct nvkm_device *device = gpio->subdev.device;
67+ return !!(nvkm_rd32(device, 0x021200 + (line * 4)) & 0x00004000);
68+}
69+
70+static void
71+ga102_gpio_intr_stat(struct nvkm_gpio *gpio, u32 *hi, u32 *lo)
72+{
73+ struct nvkm_device *device = gpio->subdev.device;
74+ u32 intr0 = nvkm_rd32(device, 0x021640);
75+ u32 intr1 = nvkm_rd32(device, 0x02164c);
76+ u32 stat0 = nvkm_rd32(device, 0x021648) & intr0;
77+ u32 stat1 = nvkm_rd32(device, 0x021654) & intr1;
78+ *lo = (stat1 & 0xffff0000) | (stat0 >> 16);
79+ *hi = (stat1 << 16) | (stat0 & 0x0000ffff);
80+ nvkm_wr32(device, 0x021640, intr0);
81+ nvkm_wr32(device, 0x02164c, intr1);
82+}
83+
84+static void
85+ga102_gpio_intr_mask(struct nvkm_gpio *gpio, u32 type, u32 mask, u32 data)
86+{
87+ struct nvkm_device *device = gpio->subdev.device;
88+ u32 inte0 = nvkm_rd32(device, 0x021648);
89+ u32 inte1 = nvkm_rd32(device, 0x021654);
90+ if (type & NVKM_GPIO_LO)
91+ inte0 = (inte0 & ~(mask << 16)) | (data << 16);
92+ if (type & NVKM_GPIO_HI)
93+ inte0 = (inte0 & ~(mask & 0xffff)) | (data & 0xffff);
94+ mask >>= 16;
95+ data >>= 16;
96+ if (type & NVKM_GPIO_LO)
97+ inte1 = (inte1 & ~(mask << 16)) | (data << 16);
98+ if (type & NVKM_GPIO_HI)
99+ inte1 = (inte1 & ~mask) | data;
100+ nvkm_wr32(device, 0x021648, inte0);
101+ nvkm_wr32(device, 0x021654, inte1);
102+}
103+
104+static const struct nvkm_gpio_func
105+ga102_gpio = {
106+ .lines = 32,
107+ .intr_stat = ga102_gpio_intr_stat,
108+ .intr_mask = ga102_gpio_intr_mask,
109+ .drive = ga102_gpio_drive,
110+ .sense = ga102_gpio_sense,
111+ .reset = ga102_gpio_reset,
112+};
113+
114+int
115+ga102_gpio_new(struct nvkm_device *device, int index, struct nvkm_gpio **pgpio)
116+{
117+ return nvkm_gpio_new_(&ga102_gpio, device, index, pgpio);
118+}
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/Kbuild+1−0
@@ -7,6 +7,7 @@ nvkm-y += nvkm/subdev/i2c/g94.o · 6 unmodified lines
77 nvkm-y += nvkm/subdev/i2c/gf117.o
88 nvkm-y += nvkm/subdev/i2c/gf119.o
99 nvkm-y += nvkm/subdev/i2c/gk104.o
10+nvkm-y += nvkm/subdev/i2c/gk110.o
1011 nvkm-y += nvkm/subdev/i2c/gm200.o
1112
1213 nvkm-y += nvkm/subdev/i2c/pad.o
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h+7−0
@@ -3,6 +3,13 @@ · 2 unmodified lines
33 #define __NVKM_I2C_AUX_H__
44 #include "pad.h"
55
6+static inline void
7+nvkm_i2c_aux_autodpcd(struct nvkm_i2c *i2c, int aux, bool enable)
8+{
9+ if (i2c->func->aux_autodpcd)
10+ i2c->func->aux_autodpcd(i2c, aux, false);
11+}
12+
613 struct nvkm_i2c_aux_func {
714 bool address_only;
815 int (*xfer)(struct nvkm_i2c_aux *, bool retry, u8 type,
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c+7−3
@@ -77,7 +77,8 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 76 unmodified lines
7777 u8 type, u32 addr, u8 *data, u8 *size)
7878 {
7979 struct g94_i2c_aux *aux = g94_i2c_aux(obj);
80− struct nvkm_device *device = aux->base.pad->i2c->subdev.device;
80+ struct nvkm_i2c *i2c = aux->base.pad->i2c;
81+ struct nvkm_device *device = i2c->subdev.device;
8182 const u32 base = aux->ch * 0x50;
8283 u32 ctrl, stat, timeout, retries = 0;
8384 u32 xbuf[4] = {};
@@ -96,6 +97,8 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 12 unmodified lines
9697 goto out;
9798 }
9899
100+ nvkm_i2c_aux_autodpcd(i2c, aux->ch, false);
101+
99102 if (!(type & 1)) {
100103 memcpy(xbuf, data, *size);
101104 for (i = 0; i < 16; i += 4) {
@@ -128,7 +131,7 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 26 unmodified lines
128131 if (!timeout--) {
129132 AUX_ERR(&aux->base, "timeout %08x", ctrl);
130133 ret = -EIO;
131− goto out;
134+ goto out_err;
132135 }
133136 } while (ctrl & 0x00010000);
134137 ret = 0;
@@ -154,7 +157,8 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 19 unmodified lines
154157 memcpy(data, xbuf, *size);
155158 *size = stat & 0x0000001f;
156159 }
157−
160+out_err:
161+ nvkm_i2c_aux_autodpcd(i2c, aux->ch, true);
158162 out:
159163 g94_i2c_aux_fini(aux);
160164 return ret < 0 ? ret : (stat & 0x000f0000) >> 16;
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c+11−6
@@ -33,7 +33,7 @@ static void · 32 unmodified lines
3333 gm200_i2c_aux_fini(struct gm200_i2c_aux *aux)
3434 {
3535 struct nvkm_device *device = aux->base.pad->i2c->subdev.device;
36− nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00310000, 0x00000000);
36+ nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00710000, 0x00000000);
3737 }
3838
3939 static int
@@ -54,10 +54,10 @@ gm200_i2c_aux_init(struct gm200_i2c_aux *aux) · 14 unmodified lines
5454 AUX_ERR(&aux->base, "begin idle timeout %08x", ctrl);
5555 return -EBUSY;
5656 }
57− } while (ctrl & 0x03010000);
57+ } while (ctrl & 0x07010000);
5858
5959 /* set some magic, and wait up to 1ms for it to appear */
60− nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00300000, ureq);
60+ nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00700000, ureq);
6161 timeout = 1000;
6262 do {
6363 ctrl = nvkm_rd32(device, 0x00d954 + (aux->ch * 0x50));
@@ -67,7 +67,7 @@ gm200_i2c_aux_init(struct gm200_i2c_aux *aux) · 3 unmodified lines
6767 gm200_i2c_aux_fini(aux);
6868 return -EBUSY;
6969 }
70− } while ((ctrl & 0x03000000) != urep);
70+ } while ((ctrl & 0x07000000) != urep);
7171
7272 return 0;
7373 }
@@ -77,7 +77,8 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 3 unmodified lines
7777 u8 type, u32 addr, u8 *data, u8 *size)
7878 {
7979 struct gm200_i2c_aux *aux = gm200_i2c_aux(obj);
80− struct nvkm_device *device = aux->base.pad->i2c->subdev.device;
80+ struct nvkm_i2c *i2c = aux->base.pad->i2c;
81+ struct nvkm_device *device = i2c->subdev.device;
8182 const u32 base = aux->ch * 0x50;
8283 u32 ctrl, stat, timeout, retries = 0;
8384 u32 xbuf[4] = {};
@@ -96,6 +97,8 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 12 unmodified lines
9697 goto out;
9798 }
9899
100+ nvkm_i2c_aux_autodpcd(i2c, aux->ch, false);
101+
99102 if (!(type & 1)) {
100103 memcpy(xbuf, data, *size);
101104 for (i = 0; i < 16; i += 4) {
@@ -128,7 +131,7 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 26 unmodified lines
128131 if (!timeout--) {
129132 AUX_ERR(&aux->base, "timeout %08x", ctrl);
130133 ret = -EIO;
131− goto out;
134+ goto out_err;
132135 }
133136 } while (ctrl & 0x00010000);
134137 ret = 0;
@@ -155,6 +158,8 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 20 unmodified lines
155158 *size = stat & 0x0000001f;
156159 }
157160
161+out_err:
162+ nvkm_i2c_aux_autodpcd(i2c, aux->ch, true);
158163 out:
159164 gm200_i2c_aux_fini(aux);
160165 return ret < 0 ? ret : (stat & 0x000f0000) >> 16;
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/gk110.c+45−0
@@ -0,0 +1,45 @@
1+/*
2+ * Copyright 2021 Red Hat 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+#include "priv.h"
23+#include "pad.h"
24+
25+static void
26+gk110_aux_autodpcd(struct nvkm_i2c *i2c, int aux, bool enable)
27+{
28+ nvkm_mask(i2c->subdev.device, 0x00e4f8 + (aux * 0x50), 0x00010000, enable << 16);
29+}
30+
31+static const struct nvkm_i2c_func
32+gk110_i2c = {
33+ .pad_x_new = gf119_i2c_pad_x_new,
34+ .pad_s_new = gf119_i2c_pad_s_new,
35+ .aux = 4,
36+ .aux_stat = gk104_aux_stat,
37+ .aux_mask = gk104_aux_mask,
38+ .aux_autodpcd = gk110_aux_autodpcd,
39+};
40+
41+int
42+gk110_i2c_new(struct nvkm_device *device, int index, struct nvkm_i2c **pi2c)
43+{
44+ return nvkm_i2c_new_(&gk110_i2c, device, index, pi2c);
45+}
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/gm200.c+7−0
@@ -24,6 +24,12 @@ · 23 unmodified lines
2424 #include "priv.h"
2525 #include "pad.h"
2626
27+static void
28+gm200_aux_autodpcd(struct nvkm_i2c *i2c, int aux, bool enable)
29+{
30+ nvkm_mask(i2c->subdev.device, 0x00d968 + (aux * 0x50), 0x00010000, enable << 16);
31+}
32+
2733 static const struct nvkm_i2c_func
2834 gm200_i2c = {
2935 .pad_x_new = gf119_i2c_pad_x_new,
@@ -31,6 +37,7 @@ gm200_i2c = { · 1 unmodified line
3137 .aux = 8,
3238 .aux_stat = gk104_aux_stat,
3339 .aux_mask = gk104_aux_mask,
40+ .aux_autodpcd = gm200_aux_autodpcd,
3441 };
3542
3643 int
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.h+1−1
@@ -1,7 +1,7 @@
11 /* SPDX-License-Identifier: MIT */
22 #ifndef __NVKM_I2C_PAD_H__
33 #define __NVKM_I2C_PAD_H__
4−#include <subdev/i2c.h>
4+#include "priv.h"
55
66 struct nvkm_i2c_pad {
77 const struct nvkm_i2c_pad_func *func;
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/priv.h+4−0
@@ -23,6 +23,10 @@ struct nvkm_i2c_func { · 22 unmodified lines
2323 /* mask on/off interrupt types for a given set of auxch
2424 */
2525 void (*aux_mask)(struct nvkm_i2c *, u32, u32, u32);
26+
27+ /* enable/disable HW-initiated DPCD reads
28+ */
29+ void (*aux_autodpcd)(struct nvkm_i2c *, int aux, bool enable);
2630 };
2731
2832 void g94_aux_stat(struct nvkm_i2c *, u32 *, u32 *, u32 *, u32 *);
drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gf100.c+7−3
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 * Authors: Ben Skeggs
2323 */
2424 #include "priv.h"
25+#include <subdev/timer.h>
2526
2627 static void
2728 gf100_ibus_intr_hub(struct nvkm_subdev *ibus, int i)
@@ -31,7 +32,6 @@ gf100_ibus_intr_hub(struct nvkm_subdev *ibus, int i) · 3 unmodified lines
3132 u32 data = nvkm_rd32(device, 0x122124 + (i * 0x0400));
3233 u32 stat = nvkm_rd32(device, 0x122128 + (i * 0x0400));
3334 nvkm_debug(ibus, "HUB%d: %06x %08x (%08x)\n", i, addr, data, stat);
34− nvkm_mask(device, 0x122128 + (i * 0x0400), 0x00000200, 0x00000000);
3535 }
3636
3737 static void
@@ -42,7 +42,6 @@ gf100_ibus_intr_rop(struct nvkm_subdev *ibus, int i) · 4 unmodified lines
4242 u32 data = nvkm_rd32(device, 0x124124 + (i * 0x0400));
4343 u32 stat = nvkm_rd32(device, 0x124128 + (i * 0x0400));
4444 nvkm_debug(ibus, "ROP%d: %06x %08x (%08x)\n", i, addr, data, stat);
45− nvkm_mask(device, 0x124128 + (i * 0x0400), 0x00000200, 0x00000000);
4645 }
4746
4847 static void
@@ -53,7 +52,6 @@ gf100_ibus_intr_gpc(struct nvkm_subdev *ibus, int i) · 4 unmodified lines
5352 u32 data = nvkm_rd32(device, 0x128124 + (i * 0x0400));
5453 u32 stat = nvkm_rd32(device, 0x128128 + (i * 0x0400));
5554 nvkm_debug(ibus, "GPC%d: %06x %08x (%08x)\n", i, addr, data, stat);
56− nvkm_mask(device, 0x128128 + (i * 0x0400), 0x00000200, 0x00000000);
5755 }
5856
5957 void
@@ -90,6 +88,12 @@ gf100_ibus_intr(struct nvkm_subdev *ibus) · 30 unmodified lines
9088 intr1 &= ~stat;
9189 }
9290 }
91+
92+ nvkm_mask(device, 0x121c4c, 0x0000003f, 0x00000002);
93+ nvkm_msec(device, 2000,
94+ if (!(nvkm_rd32(device, 0x121c4c) & 0x0000003f))
95+ break;
96+ );
9397 }
9498
9599 static int
drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gk104.c+7−3
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 * Authors: Ben Skeggs
2323 */
2424 #include "priv.h"
25+#include <subdev/timer.h>
2526
2627 static void
2728 gk104_ibus_intr_hub(struct nvkm_subdev *ibus, int i)
@@ -31,7 +32,6 @@ gk104_ibus_intr_hub(struct nvkm_subdev *ibus, int i) · 3 unmodified lines
3132 u32 data = nvkm_rd32(device, 0x122124 + (i * 0x0800));
3233 u32 stat = nvkm_rd32(device, 0x122128 + (i * 0x0800));
3334 nvkm_debug(ibus, "HUB%d: %06x %08x (%08x)\n", i, addr, data, stat);
34− nvkm_mask(device, 0x122128 + (i * 0x0800), 0x00000200, 0x00000000);
3535 }
3636
3737 static void
@@ -42,7 +42,6 @@ gk104_ibus_intr_rop(struct nvkm_subdev *ibus, int i) · 4 unmodified lines
4242 u32 data = nvkm_rd32(device, 0x124124 + (i * 0x0800));
4343 u32 stat = nvkm_rd32(device, 0x124128 + (i * 0x0800));
4444 nvkm_debug(ibus, "ROP%d: %06x %08x (%08x)\n", i, addr, data, stat);
45− nvkm_mask(device, 0x124128 + (i * 0x0800), 0x00000200, 0x00000000);
4645 }
4746
4847 static void
@@ -53,7 +52,6 @@ gk104_ibus_intr_gpc(struct nvkm_subdev *ibus, int i) · 4 unmodified lines
5352 u32 data = nvkm_rd32(device, 0x128124 + (i * 0x0800));
5453 u32 stat = nvkm_rd32(device, 0x128128 + (i * 0x0800));
5554 nvkm_debug(ibus, "GPC%d: %06x %08x (%08x)\n", i, addr, data, stat);
56− nvkm_mask(device, 0x128128 + (i * 0x0800), 0x00000200, 0x00000000);
5755 }
5856
5957 void
@@ -90,6 +88,12 @@ gk104_ibus_intr(struct nvkm_subdev *ibus) · 30 unmodified lines
9088 intr1 &= ~stat;
9189 }
9290 }
91+
92+ nvkm_mask(device, 0x12004c, 0x0000003f, 0x00000002);
93+ nvkm_msec(device, 2000,
94+ if (!(nvkm_rd32(device, 0x12004c) & 0x0000003f))
95+ break;
96+ );
9397 }
9498
9599 static int
drivers/gpu/drm/nouveau/nvkm/subdev/mc/Kbuild+1−0
@@ -14,3 +14,4 @@ nvkm-y += nvkm/subdev/mc/gk20a.o · 13 unmodified lines
1414 nvkm-y += nvkm/subdev/mc/gp100.o
1515 nvkm-y += nvkm/subdev/mc/gp10b.o
1616 nvkm-y += nvkm/subdev/mc/tu102.o
17+nvkm-y += nvkm/subdev/mc/ga100.o
drivers/gpu/drm/nouveau/nvkm/subdev/mc/ga100.c+74−0
@@ -0,0 +1,74 @@
1+/*
2+ * Copyright 2021 Red Hat 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+#include "priv.h"
23+
24+static void
25+ga100_mc_intr_unarm(struct nvkm_mc *mc)
26+{
27+ nvkm_wr32(mc->subdev.device, 0xb81610, 0x00000004);
28+}
29+
30+static void
31+ga100_mc_intr_rearm(struct nvkm_mc *mc)
32+{
33+ nvkm_wr32(mc->subdev.device, 0xb81608, 0x00000004);
34+}
35+
36+static void
37+ga100_mc_intr_mask(struct nvkm_mc *mc, u32 mask, u32 intr)
38+{
39+ nvkm_wr32(mc->subdev.device, 0xb81210, mask & intr );
40+ nvkm_wr32(mc->subdev.device, 0xb81410, mask & ~(mask & intr));
41+}
42+
43+static u32
44+ga100_mc_intr_stat(struct nvkm_mc *mc)
45+{
46+ u32 intr_top = nvkm_rd32(mc->subdev.device, 0xb81600), intr = 0x00000000;
47+ if (intr_top & 0x00000004)
48+ intr = nvkm_mask(mc->subdev.device, 0xb81010, 0x00000000, 0x00000000);
49+ return intr;
50+}
51+
52+static void
53+ga100_mc_init(struct nvkm_mc *mc)
54+{
55+ nv50_mc_init(mc);
56+ nvkm_wr32(mc->subdev.device, 0xb81210, 0xffffffff);
57+}
58+
59+static const struct nvkm_mc_func
60+ga100_mc = {
61+ .init = ga100_mc_init,
62+ .intr = gp100_mc_intr,
63+ .intr_unarm = ga100_mc_intr_unarm,
64+ .intr_rearm = ga100_mc_intr_rearm,
65+ .intr_mask = ga100_mc_intr_mask,
66+ .intr_stat = ga100_mc_intr_stat,
67+ .reset = gk104_mc_reset,
68+};
69+
70+int
71+ga100_mc_new(struct nvkm_device *device, int index, struct nvkm_mc **pmc)
72+{
73+ return nvkm_mc_new_(&ga100_mc, device, index, pmc);
74+}
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c+3−3
@@ -316,9 +316,9 @@ nvkm_mmu_vram(struct nvkm_mmu *mmu) · 315 unmodified lines
316316 {
317317 struct nvkm_device *device = mmu->subdev.device;
318318 struct nvkm_mm *mm = &device->fb->ram->vram;
319− const u32 sizeN = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NORMAL);
320− const u32 sizeU = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NOMAP);
321− const u32 sizeM = nvkm_mm_heap_size(mm, NVKM_RAM_MM_MIXED);
319+ const u64 sizeN = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NORMAL);
320+ const u64 sizeU = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NOMAP);
321+ const u64 sizeM = nvkm_mm_heap_size(mm, NVKM_RAM_MM_MIXED);
322322 u8 type = NVKM_MEM_KIND * !!mmu->func->kind;
323323 u8 heap = NVKM_MEM_VRAM;
324324 int heapM, heapN, heapU;
drivers/gpu/drm/radeon/radeon_ttm.c+0−3
@@ -730,9 +730,6 @@ int radeon_ttm_init(struct radeon_device *rdev) · 729 unmodified lines
730730 }
731731 rdev->mman.initialized = true;
732732
733− ttm_pool_init(&rdev->mman.bdev.pool, rdev->dev, rdev->need_swiotlb,
734− dma_addressing_limited(&rdev->pdev->dev));
735−
736733 r = radeon_ttm_init_vram(rdev);
737734 if (r) {
738735 DRM_ERROR("Failed initializing VRAM heap.\n");
drivers/gpu/drm/sun4i/sun4i_tcon.c+25−0
@@ -689,6 +689,30 @@ static void sun4i_tcon1_mode_set(struct sun4i_tcon *tcon, · 688 unmodified lines
689689 SUN4I_TCON1_BASIC5_V_SYNC(vsync) |
690690 SUN4I_TCON1_BASIC5_H_SYNC(hsync));
691691
692+ /* Setup the polarity of multiple signals */
693+ if (tcon->quirks->polarity_in_ch0) {
694+ val = 0;
695+
696+ if (mode->flags & DRM_MODE_FLAG_PHSYNC)
697+ val |= SUN4I_TCON0_IO_POL_HSYNC_POSITIVE;
698+
699+ if (mode->flags & DRM_MODE_FLAG_PVSYNC)
700+ val |= SUN4I_TCON0_IO_POL_VSYNC_POSITIVE;
701+
702+ regmap_write(tcon->regs, SUN4I_TCON0_IO_POL_REG, val);
703+ } else {
704+ /* according to vendor driver, this bit must be always set */
705+ val = SUN4I_TCON1_IO_POL_UNKNOWN;
706+
707+ if (mode->flags & DRM_MODE_FLAG_PHSYNC)
708+ val |= SUN4I_TCON1_IO_POL_HSYNC_POSITIVE;
709+
710+ if (mode->flags & DRM_MODE_FLAG_PVSYNC)
711+ val |= SUN4I_TCON1_IO_POL_VSYNC_POSITIVE;
712+
713+ regmap_write(tcon->regs, SUN4I_TCON1_IO_POL_REG, val);
714+ }
715+
692716 /* Map output pins to channel 1 */
693717 regmap_update_bits(tcon->regs, SUN4I_TCON_GCTL_REG,
694718 SUN4I_TCON_GCTL_IOMAP_MASK,
@@ -1517,6 +1541,7 @@ static const struct sun4i_tcon_quirks sun8i_a83t_tv_quirks = { · 822 unmodified lines
15171541
15181542 static const struct sun4i_tcon_quirks sun8i_r40_tv_quirks = {
15191543 .has_channel_1 = true,
1544+ .polarity_in_ch0 = true,
15201545 .set_mux = sun8i_r40_tcon_tv_set_mux,
15211546 };
15221547
drivers/gpu/drm/sun4i/sun4i_tcon.h+6−0
@@ -153,6 +153,11 @@ · 152 unmodified lines
153153 #define SUN4I_TCON1_BASIC5_V_SYNC(height) (((height) - 1) & 0x3ff)
154154
155155 #define SUN4I_TCON1_IO_POL_REG 0xf0
156+/* there is no documentation about this bit */
157+#define SUN4I_TCON1_IO_POL_UNKNOWN BIT(26)
158+#define SUN4I_TCON1_IO_POL_HSYNC_POSITIVE BIT(25)
159+#define SUN4I_TCON1_IO_POL_VSYNC_POSITIVE BIT(24)
160+
156161 #define SUN4I_TCON1_IO_TRI_REG 0xf4
157162
158163 #define SUN4I_TCON_ECC_FIFO_REG 0xf8
@@ -235,6 +240,7 @@ struct sun4i_tcon_quirks { · 76 unmodified lines
235240 bool needs_de_be_mux; /* sun6i needs mux to select backend */
236241 bool needs_edp_reset; /* a80 edp reset needed for tcon0 access */
237242 bool supports_lvds; /* Does the TCON support an LVDS output? */
243+ bool polarity_in_ch0; /* some tcon1 channels have polarity bits in tcon0 pol register */
238244 u8 dclk_min_div; /* minimum divider for TCON0 DCLK */
239245
240246 /* callback to handle tcon muxing options */
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c+3−7
@@ -21,8 +21,7 @@ static void sun8i_dw_hdmi_encoder_mode_set(struct drm_encoder *encoder, · 20 unmodified lines
2121 {
2222 struct sun8i_dw_hdmi *hdmi = encoder_to_sun8i_dw_hdmi(encoder);
2323
24− if (hdmi->quirks->set_rate)
25− clk_set_rate(hdmi->clk_tmds, mode->crtc_clock * 1000);
24+ clk_set_rate(hdmi->clk_tmds, mode->crtc_clock * 1000);
2625 }
2726
2827 static const struct drm_encoder_helper_funcs
@@ -48,11 +47,9 @@ sun8i_dw_hdmi_mode_valid_h6(struct dw_hdmi *hdmi, void *data, · 19 unmodified lines
4847 {
4948 /*
5049 * Controller support maximum of 594 MHz, which correlates to
51− * 4K@60Hz 4:4:4 or RGB. However, for frequencies greater than
52− * 340 MHz scrambling has to be enabled. Because scrambling is
53− * not yet implemented, just limit to 340 MHz for now.
50+ * 4K@60Hz 4:4:4 or RGB.
5451 */
55− if (mode->clock > 340000)
52+ if (mode->clock > 594000)
5653 return MODE_CLOCK_HIGH;
5754
5855 return MODE_OK;
@@ -295,7 +292,6 @@ static int sun8i_dw_hdmi_remove(struct platform_device *pdev) · 236 unmodified lines
295292
296293 static const struct sun8i_dw_hdmi_quirks sun8i_a83t_quirks = {
297294 .mode_valid = sun8i_dw_hdmi_mode_valid_a83t,
298− .set_rate = true,
299295 };
300296
301297 static const struct sun8i_dw_hdmi_quirks sun50i_h6_quirks = {
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h+0−1
@@ -179,7 +179,6 @@ struct sun8i_dw_hdmi_quirks { · 178 unmodified lines
179179 enum drm_mode_status (*mode_valid)(struct dw_hdmi *hdmi, void *data,
180180 const struct drm_display_info *info,
181181 const struct drm_display_mode *mode);
182− unsigned int set_rate : 1;
183182 unsigned int use_drm_infoframe : 1;
184183 };
185184
drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c+9−17
@@ -104,29 +104,21 @@ static const struct dw_hdmi_mpll_config sun50i_h6_mpll_cfg[] = { · 103 unmodified lines
104104
105105 static const struct dw_hdmi_curr_ctrl sun50i_h6_cur_ctr[] = {
106106 /* pixelclk bpp8 bpp10 bpp12 */
107− { 25175000, { 0x0000, 0x0000, 0x0000 }, },
108107 { 27000000, { 0x0012, 0x0000, 0x0000 }, },
109− { 59400000, { 0x0008, 0x0008, 0x0008 }, },
110− { 72000000, { 0x0008, 0x0008, 0x001b }, },
111− { 74250000, { 0x0013, 0x0013, 0x0013 }, },
112− { 90000000, { 0x0008, 0x001a, 0x001b }, },
113− { 118800000, { 0x001b, 0x001a, 0x001b }, },
114− { 144000000, { 0x001b, 0x001a, 0x0034 }, },
115− { 180000000, { 0x001b, 0x0033, 0x0034 }, },
116− { 216000000, { 0x0036, 0x0033, 0x0034 }, },
117− { 237600000, { 0x0036, 0x0033, 0x001b }, },
118− { 288000000, { 0x0036, 0x001b, 0x001b }, },
119− { 297000000, { 0x0019, 0x001b, 0x0019 }, },
120− { 330000000, { 0x0036, 0x001b, 0x001b }, },
121− { 594000000, { 0x003f, 0x001b, 0x001b }, },
108+ { 74250000, { 0x0013, 0x001a, 0x001b }, },
109+ { 148500000, { 0x0019, 0x0033, 0x0034 }, },
110+ { 297000000, { 0x0019, 0x001b, 0x001b }, },
111+ { 594000000, { 0x0010, 0x001b, 0x001b }, },
122112 { ~0UL, { 0x0000, 0x0000, 0x0000 }, }
123113 };
124114
125115 static const struct dw_hdmi_phy_config sun50i_h6_phy_config[] = {
126116 /*pixelclk symbol term vlev*/
127− { 74250000, 0x8009, 0x0004, 0x0232},
128− { 148500000, 0x8029, 0x0004, 0x0273},
129− { 594000000, 0x8039, 0x0004, 0x014a},
117+ { 27000000, 0x8009, 0x0007, 0x02b0 },
118+ { 74250000, 0x8009, 0x0006, 0x022d },
119+ { 148500000, 0x8029, 0x0006, 0x0270 },
120+ { 297000000, 0x8039, 0x0005, 0x01ab },
121+ { 594000000, 0x8029, 0x0000, 0x008a },
130122 { ~0UL, 0x0000, 0x0000, 0x0000}
131123 };
132124
drivers/gpu/drm/ttm/ttm_pool.c+27−18
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333
3434 #include <linux/module.h>
3535 #include <linux/dma-mapping.h>
36+#include <linux/highmem.h>
3637
3738 #ifdef CONFIG_X86
3839 #include <asm/set_memory.h>
@@ -66,7 +67,7 @@ static struct ttm_pool_type global_uncached[MAX_ORDER]; · 27 unmodified lines
6667 static struct ttm_pool_type global_dma32_write_combined[MAX_ORDER];
6768 static struct ttm_pool_type global_dma32_uncached[MAX_ORDER];
6869
69−static spinlock_t shrinker_lock;
70+static struct mutex shrinker_lock;
7071 static struct list_head shrinker_list;
7172 static struct shrinker mm_shrinker;
7273
@@ -79,12 +80,13 @@ static struct page *ttm_pool_alloc_page(struct ttm_pool *pool, gfp_t gfp_flags, · 6 unmodified lines
7980 struct page *p;
8081 void *vaddr;
8182
82− if (order) {
83− gfp_flags |= GFP_TRANSHUGE_LIGHT | __GFP_NORETRY |
83+ /* Don't set the __GFP_COMP flag for higher order allocations.
84+ * Mapping pages directly into an userspace process and calling
85+ * put_page() on a TTM allocated page is illegal.
86+ */
87+ if (order)
88+ gfp_flags |= __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN |
8489 __GFP_KSWAPD_RECLAIM;
85− gfp_flags &= ~__GFP_MOVABLE;
86− gfp_flags &= ~__GFP_COMP;
87− }
8890
8991 if (!pool->use_dma_alloc) {
9092 p = alloc_pages(gfp_flags, order);
@@ -190,7 +192,7 @@ static int ttm_pool_map(struct ttm_pool *pool, unsigned int order, · 99 unmodified lines
190192 size_t size = (1ULL << order) * PAGE_SIZE;
191193
192194 addr = dma_map_page(pool->dev, p, 0, size, DMA_BIDIRECTIONAL);
193− if (dma_mapping_error(pool->dev, **dma_addr))
195+ if (dma_mapping_error(pool->dev, addr))
194196 return -EFAULT;
195197 }
196198
@@ -217,6 +219,15 @@ static void ttm_pool_unmap(struct ttm_pool *pool, dma_addr_t dma_addr, · 20 unmodified lines
217219 /* Give pages into a specific pool_type */
218220 static void ttm_pool_type_give(struct ttm_pool_type *pt, struct page *p)
219221 {
222+ unsigned int i, num_pages = 1 << pt->order;
223+
224+ for (i = 0; i < num_pages; ++i) {
225+ if (PageHighMem(p))
226+ clear_highpage(p + i);
227+ else
228+ clear_page(page_address(p + i));
229+ }
230+
220231 spin_lock(&pt->lock);
221232 list_add(&p->lru, &pt->pages);
222233 spin_unlock(&pt->lock);
@@ -249,9 +260,9 @@ static void ttm_pool_type_init(struct ttm_pool_type *pt, struct ttm_pool *pool, · 26 unmodified lines
249260 spin_lock_init(&pt->lock);
250261 INIT_LIST_HEAD(&pt->pages);
251262
252− spin_lock(&shrinker_lock);
263+ mutex_lock(&shrinker_lock);
253264 list_add_tail(&pt->shrinker_list, &shrinker_list);
254− spin_unlock(&shrinker_lock);
265+ mutex_unlock(&shrinker_lock);
255266 }
256267
257268 /* Remove a pool_type from the global shrinker list and free all pages */
@@ -259,9 +270,9 @@ static void ttm_pool_type_fini(struct ttm_pool_type *pt) · 1 unmodified line
259270 {
260271 struct page *p, *tmp;
261272
262− spin_lock(&shrinker_lock);
273+ mutex_lock(&shrinker_lock);
263274 list_del(&pt->shrinker_list);
264− spin_unlock(&shrinker_lock);
275+ mutex_unlock(&shrinker_lock);
265276
266277 list_for_each_entry_safe(p, tmp, &pt->pages, lru)
267278 ttm_pool_free_page(pt->pool, pt->caching, pt->order, p);
@@ -302,7 +313,7 @@ static unsigned int ttm_pool_shrink(void) · 34 unmodified lines
302313 unsigned int num_freed;
303314 struct page *p;
304315
305− spin_lock(&shrinker_lock);
316+ mutex_lock(&shrinker_lock);
306317 pt = list_first_entry(&shrinker_list, typeof(*pt), shrinker_list);
307318
308319 p = ttm_pool_type_take(pt);
@@ -314,7 +325,7 @@ static unsigned int ttm_pool_shrink(void) · 5 unmodified lines
314325 }
315326
316327 list_move_tail(&pt->shrinker_list, &shrinker_list);
317− spin_unlock(&shrinker_lock);
328+ mutex_unlock(&shrinker_lock);
318329
319330 return num_freed;
320331 }
@@ -507,7 +518,6 @@ void ttm_pool_init(struct ttm_pool *pool, struct device *dev, · 186 unmodified lines
507518 ttm_pool_type_init(&pool->caching[i].orders[j],
508519 pool, i, j);
509520 }
510−EXPORT_SYMBOL(ttm_pool_init);
511521
512522 /**
513523 * ttm_pool_fini - Cleanup a pool
@@ -525,7 +535,6 @@ void ttm_pool_fini(struct ttm_pool *pool) · 11 unmodified lines
525535 for (j = 0; j < MAX_ORDER; ++j)
526536 ttm_pool_type_fini(&pool->caching[i].orders[j]);
527537 }
528−EXPORT_SYMBOL(ttm_pool_fini);
529538
530539 #ifdef CONFIG_DEBUG_FS
531540 /* Count the number of pages available in a pool_type */
@@ -566,7 +575,7 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct seq_file *m) · 34 unmodified lines
566575 {
567576 unsigned int i;
568577
569− spin_lock(&shrinker_lock);
578+ mutex_lock(&shrinker_lock);
570579
571580 seq_puts(m, "\t ");
572581 for (i = 0; i < MAX_ORDER; ++i)
@@ -602,7 +611,7 @@ int ttm_pool_debugfs(struct ttm_pool *pool, struct seq_file *m) · 29 unmodified lines
602611 seq_printf(m, "\ntotal\t: %8lu of %8lu\n",
603612 atomic_long_read(&allocated_pages), page_pool_size);
604613
605− spin_unlock(&shrinker_lock);
614+ mutex_unlock(&shrinker_lock);
606615
607616 return 0;
608617 }
@@ -646,7 +655,7 @@ int ttm_pool_mgr_init(unsigned long num_pages) · 37 unmodified lines
646655 if (!page_pool_size)
647656 page_pool_size = num_pages;
648657
649− spin_lock_init(&shrinker_lock);
658+ mutex_init(&shrinker_lock);
650659 INIT_LIST_HEAD(&shrinker_list);
651660
652661 for (i = 0; i < MAX_ORDER; ++i) {
drivers/gpu/drm/vc4/vc4_hdmi.c+1−0
@@ -1267,6 +1267,7 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) · 1266 unmodified lines
12671267 card->dai_link = dai_link;
12681268 card->num_links = 1;
12691269 card->name = vc4_hdmi->variant->card_name;
1270+ card->driver_name = "vc4-hdmi";
12701271 card->dev = dev;
12711272 card->owner = THIS_MODULE;
12721273
drivers/gpu/drm/vc4/vc4_hvs.c+4−4
@@ -620,11 +620,11 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data) · 619 unmodified lines
620620 * for now we just allocate globally.
621621 */
622622 if (!hvs->hvs5)
623− /* 96kB */
624− drm_mm_init(&hvs->lbm_mm, 0, 96 * 1024);
623+ /* 48k words of 2x12-bit pixels */
624+ drm_mm_init(&hvs->lbm_mm, 0, 48 * 1024);
625625 else
626− /* 70k words */
627− drm_mm_init(&hvs->lbm_mm, 0, 70 * 2 * 1024);
626+ /* 60k words of 4x12-bit pixels */
627+ drm_mm_init(&hvs->lbm_mm, 0, 60 * 1024);
628628
629629 /* Upload filter kernels. We only have the one for now, so we
630630 * keep it around for the lifetime of the driver.
drivers/gpu/drm/vc4/vc4_plane.c+22−7
@@ -220,7 +220,7 @@ static void vc4_plane_reset(struct drm_plane *plane) · 219 unmodified lines
220220 __drm_atomic_helper_plane_reset(plane, &vc4_state->base);
221221 }
222222
223−static void vc4_dlist_write(struct vc4_plane_state *vc4_state, u32 val)
223+static void vc4_dlist_counter_increment(struct vc4_plane_state *vc4_state)
224224 {
225225 if (vc4_state->dlist_count == vc4_state->dlist_size) {
226226 u32 new_size = max(4u, vc4_state->dlist_count * 2);
@@ -235,7 +235,15 @@ static void vc4_dlist_write(struct vc4_plane_state *vc4_state, u32 val) · 8 unmodified lines
235235 vc4_state->dlist_size = new_size;
236236 }
237237
238− vc4_state->dlist[vc4_state->dlist_count++] = val;
238+ vc4_state->dlist_count++;
239+}
240+
241+static void vc4_dlist_write(struct vc4_plane_state *vc4_state, u32 val)
242+{
243+ unsigned int idx = vc4_state->dlist_count;
244+
245+ vc4_dlist_counter_increment(vc4_state);
246+ vc4_state->dlist[idx] = val;
239247 }
240248
241249 /* Returns the scl0/scl1 field based on whether the dimensions need to
@@ -437,6 +445,7 @@ static void vc4_write_ppf(struct vc4_plane_state *vc4_state, u32 src, u32 dst) · 195 unmodified lines
437445 static u32 vc4_lbm_size(struct drm_plane_state *state)
438446 {
439447 struct vc4_plane_state *vc4_state = to_vc4_plane_state(state);
448+ struct vc4_dev *vc4 = to_vc4_dev(state->plane->dev);
440449 u32 pix_per_line;
441450 u32 lbm;
442451
@@ -472,7 +481,11 @@ static u32 vc4_lbm_size(struct drm_plane_state *state) · 29 unmodified lines
472481 lbm = pix_per_line * 16;
473482 }
474483
475− lbm = roundup(lbm, 32);
484+ /* Align it to 64 or 128 (hvs5) bytes */
485+ lbm = roundup(lbm, vc4->hvs->hvs5 ? 128 : 64);
486+
487+ /* Each "word" of the LBM memory contains 2 or 4 (hvs5) pixels */
488+ lbm /= vc4->hvs->hvs5 ? 4 : 2;
476489
477490 return lbm;
478491 }
@@ -912,9 +925,9 @@ static int vc4_plane_mode_set(struct drm_plane *plane, · 433 unmodified lines
912925 if (!vc4_state->is_unity) {
913926 vc4_dlist_write(vc4_state,
914927 VC4_SET_FIELD(vc4_state->crtc_w,
915− SCALER_POS1_SCL_WIDTH) |
928+ SCALER5_POS1_SCL_WIDTH) |
916929 VC4_SET_FIELD(vc4_state->crtc_h,
917− SCALER_POS1_SCL_HEIGHT));
930+ SCALER5_POS1_SCL_HEIGHT));
918931 }
919932
920933 /* Position Word 2: Source Image Size */
@@ -973,8 +986,10 @@ static int vc4_plane_mode_set(struct drm_plane *plane, · 52 unmodified lines
973986 * be set when calling vc4_plane_allocate_lbm().
974987 */
975988 if (vc4_state->y_scaling[0] != VC4_SCALING_NONE ||
976− vc4_state->y_scaling[1] != VC4_SCALING_NONE)
977− vc4_state->lbm_offset = vc4_state->dlist_count++;
989+ vc4_state->y_scaling[1] != VC4_SCALING_NONE) {
990+ vc4_state->lbm_offset = vc4_state->dlist_count;
991+ vc4_dlist_counter_increment(vc4_state);
992+ }
978993
979994 if (num_planes > 1) {
980995 /* Emit Cb/Cr as channel 0 and Y as channel
drivers/gpu/drm/xlnx/zynqmp_disp.c+7−8
@@ -1396,19 +1396,11 @@ static void zynqmp_disp_enable(struct zynqmp_disp *disp) · 1395 unmodified lines
13961396 */
13971397 static void zynqmp_disp_disable(struct zynqmp_disp *disp)
13981398 {
1399− struct drm_crtc *crtc = &disp->crtc;
1400−
14011399 zynqmp_disp_audio_disable(&disp->audio);
14021400
14031401 zynqmp_disp_avbuf_disable_audio(&disp->avbuf);
14041402 zynqmp_disp_avbuf_disable_channels(&disp->avbuf);
14051403 zynqmp_disp_avbuf_disable(&disp->avbuf);
1406−
1407− /* Mark the flip is done as crtc is disabled anyway */
1408− if (crtc->state->event) {
1409− complete_all(crtc->state->event->base.completion);
1410− crtc->state->event = NULL;
1411− }
14121404 }
14131405
14141406 static inline struct zynqmp_disp *crtc_to_disp(struct drm_crtc *crtc)
@@ -1499,6 +1491,13 @@ zynqmp_disp_crtc_atomic_disable(struct drm_crtc *crtc, · 84 unmodified lines
14991491
15001492 drm_crtc_vblank_off(&disp->crtc);
15011493
1494+ spin_lock_irq(&crtc->dev->event_lock);
1495+ if (crtc->state->event) {
1496+ drm_crtc_send_vblank_event(crtc, crtc->state->event);
1497+ crtc->state->event = NULL;
1498+ }
1499+ spin_unlock_irq(&crtc->dev->event_lock);
1500+
15021501 clk_disable_unprepare(disp->pclk);
15031502 pm_runtime_put_sync(disp->dev);
15041503 }
drivers/hid/Kconfig+1−0
@@ -899,6 +899,7 @@ config HID_SONY · 898 unmodified lines
899899 depends on NEW_LEDS
900900 depends on LEDS_CLASS
901901 select POWER_SUPPLY
902+ select CRC32
902903 help
903904 Support for
904905
drivers/hid/amd-sfh-hid/amd_sfh_client.c+4−4
@@ -154,7 +154,7 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata) · 153 unmodified lines
154154
155155 for (i = 0; i < cl_data->num_hid_devices; i++) {
156156 cl_data->sensor_virt_addr[i] = dma_alloc_coherent(dev, sizeof(int) * 8,
157− &cl_data->sensor_phys_addr[i],
157+ &cl_data->sensor_dma_addr[i],
158158 GFP_KERNEL);
159159 cl_data->sensor_sts[i] = 0;
160160 cl_data->sensor_requested_cnt[i] = 0;
@@ -187,7 +187,7 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata) · 26 unmodified lines
187187 }
188188 info.period = msecs_to_jiffies(AMD_SFH_IDLE_LOOP);
189189 info.sensor_idx = cl_idx;
190− info.phys_address = cl_data->sensor_phys_addr[i];

22 more lines aren’t shown here.

drivers/hid/amd-sfh-hid/amd_sfh_hid.h+1−1

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

drivers/hid/amd-sfh-hid/amd_sfh_pcie.c+1−1

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

drivers/hid/amd-sfh-hid/amd_sfh_pcie.h+1−1

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

drivers/hid/hid-ids.h+1−0

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

drivers/hid/hid-input.c+2−0

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

drivers/hid/hid-logitech-dj.c+4−0

This diff is large: its 11 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-multitouch.c+6−1

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

drivers/hid/hid-uclogic-params.c+1−1

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

drivers/hid/hid-wiimote-core.c+1−1

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

drivers/hid/wacom_sys.c+35−5

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

drivers/hid/wacom_wac.h+1−1

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

drivers/hv/vmbus_drv.c+0−2

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

drivers/hwmon/amd_energy.c+2−1

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

drivers/hwmon/pwm-fan.c+11−1

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

drivers/hwtracing/intel_th/pci.c+5−0

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

drivers/hwtracing/stm/heartbeat.c+4−2

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

drivers/i2c/busses/Kconfig+1−0

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

drivers/i2c/busses/i2c-i801.c+1−1

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

drivers/i2c/busses/i2c-imx.c+19−1

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

drivers/i2c/busses/i2c-mt65xx.c+38−8

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

drivers/i2c/busses/i2c-octeon-core.c+1−1

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

drivers/i2c/busses/i2c-sprd.c+7−1

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

drivers/i2c/busses/i2c-stm32f7.c+10−1

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

drivers/i2c/busses/i2c-tegra-bpmp.c+1−1

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

drivers/i2c/busses/i2c-tegra.c+22−2

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

drivers/i3c/master/mipi-i3c-hci/core.c+1−1

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

drivers/iio/adc/ti_am335x_adc.c+1−5

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

drivers/iio/common/st_sensors/st_sensors_trigger.c+17−14

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

drivers/iio/dac/ad5504.c+2−2

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

drivers/iio/proximity/sx9310.c+3−2

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

drivers/iio/temperature/mlx90632.c+6−0

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

drivers/infiniband/core/cma_configfs.c+3−1

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

drivers/infiniband/core/restrack.c+1−0

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

drivers/infiniband/core/ucma.c+72−63

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

drivers/infiniband/core/umem.c+1−1

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

drivers/infiniband/hw/cxgb4/qp.c+1−1

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

drivers/infiniband/hw/hns/hns_roce_device.h+1−1

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

drivers/infiniband/hw/hns/hns_roce_qp.c+6−5

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

drivers/infiniband/hw/mlx5/main.c+4−6

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

drivers/infiniband/hw/ocrdma/ocrdma_verbs.c+1−1

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

drivers/infiniband/hw/usnic/usnic_ib_sysfs.c+3−4

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

drivers/infiniband/hw/usnic/usnic_ib_verbs.c+3−0

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

drivers/infiniband/hw/vmw_pvrdma/pvrdma.h+14−0

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

drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c+1−1

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

drivers/infiniband/sw/rxe/rxe_net.c+6−0

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

drivers/infiniband/sw/rxe/rxe_resp.c+5−0

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

drivers/input/joystick/xpad.c+16−1

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

drivers/input/misc/ariel-pwrbutton.c+0−6

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

drivers/input/serio/i8042-x86ia64io.h+2−0

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

drivers/input/touchscreen/goodix.c+2−0

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

drivers/input/touchscreen/ili210x.c+19−7

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

drivers/input/touchscreen/st1232.c+42−6

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

drivers/interconnect/imx/imx.c+2−1

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

drivers/interconnect/imx/imx8mq.c+2−0

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

drivers/interconnect/qcom/Kconfig+15−8

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

drivers/iommu/amd/amd_iommu.h+2−5

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

drivers/iommu/amd/amd_iommu_types.h+4−0

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

drivers/iommu/amd/init.c+55−4

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

drivers/iommu/amd/iommu.c+3−0

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

drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c+4−0

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

drivers/iommu/dma-iommu.c+0−27

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

drivers/iommu/intel/dmar.c+3−3

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

drivers/iommu/intel/iommu.c+139−42

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

drivers/iommu/intel/irq_remapping.c+2−0

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

drivers/iommu/intel/svm.c+33−12

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

drivers/iommu/iova.c+4−4

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

drivers/irqchip/Kconfig+3−2

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

drivers/irqchip/irq-bcm2836.c+2−2

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

drivers/irqchip/irq-loongson-liointc.c+2−2

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

drivers/irqchip/irq-mips-cpu.c+7−0

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

drivers/irqchip/irq-sl28cpld.c+1−1

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

drivers/isdn/mISDN/Kconfig+1−0

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

drivers/leds/Kconfig+3−0

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

drivers/leds/Makefile+3−0

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

drivers/leds/flash/Kconfig+16−0

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

drivers/leds/flash/Makefile+3−0

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

drivers/leds/flash/leds-rt8515.c+397−0

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

drivers/leds/led-triggers.c+6−4

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

drivers/leds/leds-ariel.c+3−3

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

drivers/leds/leds-lm3533.c+1−1

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

drivers/lightnvm/Kconfig+1−0

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

drivers/lightnvm/core.c+1−2

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

drivers/md/Kconfig+2−0

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

drivers/md/bcache/features.c+1−1

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

drivers/md/bcache/features.h+31−5

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

drivers/md/bcache/super.c+49−4

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

drivers/md/dm-bufio.c+6−0

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

drivers/md/dm-crypt.c+152−18

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

drivers/md/dm-integrity.c+79−13

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

drivers/md/dm-raid.c+3−3

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

drivers/md/dm-snap.c+24−0

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

drivers/md/dm-table.c+12−3

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

drivers/md/dm.c+1−1

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

drivers/md/md.c+2−0

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

drivers/media/cec/platform/Makefile+1−0

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

drivers/media/common/videobuf2/videobuf2-v4l2.c+1−2

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

drivers/media/i2c/ccs-pll.c+1−7

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

drivers/media/i2c/ccs/ccs-data.c+1−1

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

drivers/media/pci/intel/ipu3/ipu3-cio2.c+1−1

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

drivers/media/platform/qcom/venus/core.c+2−0

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

drivers/media/platform/rcar-vin/rcar-core.c+1−1

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

drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c+12−9

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

drivers/media/platform/rockchip/rkisp1/rkisp1-params.c+3−2

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

drivers/media/platform/rockchip/rkisp1/rkisp1-regs.h+1−0

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

drivers/media/platform/rockchip/rkisp1/rkisp1-stats.c+6−5

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

drivers/media/rc/ir-mce_kbd-decoder.c+1−1

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

drivers/media/rc/ite-cir.c+1−1

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

drivers/media/rc/rc-main.c+4−4

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

drivers/media/rc/serial_ir.c+1−1

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

drivers/media/v4l2-core/v4l2-common.c+2−2

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

drivers/misc/cardreader/rtsx_pcr.c+6−1

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

drivers/misc/habanalabs/common/command_submission.c+58−19

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

drivers/misc/habanalabs/common/device.c+15−4

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

drivers/misc/habanalabs/common/firmware_if.c+49−16

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

drivers/misc/habanalabs/common/habanalabs.h+4−1

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

drivers/misc/habanalabs/common/habanalabs_drv.c+1−0

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

drivers/misc/habanalabs/common/habanalabs_ioctl.c+8−1

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

drivers/misc/habanalabs/common/hw_queue.c+4−1

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

drivers/misc/habanalabs/common/memory.c+8−2

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

drivers/misc/habanalabs/common/mmu.c+3−3

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

drivers/misc/habanalabs/common/mmu_v1.c+10−2

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

drivers/misc/habanalabs/common/pci.c+17−11

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

drivers/misc/habanalabs/gaudi/gaudi.c+85−109

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

drivers/misc/habanalabs/gaudi/gaudiP.h+0−7

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

drivers/misc/habanalabs/gaudi/gaudi_coresight.c+2−1

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

drivers/misc/habanalabs/goya/goya.c+47−31

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

drivers/misc/habanalabs/include/common/hl_boot_if.h+8−1

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

drivers/misc/pvpanic.c+15−4

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

drivers/mmc/core/queue.c+3−1

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

drivers/mmc/core/sdio_cis.c+6−0

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

drivers/mmc/host/sdhci-brcmstb.c+1−5

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

drivers/mmc/host/sdhci-of-dwcmshc.c+27−0

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

drivers/mmc/host/sdhci-pltfm.h+6−1

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

drivers/mmc/host/sdhci-xenon.c+6−1

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

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c+1−1

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

drivers/mtd/nand/raw/intel-nand-controller.c+3−2

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

drivers/mtd/nand/raw/nandsim.c+3−4

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

drivers/mtd/nand/raw/omap2.c+9−6

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

drivers/mtd/nand/spi/core.c+11−3

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

drivers/net/arcnet/arc-rimi.c+2−2

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

drivers/net/arcnet/arcdevice.h+6−0

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

drivers/net/arcnet/arcnet.c+62−4

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

drivers/net/arcnet/com20020-isa.c+2−2

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

drivers/net/arcnet/com20020-pci.c+1−1

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

drivers/net/arcnet/com20020_cs.c+1−1

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

drivers/net/arcnet/com90io.c+2−2

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

drivers/net/arcnet/com90xx.c+2−2

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

drivers/net/bareudp.c+16−9

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

drivers/net/can/Kconfig+1−0

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

drivers/net/can/dev.c+3−3

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

drivers/net/can/m_can/m_can.c+0−2

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

drivers/net/can/m_can/tcan4x5x.c+0−26

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

drivers/net/can/rcar/Kconfig+2−2

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

drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c+9−10

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

drivers/net/can/usb/peak_usb/pcan_usb_fd.c+4−4

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

drivers/net/can/vxcan.c+4−2

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

drivers/net/dsa/b53/b53_common.c+1−1

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

drivers/net/dsa/bcm_sf2.c+6−2

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

drivers/net/dsa/hirschmann/Kconfig+1−0

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

drivers/net/dsa/lantiq_gswip.c+11−23

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

drivers/net/dsa/microchip/ksz8795.c+20−10

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

drivers/net/dsa/microchip/ksz_common.c+2−2

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

drivers/net/dsa/mv88e6xxx/chip.c+5−1

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

drivers/net/dsa/mv88e6xxx/global1_vtu.c+4−0

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

drivers/net/dsa/ocelot/felix.c+16−1

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

drivers/net/ethernet/amazon/ena/ena_netdev.c+5−1

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

drivers/net/ethernet/aquantia/Kconfig+0−1

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

drivers/net/ethernet/broadcom/bcmsysport.c+5−2

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

drivers/net/ethernet/broadcom/bnxt/bnxt.c+19−19

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

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

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

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

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

drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c+6−2

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

drivers/net/ethernet/cadence/macb_main.c+1−1

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

drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h+1−0

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

drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h+7−0

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

drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls.h+4−0

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

drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c+56−52

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

drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_hw.c+41−0

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

drivers/net/ethernet/ethoc.c+2−1

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

drivers/net/ethernet/freescale/dpaa/dpaa_eth.c+38−4

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

drivers/net/ethernet/freescale/enetc/enetc_hw.h+2−0

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

drivers/net/ethernet/freescale/enetc/enetc_pf.c+59−0

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

drivers/net/ethernet/freescale/fec.h+5−0

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

drivers/net/ethernet/freescale/fec_main.c+6−3

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

drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c+1−0

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

drivers/net/ethernet/freescale/fs_enet/mii-fec.c+1−0

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

drivers/net/ethernet/freescale/ucc_geth.c+2−1

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

drivers/net/ethernet/freescale/ucc_geth.h+8−1

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

drivers/net/ethernet/hisilicon/hns/hns_ethtool.c+4−0

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

drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h+2−2

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

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c+13−3

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

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h+2−0

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

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c+25−4

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

drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c+6−3

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

drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h+2−0

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

drivers/net/ethernet/ibm/ibmvnic.c+27−11

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

drivers/net/ethernet/intel/e1000e/e1000.h+1−0

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

drivers/net/ethernet/intel/e1000e/ethtool.c+46−0

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

drivers/net/ethernet/intel/e1000e/ich8lan.c+14−3

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

drivers/net/ethernet/intel/e1000e/netdev.c+10−49

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

drivers/net/ethernet/intel/i40e/i40e.h+3−0

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

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

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

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c+7−21

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

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h+0−1

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

drivers/net/ethernet/intel/i40e/i40e_xsk.c+1−1

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

drivers/net/ethernet/intel/iavf/iavf_main.c+1−3

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

drivers/net/ethernet/intel/ice/ice.h+3−1

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

drivers/net/ethernet/intel/ice/ice_ethtool.c+4−4

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

drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c+7−1

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

drivers/net/ethernet/intel/ice/ice_lib.c+9−5

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

drivers/net/ethernet/intel/ice/ice_main.c+9−7

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

drivers/net/ethernet/intel/ice/ice_txrx.c+6−3

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

drivers/net/ethernet/intel/igc/igc_ethtool.c+20−7

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

drivers/net/ethernet/intel/igc/igc_i225.c+1−2

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

drivers/net/ethernet/intel/igc/igc_mac.c+1−1

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

drivers/net/ethernet/marvell/mvneta.c+2−2

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

drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c+20−9

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

drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c+41−7

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

drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.h+1−1

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

drivers/net/ethernet/marvell/octeontx2/af/cgx.c+11−3

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

drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c+6−0

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/en/health.c+1−1

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

drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c+5−0

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c+62−35

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

drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h+9−0

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

drivers/net/ethernet/mellanox/mlx5/core/en_accel/en_accel.h+5−3

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c+8−5

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

drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c+25−7

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

drivers/net/ethernet/mellanox/mlx5/core/en_fs.c+3−0

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

drivers/net/ethernet/mellanox/mlx5/core/en_main.c+33−15

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

drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+2−0

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

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c+12−4

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

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+17−5

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c+13−14

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

drivers/net/ethernet/mellanox/mlx5/core/fs_core.c+6−0

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

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

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

drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h+5−0

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

drivers/net/ethernet/mellanox/mlx5/core/main.c+5−2

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

drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c+34−24

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

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

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

drivers/net/ethernet/mellanox/mlxsw/core_thermal.c+8−5

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c+6−0

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h+1−0

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

drivers/net/ethernet/mscc/ocelot.c+72−5

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

drivers/net/ethernet/mscc/ocelot_io.c+8−0

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

drivers/net/ethernet/mscc/ocelot_net.c+1−3

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

drivers/net/ethernet/natsemi/macsonic.c+10−2

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

drivers/net/ethernet/natsemi/xtsonic.c+5−2

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

drivers/net/ethernet/pensando/ionic/ionic_txrx.c+1−1

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

drivers/net/ethernet/qlogic/Kconfig+1−0

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

drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c+1−6

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

drivers/net/ethernet/qlogic/qede/qede_fp.c+5−0

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

drivers/net/ethernet/realtek/r8169_main.c+71−10

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

drivers/net/ethernet/renesas/sh_eth.c+28−2

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

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

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

drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c+6−0

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

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

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

drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c+82−47

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

drivers/net/ethernet/stmicro/stmmac/dwmac5.c+4−48

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

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+4−3

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

drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c+24−3

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

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

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

drivers/net/hyperv/netvsc.c+4−1

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

drivers/net/hyperv/rndis_filter.c+0−2

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

drivers/net/ipa/gsi.c+72−60

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

drivers/net/ipa/ipa_clock.c+2−2

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

drivers/net/ipa/ipa_endpoint.c+3−3

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

drivers/net/ipa/ipa_mem.c+2−2

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

drivers/net/ipa/ipa_modem.c+1−0

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

drivers/net/mdio/mdio-bitbang.c+4−2

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

drivers/net/phy/smsc.c+2−1

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

drivers/net/ppp/ppp_generic.c+9−3

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

drivers/net/team/team.c+3−3

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

drivers/net/tun.c+1−1

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

drivers/net/usb/Kconfig+0−1

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

drivers/net/usb/cdc_ether.c+13−0

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

drivers/net/usb/cdc_ncm.c+17−6

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

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

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

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

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

drivers/net/usb/r8153_ecm.c+8−0

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

drivers/net/usb/rndis_host.c+1−1

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

drivers/net/virtio_net.c+7−5

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

drivers/net/wan/Kconfig+1−0

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

drivers/net/wan/hdlc_ppp.c+7−0

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

drivers/net/wan/hdlc_x25.c+3−3

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

drivers/net/wireless/ath/ath11k/core.c+1−1

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

drivers/net/wireless/ath/ath11k/dp_rx.c+7−3

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

drivers/net/wireless/ath/ath11k/mac.c+6−2

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

drivers/net/wireless/ath/ath11k/pci.c+40−4

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

drivers/net/wireless/ath/ath11k/pci.h+2−0

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

drivers/net/wireless/ath/ath11k/peer.c+17−0

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

drivers/net/wireless/ath/ath11k/peer.h+2−0

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

drivers/net/wireless/ath/ath11k/qmi.c+22−2

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

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

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

drivers/net/wireless/ath/ath11k/wmi.c+3−0

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

drivers/net/wireless/ath/ath9k/Kconfig+2−6

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

drivers/net/wireless/ath/wil6210/Kconfig+1−0

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

drivers/net/wireless/intel/iwlwifi/cfg/22000.c+25−0

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

drivers/net/wireless/intel/iwlwifi/fw/acpi.c+50−15

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

drivers/net/wireless/intel/iwlwifi/fw/acpi.h+4−3

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

drivers/net/wireless/intel/iwlwifi/fw/pnvm.c+31−25

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

drivers/net/wireless/intel/iwlwifi/iwl-config.h+5−2

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

drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c+0−7

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

drivers/net/wireless/intel/iwlwifi/iwl-io.c+5−4

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

drivers/net/wireless/intel/iwlwifi/iwl-io.h+8−2

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

drivers/net/wireless/intel/iwlwifi/iwl-prph.h+6−0

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

drivers/net/wireless/intel/iwlwifi/mvm/d3.c+3−3

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

drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c+3−0

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

drivers/net/wireless/intel/iwlwifi/mvm/fw.c+14−11

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

drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c+3−0

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

drivers/net/wireless/intel/iwlwifi/mvm/ops.c+6−1

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

drivers/net/wireless/intel/iwlwifi/mvm/sta.c+6−0

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

drivers/net/wireless/intel/iwlwifi/mvm/tx.c+3−0

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

drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c+34−19

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

drivers/net/wireless/intel/iwlwifi/pcie/drv.c+10−0

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

drivers/net/wireless/intel/iwlwifi/pcie/trans.c+8−6

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

drivers/net/wireless/intel/iwlwifi/pcie/tx.c+5−0

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

drivers/net/wireless/intel/iwlwifi/queue/tx.c+26−29

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

drivers/net/wireless/mediatek/mt76/dma.c+5−3

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

drivers/net/wireless/mediatek/mt76/mt7615/mcu.c+1−1

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

drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c+4−5

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

drivers/net/wireless/mediatek/mt76/mt7915/init.c+2−2

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

drivers/net/wireless/mediatek/mt76/mt7915/mcu.c+5−5

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

drivers/net/wireless/mediatek/mt76/sdio.c+7−12

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

drivers/net/wireless/mediatek/mt76/usb.c+2−7

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

drivers/net/wireless/mediatek/mt7601u/dma.c+2−3

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

drivers/net/wireless/realtek/rtlwifi/core.c+5−3

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

drivers/net/xen-netback/rx.c+8−1

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

drivers/nvdimm/dimm_devs.c+15−3

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

drivers/nvdimm/namespace_devs.c+5−5

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

drivers/nvdimm/pmem.c+0−1

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

drivers/nvme/host/core.c+27−11

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

drivers/nvme/host/fc.c+14−1

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

drivers/nvme/host/multipath.c+1−1

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

drivers/nvme/host/nvme.h+2−7

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

drivers/nvme/host/pci.c+93−42

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

drivers/nvme/host/rdma.c+11−4

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

drivers/nvme/host/tcp.c+23−7

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

drivers/nvme/target/admin-cmd.c+6−2

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

drivers/nvme/target/fcloop.c+4−3

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

drivers/nvme/target/rdma.c+18−8

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

drivers/nvme/target/tcp.c+2−1

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

drivers/of/device.c+7−3

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

drivers/pci/pci.c+0−7

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

drivers/pci/pci.h+0−4

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

drivers/pci/pcie/aspm.c+0−44

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

drivers/perf/arm_pmu.c+0−5

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

drivers/phy/ingenic/Makefile+1−1

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

drivers/phy/mediatek/Kconfig+3−1

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

drivers/phy/motorola/phy-cpcap-usb.c+13−6

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

drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c+1−1

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

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

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

drivers/pinctrl/nomadik/pinctrl-nomadik.c+0−1

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

drivers/pinctrl/pinctrl-ingenic.c+40−40

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

drivers/pinctrl/qcom/pinctrl-msm.c+60−36

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

drivers/pinctrl/qcom/pinctrl-msm.h+2−0

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

drivers/platform/surface/Kconfig+4−4

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

drivers/platform/surface/surface_gpe.c+2−2

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

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

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

drivers/platform/x86/dell-wmi-sysman/sysman.c+5−1

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

drivers/platform/x86/hp-wmi.c+12−5

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

drivers/platform/x86/i2c-multi-instantiate.c+23−8

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

drivers/platform/x86/ideapad-laptop.c+14−1

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

drivers/platform/x86/intel-vbtn.c+5−5

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

drivers/platform/x86/thinkpad_acpi.c+3−2

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

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

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

drivers/ptp/Kconfig+2−0

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

drivers/regulator/Kconfig+1−0

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

drivers/regulator/bd718x7-regulator.c+57−0

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

drivers/regulator/core.c+33−11

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

drivers/regulator/pf8x00-regulator.c+6−2

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

drivers/regulator/qcom-rpmh-regulator.c+1−1

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

drivers/rtc/rtc-cmos.c+8−0

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

drivers/rtc/rtc-mc146818-lib.c+7−0

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

drivers/s390/block/dasd_devmap.c+14−6

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

drivers/s390/block/dasd_eckd.c+2−1

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

drivers/s390/block/dasd_int.h+1−1

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

drivers/s390/crypto/vfio_ap_drv.c+1−5

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

drivers/s390/crypto/vfio_ap_ops.c+90−59

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

drivers/s390/crypto/vfio_ap_private.h+6−6

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

drivers/s390/net/qeth_core.h+2−1

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

drivers/s390/net/qeth_core_main.c+25−13

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

drivers/s390/net/qeth_l2_main.c+1−1

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

drivers/s390/net/qeth_l3_main.c+2−2

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

drivers/scsi/fnic/vnic_dev.c+5−3

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

drivers/scsi/hisi_sas/hisi_sas.h+4−0

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

drivers/scsi/hisi_sas/hisi_sas_main.c+11−0

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

drivers/scsi/hisi_sas/hisi_sas_v2_hw.c+53−13

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

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

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

drivers/scsi/libfc/fc_exch.c+14−2

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

drivers/scsi/lpfc/lpfc_nvme.c+3−0

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

drivers/scsi/megaraid/megaraid_sas_base.c+41−4

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

drivers/scsi/megaraid/megaraid_sas_fusion.c+16−13

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

drivers/scsi/mpt3sas/Kconfig+1−1

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

drivers/scsi/qedi/qedi_main.c+2−2

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

drivers/scsi/qla2xxx/qla_os.c+1−1

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

drivers/scsi/scsi_debug.c+4−2

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

drivers/scsi/scsi_transport_srp.c+8−1

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

drivers/scsi/sd.c+3−3

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

drivers/scsi/ufs/Kconfig+1−0

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

drivers/scsi/ufs/ufshcd.c+35−26

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

drivers/sh/intc/core.c+1−1

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

drivers/sh/intc/virq-debugfs.c+2−12

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

drivers/soc/atmel/soc.c+13−0

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

drivers/soc/imx/Kconfig+1−1

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

drivers/soc/litex/Kconfig+1−0

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

drivers/soc/litex/litex_soc_ctrl.c+2−1

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

drivers/soc/sunxi/sunxi_mbus.c+0−5

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

drivers/soc/ti/omap_prm.c+11−0

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

drivers/spi/spi-altera.c+16−13

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

drivers/spi/spi-cadence.c+4−2

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

drivers/spi/spi-fsl-spi.c+2−3

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

drivers/spi/spi-geni-qcom.c+80−4

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

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

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

drivers/spi/spi.c+8−3

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

drivers/spi/spidev.c+1−0

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

drivers/staging/comedi/comedi_fops.c+3−1

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

drivers/staging/hikey9xx/hisi-spmi-controller.c+15−6

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

drivers/staging/media/atomisp/pci/atomisp_subdev.c+0−20

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

drivers/staging/media/hantro/hantro_v4l2.c+1−1

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

drivers/staging/media/sunxi/cedrus/cedrus_h264.c+1−1

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

drivers/staging/mt7621-dma/mtk-hsdma.c+3−1

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

drivers/staging/rtl8723bs/include/rtw_wifi_regd.h+3−3

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

drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c+3−3

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

drivers/staging/rtl8723bs/os_dep/sdio_intf.c+2−2

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

drivers/staging/rtl8723bs/os_dep/wifi_regd.c+3−7

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

drivers/target/iscsi/iscsi_target_login.c+1−1

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

drivers/target/target_core_user.c+8−3

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

drivers/target/target_core_xcopy.c+70−49

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

drivers/target/target_core_xcopy.h+1−0

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

drivers/tee/optee/call.c+3−1

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

drivers/thunderbolt/acpi.c+1−1

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

drivers/thunderbolt/icm.c+1−1

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

drivers/tty/Kconfig+14−0

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

drivers/tty/Makefile+2−1

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

drivers/tty/n_tty.c+2−5

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

drivers/tty/serial/mvebu-uart.c+9−1

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

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

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

drivers/tty/tty_io.c+41−24

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

drivers/tty/ttynull.c+0−18

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

drivers/usb/cdns3/cdns3-imx.c+11−11

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

drivers/usb/chipidea/ci_hdrc_imx.c+5−1

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

drivers/usb/class/cdc-acm.c+4−0

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

drivers/usb/class/cdc-wdm.c+13−3

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

drivers/usb/class/usblp.c+30−10

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

drivers/usb/core/hcd.c+3−5

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

drivers/usb/dwc2/gadget.c+1−7

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

drivers/usb/dwc3/core.c+1−1

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

drivers/usb/dwc3/core.h+1−0

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

drivers/usb/dwc3/dwc3-meson-g12a.c+1−1

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

drivers/usb/dwc3/gadget.c+5−11

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

drivers/usb/dwc3/ulpi.c+21−17

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

drivers/usb/gadget/Kconfig+2−0

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

drivers/usb/gadget/composite.c+8−2

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

drivers/usb/gadget/configfs.c+13−6

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

drivers/usb/gadget/function/f_printer.c+1−0

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

drivers/usb/gadget/function/f_uac2.c+55−14

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

drivers/usb/gadget/function/u_ether.c+5−4

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

drivers/usb/gadget/legacy/acm_ms.c+3−1

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

drivers/usb/gadget/legacy/ether.c+3−1

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

drivers/usb/gadget/udc/Kconfig+1−1

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

drivers/usb/gadget/udc/Makefile+0−1

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

drivers/usb/gadget/udc/aspeed-vhub/epn.c+4−1

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

drivers/usb/gadget/udc/aspeed-vhub/hub.c+3−1

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

drivers/usb/gadget/udc/bdc/Kconfig+1−1

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

drivers/usb/gadget/udc/core.c+11−5

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

drivers/usb/gadget/udc/dummy_hcd.c+30−15

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

drivers/usb/gadget/udc/fsl_mxc_udc.c+0−122

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

drivers/usb/host/ehci-hcd.c+12−0

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

drivers/usb/host/ehci-hub.c+3−0

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

drivers/usb/host/xhci-mtk-sch.c+93−37

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

drivers/usb/host/xhci-mtk.c+2−0

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

drivers/usb/host/xhci-mtk.h+15−0

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

drivers/usb/host/xhci-mvebu.c+42−0

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

drivers/usb/host/xhci-mvebu.h+6−0

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

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

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

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

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

drivers/usb/host/xhci-ring.c+22−11

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

drivers/usb/host/xhci-tegra.c+7−0

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

drivers/usb/host/xhci.c+18−14

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

drivers/usb/host/xhci.h+4−0

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

drivers/usb/misc/yurex.c+3−0

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

drivers/usb/renesas_usbhs/fifo.c+1−0

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

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

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

drivers/usb/serial/iuu_phoenix.c+15−5

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

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

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

drivers/usb/storage/unusual_uas.h+7−0

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

drivers/usb/typec/altmodes/Kconfig+1−1

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

drivers/usb/typec/class.c+2−0

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

drivers/usb/typec/mux/intel_pmc_mux.c+11−0

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

drivers/usb/usbip/vhci_hcd.c+2−0

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

drivers/vdpa/mlx5/core/mlx5_vdpa.h+1−0

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

drivers/vdpa/mlx5/core/mr.c+12−16

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

drivers/vdpa/mlx5/net/mlx5_vnet.c+18−0

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

drivers/vhost/net.c+3−3

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

drivers/vhost/vsock.c+65−3

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

drivers/xen/events/events_base.c+0−10

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

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

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

drivers/xen/privcmd.c+19−6

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

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

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

drivers/xen/xenbus/xenbus_probe.c+97−13

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

fs/Kconfig+1−1

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

fs/afs/dir.c+26−23

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

fs/afs/dir_edit.c+2−4

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

fs/afs/main.c+3−3

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

fs/afs/xdr_fs.h+21−4

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

fs/block_dev.c+14−3

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

fs/btrfs/backref.c+1−1

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

fs/btrfs/block-group.c+11−2

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

fs/btrfs/btrfs_inode.h+9−0

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

fs/btrfs/ctree.c+22−2

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

fs/btrfs/ctree.h+30−2

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

fs/btrfs/dev-replace.c+1−1

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

fs/btrfs/discard.c+36−34

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

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

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

fs/btrfs/extent-tree.c+29−44

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

fs/btrfs/extent_io.c+1−3

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

fs/btrfs/file-item.c+2−0

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

fs/btrfs/free-space-tree.c+9−1

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

fs/btrfs/inode.c+51−18

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

fs/btrfs/ioctl.c+1−1

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

fs/btrfs/print-tree.c+5−5

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

fs/btrfs/print-tree.h+1−1

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

fs/btrfs/qgroup.c+30−13

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

fs/btrfs/reflink.c+15−0

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

fs/btrfs/relocation.c+6−1

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

fs/btrfs/send.c+46−18

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

fs/btrfs/space-info.c+3−1

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

fs/btrfs/super.c+37−3

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

fs/btrfs/tests/btrfs-tests.c+8−2

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

fs/btrfs/tests/inode-tests.c+0−9

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

fs/btrfs/transaction.c+0−8

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

fs/btrfs/tree-checker.c+7−0

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

fs/btrfs/volumes.c+5−3

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

fs/btrfs/volumes.h+6−5

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

fs/cachefiles/rdwr.c+0−2

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

fs/ceph/mds_client.c+17−17

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

fs/cifs/cifs_dfs_ref.c+8−4

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

fs/cifs/cifsfs.c+2−2

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

fs/cifs/cifsproto.h+4−2

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

fs/cifs/connect.c+38−9

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

fs/cifs/dfs_cache.c+7−4

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

fs/cifs/dir.c+20−2

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

fs/cifs/fs_context.c+55−10

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

fs/cifs/fs_context.h+1−0

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

fs/cifs/smb2pdu.c+1−1

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

fs/cifs/smb2pdu.h+2−2

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

fs/cifs/transport.c+17−5

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

fs/ecryptfs/inode.c+7−3

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

fs/ext4/ext4_jbd2.c+0−17

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

fs/ext4/ext4_jbd2.h+0−5

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

fs/ext4/fast_commit.c+18−17

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

fs/ext4/file.c+5−2

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

fs/ext4/inode.c+5−1

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

fs/ext4/ioctl.c+3−0

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

fs/ext4/namei.c+17−10

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

fs/ext4/resize.c+16−4

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

fs/ext4/super.c+118−72

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

fs/ext4/xattr.c+4−1

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

fs/fs-writeback.c+13−11

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

fs/hugetlbfs/inode.c+2−1

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

fs/io_uring.c+305−154

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

fs/kernfs/file.c+24−41

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

fs/namespace.c+5−2

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

fs/nfs/delegation.c+7−5

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

fs/nfs/internal.h+30−8

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

fs/nfs/nfs4proc.c+11−17

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

fs/nfs/nfs4super.c+2−2

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

fs/nfs/pnfs.c+79−57

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

fs/nfs/pnfs.h+3−5

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

fs/nfs/pnfs_nfs.c+10−12

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

fs/nfsd/nfs3xdr.c+6−1

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

fs/nfsd/nfs4proc.c+5−0

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

fs/nfsd/nfs4xdr.c+36−20

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

fs/nfsd/nfssvc.c+0−6

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

fs/nfsd/xdr4.h+0−1

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

fs/nilfs2/file.c+1−0

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

fs/notify/fanotify/fanotify_user.c+7−10

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

fs/overlayfs/copy_up.c+8−7

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

fs/overlayfs/dir.c+1−1

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

fs/overlayfs/file.c+3−2

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

fs/overlayfs/inode.c+2−0

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

fs/overlayfs/overlayfs.h+1−0

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

fs/overlayfs/ovl_entry.h+2−0

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

fs/overlayfs/readdir.c+10−18

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

fs/overlayfs/super.c+31−7

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

fs/overlayfs/util.c+27−0

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

fs/pipe.c+1−0

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

fs/proc/proc_sysctl.c+6−1

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

fs/proc/task_mmu.c+30−23

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

fs/select.c+11−3

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

fs/squashfs/block.c+7−1

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

fs/squashfs/export.c+33−8

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

fs/squashfs/id.c+32−8

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

fs/squashfs/squashfs_fs_sb.h+1−0

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

fs/squashfs/super.c+3−3

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

fs/squashfs/xattr.h+9−1

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

fs/squashfs/xattr_id.c+57−9

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

fs/udf/super.c+4−3

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

fs/zonefs/Kconfig+1−0

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

include/asm-generic/bitops/atomic.h+3−3

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

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

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

include/drm/drm_dp_mst_helper.h+1−0

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

include/dt-bindings/sound/apq8016-lpass.h+3−4

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

include/dt-bindings/sound/qcom,lpass.h+15−0

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

include/dt-bindings/sound/sc7180-lpass.h+2−4

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

include/kvm/arm_pmu.h+1−1

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

include/linux/acpi.h+7−0

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

include/linux/compiler-gcc.h+6−0

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

include/linux/compiler_attributes.h+6−0

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

include/linux/compiler_types.h+0−6

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

include/linux/console.h+0−3

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

include/linux/device.h+12−0

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

include/linux/dm-bufio.h+1−0

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

include/linux/entry-common.h+1−0

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

include/linux/hugetlb.h+2−0

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

include/linux/intel-iommu.h+12−6

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

include/linux/iommu.h+4−1

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

include/linux/irq.h+2−2

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

include/linux/kasan.h+12−1

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

include/linux/kcov.h+21−0

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

include/linux/kprobes.h+1−1

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

include/linux/kthread.h+3−0

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

include/linux/ktime.h+0−1

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

include/linux/linkage.h+5−0

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

include/linux/mdio-bitbang.h+3−0

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

include/linux/memcontrol.h+1−1

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

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

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

include/linux/mlx5/mlx5_ifc.h+2−1

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

include/linux/msi.h+6−0

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

include/linux/netdevice.h+2−0

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

include/linux/nvme.h+6−0

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

include/linux/perf/arm_pmu.h+0−2

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

include/linux/rcupdate.h+6−0

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

include/linux/regulator/consumer.h+30−0

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

include/linux/skbuff.h+2−1

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

include/linux/sunrpc/xdr.h+1−2

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

include/linux/syscalls.h+24−0

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

include/linux/thread_info.h+2−0

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

include/linux/timekeeping32.h+0−14

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

include/linux/tracepoint.h+7−5

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

include/linux/tty.h+1−0

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

include/linux/uio.h+7−1

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

include/linux/usb/usbnet.h+2−0

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

include/linux/vmalloc.h+2−7

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

include/media/v4l2-common.h+2−2

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

include/net/cfg80211.h+4−1

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

include/net/inet_connection_sock.h+3−0

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

include/net/lapb.h+2−0

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

include/net/mac80211.h+1−0

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

include/net/netfilter/nf_tables.h+2−0

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

include/net/red.h+3−1

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

include/net/sch_generic.h+1−1

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

include/net/sock.h+12−5

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

include/net/switchdev.h+0−2

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

include/net/tcp.h+2−1

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

include/net/udp.h+1−1

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

include/net/xdp_sock.h+0−4

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

include/net/xsk_buff_pool.h+5−0

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

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

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

include/soc/nps/common.h+0−172

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

include/soc/nps/mtm.h+0−59

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

include/sound/pcm.h+1−1

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

include/trace/events/afs.h+2−0

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

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

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

include/trace/events/sunrpc.h+53−6

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

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

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

include/uapi/linux/if_link.h+3−2

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

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

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

include/uapi/linux/mrp_bridge.h+0−86

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

include/uapi/linux/netfilter/nf_tables.h+3−0

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

include/uapi/linux/ppp-ioctl.h+1−1

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

include/uapi/linux/prctl.h+3−0

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

include/uapi/linux/rkisp1-config.h+76−10

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

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

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

include/uapi/linux/v4l2-subdev.h+1−1

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

include/uapi/misc/habanalabs.h+5−0

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

include/uapi/rdma/vmw_pvrdma-abi.h+7−0

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

include/xen/xenbus.h+0−2

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

init/Kconfig+0−1

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

init/init_task.c+2−1

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

init/main.c+10−9

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

kernel/bpf/bpf_inode_storage.c+11−4

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

kernel/bpf/bpf_lsm.c+12−0

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

kernel/bpf/bpf_task_storage.c+4−1

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

kernel/bpf/btf.c+1−1

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

kernel/bpf/cgroup.c+9−3

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

kernel/bpf/hashtab.c+1−0

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

kernel/bpf/helpers.c+1−1

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

kernel/bpf/preload/Makefile+4−1

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

kernel/bpf/stackmap.c+2−0

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

kernel/bpf/syscall.c+4−3

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

kernel/bpf/task_iter.c+9−8

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

kernel/bpf/verifier.c+25−21

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

kernel/cgroup/cgroup-v1.c+3−0

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

kernel/cgroup/cgroup.c+3−1

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

kernel/configs/android-recommended.config+0−1

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

kernel/dma/map_benchmark.c+6−2

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

kernel/entry/common.c+3−11

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

kernel/entry/syscall_user_dispatch.c+2−2

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

kernel/fork.c+2−4

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

kernel/futex.c+96−123

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

kernel/gcov/Kconfig+1−1

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

kernel/irq/manage.c+1−0

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

kernel/irq/msi.c+21−25

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

kernel/kexec_core.c+0−2

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

kernel/kprobes.c+28−8

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

kernel/kthread.c+27−2

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

kernel/locking/lockdep.c+7−2

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

kernel/locking/rtmutex.c+1−2

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

kernel/locking/rtmutex_common.h+1−2

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

kernel/power/swap.c+1−1

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

kernel/printk/printk.c+29−11

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

kernel/printk/printk_ringbuffer.c+1−1

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

kernel/rcu/tasks.h+21−4

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

kernel/sched/core.c+88−23

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

kernel/sched/sched.h+1−0

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

kernel/signal.c+5−1

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

kernel/smpboot.c+1−0

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

kernel/time/ntp.c+4−4

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

kernel/time/timekeeping.c+1−2

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

kernel/trace/Kconfig+1−1

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

kernel/trace/bpf_trace.c+0−3

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

kernel/trace/fgraph.c+0−2

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

kernel/trace/trace.c+1−1

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

kernel/trace/trace_events.c+2−1

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

kernel/trace/trace_irqsoff.c+4−0

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

kernel/trace/trace_kprobe.c+7−5

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

kernel/workqueue.c+13−9

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

lib/Kconfig.debug+0−8

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

lib/Kconfig.ubsan+1−0

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

lib/cpumask.c+5−11

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

lib/fonts/font_ter16x32.c+3−3

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

lib/iov_iter.c+15−11

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

lib/raid6/Makefile+1−1

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

lib/ubsan.c+31−0

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

lib/ubsan.h+6−0

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

mm/compaction.c+2−1

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

mm/filemap.c+4−0

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

mm/highmem.c+6−1

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

mm/huge_memory.c+23−14

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

mm/hugetlb.c+48−7

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

mm/kasan/hw_tags.c+28−45

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

mm/kasan/init.c+15−11

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

mm/kasan/kasan.h+1−1

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

mm/memblock.c+7−44

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

mm/memcontrol.c+3−6

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

mm/memory-failure.c+17−5

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

mm/mempolicy.c+1−1

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

mm/migrate.c+18−11

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

mm/mremap.c+3−2

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

mm/page-writeback.c+1−1

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

mm/page_alloc.c+18−15

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

mm/process_vm_access.c+1−0

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

mm/slub.c+22−9

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

mm/vmalloc.c+3−1

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

mm/vmscan.c+2−0

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

net/8021q/vlan.c+1−2

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

net/bpf/test_run.c+2−1

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

net/bridge/br_mrp.c+6−3

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

net/bridge/br_mrp_switchdev.c+3−4

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

net/bridge/br_private_mrp.h+30−2

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

net/can/isotp.c+1−0

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

net/ceph/auth_x.c+34−23

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

net/ceph/crypto.c+2−1

This diff is large: its 17 lines aren’t shown here.

net/ceph/messenger_v1.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ceph/messenger_v2.c+26−19

This diff is large: its 122 lines aren’t shown here.

net/ceph/mon_client.c+7−7

This diff is large: its 37 lines aren’t shown here.

net/ceph/osd_client.c+20−20

This diff is large: its 106 lines aren’t shown here.

net/core/datagram.c+10−2

This diff is large: its 19 lines aren’t shown here.

net/core/dev.c+35−18

This diff is large: its 105 lines aren’t shown here.

net/core/devlink.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/core/gen_estimator.c+7−4

This diff is large: its 26 lines aren’t shown here.

net/core/neighbour.c+6−7

This diff is large: its 31 lines aren’t shown here.

net/core/net-sysfs.c+53−12

This diff is large: its 148 lines aren’t shown here.

net/core/rtnetlink.c+6−17

This diff is large: its 33 lines aren’t shown here.

net/core/skbuff.c+54−9

This diff is large: its 134 lines aren’t shown here.

net/core/sock_reuseport.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/dcb/dcbnl.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/decnet/dn_route.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/dsa/dsa2.c+9−2

This diff is large: its 40 lines aren’t shown here.

net/dsa/master.c+10−0

This diff is large: its 19 lines aren’t shown here.

net/hsr/hsr_main.h+4−1

This diff is large: its 12 lines aren’t shown here.

net/ipv4/esp4.c+1−6

This diff is large: its 24 lines aren’t shown here.

net/ipv4/fib_frontend.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/gre_demux.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/inet_connection_sock.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/ipv4/ip_output.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/ip_tunnel.c+12−15

This diff is large: its 79 lines aren’t shown here.

net/ipv4/netfilter/arp_tables.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/netfilter/ip_tables.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/netfilter/ipt_rpfilter.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/nexthop.c+4−2

This diff is large: its 21 lines aren’t shown here.

net/ipv4/tcp.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/ipv4/tcp_input.c+11−9

This diff is large: its 63 lines aren’t shown here.

net/ipv4/tcp_ipv4.c+15−14

This diff is large: its 78 lines aren’t shown here.

net/ipv4/tcp_output.c+3−0

This diff is large: its 17 lines aren’t shown here.

net/ipv4/tcp_recovery.c+3−2

This diff is large: its 24 lines aren’t shown here.

net/ipv4/tcp_timer.c+33−21

This diff is large: its 96 lines aren’t shown here.

net/ipv4/udp.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/ipv4/udp_offload.c+64−5

This diff is large: its 101 lines aren’t shown here.

net/ipv6/addrconf.c+2−1

This diff is large: its 11 lines aren’t shown here.

net/ipv6/esp6.c+1−6

This diff is large: its 24 lines aren’t shown here.

net/ipv6/ip6_fib.c+2−3

This diff is large: its 19 lines aren’t shown here.

net/ipv6/ip6_output.c+40−1

This diff is large: its 57 lines aren’t shown here.

net/ipv6/netfilter/ip6_tables.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv6/sit.c+4−1

This diff is large: its 13 lines aren’t shown here.

net/ipv6/udp_offload.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/key/af_key.c+3−3

This diff is large: its 27 lines aren’t shown here.

net/lapb/lapb_iface.c+55−16

This diff is large: its 207 lines aren’t shown here.

net/lapb/lapb_out.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/lapb/lapb_timer.c+26−4

This diff is large: its 104 lines aren’t shown here.

net/mac80211/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

net/mac80211/debugfs.c+20−24

This diff is large: its 98 lines aren’t shown here.

net/mac80211/driver-ops.c+4−1

This diff is large: its 13 lines aren’t shown here.

net/mac80211/ieee80211_i.h+1−0

This diff is large: its 8 lines aren’t shown here.

net/mac80211/iface.c+6−0

This diff is large: its 20 lines aren’t shown here.

net/mac80211/rate.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/mac80211/rx.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/mac80211/spectmgmt.c+7−3

This diff is large: its 24 lines aren’t shown here.

net/mac80211/tx.c+17−14

This diff is large: its 60 lines aren’t shown here.

net/mptcp/protocol.c+27−47

This diff is large: its 137 lines aren’t shown here.

net/ncsi/ncsi-rsp.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_gen.h+18−24

This diff is large: its 77 lines aren’t shown here.

net/netfilter/nf_conntrack_core.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nf_conntrack_standalone.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nf_flow_table_core.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/netfilter/nf_nat_core.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/netfilter/nf_tables_api.c+43−25

This diff is large: its 203 lines aren’t shown here.

net/netfilter/nft_dynset.c+36−20

This diff is large: its 117 lines aren’t shown here.

net/netfilter/xt_RATEEST.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/netfilter/xt_recent.c+10−2

This diff is large: its 33 lines aren’t shown here.

net/nfc/nci/core.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/nfc/netlink.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/nfc/rawsock.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/packet/af_packet.c+3−1

This diff is large: its 11 lines aren’t shown here.

net/qrtr/ns.c+4−3

This diff is large: its 33 lines aren’t shown here.

net/qrtr/qrtr.c+11−5

This diff is large: its 25 lines aren’t shown here.

net/qrtr/qrtr.h+1−1

This diff is large: its 9 lines aren’t shown here.

net/qrtr/tun.c+6−0

This diff is large: its 13 lines aren’t shown here.

net/rds/rdma.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/rxrpc/af_rxrpc.c+3−3

This diff is large: its 27 lines aren’t shown here.

net/rxrpc/call_accept.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/rxrpc/call_object.c+0−2

This diff is large: its 9 lines aren’t shown here.

net/rxrpc/input.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/rxrpc/key.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/cls_flower.c+13−9

This diff is large: its 55 lines aren’t shown here.

net/sched/cls_tcindex.c+6−2

This diff is large: its 16 lines aren’t shown here.

net/sched/sch_api.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/sched/sch_choke.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/sched/sch_gred.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/sched/sch_red.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/sched/sch_sfq.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/sched/sch_taprio.c+4−3

This diff is large: its 21 lines aren’t shown here.

net/sctp/proc.c+12−4

This diff is large: its 44 lines aren’t shown here.

net/smc/smc_core.c+13−7

This diff is large: its 64 lines aren’t shown here.

net/smc/smc_ib.c+3−3

This diff is large: its 20 lines aren’t shown here.

net/smc/smc_ism.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/sunrpc/addr.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/sunrpc/auth_gss/auth_gss.c+1−29

This diff is large: its 44 lines aren’t shown here.

net/sunrpc/auth_gss/auth_gss_internal.h+45−0

This diff is large: its 46 lines aren’t shown here.

net/sunrpc/auth_gss/gss_krb5_mech.c+2−29

This diff is large: its 45 lines aren’t shown here.

net/sunrpc/svc_xprt.c+2−2

This diff is large: its 25 lines aren’t shown here.

net/sunrpc/svcsock.c+86−1

This diff is large: its 101 lines aren’t shown here.

net/switchdev/switchdev.c+13−10

This diff is large: its 44 lines aren’t shown here.

net/tipc/link.c+8−3

This diff is large: its 45 lines aren’t shown here.

net/tipc/node.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/vmw_vsock/af_vsock.c+19−13

This diff is large: its 135 lines aren’t shown here.

net/vmw_vsock/hyperv_transport.c+0−4

This diff is large: its 15 lines aren’t shown here.

net/vmw_vsock/virtio_transport_common.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/wireless/Kconfig+1−0

This diff is large: its 8 lines aren’t shown here.

net/wireless/reg.c+10−1

This diff is large: its 35 lines aren’t shown here.

net/wireless/wext-core.c+3−2

This diff is large: its 12 lines aren’t shown here.

net/xdp/xsk.c+15−5

This diff is large: its 75 lines aren’t shown here.

net/xdp/xsk_buff_pool.c+1−2

This diff is large: its 14 lines aren’t shown here.

net/xdp/xsk_queue.h+5−0

This diff is large: its 12 lines aren’t shown here.

net/xfrm/xfrm_input.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/xfrm/xfrm_policy.c+20−10

This diff is large: its 56 lines aren’t shown here.

scripts/Makefile+7−2

This diff is large: its 23 lines aren’t shown here.

scripts/bloat-o-meter+1−1

This diff is large: its 6 lines aren’t shown here.

scripts/checkpatch.pl+0−7

This diff is large: its 14 lines aren’t shown here.

scripts/clang-tools/gen_compile_commands.py+1−1

This diff is large: its 6 lines aren’t shown here.

scripts/clang-tools/run-clang-tools.py+1−1

This diff is large: its 6 lines aren’t shown here.

scripts/config+1−0

This diff is large: its 8 lines aren’t shown here.

scripts/diffconfig+1−1

This diff is large: its 6 lines aren’t shown here.

scripts/dummy-tools/gcc+3−7

This diff is large: its 20 lines aren’t shown here.

scripts/gcc-plugins/Makefile+2−2

This diff is large: its 12 lines aren’t shown here.

scripts/gen_autoksyms.sh+3−0

This diff is large: its 10 lines aren’t shown here.

scripts/jobserver-exec+1−1

This diff is large: its 6 lines aren’t shown here.

scripts/kallsyms.c+6−0

This diff is large: its 13 lines aren’t shown here.

scripts/kconfig/Makefile+0−10

This diff is large: its 17 lines aren’t shown here.

scripts/kconfig/mconf-cfg.sh+3−1

This diff is large: its 11 lines aren’t shown here.

scripts/recordmcount.pl+5−1

This diff is large: its 13 lines aren’t shown here.

security/commoncap.c+43−24

This diff is large: its 111 lines aren’t shown here.

security/lsm_audit.c+5−2

This diff is large: its 22 lines aren’t shown here.

sound/core/pcm_native.c+2−2

This diff is large: its 11 lines aren’t shown here.

sound/core/seq/oss/seq_oss_synth.c+2−1

This diff is large: its 10 lines aren’t shown here.

sound/firewire/fireface/ff-transaction.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/firewire/tascam/tascam-transaction.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/hda/intel-dsp-config.c+4−0

This diff is large: its 11 lines aren’t shown here.

sound/pci/hda/hda_codec.c+7−17

This diff is large: its 72 lines aren’t shown here.

sound/pci/hda/hda_intel.c+12−5

This diff is large: its 53 lines aren’t shown here.

sound/pci/hda/hda_tegra.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/pci/hda/patch_conexant.c+1−0

This diff is large: its 8 lines aren’t shown here.

sound/pci/hda/patch_hdmi.c+2−1

This diff is large: its 17 lines aren’t shown here.

sound/pci/hda/patch_realtek.c+24−1

This diff is large: its 100 lines aren’t shown here.

sound/pci/hda/patch_via.c+14−0

This diff is large: its 47 lines aren’t shown here.

sound/soc/amd/raven/pci-acp3x.c+3−13

This diff is large: its 50 lines aren’t shown here.

sound/soc/amd/renoir/rn-pci-acp3x.c+30−2

This diff is large: its 41 lines aren’t shown here.

sound/soc/atmel/Kconfig+2−2

This diff is large: its 16 lines aren’t shown here.

sound/soc/codecs/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/codecs/ak4458.c+7−15

This diff is large: its 59 lines aren’t shown here.

sound/soc/codecs/hdmi-codec.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/codecs/max98373-i2c.c+20−0

This diff is large: its 48 lines aren’t shown here.

sound/soc/codecs/max98373-sdw.c+20−0

This diff is large: its 48 lines aren’t shown here.

sound/soc/codecs/max98373.c+31−3

This diff is large: its 55 lines aren’t shown here.

sound/soc/codecs/max98373.h+8−0

This diff is large: its 22 lines aren’t shown here.

sound/soc/codecs/rt711.c+6−0

This diff is large: its 30 lines aren’t shown here.

sound/soc/codecs/wm_adsp.c+3−0

This diff is large: its 15 lines aren’t shown here.

sound/soc/fsl/imx-hdmi.c+2−1

This diff is large: its 17 lines aren’t shown here.

sound/soc/intel/boards/haswell.c+1−0

This diff is large: its 8 lines aren’t shown here.

sound/soc/intel/boards/sof_sdw.c+10−0

This diff is large: its 17 lines aren’t shown here.

sound/soc/intel/skylake/cnl-sst.c+1−0

This diff is large: its 8 lines aren’t shown here.

sound/soc/intel/skylake/skl-topology.c+8−7

This diff is large: its 28 lines aren’t shown here.

sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c+4−1

This diff is large: its 20 lines aren’t shown here.

sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c+4−1

This diff is large: its 20 lines aren’t shown here.

sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c+49−0

This diff is large: its 70 lines aren’t shown here.

sound/soc/meson/axg-tdm-interface.c+13−1

This diff is large: its 22 lines aren’t shown here.

sound/soc/meson/axg-tdmin.c+2−11

This diff is large: its 29 lines aren’t shown here.

sound/soc/qcom/lpass-cpu.c+24−18

This diff is large: its 73 lines aren’t shown here.

sound/soc/qcom/lpass-ipq806x.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/qcom/lpass-lpaif-reg.h+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/qcom/lpass-platform.c+47−15

This diff is large: its 133 lines aren’t shown here.

sound/soc/qcom/lpass-sc7180.c+4−7

This diff is large: its 39 lines aren’t shown here.

sound/soc/qcom/lpass.h+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/sh/rcar/adg.c+10−8

This diff is large: its 36 lines aren’t shown here.

sound/soc/soc-dapm.c+1−0

This diff is large: its 8 lines aren’t shown here.

sound/soc/soc-topology.c+6−5

This diff is large: its 47 lines aren’t shown here.

sound/soc/sof/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/sof/intel/Kconfig+2−1

This diff is large: its 17 lines aren’t shown here.

sound/soc/sof/intel/hda-codec.c+17−20

This diff is large: its 91 lines aren’t shown here.

sound/soc/sof/intel/hda-dsp.c+6−3

This diff is large: its 23 lines aren’t shown here.

sound/soc/sof/intel/hda.h+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/sof/sof-acpi-dev.c+6−5

This diff is large: its 19 lines aren’t shown here.

sound/soc/sof/sof-pci-dev.c+6−4

This diff is large: its 17 lines aren’t shown here.

sound/usb/card.c+2−3

This diff is large: its 20 lines aren’t shown here.

sound/usb/card.h+3−0

This diff is large: its 24 lines aren’t shown here.

sound/usb/clock.c+6−15

This diff is large: its 49 lines aren’t shown here.

sound/usb/endpoint.c+81−12

This diff is large: its 185 lines aren’t shown here.

sound/usb/endpoint.h+1−1

This diff is large: its 9 lines aren’t shown here.

sound/usb/format.c+11−0

This diff is large: its 18 lines aren’t shown here.

sound/usb/implicit.c+47−15

This diff is large: its 166 lines aren’t shown here.

sound/usb/midi.c+4−0

This diff is large: its 18 lines aren’t shown here.

sound/usb/pcm.c+111−63

This diff is large: its 268 lines aren’t shown here.

sound/usb/quirks-table.h+6−0

This diff is large: its 48 lines aren’t shown here.

sound/usb/quirks.c+46−40

This diff is large: its 150 lines aren’t shown here.

sound/usb/usbaudio.h+1−0

This diff is large: its 8 lines aren’t shown here.

tools/bootconfig/scripts/bconf2ftrace.sh+1−0

This diff is large: its 8 lines aren’t shown here.

tools/bootconfig/scripts/ftrace2bconf.sh+4−0

This diff is large: its 11 lines aren’t shown here.

tools/bpf/bpftool/net.c+0−1

This diff is large: its 8 lines aren’t shown here.

tools/bpf/resolve_btfids/main.c+12−5

This diff is large: its 49 lines aren’t shown here.

tools/gpio/gpio-event-mon.c+2−2

This diff is large: its 11 lines aren’t shown here.

tools/gpio/gpio-watch.c+3−2

This diff is large: its 19 lines aren’t shown here.

tools/include/linux/build_bug.h+0−5

This diff is large: its 10 lines aren’t shown here.

tools/include/uapi/linux/kvm.h+2−0

This diff is large: its 16 lines aren’t shown here.

tools/lib/bpf/btf.c+0−5

This diff is large: its 12 lines aren’t shown here.

tools/lib/perf/evlist.c+4−13

This diff is large: its 35 lines aren’t shown here.

tools/lib/perf/tests/test-cpumap.c+1−1

This diff is large: its 7 lines aren’t shown here.

tools/lib/perf/tests/test-evlist.c+4−3

This diff is large: its 39 lines aren’t shown here.

tools/lib/perf/tests/test-evsel.c+1−1

This diff is large: its 7 lines aren’t shown here.

tools/lib/perf/tests/test-threadmap.c+1−1

This diff is large: its 7 lines aren’t shown here.

tools/objtool/check.c+5−9

This diff is large: its 20 lines aren’t shown here.

tools/objtool/elf.c+12−2

This diff is large: its 28 lines aren’t shown here.

tools/perf/builtin-script.c+17−1

This diff is large: its 40 lines aren’t shown here.

tools/perf/examples/bpf/5sec.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/perf/tests/shell/stat+shadow_stat.sh+14−16

This diff is large: its 79 lines aren’t shown here.

tools/perf/util/header.c+8−0

This diff is large: its 15 lines aren’t shown here.

tools/perf/util/machine.c+2−2

This diff is large: its 18 lines aren’t shown here.

tools/perf/util/metricgroup.c+11−5

This diff is large: its 56 lines aren’t shown here.

tools/perf/util/session.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/perf/util/stat-shadow.c+189−177

This diff is large: its 840 lines aren’t shown here.

tools/power/x86/intel-speed-select/isst-config.c+32−0

This diff is large: its 67 lines aren’t shown here.

tools/power/x86/turbostat/turbostat.c+9−1

This diff is large: its 29 lines aren’t shown here.

tools/testing/kunit/kunit.py+11−23

This diff is large: its 95 lines aren’t shown here.

tools/testing/kunit/kunit_config.py+4−3

This diff is large: its 22 lines aren’t shown here.

tools/testing/kunit/kunit_json.py+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/kunit/kunit_kernel.py+29−27

This diff is large: its 158 lines aren’t shown here.

tools/testing/kunit/kunit_parser.py+40−41

This diff is large: its 221 lines aren’t shown here.

tools/testing/nvdimm/config_check.c+2−1

This diff is large: its 10 lines aren’t shown here.

tools/testing/nvdimm/test/Kbuild+5−1

This diff is large: its 11 lines aren’t shown here.

tools/testing/nvdimm/test/ndtest.c+1129−0

This diff is large: its 1130 lines aren’t shown here.

tools/testing/nvdimm/test/ndtest.h+109−0

This diff is large: its 110 lines aren’t shown here.

tools/testing/selftests/Makefile+4−2

This diff is large: its 13 lines aren’t shown here.

tools/testing/selftests/arm64/fp/fpsimd-test.S+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/arm64/fp/sve-test.S+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/Makefile+3−0

This diff is large: its 10 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/test_local_storage.c+26−70

This diff is large: its 151 lines aren’t shown here.

tools/testing/selftests/bpf/progs/bprm_opts.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/progs/local_storage.c+35−27

This diff is large: its 103 lines aren’t shown here.

tools/testing/selftests/bpf/test_maps.c+42−6

This diff is large: its 65 lines aren’t shown here.

tools/testing/selftests/bpf/test_verifier.c+11−1

This diff is large: its 40 lines aren’t shown here.

tools/testing/selftests/bpf/verifier/spill_fill.c+30−0

This diff is large: its 37 lines aren’t shown here.

tools/testing/selftests/bpf/xdpxceiver.c+2−2

This diff is large: its 18 lines aren’t shown here.

tools/testing/selftests/dma/dma_map_benchmark.c+3−1

This diff is large: its 25 lines aren’t shown here.

tools/testing/selftests/drivers/net/mlxsw/qos_pfc.sh+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/Makefile+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/kvm/demand_paging_test.c+32−86

This diff is large: its 226 lines aren’t shown here.

tools/testing/selftests/kvm/dirty_log_perf_test.c+46−99

This diff is large: its 295 lines aren’t shown here.

tools/testing/selftests/kvm/dirty_log_test.c+37−88

This diff is large: its 219 lines aren’t shown here.

tools/testing/selftests/kvm/include/guest_modes.h+21−0

This diff is large: its 22 lines aren’t shown here.

tools/testing/selftests/kvm/include/kvm_util.h+9−0

This diff is large: its 23 lines aren’t shown here.

tools/testing/selftests/kvm/include/perf_test_util.h+12−155

This diff is large: its 193 lines aren’t shown here.

tools/testing/selftests/kvm/lib/guest_modes.c+70−0

This diff is large: its 71 lines aren’t shown here.

tools/testing/selftests/kvm/lib/kvm_util.c+1−8

This diff is large: its 16 lines aren’t shown here.

tools/testing/selftests/kvm/lib/perf_test_util.c+134−0

This diff is large: its 135 lines aren’t shown here.

tools/testing/selftests/net/fib_nexthops.sh+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/net/fib_tests.sh+0−1

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/net/forwarding/router_mpath_nh.sh+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/net/forwarding/router_multipath.sh+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/net/pmtu.sh+69−2

This diff is large: its 92 lines aren’t shown here.

tools/testing/selftests/net/tls.c+12−7

This diff is large: its 44 lines aren’t shown here.

tools/testing/selftests/net/txtimestamp.c+3−3

This diff is large: its 31 lines aren’t shown here.

tools/testing/selftests/net/udpgro.sh+34−0

This diff is large: its 107 lines aren’t shown here.

tools/testing/selftests/net/xfrm_policy.sh+44−1

This diff is large: its 66 lines aren’t shown here.

tools/testing/selftests/netfilter/Makefile+2−1

This diff is large: its 10 lines aren’t shown here.

tools/testing/selftests/netfilter/ipip-conntrack-mtu.sh+206−0

This diff is large: its 207 lines aren’t shown here.

tools/testing/selftests/netfilter/nft_conntrack_helper.sh+9−3

This diff is large: its 35 lines aren’t shown here.

tools/testing/selftests/netfilter/nft_meta.sh+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/powerpc/alignment/alignment_handler.c+4−1

This diff is large: its 20 lines aren’t shown here.

tools/testing/selftests/powerpc/mm/pkey_exec_prot.c+1−1

This diff is large: its 7 lines aren’t shown here.

tools/testing/selftests/powerpc/mm/pkey_siginfo.c+1−1

This diff is large: its 7 lines aren’t shown here.

tools/testing/selftests/syscall_user_dispatch/sud_benchmark.c+5−3

This diff is large: its 29 lines aren’t shown here.

tools/testing/selftests/syscall_user_dispatch/sud_test.c+8−6

This diff is large: its 56 lines aren’t shown here.

tools/testing/selftests/vDSO/.gitignore+3−0

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/vDSO/vdso_test_correctness.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/vm/run_vmtests.shrenamed from tools/testing/selftests/vm/run_vmtests+0−0

File renamed without changes.

tools/testing/selftests/wireguard/qemu/debug.config+0−1

This diff is large: its 6 lines aren’t shown here.

virt/kvm/kvm_main.c+2−2

This diff is large: its 19 lines aren’t shown here.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t