History

Merge remote-tracking branch 'torvalds/master' into perf/core

Minor conflict in tools/perf/arch/arm/util/auxtrace.c as one fix there was cherry-picked for the last perf/urgent pull req to Linus, so was already there.

Arnaldo Carvalho de Melo committed 6 years ago

Commit b1aa3db2 parents 7c43b0c bcf87681009 files · +9599 −6464Browse files

Unified · Split

1009 files
  1. .mailmap +8 −0
  2. Documentation/ABI/testing/debugfs-driver-habanalabs +10 −1
  3. Documentation/admin-guide/README.rst +1 −1
  4. Documentation/arm64/cpu-feature-registers.rst +2 −0
  5. Documentation/block/bfq-iosched.rst +1 −8
  6. Documentation/core-api/dma-api.rst +8 −0
  7. Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml +3 −0
  8. Documentation/devicetree/bindings/sound/simple-card.yaml +13 −4
  9. Documentation/driver-api/ptp.rst +12 −0
  10. Documentation/filesystems/overlayfs.rst +2 −2
  11. Documentation/networking/arcnet.rst +1 −1
  12. Documentation/networking/ax25.rst +1 −1
  13. Documentation/networking/bareudp.rst +15 −9
  14. Documentation/networking/can_ucan_protocol.rst +2 −2
  15. Documentation/networking/devlink/devlink-trap.rst +4 −0
  16. Documentation/networking/dsa/dsa.rst +1 −1
  17. Documentation/networking/ip-sysctl.rst +1 −1
  18. Documentation/networking/ipvs-sysctl.rst +1 −1
  19. Documentation/networking/rxrpc.rst +1 −1
  20. Documentation/powerpc/vas-api.rst +1 −1
  21. Documentation/process/changes.rst +1 −1
  22. Documentation/process/coding-style.rst +20 −0
  23. Documentation/virt/kvm/api.rst +3 −2
  24. MAINTAINERS +29 −15
  25. Makefile +3 −3
  26. arch/arm/boot/dts/am437x-l4.dtsi +10 −4
  27. arch/arm/boot/dts/armada-38x.dtsi +2 −1
  28. arch/arm/boot/dts/imx6qdl-gw551x.dtsi +1 −1
  29. arch/arm/boot/dts/imx6qdl-icore.dtsi +2 −1
  30. arch/arm/boot/dts/imx6sx-sabreauto.dts +1 −1
  31. arch/arm/boot/dts/imx6sx-sdb.dtsi +1 −1
  32. arch/arm/boot/dts/keystone-k2g-evm.dts +1 −1
  33. arch/arm/boot/dts/meson.dtsi +1 −1
  34. arch/arm/boot/dts/omap3-n900.dts +8 −4
  35. arch/arm/boot/dts/socfpga.dtsi +1 −1
  36. arch/arm/boot/dts/socfpga_arria10.dtsi +1 −1
  37. arch/arm/boot/dts/sun4i-a10.dtsi +1 −1
  38. arch/arm/boot/dts/sun5i.dtsi +1 −1
  39. arch/arm/boot/dts/sun7i-a20.dtsi +1 −1
  40. arch/arm/include/asm/percpu.h +2 −0
  41. arch/arm/kernel/asm-offsets.c +0 −9
  42. arch/arm/kernel/hw_breakpoint.c +22 −5
  43. arch/arm/kernel/vdso.c +1 −0
  44. arch/arm/mach-imx/devices/devices-common.h +1 −1
  45. arch/arm/mach-imx/devices/platform-gpio-mxc.c +3 −2
  46. arch/arm/mach-imx/devices/platform-imx-dma.c +1 −5
  47. arch/arm/mach-imx/mm-imx21.c +1 −2
  48. arch/arm/mach-imx/mm-imx27.c +1 −2
  49. arch/arm/mach-omap2/omap_hwmod.c +11 −3
  50. arch/arm/mm/mmu.c +1 −1
  51. arch/arm64/Makefile +1 −1
  52. arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +1 −0
  53. arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi +4 −4
  54. arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts +1 −0
  55. arch/arm64/boot/dts/altera/socfpga_stratix10_socdk_nand.dts +4 −3
  56. arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts +1 −1
  57. arch/arm64/boot/dts/amlogic/meson-gxl-s805x-p241.dts +1 −1
  58. arch/arm64/boot/dts/amlogic/meson-gxl-s805x.dtsi +24 −0
  59. arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +5 −0
  60. arch/arm64/boot/dts/intel/socfpga_agilex_socdk.dts +1 −0
  61. arch/arm64/boot/dts/marvell/armada-8040-clearfog-gt-8k.dts +1 −4
  62. arch/arm64/configs/defconfig +1 −1
  63. arch/arm64/include/asm/alternative.h +2 −2
  64. arch/arm64/include/asm/arch_timer.h +1 −0
  65. arch/arm64/include/asm/checksum.h +3 −2
  66. arch/arm64/include/asm/debug-monitors.h +2 −0
  67. arch/arm64/include/asm/kvm_host.h +8 −3
  68. arch/arm64/include/asm/pgtable-prot.h +1 −1
  69. arch/arm64/include/asm/smp.h +0 −1
  70. arch/arm64/include/asm/syscall.h +11 −1
  71. arch/arm64/include/asm/thread_info.h +1 −0
  72. arch/arm64/include/asm/vdso/clocksource.h +5 −2
  73. arch/arm64/include/asm/vdso/compat_gettimeofday.h +7 −1
  74. arch/arm64/kernel/alternative.c +2 −14
  75. arch/arm64/kernel/cpu_errata.c +1 −0
  76. arch/arm64/kernel/debug-monitors.c +18 −6
  77. arch/arm64/kernel/entry-common.c +1 −1
  78. arch/arm64/kernel/entry.S +31 −21
  79. arch/arm64/kernel/kgdb.c +1 −1
  80. arch/arm64/kernel/ptrace.c +37 −12
  81. arch/arm64/kernel/signal.c +2 −9
  82. arch/arm64/kernel/syscall.c +19 −2
  83. arch/arm64/kernel/vdso32/Makefile +1 −1
  84. arch/arm64/kvm/mmu.c +6 −5
  85. arch/mips/include/asm/unroll.h +3 −5
  86. arch/mips/kvm/emulate.c +4 −0
  87. arch/mips/pci/pci-xtalk-bridge.c +3 −2
  88. arch/parisc/include/asm/atomic.h +2 −0
  89. arch/parisc/include/asm/cmpxchg.h +2 −0
  90. arch/parisc/lib/bitops.c +12 −0
  91. arch/powerpc/include/asm/icswx.h +2 −0
  92. arch/powerpc/kernel/exceptions-64s.S +12 −4
  93. arch/powerpc/kernel/paca.c +1 −1
  94. arch/powerpc/mm/book3s64/hash_utils.c +25 −0
  95. arch/powerpc/mm/book3s64/pkeys.c +7 −5
  96. arch/powerpc/perf/core-book3s.c +6 −0
  97. arch/powerpc/platforms/powernv/vas-fault.c +1 −1
  98. arch/riscv/Kconfig +2 −0
  99. arch/riscv/include/asm/barrier.h +9 −1
  100. arch/riscv/include/asm/gdb_xml.h +1 −2
  101. arch/riscv/include/asm/kgdb.h +3 −2
  102. arch/riscv/include/asm/thread_info.h +4 −0
  103. arch/riscv/kernel/kgdb.c +5 −5
  104. arch/riscv/mm/init.c +45 −21
  105. arch/riscv/mm/kasan_init.c +2 −2
  106. arch/s390/kernel/perf_cpum_cf_events.c +2 −2
  107. arch/s390/mm/hugetlbpage.c +1 −1
  108. arch/sh/include/asm/pgalloc.h +1 −9
  109. arch/sh/kernel/entry-common.S +3 −3
  110. arch/x86/boot/compressed/Makefile +2 −2
  111. arch/x86/entry/Makefile +11 −3
  112. arch/x86/entry/common.c +2 −2
  113. arch/x86/include/asm/idtentry.h +10 −12
  114. arch/x86/include/asm/io_bitmap.h +16 −0
  115. arch/x86/include/asm/iosf_mbi.h +1 −0
  116. arch/x86/include/asm/paravirt.h +5 −0
  117. arch/x86/include/asm/paravirt_types.h +1 −0
  118. arch/x86/include/uapi/asm/kvm.h +3 −2
  119. arch/x86/kernel/apic/io_apic.c +5 −5
  120. arch/x86/kernel/apic/msi.c +12 −6
  121. arch/x86/kernel/apic/vector.c +5 −18
  122. arch/x86/kernel/dumpstack.c +17 −10
  123. arch/x86/kernel/fpu/xstate.c +1 −1
  124. arch/x86/kernel/i8259.c +1 −1
  125. arch/x86/kernel/paravirt.c +2 −1
  126. arch/x86/kernel/process.c +2 −16
  127. arch/x86/kernel/stacktrace.c +0 −5
  128. arch/x86/kernel/traps.c +2 −0
  129. arch/x86/kernel/unwind_orc.c +6 −2
  130. arch/x86/kernel/vmlinux.lds.S +1 −0
  131. arch/x86/kvm/lapic.c +1 −1
  132. arch/x86/kvm/svm/svm.c +6 −3
  133. arch/x86/kvm/vmx/nested.c +14 −3
  134. arch/x86/kvm/vmx/nested.h +5 −0
  135. arch/x86/math-emu/wm_sqrt.S +1 −1
  136. arch/x86/platform/uv/uv_irq.c +2 −1
  137. arch/x86/xen/enlighten_pv.c +12 −0
  138. arch/xtensa/include/asm/checksum.h +1 −1
  139. arch/xtensa/kernel/perf_event.c +1 −3
  140. arch/xtensa/kernel/setup.c +2 −1
  141. arch/xtensa/kernel/xtensa_ksyms.c +2 −2
  142. block/blk-mq.c +2 −2
  143. crypto/asymmetric_keys/public_key.c +1 −0
  144. drivers/android/binder_alloc.c +1 −1
  145. drivers/atm/atmtcp.c +8 −2
  146. drivers/base/base.h +0 −1
  147. drivers/base/core.c +32 −12
  148. drivers/base/dd.c +0 −5
  149. drivers/base/property.c +1 −1
  150. drivers/base/regmap/Kconfig +1 −1
  151. drivers/base/regmap/regmap-debugfs.c +29 −23
  152. drivers/base/regmap/regmap.c +1 −1
  153. drivers/block/nbd.c +15 −10
  154. drivers/block/zram/zram_drv.c +2 −1
  155. drivers/bus/ti-sysc.c +34 −11
  156. drivers/char/mem.c +7 −3
  157. drivers/char/random.c +1 −0
  158. drivers/char/virtio_console.c +2 −1
  159. drivers/clk/Kconfig +1 −0
  160. drivers/clk/clk-ast2600.c +41 −8
  161. drivers/clk/mvebu/Kconfig +1 −0
  162. drivers/clocksource/arm_arch_timer.c +11 −0
  163. drivers/clocksource/timer-ti-dm-systimer.c +36 −10
  164. drivers/counter/104-quad-8.c +19 −3
  165. drivers/cpufreq/intel_pstate.c +6 −2
  166. drivers/crypto/chelsio/chtls/chtls_cm.c +1 −1
  167. drivers/crypto/chelsio/chtls/chtls_io.c +4 −3
  168. drivers/dma-buf/dma-buf.c +7 −4
  169. drivers/dma/dmatest.c +2 −0
  170. drivers/dma/dw/core.c +0 −12
  171. drivers/dma/fsl-edma-common.c +16 −12
  172. drivers/dma/fsl-edma-common.h +1 −1
  173. drivers/dma/fsl-edma.c +7 −0
  174. drivers/dma/idxd/cdev.c +16 −3
  175. drivers/dma/idxd/device.c +25 −0
  176. drivers/dma/idxd/idxd.h +1 −0
  177. drivers/dma/idxd/irq.c +2 −1
  178. drivers/dma/idxd/sysfs.c +5 −0
  179. drivers/dma/imx-sdma.c +4 −7
  180. drivers/dma/ioat/dma.c +12 −0
  181. drivers/dma/ioat/dma.h +0 −2
  182. drivers/dma/mcf-edma.c +7 −0
  183. drivers/dma/sh/usb-dmac.c +2 −0
  184. drivers/dma/tegra210-adma.c +4 −1
  185. drivers/dma/ti/k3-udma-private.c +1 −0
  186. drivers/dma/ti/k3-udma.c +19 −20
  187. drivers/firmware/efi/efi-pstore.c +1 −4
  188. drivers/firmware/efi/efi.c +8 −4
  189. drivers/firmware/efi/efivars.c +1 −4
  190. drivers/firmware/efi/libstub/Makefile +1 −2
  191. drivers/firmware/efi/libstub/alignedmem.c +1 −1
  192. drivers/firmware/efi/libstub/arm64-stub.c +14 −11
  193. drivers/firmware/efi/libstub/efi-stub-helper.c +1 −1
  194. drivers/firmware/efi/libstub/efi-stub.c +0 −17
  195. drivers/firmware/efi/libstub/efistub.h +16 −0
  196. drivers/firmware/efi/libstub/x86-stub.c +4 −4
  197. drivers/firmware/efi/vars.c +6 −0
  198. drivers/firmware/psci/psci_checker.c +5 −3
  199. drivers/firmware/qemu_fw_cfg.c +4 −3
  200. drivers/fpga/dfl-afu-main.c +2 −1
  201. drivers/fpga/dfl-pci.c +2 −1
  202. drivers/gpio/gpio-arizona.c +6 −1
  203. drivers/gpio/gpio-pca953x.c +94 −5
  204. drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +15 −5
  205. drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +2 −1
  206. drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2 −1
  207. drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +59 −4
  208. drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +8 −1
  209. drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +8 −18
  210. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +42 −10
  211. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +10 −1
  212. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +26 −27
  213. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h +3 −0
  214. drivers/gpu/drm/amd/display/dc/core/dc_stream.c +16 −3
  215. drivers/gpu/drm/amd/powerplay/renoir_ppt.c +1 −1
  216. drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c +6 −4
  217. drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +1 −2
  218. drivers/gpu/drm/bochs/bochs_kms.c +1 −0
  219. drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +1 −0
  220. drivers/gpu/drm/bridge/nwl-dsi.c +0 −5
  221. drivers/gpu/drm/drm_fb_helper.c +5 −1
  222. drivers/gpu/drm/drm_gem.c +4 −6
  223. drivers/gpu/drm/drm_mipi_dbi.c +1 −1
  224. drivers/gpu/drm/drm_of.c +1 −3
  225. drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +3 −2
  226. drivers/gpu/drm/i915/display/intel_display.c +11 −0
  227. drivers/gpu/drm/i915/display/intel_display.h +1 −0
  228. drivers/gpu/drm/i915/display/intel_fbc.c +36 −29
  229. drivers/gpu/drm/i915/display/intel_hdmi.c +2 −8
  230. drivers/gpu/drm/i915/gt/intel_context.c +6 −6
  231. drivers/gpu/drm/i915/gt/intel_lrc.c +5 −14
  232. drivers/gpu/drm/i915/gt/selftest_rps.c +4 −4
  233. drivers/gpu/drm/i915/i915_debugfs.c +1 −1
  234. drivers/gpu/drm/i915/i915_drv.h +4 −3
  235. drivers/gpu/drm/i915/i915_perf.c +1 −0
  236. drivers/gpu/drm/i915/i915_vma.c +6 −9
  237. drivers/gpu/drm/lima/lima_pp.c +2 −0
  238. drivers/gpu/drm/mcde/mcde_display.c +8 −3
  239. drivers/gpu/drm/mediatek/Kconfig +1 −1
  240. drivers/gpu/drm/mediatek/mtk_drm_crtc.c +2 −6
  241. drivers/gpu/drm/mediatek/mtk_drm_drv.c +2 −4
  242. drivers/gpu/drm/mediatek/mtk_drm_plane.c +15 −10
  243. drivers/gpu/drm/mediatek/mtk_dsi.c +1 −4
  244. drivers/gpu/drm/mediatek/mtk_hdmi.c +1 −11
  245. drivers/gpu/drm/mediatek/mtk_mt8173_hdmi_phy.c +0 −52
  246. drivers/gpu/drm/meson/meson_registers.h +6 −0
  247. drivers/gpu/drm/meson/meson_viu.c +2 −9
  248. drivers/gpu/drm/nouveau/dispnv50/disp.c +5 −2
  249. drivers/gpu/drm/nouveau/nouveau_display.c +25 −2
  250. drivers/gpu/drm/nouveau/nouveau_dmem.c +1 −1
  251. drivers/gpu/drm/nouveau/nouveau_fbcon.c +2 −1
  252. drivers/gpu/drm/nouveau/nouveau_svm.c +1 −0
  253. drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c +21 −9
  254. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c +2 −2
  255. drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c +2 −2
  256. drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +3 −3
  257. drivers/gpu/drm/panel/panel-simple.c +15 −1
  258. drivers/gpu/drm/radeon/ci_dpm.c +3 −4
  259. drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +1 −1
  260. drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +4 −4
  261. drivers/hid/hid-alps.c +2 −0
  262. drivers/hid/hid-apple.c +18 −0
  263. drivers/hid/hid-ids.h +3 −0
  264. drivers/hid/hid-logitech-dj.c +3 −3
  265. drivers/hid/hid-logitech-hidpp.c +1 −1
  266. drivers/hid/hid-magicmouse.c +6 −0
  267. drivers/hid/hid-quirks.c +2 −0
  268. drivers/hid/hid-steam.c +4 −2
  269. drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c +8 −0
  270. drivers/hwmon/amd_energy.c +1 −1
  271. drivers/hwmon/aspeed-pwm-tacho.c +2 −0
  272. drivers/hwmon/drivetemp.c +43 −0
  273. drivers/hwmon/emc2103.c +1 −1
  274. drivers/hwmon/nct6775.c +3 −3
  275. drivers/hwmon/pmbus/adm1275.c +8 −2
  276. drivers/hwmon/scmi-hwmon.c +1 −1
  277. drivers/hwtracing/coresight/coresight-cti.c +54 −42
  278. drivers/hwtracing/coresight/coresight-etm4x.c +53 −29
  279. drivers/hwtracing/intel_th/core.c +18 −3
  280. drivers/hwtracing/intel_th/pci.c +15 −0
  281. drivers/hwtracing/intel_th/sth.c +1 −3
  282. drivers/i2c/busses/i2c-cadence.c +12 −16
  283. drivers/i2c/busses/i2c-qcom-geni.c +4 −2
  284. drivers/i2c/busses/i2c-rcar.c +3 −0
  285. drivers/i2c/i2c-core-slave.c +4 −3
  286. drivers/iio/accel/mma8452.c +4 −1
  287. drivers/iio/adc/ad7780.c +1 −1
  288. drivers/iio/adc/adi-axi-adc.c +2 −2
  289. drivers/iio/health/afe4403.c +6 −3
  290. drivers/iio/health/afe4404.c +5 −3
  291. drivers/iio/humidity/hdc100x.c +7 −3
  292. drivers/iio/humidity/hts221.h +5 −2
  293. drivers/iio/humidity/hts221_buffer.c +5 −4
  294. drivers/iio/industrialio-core.c +2 −0
  295. drivers/iio/magnetometer/ak8974.c +17 −12
  296. drivers/iio/pressure/ms5611_core.c +8 −3
  297. drivers/iio/pressure/zpa2326.c +3 −1
  298. drivers/infiniband/core/cm.c +2 −0
  299. drivers/infiniband/core/cq.c +11 −3
  300. drivers/infiniband/core/rdma_core.c +3 −3
  301. drivers/infiniband/core/sa_query.c +17 −21
  302. drivers/infiniband/core/ucma.c +4 −0
  303. drivers/infiniband/hw/hfi1/init.c +28 −9
  304. drivers/infiniband/hw/hfi1/qp.c +5 −2
  305. drivers/infiniband/hw/hfi1/tid_rdma.c +4 −1
  306. drivers/infiniband/hw/hns/hns_roce_hw_v2.c +22 −12
  307. drivers/infiniband/hw/hns/hns_roce_mr.c +1 −1
  308. drivers/infiniband/hw/mlx5/main.c +1 −1
  309. drivers/infiniband/hw/mlx5/odp.c +21 −6
  310. drivers/infiniband/hw/mlx5/qp.c +22 −14
  311. drivers/infiniband/hw/mlx5/srq_cmd.c +2 −2
  312. drivers/infiniband/sw/rdmavt/qp.c +4 −29
  313. drivers/infiniband/sw/rdmavt/rc.c +1 −3
  314. drivers/infiniband/sw/siw/siw_main.c +2 −1
  315. drivers/input/mouse/elan_i2c_core.c +5 −4
  316. drivers/input/mouse/synaptics.c +1 −0
  317. drivers/input/serio/i8042-x86ia64io.h +7 −0
  318. drivers/input/touchscreen/elants_i2c.c +0 −1
  319. drivers/interconnect/core.c +9 −3
  320. drivers/interconnect/qcom/msm8916.c +7 −7
  321. drivers/iommu/Kconfig +1 −0
  322. drivers/iommu/amd/amd_iommu.h +1 −1
  323. drivers/iommu/amd/iommu.c +3 −2
  324. drivers/iommu/arm-smmu-qcom.c +1 −1
  325. drivers/iommu/hyperv-iommu.c +4 −1
  326. drivers/iommu/intel/irq_remapping.c +1 −1
  327. drivers/iommu/iommu.c +1 −1
  328. drivers/iommu/qcom_iommu.c +17 −20
  329. drivers/iommu/sun50i-iommu.c +3 −5
  330. drivers/md/dm-integrity.c +2 −2
  331. drivers/md/dm-rq.c +0 −4
  332. drivers/md/dm-writecache.c +6 −0
  333. drivers/md/dm-zoned-metadata.c +8 −1
  334. drivers/md/dm-zoned-reclaim.c +3 −4
  335. drivers/md/dm-zoned-target.c +1 −9
  336. drivers/md/dm.c +70 −31
  337. drivers/mfd/ioc3.c +3 −2
  338. drivers/misc/atmel-ssc.c +12 −12
  339. drivers/misc/habanalabs/command_submission.c +11 −3
  340. drivers/misc/habanalabs/debugfs.c +8 −15
  341. drivers/misc/habanalabs/device.c +1 −1
  342. drivers/misc/habanalabs/firmware_if.c +5 −5
  343. drivers/misc/habanalabs/gaudi/gaudi.c +84 −39
  344. drivers/misc/habanalabs/goya/goya.c +12 −8
  345. drivers/misc/habanalabs/habanalabs.h +13 −6
  346. drivers/misc/habanalabs/habanalabs_drv.c +1 −1
  347. drivers/misc/habanalabs/hwmon.c +9 −10
  348. drivers/misc/habanalabs/sysfs.c +4 −7
  349. drivers/misc/mei/bus.c +1 −2
  350. drivers/mmc/host/meson-gx-mmc.c +4 −2
  351. drivers/mmc/host/owl-mmc.c +1 −1
  352. drivers/mmc/host/sdhci-msm.c +3 −2
  353. drivers/mmc/host/sdhci-of-aspeed.c +1 −1
  354. drivers/net/bareudp.c +22 −7
  355. drivers/net/bonding/bond_main.c +7 −3
  356. drivers/net/bonding/bond_netlink.c +1 −2
  357. drivers/net/dsa/microchip/ksz8795.c +3 −0
  358. drivers/net/dsa/microchip/ksz9477.c +26 −19
  359. drivers/net/dsa/microchip/ksz9477_i2c.c +1 −0
  360. drivers/net/dsa/microchip/ksz_common.c +0 −2
  361. drivers/net/dsa/microchip/ksz_common.h +0 −2
  362. drivers/net/dsa/mv88e6xxx/chip.c +19 −3
  363. drivers/net/dsa/mv88e6xxx/chip.h +1 −0
  364. drivers/net/ethernet/aquantia/atlantic/aq_hw.h +1 −0
  365. drivers/net/ethernet/aquantia/atlantic/aq_nic.c +9 −0
  366. drivers/net/ethernet/aquantia/atlantic/aq_nic.h +2 −0
  367. drivers/net/ethernet/aquantia/atlantic/aq_phy.c +27 −2
  368. drivers/net/ethernet/aquantia/atlantic/aq_phy.h +6 −2
  369. drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c +25 −1
  370. drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.h +4 −6
  371. drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c +2 −2
  372. drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h +1 −1
  373. drivers/net/ethernet/atheros/ag71xx.c +2 −1
  374. drivers/net/ethernet/broadcom/bnxt/bnxt.c +15 −7
  375. drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +4 −1
  376. drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +1 −1
  377. drivers/net/ethernet/broadcom/genet/bcmgenet.c +65 −79
  378. drivers/net/ethernet/broadcom/genet/bcmgenet.h +0 −1
  379. drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c +15 −7
  380. drivers/net/ethernet/cadence/macb_main.c +20 −13
  381. drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c +5 −5
  382. drivers/net/ethernet/chelsio/cxgb4/sge.c +1 −0
  383. drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +4 −4
  384. drivers/net/ethernet/cortina/gemini.c +4 −1
  385. drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +1 −1
  386. drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +1 −1
  387. drivers/net/ethernet/freescale/enetc/enetc.c +2 −2
  388. drivers/net/ethernet/freescale/enetc/enetc_pf.c +1 −0
  389. drivers/net/ethernet/freescale/fec.h +1 −5
  390. drivers/net/ethernet/freescale/fec_main.c +48 −69
  391. drivers/net/ethernet/freescale/fec_ptp.c +12 −0
  392. drivers/net/ethernet/freescale/gianfar.c +5 −1
  393. drivers/net/ethernet/hisilicon/hns3/hnae3.h +1 −0
  394. drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +20 −25
  395. drivers/net/ethernet/hisilicon/hns3/hns3_enet.h +0 −2
  396. drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +6 −3
  397. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +42 −44
  398. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h +3 −0
  399. drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +31 −12
  400. drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c +2 −0
  401. drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c +72 −19
  402. drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.h +16 −0
  403. drivers/net/ethernet/ibm/ibmvnic.c +1 −1
  404. drivers/net/ethernet/intel/e1000e/ich8lan.c +1 −3
  405. drivers/net/ethernet/intel/igb/igb_main.c +9 −0
  406. drivers/net/ethernet/marvell/mvneta.c +1 −1
  407. drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +3 −0
  408. drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c +2 −0
  409. drivers/net/ethernet/marvell/sky2.c +1 −1
  410. drivers/net/ethernet/mediatek/mtk_eth_soc.c +16 −5
  411. drivers/net/ethernet/mellanox/mlx4/main.c +2 −0
  412. drivers/net/ethernet/mellanox/mlx5/core/en/dcbnl.h +1 −0
  413. drivers/net/ethernet/mellanox/mlx5/core/en/port.c +18 −3
  414. drivers/net/ethernet/mellanox/mlx5/core/en/port.h +1 −1
  415. drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.c +29 −24
  416. drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.h +0 −1
  417. drivers/net/ethernet/mellanox/mlx5/core/en/rep/bond.c +5 −2
  418. drivers/net/ethernet/mellanox/mlx5/core/en/rep/neigh.c +0 −1
  419. drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c +21 −9
  420. drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +1 −0
  421. drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c +2 −0
  422. drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_gre.c +2 −0
  423. drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_vxlan.c +2 −0
  424. drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +19 −0
  425. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +4 −4
  426. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +34 −12
  427. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +3 −0
  428. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +10 −5
  429. drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c +0 −1
  430. drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +16 −11
  431. drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +2 −0
  432. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +12 −7
  433. drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +5 −23
  434. drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c +65 −13
  435. drivers/net/ethernet/mellanox/mlx5/core/port.c +77 −16
  436. drivers/net/ethernet/mellanox/mlxsw/core.c +7 −4
  437. drivers/net/ethernet/mellanox/mlxsw/core_env.c +32 −16
  438. drivers/net/ethernet/mellanox/mlxsw/pci.c +38 −16
  439. drivers/net/ethernet/mellanox/mlxsw/reg.h +1 −0
  440. drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +27 −34
  441. drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c +11 −3
  442. drivers/net/ethernet/mscc/ocelot.c +5 −5
  443. drivers/net/ethernet/neterion/vxge/vxge-main.c +1 −1
  444. drivers/net/ethernet/ni/nixge.c +5 −3
  445. drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +22 −37
  446. drivers/net/ethernet/pensando/ionic/ionic_lif.c +44 −27
  447. drivers/net/ethernet/pensando/ionic/ionic_lif.h +4 −8
  448. drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c +29 −0
  449. drivers/net/ethernet/pensando/ionic/ionic_txrx.c +0 −6
  450. drivers/net/ethernet/qlogic/qed/qed.h +2 −0
  451. drivers/net/ethernet/qlogic/qed/qed_cxt.c +2 −2
  452. drivers/net/ethernet/qlogic/qed/qed_debug.c +16 −1
  453. drivers/net/ethernet/qlogic/qed/qed_dev.c +4 −10
  454. drivers/net/ethernet/qlogic/qed/qed_int.c +31 −22
  455. drivers/net/ethernet/qlogic/qed/qed_int.h +2 −2
  456. drivers/net/ethernet/qlogic/qed/qed_mcp.c +7 −0
  457. drivers/net/ethernet/qlogic/qed/qed_mcp.h +7 −0
  458. drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c +13 −5
  459. drivers/net/ethernet/renesas/ravb_main.c +24 −2
  460. drivers/net/ethernet/smsc/smc91x.c +2 −2
  461. drivers/net/ethernet/socionext/sni_ave.c +1 −1
  462. drivers/net/ethernet/ti/am65-cpsw-nuss.c +2 −1
  463. drivers/net/geneve.c +1 −1
  464. drivers/net/hippi/rrunner.c +1 −1
  465. drivers/net/ieee802154/adf7242.c +4 −2
  466. drivers/net/ipa/gsi.c +7 −9
  467. drivers/net/ipa/ipa_cmd.c +15 −0
  468. drivers/net/ipa/ipa_cmd.h +8 −0
  469. drivers/net/ipa/ipa_data-sdm845.c +0 −1
  470. drivers/net/ipa/ipa_endpoint.c +2 −0
  471. drivers/net/ipa/ipa_gsi.c +1 −0
  472. drivers/net/ipa/ipa_gsi.h +2 −0
  473. drivers/net/ipa/ipa_qmi_msg.c +3 −3
  474. drivers/net/macsec.c +2 −3
  475. drivers/net/macvlan.c +2 −3
  476. drivers/net/netdevsim/netdev.c +2 −2
  477. drivers/net/phy/dp83640.c +4 −0
  478. drivers/net/tun.c +2 −0
  479. drivers/net/usb/ax88172a.c +1 −0
  480. drivers/net/usb/hso.c +7 −3
  481. drivers/net/usb/lan78xx.c +31 −82
  482. drivers/net/usb/qmi_wwan.c +1 −0
  483. drivers/net/usb/smsc95xx.c +8 −1
  484. drivers/net/vxlan.c +12 −4
  485. drivers/net/wan/hdlc_x25.c +3 −1
  486. drivers/net/wan/lapbether.c +13 −4
  487. drivers/net/wan/x25_asy.c +14 −7
  488. drivers/net/wireguard/device.c +1 −0
  489. drivers/net/wireguard/queueing.h +2 −17
  490. drivers/net/wireguard/receive.c +1 −1
  491. drivers/net/wireless/ath/ath10k/ahb.c +1 −1
  492. drivers/net/wireless/ath/ath10k/pci.c +37 −41
  493. drivers/net/wireless/ath/ath9k/hif_usb.c +3 −1
  494. drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +14 −2
  495. drivers/net/wireless/intel/iwlwifi/mvm/sta.c +3 −5
  496. drivers/net/wireless/intel/iwlwifi/pcie/drv.c +2 −0
  497. drivers/net/wireless/mediatek/mt76/mt76.h +1 −0
  498. drivers/net/wireless/mediatek/mt76/mt7603/main.c +2 −0
  499. drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c +5 −4
  500. drivers/net/wireless/mediatek/mt76/mt7615/dma.c +5 −4
  501. drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c +1 −2
  502. drivers/net/wireless/mediatek/mt76/mt7615/eeprom.h +1 −1
  503. drivers/net/wireless/mediatek/mt76/mt7615/mac.c +7 −13
  504. drivers/net/wireless/mediatek/mt76/mt7615/mac.h +0 −15
  505. drivers/net/wireless/mediatek/mt76/mt7615/main.c +4 −0
  506. drivers/net/wireless/mediatek/mt76/mt7615/mmio.c +1 −1
  507. drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h +30 −0
  508. drivers/net/wireless/mediatek/mt76/mt7615/usb.c +7 −6
  509. drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c +3 −2
  510. drivers/net/wireless/mediatek/mt76/mt7915/main.c +3 −0
  511. drivers/net/wireless/mediatek/mt76/tx.c +7 −0
  512. drivers/net/wireless/mediatek/mt76/usb.c +26 −13
  513. drivers/net/xen-netfront.c +42 −22
  514. drivers/nfc/s3fwrn5/core.c +1 −0
  515. drivers/nvdimm/security.c +1 −1
  516. drivers/nvme/host/core.c +4 −12
  517. drivers/nvme/host/nvme.h +20 −0
  518. drivers/nvme/host/pci.c +4 −0
  519. drivers/nvme/host/tcp.c +3 −0
  520. drivers/opp/of.c +4 −0
  521. drivers/pci/controller/vmd.c +3 −2
  522. drivers/pci/pci.c +9 −21
  523. drivers/pci/quirks.c +13 −0
  524. drivers/perf/arm-cci.c +1 −0
  525. drivers/perf/arm-ccn.c +1 −0
  526. drivers/perf/arm_dsu_pmu.c +1 −0
  527. drivers/perf/arm_smmuv3_pmu.c +2 −0
  528. drivers/perf/arm_spe_pmu.c +1 −0
  529. drivers/perf/fsl_imx8_ddr_perf.c +2 −0
  530. drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c +2 −0
  531. drivers/perf/hisilicon/hisi_uncore_hha_pmu.c +2 −0
  532. drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c +2 −0
  533. drivers/perf/qcom_l2_pmu.c +1 −0
  534. drivers/perf/qcom_l3_pmu.c +1 −0
  535. drivers/perf/thunderx2_pmu.c +1 −0
  536. drivers/perf/xgene_pmu.c +1 −0
  537. drivers/phy/allwinner/phy-sun4i-usb.c +3 −2
  538. drivers/phy/intel/phy-intel-combo.c +8 −6
  539. drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c +2 −2
  540. drivers/phy/ti/phy-am654-serdes.c +1 −1
  541. drivers/phy/ti/phy-j721e-wiz.c +5 −5
  542. drivers/pinctrl/intel/pinctrl-baytrail.c +53 −14
  543. drivers/pinctrl/pinctrl-amd.h +1 −1
  544. drivers/pinctrl/qcom/Kconfig +2 −0
  545. drivers/pinctrl/qcom/pinctrl-msm.c +72 −2
  546. drivers/pinctrl/qcom/pinctrl-msm.h +4 −0
  547. drivers/pinctrl/qcom/pinctrl-sc7180.c +1 −0
  548. drivers/platform/x86/asus-wmi.c +1 −0
  549. drivers/platform/x86/intel_speed_select_if/isst_if_common.h +3 −0
  550. drivers/platform/x86/intel_speed_select_if/isst_if_mbox_pci.c +1 −0
  551. drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c +1 −0
  552. drivers/platform/x86/thinkpad_acpi.c +11 −3
  553. drivers/regulator/Makefile +1 −1
  554. drivers/regulator/da903x-regulator.c +0 −0
  555. drivers/regulator/qcom_smd-regulator.c +1 −1
  556. drivers/scsi/libiscsi.c +1 −1
  557. drivers/scsi/megaraid/megaraid_sas_fusion.c +0 −2
  558. drivers/scsi/mpt3sas/mpt3sas_ctl.c +7 −5
  559. drivers/scsi/scsi_devinfo.c +1 −0
  560. drivers/scsi/scsi_dh.c +1 −0
  561. drivers/scsi/scsi_lib.c +11 −5
  562. drivers/scsi/scsi_transport_iscsi.c +1 −1
  563. drivers/scsi/scsi_transport_spi.c +1 −1
  564. drivers/soc/amlogic/meson-gx-socinfo.c +5 −3
  565. drivers/soc/imx/soc-imx.c +3 −0
  566. drivers/soundwire/intel.c +3 −2
  567. drivers/spi/spi-mt65xx.c +8 −7
  568. drivers/spi/spi-sun6i.c +6 −8
  569. drivers/staging/comedi/drivers/addi_apci_1032.c +14 −6
  570. drivers/staging/comedi/drivers/addi_apci_1500.c +26 −8
  571. drivers/staging/comedi/drivers/addi_apci_1564.c +14 −6
  572. drivers/staging/comedi/drivers/ni_6527.c +1 −1
  573. drivers/staging/media/atomisp/Kconfig +1 −1
  574. drivers/staging/media/atomisp/Makefile +1 −5
  575. drivers/staging/media/atomisp/i2c/atomisp-ov2680.c +3 −3
  576. drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c +4 −2
  577. drivers/staging/media/atomisp/include/linux/atomisp_platform.h +1 −0
  578. drivers/staging/media/atomisp/pci/atomisp-regs.h +0 −3
  579. drivers/staging/media/atomisp/pci/atomisp_acc.c +2 −2
  580. drivers/staging/media/atomisp/pci/atomisp_cmd.c +32 −27
  581. drivers/staging/media/atomisp/pci/atomisp_cmd.h +2 −2
  582. drivers/staging/media/atomisp/pci/atomisp_compat.h +0 −2
  583. drivers/staging/media/atomisp/pci/atomisp_compat_css20.c +34 −36
  584. drivers/staging/media/atomisp/pci/atomisp_compat_css20.h +1 −1
  585. drivers/staging/media/atomisp/pci/atomisp_drvfs.c +7 −7
  586. drivers/staging/media/atomisp/pci/atomisp_drvfs.h +1 −1
  587. drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c +351 −186
  588. drivers/staging/media/atomisp/pci/atomisp_internal.h +1 −1
  589. drivers/staging/media/atomisp/pci/atomisp_ioctl.c +9 −10
  590. drivers/staging/media/atomisp/pci/atomisp_v4l2.c +127 −158
  591. drivers/staging/media/atomisp/pci/base/refcount/src/refcount.c +14 −14
  592. drivers/staging/media/atomisp/pci/hive_types.h +3 −21
  593. drivers/staging/media/atomisp/pci/hmm/hmm.c +5 −5
  594. drivers/staging/media/atomisp/pci/isp2400_system_global.h +0 −302
  595. drivers/staging/media/atomisp/pci/isp2400_system_local.h +0 −321
  596. drivers/staging/media/atomisp/pci/isp2401_system_global.h +1 −409
  597. drivers/staging/media/atomisp/pci/isp2401_system_local.h +0 −402
  598. drivers/staging/media/atomisp/pci/sh_css.c +7 −2
  599. drivers/staging/media/atomisp/pci/system_global.h +395 −0
  600. drivers/staging/media/atomisp/pci/system_local.c +179 −0
  601. drivers/staging/media/atomisp/pci/system_local.h +98 −6
  602. drivers/staging/wlan-ng/prism2usb.c +15 −1
  603. drivers/thermal/intel/int340x_thermal/int3400_thermal.c +6 −1
  604. drivers/thermal/intel/int340x_thermal/int3403_thermal.c +1 −1
  605. drivers/thermal/mtk_thermal.c +2 −4
  606. drivers/thunderbolt/tunnel.c +6 −6
  607. drivers/tty/serial/8250/8250_core.c +1 −1
  608. drivers/tty/serial/8250/8250_exar.c +11 −1
  609. drivers/tty/serial/8250/8250_mtk.c +18 −0
  610. drivers/tty/serial/cpm_uart/cpm_uart_core.c +8 −1
  611. drivers/tty/serial/mxs-auart.c +8 −4
  612. drivers/tty/serial/serial-tegra.c +7 −9
  613. drivers/tty/serial/serial_core.c +17 −98
  614. drivers/tty/serial/sh-sci.c +3 −0
  615. drivers/tty/serial/xilinx_uartps.c +6 −3
  616. drivers/tty/vt/vt.c +18 −11
  617. drivers/uio/uio_pdrv_genirq.c +2 −2
  618. drivers/usb/c67x00/c67x00-sched.c +1 −1
  619. drivers/usb/cdns3/ep0.c +15 −15
  620. drivers/usb/cdns3/trace.h +3 −3
  621. drivers/usb/chipidea/core.c +24 −0
  622. drivers/usb/dwc2/platform.c +2 −1
  623. drivers/usb/dwc3/dwc3-pci.c +8 −0
  624. drivers/usb/gadget/function/f_uac1_legacy.c +2 −0
  625. drivers/usb/gadget/udc/atmel_usba_udc.c +2 −8
  626. drivers/usb/gadget/udc/gr_udc.c +5 −2
  627. drivers/usb/gadget/usbstring.c +1 −1
  628. drivers/usb/host/xhci-mtk-sch.c +4 −0
  629. drivers/usb/host/xhci-pci.c +3 −0
  630. drivers/usb/host/xhci-tegra.c +1 −1
  631. drivers/usb/serial/ch341.c +1 −0
  632. drivers/usb/serial/cypress_m8.c +2 −0
  633. drivers/usb/serial/cypress_m8.h +3 −0
  634. drivers/usb/serial/iuu_phoenix.c +5 −3
  635. drivers/usb/serial/option.c +6 −0
  636. drivers/vfio/pci/vfio_pci.c +5 −0
  637. drivers/vhost/scsi.c +1 −1
  638. drivers/video/fbdev/core/bitblit.c +2 −2
  639. drivers/video/fbdev/core/fbcon_ccw.c +2 −2
  640. drivers/video/fbdev/core/fbcon_cw.c +2 −2
  641. drivers/video/fbdev/core/fbcon_ud.c +2 −2
  642. drivers/virt/vboxguest/vboxguest_core.c +4 −2
  643. drivers/virt/vboxguest/vboxguest_core.h +15 −0
  644. drivers/virt/vboxguest/vboxguest_linux.c +2 −1
  645. drivers/virt/vboxguest/vmmdev.h +2 −0
  646. drivers/virtio/Kconfig +1 −1
  647. drivers/virtio/virtio_balloon.c +10 −1
  648. drivers/virtio/virtio_mmio.c +2 −2
  649. drivers/xen/xenbus/xenbus_client.c +1 −3
  650. fs/afs/fs_operation.c +2 −2
  651. fs/afs/write.c +1 −0
  652. fs/autofs/waitq.c +1 −1
  653. fs/btrfs/backref.c +1 −0
  654. fs/btrfs/discard.c +1 −0
  655. fs/btrfs/extent_io.c +2 −1
  656. fs/btrfs/file.c +1 −0
  657. fs/btrfs/inode.c +11 −21
  658. fs/btrfs/volumes.c +8 −0
  659. fs/cachefiles/rdwr.c +1 −1
  660. fs/cifs/cifsfs.h +1 −1
  661. fs/cifs/file.c +6 −13
  662. fs/cifs/inode.c +2 −8
  663. fs/cifs/ioctl.c +8 −1
  664. fs/cifs/smb2misc.c +6 −2
  665. fs/cifs/smb2ops.c +1 −1
  666. fs/efivarfs/super.c +3 −3
  667. fs/exfat/dir.c +1 −1
  668. fs/exfat/exfat_fs.h +1 −1
  669. fs/exfat/file.c +1 −1
  670. fs/exfat/nls.c +4 −4
  671. fs/fuse/file.c +78 −54
  672. fs/fuse/inode.c +16 −3
  673. fs/gfs2/aops.c +1 −44
  674. fs/gfs2/file.c +50 −2
  675. fs/io_uring.c +76 −36
  676. fs/namespace.c +1 −0
  677. fs/nfs/direct.c +4 −9
  678. fs/nfs/file.c +0 −1
  679. fs/nfs/nfs4proc.c +18 −2
  680. fs/nfsd/nfs4state.c +19 −1
  681. fs/overlayfs/copy_up.c +1 −1
  682. fs/overlayfs/export.c +1 −1
  683. fs/overlayfs/file.c +6 −4
  684. fs/overlayfs/namei.c +6 −9
  685. fs/overlayfs/overlayfs.h +0 −1
  686. fs/overlayfs/super.c +49 −24
  687. fs/read_write.c +75 −56
  688. fs/squashfs/block.c +1 −1
  689. fs/zonefs/super.c +11 −7
  690. include/asm-generic/io.h +2 −2
  691. include/asm-generic/mmiowb.h +4 −2
  692. include/asm-generic/vmlinux.lds.h +4 −1
  693. include/drm/drm_mode_config.h +12 −0
  694. include/linux/bits.h +1 −2
  695. include/linux/bpf-netns.h +3 −2
  696. include/linux/bpf.h +11 −2
  697. include/linux/btf.h +5 −0
  698. include/linux/cgroup-defs.h +6 −2
  699. include/linux/cgroup.h +3 −1
  700. include/linux/compiler-gcc.h +1 −1
  701. include/linux/compiler_types.h +1 −26
  702. include/linux/device-mapper.h +1 −0
  703. include/linux/device.h +3 −2
  704. include/linux/dma-buf.h +1 −0
  705. include/linux/dma-direct.h +2 −0
  706. include/linux/dma-mapping.h +5 −0
  707. include/linux/efi.h +1 −0
  708. include/linux/filter.h +2 −2
  709. include/linux/fs.h +2 −1
  710. include/linux/fs_context.h +1 −0
  711. include/linux/i2c.h +2 −2
  712. include/linux/ieee80211.h +4 −0
  713. include/linux/if_vlan.h +22 −7
  714. include/linux/input/elan-i2c-ids.h +7 −0
  715. include/linux/io-mapping.h +4 −1
  716. include/linux/kallsyms.h +3 −2
  717. include/linux/kgdb.h +12 −0
  718. include/linux/mlx5/driver.h +1 −0
  719. include/linux/mlx5/mlx5_ifc.h +29 −0
  720. include/linux/mod_devicetable.h +1 −1
  721. include/linux/random.h +3 −0
  722. include/linux/rhashtable.h +32 −39
  723. include/linux/scatterlist.h +4 −4
  724. include/linux/sched.h +0 −4
  725. include/linux/serial_core.h +98 −4
  726. include/linux/skmsg.h +13 −0
  727. include/linux/tcp.h +4 −2
  728. include/linux/xattr.h +2 −1
  729. include/net/addrconf.h +1 −0
  730. include/net/devlink.h +3 −0
  731. include/net/dst.h +9 −1
  732. include/net/flow_dissector.h +2 −1
  733. include/net/flow_offload.h +0 −1
  734. include/net/genetlink.h +0 −10
  735. include/net/inet_ecn.h +17 −8
  736. include/net/ip_tunnels.h +3 −0
  737. include/net/netns/bpf.h +5 −2
  738. include/net/pkt_sched.h +0 −11
  739. include/net/sock.h +2 −1
  740. include/net/xfrm.h +9 −6
  741. include/net/xsk_buff_pool.h +3 −3
  742. include/rdma/rdmavt_qp.h +19 −0
  743. include/sound/compress_driver.h +9 −1
  744. include/sound/rt5670.h +1 −0
  745. include/sound/soc-dai.h +1 −0
  746. include/sound/soc.h +2 −0
  747. include/uapi/linux/bpf.h +21 −20
  748. include/uapi/linux/idxd.h +3 −0
  749. include/uapi/linux/input-event-codes.h +2 −1
  750. include/uapi/linux/io_uring.h +1 −0
  751. include/uapi/linux/vboxguest.h +2 −2
  752. kernel/audit.c +0 −1
  753. kernel/audit.h +0 −8
  754. kernel/auditsc.c +3 −0
  755. kernel/bpf/btf.c +7 −2
  756. kernel/bpf/hashtab.c +9 −3
  757. kernel/bpf/net_namespace.c +134 −60
  758. kernel/bpf/reuseport_array.c +10 −4
  759. kernel/bpf/ringbuf.c +8 −10
  760. kernel/bpf/syscall.c +24 −21
  761. kernel/bpf/verifier.c +10 −3
  762. kernel/cgroup/cgroup.c +19 −12
  763. kernel/debug/gdbstub.c +13 −0
  764. kernel/dma/direct.c +7 −1
  765. kernel/dma/mapping.c +10 −0
  766. kernel/dma/pool.c +56 −31
  767. kernel/events/uprobes.c +1 −1
  768. kernel/irq/manage.c +35 −2
  769. kernel/kallsyms.c +11 −6
  770. kernel/kprobes.c +2 −2
  771. kernel/module.c +27 −24
  772. kernel/sched/core.c +58 −16
  773. kernel/sched/fair.c +13 −2
  774. kernel/signal.c +1 −1
  775. kernel/time/timer.c +24 −5
  776. lib/Kconfig.kgdb +5 −0
  777. lib/packing.c +1 −0
  778. lib/random32.c +1 −1
  779. lib/rhashtable.c +16 −19
  780. mm/filemap.c +21 −2
  781. mm/hugetlb.c +10 −5
  782. mm/khugepaged.c +3 −0
  783. mm/memcontrol.c +10 −3
  784. mm/memory.c +1 −1
  785. mm/migrate.c +1 −12
  786. mm/mmap.c +14 −2
  787. mm/mremap.c +21 −2
  788. mm/shmem.c +1 −1
  789. mm/slab_common.c +28 −7
  790. net/8021q/vlan_dev.c +4 −5
  791. net/9p/trans_fd.c +30 −9
  792. net/ax25/af_ax25.c +8 −2
  793. net/bluetooth/hci_event.c +19 −7
  794. net/bpf/test_run.c +18 −1
  795. net/bpfilter/bpfilter_kern.c +2 −2
  796. net/bridge/br_mrp.c +1 −1
  797. net/bridge/br_multicast.c +1 −1
  798. net/bridge/br_private.h +1 −1
  799. net/bridge/br_private_mrp.h +1 −1
  800. net/compat.c +1 −1
  801. net/core/dev.c +1 −1
  802. net/core/dev_addr_lists.c +10 −0
  803. net/core/devlink.c +19 −6
  804. net/core/filter.c +7 −3
  805. net/core/flow_dissector.c +12 −20
  806. net/core/flow_offload.c +1 −0
  807. net/core/net-sysfs.c +1 −1
  808. net/core/rtnetlink.c +2 −1
  809. net/core/skmsg.c +15 −8
  810. net/core/sock.c +1 −1
  811. net/core/sock_map.c +48 −5
  812. net/core/sock_reuseport.c +1 −0
  813. net/core/sysctl_net_core.c +1 −1
  814. net/ethtool/netlink.c +13 −14
  815. net/hsr/hsr_device.c +7 −4
  816. net/hsr/hsr_forward.c +13 −5
  817. net/hsr/hsr_framereg.c +2 −1
  818. net/ipv4/fib_trie.c +1 −1
  819. net/ipv4/icmp.c +2 −2
  820. net/ipv4/ip_output.c +1 −1
  821. net/ipv4/ip_tunnel_core.c +18 −0
  822. net/ipv4/ip_vti.c +1 −0
  823. net/ipv4/ipip.c +1 −0
  824. net/ipv4/ping.c +3 −0
  825. net/ipv4/route.c +1 −1
  826. net/ipv4/tcp.c +10 −7
  827. net/ipv4/tcp_cong.c +1 −1
  828. net/ipv4/tcp_input.c +8 −5
  829. net/ipv4/tcp_ipv4.c +16 −4
  830. net/ipv4/tcp_output.c +13 −8
  831. net/ipv4/udp.c +10 −7
  832. net/ipv6/anycast.c +12 −5
  833. net/ipv6/esp6.c +10 −3
  834. net/ipv6/icmp.c +2 −2
  835. net/ipv6/ip6_gre.c +6 −5
  836. net/ipv6/ip6_tunnel.c +1 −0
  837. net/ipv6/ip6_vti.c +1 −0
  838. net/ipv6/ipv6_sockglue.c +1 −0
  839. net/ipv6/route.c +9 −6
  840. net/ipv6/sit.c +1 −0
  841. net/ipv6/udp.c +10 −7
  842. net/key/af_key.c +9 −2
  843. net/l2tp/l2tp_core.c +1 −4
  844. net/llc/af_llc.c +7 −3
  845. net/mac80211/cfg.c +1 −0
  846. net/mac80211/mesh.c +13 −0
  847. net/mac80211/mesh_hwmp.c +2 −5
  848. net/mac80211/mesh_pathtbl.c +1 −0
  849. net/mac80211/rx.c +26 −0
  850. net/mac80211/sta_info.c +1 −3
  851. net/mac80211/status.c +15 −7
  852. net/mac80211/tx.c +10 −5
  853. net/mac80211/util.c +4 −0
  854. net/mptcp/options.c +3 −3
  855. net/mptcp/protocol.c +1 −1
  856. net/netfilter/ipset/ip_set_bitmap_ip.c +1 −1
  857. net/netfilter/ipset/ip_set_bitmap_ipmac.c +1 −1
  858. net/netfilter/ipset/ip_set_bitmap_port.c +1 −1
  859. net/netfilter/ipset/ip_set_hash_gen.h +2 −2
  860. net/netfilter/ipvs/ip_vs_sync.c +8 −4
  861. net/netfilter/nf_conntrack_core.c +2 −0
  862. net/netfilter/nf_tables_api.c +14 −27
  863. net/netlink/genetlink.c +13 −84
  864. net/nfc/nci/core.c +4 −1
  865. net/qrtr/qrtr.c +9 −2
  866. net/rds/connection.c +11 −0
  867. net/rds/rds.h +7 −0
  868. net/rds/recv.c +2 −1
  869. net/rds/send.c +2 −1
  870. net/rxrpc/call_object.c +19 −8
  871. net/rxrpc/conn_object.c +5 −3
  872. net/rxrpc/recvmsg.c +2 −2
  873. net/rxrpc/sendmsg.c +4 −1
  874. net/sched/act_connmark.c +6 −3
  875. net/sched/act_csum.c +1 −1
  876. net/sched/act_ct.c +22 −9
  877. net/sched/act_ctinfo.c +6 −3
  878. net/sched/act_mpls.c +1 −1
  879. net/sched/act_skbedit.c +1 −1
  880. net/sched/cls_api.c +1 −2
  881. net/sched/cls_flow.c +4 −4
  882. net/sched/cls_flower.c +1 −1
  883. net/sched/em_ipset.c +1 −1
  884. net/sched/em_ipt.c +1 −1
  885. net/sched/em_meta.c +1 −1
  886. net/sched/sch_atm.c +4 −4
  887. net/sched/sch_cake.c +2 −2
  888. net/sched/sch_dsmark.c +3 −3
  889. net/sched/sch_teql.c +1 −1
  890. net/sctp/stream.c +18 −9
  891. net/smc/af_smc.c +8 −4
  892. net/smc/smc_cdc.c +5 −1
  893. net/smc/smc_clc.c +32 −13
  894. net/smc/smc_clc.h +2 −0
  895. net/smc/smc_core.c +41 −95
  896. net/smc/smc_core.h +8 −1
  897. net/smc/smc_ib.c +19 −8
  898. net/smc/smc_ib.h +3 −1
  899. net/smc/smc_ism.c +6 −5
  900. net/smc/smc_ism.h +2 −1
  901. net/smc/smc_llc.c +138 −74
  902. net/smc/smc_llc.h +1 −1
  903. net/smc/smc_pnet.c +19 −18
  904. net/smc/smc_wr.c +6 −4
  905. net/sunrpc/xprtrdma/rpc_rdma.c +2 −2
  906. net/sunrpc/xprtrdma/transport.c +5 −0
  907. net/sunrpc/xprtrdma/verbs.c +16 −19
  908. net/tipc/link.c +19 −9
  909. net/vmw_vsock/virtio_transport.c +1 −1
  910. net/wireless/nl80211.c +6 −5
  911. net/xdp/xsk_buff_pool.c +4 −50
  912. net/xfrm/espintcp.c +47 −15
  913. net/xfrm/xfrm_interface.c +2 −0
  914. net/xfrm/xfrm_policy.c +18 −25
  915. net/xfrm/xfrm_user.c +11 −7
  916. scripts/Makefile.extrawarn +2 −0
  917. scripts/Makefile.modpost +0 −3
  918. scripts/decode_stacktrace.sh +2 −2
  919. scripts/gdb/linux/symbols.py +1 −1
  920. scripts/kconfig/.gitignore +1 −1
  921. scripts/kconfig/Makefile +8 −5
  922. scripts/kconfig/qconf.cc +6 −17
  923. scripts/kconfig/qconf.h +0 −4
  924. scripts/mod/modpost.c +11 −2
  925. security/integrity/iint.c +1 −13
  926. sound/core/compress_offload.c +4 −0
  927. sound/core/info.c +3 −1
  928. sound/drivers/opl3/opl3_synth.c +2 −0
  929. sound/pci/hda/hda_auto_parser.c +6 −0
  930. sound/pci/hda/hda_codec.c +8 −0
  931. sound/pci/hda/hda_controller.h +1 −1
  932. sound/pci/hda/hda_intel.c +14 −3
  933. sound/pci/hda/patch_hdmi.c +27 −16
  934. sound/pci/hda/patch_realtek.c +90 −5
  935. sound/soc/amd/raven/pci-acp3x.c +1 −3
  936. sound/soc/amd/renoir/Makefile +4 −3
  937. sound/soc/codecs/max98373.c +0 −8
  938. sound/soc/codecs/rt286.c +4 −4
  939. sound/soc/codecs/rt5670.c +58 −17
  940. sound/soc/codecs/rt5670.h +1 −1
  941. sound/soc/codecs/rt5682.c +37 −18
  942. sound/soc/codecs/wm8974.c +5 −1
  943. sound/soc/fsl/fsl_mqs.c +14 −9
  944. sound/soc/generic/audio-graph-card.c +2 −2
  945. sound/soc/generic/simple-card.c +2 −2
  946. sound/soc/intel/boards/bdw-rt5677.c +1 −0
  947. sound/soc/intel/boards/bytcht_es8316.c +3 −1
  948. sound/soc/intel/boards/cht_bsw_rt5672.c +11 −12
  949. sound/soc/qcom/Kconfig +1 −1
  950. sound/soc/rockchip/rk3399_gru_sound.c +13 −0
  951. sound/soc/soc-core.c +27 −0
  952. sound/soc/soc-dai.c +38 −0
  953. sound/soc/soc-devres.c +5 −3
  954. sound/soc/soc-generic-dmaengine-pcm.c +1 −1
  955. sound/soc/soc-topology.c +18 −6
  956. sound/soc/sof/core.c +5 −5
  957. sound/soc/sof/imx/imx8.c +8 −0
  958. sound/soc/sof/imx/imx8m.c +8 −0
  959. sound/usb/card.h +3 −3
  960. sound/usb/endpoint.c +9 −9
  961. sound/usb/line6/capture.c +2 −0
  962. sound/usb/line6/driver.c +1 −1
  963. sound/usb/line6/playback.c +2 −0
  964. sound/usb/midi.c +12 −5
  965. sound/usb/pcm.c +2 −0
  966. sound/usb/quirks-table.h +52 −0
  967. tools/arch/x86/include/uapi/asm/kvm.h +3 −2
  968. tools/include/linux/bits.h +1 −2
  969. tools/include/uapi/linux/bpf.h +21 −20
  970. tools/lib/bpf/bpf.h +2 −0
  971. tools/lib/bpf/hashmap.h +8 −4
  972. tools/lib/bpf/libbpf.c +8 −2
  973. tools/lib/subcmd/parse-options.c +3 −0
  974. tools/lib/traceevent/event-parse.c +1 −0
  975. tools/lib/traceevent/plugins/Makefile +1 −1
  976. tools/perf/pmu-events/arch/s390/cf_z15/extended.json +1 −1
  977. tools/perf/tests/shell/record+zstd_comp_decomp.sh +2 −1
  978. tools/perf/util/hashmap.h +8 −4
  979. tools/testing/selftests/bpf/prog_tests/btf_map_in_map.c +110 −14
  980. tools/testing/selftests/bpf/prog_tests/fentry_fexit.c +1 −1
  981. tools/testing/selftests/bpf/prog_tests/flow_dissector.c +2 −2
  982. tools/testing/selftests/bpf/prog_tests/flow_dissector_reattach.c +34 −10
  983. tools/testing/selftests/bpf/progs/bpf_iter_netlink.c +1 −1
  984. tools/testing/selftests/bpf/progs/fentry_test.c +22 −0
  985. tools/testing/selftests/bpf/progs/fexit_test.c +22 −0
  986. tools/testing/selftests/bpf/progs/test_sockmap_kern.h +7 −1
  987. tools/testing/selftests/bpf/progs/test_xdp_with_devmap_helpers.c +1 −1
  988. tools/testing/selftests/bpf/test_maps.c +6 −6
  989. tools/testing/selftests/bpf/test_offload.py +3 −0
  990. tools/testing/selftests/bpf/test_sockmap.c +18 −0
  991. tools/testing/selftests/bpf/verifier/event_output.c +1 −0
  992. tools/testing/selftests/kmod/kmod.sh +36 −0
  993. tools/testing/selftests/kselftest.h +1 −1
  994. tools/testing/selftests/kvm/x86_64/vmx_set_nested_state_test.c +33 −9
  995. tools/testing/selftests/net/fib_nexthop_multiprefix.sh +1 −1
  996. tools/testing/selftests/net/fib_nexthops.sh +13 −0
  997. tools/testing/selftests/net/forwarding/ethtool.sh +0 −2
  998. tools/testing/selftests/net/ip_defrag.sh +2 −0
  999. tools/testing/selftests/net/psock_fanout.c +2 −1
  1000. tools/testing/selftests/net/rxtimestamp.c +1 −2
  1001. tools/testing/selftests/net/so_txtime.c +1 −1
  1002. tools/testing/selftests/net/tcp_mmap.c +3 −3
  1003. tools/testing/selftests/net/txtimestamp.sh +1 −1
  1004. tools/testing/selftests/powerpc/nx-gzip/gunz_test.c +2 −2
  1005. tools/testing/selftests/powerpc/nx-gzip/gzfht_test.c +2 −2
  1006. tools/testing/selftests/tpm2/test_smoke.sh +2 −2
  1007. tools/testing/selftests/tpm2/test_space.sh +1 −1
  1008. tools/testing/selftests/tpm2/tpm2.py +29 −27
  1009. tools/testing/selftests/tpm2/tpm2_tests.py +20 −19
.mailmap+8−0
@@ -90,11 +90,16 @@ Frank Rowand <frowand.list@gmail.com> <frank.rowand@sonymobile.com> · 89 unmodified lines
9090 Frank Zago <fzago@systemfabricworks.com>
9191 Gao Xiang <xiang@kernel.org> <gaoxiang25@huawei.com>
9292 Gao Xiang <xiang@kernel.org> <hsiangkao@aol.com>
93+Gerald Schaefer <gerald.schaefer@linux.ibm.com> <gerald.schaefer@de.ibm.com>
94+Gerald Schaefer <gerald.schaefer@linux.ibm.com> <geraldsc@de.ibm.com>
95+Gerald Schaefer <gerald.schaefer@linux.ibm.com> <geraldsc@linux.vnet.ibm.com>
9396 Greg Kroah-Hartman <greg@echidna.(none)>
9497 Greg Kroah-Hartman <gregkh@suse.de>
9598 Greg Kroah-Hartman <greg@kroah.com>
9699 Gregory CLEMENT <gregory.clement@bootlin.com> <gregory.clement@free-electrons.com>
97100 Hanjun Guo <guohanjun@huawei.com> <hanjun.guo@linaro.org>
101+Heiko Carstens <hca@linux.ibm.com> <h.carstens@de.ibm.com>
102+Heiko Carstens <hca@linux.ibm.com> <heiko.carstens@de.ibm.com>
98103 Henk Vergonet <Henk.Vergonet@gmail.com>
99104 Henrik Kretzschmar <henne@nachtwindheim.de>
100105 Henrik Rydberg <rydberg@bitmath.org>
@@ -193,6 +198,9 @@ Maxime Ripard <mripard@kernel.org> <maxime.ripard@free-electrons.com> · 92 unmodified lines
193198 Mayuresh Janorkar <mayur@ti.com>
194199 Michael Buesch <m@bues.ch>
195200 Michel Dänzer <michel@tungstengraphics.com>
201+Mike Rapoport <rppt@kernel.org> <mike@compulab.co.il>
202+Mike Rapoport <rppt@kernel.org> <mike.rapoport@gmail.com>
203+Mike Rapoport <rppt@kernel.org> <rppt@linux.ibm.com>
196204 Miodrag Dinic <miodrag.dinic@mips.com> <miodrag.dinic@imgtec.com>
197205 Miquel Raynal <miquel.raynal@bootlin.com> <miquel.raynal@free-electrons.com>
198206 Mitesh shah <mshah@teja.com>
Documentation/ABI/testing/debugfs-driver-habanalabs+10−1
@@ -16,7 +16,16 @@ Description: Allow the root user to disable/enable in runtime the clock · 15 unmodified lines
1616 gating mechanism in Gaudi. Due to how Gaudi is built, the
1717 clock gating needs to be disabled in order to access the
1818 registers of the TPC and MME engines. This is sometimes needed
19− during debug by the user and hence the user needs this option
19+ during debug by the user and hence the user needs this option.
20+ The user can supply a bitmask value, each bit represents
21+ a different engine to disable/enable its clock gating feature.
22+ The bitmask is composed of 20 bits:
23+ 0 - 7 : DMA channels
24+ 8 - 11 : MME engines
25+ 12 - 19 : TPC engines
26+ The bit's location of a specific engine can be determined
27+ using (1 << GAUDI_ENGINE_ID_*). GAUDI_ENGINE_ID_* values
28+ are defined in uapi habanalabs.h file in enum gaudi_engine_id
2029
2130 What: /sys/kernel/debug/habanalabs/hl<n>/command_buffers
2231 Date: Jan 2019
Documentation/admin-guide/README.rst+1−1
@@ -258,7 +258,7 @@ Configuring the kernel · 257 unmodified lines
258258 Compiling the kernel
259259 --------------------
260260
261− - Make sure you have at least gcc 4.6 available.
261+ - Make sure you have at least gcc 4.9 available.
262262 For more information, refer to :ref:`Documentation/process/changes.rst <changes>`.
263263
264264 Please note that you can still run a.out user programs with this kernel.
Documentation/arm64/cpu-feature-registers.rst+2−0
@@ -171,6 +171,7 @@ infrastructure: · 170 unmodified lines
171171
172172
173173 3) ID_AA64PFR1_EL1 - Processor Feature Register 1
174+
174175 +------------------------------+---------+---------+
175176 | Name | bits | visible |
176177 +------------------------------+---------+---------+
@@ -181,6 +182,7 @@ infrastructure: · 4 unmodified lines
181182
182183
183184 4) MIDR_EL1 - Main ID Register
185+
184186 +------------------------------+---------+---------+
185187 | Name | bits | visible |
186188 +------------------------------+---------+---------+
Documentation/block/bfq-iosched.rst+1−8
@@ -492,13 +492,6 @@ set max_budget to higher values than those to which BFQ would have set · 491 unmodified lines
492492 it with auto-tuning. An alternative way to achieve this goal is to
493493 just increase the value of timeout_sync, leaving max_budget equal to 0.
494494
495−weights
496−-------
497−
498−Read-only parameter, used to show the weights of the currently active
499−BFQ queues.
500−
501−
502495 4. Group scheduling with BFQ
503496 ============================
504497
@@ -566,7 +559,7 @@ Parameters to set · 61 unmodified lines
566559 For each group, there is only the following parameter to set.
567560
568561 weight (namely blkio.bfq.weight or io.bfq-weight): the weight of the
569−group inside its parent. Available values: 1..10000 (default 100). The
562+group inside its parent. Available values: 1..1000 (default 100). The
570563 linear mapping between ioprio and weights, described at the beginning
571564 of the tunable section, is still valid, but all weights higher than
572565 IOPRIO_BE_NR*10 are mapped to ioprio 0.
Documentation/core-api/dma-api.rst+8−0
@@ -204,6 +204,14 @@ Returns the maximum size of a mapping for the device. The size parameter · 203 unmodified lines
204204 of the mapping functions like dma_map_single(), dma_map_page() and
205205 others should not be larger than the returned value.
206206
207+::
208+
209+ bool
210+ dma_need_sync(struct device *dev, dma_addr_t dma_addr);
211+
212+Returns %true if dma_sync_single_for_{device,cpu} calls are required to
213+transfer memory ownership. Returns %false if those calls can be skipped.
214+
207215 ::
208216
209217 unsigned long
Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml+3−0
@@ -47,6 +47,9 @@ properties: · 46 unmodified lines
4747 $ref: /schemas/types.yaml#/definitions/phandle-array
4848 description: Phandle to the device SRAM
4949
50+ iommus:
51+ maxItems: 1
52+
5053 memory-region:
5154 description:
5255 CMA pool to use for buffers allocation instead of the default
Documentation/devicetree/bindings/sound/simple-card.yaml+13−4
@@ -378,6 +378,8 @@ examples: · 377 unmodified lines
378378 - |
379379 sound {
380380 compatible = "simple-audio-card";
381+ #address-cells = <1>;
382+ #size-cells = <0>;
381383
382384 simple-audio-card,name = "rsnd-ak4643";
383385 simple-audio-card,format = "left_j";
@@ -391,10 +393,12 @@ examples: · 7 unmodified lines
391393 "ak4642 Playback", "DAI1 Playback";
392394
393395 dpcmcpu: simple-audio-card,cpu@0 {
396+ reg = <0>;
394397 sound-dai = <&rcar_sound 0>;
395398 };
396399
397400 simple-audio-card,cpu@1 {
401+ reg = <1>;
398402 sound-dai = <&rcar_sound 1>;
399403 };
400404
@@ -418,6 +422,8 @@ examples: · 17 unmodified lines
418422 - |
419423 sound {
420424 compatible = "simple-audio-card";
425+ #address-cells = <1>;
426+ #size-cells = <0>;
421427
422428 simple-audio-card,routing =
423429 "pcm3168a Playback", "DAI1 Playback",
@@ -426,6 +432,7 @@ examples: · 2 unmodified lines
426432 "pcm3168a Playback", "DAI4 Playback";
427433
428434 simple-audio-card,dai-link@0 {
435+ reg = <0>;
429436 format = "left_j";
430437 bitclock-master = <&sndcpu0>;
431438 frame-master = <&sndcpu0>;
@@ -439,22 +446,23 @@ examples: · 7 unmodified lines
439446 };
440447
441448 simple-audio-card,dai-link@1 {
449+ reg = <1>;
442450 format = "i2s";
443451 bitclock-master = <&sndcpu1>;
444452 frame-master = <&sndcpu1>;
445453
446454 convert-channels = <8>; /* TDM Split */
447455
448− sndcpu1: cpu@0 {
456+ sndcpu1: cpu0 {
449457 sound-dai = <&rcar_sound 1>;
450458 };
451− cpu@1 {
459+ cpu1 {
452460 sound-dai = <&rcar_sound 2>;
453461 };
454− cpu@2 {
462+ cpu2 {
455463 sound-dai = <&rcar_sound 3>;
456464 };
457− cpu@3 {
465+ cpu3 {
458466 sound-dai = <&rcar_sound 4>;
459467 };
460468 codec {
@@ -466,6 +474,7 @@ examples: · 5 unmodified lines
466474 };
467475
468476 simple-audio-card,dai-link@2 {
477+ reg = <2>;
469478 format = "i2s";
470479 bitclock-master = <&sndcpu2>;
471480 frame-master = <&sndcpu2>;
Documentation/driver-api/ptp.rst+12−0
@@ -23,6 +23,7 @@ PTP hardware clock infrastructure for Linux · 22 unmodified lines
2323 + Ancillary clock features
2424 - Time stamp external events
2525 - Period output signals configurable from user space
26+ - Low Pass Filter (LPF) access from user space
2627 - Synchronization of the Linux system time via the PPS subsystem
2728
2829 PTP hardware clock kernel API
@@ -94,3 +95,14 @@ Supported hardware · 65 unmodified lines
9495
9596 - Auxiliary Slave/Master Mode Snapshot (optional interrupt)
9697 - Target Time (optional interrupt)
98+
99+ * Renesas (IDT) ClockMatrix™
100+
101+ - Up to 4 independent PHC channels
102+ - Integrated low pass filter (LPF), access via .adjPhase (compliant to ITU-T G.8273.2)
103+ - Programmable output periodic signals
104+ - Programmable inputs can time stamp external triggers
105+ - Driver and/or hardware configuration through firmware (idtcm.bin)
106+ - LPF settings (bandwidth, phase limiting, automatic holdover, physical layer assist (per ITU-T G.8273.2))
107+ - Programmable output PTP clocks, any frequency up to 1GHz (to other PHY/MAC time stampers, refclk to ASSPs/SoCs/FPGAs)
108+ - Lock to GNSS input, automatic switching between GNSS and user-space PHC control (optional)
Documentation/filesystems/overlayfs.rst+2−2
@@ -560,8 +560,8 @@ When the NFS export feature is enabled, all directory index entries are · 559 unmodified lines
560560 verified on mount time to check that upper file handles are not stale.
561561 This verification may cause significant overhead in some cases.
562562
563−Note: the mount options index=off,nfs_export=on are conflicting and will
564−result in an error.
563+Note: the mount options index=off,nfs_export=on are conflicting for a
564+read-write mount and will result in an error.
565565
566566
567567 Testsuite
Documentation/networking/arcnet.rst+1−1
@@ -434,7 +434,7 @@ can set up your network then: · 433 unmodified lines
434434 ifconfig arc0 insight
435435 route add insight arc0
436436 route add freedom arc0 /* I would use the subnet here (like I said
437− to to in "single protocol" above),
437+ to in "single protocol" above),
438438 but the rest of the subnet
439439 unfortunately lies across the PPP
440440 link on freedom, which confuses
Documentation/networking/ax25.rst+1−1
@@ -6,7 +6,7 @@ AX.25 · 5 unmodified lines
66
77 To use the amateur radio protocols within Linux you will need to get a
88 suitable copy of the AX.25 Utilities. More detailed information about
9−AX.25, NET/ROM and ROSE, associated programs and and utilities can be
9+AX.25, NET/ROM and ROSE, associated programs and utilities can be
1010 found on http://www.linux-ax25.org.
1111
1212 There is an active mailing list for discussing Linux amateur radio matters
Documentation/networking/bareudp.rst+15−9
@@ -8,9 +8,8 @@ There are various L3 encapsulation standards using UDP being discussed to · 7 unmodified lines
88 leverage the UDP based load balancing capability of different networks.
99 MPLSoUDP (__ https://tools.ietf.org/html/rfc7510) is one among them.
1010
11−The Bareudp tunnel module provides a generic L3 encapsulation tunnelling
12−support for tunnelling different L3 protocols like MPLS, IP, NSH etc. inside
13−a UDP tunnel.
11+The Bareudp tunnel module provides a generic L3 encapsulation support for
12+tunnelling different L3 protocols like MPLS, IP, NSH etc. inside a UDP tunnel.
1413
1514 Special Handling
1615 ----------------
@@ -26,7 +25,7 @@ Usage · 9 unmodified lines
2625
2726 1) Device creation & deletion
2827
29− a) ip link add dev bareudp0 type bareudp dstport 6635 ethertype 0x8847.
28+ a) ip link add dev bareudp0 type bareudp dstport 6635 ethertype mpls_uc
3029
3130 This creates a bareudp tunnel device which tunnels L3 traffic with ethertype
3231 0x8847 (MPLS traffic). The destination port of the UDP header will be set to
@@ -34,14 +33,21 @@ Usage · 1 unmodified line
3433
3534 b) ip link delete bareudp0
3635
37−2) Device creation with multiple proto mode enabled
36+2) Device creation with multiproto mode enabled
3837
39−There are two ways to create a bareudp device for MPLS & IP with multiproto mode
40−enabled.
38+The multiproto mode allows bareudp tunnels to handle several protocols of the
39+same family. It is currently only available for IP and MPLS. This mode has to
40+be enabled explicitly with the "multiproto" flag.
4141
42− a) ip link add dev bareudp0 type bareudp dstport 6635 ethertype 0x8847 multiproto
42+ a) ip link add dev bareudp0 type bareudp dstport 6635 ethertype ipv4 multiproto
4343
44− b) ip link add dev bareudp0 type bareudp dstport 6635 ethertype mpls
44+ For an IPv4 tunnel the multiproto mode allows the tunnel to also handle
45+ IPv6.
46+
47+ b) ip link add dev bareudp0 type bareudp dstport 6635 ethertype mpls_uc multiproto
48+
49+ For MPLS, the multiproto mode allows the tunnel to handle both unicast
50+ and multicast MPLS packets.
4551
4652 3) Device Usage
4753
Documentation/networking/can_ucan_protocol.rst+2−2
@@ -144,7 +144,7 @@ UCAN_COMMAND_SET_BITTIMING · 143 unmodified lines
144144
145145 *Host2Dev; mandatory*
146146
147−Setup bittiming by sending the the structure
147+Setup bittiming by sending the structure
148148 ``ucan_ctl_payload_t.cmd_set_bittiming`` (see ``struct bittiming`` for
149149 details)
150150
@@ -232,7 +232,7 @@ UCAN_IN_TX_COMPLETE · 81 unmodified lines
232232 zero
233233
234234 The CAN device has sent a message to the CAN bus. It answers with a
235−list of of tuples <echo-ids, flags>.
235+list of tuples <echo-ids, flags>.
236236
237237 The echo-id identifies the frame from (echos the id from a previous
238238 UCAN_OUT_TX message). The flag indicates the result of the
Documentation/networking/devlink/devlink-trap.rst+4−0
@@ -486,6 +486,10 @@ narrow. The description of these groups must be added to the following table: · 485 unmodified lines
486486 - Contains packet traps for packets that should be locally delivered after
487487 routing, but do not match more specific packet traps (e.g.,
488488 ``ipv4_bgp``)
489+ * - ``external_delivery``
490+ - Contains packet traps for packets that should be routed through an
491+ external interface (e.g., management interface) that does not belong to
492+ the same device (e.g., switch ASIC) as the ingress interface
489493 * - ``ipv6``
490494 - Contains packet traps for various IPv6 control packets (e.g., Router
491495 Advertisements)
Documentation/networking/dsa/dsa.rst+1−1
@@ -95,7 +95,7 @@ Ethernet switch. · 94 unmodified lines
9595 Networking stack hooks
9696 ----------------------
9797
98−When a master netdev is used with DSA, a small hook is placed in in the
98+When a master netdev is used with DSA, a small hook is placed in the
9999 networking stack is in order to have the DSA subsystem process the Ethernet
100100 switch specific tagging protocol. DSA accomplishes this by registering a
101101 specific (and fake) Ethernet type (later becoming ``skb->protocol``) with the
Documentation/networking/ip-sysctl.rst+1−1
@@ -741,7 +741,7 @@ tcp_fastopen - INTEGER · 740 unmodified lines
741741
742742 Default: 0x1
743743
744− Note that that additional client or server features are only
744+ Note that additional client or server features are only
745745 effective if the basic support (0x1 and 0x2) are enabled respectively.
746746
747747 tcp_fastopen_blackhole_timeout_sec - INTEGER
Documentation/networking/ipvs-sysctl.rst+1−1
@@ -114,7 +114,7 @@ drop_entry - INTEGER · 113 unmodified lines
114114 modes (when there is no enough available memory, the strategy
115115 is enabled and the variable is automatically set to 2,
116116 otherwise the strategy is disabled and the variable is set to
117− 1), and 3 means that that the strategy is always enabled.
117+ 1), and 3 means that the strategy is always enabled.
118118
119119 drop_packet - INTEGER
120120 - 0 - disabled (default)
Documentation/networking/rxrpc.rst+1−1
@@ -186,7 +186,7 @@ About the AF_RXRPC driver: · 185 unmodified lines
186186 time [tunable] after the last connection using it discarded, in case a new
187187 connection is made that could use it.
188188
189− (#) A client-side connection is only shared between calls if they have have
189+ (#) A client-side connection is only shared between calls if they have
190190 the same key struct describing their security (and assuming the calls
191191 would otherwise share the connection). Non-secured calls would also be
192192 able to share connections with each other.
Documentation/powerpc/vas-api.rst+1−1
@@ -213,7 +213,7 @@ request buffers are not in memory. The operating system handles the fault by · 212 unmodified lines
213213 updating CSB with the following data:
214214
215215 csb.flags = CSB_V;
216− csb.cc = CSB_CC_TRANSLATION;
216+ csb.cc = CSB_CC_FAULT_ADDRESS;
217217 csb.ce = CSB_CE_TERMINATION;
218218 csb.address = fault_address;
219219
Documentation/process/changes.rst+1−1
@@ -29,7 +29,7 @@ you probably needn't concern yourself with pcmciautils. · 28 unmodified lines
2929 ====================== =============== ========================================
3030 Program Minimal version Command to check the version
3131 ====================== =============== ========================================
32−GNU C 4.8 gcc --version
32+GNU C 4.9 gcc --version
3333 GNU make 3.81 make --version
3434 binutils 2.23 ld -v
3535 flex 2.5.35 flex --version
Documentation/process/coding-style.rst+20−0
@@ -319,6 +319,26 @@ If you are afraid to mix up your local variable names, you have another · 318 unmodified lines
319319 problem, which is called the function-growth-hormone-imbalance syndrome.
320320 See chapter 6 (Functions).
321321
322+For symbol names and documentation, avoid introducing new usage of
323+'master / slave' (or 'slave' independent of 'master') and 'blacklist /
324+whitelist'.
325+
326+Recommended replacements for 'master / slave' are:
327+ '{primary,main} / {secondary,replica,subordinate}'
328+ '{initiator,requester} / {target,responder}'
329+ '{controller,host} / {device,worker,proxy}'
330+ 'leader / follower'
331+ 'director / performer'
332+
333+Recommended replacements for 'blacklist/whitelist' are:
334+ 'denylist / allowlist'
335+ 'blocklist / passlist'
336+
337+Exceptions for introducing new usage is to maintain a userspace ABI/API,
338+or when updating code for an existing (as of 2020) hardware or protocol
339+specification that mandates those terms. For new specifications
340+translate specification usage of the terminology to the kernel coding
341+standard where possible.
322342
323343 5) Typedefs
324344 -----------
Documentation/virt/kvm/api.rst+3−2
@@ -4339,14 +4339,15 @@ Errors: · 4338 unmodified lines
43394339 #define KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE 0x00000001
43404340
43414341 struct kvm_vmx_nested_state_hdr {
4342− __u32 flags;
43434342 __u64 vmxon_pa;
43444343 __u64 vmcs12_pa;
4345− __u64 preemption_timer_deadline;
43464344
43474345 struct {
43484346 __u16 flags;
43494347 } smm;
4348+
4349+ __u32 flags;
4350+ __u64 preemption_timer_deadline;
43504351 };
43514352
43524353 struct kvm_vmx_nested_state_data {
MAINTAINERS+29−15
@@ -782,7 +782,7 @@ F: include/dt-bindings/reset/altr,rst-mgr-a10sr.h · 781 unmodified lines
782782 F: include/linux/mfd/altera-a10sr.h
783783
784784 ALTERA TRIPLE SPEED ETHERNET DRIVER
785−M: Thor Thayer <thor.thayer@linux.intel.com>
785+M: Joyce Ooi <joyce.ooi@intel.com>
786786 L: netdev@vger.kernel.org
787787 S: Maintained
788788 F: drivers/net/ethernet/altera/
@@ -1425,7 +1425,7 @@ F: arch/arm*/include/asm/perf_event.h · 636 unmodified lines
14251425 F: arch/arm*/kernel/hw_breakpoint.c
14261426 F: arch/arm*/kernel/perf_*
14271427 F: arch/arm/oprofile/common.c
1428−F: drivers/perf/*
1428+F: drivers/perf/
14291429 F: include/linux/perf/arm_pmu.h
14301430
14311431 ARM PORT
@@ -2929,6 +2929,7 @@ F: include/uapi/linux/atm* · 1497 unmodified lines
29292929
29302930 ATMEL MACB ETHERNET DRIVER
29312931 M: Nicolas Ferre <nicolas.ferre@microchip.com>
2932+M: Claudiu Beznea <claudiu.beznea@microchip.com>
29322933 S: Supported
29332934 F: drivers/net/ethernet/cadence/
29342935
@@ -3306,7 +3307,7 @@ X: arch/riscv/net/bpf_jit_comp32.c · 371 unmodified lines
33063307
33073308 BPF JIT for S390
33083309 M: Ilya Leoshkevich <iii@linux.ibm.com>
3309−M: Heiko Carstens <heiko.carstens@de.ibm.com>
3310+M: Heiko Carstens <hca@linux.ibm.com>
33103311 M: Vasily Gorbik <gor@linux.ibm.com>
33113312 L: netdev@vger.kernel.org
33123313 L: bpf@vger.kernel.org
@@ -5021,7 +5022,6 @@ F: drivers/mfd/da91??-*.c · 1708 unmodified lines
50215022 F: drivers/pinctrl/pinctrl-da90??.c
50225023 F: drivers/power/supply/da9052-battery.c
50235024 F: drivers/power/supply/da91??-*.c
5024−F: drivers/regulator/da903x.c
50255025 F: drivers/regulator/da9???-regulator.[ch]
50265026 F: drivers/regulator/slg51000-regulator.[ch]
50275027 F: drivers/rtc/rtc-da90??.c
@@ -5111,7 +5111,7 @@ M: Vinod Koul <vkoul@kernel.org> · 83 unmodified lines
51115111 L: dmaengine@vger.kernel.org
51125112 S: Maintained
51135113 Q: https://patchwork.kernel.org/project/linux-dmaengine/list/
5114−T: git git://git.infradead.org/users/vkoul/slave-dma.git
5114+T: git git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git
51155115 F: Documentation/devicetree/bindings/dma/
51165116 F: Documentation/driver-api/dmaengine/
51175117 F: drivers/dma/
@@ -6956,6 +6956,7 @@ M: Timur Tabi <timur@kernel.org> · 1838 unmodified lines
69566956 M: Nicolin Chen <nicoleotsuka@gmail.com>
69576957 M: Xiubo Li <Xiubo.Lee@gmail.com>
69586958 R: Fabio Estevam <festevam@gmail.com>
6959+R: Shengjiu Wang <shengjiu.wang@gmail.com>
69596960 L: alsa-devel@alsa-project.org (moderated for non-subscribers)
69606961 L: linuxppc-dev@lists.ozlabs.org
69616962 S: Maintained
@@ -9305,6 +9306,17 @@ F: Documentation/kbuild/kconfig* · 2343 unmodified lines
93059306 F: scripts/Kconfig.include
93069307 F: scripts/kconfig/
93079308
9309+KCOV
9310+R: Dmitry Vyukov <dvyukov@google.com>
9311+R: Andrey Konovalov <andreyknvl@google.com>
9312+L: kasan-dev@googlegroups.com
9313+S: Maintained
9314+F: Documentation/dev-tools/kcov.rst
9315+F: include/linux/kcov.h
9316+F: include/uapi/linux/kcov.h
9317+F: kernel/kcov.c
9318+F: scripts/Makefile.kcov
9319+
93089320 KCSAN
93099321 M: Marco Elver <elver@google.com>
93109322 R: Dmitry Vyukov <dvyukov@google.com>
@@ -11240,7 +11252,7 @@ S: Maintained · 1929 unmodified lines
1124011252 F: drivers/crypto/atmel-ecc.*
1124111253
1124211254 MICROCHIP I2C DRIVER
11243−M: Ludovic Desroches <ludovic.desroches@microchip.com>
11255+M: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
1124411256 L: linux-i2c@vger.kernel.org
1124511257 S: Supported
1124611258 F: drivers/i2c/busses/i2c-at91-*.c
@@ -11333,17 +11345,17 @@ F: drivers/iio/adc/at91-sama5d2_adc.c · 86 unmodified lines
1133311345 F: include/dt-bindings/iio/adc/at91-sama5d2_adc.h
1133411346
1133511347 MICROCHIP SAMA5D2-COMPATIBLE SHUTDOWN CONTROLLER
11336−M: Nicolas Ferre <nicolas.ferre@microchip.com>
11348+M: Claudiu Beznea <claudiu.beznea@microchip.com>
1133711349 S: Supported
1133811350 F: drivers/power/reset/at91-sama5d2_shdwc.c
1133911351
1134011352 MICROCHIP SPI DRIVER
11341−M: Nicolas Ferre <nicolas.ferre@microchip.com>
11353+M: Tudor Ambarus <tudor.ambarus@microchip.com>
1134211354 S: Supported
1134311355 F: drivers/spi/spi-atmel.*
1134411356
1134511357 MICROCHIP SSC DRIVER
11346−M: Nicolas Ferre <nicolas.ferre@microchip.com>
11358+M: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
1134711359 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1134811360 S: Supported
1134911361 F: drivers/misc/atmel-ssc.c
@@ -14176,7 +14188,8 @@ F: Documentation/devicetree/bindings/net/qcom,ethqos.txt · 2826 unmodified lines
1417614188 F: drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
1417714189
1417814190 QUALCOMM GENERIC INTERFACE I2C DRIVER
14179−M: Alok Chauhan <alokc@codeaurora.org>
14191+M: Akash Asthana <akashast@codeaurora.org>
14192+M: Mukesh Savaliya <msavaliy@codeaurora.org>
1418014193 L: linux-i2c@vger.kernel.org
1418114194 L: linux-arm-msm@vger.kernel.org
1418214195 S: Supported
@@ -14831,7 +14844,7 @@ S: Maintained · 648 unmodified lines
1483114844 F: drivers/video/fbdev/savage/
1483214845
1483314846 S390
14834−M: Heiko Carstens <heiko.carstens@de.ibm.com>
14847+M: Heiko Carstens <hca@linux.ibm.com>
1483514848 M: Vasily Gorbik <gor@linux.ibm.com>
1483614849 M: Christian Borntraeger <borntraeger@de.ibm.com>
1483714850 L: linux-s390@vger.kernel.org
@@ -14862,7 +14875,8 @@ F: drivers/s390/block/dasd* · 24 unmodified lines
1486214875 F: include/linux/dasd_mod.h
1486314876
1486414877 S390 IOMMU (PCI)
14865−M: Gerald Schaefer <gerald.schaefer@de.ibm.com>
14878+M: Matthew Rosato <mjrosato@linux.ibm.com>
14879+M: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
1486614880 L: linux-s390@vger.kernel.org
1486714881 S: Supported
1486814882 W: http://www.ibm.com/developerworks/linux/linux390/
@@ -14890,7 +14904,7 @@ F: drivers/s390/net/ · 21 unmodified lines
1489014904
1489114905 S390 PCI SUBSYSTEM
1489214906 M: Niklas Schnelle <schnelle@linux.ibm.com>
14893−M: Gerald Schaefer <gerald.schaefer@de.ibm.com>
14907+M: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
1489414908 L: linux-s390@vger.kernel.org
1489514909 S: Supported
1489614910 W: http://www.ibm.com/developerworks/linux/linux390/
@@ -17513,7 +17527,7 @@ F: Documentation/admin-guide/ufs.rst · 2616 unmodified lines
1751317527 F: fs/ufs/
1751417528
1751517529 UHID USERSPACE HID IO DRIVER
17516−M: David Herrmann <dh.herrmann@googlemail.com>
17530+M: David Rheinsberg <david.rheinsberg@gmail.com>
1751717531 L: linux-input@vger.kernel.org
1751817532 S: Maintained
1751917533 F: drivers/hid/uhid.c
@@ -18472,7 +18486,7 @@ S: Maintained · 952 unmodified lines
1847218486 F: drivers/rtc/rtc-sd3078.c
1847318487
1847418488 WIIMOTE HID DRIVER
18475−M: David Herrmann <dh.herrmann@googlemail.com>
18489+M: David Rheinsberg <david.rheinsberg@gmail.com>
1847618490 L: linux-input@vger.kernel.org
1847718491 S: Maintained
1847818492 F: drivers/hid/hid-wiimote*
Makefile+3−3
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 5
33 PATCHLEVEL = 8
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc4
5+EXTRAVERSION =
66 NAME = Kleptomaniac Octopus
77
88 # *DOCUMENTATION*
@@ -567,7 +567,7 @@ ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),) · 558 unmodified lines
567567 ifneq ($(CROSS_COMPILE),)
568568 CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
569569 GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
570−CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)
570+CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
571571 GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..)
572572 endif
573573 ifneq ($(GCC_TOOLCHAIN),)
@@ -1754,7 +1754,7 @@ PHONY += descend $(build-dirs) · 1180 unmodified lines
17541754 descend: $(build-dirs)
17551755 $(build-dirs): prepare
17561756 $(Q)$(MAKE) $(build)=$@ \
1757− single-build=$(if $(filter-out $@/, $(filter $@/%, $(single-no-ko))),1) \
1757+ single-build=$(if $(filter-out $@/, $(filter $@/%, $(KBUILD_SINGLE_TARGETS))),1) \
17581758 need-builtin=1 need-modorder=1
17591759
17601760 clean-dirs := $(addprefix _clean_, $(clean-dirs))
arch/arm/boot/dts/am437x-l4.dtsi+10−4
@@ -1540,8 +1540,9 @@ · 1539 unmodified lines
15401540 reg = <0xcc020 0x4>;
15411541 reg-names = "rev";
15421542 /* Domains (P, C): per_pwrdm, l4ls_clkdm */
1543− clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN0_CLKCTRL 0>;
1544− clock-names = "fck";
1543+ clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN0_CLKCTRL 0>,
1544+ <&dcan0_fck>;
1545+ clock-names = "fck", "osc";
15451546 #address-cells = <1>;
15461547 #size-cells = <1>;
15471548 ranges = <0x0 0xcc000 0x2000>;
@@ -1549,6 +1550,8 @@ · 1 unmodified line
15491550 dcan0: can@0 {
15501551 compatible = "ti,am4372-d_can", "ti,am3352-d_can";
15511552 reg = <0x0 0x2000>;
1553+ clocks = <&dcan0_fck>;
1554+ clock-names = "fck";
15521555 syscon-raminit = <&scm_conf 0x644 0>;
15531556 interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
15541557 status = "disabled";
@@ -1560,8 +1563,9 @@ · 5 unmodified lines
15601563 reg = <0xd0020 0x4>;
15611564 reg-names = "rev";
15621565 /* Domains (P, C): per_pwrdm, l4ls_clkdm */
1563− clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN1_CLKCTRL 0>;
1564− clock-names = "fck";
1566+ clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN1_CLKCTRL 0>,
1567+ <&dcan1_fck>;
1568+ clock-names = "fck", "osc";
15651569 #address-cells = <1>;
15661570 #size-cells = <1>;
15671571 ranges = <0x0 0xd0000 0x2000>;
@@ -1569,6 +1573,8 @@ · 1 unmodified line
15691573 dcan1: can@0 {
15701574 compatible = "ti,am4372-d_can", "ti,am3352-d_can";
15711575 reg = <0x0 0x2000>;
1576+ clocks = <&dcan1_fck>;
1577+ clock-name = "fck";
15721578 syscon-raminit = <&scm_conf 0x644 1>;
15731579 interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
15741580 status = "disabled";
arch/arm/boot/dts/armada-38x.dtsi+2−1
@@ -342,7 +342,8 @@ · 341 unmodified lines
342342
343343 comphy: phy@18300 {
344344 compatible = "marvell,armada-380-comphy";
345− reg = <0x18300 0x100>;
345+ reg-names = "comphy", "conf";
346+ reg = <0x18300 0x100>, <0x18460 4>;
346347 #address-cells = <1>;
347348 #size-cells = <0>;
348349
arch/arm/boot/dts/imx6qdl-gw551x.dtsi+1−1
@@ -110,7 +110,7 @@ · 109 unmodified lines
110110 simple-audio-card,frame-master = <&sound_codec>;
111111
112112 sound_cpu: simple-audio-card,cpu {
113− sound-dai = <&ssi2>;
113+ sound-dai = <&ssi1>;
114114 };
115115
116116 sound_codec: simple-audio-card,codec {
arch/arm/boot/dts/imx6qdl-icore.dtsi+2−1
@@ -397,7 +397,7 @@ · 396 unmodified lines
397397
398398 pinctrl_usbotg: usbotggrp {
399399 fsl,pins = <
400− MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
400+ MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID 0x17059
401401 >;
402402 };
403403
@@ -409,6 +409,7 @@ · 5 unmodified lines
409409 MX6QDL_PAD_SD1_DAT1__SD1_DATA1 0x17070
410410 MX6QDL_PAD_SD1_DAT2__SD1_DATA2 0x17070
411411 MX6QDL_PAD_SD1_DAT3__SD1_DATA3 0x17070
412+ MX6QDL_PAD_GPIO_1__GPIO1_IO01 0x1b0b0
412413 >;
413414 };
414415
arch/arm/boot/dts/imx6sx-sabreauto.dts+1−1
@@ -99,7 +99,7 @@ · 98 unmodified lines
9999 &fec2 {
100100 pinctrl-names = "default";
101101 pinctrl-0 = <&pinctrl_enet2>;
102− phy-mode = "rgmii";
102+ phy-mode = "rgmii-id";
103103 phy-handle = <&ethphy0>;
104104 fsl,magic-packet;
105105 status = "okay";
arch/arm/boot/dts/imx6sx-sdb.dtsi+1−1
@@ -213,7 +213,7 @@ · 212 unmodified lines
213213 &fec2 {
214214 pinctrl-names = "default";
215215 pinctrl-0 = <&pinctrl_enet2>;
216− phy-mode = "rgmii";
216+ phy-mode = "rgmii-id";
217217 phy-handle = <&ethphy2>;
218218 status = "okay";
219219 };
arch/arm/boot/dts/keystone-k2g-evm.dts+1−1
@@ -402,7 +402,7 @@ · 401 unmodified lines
402402
403403 &gbe0 {
404404 phy-handle = <&ethphy0>;
405− phy-mode = "rgmii-id";
405+ phy-mode = "rgmii-rxid";
406406 status = "okay";
407407 };
408408
arch/arm/boot/dts/meson.dtsi+1−1
@@ -11,7 +11,7 @@ · 10 unmodified lines
1111 #size-cells = <1>;
1212 interrupt-parent = <&gic>;
1313
14− L2: l2-cache-controller@c4200000 {
14+ L2: cache-controller@c4200000 {
1515 compatible = "arm,pl310-cache";
1616 reg = <0xc4200000 0x1000>;
1717 cache-unified;
arch/arm/boot/dts/omap3-n900.dts+8−4
@@ -105,6 +105,14 @@ · 104 unmodified lines
105105 linux,code = <SW_FRONT_PROXIMITY>;
106106 linux,can-disable;
107107 };
108+
109+ machine_cover {
110+ label = "Machine Cover";
111+ gpios = <&gpio6 0 GPIO_ACTIVE_LOW>; /* 160 */
112+ linux,input-type = <EV_SW>;
113+ linux,code = <SW_MACHINE_COVER>;
114+ linux,can-disable;
115+ };
108116 };
109117
110118 isp1707: isp1707 {
@@ -819,10 +827,6 @@ · 708 unmodified lines
819827 pinctrl-0 = <&mmc1_pins>;
820828 vmmc-supply = <&vmmc1>;
821829 bus-width = <4>;
822− /* For debugging, it is often good idea to remove this GPIO.
823− It means you can remove back cover (to reboot by removing
824− battery) and still use the MMC card. */
825− cd-gpios = <&gpio6 0 GPIO_ACTIVE_LOW>; /* 160 */
826830 };
827831
828832 /* most boards use vaux3, only some old versions use vmmc2 instead */
arch/arm/boot/dts/socfpga.dtsi+1−1
@@ -726,7 +726,7 @@ · 725 unmodified lines
726726 };
727727 };
728728
729− L2: l2-cache@fffef000 {
729+ L2: cache-controller@fffef000 {
730730 compatible = "arm,pl310-cache";
731731 reg = <0xfffef000 0x1000>;
732732 interrupts = <0 38 0x04>;
arch/arm/boot/dts/socfpga_arria10.dtsi+1−1
@@ -636,7 +636,7 @@ · 635 unmodified lines
636636 reg = <0xffcfb100 0x80>;
637637 };
638638
639− L2: l2-cache@fffff000 {
639+ L2: cache-controller@fffff000 {
640640 compatible = "arm,pl310-cache";
641641 reg = <0xfffff000 0x1000>;
642642 interrupts = <0 18 IRQ_TYPE_LEVEL_HIGH>;
arch/arm/boot/dts/sun4i-a10.dtsi+1−1
@@ -198,7 +198,7 @@ · 197 unmodified lines
198198 default-pool {
199199 compatible = "shared-dma-pool";
200200 size = <0x6000000>;
201− alloc-ranges = <0x4a000000 0x6000000>;
201+ alloc-ranges = <0x40000000 0x10000000>;
202202 reusable;
203203 linux,cma-default;
204204 };
arch/arm/boot/dts/sun5i.dtsi+1−1
@@ -117,7 +117,7 @@ · 116 unmodified lines
117117 default-pool {
118118 compatible = "shared-dma-pool";
119119 size = <0x6000000>;
120− alloc-ranges = <0x4a000000 0x6000000>;
120+ alloc-ranges = <0x40000000 0x10000000>;
121121 reusable;
122122 linux,cma-default;
123123 };
arch/arm/boot/dts/sun7i-a20.dtsi+1−1
@@ -181,7 +181,7 @@ · 180 unmodified lines
181181 default-pool {
182182 compatible = "shared-dma-pool";
183183 size = <0x6000000>;
184− alloc-ranges = <0x4a000000 0x6000000>;
184+ alloc-ranges = <0x40000000 0x10000000>;
185185 reusable;
186186 linux,cma-default;
187187 };
arch/arm/include/asm/percpu.h+2−0
@@ -5,6 +5,8 @@ · 4 unmodified lines
55 #ifndef _ASM_ARM_PERCPU_H_
66 #define _ASM_ARM_PERCPU_H_
77
8+#include <asm/thread_info.h>
9+
810 /*
911 * Same as asm-generic/percpu.h, except that we store the per cpu offset
1012 * in the TPIDRPRW. TPIDRPRW only exists on V6K and V7
arch/arm/kernel/asm-offsets.c+0−9
@@ -31,15 +31,6 @@ · 30 unmodified lines
3131 #if defined(__APCS_26__)
3232 #error Sorry, your compiler targets APCS-26 but this kernel requires APCS-32
3333 #endif
34−/*
35− * GCC 4.8.0-4.8.2: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58854
36− * miscompiles find_get_entry(), and can result in EXT3 and EXT4
37− * filesystem corruption (possibly other FS too).
38− */
39−#if defined(GCC_VERSION) && GCC_VERSION >= 40800 && GCC_VERSION < 40803
40−#error Your compiler is too buggy; it is known to miscompile kernels
41−#error and result in filesystem corruption and oopses.
42−#endif
4334
4435 int main(void)
4536 {
arch/arm/kernel/hw_breakpoint.c+22−5
@@ -683,6 +683,12 @@ static void disable_single_step(struct perf_event *bp) · 682 unmodified lines
683683 arch_install_hw_breakpoint(bp);
684684 }
685685
686+static int watchpoint_fault_on_uaccess(struct pt_regs *regs,
687+ struct arch_hw_breakpoint *info)
688+{
689+ return !user_mode(regs) && info->ctrl.privilege == ARM_BREAKPOINT_USER;
690+}
691+
686692 static void watchpoint_handler(unsigned long addr, unsigned int fsr,
687693 struct pt_regs *regs)
688694 {
@@ -742,16 +748,27 @@ static void watchpoint_handler(unsigned long addr, unsigned int fsr, · 53 unmodified lines
742748 }
743749
744750 pr_debug("watchpoint fired: address = 0x%x\n", info->trigger);
751+
752+ /*
753+ * If we triggered a user watchpoint from a uaccess routine,
754+ * then handle the stepping ourselves since userspace really
755+ * can't help us with this.
756+ */
757+ if (watchpoint_fault_on_uaccess(regs, info))
758+ goto step;
759+
745760 perf_bp_event(wp, regs);
746761
747762 /*
748− * If no overflow handler is present, insert a temporary
749− * mismatch breakpoint so we can single-step over the
750− * watchpoint trigger.
763+ * Defer stepping to the overflow handler if one is installed.
764+ * Otherwise, insert a temporary mismatch breakpoint so that
765+ * we can single-step over the watchpoint trigger.
751766 */
752− if (is_default_overflow_handler(wp))
753− enable_single_step(wp, instruction_pointer(regs));
767+ if (!is_default_overflow_handler(wp))
768+ goto unlock;
754769
770+step:
771+ enable_single_step(wp, instruction_pointer(regs));
755772 unlock:
756773 rcu_read_unlock();
757774 }
arch/arm/kernel/vdso.c+1−0
@@ -184,6 +184,7 @@ static void __init patch_vdso(void *ehdr) · 183 unmodified lines
184184 if (!cntvct_ok) {
185185 vdso_nullpatch_one(&einfo, "__vdso_gettimeofday");
186186 vdso_nullpatch_one(&einfo, "__vdso_clock_gettime");
187+ vdso_nullpatch_one(&einfo, "__vdso_clock_gettime64");
187188 }
188189 }
189190
arch/arm/mach-imx/devices/devices-common.h+1−1
@@ -289,6 +289,6 @@ struct platform_device *__init imx_add_spi_imx( · 288 unmodified lines
289289 const struct spi_imx_master *pdata);
290290
291291 struct platform_device *imx_add_imx_dma(char *name, resource_size_t iobase,
292− int irq, int irq_err);
292+ int irq);
293293 struct platform_device *imx_add_imx_sdma(char *name,
294294 resource_size_t iobase, int irq, struct sdma_platform_data *pdata);
arch/arm/mach-imx/devices/platform-gpio-mxc.c+3−2
@@ -24,7 +24,8 @@ struct platform_device *__init mxc_register_gpio(char *name, int id, · 23 unmodified lines
2424 .flags = IORESOURCE_IRQ,
2525 },
2626 };
27+ unsigned int nres;
2728
28− return platform_device_register_resndata(&mxc_aips_bus,
29− name, id, res, ARRAY_SIZE(res), NULL, 0);
29+ nres = irq_high ? ARRAY_SIZE(res) : ARRAY_SIZE(res) - 1;
30+ return platform_device_register_resndata(&mxc_aips_bus, name, id, res, nres, NULL, 0);
3031 }
arch/arm/mach-imx/devices/platform-imx-dma.c+1−5
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 #include "devices-common.h"
77
88 struct platform_device __init __maybe_unused *imx_add_imx_dma(char *name,
9− resource_size_t iobase, int irq, int irq_err)
9+ resource_size_t iobase, int irq)
1010 {
1111 struct resource res[] = {
1212 {
@@ -17,10 +17,6 @@ struct platform_device __init __maybe_unused *imx_add_imx_dma(char *name, · 4 unmodified lines
1717 .start = irq,
1818 .end = irq,
1919 .flags = IORESOURCE_IRQ,
20− }, {
21− .start = irq_err,
22− .end = irq_err,
23− .flags = IORESOURCE_IRQ,
2420 },
2521 };
2622
arch/arm/mach-imx/mm-imx21.c+1−2
@@ -78,8 +78,7 @@ void __init imx21_soc_init(void) · 77 unmodified lines
7878 mxc_register_gpio("imx21-gpio", 5, MX21_GPIO6_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
7979
8080 pinctrl_provide_dummies();
81− imx_add_imx_dma("imx21-dma", MX21_DMA_BASE_ADDR,
82− MX21_INT_DMACH0, 0); /* No ERR irq */
81+ imx_add_imx_dma("imx21-dma", MX21_DMA_BASE_ADDR, MX21_INT_DMACH0);
8382 platform_device_register_simple("imx21-audmux", 0, imx21_audmux_res,
8483 ARRAY_SIZE(imx21_audmux_res));
8584 }
arch/arm/mach-imx/mm-imx27.c+1−2
@@ -79,8 +79,7 @@ void __init imx27_soc_init(void) · 78 unmodified lines
7979 mxc_register_gpio("imx21-gpio", 5, MX27_GPIO6_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0);
8080
8181 pinctrl_provide_dummies();
82− imx_add_imx_dma("imx27-dma", MX27_DMA_BASE_ADDR,
83− MX27_INT_DMACH0, 0); /* No ERR irq */
82+ imx_add_imx_dma("imx27-dma", MX27_DMA_BASE_ADDR, MX27_INT_DMACH0);
8483 /* imx27 has the imx21 type audmux */
8584 platform_device_register_simple("imx21-audmux", 0, imx27_audmux_res,
8685 ARRAY_SIZE(imx27_audmux_res));
arch/arm/mach-omap2/omap_hwmod.c+11−3
@@ -3435,7 +3435,7 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, · 3434 unmodified lines
34353435 regs = ioremap(data->module_pa,
34363436 data->module_size);
34373437 if (!regs)
3438− return -ENOMEM;
3438+ goto out_free_sysc;
34393439 }
34403440
34413441 /*
@@ -3445,13 +3445,13 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, · 3 unmodified lines
34453445 if (oh->class->name && strcmp(oh->class->name, data->name)) {
34463446 class = kmemdup(oh->class, sizeof(*oh->class), GFP_KERNEL);
34473447 if (!class)
3448− return -ENOMEM;
3448+ goto out_unmap;
34493449 }
34503450
34513451 if (list_empty(&oh->slave_ports)) {
34523452 oi = kcalloc(1, sizeof(*oi), GFP_KERNEL);
34533453 if (!oi)
3454− return -ENOMEM;
3454+ goto out_free_class;
34553455
34563456 /*
34573457 * Note that we assume interconnect interface clocks will be
@@ -3478,6 +3478,14 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, · 20 unmodified lines
34783478 spin_unlock_irqrestore(&oh->_lock, flags);
34793479
34803480 return 0;
3481+
3482+out_free_class:
3483+ kfree(class);
3484+out_unmap:
3485+ iounmap(regs);
3486+out_free_sysc:
3487+ kfree(sysc);
3488+ return -ENOMEM;
34813489 }
34823490
34833491 static const struct omap_hwmod_reset omap24xx_reset_quirks[] = {
arch/arm/mm/mmu.c+1−1
@@ -966,7 +966,7 @@ void __init create_mapping_late(struct mm_struct *mm, struct map_desc *md, · 965 unmodified lines
966966 pud_t *pud;
967967
968968 p4d = p4d_alloc(mm, pgd_offset(mm, md->virtual), md->virtual);
969− if (!WARN_ON(!p4d))
969+ if (WARN_ON(!p4d))
970970 return;
971971 pud = pud_alloc(mm, p4d, md->virtual);
972972 if (WARN_ON(!pud))
arch/arm64/Makefile+1−1
@@ -137,7 +137,7 @@ export TEXT_OFFSET · 136 unmodified lines
137137
138138 core-y += arch/arm64/
139139 libs-y := arch/arm64/lib/ $(libs-y)
140−core-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
140+libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
141141
142142 # Default target when executing plain make
143143 boot := arch/arm64/boot
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi+1−0
@@ -161,6 +161,7 @@ · 160 unmodified lines
161161 resets = <&ccu RST_BUS_VE>;
162162 interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
163163 allwinner,sram = <&ve_sram 1>;
164+ iommus = <&iommu 3>;
164165 };
165166
166167 gpu: gpu@1800000 {
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi+4−4
@@ -77,7 +77,7 @@ · 76 unmodified lines
7777 method = "smc";
7878 };
7979
80− intc: intc@fffc1000 {
80+ intc: interrupt-controller@fffc1000 {
8181 compatible = "arm,gic-400", "arm,cortex-a15-gic";
8282 #interrupt-cells = <3>;
8383 interrupt-controller;
@@ -302,7 +302,7 @@ · 218 unmodified lines
302302 status = "disabled";
303303 };
304304
305− nand: nand@ffb90000 {
305+ nand: nand-controller@ffb90000 {
306306 #address-cells = <1>;
307307 #size-cells = <0>;
308308 compatible = "altr,socfpga-denali-nand";
@@ -445,7 +445,7 @@ · 136 unmodified lines
445445 clock-names = "timer";
446446 };
447447
448− uart0: serial0@ffc02000 {
448+ uart0: serial@ffc02000 {
449449 compatible = "snps,dw-apb-uart";
450450 reg = <0xffc02000 0x100>;
451451 interrupts = <0 108 4>;
@@ -456,7 +456,7 @@ · 4 unmodified lines
456456 status = "disabled";
457457 };
458458
459− uart1: serial1@ffc02100 {
459+ uart1: serial@ffc02100 {
460460 compatible = "snps,dw-apb-uart";
461461 reg = <0xffc02100 0x100>;
462462 interrupts = <0 109 4>;
arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts+1−0
@@ -155,6 +155,7 @@ · 154 unmodified lines
155155 };
156156
157157 &qspi {
158+ status = "okay";
158159 flash@0 {
159160 #address-cells = <1>;
160161 #size-cells = <1>;
arch/arm64/boot/dts/altera/socfpga_stratix10_socdk_nand.dts+4−3
@@ -188,6 +188,7 @@ · 187 unmodified lines
188188 };
189189
190190 &qspi {
191+ status = "okay";
191192 flash@0 {
192193 #address-cells = <1>;
193194 #size-cells = <1>;
@@ -211,12 +212,12 @@ · 17 unmodified lines
211212
212213 qspi_boot: partition@0 {
213214 label = "Boot and fpga data";
214− reg = <0x0 0x034B0000>;
215+ reg = <0x0 0x03FE0000>;
215216 };
216217
217− qspi_rootfs: partition@4000000 {
218+ qspi_rootfs: partition@3FE0000 {
218219 label = "Root Filesystem - JFFS2";
219− reg = <0x034B0000 0x0EB50000>;
220+ reg = <0x03FE0000 0x0C020000>;
220221 };
221222 };
222223 };
arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts+1−1
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 #include <dt-bindings/input/input.h>
1111 #include <dt-bindings/sound/meson-aiu.h>
1212
13−#include "meson-gxl-s905x.dtsi"
13+#include "meson-gxl-s805x.dtsi"
1414
1515 / {
1616 compatible = "libretech,aml-s805x-ac", "amlogic,s805x",
arch/arm64/boot/dts/amlogic/meson-gxl-s805x-p241.dts+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
99
1010 #include <dt-bindings/input/input.h>
1111
12−#include "meson-gxl-s905x.dtsi"
12+#include "meson-gxl-s805x.dtsi"
1313
1414 / {
1515 compatible = "amlogic,p241", "amlogic,s805x", "amlogic,meson-gxl";
arch/arm64/boot/dts/amlogic/meson-gxl-s805x.dtsi+24−0
@@ -0,0 +1,24 @@
1+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+/*
3+ * Copyright (c) 2020 BayLibre SAS
4+ * Author: Neil Armstrong <narmstrong@baylibre.com>
5+ */
6+
7+#include "meson-gxl-s905x.dtsi"
8+
9+/ {
10+ compatible = "amlogic,s805x", "amlogic,meson-gxl";
11+};
12+
13+/* The S805X Package doesn't seem to handle the 744MHz OPP correctly */
14+&mali {
15+ assigned-clocks = <&clkc CLKID_MALI_0_SEL>,
16+ <&clkc CLKID_MALI_0>,
17+ <&clkc CLKID_MALI>; /* Glitch free mux */
18+ assigned-clock-parents = <&clkc CLKID_FCLK_DIV3>,
19+ <0>, /* Do Nothing */
20+ <&clkc CLKID_MALI_0>;
21+ assigned-clock-rates = <0>, /* Do Nothing */
22+ <666666666>,
23+ <0>; /* Do Nothing */
24+};
arch/arm64/boot/dts/amlogic/meson-gxl.dtsi+5−0
@@ -337,6 +337,11 @@ · 336 unmodified lines
337337 };
338338 };
339339
340+&hwrng {
341+ clocks = <&clkc CLKID_RNG0>;
342+ clock-names = "core";
343+};
344+
340345 &i2c_A {
341346 clocks = <&clkc CLKID_I2C>;
342347 };
arch/arm64/boot/dts/intel/socfpga_agilex_socdk.dts+1−0
@@ -98,6 +98,7 @@ · 97 unmodified lines
9898 };
9999
100100 &qspi {
101+ status = "okay";
101102 flash@0 {
102103 #address-cells = <1>;
103104 #size-cells = <1>;
arch/arm64/boot/dts/marvell/armada-8040-clearfog-gt-8k.dts+1−4
@@ -454,10 +454,7 @@ · 453 unmodified lines
454454 status = "okay";
455455 phy-mode = "2500base-x";
456456 phys = <&cp1_comphy5 2>;
457− fixed-link {
458− speed = <2500>;
459− full-duplex;
460− };
457+ managed = "in-band-status";
461458 };
462459
463460 &cp1_spi1 {
arch/arm64/configs/defconfig+1−1
@@ -194,7 +194,7 @@ CONFIG_HOTPLUG_PCI=y · 193 unmodified lines
194194 CONFIG_HOTPLUG_PCI_ACPI=y
195195 CONFIG_PCI_AARDVARK=y
196196 CONFIG_PCI_TEGRA=y
197−CONFIG_PCIE_RCAR=y
197+CONFIG_PCIE_RCAR_HOST=y
198198 CONFIG_PCI_HOST_GENERIC=y
199199 CONFIG_PCI_XGENE=y
200200 CONFIG_PCIE_ALTERA=y
arch/arm64/include/asm/alternative.h+2−2
@@ -77,9 +77,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { } · 76 unmodified lines
7777 "663:\n\t" \
7878 newinstr "\n" \
7979 "664:\n\t" \
80− ".previous\n\t" \
8180 ".org . - (664b-663b) + (662b-661b)\n\t" \
82− ".org . - (662b-661b) + (664b-663b)\n" \
81+ ".org . - (662b-661b) + (664b-663b)\n\t" \
82+ ".previous\n" \
8383 ".endif\n"
8484
8585 #define __ALTERNATIVE_CFG_CB(oldinstr, feature, cfg_enabled, cb) \
arch/arm64/include/asm/arch_timer.h+1−0
@@ -58,6 +58,7 @@ struct arch_timer_erratum_workaround { · 57 unmodified lines
5858 u64 (*read_cntvct_el0)(void);
5959 int (*set_next_event_phys)(unsigned long, struct clock_event_device *);
6060 int (*set_next_event_virt)(unsigned long, struct clock_event_device *);
61+ bool disable_compat_vdso;
6162 };
6263
6364 DECLARE_PER_CPU(const struct arch_timer_erratum_workaround *,
arch/arm64/include/asm/checksum.h+3−2
@@ -24,16 +24,17 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) · 23 unmodified lines
2424 {
2525 __uint128_t tmp;
2626 u64 sum;
27+ int n = ihl; /* we want it signed */
2728
2829 tmp = *(const __uint128_t *)iph;
2930 iph += 16;
30− ihl -= 4;
31+ n -= 4;
3132 tmp += ((tmp >> 64) | (tmp << 64));
3233 sum = tmp >> 64;
3334 do {
3435 sum += *(const u32 *)iph;
3536 iph += 4;
36− } while (--ihl);
37+ } while (--n > 0);
3738
3839 sum += ((sum >> 32) | (sum << 32));
3940 return csum_fold((__force u32)(sum >> 32));
arch/arm64/include/asm/debug-monitors.h+2−0
@@ -109,6 +109,8 @@ void disable_debug_monitors(enum dbg_active_el el); · 108 unmodified lines
109109
110110 void user_rewind_single_step(struct task_struct *task);
111111 void user_fastforward_single_step(struct task_struct *task);
112+void user_regs_reset_single_step(struct user_pt_regs *regs,
113+ struct task_struct *task);
112114
113115 void kernel_enable_single_step(struct pt_regs *regs);
114116 void kernel_disable_single_step(void);
arch/arm64/include/asm/kvm_host.h+8−3
@@ -380,9 +380,14 @@ struct kvm_vcpu_arch { · 379 unmodified lines
380380 #define vcpu_has_sve(vcpu) (system_supports_sve() && \
381381 ((vcpu)->arch.flags & KVM_ARM64_GUEST_HAS_SVE))
382382
383−#define vcpu_has_ptrauth(vcpu) ((system_supports_address_auth() || \
384− system_supports_generic_auth()) && \
385− ((vcpu)->arch.flags & KVM_ARM64_GUEST_HAS_PTRAUTH))
383+#ifdef CONFIG_ARM64_PTR_AUTH
384+#define vcpu_has_ptrauth(vcpu) \
385+ ((cpus_have_final_cap(ARM64_HAS_ADDRESS_AUTH) || \
386+ cpus_have_final_cap(ARM64_HAS_GENERIC_AUTH)) && \
387+ (vcpu)->arch.flags & KVM_ARM64_GUEST_HAS_PTRAUTH)
388+#else
389+#define vcpu_has_ptrauth(vcpu) false
390+#endif
386391
387392 #define vcpu_gp_regs(v) (&(v)->arch.ctxt.gp_regs)
388393
arch/arm64/include/asm/pgtable-prot.h+1−1
@@ -67,7 +67,7 @@ extern bool arm64_use_ng_mappings; · 66 unmodified lines
6767 #define PAGE_HYP __pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_HYP_XN)
6868 #define PAGE_HYP_EXEC __pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY)
6969 #define PAGE_HYP_RO __pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY | PTE_HYP_XN)
70−#define PAGE_HYP_DEVICE __pgprot(PROT_DEVICE_nGnRE | PTE_HYP)
70+#define PAGE_HYP_DEVICE __pgprot(_PROT_DEFAULT | PTE_ATTRINDX(MT_DEVICE_nGnRE) | PTE_HYP | PTE_HYP_XN)
7171
7272 #define PAGE_S2_MEMATTR(attr) \
7373 ({ \
arch/arm64/include/asm/smp.h+0−1
@@ -30,7 +30,6 @@ · 29 unmodified lines
3030 #include <linux/threads.h>
3131 #include <linux/cpumask.h>
3232 #include <linux/thread_info.h>
33−#include <asm/pointer_auth.h>
3433
3534 DECLARE_PER_CPU_READ_MOSTLY(int, cpu_number);
3635
arch/arm64/include/asm/syscall.h+11−1
@@ -34,6 +34,10 @@ static inline long syscall_get_error(struct task_struct *task, · 33 unmodified lines
3434 struct pt_regs *regs)
3535 {
3636 unsigned long error = regs->regs[0];
37+
38+ if (is_compat_thread(task_thread_info(task)))
39+ error = sign_extend64(error, 31);
40+
3741 return IS_ERR_VALUE(error) ? error : 0;
3842 }
3943
@@ -47,7 +51,13 @@ static inline void syscall_set_return_value(struct task_struct *task, · 7 unmodified lines
4751 struct pt_regs *regs,
4852 int error, long val)
4953 {
50− regs->regs[0] = (long) error ? error : val;
54+ if (error)
55+ val = error;
56+
57+ if (is_compat_thread(task_thread_info(task)))
58+ val = lower_32_bits(val);
59+
60+ regs->regs[0] = val;
5161 }
5262
5363 #define SYSCALL_MAX_ARGS 6
arch/arm64/include/asm/thread_info.h+1−0
@@ -93,6 +93,7 @@ void arch_release_task_struct(struct task_struct *tsk); · 92 unmodified lines
9393 #define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU)
9494 #define _TIF_UPROBE (1 << TIF_UPROBE)
9595 #define _TIF_FSCHECK (1 << TIF_FSCHECK)
96+#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
9697 #define _TIF_32BIT (1 << TIF_32BIT)
9798 #define _TIF_SVE (1 << TIF_SVE)
9899
arch/arm64/include/asm/vdso/clocksource.h+5−2
@@ -2,7 +2,10 @@ · 1 unmodified line
22 #ifndef __ASM_VDSOCLOCKSOURCE_H
33 #define __ASM_VDSOCLOCKSOURCE_H
44
5−#define VDSO_ARCH_CLOCKMODES \
6− VDSO_CLOCKMODE_ARCHTIMER
5+#define VDSO_ARCH_CLOCKMODES \
6+ /* vdso clocksource for both 32 and 64bit tasks */ \
7+ VDSO_CLOCKMODE_ARCHTIMER, \
8+ /* vdso clocksource for 64bit tasks only */ \
9+ VDSO_CLOCKMODE_ARCHTIMER_NOCOMPAT
710
811 #endif
arch/arm64/include/asm/vdso/compat_gettimeofday.h+7−1
@@ -111,7 +111,7 @@ static __always_inline u64 __arch_get_hw_counter(s32 clock_mode) · 110 unmodified lines
111111 * update. Return something. Core will do another round and then
112112 * see the mode change and fallback to the syscall.
113113 */
114− if (clock_mode == VDSO_CLOCKMODE_NONE)
114+ if (clock_mode != VDSO_CLOCKMODE_ARCHTIMER)
115115 return 0;
116116
117117 /*
@@ -152,6 +152,12 @@ static __always_inline const struct vdso_data *__arch_get_vdso_data(void) · 34 unmodified lines
152152 return ret;
153153 }
154154
155+static inline bool vdso_clocksource_ok(const struct vdso_data *vd)
156+{
157+ return vd->clock_mode == VDSO_CLOCKMODE_ARCHTIMER;
158+}
159+#define vdso_clocksource_ok vdso_clocksource_ok
160+
155161 #endif /* !__ASSEMBLY__ */
156162
157163 #endif /* __ASM_VDSO_GETTIMEOFDAY_H */
arch/arm64/kernel/alternative.c+2−14
@@ -43,20 +43,8 @@ bool alternative_is_applied(u16 cpufeature) · 42 unmodified lines
4343 */
4444 static bool branch_insn_requires_update(struct alt_instr *alt, unsigned long pc)
4545 {
46− unsigned long replptr;
47−
48− if (kernel_text_address(pc))
49− return true;
50−
51− replptr = (unsigned long)ALT_REPL_PTR(alt);
52− if (pc >= replptr && pc <= (replptr + alt->alt_len))
53− return false;
54−
55− /*
56− * Branching into *another* alternate sequence is doomed, and
57− * we're not even trying to fix it up.
58− */
59− BUG();
46+ unsigned long replptr = (unsigned long)ALT_REPL_PTR(alt);
47+ return !(pc >= replptr && pc <= (replptr + alt->alt_len));
6048 }
6149
6250 #define align_down(x, a) ((unsigned long)(x) & ~(((unsigned long)(a)) - 1))
arch/arm64/kernel/cpu_errata.c+1−0
@@ -782,6 +782,7 @@ static const struct midr_range erratum_1463225[] = { · 781 unmodified lines
782782 MIDR_RANGE(MIDR_CORTEX_A76, 0, 0, 3, 1),
783783 /* Kryo4xx Gold (rcpe to rfpf) => (r0p0 to r3p1) */
784784 MIDR_RANGE(MIDR_QCOM_KRYO_4XX_GOLD, 0xc, 0xe, 0xf, 0xf),
785+ {},
785786 };
786787 #endif
787788
arch/arm64/kernel/debug-monitors.c+18−6
@@ -141,17 +141,20 @@ postcore_initcall(debug_monitors_init); · 140 unmodified lines
141141 /*
142142 * Single step API and exception handling.
143143 */
144−static void set_regs_spsr_ss(struct pt_regs *regs)
144+static void set_user_regs_spsr_ss(struct user_pt_regs *regs)
145145 {
146146 regs->pstate |= DBG_SPSR_SS;
147147 }
148−NOKPROBE_SYMBOL(set_regs_spsr_ss);
148+NOKPROBE_SYMBOL(set_user_regs_spsr_ss);
149149
150−static void clear_regs_spsr_ss(struct pt_regs *regs)
150+static void clear_user_regs_spsr_ss(struct user_pt_regs *regs)
151151 {
152152 regs->pstate &= ~DBG_SPSR_SS;
153153 }
154−NOKPROBE_SYMBOL(clear_regs_spsr_ss);
154+NOKPROBE_SYMBOL(clear_user_regs_spsr_ss);
155+
156+#define set_regs_spsr_ss(r) set_user_regs_spsr_ss(&(r)->user_regs)
157+#define clear_regs_spsr_ss(r) clear_user_regs_spsr_ss(&(r)->user_regs)
155158
156159 static DEFINE_SPINLOCK(debug_hook_lock);
157160 static LIST_HEAD(user_step_hook);
@@ -391,17 +394,26 @@ void user_rewind_single_step(struct task_struct *task) · 233 unmodified lines
391394 * If single step is active for this thread, then set SPSR.SS
392395 * to 1 to avoid returning to the active-pending state.
393396 */
394− if (test_ti_thread_flag(task_thread_info(task), TIF_SINGLESTEP))
397+ if (test_tsk_thread_flag(task, TIF_SINGLESTEP))
395398 set_regs_spsr_ss(task_pt_regs(task));
396399 }
397400 NOKPROBE_SYMBOL(user_rewind_single_step);
398401
399402 void user_fastforward_single_step(struct task_struct *task)
400403 {
401− if (test_ti_thread_flag(task_thread_info(task), TIF_SINGLESTEP))
404+ if (test_tsk_thread_flag(task, TIF_SINGLESTEP))
402405 clear_regs_spsr_ss(task_pt_regs(task));
403406 }
404407
408+void user_regs_reset_single_step(struct user_pt_regs *regs,
409+ struct task_struct *task)
410+{
411+ if (test_tsk_thread_flag(task, TIF_SINGLESTEP))
412+ set_user_regs_spsr_ss(regs);
413+ else
414+ clear_user_regs_spsr_ss(regs);
415+}
416+
405417 /* Kernel API */
406418 void kernel_enable_single_step(struct pt_regs *regs)
407419 {
arch/arm64/kernel/entry-common.c+1−1
@@ -57,7 +57,7 @@ static void notrace el1_dbg(struct pt_regs *regs, unsigned long esr) · 56 unmodified lines
5757 /*
5858 * The CPU masked interrupts, and we are leaving them masked during
5959 * do_debug_exception(). Update PMR as if we had called
60− * local_mask_daif().
60+ * local_daif_mask().
6161 */
6262 if (system_uses_irq_prio_masking())
6363 gic_write_pmr(GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET);
arch/arm64/kernel/entry.S+31−21
@@ -126,8 +126,10 @@ alternative_else_nop_endif · 125 unmodified lines
126126 add \dst, \dst, #(\sym - .entry.tramp.text)
127127 .endm
128128
129− // This macro corrupts x0-x3. It is the caller's duty
130− // to save/restore them if required.
129+ /*
130+ * This macro corrupts x0-x3. It is the caller's duty to save/restore
131+ * them if required.
132+ */
131133 .macro apply_ssbd, state, tmp1, tmp2
132134 #ifdef CONFIG_ARM64_SSBD
133135 alternative_cb arm64_enable_wa2_handling
@@ -167,13 +169,28 @@ alternative_cb_end · 33 unmodified lines
167169 stp x28, x29, [sp, #16 * 14]
168170
169171 .if \el == 0
172+ .if \regsize == 32
173+ /*
174+ * If we're returning from a 32-bit task on a system affected by
175+ * 1418040 then re-enable userspace access to the virtual counter.
176+ */
177+#ifdef CONFIG_ARM64_ERRATUM_1418040
178+alternative_if ARM64_WORKAROUND_1418040
179+ mrs x0, cntkctl_el1
180+ orr x0, x0, #2 // ARCH_TIMER_USR_VCT_ACCESS_EN
181+ msr cntkctl_el1, x0
182+alternative_else_nop_endif
183+#endif
184+ .endif
170185 clear_gp_regs
171186 mrs x21, sp_el0
172187 ldr_this_cpu tsk, __entry_task, x20
173188 msr sp_el0, tsk
174189
175− // Ensure MDSCR_EL1.SS is clear, since we can unmask debug exceptions
176− // when scheduling.
190+ /*
191+ * Ensure MDSCR_EL1.SS is clear, since we can unmask debug exceptions
192+ * when scheduling.
193+ */
177194 ldr x19, [tsk, #TSK_TI_FLAGS]
178195 disable_step_tsk x19, x20
179196
@@ -320,6 +337,14 @@ alternative_else_nop_endif · 140 unmodified lines
320337 tst x22, #PSR_MODE32_BIT // native task?
321338 b.eq 3f
322339
340+#ifdef CONFIG_ARM64_ERRATUM_1418040
341+alternative_if ARM64_WORKAROUND_1418040
342+ mrs x0, cntkctl_el1
343+ bic x0, x0, #2 // ARCH_TIMER_USR_VCT_ACCESS_EN
344+ msr cntkctl_el1, x0
345+alternative_else_nop_endif
346+#endif
347+
323348 #ifdef CONFIG_ARM64_ERRATUM_845719
324349 alternative_if ARM64_WORKAROUND_845719
325350 #ifdef CONFIG_PID_IN_CONTEXTIDR
@@ -331,21 +356,6 @@ alternative_if ARM64_WORKAROUND_845719 · 5 unmodified lines
331356 alternative_else_nop_endif
332357 #endif
333358 3:
334−#ifdef CONFIG_ARM64_ERRATUM_1418040
335−alternative_if_not ARM64_WORKAROUND_1418040
336− b 4f
337−alternative_else_nop_endif
338− /*
339− * if (x22.mode32 == cntkctl_el1.el0vcten)
340− * cntkctl_el1.el0vcten = ~cntkctl_el1.el0vcten
341− */
342− mrs x1, cntkctl_el1
343− eon x0, x1, x22, lsr #3
344− tbz x0, #1, 4f
345− eor x1, x1, #2 // ARCH_TIMER_USR_VCT_ACCESS_EN
346− msr cntkctl_el1, x1
347−4:
348−#endif
349359 scs_save tsk, x0
350360
351361 /* No kernel C function calls after this as user keys are set. */
@@ -377,11 +387,11 @@ alternative_else_nop_endif · 25 unmodified lines
377387 .if \el == 0
378388 alternative_insn eret, nop, ARM64_UNMAP_KERNEL_AT_EL0
379389 #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
380− bne 5f
390+ bne 4f
381391 msr far_el1, x30
382392 tramp_alias x30, tramp_exit_native
383393 br x30
384−5:
394+4:
385395 tramp_alias x30, tramp_exit_compat
386396 br x30
387397 #endif
arch/arm64/kernel/kgdb.c+1−1
@@ -252,7 +252,7 @@ static int kgdb_step_brk_fn(struct pt_regs *regs, unsigned int esr) · 251 unmodified lines
252252 if (!kgdb_single_step)
253253 return DBG_HOOK_ERROR;
254254
255− kgdb_handle_exception(1, SIGTRAP, 0, regs);
255+ kgdb_handle_exception(0, SIGTRAP, 0, regs);
256256 return DBG_HOOK_HANDLED;
257257 }
258258 NOKPROBE_SYMBOL(kgdb_step_brk_fn);
arch/arm64/kernel/ptrace.c+37−12
@@ -1811,19 +1811,42 @@ static void tracehook_report_syscall(struct pt_regs *regs, · 1810 unmodified lines
18111811 unsigned long saved_reg;
18121812
18131813 /*
1814− * A scratch register (ip(r12) on AArch32, x7 on AArch64) is
1815− * used to denote syscall entry/exit:
1814+ * We have some ABI weirdness here in the way that we handle syscall
1815+ * exit stops because we indicate whether or not the stop has been
1816+ * signalled from syscall entry or syscall exit by clobbering a general
1817+ * purpose register (ip/r12 for AArch32, x7 for AArch64) in the tracee
1818+ * and restoring its old value after the stop. This means that:
1819+ *
1820+ * - Any writes by the tracer to this register during the stop are
1821+ * ignored/discarded.
1822+ *
1823+ * - The actual value of the register is not available during the stop,
1824+ * so the tracer cannot save it and restore it later.
1825+ *
1826+ * - Syscall stops behave differently to seccomp and pseudo-step traps
1827+ * (the latter do not nobble any registers).
18161828 */
18171829 regno = (is_compat_task() ? 12 : 7);
18181830 saved_reg = regs->regs[regno];
18191831 regs->regs[regno] = dir;
18201832
1821− if (dir == PTRACE_SYSCALL_EXIT)
1833+ if (dir == PTRACE_SYSCALL_ENTER) {
1834+ if (tracehook_report_syscall_entry(regs))
1835+ forget_syscall(regs);
1836+ regs->regs[regno] = saved_reg;
1837+ } else if (!test_thread_flag(TIF_SINGLESTEP)) {
18221838 tracehook_report_syscall_exit(regs, 0);
1823− else if (tracehook_report_syscall_entry(regs))
1824− forget_syscall(regs);
1839+ regs->regs[regno] = saved_reg;
1840+ } else {
1841+ regs->regs[regno] = saved_reg;
18251842
1826− regs->regs[regno] = saved_reg;
1843+ /*
1844+ * Signal a pseudo-step exception since we are stepping but
1845+ * tracer modifications to the registers may have rewound the
1846+ * state machine.
1847+ */
1848+ tracehook_report_syscall_exit(regs, 1);
1849+ }
18271850 }
18281851
18291852 int syscall_trace_enter(struct pt_regs *regs)
@@ -1833,12 +1856,12 @@ int syscall_trace_enter(struct pt_regs *regs) · 3 unmodified lines
18331856 if (flags & (_TIF_SYSCALL_EMU | _TIF_SYSCALL_TRACE)) {
18341857 tracehook_report_syscall(regs, PTRACE_SYSCALL_ENTER);
18351858 if (!in_syscall(regs) || (flags & _TIF_SYSCALL_EMU))
1836− return -1;
1859+ return NO_SYSCALL;
18371860 }
18381861
18391862 /* Do the secure computing after ptrace; failures should be fast. */
18401863 if (secure_computing() == -1)
1841− return -1;
1864+ return NO_SYSCALL;
18421865
18431866 if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
18441867 trace_sys_enter(regs, regs->syscallno);
@@ -1851,12 +1874,14 @@ int syscall_trace_enter(struct pt_regs *regs) · 6 unmodified lines
18511874
18521875 void syscall_trace_exit(struct pt_regs *regs)
18531876 {
1877+ unsigned long flags = READ_ONCE(current_thread_info()->flags);
1878+
18541879 audit_syscall_exit(regs);
18551880
1856− if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
1881+ if (flags & _TIF_SYSCALL_TRACEPOINT)
18571882 trace_sys_exit(regs, regs_return_value(regs));
18581883
1859− if (test_thread_flag(TIF_SYSCALL_TRACE))
1884+ if (flags & (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP))
18601885 tracehook_report_syscall(regs, PTRACE_SYSCALL_EXIT);
18611886
18621887 rseq_syscall(regs);
@@ -1934,8 +1959,8 @@ static int valid_native_regs(struct user_pt_regs *regs) · 71 unmodified lines
19341959 */
19351960 int valid_user_regs(struct user_pt_regs *regs, struct task_struct *task)
19361961 {
1937− if (!test_tsk_thread_flag(task, TIF_SINGLESTEP))
1938− regs->pstate &= ~DBG_SPSR_SS;
1962+ /* https://lore.kernel.org/lkml/20191118131525.GA4180@willie-the-truck */
1963+ user_regs_reset_single_step(regs, task);
19391964
19401965 if (is_compat_thread(task_thread_info(task)))
19411966 return valid_compat_regs(regs);
arch/arm64/kernel/signal.c+2−9
@@ -800,7 +800,6 @@ static void setup_restart_syscall(struct pt_regs *regs) · 799 unmodified lines
800800 */
801801 static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
802802 {
803− struct task_struct *tsk = current;
804803 sigset_t *oldset = sigmask_to_save();
805804 int usig = ksig->sig;
806805 int ret;
@@ -824,14 +823,8 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs) · 17 unmodified lines
824823 */
825824 ret |= !valid_user_regs(&regs->user_regs, current);
826825
827− /*
828− * Fast forward the stepping logic so we step into the signal
829− * handler.
830− */
831− if (!ret)
832− user_fastforward_single_step(tsk);
833−
834− signal_setup_done(ret, ksig, 0);
826+ /* Step into the signal handler if we are stepping */
827+ signal_setup_done(ret, ksig, test_thread_flag(TIF_SINGLESTEP));
835828 }
836829
837830 /*
arch/arm64/kernel/syscall.c+19−2
@@ -50,6 +50,9 @@ static void invoke_syscall(struct pt_regs *regs, unsigned int scno, · 49 unmodified lines
5050 ret = do_ni_syscall(regs, scno);
5151 }
5252
53+ if (is_compat_task())
54+ ret = lower_32_bits(ret);
55+
5356 regs->regs[0] = ret;
5457 }
5558
@@ -121,7 +124,21 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr, · 65 unmodified lines
121124 user_exit();
122125
123126 if (has_syscall_work(flags)) {
124− /* set default errno for user-issued syscall(-1) */
127+ /*
128+ * The de-facto standard way to skip a system call using ptrace
129+ * is to set the system call to -1 (NO_SYSCALL) and set x0 to a
130+ * suitable error code for consumption by userspace. However,
131+ * this cannot be distinguished from a user-issued syscall(-1)
132+ * and so we must set x0 to -ENOSYS here in case the tracer doesn't
133+ * issue the skip and we fall into trace_exit with x0 preserved.
134+ *
135+ * This is slightly odd because it also means that if a tracer
136+ * sets the system call number to -1 but does not initialise x0,
137+ * then x0 will be preserved for all system calls apart from a
138+ * user-issued syscall(-1). However, requesting a skip and not
139+ * setting the return value is unlikely to do anything sensible
140+ * anyway.
141+ */
125142 if (scno == NO_SYSCALL)
126143 regs->regs[0] = -ENOSYS;
127144 scno = syscall_trace_enter(regs);
@@ -139,7 +156,7 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr, · 11 unmodified lines
139156 if (!has_syscall_work(flags) && !IS_ENABLED(CONFIG_DEBUG_RSEQ)) {
140157 local_daif_mask();
141158 flags = current_thread_info()->flags;
142− if (!has_syscall_work(flags)) {
159+ if (!has_syscall_work(flags) && !(flags & _TIF_SINGLESTEP)) {
143160 /*
144161 * We're off to userspace, where interrupts are
145162 * always enabled after we restore the flags from
arch/arm64/kernel/vdso32/Makefile+1−1
@@ -14,7 +14,7 @@ COMPAT_GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE_COMPAT)elfedit)) · 13 unmodified lines
1414 COMPAT_GCC_TOOLCHAIN := $(realpath $(COMPAT_GCC_TOOLCHAIN_DIR)/..)
1515
1616 CC_COMPAT_CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%))
17−CC_COMPAT_CLANG_FLAGS += --prefix=$(COMPAT_GCC_TOOLCHAIN_DIR)
17+CC_COMPAT_CLANG_FLAGS += --prefix=$(COMPAT_GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE_COMPAT))
1818 CC_COMPAT_CLANG_FLAGS += -no-integrated-as -Qunused-arguments
1919 ifneq ($(COMPAT_GCC_TOOLCHAIN),)
2020 CC_COMPAT_CLANG_FLAGS += --gcc-toolchain=$(COMPAT_GCC_TOOLCHAIN)
arch/arm64/kvm/mmu.c+6−5
@@ -1326,7 +1326,7 @@ static bool stage2_get_leaf_entry(struct kvm *kvm, phys_addr_t addr, · 1325 unmodified lines
13261326 return true;
13271327 }
13281328
1329−static bool stage2_is_exec(struct kvm *kvm, phys_addr_t addr)
1329+static bool stage2_is_exec(struct kvm *kvm, phys_addr_t addr, unsigned long sz)
13301330 {
13311331 pud_t *pudp;
13321332 pmd_t *pmdp;
@@ -1338,11 +1338,11 @@ static bool stage2_is_exec(struct kvm *kvm, phys_addr_t addr) · 5 unmodified lines
13381338 return false;
13391339
13401340 if (pudp)
1341− return kvm_s2pud_exec(pudp);
1341+ return sz <= PUD_SIZE && kvm_s2pud_exec(pudp);
13421342 else if (pmdp)
1343− return kvm_s2pmd_exec(pmdp);
1343+ return sz <= PMD_SIZE && kvm_s2pmd_exec(pmdp);
13441344 else
1345− return kvm_s2pte_exec(ptep);
1345+ return sz == PAGE_SIZE && kvm_s2pte_exec(ptep);
13461346 }
13471347
13481348 static int stage2_set_pte(struct kvm *kvm, struct kvm_mmu_memory_cache *cache,
@@ -1958,7 +1958,8 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, · 609 unmodified lines
19581958 * execute permissions, and we preserve whatever we have.
19591959 */
19601960 needs_exec = exec_fault ||
1961− (fault_status == FSC_PERM && stage2_is_exec(kvm, fault_ipa));
1961+ (fault_status == FSC_PERM &&
1962+ stage2_is_exec(kvm, fault_ipa, vma_pagesize));
19621963
19631964 if (vma_pagesize == PUD_SIZE) {
19641965 pud_t new_pud = kvm_pfn_pud(pfn, mem_type);
arch/mips/include/asm/unroll.h+3−5
@@ -19,15 +19,13 @@ · 18 unmodified lines
1919 \
2020 /* \
2121 * We can't unroll if the number of iterations isn't \
22− * compile-time constant. Unfortunately GCC versions \
23− * up until 4.6 tend to miss obvious constants & cause \
22+ * compile-time constant. Unfortunately clang versions \
23+ * up until 8.0 tend to miss obvious constants & cause \
2424 * this check to fail, even though they go on to \
2525 * generate reasonable code for the switch statement, \
2626 * so we skip the sanity check for those compilers. \
2727 */ \
28− BUILD_BUG_ON((CONFIG_GCC_VERSION >= 40700 || \
29− CONFIG_CLANG_VERSION >= 80000) && \
30− !__builtin_constant_p(times)); \
28+ BUILD_BUG_ON(!__builtin_constant_p(times)); \
3129 \
3230 switch (times) { \
3331 case 32: fn(__VA_ARGS__); /* fall through */ \
arch/mips/kvm/emulate.c+4−0
@@ -1722,6 +1722,7 @@ enum emulation_result kvm_mips_emulate_store(union mips_instruction inst, · 1721 unmodified lines
17221722 vcpu->arch.gprs[rt], *(u32 *)data);
17231723 break;
17241724
1725+#if defined(CONFIG_64BIT) && defined(CONFIG_KVM_MIPS_VZ)
17251726 case sdl_op:
17261727 run->mmio.phys_addr = kvm_mips_callbacks->gva_to_gpa(
17271728 vcpu->arch.host_cp0_badvaddr) & (~0x7);
@@ -1815,6 +1816,7 @@ enum emulation_result kvm_mips_emulate_store(union mips_instruction inst, · 87 unmodified lines
18151816 vcpu->arch.pc, vcpu->arch.host_cp0_badvaddr,
18161817 vcpu->arch.gprs[rt], *(u64 *)data);
18171818 break;
1819+#endif
18181820
18191821 #ifdef CONFIG_CPU_LOONGSON64
18201822 case sdc2_op:
@@ -2002,6 +2004,7 @@ enum emulation_result kvm_mips_emulate_load(union mips_instruction inst, · 181 unmodified lines
20022004 }
20032005 break;
20042006
2007+#if defined(CONFIG_64BIT) && defined(CONFIG_KVM_MIPS_VZ)
20052008 case ldl_op:
20062009 run->mmio.phys_addr = kvm_mips_callbacks->gva_to_gpa(
20072010 vcpu->arch.host_cp0_badvaddr) & (~0x7);
@@ -2073,6 +2076,7 @@ enum emulation_result kvm_mips_emulate_load(union mips_instruction inst, · 65 unmodified lines
20732076 break;
20742077 }
20752078 break;
2079+#endif
20762080
20772081 #ifdef CONFIG_CPU_LOONGSON64
20782082 case ldc2_op:
arch/mips/pci/pci-xtalk-bridge.c+3−2
@@ -627,9 +627,10 @@ static int bridge_probe(struct platform_device *pdev) · 626 unmodified lines
627627 return -ENOMEM;
628628 domain = irq_domain_create_hierarchy(parent, 0, 8, fn,
629629 &bridge_domain_ops, NULL);
630− irq_domain_free_fwnode(fn);
631− if (!domain)
630+ if (!domain) {
631+ irq_domain_free_fwnode(fn);
632632 return -ENOMEM;
633+ }
633634
634635 pci_set_flags(PCI_PROBE_ONLY);
635636
arch/parisc/include/asm/atomic.h+2−0
@@ -212,6 +212,8 @@ atomic64_set(atomic64_t *v, s64 i) · 211 unmodified lines
212212 _atomic_spin_unlock_irqrestore(v, flags);
213213 }
214214
215+#define atomic64_set_release(v, i) atomic64_set((v), (i))
216+
215217 static __inline__ s64
216218 atomic64_read(const atomic64_t *v)
217219 {
arch/parisc/include/asm/cmpxchg.h+2−0
@@ -60,6 +60,7 @@ extern void __cmpxchg_called_with_bad_pointer(void); · 59 unmodified lines
6060 extern unsigned long __cmpxchg_u32(volatile unsigned int *m, unsigned int old,
6161 unsigned int new_);
6262 extern u64 __cmpxchg_u64(volatile u64 *ptr, u64 old, u64 new_);
63+extern u8 __cmpxchg_u8(volatile u8 *ptr, u8 old, u8 new_);
6364
6465 /* don't worry...optimizer will get rid of most of this */
6566 static inline unsigned long
@@ -71,6 +72,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size) · 5 unmodified lines
7172 #endif
7273 case 4: return __cmpxchg_u32((unsigned int *)ptr,
7374 (unsigned int)old, (unsigned int)new_);
75+ case 1: return __cmpxchg_u8((u8 *)ptr, (u8)old, (u8)new_);
7476 }
7577 __cmpxchg_called_with_bad_pointer();
7678 return old;
arch/parisc/lib/bitops.c+12−0
@@ -79,3 +79,15 @@ unsigned long __cmpxchg_u32(volatile unsigned int *ptr, unsigned int old, unsign · 78 unmodified lines
7979 _atomic_spin_unlock_irqrestore(ptr, flags);
8080 return (unsigned long)prev;
8181 }
82+
83+u8 __cmpxchg_u8(volatile u8 *ptr, u8 old, u8 new)
84+{
85+ unsigned long flags;
86+ u8 prev;
87+
88+ _atomic_spin_lock_irqsave(ptr, flags);
89+ if ((prev = *ptr) == old)
90+ *ptr = new;
91+ _atomic_spin_unlock_irqrestore(ptr, flags);
92+ return prev;
93+}
arch/powerpc/include/asm/icswx.h+2−0
@@ -77,6 +77,8 @@ struct coprocessor_completion_block { · 76 unmodified lines
7777 #define CSB_CC_CHAIN (37)
7878 #define CSB_CC_SEQUENCE (38)
7979 #define CSB_CC_HW (39)
80+/* P9 DD2 NX Workbook 3.2 (Table 4-36): Address translation fault */
81+#define CSB_CC_FAULT_ADDRESS (250)
8082
8183 #define CSB_SIZE (0x10)
8284 #define CSB_ALIGN CSB_SIZE
arch/powerpc/kernel/exceptions-64s.S+12−4
@@ -2551,7 +2551,7 @@ EXC_VIRT_NONE(0x5400, 0x100) · 2550 unmodified lines
25512551 INT_DEFINE_BEGIN(denorm_exception)
25522552 IVEC=0x1500
25532553 IHSRR=1
2554− IBRANCH_COMMON=0
2554+ IBRANCH_TO_COMMON=0
25552555 IKVM_REAL=1
25562556 INT_DEFINE_END(denorm_exception)
25572557
@@ -3072,10 +3072,18 @@ do_hash_page: · 514 unmodified lines
30723072 ori r0,r0,DSISR_BAD_FAULT_64S@l
30733073 and. r0,r5,r0 /* weird error? */
30743074 bne- handle_page_fault /* if not, try to insert a HPTE */
3075+
3076+ /*
3077+ * If we are in an "NMI" (e.g., an interrupt when soft-disabled), then
3078+ * don't call hash_page, just fail the fault. This is required to
3079+ * prevent re-entrancy problems in the hash code, namely perf
3080+ * interrupts hitting while something holds H_PAGE_BUSY, and taking a
3081+ * hash fault. See the comment in hash_preload().
3082+ */
30753083 ld r11, PACA_THREAD_INFO(r13)
3076− lwz r0,TI_PREEMPT(r11) /* If we're in an "NMI" */
3077− andis. r0,r0,NMI_MASK@h /* (i.e. an irq when soft-disabled) */
3078− bne 77f /* then don't call hash_page now */
3084+ lwz r0,TI_PREEMPT(r11)
3085+ andis. r0,r0,NMI_MASK@h
3086+ bne 77f
30793087
30803088 /*
30813089 * r3 contains the trap number
arch/powerpc/kernel/paca.c+1−1
@@ -87,7 +87,7 @@ static void *__init alloc_shared_lppaca(unsigned long size, unsigned long align, · 86 unmodified lines
8787 * This is very early in boot, so no harm done if the kernel crashes at
8888 * this point.
8989 */
90− BUG_ON(shared_lppaca_size >= shared_lppaca_total_size);
90+ BUG_ON(shared_lppaca_size > shared_lppaca_total_size);
9191
9292 return ptr;
9393 }
arch/powerpc/mm/book3s64/hash_utils.c+25−0
@@ -1559,6 +1559,7 @@ static void hash_preload(struct mm_struct *mm, pte_t *ptep, unsigned long ea, · 1558 unmodified lines
15591559 pgd_t *pgdir;
15601560 int rc, ssize, update_flags = 0;
15611561 unsigned long access = _PAGE_PRESENT | _PAGE_READ | (is_exec ? _PAGE_EXEC : 0);
1562+ unsigned long flags;
15621563
15631564 BUG_ON(get_region_id(ea) != USER_REGION_ID);
15641565
@@ -1592,6 +1593,28 @@ static void hash_preload(struct mm_struct *mm, pte_t *ptep, unsigned long ea, · 27 unmodified lines
15921593 return;
15931594 #endif /* CONFIG_PPC_64K_PAGES */
15941595
1596+ /*
1597+ * __hash_page_* must run with interrupts off, as it sets the
1598+ * H_PAGE_BUSY bit. It's possible for perf interrupts to hit at any
1599+ * time and may take a hash fault reading the user stack, see
1600+ * read_user_stack_slow() in the powerpc/perf code.
1601+ *
1602+ * If that takes a hash fault on the same page as we lock here, it
1603+ * will bail out when seeing H_PAGE_BUSY set, and retry the access
1604+ * leading to an infinite loop.
1605+ *
1606+ * Disabling interrupts here does not prevent perf interrupts, but it
1607+ * will prevent them taking hash faults (see the NMI test in
1608+ * do_hash_page), then read_user_stack's copy_from_user_nofault will
1609+ * fail and perf will fall back to read_user_stack_slow(), which
1610+ * walks the Linux page tables.
1611+ *
1612+ * Interrupts must also be off for the duration of the
1613+ * mm_is_thread_local test and update, to prevent preempt running the
1614+ * mm on another CPU (XXX: this may be racy vs kthread_use_mm).
1615+ */
1616+ local_irq_save(flags);
1617+
15951618 /* Is that local to this CPU ? */
15961619 if (mm_is_thread_local(mm))
15971620 update_flags |= HPTE_LOCAL_UPDATE;
@@ -1614,6 +1637,8 @@ static void hash_preload(struct mm_struct *mm, pte_t *ptep, unsigned long ea, · 16 unmodified lines
16141637 mm_ctx_user_psize(&mm->context),
16151638 mm_ctx_user_psize(&mm->context),
16161639 pte_val(*ptep));
1640+
1641+ local_irq_restore(flags);
16171642 }
16181643
16191644 /*
arch/powerpc/mm/book3s64/pkeys.c+7−5
@@ -354,12 +354,14 @@ static bool pkey_access_permitted(int pkey, bool write, bool execute) · 353 unmodified lines
354354 u64 amr;
355355
356356 pkey_shift = pkeyshift(pkey);
357− if (execute && !(read_iamr() & (IAMR_EX_BIT << pkey_shift)))
358− return true;
357+ if (execute)
358+ return !(read_iamr() & (IAMR_EX_BIT << pkey_shift));
359+
360+ amr = read_amr();
361+ if (write)
362+ return !(amr & (AMR_WR_BIT << pkey_shift));
359363
360− amr = read_amr(); /* Delay reading amr until absolutely needed */
361− return ((!write && !(amr & (AMR_RD_BIT << pkey_shift))) ||
362− (write && !(amr & (AMR_WR_BIT << pkey_shift))));
364+ return !(amr & (AMR_RD_BIT << pkey_shift));
363365 }
364366
365367 bool arch_pte_access_permitted(u64 pte, bool write, bool execute)
arch/powerpc/perf/core-book3s.c+6−0
@@ -2179,6 +2179,12 @@ static void __perf_event_interrupt(struct pt_regs *regs) · 2178 unmodified lines
21792179
21802180 perf_read_regs(regs);
21812181
2182+ /*
2183+ * If perf interrupts hit in a local_irq_disable (soft-masked) region,
2184+ * we consider them as NMIs. This is required to prevent hash faults on
2185+ * user addresses when reading callchains. See the NMI test in
2186+ * do_hash_page.
2187+ */
21822188 nmi = perf_intr_is_nmi(regs);
21832189 if (nmi)
21842190 nmi_enter();
arch/powerpc/platforms/powernv/vas-fault.c+1−1
@@ -79,7 +79,7 @@ static void update_csb(struct vas_window *window, · 78 unmodified lines
7979 csb_addr = (void __user *)be64_to_cpu(crb->csb_addr);
8080
8181 memset(&csb, 0, sizeof(csb));
82− csb.cc = CSB_CC_TRANSLATION;
82+ csb.cc = CSB_CC_FAULT_ADDRESS;
8383 csb.ce = CSB_CE_TERMINATION;
8484 csb.cs = 0;
8585 csb.count = 0;
arch/riscv/Kconfig+2−0
@@ -23,6 +23,8 @@ config RISCV · 22 unmodified lines
2323 select ARCH_HAS_SET_DIRECT_MAP
2424 select ARCH_HAS_SET_MEMORY
2525 select ARCH_HAS_STRICT_KERNEL_RWX if MMU
26+ select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
27+ select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
2628 select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
2729 select ARCH_WANT_FRAME_POINTERS
2830 select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
arch/riscv/include/asm/barrier.h+9−1
@@ -58,8 +58,16 @@ do { \ · 57 unmodified lines
5858 * The AQ/RL pair provides a RCpc critical section, but there's not really any
5959 * way we can take advantage of that here because the ordering is only enforced
6060 * on that one lock. Thus, we're just doing a full fence.
61+ *
62+ * Since we allow writeX to be called from preemptive regions we need at least
63+ * an "o" in the predecessor set to ensure device writes are visible before the
64+ * task is marked as available for scheduling on a new hart. While I don't see
65+ * any concrete reason we need a full IO fence, it seems safer to just upgrade
66+ * this in order to avoid any IO crossing a scheduling boundary. In both
67+ * instances the scheduler pairs this with an mb(), so nothing is necessary on
68+ * the new hart.
6169 */
62−#define smp_mb__after_spinlock() RISCV_FENCE(rw,rw)
70+#define smp_mb__after_spinlock() RISCV_FENCE(iorw,iorw)
6371
6472 #include <asm-generic/barrier.h>
6573
arch/riscv/include/asm/gdb_xml.h+1−2
@@ -3,8 +3,7 @@ · 2 unmodified lines
33 #ifndef __ASM_GDB_XML_H_
44 #define __ASM_GDB_XML_H_
55
6−#define kgdb_arch_gdb_stub_feature riscv_gdb_stub_feature
7−static const char riscv_gdb_stub_feature[64] =
6+const char riscv_gdb_stub_feature[64] =
87 "PacketSize=800;qXfer:features:read+;";
98
109 static const char gdb_xfer_read_target[31] = "qXfer:features:read:target.xml:";
arch/riscv/include/asm/kgdb.h+3−2
@@ -19,7 +19,6 @@ · 18 unmodified lines
1919
2020 #ifndef __ASSEMBLY__
2121
22−extern int kgdb_has_hit_break(unsigned long addr);
2322 extern unsigned long kgdb_compiled_break;
2423
2524 static inline void arch_kgdb_breakpoint(void)
@@ -106,7 +105,9 @@ static inline void arch_kgdb_breakpoint(void) · 80 unmodified lines
106105 #define DBG_REG_BADADDR_OFF 34
107106 #define DBG_REG_CAUSE_OFF 35
108107
109−#include <asm/gdb_xml.h>
108+extern const char riscv_gdb_stub_feature[64];
109+
110+#define kgdb_arch_gdb_stub_feature riscv_gdb_stub_feature
110111
111112 #endif
112113 #endif
arch/riscv/include/asm/thread_info.h+4−0
@@ -12,7 +12,11 @@ · 11 unmodified lines
1212 #include <linux/const.h>
1313
1414 /* thread information allocation */
15+#ifdef CONFIG_64BIT
16+#define THREAD_SIZE_ORDER (2)
17+#else
1518 #define THREAD_SIZE_ORDER (1)
19+#endif
1620 #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
1721
1822 #ifndef __ASSEMBLY__
arch/riscv/kernel/kgdb.c+5−5
@@ -44,18 +44,18 @@ DECLARE_INSN(c_beqz, MATCH_C_BEQZ, MASK_C_BEQZ) · 43 unmodified lines
4444 DECLARE_INSN(c_bnez, MATCH_C_BNEZ, MASK_C_BNEZ)
4545 DECLARE_INSN(sret, MATCH_SRET, MASK_SRET)
4646
47−int decode_register_index(unsigned long opcode, int offset)
47+static int decode_register_index(unsigned long opcode, int offset)
4848 {
4949 return (opcode >> offset) & 0x1F;
5050 }
5151
52−int decode_register_index_short(unsigned long opcode, int offset)
52+static int decode_register_index_short(unsigned long opcode, int offset)
5353 {
5454 return ((opcode >> offset) & 0x7) + 8;
5555 }
5656
5757 /* Calculate the new address for after a step */
58−int get_step_address(struct pt_regs *regs, unsigned long *next_addr)
58+static int get_step_address(struct pt_regs *regs, unsigned long *next_addr)
5959 {
6060 unsigned long pc = regs->epc;
6161 unsigned long *regs_ptr = (unsigned long *)regs;
@@ -136,7 +136,7 @@ int get_step_address(struct pt_regs *regs, unsigned long *next_addr) · 74 unmodified lines
136136 return 0;
137137 }
138138
139−int do_single_step(struct pt_regs *regs)
139+static int do_single_step(struct pt_regs *regs)
140140 {
141141 /* Determine where the target instruction will send us to */
142142 unsigned long addr = 0;
@@ -320,7 +320,7 @@ int kgdb_arch_handle_exception(int vector, int signo, int err_code, · 177 unmodified lines
320320 return err;
321321 }
322322
323−int kgdb_riscv_kgdbbreak(unsigned long addr)
323+static int kgdb_riscv_kgdbbreak(unsigned long addr)
324324 {
325325 if (stepped_address == addr)
326326 return KGDB_SW_SINGLE_STEP;
arch/riscv/mm/init.c+45−21
@@ -95,19 +95,40 @@ void __init mem_init(void) · 94 unmodified lines
9595 #ifdef CONFIG_BLK_DEV_INITRD
9696 static void __init setup_initrd(void)
9797 {
98+ phys_addr_t start;
9899 unsigned long size;
99100
100− if (initrd_start >= initrd_end) {
101− pr_info("initrd not found or empty");
101+ /* Ignore the virtul address computed during device tree parsing */
102+ initrd_start = initrd_end = 0;
103+
104+ if (!phys_initrd_size)
105+ return;
106+ /*
107+ * Round the memory region to page boundaries as per free_initrd_mem()
108+ * This allows us to detect whether the pages overlapping the initrd
109+ * are in use, but more importantly, reserves the entire set of pages
110+ * as we don't want these pages allocated for other purposes.
111+ */
112+ start = round_down(phys_initrd_start, PAGE_SIZE);
113+ size = phys_initrd_size + (phys_initrd_start - start);
114+ size = round_up(size, PAGE_SIZE);
115+
116+ if (!memblock_is_region_memory(start, size)) {
117+ pr_err("INITRD: 0x%08llx+0x%08lx is not a memory region",
118+ (u64)start, size);
102119 goto disable;
103120 }
104− if (__pa_symbol(initrd_end) > PFN_PHYS(max_low_pfn)) {
105− pr_err("initrd extends beyond end of memory");
121+
122+ if (memblock_is_region_reserved(start, size)) {
123+ pr_err("INITRD: 0x%08llx+0x%08lx overlaps in-use memory region\n",
124+ (u64)start, size);
106125 goto disable;
107126 }
108127
109− size = initrd_end - initrd_start;
110− memblock_reserve(__pa_symbol(initrd_start), size);
128+ memblock_reserve(start, size);
129+ /* Now convert initrd to virtual addresses */
130+ initrd_start = (unsigned long)__va(phys_initrd_start);
131+ initrd_end = initrd_start + phys_initrd_size;
111132 initrd_below_start_ok = 1;
112133
113134 pr_info("Initial ramdisk at: 0x%p (%lu bytes)\n",
@@ -126,33 +147,36 @@ void __init setup_bootmem(void) · 12 unmodified lines
126147 {
127148 struct memblock_region *reg;
128149 phys_addr_t mem_size = 0;
150+ phys_addr_t total_mem = 0;
151+ phys_addr_t mem_start, end = 0;
129152 phys_addr_t vmlinux_end = __pa_symbol(&_end);
130153 phys_addr_t vmlinux_start = __pa_symbol(&_start);
131154
132155 /* Find the memory region containing the kernel */
133156 for_each_memblock(memory, reg) {
134− phys_addr_t end = reg->base + reg->size;
135−
136− if (reg->base <= vmlinux_start && vmlinux_end <= end) {
137− mem_size = min(reg->size, (phys_addr_t)-PAGE_OFFSET);
138−
139− /*
140− * Remove memblock from the end of usable area to the
141− * end of region
142− */
143− if (reg->base + mem_size < end)
144− memblock_remove(reg->base + mem_size,
145− end - reg->base - mem_size);
146− }
157+ end = reg->base + reg->size;
158+ if (!total_mem)
159+ mem_start = reg->base;
160+ if (reg->base <= vmlinux_start && vmlinux_end <= end)
161+ BUG_ON(reg->size == 0);
162+ total_mem = total_mem + reg->size;
147163 }
148− BUG_ON(mem_size == 0);
164+
165+ /*
166+ * Remove memblock from the end of usable area to the
167+ * end of region
168+ */
169+ mem_size = min(total_mem, (phys_addr_t)-PAGE_OFFSET);
170+ if (mem_start + mem_size < end)
171+ memblock_remove(mem_start + mem_size,
172+ end - mem_start - mem_size);
149173
150174 /* Reserve from the start of the kernel to the end of the kernel */
151175 memblock_reserve(vmlinux_start, vmlinux_end - vmlinux_start);
152176
153− set_max_mapnr(PFN_DOWN(mem_size));
154177 max_pfn = PFN_DOWN(memblock_end_of_DRAM());
155178 max_low_pfn = max_pfn;
179+ set_max_mapnr(max_low_pfn);
156180
157181 #ifdef CONFIG_BLK_DEV_INITRD
158182 setup_initrd();
arch/riscv/mm/kasan_init.c+2−2
@@ -44,7 +44,7 @@ asmlinkage void __init kasan_early_init(void) · 43 unmodified lines
4444 (__pa(((uintptr_t) kasan_early_shadow_pmd))),
4545 __pgprot(_PAGE_TABLE)));
4646
47− flush_tlb_all();
47+ local_flush_tlb_all();
4848 }
4949
5050 static void __init populate(void *start, void *end)
@@ -79,7 +79,7 @@ static void __init populate(void *start, void *end) · 28 unmodified lines
7979 pfn_pgd(PFN_DOWN(__pa(&pmd[offset])),
8080 __pgprot(_PAGE_TABLE)));
8181
82− flush_tlb_all();
82+ local_flush_tlb_all();
8383 memset(start, 0, end - start);
8484 }
8585
arch/s390/kernel/perf_cpum_cf_events.c+2−2
@@ -292,7 +292,7 @@ CPUMF_EVENT_ATTR(cf_z15, TX_C_TABORT_SPECIAL, 0x00f5); · 291 unmodified lines
292292 CPUMF_EVENT_ATTR(cf_z15, DFLT_ACCESS, 0x00f7);
293293 CPUMF_EVENT_ATTR(cf_z15, DFLT_CYCLES, 0x00fc);
294294 CPUMF_EVENT_ATTR(cf_z15, DFLT_CC, 0x00108);
295−CPUMF_EVENT_ATTR(cf_z15, DFLT_CCERROR, 0x00109);
295+CPUMF_EVENT_ATTR(cf_z15, DFLT_CCFINISH, 0x00109);
296296 CPUMF_EVENT_ATTR(cf_z15, MT_DIAG_CYCLES_ONE_THR_ACTIVE, 0x01c0);
297297 CPUMF_EVENT_ATTR(cf_z15, MT_DIAG_CYCLES_TWO_THR_ACTIVE, 0x01c1);
298298
@@ -629,7 +629,7 @@ static struct attribute *cpumcf_z15_pmu_event_attr[] __initdata = { · 330 unmodified lines
629629 CPUMF_EVENT_PTR(cf_z15, DFLT_ACCESS),
630630 CPUMF_EVENT_PTR(cf_z15, DFLT_CYCLES),
631631 CPUMF_EVENT_PTR(cf_z15, DFLT_CC),
632− CPUMF_EVENT_PTR(cf_z15, DFLT_CCERROR),
632+ CPUMF_EVENT_PTR(cf_z15, DFLT_CCFINISH),
633633 CPUMF_EVENT_PTR(cf_z15, MT_DIAG_CYCLES_ONE_THR_ACTIVE),
634634 CPUMF_EVENT_PTR(cf_z15, MT_DIAG_CYCLES_TWO_THR_ACTIVE),
635635 NULL,
arch/s390/mm/hugetlbpage.c+1−1
@@ -117,7 +117,7 @@ static inline pte_t __rste_to_pte(unsigned long rste) · 116 unmodified lines
117117 _PAGE_YOUNG);
118118 #ifdef CONFIG_MEM_SOFT_DIRTY
119119 pte_val(pte) |= move_set_bit(rste, _SEGMENT_ENTRY_SOFT_DIRTY,
120− _PAGE_DIRTY);
120+ _PAGE_SOFT_DIRTY);
121121 #endif
122122 pte_val(pte) |= move_set_bit(rste, _SEGMENT_ENTRY_NOEXEC,
123123 _PAGE_NOEXEC);
arch/sh/include/asm/pgalloc.h+1−9
@@ -12,6 +12,7 @@ extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); · 11 unmodified lines
1212 extern void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd);
1313 extern pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address);
1414 extern void pmd_free(struct mm_struct *mm, pmd_t *pmd);
15+#define __pmd_free_tlb(tlb, pmdp, addr) pmd_free((tlb)->mm, (pmdp))
1516 #endif
1617
1718 static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
@@ -33,13 +34,4 @@ do { \ · 15 unmodified lines
3334 tlb_remove_page((tlb), (pte)); \
3435 } while (0)
3536
36−#if CONFIG_PGTABLE_LEVELS > 2
37−#define __pmd_free_tlb(tlb, pmdp, addr) \
38−do { \
39− struct page *page = virt_to_page(pmdp); \
40− pgtable_pmd_page_dtor(page); \
41− tlb_remove_page((tlb), page); \
42−} while (0);
43−#endif
44−
4537 #endif /* __ASM_SH_PGALLOC_H */
arch/sh/kernel/entry-common.S+3−3
@@ -199,7 +199,7 @@ syscall_trace_entry: · 198 unmodified lines
199199 mov.l @(OFF_R7,r15), r7 ! arg3
200200 mov.l @(OFF_R3,r15), r3 ! syscall_nr
201201 !
202− mov.l 2f, r10 ! Number of syscalls
202+ mov.l 6f, r10 ! Number of syscalls
203203 cmp/hs r10, r3
204204 bf syscall_call
205205 mov #-ENOSYS, r0
@@ -353,7 +353,7 @@ ENTRY(system_call) · 147 unmodified lines
353353 tst r9, r8
354354 bf syscall_trace_entry
355355 !
356− mov.l 2f, r8 ! Number of syscalls
356+ mov.l 6f, r8 ! Number of syscalls
357357 cmp/hs r8, r3
358358 bt syscall_badsys
359359 !
@@ -392,7 +392,7 @@ syscall_exit: · 32 unmodified lines
392392 #if !defined(CONFIG_CPU_SH2)
393393 1: .long TRA
394394 #endif
395−2: .long NR_syscalls
395+6: .long NR_syscalls
396396 3: .long sys_call_table
397397 7: .long do_syscall_trace_enter
398398 8: .long do_syscall_trace_leave
arch/x86/boot/compressed/Makefile+2−2
@@ -90,8 +90,8 @@ endif · 89 unmodified lines
9090
9191 vmlinux-objs-$(CONFIG_ACPI) += $(obj)/acpi.o
9292
93−vmlinux-objs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
9493 vmlinux-objs-$(CONFIG_EFI_MIXED) += $(obj)/efi_thunk_$(BITS).o
94+efi-obj-$(CONFIG_EFI_STUB) = $(objtree)/drivers/firmware/efi/libstub/lib.a
9595
9696 # The compressed kernel is built with -fPIC/-fPIE so that a boot loader
9797 # can place it anywhere in memory and it will still run. However, since
@@ -115,7 +115,7 @@ endef · 17 unmodified lines
115115 quiet_cmd_check-and-link-vmlinux = LD $@
116116 cmd_check-and-link-vmlinux = $(cmd_check_data_rel); $(cmd_ld)
117117
118−$(obj)/vmlinux: $(vmlinux-objs-y) FORCE
118+$(obj)/vmlinux: $(vmlinux-objs-y) $(efi-obj-y) FORCE
119119 $(call if_changed,check-and-link-vmlinux)
120120
121121 OBJCOPYFLAGS_vmlinux.bin := -R .comment -S
arch/x86/entry/Makefile+11−3
@@ -7,12 +7,20 @@ KASAN_SANITIZE := n · 6 unmodified lines
77 UBSAN_SANITIZE := n
88 KCOV_INSTRUMENT := n
99
10−CFLAGS_REMOVE_common.o = $(CC_FLAGS_FTRACE) -fstack-protector -fstack-protector-strong
11−CFLAGS_REMOVE_syscall_32.o = $(CC_FLAGS_FTRACE) -fstack-protector -fstack-protector-strong
12−CFLAGS_REMOVE_syscall_64.o = $(CC_FLAGS_FTRACE) -fstack-protector -fstack-protector-strong
10+CFLAGS_REMOVE_common.o = $(CC_FLAGS_FTRACE)
11+CFLAGS_REMOVE_syscall_64.o = $(CC_FLAGS_FTRACE)
12+CFLAGS_REMOVE_syscall_32.o = $(CC_FLAGS_FTRACE)
13+CFLAGS_REMOVE_syscall_x32.o = $(CC_FLAGS_FTRACE)
14+
15+CFLAGS_common.o += -fno-stack-protector
16+CFLAGS_syscall_64.o += -fno-stack-protector
17+CFLAGS_syscall_32.o += -fno-stack-protector
18+CFLAGS_syscall_x32.o += -fno-stack-protector
1319
1420 CFLAGS_syscall_64.o += $(call cc-option,-Wno-override-init,)
1521 CFLAGS_syscall_32.o += $(call cc-option,-Wno-override-init,)
22+CFLAGS_syscall_x32.o += $(call cc-option,-Wno-override-init,)
23+
1624 obj-y := entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o
1725 obj-y += common.o
1826
arch/x86/entry/common.c+2−2
@@ -46,7 +46,7 @@ · 45 unmodified lines
4646 #include <trace/events/syscalls.h>
4747
4848 /* Check that the stack and regs on entry from user mode are sane. */
49−static void check_user_regs(struct pt_regs *regs)
49+static noinstr void check_user_regs(struct pt_regs *regs)
5050 {
5151 if (IS_ENABLED(CONFIG_DEBUG_ENTRY)) {
5252 /*
@@ -294,7 +294,7 @@ static void __prepare_exit_to_usermode(struct pt_regs *regs) · 241 unmodified lines
294294 #endif
295295 }
296296
297−__visible noinstr void prepare_exit_to_usermode(struct pt_regs *regs)
297+static noinstr void prepare_exit_to_usermode(struct pt_regs *regs)
298298 {
299299 instrumentation_begin();
300300 __prepare_exit_to_usermode(regs);
arch/x86/include/asm/idtentry.h+10−12
@@ -469,16 +469,15 @@ __visible noinstr void func(struct pt_regs *regs, \ · 468 unmodified lines
469469 .align 8
470470 SYM_CODE_START(irq_entries_start)
471471 vector=FIRST_EXTERNAL_VECTOR
472− pos = .
473472 .rept (FIRST_SYSTEM_VECTOR - FIRST_EXTERNAL_VECTOR)
474473 UNWIND_HINT_IRET_REGS
474+0 :
475475 .byte 0x6a, vector
476476 jmp asm_common_interrupt
477477 nop
478478 /* Ensure that the above is 8 bytes max */
479− . = pos + 8
480− pos=pos+8
481− vector=vector+1
479+ . = 0b + 8
480+ vector = vector+1
482481 .endr
483482 SYM_CODE_END(irq_entries_start)
484483
@@ -486,16 +485,15 @@ SYM_CODE_END(irq_entries_start) · 1 unmodified line
486485 .align 8
487486 SYM_CODE_START(spurious_entries_start)
488487 vector=FIRST_SYSTEM_VECTOR
489− pos = .
490488 .rept (NR_VECTORS - FIRST_SYSTEM_VECTOR)
491489 UNWIND_HINT_IRET_REGS
490+0 :
492491 .byte 0x6a, vector
493492 jmp asm_spurious_interrupt
494493 nop
495494 /* Ensure that the above is 8 bytes max */
496− . = pos + 8
497− pos=pos+8
498− vector=vector+1
495+ . = 0b + 8
496+ vector = vector+1
499497 .endr
500498 SYM_CODE_END(spurious_entries_start)
501499 #endif
@@ -553,7 +551,7 @@ DECLARE_IDTENTRY_RAW(X86_TRAP_MC, exc_machine_check); · 51 unmodified lines
553551
554552 /* NMI */
555553 DECLARE_IDTENTRY_NMI(X86_TRAP_NMI, exc_nmi);
556−#ifdef CONFIG_XEN_PV
554+#if defined(CONFIG_XEN_PV) && defined(CONFIG_X86_64)
557555 DECLARE_IDTENTRY_RAW(X86_TRAP_NMI, xenpv_exc_nmi);
558556 #endif
559557
@@ -563,7 +561,7 @@ DECLARE_IDTENTRY_DEBUG(X86_TRAP_DB, exc_debug); · 3 unmodified lines
563561 #else
564562 DECLARE_IDTENTRY_RAW(X86_TRAP_DB, exc_debug);
565563 #endif
566−#ifdef CONFIG_XEN_PV
564+#if defined(CONFIG_XEN_PV) && defined(CONFIG_X86_64)
567565 DECLARE_IDTENTRY_RAW(X86_TRAP_DB, xenpv_exc_debug);
568566 #endif
569567
@@ -626,8 +624,8 @@ DECLARE_IDTENTRY_SYSVEC(POSTED_INTR_NESTED_VECTOR, sysvec_kvm_posted_intr_nested · 56 unmodified lines
626624
627625 #if IS_ENABLED(CONFIG_HYPERV)
628626 DECLARE_IDTENTRY_SYSVEC(HYPERVISOR_CALLBACK_VECTOR, sysvec_hyperv_callback);
629−DECLARE_IDTENTRY_SYSVEC(HYPERVISOR_REENLIGHTENMENT_VECTOR, sysvec_hyperv_reenlightenment);
630−DECLARE_IDTENTRY_SYSVEC(HYPERVISOR_STIMER0_VECTOR, sysvec_hyperv_stimer0);
627+DECLARE_IDTENTRY_SYSVEC(HYPERV_REENLIGHTENMENT_VECTOR, sysvec_hyperv_reenlightenment);
628+DECLARE_IDTENTRY_SYSVEC(HYPERV_STIMER0_VECTOR, sysvec_hyperv_stimer0);
631629 #endif
632630
633631 #if IS_ENABLED(CONFIG_ACRN_GUEST)
arch/x86/include/asm/io_bitmap.h+16−0
@@ -19,12 +19,28 @@ struct task_struct; · 18 unmodified lines
1919 void io_bitmap_share(struct task_struct *tsk);
2020 void io_bitmap_exit(struct task_struct *tsk);
2121
22+static inline void native_tss_invalidate_io_bitmap(void)
23+{
24+ /*
25+ * Invalidate the I/O bitmap by moving io_bitmap_base outside the
26+ * TSS limit so any subsequent I/O access from user space will
27+ * trigger a #GP.
28+ *
29+ * This is correct even when VMEXIT rewrites the TSS limit
30+ * to 0x67 as the only requirement is that the base points
31+ * outside the limit.
32+ */
33+ this_cpu_write(cpu_tss_rw.x86_tss.io_bitmap_base,
34+ IO_BITMAP_OFFSET_INVALID);
35+}
36+
2237 void native_tss_update_io_bitmap(void);
2338
2439 #ifdef CONFIG_PARAVIRT_XXL
2540 #include <asm/paravirt.h>
2641 #else
2742 #define tss_update_io_bitmap native_tss_update_io_bitmap
43+#define tss_invalidate_io_bitmap native_tss_invalidate_io_bitmap
2844 #endif
2945
3046 #else
arch/x86/include/asm/iosf_mbi.h+1−0
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939 #define BT_MBI_UNIT_PMC 0x04
4040 #define BT_MBI_UNIT_GFX 0x06
4141 #define BT_MBI_UNIT_SMI 0x0C
42+#define BT_MBI_UNIT_CCK 0x14
4243 #define BT_MBI_UNIT_USB 0x43
4344 #define BT_MBI_UNIT_SATA 0xA3
4445 #define BT_MBI_UNIT_PCIE 0xA6
arch/x86/include/asm/paravirt.h+5−0
@@ -302,6 +302,11 @@ static inline void write_idt_entry(gate_desc *dt, int entry, const gate_desc *g) · 301 unmodified lines
302302 }
303303
304304 #ifdef CONFIG_X86_IOPL_IOPERM
305+static inline void tss_invalidate_io_bitmap(void)
306+{
307+ PVOP_VCALL0(cpu.invalidate_io_bitmap);
308+}
309+
305310 static inline void tss_update_io_bitmap(void)
306311 {
307312 PVOP_VCALL0(cpu.update_io_bitmap);
arch/x86/include/asm/paravirt_types.h+1−0
@@ -141,6 +141,7 @@ struct pv_cpu_ops { · 140 unmodified lines
141141 void (*load_sp0)(unsigned long sp0);
142142
143143 #ifdef CONFIG_X86_IOPL_IOPERM
144+ void (*invalidate_io_bitmap)(void);
144145 void (*update_io_bitmap)(void);
145146 #endif
146147
arch/x86/include/uapi/asm/kvm.h+3−2
@@ -408,14 +408,15 @@ struct kvm_vmx_nested_state_data { · 407 unmodified lines
408408 };
409409
410410 struct kvm_vmx_nested_state_hdr {
411− __u32 flags;
412411 __u64 vmxon_pa;
413412 __u64 vmcs12_pa;
414− __u64 preemption_timer_deadline;
415413
416414 struct {
417415 __u16 flags;
418416 } smm;
417+
418+ __u32 flags;
419+ __u64 preemption_timer_deadline;
419420 };
420421
421422 struct kvm_svm_nested_state_data {
arch/x86/kernel/apic/io_apic.c+5−5
@@ -2316,12 +2316,12 @@ static int mp_irqdomain_create(int ioapic) · 2315 unmodified lines
23162316 ip->irqdomain = irq_domain_create_linear(fn, hwirqs, cfg->ops,
23172317 (void *)(long)ioapic);
23182318
2319− /* Release fw handle if it was allocated above */
2320− if (!cfg->dev)
2321− irq_domain_free_fwnode(fn);
2322−
2323− if (!ip->irqdomain)
2319+ if (!ip->irqdomain) {
2320+ /* Release fw handle if it was allocated above */
2321+ if (!cfg->dev)
2322+ irq_domain_free_fwnode(fn);
23242323 return -ENOMEM;
2324+ }
23252325
23262326 ip->irqdomain->parent = parent;
23272327
arch/x86/kernel/apic/msi.c+12−6
@@ -263,12 +263,13 @@ void __init arch_init_msi_domain(struct irq_domain *parent) · 262 unmodified lines
263263 msi_default_domain =
264264 pci_msi_create_irq_domain(fn, &pci_msi_domain_info,
265265 parent);
266− irq_domain_free_fwnode(fn);
267266 }
268− if (!msi_default_domain)
267+ if (!msi_default_domain) {
268+ irq_domain_free_fwnode(fn);
269269 pr_warn("failed to initialize irqdomain for MSI/MSI-x.\n");
270− else
270+ } else {
271271 msi_default_domain->flags |= IRQ_DOMAIN_MSI_NOMASK_QUIRK;
272+ }
272273 }
273274
274275 #ifdef CONFIG_IRQ_REMAP
@@ -301,7 +302,8 @@ struct irq_domain *arch_create_remap_msi_irq_domain(struct irq_domain *parent, · 26 unmodified lines
301302 if (!fn)
302303 return NULL;
303304 d = pci_msi_create_irq_domain(fn, &pci_msi_ir_domain_info, parent);
304− irq_domain_free_fwnode(fn);
305+ if (!d)
306+ irq_domain_free_fwnode(fn);
305307 return d;
306308 }
307309 #endif
@@ -364,7 +366,8 @@ static struct irq_domain *dmar_get_irq_domain(void) · 56 unmodified lines
364366 if (fn) {
365367 dmar_domain = msi_create_irq_domain(fn, &dmar_msi_domain_info,
366368 x86_vector_domain);
367− irq_domain_free_fwnode(fn);
369+ if (!dmar_domain)
370+ irq_domain_free_fwnode(fn);
368371 }
369372 out:
370373 mutex_unlock(&dmar_lock);
@@ -489,7 +492,10 @@ struct irq_domain *hpet_create_irq_domain(int hpet_id) · 118 unmodified lines
489492 }
490493
491494 d = msi_create_irq_domain(fn, domain_info, parent);
492− irq_domain_free_fwnode(fn);
495+ if (!d) {
496+ irq_domain_free_fwnode(fn);
497+ kfree(domain_info);
498+ }
493499 return d;
494500 }
495501
arch/x86/kernel/apic/vector.c+5−18
@@ -446,12 +446,10 @@ static int x86_vector_activate(struct irq_domain *dom, struct irq_data *irqd, · 445 unmodified lines
446446 trace_vector_activate(irqd->irq, apicd->is_managed,
447447 apicd->can_reserve, reserve);
448448
449− /* Nothing to do for fixed assigned vectors */
450− if (!apicd->can_reserve && !apicd->is_managed)
451− return 0;
452−
453449 raw_spin_lock_irqsave(&vector_lock, flags);
454− if (reserve || irqd_is_managed_and_shutdown(irqd))
450+ if (!apicd->can_reserve && !apicd->is_managed)
451+ assign_irq_vector_any_locked(irqd);
452+ else if (reserve || irqd_is_managed_and_shutdown(irqd))
455453 vector_assign_managed_shutdown(irqd);
456454 else if (apicd->is_managed)
457455 ret = activate_managed(irqd);
@@ -709,7 +707,6 @@ int __init arch_early_irq_init(void) · 251 unmodified lines
709707 x86_vector_domain = irq_domain_create_tree(fn, &x86_vector_domain_ops,
710708 NULL);
711709 BUG_ON(x86_vector_domain == NULL);
712− irq_domain_free_fwnode(fn);
713710 irq_set_default_host(x86_vector_domain);
714711
715712 arch_init_msi_domain(x86_vector_domain);
@@ -775,20 +772,10 @@ void lapic_offline(void) · 59 unmodified lines
775772 static int apic_set_affinity(struct irq_data *irqd,
776773 const struct cpumask *dest, bool force)
777774 {
778− struct apic_chip_data *apicd = apic_chip_data(irqd);
779775 int err;
780776
781− /*
782− * Core code can call here for inactive interrupts. For inactive
783− * interrupts which use managed or reservation mode there is no
784− * point in going through the vector assignment right now as the
785− * activation will assign a vector which fits the destination
786− * cpumask. Let the core code store the destination mask and be
787− * done with it.
788− */
789− if (!irqd_is_activated(irqd) &&
790− (apicd->is_managed || apicd->can_reserve))
791− return IRQ_SET_MASK_OK;
777+ if (WARN_ON_ONCE(!irqd_is_activated(irqd)))
778+ return -EIO;
792779
793780 raw_spin_lock(&vector_lock);
794781 cpumask_and(vector_searchmask, dest, cpu_online_mask);
arch/x86/kernel/dumpstack.c+17−10
@@ -71,6 +71,22 @@ static void printk_stack_address(unsigned long address, int reliable, · 70 unmodified lines
7171 printk("%s %s%pB\n", log_lvl, reliable ? "" : "? ", (void *)address);
7272 }
7373
74+static int copy_code(struct pt_regs *regs, u8 *buf, unsigned long src,
75+ unsigned int nbytes)
76+{
77+ if (!user_mode(regs))
78+ return copy_from_kernel_nofault(buf, (u8 *)src, nbytes);
79+
80+ /*
81+ * Make sure userspace isn't trying to trick us into dumping kernel
82+ * memory by pointing the userspace instruction pointer at it.
83+ */
84+ if (__chk_range_not_ok(src, nbytes, TASK_SIZE_MAX))
85+ return -EINVAL;
86+
87+ return copy_from_user_nmi(buf, (void __user *)src, nbytes);
88+}
89+
7490 /*
7591 * There are a couple of reasons for the 2/3rd prologue, courtesy of Linus:
7692 *
@@ -97,17 +113,8 @@ void show_opcodes(struct pt_regs *regs, const char *loglvl) · 20 unmodified lines
97113 #define OPCODE_BUFSIZE (PROLOGUE_SIZE + 1 + EPILOGUE_SIZE)
98114 u8 opcodes[OPCODE_BUFSIZE];
99115 unsigned long prologue = regs->ip - PROLOGUE_SIZE;
100− bool bad_ip;
101−
102− /*
103− * Make sure userspace isn't trying to trick us into dumping kernel
104− * memory by pointing the userspace instruction pointer at it.
105− */
106− bad_ip = user_mode(regs) &&
107− __chk_range_not_ok(prologue, OPCODE_BUFSIZE, TASK_SIZE_MAX);
108116
109− if (bad_ip || copy_from_kernel_nofault(opcodes, (u8 *)prologue,
110− OPCODE_BUFSIZE)) {
117+ if (copy_code(regs, opcodes, prologue, sizeof(opcodes))) {
111118 printk("%sCode: Bad RIP value.\n", loglvl);
112119 } else {
113120 printk("%sCode: %" __stringify(PROLOGUE_SIZE) "ph <%02x> %"
arch/x86/kernel/fpu/xstate.c+1−1
@@ -1074,7 +1074,7 @@ int copy_xstate_to_kernel(void *kbuf, struct xregs_state *xsave, unsigned int of · 1073 unmodified lines
10741074 copy_part(offsetof(struct fxregs_state, st_space), 128,
10751075 &xsave->i387.st_space, &kbuf, &offset_start, &count);
10761076 if (header.xfeatures & XFEATURE_MASK_SSE)
1077− copy_part(xstate_offsets[XFEATURE_MASK_SSE], 256,
1077+ copy_part(xstate_offsets[XFEATURE_SSE], 256,
10781078 &xsave->i387.xmm_space, &kbuf, &offset_start, &count);
10791079 /*
10801080 * Fill xsave->i387.sw_reserved value for ptrace frame:
arch/x86/kernel/i8259.c+1−1
@@ -207,7 +207,7 @@ spurious_8259A_irq: · 206 unmodified lines
207207 * lets ACK and report it. [once per IRQ]
208208 */
209209 if (!(spurious_irq_mask & irqmask)) {
210− printk(KERN_DEBUG
210+ printk_deferred(KERN_DEBUG
211211 "spurious 8259A interrupt: IRQ%d.\n", irq);
212212 spurious_irq_mask |= irqmask;
213213 }
arch/x86/kernel/paravirt.c+2−1
@@ -324,7 +324,8 @@ struct paravirt_patch_template pv_ops = { · 323 unmodified lines
324324 .cpu.swapgs = native_swapgs,
325325
326326 #ifdef CONFIG_X86_IOPL_IOPERM
327− .cpu.update_io_bitmap = native_tss_update_io_bitmap,
327+ .cpu.invalidate_io_bitmap = native_tss_invalidate_io_bitmap,
328+ .cpu.update_io_bitmap = native_tss_update_io_bitmap,
328329 #endif
329330
330331 .cpu.start_context_switch = paravirt_nop,
arch/x86/kernel/process.c+2−16
@@ -322,20 +322,6 @@ void arch_setup_new_exec(void) · 321 unmodified lines
322322 }
323323
324324 #ifdef CONFIG_X86_IOPL_IOPERM
325−static inline void tss_invalidate_io_bitmap(struct tss_struct *tss)
326−{
327− /*
328− * Invalidate the I/O bitmap by moving io_bitmap_base outside the
329− * TSS limit so any subsequent I/O access from user space will
330− * trigger a #GP.
331− *
332− * This is correct even when VMEXIT rewrites the TSS limit
333− * to 0x67 as the only requirement is that the base points
334− * outside the limit.
335− */
336− tss->x86_tss.io_bitmap_base = IO_BITMAP_OFFSET_INVALID;
337−}
338−
339325 static inline void switch_to_bitmap(unsigned long tifp)
340326 {
341327 /*
@@ -346,7 +332,7 @@ static inline void switch_to_bitmap(unsigned long tifp) · 4 unmodified lines
346332 * user mode.
347333 */
348334 if (tifp & _TIF_IO_BITMAP)
349− tss_invalidate_io_bitmap(this_cpu_ptr(&cpu_tss_rw));
335+ tss_invalidate_io_bitmap();
350336 }
351337
352338 static void tss_copy_io_bitmap(struct tss_struct *tss, struct io_bitmap *iobm)
@@ -380,7 +366,7 @@ void native_tss_update_io_bitmap(void) · 27 unmodified lines
380366 u16 *base = &tss->x86_tss.io_bitmap_base;
381367
382368 if (!test_thread_flag(TIF_IO_BITMAP)) {
383− tss_invalidate_io_bitmap(tss);
369+ native_tss_invalidate_io_bitmap();
384370 return;
385371 }
386372
arch/x86/kernel/stacktrace.c+0−5
@@ -58,7 +58,6 @@ int arch_stack_walk_reliable(stack_trace_consume_fn consume_entry, · 57 unmodified lines
5858 * or a page fault), which can make frame pointers
5959 * unreliable.
6060 */
61−
6261 if (IS_ENABLED(CONFIG_FRAME_POINTER))
6362 return -EINVAL;
6463 }
@@ -81,10 +80,6 @@ int arch_stack_walk_reliable(stack_trace_consume_fn consume_entry, · 16 unmodified lines
8180 if (unwind_error(&state))
8281 return -EINVAL;
8382
84− /* Success path for non-user tasks, i.e. kthreads and idle tasks */
85− if (!(task->flags & (PF_KTHREAD | PF_IDLE)))
86− return -EINVAL;
87−
8883 return 0;
8984 }
9085
arch/x86/kernel/traps.c+2−0
@@ -303,6 +303,8 @@ DEFINE_IDTENTRY_ERRORCODE(exc_alignment_check) · 302 unmodified lines
303303
304304 do_trap(X86_TRAP_AC, SIGBUS, "alignment check", regs,
305305 error_code, BUS_ADRALN, NULL);
306+
307+ local_irq_disable();
306308 }
307309
308310 #ifdef CONFIG_VMAP_STACK
arch/x86/kernel/unwind_orc.c+6−2
@@ -440,8 +440,11 @@ bool unwind_next_frame(struct unwind_state *state) · 439 unmodified lines
440440 /*
441441 * Find the orc_entry associated with the text address.
442442 *
443− * Decrement call return addresses by one so they work for sibling
444− * calls and calls to noreturn functions.
443+ * For a call frame (as opposed to a signal frame), state->ip points to
444+ * the instruction after the call. That instruction's stack layout
445+ * could be different from the call instruction's layout, for example
446+ * if the call was to a noreturn function. So get the ORC data for the
447+ * call instruction itself.
445448 */
446449 orc = orc_find(state->signal ? state->ip : state->ip - 1);
447450 if (!orc) {
@@ -662,6 +665,7 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task, · 214 unmodified lines
662665 state->sp = task->thread.sp;
663666 state->bp = READ_ONCE_NOCHECK(frame->bp);
664667 state->ip = READ_ONCE_NOCHECK(frame->ret_addr);
668+ state->signal = (void *)state->ip == ret_from_fork;
665669 }
666670
667671 if (get_stack_info((unsigned long *)state->sp, state->task,
arch/x86/kernel/vmlinux.lds.S+1−0
@@ -358,6 +358,7 @@ SECTIONS · 357 unmodified lines
358358 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
359359 __bss_start = .;
360360 *(.bss..page_aligned)
361+ . = ALIGN(PAGE_SIZE);
361362 *(BSS_MAIN)
362363 BSS_DECRYPTED
363364 . = ALIGN(PAGE_SIZE);
arch/x86/kvm/lapic.c+1−1
@@ -2195,7 +2195,7 @@ void kvm_set_lapic_tscdeadline_msr(struct kvm_vcpu *vcpu, u64 data) · 2194 unmodified lines
21952195 {
21962196 struct kvm_lapic *apic = vcpu->arch.apic;
21972197
2198− if (!lapic_in_kernel(vcpu) || apic_lvtt_oneshot(apic) ||
2198+ if (!kvm_apic_present(vcpu) || apic_lvtt_oneshot(apic) ||
21992199 apic_lvtt_period(apic))
22002200 return;
22012201
arch/x86/kvm/svm/svm.c+6−3
@@ -1090,7 +1090,7 @@ static void init_vmcb(struct vcpu_svm *svm) · 1089 unmodified lines
10901090 svm->nested.vmcb = 0;
10911091 svm->vcpu.arch.hflags = 0;
10921092
1093− if (pause_filter_count) {
1093+ if (!kvm_pause_in_guest(svm->vcpu.kvm)) {
10941094 control->pause_filter_count = pause_filter_count;
10951095 if (pause_filter_thresh)
10961096 control->pause_filter_thresh = pause_filter_thresh;
@@ -2693,7 +2693,7 @@ static int pause_interception(struct vcpu_svm *svm) · 1596 unmodified lines
26932693 struct kvm_vcpu *vcpu = &svm->vcpu;
26942694 bool in_kernel = (svm_get_cpl(vcpu) == 0);
26952695
2696− if (pause_filter_thresh)
2696+ if (!kvm_pause_in_guest(vcpu->kvm))
26972697 grow_ple_window(vcpu);
26982698
26992699 kvm_vcpu_on_spin(vcpu, in_kernel);
@@ -3780,7 +3780,7 @@ static void svm_handle_exit_irqoff(struct kvm_vcpu *vcpu) · 1080 unmodified lines
37803780
37813781 static void svm_sched_in(struct kvm_vcpu *vcpu, int cpu)
37823782 {
3783− if (pause_filter_thresh)
3783+ if (!kvm_pause_in_guest(vcpu->kvm))
37843784 shrink_ple_window(vcpu);
37853785 }
37863786
@@ -3958,6 +3958,9 @@ static void svm_vm_destroy(struct kvm *kvm) · 171 unmodified lines
39583958
39593959 static int svm_vm_init(struct kvm *kvm)
39603960 {
3961+ if (!pause_filter_count || !pause_filter_thresh)
3962+ kvm->arch.pause_in_guest = true;
3963+
39613964 if (avic) {
39623965 int ret = avic_vm_init(kvm);
39633966 if (ret)
arch/x86/kvm/vmx/nested.c+14−3
@@ -6079,6 +6079,9 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu, · 6078 unmodified lines
60796079 ~(KVM_STATE_NESTED_SMM_GUEST_MODE | KVM_STATE_NESTED_SMM_VMXON))
60806080 return -EINVAL;
60816081
6082+ if (kvm_state->hdr.vmx.flags & ~KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE)
6083+ return -EINVAL;
6084+
60826085 /*
60836086 * SMM temporarily disables VMX, so we cannot be in guest mode,
60846087 * nor can VMLAUNCH/VMRESUME be pending. Outside SMM, SMM flags
@@ -6108,9 +6111,16 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu, · 23 unmodified lines
61086111 if (ret)
61096112 return ret;
61106113
6111− /* Empty 'VMXON' state is permitted */
6112− if (kvm_state->size < sizeof(*kvm_state) + sizeof(*vmcs12))
6113− return 0;
6114+ /* Empty 'VMXON' state is permitted if no VMCS loaded */
6115+ if (kvm_state->size < sizeof(*kvm_state) + sizeof(*vmcs12)) {
6116+ /* See vmx_has_valid_vmcs12. */
6117+ if ((kvm_state->flags & KVM_STATE_NESTED_GUEST_MODE) ||
6118+ (kvm_state->flags & KVM_STATE_NESTED_EVMCS) ||
6119+ (kvm_state->hdr.vmx.vmcs12_pa != -1ull))
6120+ return -EINVAL;
6121+ else
6122+ return 0;
6123+ }
61146124
61156125 if (kvm_state->hdr.vmx.vmcs12_pa != -1ull) {
61166126 if (kvm_state->hdr.vmx.vmcs12_pa == kvm_state->hdr.vmx.vmxon_pa ||
@@ -6176,6 +6186,7 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu, · 59 unmodified lines
61766186 goto error_guest_mode;
61776187 }
61786188
6189+ vmx->nested.has_preemption_timer_deadline = false;
61796190 if (kvm_state->hdr.vmx.flags & KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE) {
61806191 vmx->nested.has_preemption_timer_deadline = true;
61816192 vmx->nested.preemption_timer_deadline =
arch/x86/kvm/vmx/nested.h+5−0
@@ -47,6 +47,11 @@ static inline struct vmcs12 *get_shadow_vmcs12(struct kvm_vcpu *vcpu) · 46 unmodified lines
4747 return to_vmx(vcpu)->nested.cached_shadow_vmcs12;
4848 }
4949
50+/*
51+ * Note: the same condition is checked against the state provided by userspace
52+ * in vmx_set_nested_state; if it is satisfied, the nested state must include
53+ * the VMCS12.
54+ */
5055 static inline int vmx_has_valid_vmcs12(struct kvm_vcpu *vcpu)
5156 {
5257 struct vcpu_vmx *vmx = to_vmx(vcpu);
arch/x86/math-emu/wm_sqrt.S+1−1
@@ -209,7 +209,7 @@ sqrt_stage_2_finish: · 208 unmodified lines
209209
210210 #ifdef PARANOID
211211 /* It should be possible to get here only if the arg is ffff....ffff */
212− cmp $0xffffffff,FPU_fsqrt_arg_1
212+ cmpl $0xffffffff,FPU_fsqrt_arg_1
213213 jnz sqrt_stage_2_error
214214 #endif /* PARANOID */
215215
arch/x86/platform/uv/uv_irq.c+2−1
@@ -167,9 +167,10 @@ static struct irq_domain *uv_get_irq_domain(void) · 166 unmodified lines
167167 goto out;
168168
169169 uv_domain = irq_domain_create_tree(fn, &uv_domain_ops, NULL);
170− irq_domain_free_fwnode(fn);
171170 if (uv_domain)
172171 uv_domain->parent = x86_vector_domain;
172+ else
173+ irq_domain_free_fwnode(fn);
173174 out:
174175 mutex_unlock(&uv_lock);
175176
arch/x86/xen/enlighten_pv.c+12−0
@@ -870,6 +870,17 @@ static void xen_load_sp0(unsigned long sp0) · 869 unmodified lines
870870 }
871871
872872 #ifdef CONFIG_X86_IOPL_IOPERM
873+static void xen_invalidate_io_bitmap(void)
874+{
875+ struct physdev_set_iobitmap iobitmap = {
876+ .bitmap = 0,
877+ .nr_ports = 0,
878+ };
879+
880+ native_tss_invalidate_io_bitmap();
881+ HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap, &iobitmap);
882+}
883+
873884 static void xen_update_io_bitmap(void)
874885 {
875886 struct physdev_set_iobitmap iobitmap;
@@ -1099,6 +1110,7 @@ static const struct pv_cpu_ops xen_cpu_ops __initconst = { · 223 unmodified lines
10991110 .load_sp0 = xen_load_sp0,
11001111
11011112 #ifdef CONFIG_X86_IOPL_IOPERM
1113+ .invalidate_io_bitmap = xen_invalidate_io_bitmap,
11021114 .update_io_bitmap = xen_update_io_bitmap,
11031115 #endif
11041116 .io_delay = xen_io_delay,
arch/xtensa/include/asm/checksum.h+1−1
@@ -57,7 +57,7 @@ static inline · 56 unmodified lines
5757 __wsum csum_and_copy_from_user(const void __user *src, void *dst,
5858 int len, __wsum sum, int *err_ptr)
5959 {
60− if (access_ok(dst, len))
60+ if (access_ok(src, len))
6161 return csum_partial_copy_generic((__force const void *)src, dst,
6262 len, sum, err_ptr, NULL);
6363 if (len)
arch/xtensa/kernel/perf_event.c+1−3
@@ -362,9 +362,7 @@ irqreturn_t xtensa_pmu_irq_handler(int irq, void *dev_id) · 361 unmodified lines
362362 struct xtensa_pmu_events *ev = this_cpu_ptr(&xtensa_pmu_events);
363363 unsigned i;
364364
365− for (i = find_first_bit(ev->used_mask, XCHAL_NUM_PERF_COUNTERS);
366− i < XCHAL_NUM_PERF_COUNTERS;
367− i = find_next_bit(ev->used_mask, XCHAL_NUM_PERF_COUNTERS, i + 1)) {
365+ for_each_set_bit(i, ev->used_mask, XCHAL_NUM_PERF_COUNTERS) {
368366 uint32_t v = get_er(XTENSA_PMU_PMSTAT(i));
369367 struct perf_event *event = ev->event[i];
370368 struct hw_perf_event *hwc = &event->hw;
arch/xtensa/kernel/setup.c+2−1
@@ -724,7 +724,8 @@ c_start(struct seq_file *f, loff_t *pos) · 723 unmodified lines
724724 static void *
725725 c_next(struct seq_file *f, void *v, loff_t *pos)
726726 {
727− return NULL;
727+ ++*pos;
728+ return c_start(f, pos);
728729 }
729730
730731 static void
arch/xtensa/kernel/xtensa_ksyms.c+2−2
@@ -87,13 +87,13 @@ void __xtensa_libgcc_window_spill(void) · 86 unmodified lines
8787 }
8888 EXPORT_SYMBOL(__xtensa_libgcc_window_spill);
8989
90−unsigned long __sync_fetch_and_and_4(unsigned long *p, unsigned long v)
90+unsigned int __sync_fetch_and_and_4(volatile void *p, unsigned int v)
9191 {
9292 BUG();
9393 }
9494 EXPORT_SYMBOL(__sync_fetch_and_and_4);
9595
96−unsigned long __sync_fetch_and_or_4(unsigned long *p, unsigned long v)
96+unsigned int __sync_fetch_and_or_4(volatile void *p, unsigned int v)
9797 {
9898 BUG();
9999 }
block/blk-mq.c+2−2
@@ -828,10 +828,10 @@ static bool blk_mq_rq_inflight(struct blk_mq_hw_ctx *hctx, struct request *rq, · 827 unmodified lines
828828 void *priv, bool reserved)
829829 {
830830 /*
831− * If we find a request that is inflight and the queue matches,
831+ * If we find a request that isn't idle and the queue matches,
832832 * we know the queue is busy. Return false to stop the iteration.
833833 */
834− if (rq->state == MQ_RQ_IN_FLIGHT && rq->q == hctx->queue) {
834+ if (blk_mq_request_started(rq) && rq->q == hctx->queue) {
835835 bool *busy = priv;
836836
837837 *busy = true;
crypto/asymmetric_keys/public_key.c+1−0
@@ -119,6 +119,7 @@ static int software_key_query(const struct kernel_pkey_params *params, · 118 unmodified lines
119119 if (IS_ERR(tfm))
120120 return PTR_ERR(tfm);
121121
122+ ret = -ENOMEM;
122123 key = kmalloc(pkey->keylen + sizeof(u32) * 2 + pkey->paramlen,
123124 GFP_KERNEL);
124125 if (!key)
drivers/android/binder_alloc.c+1−1
@@ -947,7 +947,7 @@ enum lru_status binder_alloc_free_page(struct list_head *item, · 946 unmodified lines
947947 trace_binder_unmap_user_end(alloc, index);
948948 }
949949 mmap_read_unlock(mm);
950− mmput(mm);
950+ mmput_async(mm);
951951
952952 trace_binder_unmap_kernel_start(alloc, index);
953953
drivers/atm/atmtcp.c+8−2
@@ -433,9 +433,15 @@ static int atmtcp_remove_persistent(int itf) · 432 unmodified lines
433433 return -EMEDIUMTYPE;
434434 }
435435 dev_data = PRIV(dev);
436− if (!dev_data->persist) return 0;
436+ if (!dev_data->persist) {
437+ atm_dev_put(dev);
438+ return 0;
439+ }
437440 dev_data->persist = 0;
438− if (PRIV(dev)->vcc) return 0;
441+ if (PRIV(dev)->vcc) {
442+ atm_dev_put(dev);
443+ return 0;
444+ }
439445 kfree(dev_data);
440446 atm_dev_put(dev);
441447 atm_dev_deregister(dev);
drivers/base/base.h+0−1
@@ -153,7 +153,6 @@ extern char *make_class_name(const char *name, struct kobject *kobj); · 152 unmodified lines
153153 extern int devres_release_all(struct device *dev);
154154 extern void device_block_probing(void);
155155 extern void device_unblock_probing(void);
156−extern void driver_deferred_probe_force_trigger(void);
157156
158157 /* /sys/devices directory */
159158 extern struct kset *devices_kset;
drivers/base/core.c+32−12
@@ -50,6 +50,7 @@ static DEFINE_MUTEX(wfs_lock); · 49 unmodified lines
5050 static LIST_HEAD(deferred_sync);
5151 static unsigned int defer_sync_state_count = 1;
5252 static unsigned int defer_fw_devlink_count;
53+static LIST_HEAD(deferred_fw_devlink);
5354 static DEFINE_MUTEX(defer_fw_devlink_lock);
5455 static bool fw_devlink_is_permissive(void);
5556
@@ -754,11 +755,11 @@ static void __device_links_queue_sync_state(struct device *dev, · 698 unmodified lines
754755 */
755756 dev->state_synced = true;
756757
757− if (WARN_ON(!list_empty(&dev->links.defer_sync)))
758+ if (WARN_ON(!list_empty(&dev->links.defer_hook)))
758759 return;
759760
760761 get_device(dev);
761− list_add_tail(&dev->links.defer_sync, list);
762+ list_add_tail(&dev->links.defer_hook, list);
762763 }
763764
764765 /**
@@ -776,8 +777,8 @@ static void device_links_flush_sync_list(struct list_head *list, · 11 unmodified lines
776777 {
777778 struct device *dev, *tmp;
778779
779− list_for_each_entry_safe(dev, tmp, list, links.defer_sync) {
780− list_del_init(&dev->links.defer_sync);
780+ list_for_each_entry_safe(dev, tmp, list, links.defer_hook) {
781+ list_del_init(&dev->links.defer_hook);
781782
782783 if (dev != dont_lock_dev)
783784 device_lock(dev);
@@ -815,12 +816,12 @@ void device_links_supplier_sync_state_resume(void) · 31 unmodified lines
815816 if (defer_sync_state_count)
816817 goto out;
817818
818− list_for_each_entry_safe(dev, tmp, &deferred_sync, links.defer_sync) {
819+ list_for_each_entry_safe(dev, tmp, &deferred_sync, links.defer_hook) {
819820 /*
820821 * Delete from deferred_sync list before queuing it to
821− * sync_list because defer_sync is used for both lists.
822+ * sync_list because defer_hook is used for both lists.
822823 */
823− list_del_init(&dev->links.defer_sync);
824+ list_del_init(&dev->links.defer_hook);
824825 __device_links_queue_sync_state(dev, &sync_list);
825826 }
826827 out:
@@ -838,8 +839,8 @@ late_initcall(sync_state_resume_initcall); · 11 unmodified lines
838839
839840 static void __device_links_supplier_defer_sync(struct device *sup)
840841 {
841− if (list_empty(&sup->links.defer_sync) && dev_has_sync_state(sup))
842− list_add_tail(&sup->links.defer_sync, &deferred_sync);
842+ if (list_empty(&sup->links.defer_hook) && dev_has_sync_state(sup))
843+ list_add_tail(&sup->links.defer_hook, &deferred_sync);
843844 }
844845
845846 static void device_link_drop_managed(struct device_link *link)
@@ -1052,7 +1053,7 @@ void device_links_driver_cleanup(struct device *dev) · 206 unmodified lines
10521053 WRITE_ONCE(link->status, DL_STATE_DORMANT);
10531054 }
10541055
1055− list_del_init(&dev->links.defer_sync);
1056+ list_del_init(&dev->links.defer_hook);
10561057 __device_links_no_driver(dev);
10571058
10581059 device_links_write_unlock();
@@ -1244,6 +1245,12 @@ static void fw_devlink_link_device(struct device *dev) · 185 unmodified lines
12441245 fw_ret = -EAGAIN;
12451246 } else {
12461247 fw_ret = -ENODEV;
1248+ /*
1249+ * defer_hook is not used to add device to deferred_sync list
1250+ * until device is bound. Since deferred fw devlink also blocks
1251+ * probing, same list hook can be used for deferred_fw_devlink.
1252+ */
1253+ list_add_tail(&dev->links.defer_hook, &deferred_fw_devlink);
12471254 }
12481255
12491256 if (fw_ret == -ENODEV)
@@ -1312,6 +1319,9 @@ void fw_devlink_pause(void) · 62 unmodified lines
13121319 */
13131320 void fw_devlink_resume(void)
13141321 {
1322+ struct device *dev, *tmp;
1323+ LIST_HEAD(probe_list);
1324+
13151325 mutex_lock(&defer_fw_devlink_lock);
13161326 if (!defer_fw_devlink_count) {
13171327 WARN(true, "Unmatched fw_devlink pause/resume!");
@@ -1323,9 +1333,19 @@ void fw_devlink_resume(void) · 5 unmodified lines
13231333 goto out;
13241334
13251335 device_link_add_missing_supplier_links();
1326− driver_deferred_probe_force_trigger();
1336+ list_splice_tail_init(&deferred_fw_devlink, &probe_list);
13271337 out:
13281338 mutex_unlock(&defer_fw_devlink_lock);
1339+
1340+ /*
1341+ * bus_probe_device() can cause new devices to get added and they'll
1342+ * try to grab defer_fw_devlink_lock. So, this needs to be done outside
1343+ * the defer_fw_devlink_lock.
1344+ */
1345+ list_for_each_entry_safe(dev, tmp, &probe_list, links.defer_hook) {
1346+ list_del_init(&dev->links.defer_hook);
1347+ bus_probe_device(dev);
1348+ }
13291349 }
13301350 /* Device links support end. */
13311351
@@ -2172,7 +2192,7 @@ void device_initialize(struct device *dev) · 840 unmodified lines
21722192 INIT_LIST_HEAD(&dev->links.consumers);
21732193 INIT_LIST_HEAD(&dev->links.suppliers);
21742194 INIT_LIST_HEAD(&dev->links.needs_suppliers);
2175− INIT_LIST_HEAD(&dev->links.defer_sync);
2195+ INIT_LIST_HEAD(&dev->links.defer_hook);
21762196 dev->links.status = DL_DEV_NO_DRIVER;
21772197 }
21782198 EXPORT_SYMBOL_GPL(device_initialize);
drivers/base/dd.c+0−5
@@ -164,11 +164,6 @@ static void driver_deferred_probe_trigger(void) · 163 unmodified lines
164164 if (!driver_deferred_probe_enable)
165165 return;
166166
167− driver_deferred_probe_force_trigger();
168−}
169−
170−void driver_deferred_probe_force_trigger(void)
171−{
172167 /*
173168 * A successful probe means that all the devices in the pending list
174169 * should be triggered to be reprobed. Move all the deferred devices
drivers/base/property.c+1−1
@@ -721,7 +721,7 @@ struct fwnode_handle *device_get_next_child_node(struct device *dev, · 720 unmodified lines
721721 return next;
722722
723723 /* When no more children in primary, continue with secondary */
724− if (!IS_ERR_OR_NULL(fwnode->secondary))
724+ if (fwnode && !IS_ERR_OR_NULL(fwnode->secondary))
725725 next = fwnode_get_next_child_node(fwnode->secondary, child);
726726
727727 return next;
drivers/base/regmap/Kconfig+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 # subsystems should select the appropriate symbols.
55
66 config REGMAP
7− default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ || REGMAP_SCCB || REGMAP_I3C)
7+ default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ || REGMAP_SOUNDWIRE || REGMAP_SCCB || REGMAP_I3C)
88 select IRQ_DOMAIN if REGMAP_IRQ
99 bool
1010
drivers/base/regmap/regmap-debugfs.c+29−23
@@ -463,29 +463,31 @@ static ssize_t regmap_cache_only_write_file(struct file *file, · 462 unmodified lines
463463 {
464464 struct regmap *map = container_of(file->private_data,
465465 struct regmap, cache_only);
466− ssize_t result;
467− bool was_enabled, require_sync = false;
466+ bool new_val, require_sync = false;
468467 int err;
469468
470− map->lock(map->lock_arg);
469+ err = kstrtobool_from_user(user_buf, count, &new_val);
470+ /* Ignore malforned data like debugfs_write_file_bool() */
471+ if (err)
472+ return count;
471473
472− was_enabled = map->cache_only;
474+ err = debugfs_file_get(file->f_path.dentry);
475+ if (err)
476+ return err;
473477
474− result = debugfs_write_file_bool(file, user_buf, count, ppos);
475− if (result < 0) {
476− map->unlock(map->lock_arg);
477− return result;
478− }
478+ map->lock(map->lock_arg);
479479
480− if (map->cache_only && !was_enabled) {
480+ if (new_val && !map->cache_only) {
481481 dev_warn(map->dev, "debugfs cache_only=Y forced\n");
482482 add_taint(TAINT_USER, LOCKDEP_STILL_OK);
483− } else if (!map->cache_only && was_enabled) {
483+ } else if (!new_val && map->cache_only) {
484484 dev_warn(map->dev, "debugfs cache_only=N forced: syncing cache\n");
485485 require_sync = true;
486486 }
487+ map->cache_only = new_val;
487488
488489 map->unlock(map->lock_arg);
490+ debugfs_file_put(file->f_path.dentry);
489491
490492 if (require_sync) {
491493 err = regcache_sync(map);
@@ -493,7 +495,7 @@ static ssize_t regmap_cache_only_write_file(struct file *file, · 1 unmodified line
493495 dev_err(map->dev, "Failed to sync cache %d\n", err);
494496 }
495497
496− return result;
498+ return count;
497499 }
498500
499501 static const struct file_operations regmap_cache_only_fops = {
@@ -508,28 +510,32 @@ static ssize_t regmap_cache_bypass_write_file(struct file *file, · 8 unmodified lines
508510 {
509511 struct regmap *map = container_of(file->private_data,
510512 struct regmap, cache_bypass);
511− ssize_t result;
512− bool was_enabled;
513+ bool new_val;
514+ int err;
513515
514− map->lock(map->lock_arg);
516+ err = kstrtobool_from_user(user_buf, count, &new_val);
517+ /* Ignore malforned data like debugfs_write_file_bool() */
518+ if (err)
519+ return count;
515520
516− was_enabled = map->cache_bypass;
521+ err = debugfs_file_get(file->f_path.dentry);
522+ if (err)
523+ return err;
517524
518− result = debugfs_write_file_bool(file, user_buf, count, ppos);
519− if (result < 0)
520− goto out;
525+ map->lock(map->lock_arg);
521526
522− if (map->cache_bypass && !was_enabled) {
527+ if (new_val && !map->cache_bypass) {
523528 dev_warn(map->dev, "debugfs cache_bypass=Y forced\n");
524529 add_taint(TAINT_USER, LOCKDEP_STILL_OK);
525− } else if (!map->cache_bypass && was_enabled) {
530+ } else if (!new_val && map->cache_bypass) {
526531 dev_warn(map->dev, "debugfs cache_bypass=N forced\n");
527532 }
533+ map->cache_bypass = new_val;
528534
529−out:
530535 map->unlock(map->lock_arg);
536+ debugfs_file_put(file->f_path.dentry);
531537
532− return result;
538+ return count;
533539 }
534540
535541 static const struct file_operations regmap_cache_bypass_fops = {
drivers/base/regmap/regmap.c+1−1
@@ -1364,7 +1364,7 @@ static int dev_get_regmap_match(struct device *dev, void *res, void *data) · 1363 unmodified lines
13641364
13651365 /* If the user didn't specify a name match any */
13661366 if (data)
1367− return (*r)->name == data;
1367+ return !strcmp((*r)->name, data);
13681368 else
13691369 return 1;
13701370 }
drivers/block/nbd.c+15−10
@@ -1033,25 +1033,26 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg, · 1032 unmodified lines
10331033 test_bit(NBD_RT_BOUND, &config->runtime_flags))) {
10341034 dev_err(disk_to_dev(nbd->disk),
10351035 "Device being setup by another task");
1036− sockfd_put(sock);
1037− return -EBUSY;
1036+ err = -EBUSY;
1037+ goto put_socket;
1038+ }
1039+
1040+ nsock = kzalloc(sizeof(*nsock), GFP_KERNEL);
1041+ if (!nsock) {
1042+ err = -ENOMEM;
1043+ goto put_socket;
10381044 }
10391045
10401046 socks = krealloc(config->socks, (config->num_connections + 1) *
10411047 sizeof(struct nbd_sock *), GFP_KERNEL);
10421048 if (!socks) {
1043− sockfd_put(sock);
1044− return -ENOMEM;
1049+ kfree(nsock);
1050+ err = -ENOMEM;
1051+ goto put_socket;
10451052 }
10461053
10471054 config->socks = socks;
10481055
1049− nsock = kzalloc(sizeof(struct nbd_sock), GFP_KERNEL);
1050− if (!nsock) {
1051− sockfd_put(sock);
1052− return -ENOMEM;
1053− }
1054−
10551056 nsock->fallback_index = -1;
10561057 nsock->dead = false;
10571058 mutex_init(&nsock->tx_lock);
@@ -1063,6 +1064,10 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg, · 5 unmodified lines
10631064 atomic_inc(&config->live_connections);
10641065
10651066 return 0;
1067+
1068+put_socket:
1069+ sockfd_put(sock);
1070+ return err;
10661071 }
10671072
10681073 static int nbd_reconnect_socket(struct nbd_device *nbd, unsigned long arg)
drivers/block/zram/zram_drv.c+2−1
@@ -2021,7 +2021,8 @@ static ssize_t hot_add_show(struct class *class, · 2020 unmodified lines
20212021 return ret;
20222022 return scnprintf(buf, PAGE_SIZE, "%d\n", ret);
20232023 }
2024−static CLASS_ATTR_RO(hot_add);
2024+static struct class_attribute class_attr_hot_add =
2025+ __ATTR(hot_add, 0400, hot_add_show, NULL);
20252026
20262027 static ssize_t hot_remove_store(struct class *class,
20272028 struct class_attribute *attr,
drivers/bus/ti-sysc.c+34−11
@@ -236,15 +236,14 @@ static int sysc_wait_softreset(struct sysc *ddata) · 235 unmodified lines
236236 syss_done = ddata->cfg.syss_mask;
237237
238238 if (syss_offset >= 0) {
239− error = readx_poll_timeout(sysc_read_sysstatus, ddata, rstval,
240− (rstval & ddata->cfg.syss_mask) ==
241− syss_done,
242− 100, MAX_MODULE_SOFTRESET_WAIT);
239+ error = readx_poll_timeout_atomic(sysc_read_sysstatus, ddata,
240+ rstval, (rstval & ddata->cfg.syss_mask) ==
241+ syss_done, 100, MAX_MODULE_SOFTRESET_WAIT);
243242
244243 } else if (ddata->cfg.quirks & SYSC_QUIRK_RESET_STATUS) {
245− error = readx_poll_timeout(sysc_read_sysconfig, ddata, rstval,
246− !(rstval & sysc_mask),
247− 100, MAX_MODULE_SOFTRESET_WAIT);
244+ error = readx_poll_timeout_atomic(sysc_read_sysconfig, ddata,
245+ rstval, !(rstval & sysc_mask),
246+ 100, MAX_MODULE_SOFTRESET_WAIT);
248247 }
249248
250249 return error;
@@ -1279,7 +1278,8 @@ static int __maybe_unused sysc_noirq_suspend(struct device *dev) · 1028 unmodified lines
12791278
12801279 ddata = dev_get_drvdata(dev);
12811280
1282− if (ddata->cfg.quirks & SYSC_QUIRK_LEGACY_IDLE)
1281+ if (ddata->cfg.quirks &
1282+ (SYSC_QUIRK_LEGACY_IDLE | SYSC_QUIRK_NO_IDLE))
12831283 return 0;
12841284
12851285 return pm_runtime_force_suspend(dev);
@@ -1291,7 +1291,8 @@ static int __maybe_unused sysc_noirq_resume(struct device *dev) · 5 unmodified lines
12911291
12921292 ddata = dev_get_drvdata(dev);
12931293
1294− if (ddata->cfg.quirks & SYSC_QUIRK_LEGACY_IDLE)
1294+ if (ddata->cfg.quirks &
1295+ (SYSC_QUIRK_LEGACY_IDLE | SYSC_QUIRK_NO_IDLE))
12951296 return 0;
12961297
12971298 return pm_runtime_force_resume(dev);
@@ -1728,8 +1729,8 @@ static void sysc_quirk_rtc(struct sysc *ddata, bool lock) · 430 unmodified lines
17281729
17291730 local_irq_save(flags);
17301731 /* RTC_STATUS BUSY bit may stay active for 1/32768 seconds (~30 usec) */
1731− error = readl_poll_timeout(ddata->module_va + 0x44, val,
1732− !(val & BIT(0)), 100, 50);
1732+ error = readl_poll_timeout_atomic(ddata->module_va + 0x44, val,
1733+ !(val & BIT(0)), 100, 50);
17331734 if (error)
17341735 dev_warn(ddata->dev, "rtc busy timeout\n");
17351736 /* Now we have ~15 microseconds to read/write various registers */
@@ -2864,6 +2865,24 @@ static int sysc_check_disabled_devices(struct sysc *ddata) · 1128 unmodified lines
28642865 return error;
28652866 }
28662867
2868+/*
2869+ * Ignore timers tagged with no-reset and no-idle. These are likely in use,
2870+ * for example by drivers/clocksource/timer-ti-dm-systimer.c. If more checks
2871+ * are needed, we could also look at the timer register configuration.
2872+ */
2873+static int sysc_check_active_timer(struct sysc *ddata)
2874+{
2875+ if (ddata->cap->type != TI_SYSC_OMAP2_TIMER &&
2876+ ddata->cap->type != TI_SYSC_OMAP4_TIMER)
2877+ return 0;
2878+
2879+ if ((ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT) &&
2880+ (ddata->cfg.quirks & SYSC_QUIRK_NO_IDLE))
2881+ return -EBUSY;
2882+
2883+ return 0;
2884+}
2885+
28672886 static const struct of_device_id sysc_match_table[] = {
28682887 { .compatible = "simple-bus", },
28692888 { /* sentinel */ },
@@ -2920,6 +2939,10 @@ static int sysc_probe(struct platform_device *pdev) · 50 unmodified lines
29202939 if (error)
29212940 return error;
29222941
2942+ error = sysc_check_active_timer(ddata);
2943+ if (error)
2944+ return error;
2945+
29232946 error = sysc_get_clocks(ddata);
29242947 if (error)
29252948 return error;
drivers/char/mem.c+7−3
@@ -814,7 +814,8 @@ static struct inode *devmem_inode; · 813 unmodified lines
814814 #ifdef CONFIG_IO_STRICT_DEVMEM
815815 void revoke_devmem(struct resource *res)
816816 {
817− struct inode *inode = READ_ONCE(devmem_inode);
817+ /* pairs with smp_store_release() in devmem_init_inode() */
818+ struct inode *inode = smp_load_acquire(&devmem_inode);
818819
819820 /*
820821 * Check that the initialization has completed. Losing the race
@@ -1028,8 +1029,11 @@ static int devmem_init_inode(void) · 207 unmodified lines
10281029 return rc;
10291030 }
10301031
1031− /* publish /dev/mem initialized */
1032− WRITE_ONCE(devmem_inode, inode);
1032+ /*
1033+ * Publish /dev/mem initialized.
1034+ * Pairs with smp_load_acquire() in revoke_devmem().
1035+ */
1036+ smp_store_release(&devmem_inode, inode);
10331037
10341038 return 0;
10351039 }
drivers/char/random.c+1−0
@@ -1277,6 +1277,7 @@ void add_interrupt_randomness(int irq, int irq_flags) · 1276 unmodified lines
12771277
12781278 fast_mix(fast_pool);
12791279 add_interrupt_bench(cycles);
1280+ this_cpu_add(net_rand_state.s1, fast_pool->pool[cycles & 3]);
12801281
12811282 if (unlikely(crng_init == 0)) {
12821283 if ((fast_pool->count >= 64) &&
drivers/char/virtio_console.c+2−1
@@ -2116,6 +2116,7 @@ static struct virtio_device_id id_table[] = { · 2115 unmodified lines
21162116 { VIRTIO_ID_CONSOLE, VIRTIO_DEV_ANY_ID },
21172117 { 0 },
21182118 };
2119+MODULE_DEVICE_TABLE(virtio, id_table);
21192120
21202121 static unsigned int features[] = {
21212122 VIRTIO_CONSOLE_F_SIZE,
@@ -2128,6 +2129,7 @@ static struct virtio_device_id rproc_serial_id_table[] = { · 6 unmodified lines
21282129 #endif
21292130 { 0 },
21302131 };
2132+MODULE_DEVICE_TABLE(virtio, rproc_serial_id_table);
21312133
21322134 static unsigned int rproc_serial_features[] = {
21332135 };
@@ -2280,6 +2282,5 @@ static void __exit fini(void) · 146 unmodified lines
22802282 module_init(init);
22812283 module_exit(fini);
22822284
2283−MODULE_DEVICE_TABLE(virtio, id_table);
22842285 MODULE_DESCRIPTION("Virtio console driver");
22852286 MODULE_LICENSE("GPL");
drivers/clk/Kconfig+1−0
@@ -50,6 +50,7 @@ source "drivers/clk/versatile/Kconfig" · 49 unmodified lines
5050 config CLK_HSDK
5151 bool "PLL Driver for HSDK platform"
5252 depends on OF || COMPILE_TEST
53+ depends on IOMEM
5354 help
5455 This driver supports the HSDK core, system, ddr, tunnel and hdmi PLLs
5556 control.
drivers/clk/clk-ast2600.c+41−8
@@ -131,6 +131,18 @@ static const struct clk_div_table ast2600_eclk_div_table[] = { · 130 unmodified lines
131131 { 0 }
132132 };
133133
134+static const struct clk_div_table ast2600_emmc_extclk_div_table[] = {
135+ { 0x0, 2 },
136+ { 0x1, 4 },
137+ { 0x2, 6 },
138+ { 0x3, 8 },
139+ { 0x4, 10 },
140+ { 0x5, 12 },
141+ { 0x6, 14 },
142+ { 0x7, 16 },
143+ { 0 }
144+};
145+
134146 static const struct clk_div_table ast2600_mac_div_table[] = {
135147 { 0x0, 4 },
136148 { 0x1, 4 },
@@ -390,6 +402,11 @@ static struct clk_hw *aspeed_g6_clk_hw_register_gate(struct device *dev, · 253 unmodified lines
390402 return hw;
391403 }
392404
405+static const char *const emmc_extclk_parent_names[] = {
406+ "emmc_extclk_hpll_in",
407+ "mpll",
408+};
409+
393410 static const char * const vclk_parent_names[] = {
394411 "dpll",
395412 "d1pll",
@@ -459,16 +476,32 @@ static int aspeed_g6_clk_probe(struct platform_device *pdev) · 63 unmodified lines
459476 return PTR_ERR(hw);
460477 aspeed_g6_clk_data->hws[ASPEED_CLK_UARTX] = hw;
461478
462− /* EMMC ext clock divider */
463− hw = clk_hw_register_gate(dev, "emmc_extclk_gate", "hpll", 0,
464− scu_g6_base + ASPEED_G6_CLK_SELECTION1, 15, 0,
465− &aspeed_g6_clk_lock);
479+ /* EMMC ext clock */
480+ hw = clk_hw_register_fixed_factor(dev, "emmc_extclk_hpll_in", "hpll",
481+ 0, 1, 2);
466482 if (IS_ERR(hw))
467483 return PTR_ERR(hw);
468− hw = clk_hw_register_divider_table(dev, "emmc_extclk", "emmc_extclk_gate", 0,
469− scu_g6_base + ASPEED_G6_CLK_SELECTION1, 12, 3, 0,
470− ast2600_div_table,
471− &aspeed_g6_clk_lock);
484+
485+ hw = clk_hw_register_mux(dev, "emmc_extclk_mux",
486+ emmc_extclk_parent_names,
487+ ARRAY_SIZE(emmc_extclk_parent_names), 0,
488+ scu_g6_base + ASPEED_G6_CLK_SELECTION1, 11, 1,
489+ 0, &aspeed_g6_clk_lock);
490+ if (IS_ERR(hw))
491+ return PTR_ERR(hw);
492+
493+ hw = clk_hw_register_gate(dev, "emmc_extclk_gate", "emmc_extclk_mux",
494+ 0, scu_g6_base + ASPEED_G6_CLK_SELECTION1,
495+ 15, 0, &aspeed_g6_clk_lock);
496+ if (IS_ERR(hw))
497+ return PTR_ERR(hw);
498+
499+ hw = clk_hw_register_divider_table(dev, "emmc_extclk",
500+ "emmc_extclk_gate", 0,
501+ scu_g6_base +
502+ ASPEED_G6_CLK_SELECTION1, 12,
503+ 3, 0, ast2600_emmc_extclk_div_table,
504+ &aspeed_g6_clk_lock);
472505 if (IS_ERR(hw))
473506 return PTR_ERR(hw);
474507 aspeed_g6_clk_data->hws[ASPEED_CLK_EMMC] = hw;
drivers/clk/mvebu/Kconfig+1−0
@@ -42,6 +42,7 @@ config ARMADA_AP806_SYSCON · 41 unmodified lines
4242
4343 config ARMADA_AP_CPU_CLK
4444 bool
45+ select ARMADA_AP_CP_HELPER
4546
4647 config ARMADA_CP110_SYSCON
4748 bool
drivers/clocksource/arm_arch_timer.c+11−0
@@ -480,6 +480,14 @@ static const struct arch_timer_erratum_workaround ool_workarounds[] = { · 479 unmodified lines
480480 .set_next_event_virt = erratum_set_next_event_tval_virt,
481481 },
482482 #endif
483+#ifdef CONFIG_ARM64_ERRATUM_1418040
484+ {
485+ .match_type = ate_match_local_cap_id,
486+ .id = (void *)ARM64_WORKAROUND_1418040,
487+ .desc = "ARM erratum 1418040",
488+ .disable_compat_vdso = true,
489+ },
490+#endif
483491 };
484492
485493 typedef bool (*ate_match_fn_t)(const struct arch_timer_erratum_workaround *,
@@ -566,6 +574,9 @@ void arch_timer_enable_workaround(const struct arch_timer_erratum_workaround *wa · 80 unmodified lines
566574 if (wa->read_cntvct_el0) {
567575 clocksource_counter.vdso_clock_mode = VDSO_CLOCKMODE_NONE;
568576 vdso_default = VDSO_CLOCKMODE_NONE;
577+ } else if (wa->disable_compat_vdso && vdso_default != VDSO_CLOCKMODE_NONE) {
578+ vdso_default = VDSO_CLOCKMODE_ARCHTIMER_NOCOMPAT;
579+ clocksource_counter.vdso_clock_mode = vdso_default;
569580 }
570581 }
571582
drivers/clocksource/timer-ti-dm-systimer.c+36−10
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 /* For type1, set SYSC_OMAP2_CLOCKACTIVITY for fck off on idle, l4 clock on */
2020 #define DMTIMER_TYPE1_ENABLE ((1 << 9) | (SYSC_IDLE_SMART << 3) | \
2121 SYSC_OMAP2_ENAWAKEUP | SYSC_OMAP2_AUTOIDLE)
22−
22+#define DMTIMER_TYPE1_DISABLE (SYSC_OMAP2_SOFTRESET | SYSC_OMAP2_AUTOIDLE)
2323 #define DMTIMER_TYPE2_ENABLE (SYSC_IDLE_SMART_WKUP << 2)
2424 #define DMTIMER_RESET_WAIT 100000
2525
@@ -44,6 +44,8 @@ struct dmtimer_systimer { · 18 unmodified lines
4444 u8 ctrl;
4545 u8 wakeup;
4646 u8 ifctrl;
47+ struct clk *fck;
48+ struct clk *ick;
4749 unsigned long rate;
4850 };
4951
@@ -298,16 +300,20 @@ static void __init dmtimer_systimer_select_best(void) · 248 unmodified lines
298300 }
299301
300302 /* Interface clocks are only available on some SoCs variants */
301−static int __init dmtimer_systimer_init_clock(struct device_node *np,
303+static int __init dmtimer_systimer_init_clock(struct dmtimer_systimer *t,
304+ struct device_node *np,
302305 const char *name,
303306 unsigned long *rate)
304307 {
305308 struct clk *clock;
306309 unsigned long r;
310+ bool is_ick = false;
307311 int error;
308312
313+ is_ick = !strncmp(name, "ick", 3);
314+
309315 clock = of_clk_get_by_name(np, name);
310− if ((PTR_ERR(clock) == -EINVAL) && !strncmp(name, "ick", 3))
316+ if ((PTR_ERR(clock) == -EINVAL) && is_ick)
311317 return 0;
312318 else if (IS_ERR(clock))
313319 return PTR_ERR(clock);
@@ -320,6 +326,11 @@ static int __init dmtimer_systimer_init_clock(struct device_node *np, · 6 unmodified lines
320326 if (!r)
321327 return -ENODEV;
322328
329+ if (is_ick)
330+ t->ick = clock;
331+ else
332+ t->fck = clock;
333+
323334 *rate = r;
324335
325336 return 0;
@@ -339,7 +350,10 @@ static void dmtimer_systimer_enable(struct dmtimer_systimer *t) · 13 unmodified lines
339350
340351 static void dmtimer_systimer_disable(struct dmtimer_systimer *t)
341352 {
342− writel_relaxed(0, t->base + t->sysc);
353+ if (!dmtimer_systimer_revision1(t))
354+ return;
355+
356+ writel_relaxed(DMTIMER_TYPE1_DISABLE, t->base + t->sysc);
343357 }
344358
345359 static int __init dmtimer_systimer_setup(struct device_node *np,
@@ -366,13 +380,13 @@ static int __init dmtimer_systimer_setup(struct device_node *np, · 20 unmodified lines
366380 pr_err("%s: clock source init failed: %i\n", __func__, error);
367381
368382 /* For ti-sysc, we have timer clocks at the parent module level */
369− error = dmtimer_systimer_init_clock(np->parent, "fck", &rate);
383+ error = dmtimer_systimer_init_clock(t, np->parent, "fck", &rate);
370384 if (error)
371385 goto err_unmap;
372386
373387 t->rate = rate;
374388
375− error = dmtimer_systimer_init_clock(np->parent, "ick", &rate);
389+ error = dmtimer_systimer_init_clock(t, np->parent, "ick", &rate);
376390 if (error)
377391 goto err_unmap;
378392
@@ -496,12 +510,18 @@ static void omap_clockevent_idle(struct clock_event_device *evt) · 117 unmodified lines
496510 struct dmtimer_systimer *t = &clkevt->t;
497511
498512 dmtimer_systimer_disable(t);
513+ clk_disable(t->fck);
499514 }
500515
501516 static void omap_clockevent_unidle(struct clock_event_device *evt)
502517 {
503518 struct dmtimer_clockevent *clkevt = to_dmtimer_clockevent(evt);
504519 struct dmtimer_systimer *t = &clkevt->t;
520+ int error;
521+
522+ error = clk_enable(t->fck);
523+ if (error)
524+ pr_err("could not enable timer fck on resume: %i\n", error);
505525
506526 dmtimer_systimer_enable(t);
507527 writel_relaxed(OMAP_TIMER_INT_OVERFLOW, t->base + t->irq_ena);
@@ -570,8 +590,8 @@ static int __init dmtimer_clockevent_init(struct device_node *np) · 62 unmodified lines
570590 3, /* Timer internal resynch latency */
571591 0xffffffff);
572592
573− if (of_device_is_compatible(np, "ti,am33xx") ||
574− of_device_is_compatible(np, "ti,am43")) {
593+ if (of_machine_is_compatible("ti,am33xx") ||
594+ of_machine_is_compatible("ti,am43")) {
575595 dev->suspend = omap_clockevent_idle;
576596 dev->resume = omap_clockevent_unidle;
577597 }
@@ -616,12 +636,18 @@ static void dmtimer_clocksource_suspend(struct clocksource *cs) · 38 unmodified lines
616636
617637 clksrc->loadval = readl_relaxed(t->base + t->counter);
618638 dmtimer_systimer_disable(t);
639+ clk_disable(t->fck);
619640 }
620641
621642 static void dmtimer_clocksource_resume(struct clocksource *cs)
622643 {
623644 struct dmtimer_clocksource *clksrc = to_dmtimer_clocksource(cs);
624645 struct dmtimer_systimer *t = &clksrc->t;
646+ int error;
647+
648+ error = clk_enable(t->fck);
649+ if (error)
650+ pr_err("could not enable timer fck on resume: %i\n", error);
625651
626652 dmtimer_systimer_enable(t);
627653 writel_relaxed(clksrc->loadval, t->base + t->counter);
@@ -653,8 +679,8 @@ static int __init dmtimer_clocksource_init(struct device_node *np) · 25 unmodified lines
653679 dev->mask = CLOCKSOURCE_MASK(32);
654680 dev->flags = CLOCK_SOURCE_IS_CONTINUOUS;
655681
656− if (of_device_is_compatible(np, "ti,am33xx") ||
657− of_device_is_compatible(np, "ti,am43")) {
682+ /* Unlike for clockevent, legacy code sets suspend only for am4 */
683+ if (of_machine_is_compatible("ti,am43")) {
658684 dev->suspend = dmtimer_clocksource_suspend;
659685 dev->resume = dmtimer_clocksource_resume;
660686 }
drivers/counter/104-quad-8.c+19−3
@@ -1274,18 +1274,26 @@ static ssize_t quad8_signal_cable_fault_read(struct counter_device *counter, · 1273 unmodified lines
12741274 struct counter_signal *signal,
12751275 void *private, char *buf)
12761276 {
1277− const struct quad8_iio *const priv = counter->priv;
1277+ struct quad8_iio *const priv = counter->priv;
12781278 const size_t channel_id = signal->id / 2;
1279− const bool disabled = !(priv->cable_fault_enable & BIT(channel_id));
1279+ bool disabled;
12801280 unsigned int status;
12811281 unsigned int fault;
12821282
1283− if (disabled)
1283+ mutex_lock(&priv->lock);
1284+
1285+ disabled = !(priv->cable_fault_enable & BIT(channel_id));
1286+
1287+ if (disabled) {
1288+ mutex_unlock(&priv->lock);
12841289 return -EINVAL;
1290+ }
12851291
12861292 /* Logic 0 = cable fault */
12871293 status = inb(priv->base + QUAD8_DIFF_ENCODER_CABLE_STATUS);
12881294
1295+ mutex_unlock(&priv->lock);
1296+
12891297 /* Mask respective channel and invert logic */
12901298 fault = !(status & BIT(channel_id));
12911299
@@ -1317,6 +1325,8 @@ static ssize_t quad8_signal_cable_fault_enable_write( · 25 unmodified lines
13171325 if (ret)
13181326 return ret;
13191327
1328+ mutex_lock(&priv->lock);
1329+
13201330 if (enable)
13211331 priv->cable_fault_enable |= BIT(channel_id);
13221332 else
@@ -1327,6 +1337,8 @@ static ssize_t quad8_signal_cable_fault_enable_write( · 4 unmodified lines
13271337
13281338 outb(cable_fault_enable, priv->base + QUAD8_DIFF_ENCODER_CABLE_STATUS);
13291339
1340+ mutex_unlock(&priv->lock);
1341+
13301342 return len;
13311343 }
13321344
@@ -1353,6 +1365,8 @@ static ssize_t quad8_signal_fck_prescaler_write(struct counter_device *counter, · 20 unmodified lines
13531365 if (ret)
13541366 return ret;
13551367
1368+ mutex_lock(&priv->lock);
1369+
13561370 priv->fck_prescaler[channel_id] = prescaler;
13571371
13581372 /* Reset Byte Pointer */
@@ -1363,6 +1377,8 @@ static ssize_t quad8_signal_fck_prescaler_write(struct counter_device *counter, · 4 unmodified lines
13631377 outb(QUAD8_CTR_RLD | QUAD8_RLD_RESET_BP | QUAD8_RLD_PRESET_PSC,
13641378 base_offset + 1);
13651379
1380+ mutex_unlock(&priv->lock);
1381+
13661382 return len;
13671383 }
13681384
drivers/cpufreq/intel_pstate.c+6−2
@@ -2464,7 +2464,7 @@ static struct cpufreq_driver intel_cpufreq = { · 2463 unmodified lines
24642464 .name = "intel_cpufreq",
24652465 };
24662466
2467−static struct cpufreq_driver *default_driver = &intel_pstate;
2467+static struct cpufreq_driver *default_driver;
24682468
24692469 static void intel_pstate_driver_cleanup(void)
24702470 {
@@ -2758,6 +2758,7 @@ static int __init intel_pstate_init(void) · 287 unmodified lines
27582758 hwp_active++;
27592759 hwp_mode_bdw = id->driver_data;
27602760 intel_pstate.attr = hwp_cpufreq_attrs;
2761+ default_driver = &intel_pstate;
27612762 goto hwp_cpu_matched;
27622763 }
27632764 } else {
@@ -2775,7 +2776,8 @@ static int __init intel_pstate_init(void) · 11 unmodified lines
27752776 return -ENODEV;
27762777 }
27772778 /* Without HWP start in the passive mode. */
2778− default_driver = &intel_cpufreq;
2779+ if (!default_driver)
2780+ default_driver = &intel_cpufreq;
27792781
27802782 hwp_cpu_matched:
27812783 /*
@@ -2820,6 +2822,8 @@ static int __init intel_pstate_setup(char *str) · 38 unmodified lines
28202822
28212823 if (!strcmp(str, "disable")) {
28222824 no_load = 1;
2825+ } else if (!strcmp(str, "active")) {
2826+ default_driver = &intel_pstate;
28232827 } else if (!strcmp(str, "passive")) {
28242828 default_driver = &intel_cpufreq;
28252829 no_hwp = 1;
drivers/crypto/chelsio/chtls/chtls_cm.c+1−1
@@ -102,7 +102,7 @@ static struct net_device *chtls_find_netdev(struct chtls_dev *cdev, · 101 unmodified lines
102102 case PF_INET:
103103 if (likely(!inet_sk(sk)->inet_rcv_saddr))
104104 return ndev;
105− ndev = ip_dev_find(&init_net, inet_sk(sk)->inet_rcv_saddr);
105+ ndev = __ip_dev_find(&init_net, inet_sk(sk)->inet_rcv_saddr, false);
106106 break;
107107 #if IS_ENABLED(CONFIG_IPV6)
108108 case PF_INET6:
drivers/crypto/chelsio/chtls/chtls_io.c+4−3
@@ -1052,14 +1052,15 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) · 1051 unmodified lines
10521052 &record_type);
10531053 if (err)
10541054 goto out_err;
1055+
1056+ /* Avoid appending tls handshake, alert to tls data */
1057+ if (skb)
1058+ tx_skb_finalize(skb);
10551059 }
10561060
10571061 recordsz = size;
10581062 csk->tlshws.txleft = recordsz;
10591063 csk->tlshws.type = record_type;
1060−
1061− if (skb)
1062− ULP_SKB_CB(skb)->ulp.tls.type = record_type;
10631064 }
10641065
10651066 if (!skb || (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_NO_APPEND) ||
drivers/dma-buf/dma-buf.c+7−4
@@ -45,10 +45,10 @@ static char *dmabuffs_dname(struct dentry *dentry, char *buffer, int buflen) · 44 unmodified lines
4545 size_t ret = 0;
4646
4747 dmabuf = dentry->d_fsdata;
48− dma_resv_lock(dmabuf->resv, NULL);
48+ spin_lock(&dmabuf->name_lock);
4949 if (dmabuf->name)
5050 ret = strlcpy(name, dmabuf->name, DMA_BUF_NAME_LEN);
51− dma_resv_unlock(dmabuf->resv);
51+ spin_unlock(&dmabuf->name_lock);
5252
5353 return dynamic_dname(dentry, buffer, buflen, "/%s:%s",
5454 dentry->d_name.name, ret > 0 ? name : "");
@@ -338,8 +338,10 @@ static long dma_buf_set_name(struct dma_buf *dmabuf, const char __user *buf) · 283 unmodified lines
338338 kfree(name);
339339 goto out_unlock;
340340 }
341+ spin_lock(&dmabuf->name_lock);
341342 kfree(dmabuf->name);
342343 dmabuf->name = name;
344+ spin_unlock(&dmabuf->name_lock);
343345
344346 out_unlock:
345347 dma_resv_unlock(dmabuf->resv);
@@ -402,10 +404,10 @@ static void dma_buf_show_fdinfo(struct seq_file *m, struct file *file) · 56 unmodified lines
402404 /* Don't count the temporary reference taken inside procfs seq_show */
403405 seq_printf(m, "count:\t%ld\n", file_count(dmabuf->file) - 1);
404406 seq_printf(m, "exp_name:\t%s\n", dmabuf->exp_name);
405− dma_resv_lock(dmabuf->resv, NULL);
407+ spin_lock(&dmabuf->name_lock);
406408 if (dmabuf->name)
407409 seq_printf(m, "name:\t%s\n", dmabuf->name);
408− dma_resv_unlock(dmabuf->resv);
410+ spin_unlock(&dmabuf->name_lock);
409411 }
410412
411413 static const struct file_operations dma_buf_fops = {
@@ -542,6 +544,7 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info) · 130 unmodified lines
542544 dmabuf->size = exp_info->size;
543545 dmabuf->exp_name = exp_info->exp_name;
544546 dmabuf->owner = exp_info->owner;
547+ spin_lock_init(&dmabuf->name_lock);
545548 init_waitqueue_head(&dmabuf->poll);
546549 dmabuf->cb_excl.poll = dmabuf->cb_shared.poll = &dmabuf->poll;
547550 dmabuf->cb_excl.active = dmabuf->cb_shared.active = 0;
drivers/dma/dmatest.c+2−0
@@ -1176,6 +1176,8 @@ static int dmatest_run_set(const char *val, const struct kernel_param *kp) · 1175 unmodified lines
11761176 } else if (dmatest_run) {
11771177 if (!is_threaded_test_pending(info)) {
11781178 pr_info("No channels configured, continue with any\n");
1179+ if (!is_threaded_test_run(info))
1180+ stop_threaded_test(info);
11791181 add_threaded_test(info);
11801182 }
11811183 start_threaded_tests(info);
drivers/dma/dw/core.c+0−12
@@ -118,16 +118,11 @@ static void dwc_initialize(struct dw_dma_chan *dwc) · 117 unmodified lines
118118 {
119119 struct dw_dma *dw = to_dw_dma(dwc->chan.device);
120120
121− if (test_bit(DW_DMA_IS_INITIALIZED, &dwc->flags))
122− return;
123−
124121 dw->initialize_chan(dwc);
125122
126123 /* Enable interrupts */
127124 channel_set_bit(dw, MASK.XFER, dwc->mask);
128125 channel_set_bit(dw, MASK.ERROR, dwc->mask);
129−
130− set_bit(DW_DMA_IS_INITIALIZED, &dwc->flags);
131126 }
132127
133128 /*----------------------------------------------------------------------*/
@@ -954,8 +949,6 @@ static void dwc_issue_pending(struct dma_chan *chan) · 820 unmodified lines
954949
955950 void do_dw_dma_off(struct dw_dma *dw)
956951 {
957− unsigned int i;
958−
959952 dma_writel(dw, CFG, 0);
960953
961954 channel_clear_bit(dw, MASK.XFER, dw->all_chan_mask);
@@ -966,9 +959,6 @@ void do_dw_dma_off(struct dw_dma *dw) · 4 unmodified lines
966959
967960 while (dma_readl(dw, CFG) & DW_CFG_DMA_EN)
968961 cpu_relax();
969−
970− for (i = 0; i < dw->dma.chancnt; i++)
971− clear_bit(DW_DMA_IS_INITIALIZED, &dw->chan[i].flags);
972962 }
973963
974964 void do_dw_dma_on(struct dw_dma *dw)
@@ -1032,8 +1022,6 @@ static void dwc_free_chan_resources(struct dma_chan *chan) · 57 unmodified lines
10321022 /* Clear custom channel configuration */
10331023 memset(&dwc->dws, 0, sizeof(struct dw_dma_slave));
10341024
1035− clear_bit(DW_DMA_IS_INITIALIZED, &dwc->flags);
1036−
10371025 /* Disable interrupts */
10381026 channel_clear_bit(dw, MASK.XFER, dwc->mask);
10391027 channel_clear_bit(dw, MASK.BLOCK, dwc->mask);
drivers/dma/fsl-edma-common.c+16−12
@@ -352,26 +352,28 @@ static void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, · 351 unmodified lines
352352 /*
353353 * TCD parameters are stored in struct fsl_edma_hw_tcd in little
354354 * endian format. However, we need to load the TCD registers in
355− * big- or little-endian obeying the eDMA engine model endian.
355+ * big- or little-endian obeying the eDMA engine model endian,
356+ * and this is performed from specific edma_write functions
356357 */
357358 edma_writew(edma, 0, &regs->tcd[ch].csr);
358− edma_writel(edma, le32_to_cpu(tcd->saddr), &regs->tcd[ch].saddr);
359− edma_writel(edma, le32_to_cpu(tcd->daddr), &regs->tcd[ch].daddr);
360359
361− edma_writew(edma, le16_to_cpu(tcd->attr), &regs->tcd[ch].attr);
362− edma_writew(edma, le16_to_cpu(tcd->soff), &regs->tcd[ch].soff);
360+ edma_writel(edma, (s32)tcd->saddr, &regs->tcd[ch].saddr);
361+ edma_writel(edma, (s32)tcd->daddr, &regs->tcd[ch].daddr);
363362
364− edma_writel(edma, le32_to_cpu(tcd->nbytes), &regs->tcd[ch].nbytes);
365− edma_writel(edma, le32_to_cpu(tcd->slast), &regs->tcd[ch].slast);
363+ edma_writew(edma, (s16)tcd->attr, &regs->tcd[ch].attr);
364+ edma_writew(edma, tcd->soff, &regs->tcd[ch].soff);
366365
367− edma_writew(edma, le16_to_cpu(tcd->citer), &regs->tcd[ch].citer);
368− edma_writew(edma, le16_to_cpu(tcd->biter), &regs->tcd[ch].biter);
369− edma_writew(edma, le16_to_cpu(tcd->doff), &regs->tcd[ch].doff);
366+ edma_writel(edma, (s32)tcd->nbytes, &regs->tcd[ch].nbytes);
367+ edma_writel(edma, (s32)tcd->slast, &regs->tcd[ch].slast);
370368
371− edma_writel(edma, le32_to_cpu(tcd->dlast_sga),
369+ edma_writew(edma, (s16)tcd->citer, &regs->tcd[ch].citer);
370+ edma_writew(edma, (s16)tcd->biter, &regs->tcd[ch].biter);
371+ edma_writew(edma, (s16)tcd->doff, &regs->tcd[ch].doff);
372+
373+ edma_writel(edma, (s32)tcd->dlast_sga,
372374 &regs->tcd[ch].dlast_sga);
373375
374− edma_writew(edma, le16_to_cpu(tcd->csr), &regs->tcd[ch].csr);
376+ edma_writew(edma, (s16)tcd->csr, &regs->tcd[ch].csr);
375377 }
376378
377379 static inline
@@ -589,6 +591,8 @@ void fsl_edma_xfer_desc(struct fsl_edma_chan *fsl_chan) · 211 unmodified lines
589591 {
590592 struct virt_dma_desc *vdesc;
591593
594+ lockdep_assert_held(&fsl_chan->vchan.lock);
595+
592596 vdesc = vchan_next_desc(&fsl_chan->vchan);
593597 if (!vdesc)
594598 return;
drivers/dma/fsl-edma-common.h+1−1
@@ -33,7 +33,7 @@ · 32 unmodified lines
3333 #define EDMA_TCD_ATTR_DSIZE_16BIT BIT(0)
3434 #define EDMA_TCD_ATTR_DSIZE_32BIT BIT(1)
3535 #define EDMA_TCD_ATTR_DSIZE_64BIT (BIT(0) | BIT(1))
36−#define EDMA_TCD_ATTR_DSIZE_32BYTE (BIT(3) | BIT(0))
36+#define EDMA_TCD_ATTR_DSIZE_32BYTE (BIT(2) | BIT(0))
3737 #define EDMA_TCD_ATTR_SSIZE_8BIT 0
3838 #define EDMA_TCD_ATTR_SSIZE_16BIT (EDMA_TCD_ATTR_DSIZE_16BIT << 8)
3939 #define EDMA_TCD_ATTR_SSIZE_32BIT (EDMA_TCD_ATTR_DSIZE_32BIT << 8)
drivers/dma/fsl-edma.c+7−0
@@ -45,6 +45,13 @@ static irqreturn_t fsl_edma_tx_handler(int irq, void *dev_id) · 44 unmodified lines
4545 fsl_chan = &fsl_edma->chans[ch];
4646
4747 spin_lock(&fsl_chan->vchan.lock);
48+
49+ if (!fsl_chan->edesc) {
50+ /* terminate_all called before */
51+ spin_unlock(&fsl_chan->vchan.lock);
52+ continue;
53+ }
54+
4855 if (!fsl_chan->edesc->iscyclic) {
4956 list_del(&fsl_chan->edesc->vdesc.node);
5057 vchan_cookie_complete(&fsl_chan->edesc->vdesc);
drivers/dma/idxd/cdev.c+16−3
@@ -74,6 +74,7 @@ static int idxd_cdev_open(struct inode *inode, struct file *filp) · 73 unmodified lines
7474 struct idxd_device *idxd;
7575 struct idxd_wq *wq;
7676 struct device *dev;
77+ int rc = 0;
7778
7879 wq = inode_wq(inode);
7980 idxd = wq->idxd;
@@ -81,17 +82,27 @@ static int idxd_cdev_open(struct inode *inode, struct file *filp) · 1 unmodified line
8182
8283 dev_dbg(dev, "%s called: %d\n", __func__, idxd_wq_refcount(wq));
8384
84− if (idxd_wq_refcount(wq) > 0 && wq_dedicated(wq))
85− return -EBUSY;
86−
8785 ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
8886 if (!ctx)
8987 return -ENOMEM;
9088
89+ mutex_lock(&wq->wq_lock);
90+
91+ if (idxd_wq_refcount(wq) > 0 && wq_dedicated(wq)) {
92+ rc = -EBUSY;
93+ goto failed;
94+ }
95+
9196 ctx->wq = wq;
9297 filp->private_data = ctx;
9398 idxd_wq_get(wq);
99+ mutex_unlock(&wq->wq_lock);
94100 return 0;
101+
102+ failed:
103+ mutex_unlock(&wq->wq_lock);
104+ kfree(ctx);
105+ return rc;
95106 }
96107
97108 static int idxd_cdev_release(struct inode *node, struct file *filep)
@@ -105,7 +116,9 @@ static int idxd_cdev_release(struct inode *node, struct file *filep) · 7 unmodified lines
105116 filep->private_data = NULL;
106117
107118 kfree(ctx);
119+ mutex_lock(&wq->wq_lock);
108120 idxd_wq_put(wq);
121+ mutex_unlock(&wq->wq_lock);
109122 return 0;
110123 }
111124
drivers/dma/idxd/device.c+25−0
@@ -320,6 +320,31 @@ void idxd_wq_unmap_portal(struct idxd_wq *wq) · 319 unmodified lines
320320 devm_iounmap(dev, wq->dportal);
321321 }
322322
323+void idxd_wq_disable_cleanup(struct idxd_wq *wq)
324+{
325+ struct idxd_device *idxd = wq->idxd;
326+ struct device *dev = &idxd->pdev->dev;
327+ int i, wq_offset;
328+
329+ lockdep_assert_held(&idxd->dev_lock);
330+ memset(&wq->wqcfg, 0, sizeof(wq->wqcfg));
331+ wq->type = IDXD_WQT_NONE;
332+ wq->size = 0;
333+ wq->group = NULL;
334+ wq->threshold = 0;
335+ wq->priority = 0;
336+ clear_bit(WQ_FLAG_DEDICATED, &wq->flags);
337+ memset(wq->name, 0, WQ_NAME_SIZE);
338+
339+ for (i = 0; i < 8; i++) {
340+ wq_offset = idxd->wqcfg_offset + wq->id * 32 + i * sizeof(u32);
341+ iowrite32(0, idxd->reg_base + wq_offset);
342+ dev_dbg(dev, "WQ[%d][%d][%#x]: %#x\n",
343+ wq->id, i, wq_offset,
344+ ioread32(idxd->reg_base + wq_offset));
345+ }
346+}
347+
323348 /* Device control bits */
324349 static inline bool idxd_is_enabled(struct idxd_device *idxd)
325350 {
drivers/dma/idxd/idxd.h+1−0
@@ -290,6 +290,7 @@ int idxd_wq_enable(struct idxd_wq *wq); · 289 unmodified lines
290290 int idxd_wq_disable(struct idxd_wq *wq);
291291 int idxd_wq_map_portal(struct idxd_wq *wq);
292292 void idxd_wq_unmap_portal(struct idxd_wq *wq);
293+void idxd_wq_disable_cleanup(struct idxd_wq *wq);
293294
294295 /* submission */
295296 int idxd_submit_desc(struct idxd_wq *wq, struct idxd_desc *desc);
drivers/dma/idxd/irq.c+2−1
@@ -141,7 +141,7 @@ irqreturn_t idxd_misc_thread(int vec, void *data) · 140 unmodified lines
141141
142142 iowrite32(cause, idxd->reg_base + IDXD_INTCAUSE_OFFSET);
143143 if (!err)
144− return IRQ_HANDLED;
144+ goto out;
145145
146146 gensts.bits = ioread32(idxd->reg_base + IDXD_GENSTATS_OFFSET);
147147 if (gensts.state == IDXD_DEVICE_STATE_HALT) {
@@ -162,6 +162,7 @@ irqreturn_t idxd_misc_thread(int vec, void *data) · 14 unmodified lines
162162 spin_unlock_bh(&idxd->dev_lock);
163163 }
164164
165+ out:
165166 idxd_unmask_msix_vector(idxd, irq_entry->id);
166167 return IRQ_HANDLED;
167168 }
drivers/dma/idxd/sysfs.c+5−0
@@ -315,6 +315,11 @@ static int idxd_config_bus_remove(struct device *dev) · 314 unmodified lines
315315 idxd_unregister_dma_device(idxd);
316316 spin_lock_irqsave(&idxd->dev_lock, flags);
317317 rc = idxd_device_disable(idxd);
318+ for (i = 0; i < idxd->max_wqs; i++) {
319+ struct idxd_wq *wq = &idxd->wqs[i];
320+
321+ idxd_wq_disable_cleanup(wq);
322+ }
318323 spin_unlock_irqrestore(&idxd->dev_lock, flags);
319324 module_put(THIS_MODULE);
320325 if (rc < 0)
drivers/dma/imx-sdma.c+4−7
@@ -1331,8 +1331,7 @@ static void sdma_free_chan_resources(struct dma_chan *chan) · 1330 unmodified lines
13311331
13321332 sdma_channel_synchronize(chan);
13331333
1334− if (sdmac->event_id0 >= 0)
1335− sdma_event_disable(sdmac, sdmac->event_id0);
1334+ sdma_event_disable(sdmac, sdmac->event_id0);
13361335 if (sdmac->event_id1)
13371336 sdma_event_disable(sdmac, sdmac->event_id1);
13381337
@@ -1632,11 +1631,9 @@ static int sdma_config(struct dma_chan *chan, · 293 unmodified lines
16321631 memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg));
16331632
16341633 /* Set ENBLn earlier to make sure dma request triggered after that */
1635− if (sdmac->event_id0 >= 0) {
1636− if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
1637− return -EINVAL;
1638− sdma_event_enable(sdmac, sdmac->event_id0);
1639− }
1634+ if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
1635+ return -EINVAL;
1636+ sdma_event_enable(sdmac, sdmac->event_id0);
16401637
16411638 if (sdmac->event_id1) {
16421639 if (sdmac->event_id1 >= sdmac->sdma->drvdata->num_events)
drivers/dma/ioat/dma.c+12−0
@@ -26,6 +26,18 @@ · 25 unmodified lines
2626
2727 #include "../dmaengine.h"
2828
29+int completion_timeout = 200;
30+module_param(completion_timeout, int, 0644);
31+MODULE_PARM_DESC(completion_timeout,
32+ "set ioat completion timeout [msec] (default 200 [msec])");
33+int idle_timeout = 2000;
34+module_param(idle_timeout, int, 0644);
35+MODULE_PARM_DESC(idle_timeout,
36+ "set ioat idel timeout [msec] (default 2000 [msec])");
37+
38+#define IDLE_TIMEOUT msecs_to_jiffies(idle_timeout)
39+#define COMPLETION_TIMEOUT msecs_to_jiffies(completion_timeout)
40+
2941 static char *chanerr_str[] = {
3042 "DMA Transfer Source Address Error",
3143 "DMA Transfer Destination Address Error",
drivers/dma/ioat/dma.h+0−2
@@ -104,8 +104,6 @@ struct ioatdma_chan { · 103 unmodified lines
104104 #define IOAT_RUN 5
105105 #define IOAT_CHAN_ACTIVE 6
106106 struct timer_list timer;
107− #define COMPLETION_TIMEOUT msecs_to_jiffies(100)
108− #define IDLE_TIMEOUT msecs_to_jiffies(2000)
109107 #define RESET_DELAY msecs_to_jiffies(100)
110108 struct ioatdma_device *ioat_dma;
111109 dma_addr_t completion_dma;
drivers/dma/mcf-edma.c+7−0
@@ -35,6 +35,13 @@ static irqreturn_t mcf_edma_tx_handler(int irq, void *dev_id) · 34 unmodified lines
3535 mcf_chan = &mcf_edma->chans[ch];
3636
3737 spin_lock(&mcf_chan->vchan.lock);
38+
39+ if (!mcf_chan->edesc) {
40+ /* terminate_all called before */
41+ spin_unlock(&mcf_chan->vchan.lock);
42+ continue;
43+ }
44+
3845 if (!mcf_chan->edesc->iscyclic) {
3946 list_del(&mcf_chan->edesc->vdesc.node);
4047 vchan_cookie_complete(&mcf_chan->edesc->vdesc);
drivers/dma/sh/usb-dmac.c+2−0
@@ -586,6 +586,8 @@ static void usb_dmac_isr_transfer_end(struct usb_dmac_chan *chan) · 585 unmodified lines
586586 desc->residue = usb_dmac_get_current_residue(chan, desc,
587587 desc->sg_index - 1);
588588 desc->done_cookie = desc->vd.tx.cookie;
589+ desc->vd.tx_result.result = DMA_TRANS_NOERROR;
590+ desc->vd.tx_result.residue = desc->residue;
589591 vchan_cookie_complete(&desc->vd);
590592
591593 /* Restart the next transfer if this driver has a next desc */
drivers/dma/tegra210-adma.c+4−1
@@ -658,6 +658,7 @@ static int tegra_adma_alloc_chan_resources(struct dma_chan *dc) · 657 unmodified lines
658658
659659 ret = pm_runtime_get_sync(tdc2dev(tdc));
660660 if (ret < 0) {
661+ pm_runtime_put_noidle(tdc2dev(tdc));
661662 free_irq(tdc->irq, tdc);
662663 return ret;
663664 }
@@ -869,8 +870,10 @@ static int tegra_adma_probe(struct platform_device *pdev) · 205 unmodified lines
869870 pm_runtime_enable(&pdev->dev);
870871
871872 ret = pm_runtime_get_sync(&pdev->dev);
872− if (ret < 0)
873+ if (ret < 0) {
874+ pm_runtime_put_noidle(&pdev->dev);
873875 goto rpm_disable;
876+ }
874877
875878 ret = tegra_adma_init(tdma);
876879 if (ret)
drivers/dma/ti/k3-udma-private.c+1−0
@@ -42,6 +42,7 @@ struct udma_dev *of_xudma_dev_get(struct device_node *np, const char *property) · 41 unmodified lines
4242 ud = platform_get_drvdata(pdev);
4343 if (!ud) {
4444 pr_debug("UDMA has not been probed\n");
45+ put_device(&pdev->dev);
4546 return ERR_PTR(-EPROBE_DEFER);
4647 }
4748
drivers/dma/ti/k3-udma.c+19−20
@@ -1753,7 +1753,8 @@ static int udma_alloc_chan_resources(struct dma_chan *chan) · 1752 unmodified lines
17531753 dev_err(ud->ddev.dev,
17541754 "Descriptor pool allocation failed\n");
17551755 uc->use_dma_pool = false;
1756− return -ENOMEM;
1756+ ret = -ENOMEM;
1757+ goto err_cleanup;
17571758 }
17581759 }
17591760
@@ -1773,16 +1774,18 @@ static int udma_alloc_chan_resources(struct dma_chan *chan) · 13 unmodified lines
17731774
17741775 ret = udma_get_chan_pair(uc);
17751776 if (ret)
1776− return ret;
1777+ goto err_cleanup;
17771778
17781779 ret = udma_alloc_tx_resources(uc);
1779− if (ret)
1780− return ret;
1780+ if (ret) {
1781+ udma_put_rchan(uc);
1782+ goto err_cleanup;
1783+ }
17811784
17821785 ret = udma_alloc_rx_resources(uc);
17831786 if (ret) {
17841787 udma_free_tx_resources(uc);
1785− return ret;
1788+ goto err_cleanup;
17861789 }
17871790
17881791 uc->config.src_thread = ud->psil_base + uc->tchan->id;
@@ -1800,10 +1803,8 @@ static int udma_alloc_chan_resources(struct dma_chan *chan) · 11 unmodified lines
18001803 uc->id);
18011804
18021805 ret = udma_alloc_tx_resources(uc);
1803− if (ret) {
1804− uc->config.remote_thread_id = -1;
1805− return ret;
1806− }
1806+ if (ret)
1807+ goto err_cleanup;
18071808
18081809 uc->config.src_thread = ud->psil_base + uc->tchan->id;
18091810 uc->config.dst_thread = uc->config.remote_thread_id;
@@ -1820,10 +1821,8 @@ static int udma_alloc_chan_resources(struct dma_chan *chan) · 10 unmodified lines
18201821 uc->id);
18211822
18221823 ret = udma_alloc_rx_resources(uc);
1823− if (ret) {
1824− uc->config.remote_thread_id = -1;
1825− return ret;
1826− }
1824+ if (ret)
1825+ goto err_cleanup;
18271826
18281827 uc->config.src_thread = uc->config.remote_thread_id;
18291828 uc->config.dst_thread = (ud->psil_base + uc->rchan->id) |
@@ -1838,7 +1837,9 @@ static int udma_alloc_chan_resources(struct dma_chan *chan) · 8 unmodified lines
18381837 /* Can not happen */
18391838 dev_err(uc->ud->dev, "%s: chan%d invalid direction (%u)\n",
18401839 __func__, uc->id, uc->config.dir);
1841− return -EINVAL;
1840+ ret = -EINVAL;
1841+ goto err_cleanup;
1842+
18421843 }
18431844
18441845 /* check if the channel configuration was successful */
@@ -1847,7 +1848,7 @@ static int udma_alloc_chan_resources(struct dma_chan *chan) · 2 unmodified lines
18471848
18481849 if (udma_is_chan_running(uc)) {
18491850 dev_warn(ud->dev, "chan%d: is running!\n", uc->id);
1850− udma_stop(uc);
1851+ udma_reset_chan(uc, false);
18511852 if (udma_is_chan_running(uc)) {
18521853 dev_err(ud->dev, "chan%d: won't stop!\n", uc->id);
18531854 ret = -EBUSY;
@@ -1906,8 +1907,6 @@ static int udma_alloc_chan_resources(struct dma_chan *chan) · 52 unmodified lines
19061907
19071908 udma_reset_rings(uc);
19081909
1909− INIT_DELAYED_WORK_ONSTACK(&uc->tx_drain.work,
1910− udma_check_tx_completion);
19111910 return 0;
19121911
19131912 err_irq_free:
@@ -1919,7 +1918,7 @@ err_psi_free: · 5 unmodified lines
19191918 err_res_free:
19201919 udma_free_tx_resources(uc);
19211920 udma_free_rx_resources(uc);
1922−
1921+err_cleanup:
19231922 udma_reset_uchan(uc);
19241923
19251924 if (uc->use_dma_pool) {
@@ -3019,7 +3018,6 @@ static void udma_free_chan_resources(struct dma_chan *chan) · 1093 unmodified lines
30193018 }
30203019
30213020 cancel_delayed_work_sync(&uc->tx_drain.work);
3022− destroy_delayed_work_on_stack(&uc->tx_drain.work);
30233021
30243022 if (uc->irq_num_ring > 0) {
30253023 free_irq(uc->irq_num_ring, uc);
@@ -3593,7 +3591,7 @@ static int udma_probe(struct platform_device *pdev) · 567 unmodified lines
35933591 return ret;
35943592 }
35953593
3596− ret = of_property_read_u32(navss_node, "ti,udma-atype", &ud->atype);
3594+ ret = of_property_read_u32(dev->of_node, "ti,udma-atype", &ud->atype);
35973595 if (!ret && ud->atype > 2) {
35983596 dev_err(dev, "Invalid atype: %u\n", ud->atype);
35993597 return -EINVAL;
@@ -3711,6 +3709,7 @@ static int udma_probe(struct platform_device *pdev) · 111 unmodified lines
37113709 tasklet_init(&uc->vc.task, udma_vchan_complete,
37123710 (unsigned long)&uc->vc);
37133711 init_completion(&uc->teardown_completed);
3712+ INIT_DELAYED_WORK(&uc->tx_drain.work, udma_check_tx_completion);
37143713 }
37153714
37163715 ret = dma_async_device_register(&ud->ddev);
drivers/firmware/efi/efi-pstore.c+1−4
@@ -356,10 +356,7 @@ static struct pstore_info efi_pstore_info = { · 355 unmodified lines
356356
357357 static __init int efivars_pstore_init(void)
358358 {
359− if (!efi_rt_services_supported(EFI_RT_SUPPORTED_VARIABLE_SERVICES))
360− return 0;
361−
362− if (!efivars_kobject())
359+ if (!efivars_kobject() || !efivar_supports_writes())
363360 return 0;
364361
365362 if (efivars_pstore_disable)
drivers/firmware/efi/efi.c+8−4
@@ -176,11 +176,13 @@ static struct efivar_operations generic_ops; · 175 unmodified lines
176176 static int generic_ops_register(void)
177177 {
178178 generic_ops.get_variable = efi.get_variable;
179− generic_ops.set_variable = efi.set_variable;
180− generic_ops.set_variable_nonblocking = efi.set_variable_nonblocking;
181179 generic_ops.get_next_variable = efi.get_next_variable;
182180 generic_ops.query_variable_store = efi_query_variable_store;
183181
182+ if (efi_rt_services_supported(EFI_RT_SUPPORTED_SET_VARIABLE)) {
183+ generic_ops.set_variable = efi.set_variable;
184+ generic_ops.set_variable_nonblocking = efi.set_variable_nonblocking;
185+ }
184186 return efivars_register(&generic_efivars, &generic_ops, efi_kobj);
185187 }
186188
@@ -382,7 +384,8 @@ static int __init efisubsys_init(void) · 195 unmodified lines
382384 return -ENOMEM;
383385 }
384386
385− if (efi_rt_services_supported(EFI_RT_SUPPORTED_VARIABLE_SERVICES)) {
387+ if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE |
388+ EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME)) {
386389 efivar_ssdt_load();
387390 error = generic_ops_register();
388391 if (error)
@@ -416,7 +419,8 @@ static int __init efisubsys_init(void) · 27 unmodified lines
416419 err_remove_group:
417420 sysfs_remove_group(efi_kobj, &efi_subsys_attr_group);
418421 err_unregister:
419− if (efi_rt_services_supported(EFI_RT_SUPPORTED_VARIABLE_SERVICES))
422+ if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE |
423+ EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME))
420424 generic_ops_unregister();
421425 err_put:
422426 kobject_put(efi_kobj);
drivers/firmware/efi/efivars.c+1−4
@@ -680,11 +680,8 @@ int efivars_sysfs_init(void) · 679 unmodified lines
680680 struct kobject *parent_kobj = efivars_kobject();
681681 int error = 0;
682682
683− if (!efi_rt_services_supported(EFI_RT_SUPPORTED_VARIABLE_SERVICES))
684− return -ENODEV;
685−
686683 /* No efivars has been registered yet */
687− if (!parent_kobj)
684+ if (!parent_kobj || !efivar_supports_writes())
688685 return 0;
689686
690687 printk(KERN_INFO "EFI Variables Facility v%s %s\n", EFIVARS_VERSION,
drivers/firmware/efi/libstub/Makefile+1−2
@@ -6,8 +6,7 @@ · 5 unmodified lines
66 # enabled, even if doing so doesn't break the build.
77 #
88 cflags-$(CONFIG_X86_32) := -march=i386
9−cflags-$(CONFIG_X86_64) := -mcmodel=small \
10− $(call cc-option,-maccumulate-outgoing-args)
9+cflags-$(CONFIG_X86_64) := -mcmodel=small
1110 cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ \
1211 -fPIC -fno-strict-aliasing -mno-red-zone \
1312 -mno-mmx -mno-sse -fshort-wchar \
drivers/firmware/efi/libstub/alignedmem.c+1−1
@@ -44,7 +44,7 @@ efi_status_t efi_allocate_pages_aligned(unsigned long size, unsigned long *addr, · 43 unmodified lines
4444 *addr = ALIGN((unsigned long)alloc_addr, align);
4545
4646 if (slack > 0) {
47− int l = (alloc_addr % align) / EFI_PAGE_SIZE;
47+ int l = (alloc_addr & (align - 1)) / EFI_PAGE_SIZE;
4848
4949 if (l) {
5050 efi_bs_call(free_pages, alloc_addr, slack - l + 1);
drivers/firmware/efi/libstub/arm64-stub.c+14−11
@@ -35,13 +35,16 @@ efi_status_t check_platform_features(void) · 34 unmodified lines
3535 }
3636
3737 /*
38− * Relocatable kernels can fix up the misalignment with respect to
39− * MIN_KIMG_ALIGN, so they only require a minimum alignment of EFI_KIMG_ALIGN
40− * (which accounts for the alignment of statically allocated objects such as
41− * the swapper stack.)
38+ * Although relocatable kernels can fix up the misalignment with respect to
39+ * MIN_KIMG_ALIGN, the resulting virtual text addresses are subtly out of
40+ * sync with those recorded in the vmlinux when kaslr is disabled but the
41+ * image required relocation anyway. Therefore retain 2M alignment unless
42+ * KASLR is in use.
4243 */
43−static const u64 min_kimg_align = IS_ENABLED(CONFIG_RELOCATABLE) ? EFI_KIMG_ALIGN
44− : MIN_KIMG_ALIGN;
44+static u64 min_kimg_align(void)
45+{
46+ return efi_nokaslr ? MIN_KIMG_ALIGN : EFI_KIMG_ALIGN;
47+}
4548
4649 efi_status_t handle_kernel_image(unsigned long *image_addr,
4750 unsigned long *image_size,
@@ -74,21 +77,21 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, · 26 unmodified lines
7477
7578 kernel_size = _edata - _text;
7679 kernel_memsize = kernel_size + (_end - _edata);
77− *reserve_size = kernel_memsize + TEXT_OFFSET % min_kimg_align;
80+ *reserve_size = kernel_memsize + TEXT_OFFSET % min_kimg_align();
7881
7982 if (IS_ENABLED(CONFIG_RANDOMIZE_BASE) && phys_seed != 0) {
8083 /*
8184 * If KASLR is enabled, and we have some randomness available,
8285 * locate the kernel at a randomized offset in physical memory.
8386 */
84− status = efi_random_alloc(*reserve_size, min_kimg_align,
87+ status = efi_random_alloc(*reserve_size, min_kimg_align(),
8588 reserve_addr, phys_seed);
8689 } else {
8790 status = EFI_OUT_OF_RESOURCES;
8891 }
8992
9093 if (status != EFI_SUCCESS) {
91− if (IS_ALIGNED((u64)_text - TEXT_OFFSET, min_kimg_align)) {
94+ if (IS_ALIGNED((u64)_text - TEXT_OFFSET, min_kimg_align())) {
9295 /*
9396 * Just execute from wherever we were loaded by the
9497 * UEFI PE/COFF loader if the alignment is suitable.
@@ -99,7 +102,7 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, · 4 unmodified lines
99102 }
100103
101104 status = efi_allocate_pages_aligned(*reserve_size, reserve_addr,
102− ULONG_MAX, min_kimg_align);
105+ ULONG_MAX, min_kimg_align());
103106
104107 if (status != EFI_SUCCESS) {
105108 efi_err("Failed to relocate kernel\n");
@@ -108,7 +111,7 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, · 2 unmodified lines
108111 }
109112 }
110113
111− *image_addr = *reserve_addr + TEXT_OFFSET % min_kimg_align;
114+ *image_addr = *reserve_addr + TEXT_OFFSET % min_kimg_align();
112115 memcpy((void *)*image_addr, _text, kernel_size);
113116
114117 return EFI_SUCCESS;
drivers/firmware/efi/libstub/efi-stub-helper.c+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 #include "efistub.h"
2020
2121 bool efi_nochunk;
22−bool efi_nokaslr;
22+bool efi_nokaslr = !IS_ENABLED(CONFIG_RANDOMIZE_BASE);
2323 bool efi_noinitrd;
2424 int efi_loglevel = CONSOLE_LOGLEVEL_DEFAULT;
2525 bool efi_novamap;
drivers/firmware/efi/libstub/efi-stub.c+0−17
@@ -121,23 +121,6 @@ static unsigned long get_dram_base(void) · 120 unmodified lines
121121 return membase;
122122 }
123123
124−/*
125− * This function handles the architcture specific differences between arm and
126− * arm64 regarding where the kernel image must be loaded and any memory that
127− * must be reserved. On failure it is required to free all
128− * all allocations it has made.
129− */
130−efi_status_t handle_kernel_image(unsigned long *image_addr,
131− unsigned long *image_size,
132− unsigned long *reserve_addr,
133− unsigned long *reserve_size,
134− unsigned long dram_base,
135− efi_loaded_image_t *image);
136−
137−asmlinkage void __noreturn efi_enter_kernel(unsigned long entrypoint,
138− unsigned long fdt_addr,
139− unsigned long fdt_size);
140−
141124 /*
142125 * EFI entry point for the arm/arm64 EFI stubs. This is the entrypoint
143126 * that is described in the PE/COFF header. Most of the code is the same
drivers/firmware/efi/libstub/efistub.h+16−0
@@ -776,6 +776,22 @@ efi_status_t efi_load_initrd(efi_loaded_image_t *image, · 775 unmodified lines
776776 unsigned long *load_size,
777777 unsigned long soft_limit,
778778 unsigned long hard_limit);
779+/*
780+ * This function handles the architcture specific differences between arm and
781+ * arm64 regarding where the kernel image must be loaded and any memory that
782+ * must be reserved. On failure it is required to free all
783+ * all allocations it has made.
784+ */
785+efi_status_t handle_kernel_image(unsigned long *image_addr,
786+ unsigned long *image_size,
787+ unsigned long *reserve_addr,
788+ unsigned long *reserve_size,
789+ unsigned long dram_base,
790+ efi_loaded_image_t *image);
791+
792+asmlinkage void __noreturn efi_enter_kernel(unsigned long entrypoint,
793+ unsigned long fdt_addr,
794+ unsigned long fdt_size);
779795
780796 void efi_handle_post_ebs_state(void);
781797
drivers/firmware/efi/libstub/x86-stub.c+4−4
@@ -8,6 +8,7 @@ · 7 unmodified lines
88
99 #include <linux/efi.h>
1010 #include <linux/pci.h>
11+#include <linux/stddef.h>
1112
1213 #include <asm/efi.h>
1314 #include <asm/e820/types.h>
@@ -361,8 +362,6 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, · 347 unmodified lines
361362 int options_size = 0;
362363 efi_status_t status;
363364 char *cmdline_ptr;
364− unsigned long ramdisk_addr;
365− unsigned long ramdisk_size;
366365
367366 efi_system_table = sys_table_arg;
368367
@@ -390,8 +389,9 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, · 21 unmodified lines
390389
391390 hdr = &boot_params->hdr;
392391
393− /* Copy the second sector to boot_params */
394− memcpy(&hdr->jump, image_base + 512, 512);
392+ /* Copy the setup header from the second sector to boot_params */
393+ memcpy(&hdr->jump, image_base + 512,
394+ sizeof(struct setup_header) - offsetof(struct setup_header, jump));
395395
396396 /*
397397 * Fill out some of the header fields ourselves because the
drivers/firmware/efi/vars.c+6−0
@@ -1229,3 +1229,9 @@ out: · 1228 unmodified lines
12291229 return rv;
12301230 }
12311231 EXPORT_SYMBOL_GPL(efivars_unregister);
1232+
1233+int efivar_supports_writes(void)
1234+{
1235+ return __efivars && __efivars->ops->set_variable;
1236+}
1237+EXPORT_SYMBOL_GPL(efivar_supports_writes);
drivers/firmware/psci/psci_checker.c+5−3
@@ -157,8 +157,10 @@ static int alloc_init_cpu_groups(cpumask_var_t **pcpu_groups) · 156 unmodified lines
157157
158158 cpu_groups = kcalloc(nb_available_cpus, sizeof(cpu_groups),
159159 GFP_KERNEL);
160− if (!cpu_groups)
160+ if (!cpu_groups) {
161+ free_cpumask_var(tmp);
161162 return -ENOMEM;
163+ }
162164
163165 cpumask_copy(tmp, cpu_online_mask);
164166
@@ -167,6 +169,7 @@ static int alloc_init_cpu_groups(cpumask_var_t **pcpu_groups) · 2 unmodified lines
167169 topology_core_cpumask(cpumask_any(tmp));
168170
169171 if (!alloc_cpumask_var(&cpu_groups[num_groups], GFP_KERNEL)) {
172+ free_cpumask_var(tmp);
170173 free_cpu_groups(num_groups, &cpu_groups);
171174 return -ENOMEM;
172175 }
@@ -196,13 +199,12 @@ static int hotplug_tests(void) · 23 unmodified lines
196199 if (!page_buf)
197200 goto out_free_cpu_groups;
198201
199− err = 0;
200202 /*
201203 * Of course the last CPU cannot be powered down and cpu_down() should
202204 * refuse doing that.
203205 */
204206 pr_info("Trying to turn off and on again all CPUs\n");
205− err += down_and_up_cpus(cpu_online_mask, offlined_cpus);
207+ err = down_and_up_cpus(cpu_online_mask, offlined_cpus);
206208
207209 /*
208210 * Take down CPUs by cpu group this time. When the last CPU is turned
drivers/firmware/qemu_fw_cfg.c+4−3
@@ -605,8 +605,10 @@ static int fw_cfg_register_file(const struct fw_cfg_file *f) · 604 unmodified lines
605605 /* register entry under "/sys/firmware/qemu_fw_cfg/by_key/" */
606606 err = kobject_init_and_add(&entry->kobj, &fw_cfg_sysfs_entry_ktype,
607607 fw_cfg_sel_ko, "%d", entry->select);
608− if (err)
609− goto err_register;
608+ if (err) {
609+ kobject_put(&entry->kobj);
610+ return err;
611+ }
610612
611613 /* add raw binary content access */
612614 err = sysfs_create_bin_file(&entry->kobj, &fw_cfg_sysfs_attr_raw);
@@ -622,7 +624,6 @@ static int fw_cfg_register_file(const struct fw_cfg_file *f) · 9 unmodified lines
622624
623625 err_add_raw:
624626 kobject_del(&entry->kobj);
625−err_register:
626627 kfree(entry);
627628 return err;
628629 }
drivers/fpga/dfl-afu-main.c+2−1
@@ -83,7 +83,8 @@ int __afu_port_disable(struct platform_device *pdev) · 82 unmodified lines
8383 * on this port and minimum soft reset pulse width has elapsed.
8484 * Driver polls port_soft_reset_ack to determine if reset done by HW.
8585 */
86− if (readq_poll_timeout(base + PORT_HDR_CTRL, v, v & PORT_CTRL_SFTRST,
86+ if (readq_poll_timeout(base + PORT_HDR_CTRL, v,
87+ v & PORT_CTRL_SFTRST_ACK,
8788 RST_POLL_INVL, RST_POLL_TIMEOUT)) {
8889 dev_err(&pdev->dev, "timeout, fail to reset device\n");
8990 return -ETIMEDOUT;
drivers/fpga/dfl-pci.c+2−1
@@ -227,7 +227,6 @@ static int cci_pci_sriov_configure(struct pci_dev *pcidev, int num_vfs) · 226 unmodified lines
227227 {
228228 struct cci_drvdata *drvdata = pci_get_drvdata(pcidev);
229229 struct dfl_fpga_cdev *cdev = drvdata->cdev;
230− int ret = 0;
231230
232231 if (!num_vfs) {
233232 /*
@@ -239,6 +238,8 @@ static int cci_pci_sriov_configure(struct pci_dev *pcidev, int num_vfs) · 5 unmodified lines
239238 dfl_fpga_cdev_config_ports_pf(cdev);
240239
241240 } else {
241+ int ret;
242+
242243 /*
243244 * before enable SRIOV, put released ports into VF access mode
244245 * first of all.
drivers/gpio/gpio-arizona.c+6−1
@@ -64,6 +64,7 @@ static int arizona_gpio_get(struct gpio_chip *chip, unsigned offset) · 63 unmodified lines
6464 ret = pm_runtime_get_sync(chip->parent);
6565 if (ret < 0) {
6666 dev_err(chip->parent, "Failed to resume: %d\n", ret);
67+ pm_runtime_put_autosuspend(chip->parent);
6768 return ret;
6869 }
6970
@@ -72,12 +73,15 @@ static int arizona_gpio_get(struct gpio_chip *chip, unsigned offset) · 2 unmodified lines
7273 if (ret < 0) {
7374 dev_err(chip->parent, "Failed to drop cache: %d\n",
7475 ret);
76+ pm_runtime_put_autosuspend(chip->parent);
7577 return ret;
7678 }
7779
7880 ret = regmap_read(arizona->regmap, reg, &val);
79− if (ret < 0)
81+ if (ret < 0) {
82+ pm_runtime_put_autosuspend(chip->parent);
8083 return ret;
84+ }
8185
8286 pm_runtime_mark_last_busy(chip->parent);
8387 pm_runtime_put_autosuspend(chip->parent);
@@ -106,6 +110,7 @@ static int arizona_gpio_direction_out(struct gpio_chip *chip, · 22 unmodified lines
106110 ret = pm_runtime_get_sync(chip->parent);
107111 if (ret < 0) {
108112 dev_err(chip->parent, "Failed to resume: %d\n", ret);
113+ pm_runtime_put(chip->parent);
109114 return ret;
110115 }
111116 }
drivers/gpio/gpio-pca953x.c+94−5
@@ -107,6 +107,84 @@ static const struct i2c_device_id pca953x_id[] = { · 106 unmodified lines
107107 };
108108 MODULE_DEVICE_TABLE(i2c, pca953x_id);
109109
110+#ifdef CONFIG_GPIO_PCA953X_IRQ
111+
112+#include <linux/dmi.h>
113+#include <linux/gpio.h>
114+#include <linux/list.h>
115+
116+static const struct dmi_system_id pca953x_dmi_acpi_irq_info[] = {
117+ {
118+ /*
119+ * On Intel Galileo Gen 2 board the IRQ pin of one of
120+ * the I²C GPIO expanders, which has GpioInt() resource,
121+ * is provided as an absolute number instead of being
122+ * relative. Since first controller (gpio-sch.c) and
123+ * second (gpio-dwapb.c) are at the fixed bases, we may
124+ * safely refer to the number in the global space to get
125+ * an IRQ out of it.
126+ */
127+ .matches = {
128+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "GalileoGen2"),
129+ },
130+ },
131+ {}
132+};
133+
134+#ifdef CONFIG_ACPI
135+static int pca953x_acpi_get_pin(struct acpi_resource *ares, void *data)
136+{
137+ struct acpi_resource_gpio *agpio;
138+ int *pin = data;
139+
140+ if (acpi_gpio_get_irq_resource(ares, &agpio))
141+ *pin = agpio->pin_table[0];
142+ return 1;
143+}
144+
145+static int pca953x_acpi_find_pin(struct device *dev)
146+{
147+ struct acpi_device *adev = ACPI_COMPANION(dev);
148+ int pin = -ENOENT, ret;
149+ LIST_HEAD(r);
150+
151+ ret = acpi_dev_get_resources(adev, &r, pca953x_acpi_get_pin, &pin);
152+ acpi_dev_free_resource_list(&r);
153+ if (ret < 0)
154+ return ret;
155+
156+ return pin;
157+}
158+#else
159+static inline int pca953x_acpi_find_pin(struct device *dev) { return -ENXIO; }
160+#endif
161+
162+static int pca953x_acpi_get_irq(struct device *dev)
163+{
164+ int pin, ret;
165+
166+ pin = pca953x_acpi_find_pin(dev);
167+ if (pin < 0)
168+ return pin;
169+
170+ dev_info(dev, "Applying ACPI interrupt quirk (GPIO %d)\n", pin);
171+
172+ if (!gpio_is_valid(pin))
173+ return -EINVAL;
174+
175+ ret = gpio_request(pin, "pca953x interrupt");
176+ if (ret)
177+ return ret;
178+
179+ ret = gpio_to_irq(pin);
180+
181+ /* When pin is used as an IRQ, no need to keep it requested */
182+ gpio_free(pin);
183+
184+ return ret;
185+}
186+#endif
187+
110188 static const struct acpi_device_id pca953x_acpi_ids[] = {
111189 { "INT3491", 16 | PCA953X_TYPE | PCA_LATCH_INT, },
112190 { }
@@ -322,6 +400,7 @@ static const struct regmap_config pca953x_ai_i2c_regmap = { · 209 unmodified lines
322400 .writeable_reg = pca953x_writeable_register,
323401 .volatile_reg = pca953x_volatile_register,
324402
403+ .disable_locking = true,
325404 .cache_type = REGCACHE_RBTREE,
326405 .max_register = 0x7f,
327406 };
@@ -623,8 +702,6 @@ static void pca953x_irq_bus_sync_unlock(struct irq_data *d) · 295 unmodified lines
623702 DECLARE_BITMAP(reg_direction, MAX_LINE);
624703 int level;
625704
626− pca953x_read_regs(chip, chip->regs->direction, reg_direction);
627−
628705 if (chip->driver_data & PCA_PCAL) {
629706 /* Enable latch on interrupt-enabled inputs */
630707 pca953x_write_regs(chip, PCAL953X_IN_LATCH, chip->irq_mask);
@@ -635,7 +712,11 @@ static void pca953x_irq_bus_sync_unlock(struct irq_data *d) · 4 unmodified lines
635712 pca953x_write_regs(chip, PCAL953X_INT_MASK, irq_mask);
636713 }
637714
715+ /* Switch direction to input if needed */
716+ pca953x_read_regs(chip, chip->regs->direction, reg_direction);
717+
638718 bitmap_or(irq_mask, chip->irq_trig_fall, chip->irq_trig_raise, gc->ngpio);
719+ bitmap_complement(reg_direction, reg_direction, gc->ngpio);
639720 bitmap_and(irq_mask, irq_mask, reg_direction, gc->ngpio);
640721
641722 /* Look for any newly setup interrupt */
@@ -734,14 +815,16 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid) · 92 unmodified lines
734815 struct gpio_chip *gc = &chip->gpio_chip;
735816 DECLARE_BITMAP(pending, MAX_LINE);
736817 int level;
818+ bool ret;
737819
738− if (!pca953x_irq_pending(chip, pending))
739− return IRQ_NONE;
820+ mutex_lock(&chip->i2c_lock);
821+ ret = pca953x_irq_pending(chip, pending);
822+ mutex_unlock(&chip->i2c_lock);
740823
741824 for_each_set_bit(level, pending, gc->ngpio)
742825 handle_nested_irq(irq_find_mapping(gc->irq.domain, level));
743826
744− return IRQ_HANDLED;
827+ return IRQ_RETVAL(ret);
745828 }
746829
747830 static int pca953x_irq_setup(struct pca953x_chip *chip, int irq_base)
@@ -752,6 +835,12 @@ static int pca953x_irq_setup(struct pca953x_chip *chip, int irq_base) · 4 unmodified lines
752835 DECLARE_BITMAP(irq_stat, MAX_LINE);
753836 int ret;
754837
838+ if (dmi_first_match(pca953x_dmi_acpi_irq_info)) {
839+ ret = pca953x_acpi_get_irq(&client->dev);
840+ if (ret > 0)
841+ client->irq = ret;
842+ }
843+
755844 if (!client->irq)
756845 return 0;
757846
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c+15−5
@@ -1295,27 +1295,37 @@ static void amdgpu_ib_preempt_job_recovery(struct drm_gpu_scheduler *sched) · 1294 unmodified lines
12951295 static void amdgpu_ib_preempt_mark_partial_job(struct amdgpu_ring *ring)
12961296 {
12971297 struct amdgpu_job *job;
1298− struct drm_sched_job *s_job;
1298+ struct drm_sched_job *s_job, *tmp;
12991299 uint32_t preempt_seq;
13001300 struct dma_fence *fence, **ptr;
13011301 struct amdgpu_fence_driver *drv = &ring->fence_drv;
13021302 struct drm_gpu_scheduler *sched = &ring->sched;
1303+ bool preempted = true;
13031304
13041305 if (ring->funcs->type != AMDGPU_RING_TYPE_GFX)
13051306 return;
13061307
13071308 preempt_seq = le32_to_cpu(*(drv->cpu_addr + 2));
1308− if (preempt_seq <= atomic_read(&drv->last_seq))
1309− return;
1309+ if (preempt_seq <= atomic_read(&drv->last_seq)) {
1310+ preempted = false;
1311+ goto no_preempt;
1312+ }
13101313
13111314 preempt_seq &= drv->num_fences_mask;
13121315 ptr = &drv->fences[preempt_seq];
13131316 fence = rcu_dereference_protected(*ptr, 1);
13141317
1318+no_preempt:
13151319 spin_lock(&sched->job_list_lock);
1316− list_for_each_entry(s_job, &sched->ring_mirror_list, node) {
1320+ list_for_each_entry_safe(s_job, tmp, &sched->ring_mirror_list, node) {
1321+ if (dma_fence_is_signaled(&s_job->s_fence->finished)) {
1322+ /* remove job from ring_mirror_list */
1323+ list_del_init(&s_job->node);
1324+ sched->ops->free_job(s_job);
1325+ continue;
1326+ }
13171327 job = to_amdgpu_job(s_job);
1318− if (job->fence == fence)
1328+ if (preempted && job->fence == fence)
13191329 /* mark the job as preempted */
13201330 job->preemption_status |= AMDGPU_IB_PREEMPTED;
13211331 }
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c+2−1
@@ -37,7 +37,8 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job) · 36 unmodified lines
3737
3838 memset(&ti, 0, sizeof(struct amdgpu_task_info));
3939
40− if (amdgpu_ring_soft_recovery(ring, job->vmid, s_job->s_fence->parent)) {
40+ if (amdgpu_gpu_recovery &&
41+ amdgpu_ring_soft_recovery(ring, job->vmid, s_job->s_fence->parent)) {
4142 DRM_ERROR("ring %s timeout, but soft recovered\n",
4243 s_job->sched->name);
4344 return;
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c+2−1
@@ -692,9 +692,10 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file · 691 unmodified lines
692692 return n ? -EFAULT : 0;
693693 }
694694 case AMDGPU_INFO_DEV_INFO: {
695− struct drm_amdgpu_info_device dev_info = {};
695+ struct drm_amdgpu_info_device dev_info;
696696 uint64_t vm_size;
697697
698+ memset(&dev_info, 0, sizeof(dev_info));
698699 dev_info.device_id = dev->pdev->device;
699700 dev_info.chip_rev = adev->rev_id;
700701 dev_info.external_rev = adev->external_rev_id;
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c+59−4
@@ -372,6 +372,52 @@ static int psp_tmr_load(struct psp_context *psp) · 371 unmodified lines
372372 return ret;
373373 }
374374
375+static void psp_prep_tmr_unload_cmd_buf(struct psp_context *psp,
376+ struct psp_gfx_cmd_resp *cmd)
377+{
378+ if (amdgpu_sriov_vf(psp->adev))
379+ cmd->cmd_id = GFX_CMD_ID_DESTROY_VMR;
380+ else
381+ cmd->cmd_id = GFX_CMD_ID_DESTROY_TMR;
382+}
383+
384+static int psp_tmr_unload(struct psp_context *psp)
385+{
386+ int ret;
387+ struct psp_gfx_cmd_resp *cmd;
388+
389+ cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);
390+ if (!cmd)
391+ return -ENOMEM;
392+
393+ psp_prep_tmr_unload_cmd_buf(psp, cmd);
394+ DRM_INFO("free PSP TMR buffer\n");
395+
396+ ret = psp_cmd_submit_buf(psp, NULL, cmd,
397+ psp->fence_buf_mc_addr);
398+
399+ kfree(cmd);
400+
401+ return ret;
402+}
403+
404+static int psp_tmr_terminate(struct psp_context *psp)
405+{
406+ int ret;
407+ void *tmr_buf;
408+ void **pptr;
409+
410+ ret = psp_tmr_unload(psp);
411+ if (ret)
412+ return ret;
413+
414+ /* free TMR memory buffer */
415+ pptr = amdgpu_sriov_vf(psp->adev) ? &tmr_buf : NULL;
416+ amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, pptr);
417+
418+ return 0;
419+}
420+
375421 static void psp_prep_asd_load_cmd_buf(struct psp_gfx_cmd_resp *cmd,
376422 uint64_t asd_mc, uint32_t size)
377423 {
@@ -1779,8 +1825,6 @@ static int psp_hw_fini(void *handle) · 1401 unmodified lines
17791825 {
17801826 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
17811827 struct psp_context *psp = &adev->psp;
1782− void *tmr_buf;
1783− void **pptr;
17841828
17851829 if (psp->adev->psp.ta_fw) {
17861830 psp_ras_terminate(psp);
@@ -1790,10 +1834,9 @@ static int psp_hw_fini(void *handle) · 3 unmodified lines
17901834
17911835 psp_asd_unload(psp);
17921836
1837+ psp_tmr_terminate(psp);
17931838 psp_ring_destroy(psp, PSP_RING_TYPE__KM);
17941839
1795− pptr = amdgpu_sriov_vf(psp->adev) ? &tmr_buf : NULL;
1796− amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, pptr);
17971840 amdgpu_bo_free_kernel(&psp->fw_pri_bo,
17981841 &psp->fw_pri_mc_addr, &psp->fw_pri_buf);
17991842 amdgpu_bo_free_kernel(&psp->fence_buf_bo,
@@ -1840,6 +1883,18 @@ static int psp_suspend(void *handle) · 40 unmodified lines
18401883 }
18411884 }
18421885
1886+ ret = psp_asd_unload(psp);
1887+ if (ret) {
1888+ DRM_ERROR("Failed to unload asd\n");
1889+ return ret;
1890+ }
1891+
1892+ ret = psp_tmr_terminate(psp);
1893+ if (ret) {
1894+ DRM_ERROR("Falied to terminate tmr\n");
1895+ return ret;
1896+ }
1897+
18431898 ret = psp_ring_stop(psp, PSP_RING_TYPE__KM);
18441899 if (ret) {
18451900 DRM_ERROR("PSP ring stop failed\n");
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c+8−1
@@ -7513,12 +7513,17 @@ static int gfx_v10_0_ring_preempt_ib(struct amdgpu_ring *ring) · 7512 unmodified lines
75137513 struct amdgpu_device *adev = ring->adev;
75147514 struct amdgpu_kiq *kiq = &adev->gfx.kiq;
75157515 struct amdgpu_ring *kiq_ring = &kiq->ring;
7516+ unsigned long flags;
75167517
75177518 if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues)
75187519 return -EINVAL;
75197520
7520− if (amdgpu_ring_alloc(kiq_ring, kiq->pmf->unmap_queues_size))
7521+ spin_lock_irqsave(&kiq->ring_lock, flags);
7522+
7523+ if (amdgpu_ring_alloc(kiq_ring, kiq->pmf->unmap_queues_size)) {
7524+ spin_unlock_irqrestore(&kiq->ring_lock, flags);
75217525 return -ENOMEM;
7526+ }
75227527
75237528 /* assert preemption condition */
75247529 amdgpu_ring_set_preempt_cond_exec(ring, false);
@@ -7529,6 +7534,8 @@ static int gfx_v10_0_ring_preempt_ib(struct amdgpu_ring *ring) · 4 unmodified lines
75297534 ++ring->trail_seq);
75307535 amdgpu_ring_commit(kiq_ring);
75317536
7537+ spin_unlock_irqrestore(&kiq->ring_lock, flags);
7538+
75327539 /* poll the trailing fence */
75337540 for (i = 0; i < adev->usec_timeout; i++) {
75347541 if (ring->trail_seq ==
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c+8−18
@@ -314,30 +314,20 @@ static uint64_t sdma_v5_0_ring_get_rptr(struct amdgpu_ring *ring) · 313 unmodified lines
314314 static uint64_t sdma_v5_0_ring_get_wptr(struct amdgpu_ring *ring)
315315 {
316316 struct amdgpu_device *adev = ring->adev;
317− u64 *wptr = NULL;
318− uint64_t local_wptr = 0;
317+ u64 wptr;
319318
320319 if (ring->use_doorbell) {
321320 /* XXX check if swapping is necessary on BE */
322− wptr = ((u64 *)&adev->wb.wb[ring->wptr_offs]);
323− DRM_DEBUG("wptr/doorbell before shift == 0x%016llx\n", *wptr);
324− *wptr = (*wptr) >> 2;
325− DRM_DEBUG("wptr/doorbell after shift == 0x%016llx\n", *wptr);
321+ wptr = READ_ONCE(*((u64 *)&adev->wb.wb[ring->wptr_offs]));
322+ DRM_DEBUG("wptr/doorbell before shift == 0x%016llx\n", wptr);
326323 } else {
327− u32 lowbit, highbit;
328−
329− wptr = &local_wptr;
330− lowbit = RREG32(sdma_v5_0_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR)) >> 2;
331− highbit = RREG32(sdma_v5_0_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR_HI)) >> 2;
332−
333− DRM_DEBUG("wptr [%i]high== 0x%08x low==0x%08x\n",
334− ring->me, highbit, lowbit);
335− *wptr = highbit;
336− *wptr = (*wptr) << 32;
337− *wptr |= lowbit;
324+ wptr = RREG32(sdma_v5_0_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR_HI));
325+ wptr = wptr << 32;
326+ wptr |= RREG32(sdma_v5_0_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR));
327+ DRM_DEBUG("wptr before shift [%i] wptr == 0x%016llx\n", ring->me, wptr);
338328 }
339329
340− return *wptr;
330+ return wptr >> 2;
341331 }
342332
343333 /**
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+42−10
@@ -974,6 +974,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) · 973 unmodified lines
974974 /* Update the actual used number of crtc */
975975 adev->mode_info.num_crtc = adev->dm.display_indexes_num;
976976
977+ /* create fake encoders for MST */
978+ dm_dp_create_fake_mst_encoders(adev);
979+
977980 /* TODO: Add_display_info? */
978981
979982 /* TODO use dynamic cursor width */
@@ -997,6 +1000,12 @@ error: · 17 unmodified lines
9971000
9981001 static void amdgpu_dm_fini(struct amdgpu_device *adev)
9991002 {
1003+ int i;
1004+
1005+ for (i = 0; i < adev->dm.display_indexes_num; i++) {
1006+ drm_encoder_cleanup(&adev->dm.mst_encoders[i].base);
1007+ }
1008+
10001009 amdgpu_dm_audio_fini(adev);
10011010
10021011 amdgpu_dm_destroy_drm_device(&adev->dm);
@@ -1358,7 +1367,7 @@ static int dm_late_init(void *handle) · 355 unmodified lines
13581367 struct dmcu *dmcu = NULL;
13591368 bool ret;
13601369
1361− if (!adev->dm.fw_dmcu)
1370+ if (!adev->dm.fw_dmcu && !adev->dm.dmub_fw)
13621371 return detect_mst_link_for_all_connectors(adev->ddev);
13631372
13641373 dmcu = adev->dm.dc->res_pool->dmcu;
@@ -2010,6 +2019,7 @@ static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector) · 645 unmodified lines
20102019 struct amdgpu_display_manager *dm;
20112020 struct drm_connector *conn_base;
20122021 struct amdgpu_device *adev;
2022+ struct dc_link *link = NULL;
20132023 static const u8 pre_computed_values[] = {
20142024 50, 51, 52, 53, 55, 56, 57, 58, 59, 61, 62, 63, 65, 66, 68, 69,
20152025 71, 72, 74, 75, 77, 79, 81, 82, 84, 86, 88, 90, 92, 94, 96, 98};
@@ -2017,6 +2027,10 @@ static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector) · 1 unmodified line
20172027 if (!aconnector || !aconnector->dc_link)
20182028 return;
20192029
2030+ link = aconnector->dc_link;
2031+ if (link->connector_signal != SIGNAL_TYPE_EDP)
2032+ return;
2033+
20202034 conn_base = &aconnector->base;
20212035 adev = conn_base->dev->dev_private;
20222036 dm = &adev->dm;
@@ -8703,20 +8717,38 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, · 6680 unmodified lines
87038717 * the same resource. If we have a new DC context as part of
87048718 * the DM atomic state from validation we need to free it and
87058719 * retain the existing one instead.
8720+ *
8721+ * Furthermore, since the DM atomic state only contains the DC
8722+ * context and can safely be annulled, we can free the state
8723+ * and clear the associated private object now to free
8724+ * some memory and avoid a possible use-after-free later.
87068725 */
8707− struct dm_atomic_state *new_dm_state, *old_dm_state;
87088726
8709− new_dm_state = dm_atomic_get_new_state(state);
8710− old_dm_state = dm_atomic_get_old_state(state);
8727+ for (i = 0; i < state->num_private_objs; i++) {
8728+ struct drm_private_obj *obj = state->private_objs[i].ptr;
87118729
8712− if (new_dm_state && old_dm_state) {
8713− if (new_dm_state->context)
8714− dc_release_state(new_dm_state->context);
8730+ if (obj->funcs == adev->dm.atomic_obj.funcs) {
8731+ int j = state->num_private_objs-1;
87158732
8716− new_dm_state->context = old_dm_state->context;
8733+ dm_atomic_destroy_state(obj,
8734+ state->private_objs[i].state);
8735+
8736+ /* If i is not at the end of the array then the
8737+ * last element needs to be moved to where i was
8738+ * before the array can safely be truncated.
8739+ */
8740+ if (i != j)
8741+ state->private_objs[i] =
8742+ state->private_objs[j];
87178743
8718− if (old_dm_state->context)
8719− dc_retain_state(old_dm_state->context);
8744+ state->private_objs[j].ptr = NULL;
8745+ state->private_objs[j].state = NULL;
8746+ state->private_objs[j].old_state = NULL;
8747+ state->private_objs[j].new_state = NULL;
8748+
8749+ state->num_private_objs = j;
8750+ break;
8751+ }
87208752 }
87218753 }
87228754
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h+10−1
@@ -43,6 +43,9 @@ · 42 unmodified lines
4343 */
4444
4545 #define AMDGPU_DM_MAX_DISPLAY_INDEX 31
46+
47+#define AMDGPU_DM_MAX_CRTC 6
48+
4649 /*
4750 #include "include/amdgpu_dal_power_if.h"
4851 #include "amdgpu_dm_irq.h"
@@ -328,6 +331,13 @@ struct amdgpu_display_manager { · 279 unmodified lines
328331 * available in FW
329332 */
330333 const struct gpu_info_soc_bounding_box_v1_0 *soc_bounding_box;
334+
335+ /**
336+ * @mst_encoders:
337+ *
338+ * fake encoders used for DP MST.
339+ */
340+ struct amdgpu_encoder mst_encoders[AMDGPU_DM_MAX_CRTC];
331341 };
332342
333343 struct amdgpu_dm_connector {
@@ -356,7 +366,6 @@ struct amdgpu_dm_connector { · 22 unmodified lines
356366 struct amdgpu_dm_dp_aux dm_dp_aux;
357367 struct drm_dp_mst_port *port;
358368 struct amdgpu_dm_connector *mst_port;
359− struct amdgpu_encoder *mst_encoder;
360369 struct drm_dp_aux *dsc_aux;
361370
362371 /* TODO see if we can merge with ddc_bus or make a dm_connector */
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c+26−27
@@ -95,7 +95,6 @@ dm_dp_mst_connector_destroy(struct drm_connector *connector) · 94 unmodified lines
9595 {
9696 struct amdgpu_dm_connector *aconnector =
9797 to_amdgpu_dm_connector(connector);
98− struct amdgpu_encoder *amdgpu_encoder = aconnector->mst_encoder;
9998
10099 if (aconnector->dc_sink) {
101100 dc_link_remove_remote_sink(aconnector->dc_link,
@@ -105,8 +104,6 @@ dm_dp_mst_connector_destroy(struct drm_connector *connector) · 3 unmodified lines
105104
106105 kfree(aconnector->edid);
107106
108− drm_encoder_cleanup(&amdgpu_encoder->base);
109− kfree(amdgpu_encoder);
110107 drm_connector_cleanup(connector);
111108 drm_dp_mst_put_port_malloc(aconnector->port);
112109 kfree(aconnector);
@@ -243,7 +240,11 @@ static struct drm_encoder * · 130 unmodified lines
243240 dm_mst_atomic_best_encoder(struct drm_connector *connector,
244241 struct drm_connector_state *connector_state)
245242 {
246− return &to_amdgpu_dm_connector(connector)->mst_encoder->base;
243+ struct drm_device *dev = connector->dev;
244+ struct amdgpu_device *adev = dev->dev_private;
245+ struct amdgpu_crtc *acrtc = to_amdgpu_crtc(connector_state->crtc);
246+
247+ return &adev->dm.mst_encoders[acrtc->crtc_id].base;
247248 }
248249
249250 static int
@@ -306,31 +307,27 @@ static const struct drm_encoder_funcs amdgpu_dm_encoder_funcs = { · 56 unmodified lines
306307 .destroy = amdgpu_dm_encoder_destroy,
307308 };
308309
309−static struct amdgpu_encoder *
310−dm_dp_create_fake_mst_encoder(struct amdgpu_dm_connector *connector)
310+void
311+dm_dp_create_fake_mst_encoders(struct amdgpu_device *adev)
311312 {
312− struct drm_device *dev = connector->base.dev;
313− struct amdgpu_device *adev = dev->dev_private;
314− struct amdgpu_encoder *amdgpu_encoder;
315− struct drm_encoder *encoder;
316−
317− amdgpu_encoder = kzalloc(sizeof(*amdgpu_encoder), GFP_KERNEL);
318− if (!amdgpu_encoder)
319− return NULL;
313+ struct drm_device *dev = adev->ddev;
314+ int i;
320315
321− encoder = &amdgpu_encoder->base;
322− encoder->possible_crtcs = amdgpu_dm_get_encoder_crtc_mask(adev);
316+ for (i = 0; i < adev->dm.display_indexes_num; i++) {
317+ struct amdgpu_encoder *amdgpu_encoder = &adev->dm.mst_encoders[i];
318+ struct drm_encoder *encoder = &amdgpu_encoder->base;
323319
324− drm_encoder_init(
325− dev,
326− &amdgpu_encoder->base,
327− &amdgpu_dm_encoder_funcs,
328− DRM_MODE_ENCODER_DPMST,
329− NULL);
320+ encoder->possible_crtcs = amdgpu_dm_get_encoder_crtc_mask(adev);
330321
331− drm_encoder_helper_add(encoder, &amdgpu_dm_encoder_helper_funcs);
322+ drm_encoder_init(
323+ dev,
324+ &amdgpu_encoder->base,
325+ &amdgpu_dm_encoder_funcs,
326+ DRM_MODE_ENCODER_DPMST,
327+ NULL);
332328
333− return amdgpu_encoder;
329+ drm_encoder_helper_add(encoder, &amdgpu_dm_encoder_helper_funcs);
330+ }
334331 }
335332
336333 static struct drm_connector *
@@ -343,6 +340,7 @@ dm_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr, · 6 unmodified lines
343340 struct amdgpu_device *adev = dev->dev_private;
344341 struct amdgpu_dm_connector *aconnector;
345342 struct drm_connector *connector;
343+ int i;
346344
347345 aconnector = kzalloc(sizeof(*aconnector), GFP_KERNEL);
348346 if (!aconnector)
@@ -369,9 +367,10 @@ dm_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr, · 20 unmodified lines
369367 master->dc_link,
370368 master->connector_id);
371369
372− aconnector->mst_encoder = dm_dp_create_fake_mst_encoder(master);
373− drm_connector_attach_encoder(&aconnector->base,
374− &aconnector->mst_encoder->base);
370+ for (i = 0; i < adev->dm.display_indexes_num; i++) {
371+ drm_connector_attach_encoder(&aconnector->base,
372+ &adev->dm.mst_encoders[i].base);
373+ }
375374
376375 connector->max_bpc_property = master->base.max_bpc_property;
377376 if (connector->max_bpc_property)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h+3−0
@@ -35,6 +35,9 @@ void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm, · 34 unmodified lines
3535 struct amdgpu_dm_connector *aconnector,
3636 int link_index);
3737
38+void
39+dm_dp_create_fake_mst_encoders(struct amdgpu_device *adev);
40+
3841 #if defined(CONFIG_DRM_AMD_DC_DCN)
3942 bool compute_mst_dsc_configs_for_state(struct drm_atomic_state *state,
4043 struct dc_state *dc_state);
drivers/gpu/drm/amd/display/dc/core/dc_stream.c+16−3
@@ -56,7 +56,7 @@ void update_stream_signal(struct dc_stream_state *stream, struct dc_sink *sink) · 55 unmodified lines
5656 }
5757 }
5858
59−static void dc_stream_construct(struct dc_stream_state *stream,
59+static bool dc_stream_construct(struct dc_stream_state *stream,
6060 struct dc_sink *dc_sink_data)
6161 {
6262 uint32_t i = 0;
@@ -118,11 +118,17 @@ static void dc_stream_construct(struct dc_stream_state *stream, · 55 unmodified lines
118118 update_stream_signal(stream, dc_sink_data);
119119
120120 stream->out_transfer_func = dc_create_transfer_func();
121+ if (stream->out_transfer_func == NULL) {
122+ dc_sink_release(dc_sink_data);
123+ return false;
124+ }
121125 stream->out_transfer_func->type = TF_TYPE_BYPASS;
122126 stream->out_transfer_func->ctx = stream->ctx;
123127
124128 stream->stream_id = stream->ctx->dc_stream_id_count;
125129 stream->ctx->dc_stream_id_count++;
130+
131+ return true;
126132 }
127133
128134 static void dc_stream_destruct(struct dc_stream_state *stream)
@@ -164,13 +170,20 @@ struct dc_stream_state *dc_create_stream_for_sink( · 35 unmodified lines
164170
165171 stream = kzalloc(sizeof(struct dc_stream_state), GFP_KERNEL);
166172 if (stream == NULL)
167− return NULL;
173+ goto alloc_fail;
168174
169− dc_stream_construct(stream, sink);
175+ if (dc_stream_construct(stream, sink) == false)
176+ goto construct_fail;
170177
171178 kref_init(&stream->refcount);
172179
173180 return stream;
181+
182+construct_fail:
183+ kfree(stream);
184+
185+alloc_fail:
186+ return NULL;
174187 }
175188
176189 struct dc_stream_state *dc_copy_stream(const struct dc_stream_state *stream)
drivers/gpu/drm/amd/powerplay/renoir_ppt.c+1−1
@@ -689,7 +689,7 @@ static int renoir_set_power_profile_mode(struct smu_context *smu, long *input, u · 688 unmodified lines
689689 return -EINVAL;
690690 }
691691
692− ret = smu_send_smc_msg_with_param(smu, SMU_MSG_SetWorkloadMask,
692+ ret = smu_send_smc_msg_with_param(smu, SMU_MSG_ActiveProcessNotify,
693693 1 << workload_type,
694694 NULL);
695695 if (ret) {
drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c+6−4
@@ -644,9 +644,6 @@ static int vegam_get_dependency_volt_by_clk(struct pp_hwmgr *hwmgr, · 643 unmodified lines
644644
645645 /* sclk is bigger than max sclk in the dependence table */
646646 *voltage |= (dep_table->entries[i - 1].vddc * VOLTAGE_SCALE) << VDDC_SHIFT;
647− vddci = phm_find_closest_vddci(&(data->vddci_voltage_table),
648− (dep_table->entries[i - 1].vddc -
649− (uint16_t)VDDC_VDDCI_DELTA));
650647
651648 if (SMU7_VOLTAGE_CONTROL_NONE == data->vddci_control)
652649 *voltage |= (data->vbios_boot_state.vddci_bootup_value *
@@ -654,8 +651,13 @@ static int vegam_get_dependency_volt_by_clk(struct pp_hwmgr *hwmgr, · 1 unmodified line
654651 else if (dep_table->entries[i - 1].vddci)
655652 *voltage |= (dep_table->entries[i - 1].vddci *
656653 VOLTAGE_SCALE) << VDDC_SHIFT;
657− else
654+ else {
655+ vddci = phm_find_closest_vddci(&(data->vddci_voltage_table),
656+ (dep_table->entries[i - 1].vddc -
657+ (uint16_t)VDDC_VDDCI_DELTA));
658+
658659 *voltage |= (vddci * VOLTAGE_SCALE) << VDDCI_SHIFT;
660+ }
659661
660662 if (SMU7_VOLTAGE_CONTROL_NONE == data->mvdd_control)
661663 *mvdd = data->vbios_boot_state.mvdd_bootup_value * VOLTAGE_SCALE;
drivers/gpu/drm/aspeed/aspeed_gfx_drv.c+1−2
@@ -173,8 +173,6 @@ static int aspeed_gfx_load(struct drm_device *drm) · 172 unmodified lines
173173
174174 drm_mode_config_reset(drm);
175175
176− drm_fbdev_generic_setup(drm, 32);
177−
178176 return 0;
179177 }
180178
@@ -225,6 +223,7 @@ static int aspeed_gfx_probe(struct platform_device *pdev) · 44 unmodified lines
225223 if (ret)
226224 goto err_unload;
227225
226+ drm_fbdev_generic_setup(&priv->drm, 32);
228227 return 0;
229228
230229 err_unload:
drivers/gpu/drm/bochs/bochs_kms.c+1−0
@@ -146,6 +146,7 @@ int bochs_kms_init(struct bochs_device *bochs) · 145 unmodified lines
146146 bochs->dev->mode_config.preferred_depth = 24;
147147 bochs->dev->mode_config.prefer_shadow = 0;
148148 bochs->dev->mode_config.prefer_shadow_fbdev = 1;
149+ bochs->dev->mode_config.fbdev_use_iomem = true;
149150 bochs->dev->mode_config.quirk_addfb_prefer_host_byte_order = true;
150151
151152 bochs->dev->mode_config.funcs = &bochs_mode_funcs;
drivers/gpu/drm/bridge/adv7511/adv7511_drv.c+1−0
@@ -1224,6 +1224,7 @@ static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id) · 1223 unmodified lines
12241224
12251225 adv7511->bridge.funcs = &adv7511_bridge_funcs;
12261226 adv7511->bridge.of_node = dev->of_node;
1227+ adv7511->bridge.type = DRM_MODE_CONNECTOR_HDMIA;
12271228
12281229 drm_bridge_add(&adv7511->bridge);
12291230
drivers/gpu/drm/bridge/nwl-dsi.c+0−5
@@ -917,11 +917,6 @@ static int nwl_dsi_bridge_attach(struct drm_bridge *bridge, · 916 unmodified lines
917917 struct drm_panel *panel;
918918 int ret;
919919
920− if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
921− DRM_ERROR("Fix bridge driver to make connector optional!");
922− return -EINVAL;
923− }
924−
925920 ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 1, 0, &panel,
926921 &panel_bridge);
927922 if (ret)
drivers/gpu/drm/drm_fb_helper.c+5−1
@@ -399,7 +399,11 @@ static void drm_fb_helper_dirty_blit_real(struct drm_fb_helper *fb_helper, · 398 unmodified lines
399399 unsigned int y;
400400
401401 for (y = clip->y1; y < clip->y2; y++) {
402− memcpy(dst, src, len);
402+ if (!fb_helper->dev->mode_config.fbdev_use_iomem)
403+ memcpy(dst, src, len);
404+ else
405+ memcpy_toio((void __iomem *)dst, src, len);
406+
403407 src += fb->pitches[0];
404408 dst += fb->pitches[0];
405409 }
drivers/gpu/drm/drm_gem.c+4−6
@@ -871,9 +871,6 @@ err: · 870 unmodified lines
871871 * @file_priv: drm file-private structure
872872 *
873873 * Open an object using the global name, returning a handle and the size.
874− *
875− * This handle (of course) holds a reference to the object, so the object
876− * will not go away until the handle is deleted.
877874 */
878875 int
879876 drm_gem_open_ioctl(struct drm_device *dev, void *data,
@@ -898,14 +895,15 @@ drm_gem_open_ioctl(struct drm_device *dev, void *data, · 18 unmodified lines
898895
899896 /* drm_gem_handle_create_tail unlocks dev->object_name_lock. */
900897 ret = drm_gem_handle_create_tail(file_priv, obj, &handle);
901− drm_gem_object_put_unlocked(obj);
902898 if (ret)
903− return ret;
899+ goto err;
904900
905901 args->handle = handle;
906902 args->size = obj->size;
907903
908− return 0;
904+err:
905+ drm_gem_object_put_unlocked(obj);
906+ return ret;
909907 }
910908
911909 /**
drivers/gpu/drm/drm_mipi_dbi.c+1−1
@@ -923,7 +923,7 @@ static int mipi_dbi_spi1_transfer(struct mipi_dbi *dbi, int dc, · 922 unmodified lines
923923 }
924924 }
925925
926− tr.len = chunk;
926+ tr.len = chunk * 2;
927927 len -= chunk;
928928
929929 ret = spi_sync(spi, &m);
drivers/gpu/drm/drm_of.c+1−3
@@ -322,10 +322,8 @@ static int drm_of_lvds_get_remote_pixels_type( · 321 unmodified lines
322322 * configurations by passing the endpoints explicitly to
323323 * drm_of_lvds_get_dual_link_pixel_order().
324324 */
325− if (!current_pt || pixels_type != current_pt) {
326− of_node_put(remote_port);
325+ if (!current_pt || pixels_type != current_pt)
327326 return -EINVAL;
328− }
329327 }
330328
331329 return pixels_type;
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c+3−2
@@ -307,8 +307,6 @@ static int hibmc_load(struct drm_device *dev) · 306 unmodified lines
307307 /* reset all the states of crtc/plane/encoder/connector */
308308 drm_mode_config_reset(dev);
309309
310− drm_fbdev_generic_setup(dev, dev->mode_config.preferred_depth);
311−
312310 return 0;
313311
314312 err:
@@ -355,6 +353,9 @@ static int hibmc_pci_probe(struct pci_dev *pdev, · 40 unmodified lines
355353 ret);
356354 goto err_unload;
357355 }
356+
357+ drm_fbdev_generic_setup(dev, dev->mode_config.preferred_depth);
358+
358359 return 0;
359360
360361 err_unload:
drivers/gpu/drm/i915/display/intel_display.c+11−0
@@ -3822,6 +3822,17 @@ skl_check_main_ccs_coordinates(struct intel_plane_state *plane_state, · 3821 unmodified lines
38223822 return true;
38233823 }
38243824
3825+unsigned int
3826+intel_plane_fence_y_offset(const struct intel_plane_state *plane_state)
3827+{
3828+ int x = 0, y = 0;
3829+
3830+ intel_plane_adjust_aligned_offset(&x, &y, plane_state, 0,
3831+ plane_state->color_plane[0].offset, 0);
3832+
3833+ return y;
3834+}
3835+
38253836 static int skl_check_main_surface(struct intel_plane_state *plane_state)
38263837 {
38273838 struct drm_i915_private *dev_priv = to_i915(plane_state->uapi.plane->dev);
drivers/gpu/drm/i915/display/intel_display.h+1−0
@@ -608,6 +608,7 @@ unsigned int i9xx_plane_max_stride(struct intel_plane *plane, · 607 unmodified lines
608608 u32 pixel_format, u64 modifier,
609609 unsigned int rotation);
610610 int bdw_get_pipemisc_bpp(struct intel_crtc *crtc);
611+unsigned int intel_plane_fence_y_offset(const struct intel_plane_state *plane_state);
611612
612613 struct intel_display_error_state *
613614 intel_display_capture_error_state(struct drm_i915_private *dev_priv);
drivers/gpu/drm/i915/display/intel_fbc.c+36−29
@@ -47,19 +47,6 @@ · 46 unmodified lines
4747 #include "intel_fbc.h"
4848 #include "intel_frontbuffer.h"
4949
50−/*
51− * In some platforms where the CRTC's x:0/y:0 coordinates doesn't match the
52− * frontbuffer's x:0/y:0 coordinates we lie to the hardware about the plane's
53− * origin so the x and y offsets can actually fit the registers. As a
54− * consequence, the fence doesn't really start exactly at the display plane
55− * address we program because it starts at the real start of the buffer, so we
56− * have to take this into consideration here.
57− */
58−static unsigned int get_crtc_fence_y_offset(struct intel_fbc *fbc)
59−{
60− return fbc->state_cache.plane.y - fbc->state_cache.plane.adjusted_y;
61−}
62−
6350 /*
6451 * For SKL+, the plane source size used by the hardware is based on the value we
6552 * write to the PLANE_SIZE register. For BDW-, the hardware looks at the value
@@ -141,7 +128,7 @@ static void i8xx_fbc_activate(struct drm_i915_private *dev_priv) · 75 unmodified lines
141128 fbc_ctl2 |= FBC_CTL_CPU_FENCE;
142129 intel_de_write(dev_priv, FBC_CONTROL2, fbc_ctl2);
143130 intel_de_write(dev_priv, FBC_FENCE_OFF,
144− params->crtc.fence_y_offset);
131+ params->fence_y_offset);
145132 }
146133
147134 /* enable it... */
@@ -175,7 +162,7 @@ static void g4x_fbc_activate(struct drm_i915_private *dev_priv) · 27 unmodified lines
175162 if (params->fence_id >= 0) {
176163 dpfc_ctl |= DPFC_CTL_FENCE_EN | params->fence_id;
177164 intel_de_write(dev_priv, DPFC_FENCE_YOFF,
178− params->crtc.fence_y_offset);
165+ params->fence_y_offset);
179166 } else {
180167 intel_de_write(dev_priv, DPFC_FENCE_YOFF, 0);
181168 }
@@ -243,7 +230,7 @@ static void ilk_fbc_activate(struct drm_i915_private *dev_priv) · 61 unmodified lines
243230 intel_de_write(dev_priv, SNB_DPFC_CTL_SA,
244231 SNB_CPU_FENCE_ENABLE | params->fence_id);
245232 intel_de_write(dev_priv, DPFC_CPU_FENCE_OFFSET,
246− params->crtc.fence_y_offset);
233+ params->fence_y_offset);
247234 }
248235 } else {
249236 if (IS_GEN(dev_priv, 6)) {
@@ -253,7 +240,7 @@ static void ilk_fbc_activate(struct drm_i915_private *dev_priv) · 3 unmodified lines
253240 }
254241
255242 intel_de_write(dev_priv, ILK_DPFC_FENCE_YOFF,
256− params->crtc.fence_y_offset);
243+ params->fence_y_offset);
257244 /* enable it... */
258245 intel_de_write(dev_priv, ILK_DPFC_CONTROL, dpfc_ctl | DPFC_CTL_EN);
259246
@@ -320,7 +307,7 @@ static void gen7_fbc_activate(struct drm_i915_private *dev_priv) · 60 unmodified lines
320307 intel_de_write(dev_priv, SNB_DPFC_CTL_SA,
321308 SNB_CPU_FENCE_ENABLE | params->fence_id);
322309 intel_de_write(dev_priv, DPFC_CPU_FENCE_OFFSET,
323− params->crtc.fence_y_offset);
310+ params->fence_y_offset);
324311 } else if (dev_priv->ggtt.num_fences) {
325312 intel_de_write(dev_priv, SNB_DPFC_CTL_SA, 0);
326313 intel_de_write(dev_priv, DPFC_CPU_FENCE_OFFSET, 0);
@@ -631,8 +618,8 @@ static bool rotation_is_valid(struct drm_i915_private *dev_priv, · 304 unmodified lines
631618 /*
632619 * For some reason, the hardware tracking starts looking at whatever we
633620 * programmed as the display plane base address register. It does not look at
634− * the X and Y offset registers. That's why we look at the crtc->adjusted{x,y}
635− * variables instead of just looking at the pipe/plane size.
621+ * the X and Y offset registers. That's why we include the src x/y offsets
622+ * instead of just looking at the plane size.
636623 */
637624 static bool intel_fbc_hw_tracking_covers_screen(struct intel_crtc *crtc)
638625 {
@@ -705,7 +692,6 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc, · 66 unmodified lines
705692 cache->plane.src_h = drm_rect_height(&plane_state->uapi.src) >> 16;
706693 cache->plane.adjusted_x = plane_state->color_plane[0].x;
707694 cache->plane.adjusted_y = plane_state->color_plane[0].y;
708− cache->plane.y = plane_state->uapi.src.y1 >> 16;
709695
710696 cache->plane.pixel_blend_mode = plane_state->hw.pixel_blend_mode;
711697
@@ -713,6 +699,8 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc, · 1 unmodified line
713699 cache->fb.stride = fb->pitches[0];
714700 cache->fb.modifier = fb->modifier;
715701
702+ cache->fence_y_offset = intel_plane_fence_y_offset(plane_state);
703+
716704 drm_WARN_ON(&dev_priv->drm, plane_state->flags & PLANE_HAS_FENCE &&
717705 !plane_state->vma->fence);
718706
@@ -731,6 +719,25 @@ static bool intel_fbc_cfb_size_changed(struct drm_i915_private *dev_priv) · 12 unmodified lines
731719 fbc->compressed_fb.size * fbc->threshold;
732720 }
733721
722+static u16 intel_fbc_gen9_wa_cfb_stride(struct drm_i915_private *dev_priv)
723+{
724+ struct intel_fbc *fbc = &dev_priv->fbc;
725+ struct intel_fbc_state_cache *cache = &fbc->state_cache;
726+
727+ if ((IS_GEN9_BC(dev_priv) || IS_BROXTON(dev_priv)) &&
728+ cache->fb.modifier != I915_FORMAT_MOD_X_TILED)
729+ return DIV_ROUND_UP(cache->plane.src_w, 32 * fbc->threshold) * 8;
730+ else
731+ return 0;
732+}
733+
734+static bool intel_fbc_gen9_wa_cfb_stride_changed(struct drm_i915_private *dev_priv)
735+{
736+ struct intel_fbc *fbc = &dev_priv->fbc;
737+
738+ return fbc->params.gen9_wa_cfb_stride != intel_fbc_gen9_wa_cfb_stride(dev_priv);
739+}
740+
734741 static bool intel_fbc_can_enable(struct drm_i915_private *dev_priv)
735742 {
736743 struct intel_fbc *fbc = &dev_priv->fbc;
@@ -883,12 +890,13 @@ static void intel_fbc_get_reg_params(struct intel_crtc *crtc, · 146 unmodified lines
883890 memset(params, 0, sizeof(*params));
884891
885892 params->fence_id = cache->fence_id;
893+ params->fence_y_offset = cache->fence_y_offset;
886894
887895 params->crtc.pipe = crtc->pipe;
888896 params->crtc.i9xx_plane = to_intel_plane(crtc->base.primary)->i9xx_plane;
889− params->crtc.fence_y_offset = get_crtc_fence_y_offset(fbc);
890897
891898 params->fb.format = cache->fb.format;
899+ params->fb.modifier = cache->fb.modifier;
892900 params->fb.stride = cache->fb.stride;
893901
894902 params->cfb_size = intel_fbc_calculate_cfb_size(dev_priv, cache);
@@ -918,6 +926,9 @@ static bool intel_fbc_can_flip_nuke(const struct intel_crtc_state *crtc_state) · 23 unmodified lines
918926 if (params->fb.format != cache->fb.format)
919927 return false;
920928
929+ if (params->fb.modifier != cache->fb.modifier)
930+ return false;
931+
921932 if (params->fb.stride != cache->fb.stride)
922933 return false;
923934
@@ -1197,7 +1208,8 @@ void intel_fbc_enable(struct intel_atomic_state *state, · 273 unmodified lines
11971208
11981209 if (fbc->crtc) {
11991210 if (fbc->crtc != crtc ||
1200− !intel_fbc_cfb_size_changed(dev_priv))
1211+ (!intel_fbc_cfb_size_changed(dev_priv) &&
1212+ !intel_fbc_gen9_wa_cfb_stride_changed(dev_priv)))
12011213 goto out;
12021214
12031215 __intel_fbc_disable(dev_priv);
@@ -1219,12 +1231,7 @@ void intel_fbc_enable(struct intel_atomic_state *state, · 15 unmodified lines
12191231 goto out;
12201232 }
12211233
1222− if ((IS_GEN9_BC(dev_priv) || IS_BROXTON(dev_priv)) &&
1223− plane_state->hw.fb->modifier != I915_FORMAT_MOD_X_TILED)
1224− cache->gen9_wa_cfb_stride =
1225− DIV_ROUND_UP(cache->plane.src_w, 32 * fbc->threshold) * 8;
1226− else
1227− cache->gen9_wa_cfb_stride = 0;
1234+ cache->gen9_wa_cfb_stride = intel_fbc_gen9_wa_cfb_stride(dev_priv);
12281235
12291236 drm_dbg_kms(&dev_priv->drm, "Enabling FBC on pipe %c\n",
12301237 pipe_name(crtc->pipe));
drivers/gpu/drm/i915/display/intel_hdmi.c+2−8
@@ -2867,19 +2867,13 @@ intel_hdmi_connector_register(struct drm_connector *connector) · 2866 unmodified lines
28672867 return ret;
28682868 }
28692869
2870−static void intel_hdmi_destroy(struct drm_connector *connector)
2870+static void intel_hdmi_connector_unregister(struct drm_connector *connector)
28712871 {
28722872 struct cec_notifier *n = intel_attached_hdmi(to_intel_connector(connector))->cec_notifier;
28732873
28742874 cec_notifier_conn_unregister(n);
28752875
2876− intel_connector_destroy(connector);
2877−}
2878−
2879−static void intel_hdmi_connector_unregister(struct drm_connector *connector)
2880−{
28812876 intel_hdmi_remove_i2c_symlink(connector);
2882−
28832877 intel_connector_unregister(connector);
28842878 }
28852879
@@ -2891,7 +2885,7 @@ static const struct drm_connector_funcs intel_hdmi_connector_funcs = { · 5 unmodified lines
28912885 .atomic_set_property = intel_digital_connector_atomic_set_property,
28922886 .late_register = intel_hdmi_connector_register,
28932887 .early_unregister = intel_hdmi_connector_unregister,
2894− .destroy = intel_hdmi_destroy,
2888+ .destroy = intel_connector_destroy,
28952889 .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
28962890 .atomic_duplicate_state = intel_digital_connector_duplicate_state,
28972891 };
drivers/gpu/drm/i915/gt/intel_context.c+6−6
@@ -204,25 +204,25 @@ static int __ring_active(struct intel_ring *ring) · 203 unmodified lines
204204 {
205205 int err;
206206
207− err = i915_active_acquire(&ring->vma->active);
207+ err = intel_ring_pin(ring);
208208 if (err)
209209 return err;
210210
211− err = intel_ring_pin(ring);
211+ err = i915_active_acquire(&ring->vma->active);
212212 if (err)
213− goto err_active;
213+ goto err_pin;
214214
215215 return 0;
216216
217−err_active:
218− i915_active_release(&ring->vma->active);
217+err_pin:
218+ intel_ring_unpin(ring);
219219 return err;
220220 }
221221
222222 static void __ring_retire(struct intel_ring *ring)
223223 {
224− intel_ring_unpin(ring);
225224 i915_active_release(&ring->vma->active);
225+ intel_ring_unpin(ring);
226226 }
227227
228228 __i915_active_call
drivers/gpu/drm/i915/gt/intel_lrc.c+5−14
@@ -5396,13 +5396,8 @@ static void virtual_engine_initial_hint(struct virtual_engine *ve) · 5395 unmodified lines
53965396 * typically be the first we inspect for submission.
53975397 */
53985398 swp = prandom_u32_max(ve->num_siblings);
5399− if (!swp)
5400− return;
5401−
5402− swap(ve->siblings[swp], ve->siblings[0]);
5403− if (!intel_engine_has_relative_mmio(ve->siblings[0]))
5404− virtual_update_register_offsets(ve->context.lrc_reg_state,
5405− ve->siblings[0]);
5399+ if (swp)
5400+ swap(ve->siblings[swp], ve->siblings[0]);
54065401 }
54075402
54085403 static int virtual_context_alloc(struct intel_context *ce)
@@ -5415,15 +5410,9 @@ static int virtual_context_alloc(struct intel_context *ce) · 6 unmodified lines
54155410 static int virtual_context_pin(struct intel_context *ce)
54165411 {
54175412 struct virtual_engine *ve = container_of(ce, typeof(*ve), context);
5418− int err;
54195413
54205414 /* Note: we must use a real engine class for setting up reg state */
5421− err = __execlists_context_pin(ce, ve->siblings[0]);
5422− if (err)
5423− return err;
5424−
5425− virtual_engine_initial_hint(ve);
5426− return 0;
5415+ return __execlists_context_pin(ce, ve->siblings[0]);
54275416 }
54285417
54295418 static void virtual_context_enter(struct intel_context *ce)
@@ -5688,6 +5677,7 @@ intel_execlists_create_virtual(struct intel_engine_cs **siblings, · 258 unmodified lines
56885677 intel_engine_init_active(&ve->base, ENGINE_VIRTUAL);
56895678 intel_engine_init_breadcrumbs(&ve->base);
56905679 intel_engine_init_execlists(&ve->base);
5680+ ve->base.breadcrumbs.irq_armed = true; /* fake HW, used for irq_work */
56915681
56925682 ve->base.cops = &virtual_context_ops;
56935683 ve->base.request_alloc = execlists_request_alloc;
@@ -5769,6 +5759,7 @@ intel_execlists_create_virtual(struct intel_engine_cs **siblings, · 75 unmodified lines
57695759
57705760 ve->base.flags |= I915_ENGINE_IS_VIRTUAL;
57715761
5762+ virtual_engine_initial_hint(ve);
57725763 return &ve->context;
57735764
57745765 err_put:
drivers/gpu/drm/i915/gt/selftest_rps.c+4−4
@@ -44,9 +44,9 @@ static int cmp_u64(const void *A, const void *B) · 43 unmodified lines
4444 {
4545 const u64 *a = A, *b = B;
4646
47− if (a < b)
47+ if (*a < *b)
4848 return -1;
49− else if (a > b)
49+ else if (*a > *b)
5050 return 1;
5151 else
5252 return 0;
@@ -56,9 +56,9 @@ static int cmp_u32(const void *A, const void *B) · 3 unmodified lines
5656 {
5757 const u32 *a = A, *b = B;
5858
59− if (a < b)
59+ if (*a < *b)
6060 return -1;
61− else if (a > b)
61+ else if (*a > *b)
6262 return 1;
6363 else
6464 return 0;
drivers/gpu/drm/i915/i915_debugfs.c+1−1
@@ -230,7 +230,7 @@ static int per_file_stats(int id, void *ptr, void *data) · 229 unmodified lines
230230 struct file_stats *stats = data;
231231 struct i915_vma *vma;
232232
233− if (!kref_get_unless_zero(&obj->base.refcount))
233+ if (IS_ERR_OR_NULL(obj) || !kref_get_unless_zero(&obj->base.refcount))
234234 return 0;
235235
236236 stats->count++;
drivers/gpu/drm/i915/i915_drv.h+4−3
@@ -410,8 +410,6 @@ struct intel_fbc { · 409 unmodified lines
410410 int adjusted_x;
411411 int adjusted_y;
412412
413− int y;
414−
415413 u16 pixel_blend_mode;
416414 } plane;
417415
@@ -420,6 +418,8 @@ struct intel_fbc { · 2 unmodified lines
420418 unsigned int stride;
421419 u64 modifier;
422420 } fb;
421+
422+ unsigned int fence_y_offset;
423423 u16 gen9_wa_cfb_stride;
424424 s8 fence_id;
425425 } state_cache;
@@ -435,15 +435,16 @@ struct intel_fbc { · 9 unmodified lines
435435 struct {
436436 enum pipe pipe;
437437 enum i9xx_plane_id i9xx_plane;
438− unsigned int fence_y_offset;
439438 } crtc;
440439
441440 struct {
442441 const struct drm_format_info *format;
443442 unsigned int stride;
443+ u64 modifier;
444444 } fb;
445445
446446 int cfb_size;
447+ unsigned int fence_y_offset;
447448 u16 gen9_wa_cfb_stride;
448449 s8 fence_id;
449450 bool plane_visible;
drivers/gpu/drm/i915/i915_perf.c+1−0
@@ -1592,6 +1592,7 @@ static u32 *save_restore_register(struct i915_perf_stream *stream, u32 *cs, · 1591 unmodified lines
15921592 u32 d;
15931593
15941594 cmd = save ? MI_STORE_REGISTER_MEM : MI_LOAD_REGISTER_MEM;
1595+ cmd |= MI_SRM_LRM_GLOBAL_GTT;
15951596 if (INTEL_GEN(stream->perf->i915) >= 8)
15961597 cmd++;
15971598
drivers/gpu/drm/i915/i915_vma.c+6−9
@@ -104,6 +104,7 @@ vma_create(struct drm_i915_gem_object *obj, · 103 unmodified lines
104104 struct i915_address_space *vm,
105105 const struct i915_ggtt_view *view)
106106 {
107+ struct i915_vma *pos = ERR_PTR(-E2BIG);
107108 struct i915_vma *vma;
108109 struct rb_node *rb, **p;
109110
@@ -184,7 +185,6 @@ vma_create(struct drm_i915_gem_object *obj, · 74 unmodified lines
184185 rb = NULL;
185186 p = &obj->vma.tree.rb_node;
186187 while (*p) {
187− struct i915_vma *pos;
188188 long cmp;
189189
190190 rb = *p;
@@ -196,16 +196,12 @@ vma_create(struct drm_i915_gem_object *obj, · 5 unmodified lines
196196 * and dispose of ours.
197197 */
198198 cmp = i915_vma_compare(pos, vm, view);
199− if (cmp == 0) {
200− spin_unlock(&obj->vma.lock);
201− i915_vma_free(vma);
202− return pos;
203− }
204−
205199 if (cmp < 0)
206200 p = &rb->rb_right;
207− else
201+ else if (cmp > 0)
208202 p = &rb->rb_left;
203+ else
204+ goto err_unlock;
209205 }
210206 rb_link_node(&vma->obj_node, rb, p);
211207 rb_insert_color(&vma->obj_node, &obj->vma.tree);
@@ -228,8 +224,9 @@ vma_create(struct drm_i915_gem_object *obj, · 16 unmodified lines
228224 err_unlock:
229225 spin_unlock(&obj->vma.lock);
230226 err_vma:
227+ i915_vm_put(vm);
231228 i915_vma_free(vma);
232− return ERR_PTR(-E2BIG);
229+ return pos;
233230 }
234231
235232 static struct i915_vma *
drivers/gpu/drm/lima/lima_pp.c+2−0
@@ -271,6 +271,8 @@ void lima_pp_fini(struct lima_ip *ip) · 270 unmodified lines
271271
272272 int lima_pp_bcast_resume(struct lima_ip *ip)
273273 {
274+ /* PP has been reset by individual PP resume */
275+ ip->data.async_reset = false;
274276 return 0;
275277 }
276278
drivers/gpu/drm/mcde/mcde_display.c+8−3
@@ -1060,9 +1060,14 @@ static void mcde_display_update(struct drm_simple_display_pipe *pipe, · 1059 unmodified lines
10601060 */
10611061 if (fb) {
10621062 mcde_set_extsrc(mcde, drm_fb_cma_get_gem_addr(fb, pstate, 0));
1063− if (!mcde->video_mode)
1064− /* Send a single frame using software sync */
1065− mcde_display_send_one_frame(mcde);
1063+ if (!mcde->video_mode) {
1064+ /*
1065+ * Send a single frame using software sync if the flow
1066+ * is not active yet.
1067+ */
1068+ if (mcde->flow_active == 0)
1069+ mcde_display_send_one_frame(mcde);
1070+ }
10661071 dev_info_once(mcde->dev, "sent first display update\n");
10671072 } else {
10681073 /*
drivers/gpu/drm/mediatek/Kconfig+1−1
@@ -6,12 +6,12 @@ config DRM_MEDIATEK · 5 unmodified lines
66 depends on COMMON_CLK
77 depends on HAVE_ARM_SMCCC
88 depends on OF
9+ depends on MTK_MMSYS
910 select DRM_GEM_CMA_HELPER
1011 select DRM_KMS_HELPER
1112 select DRM_MIPI_DSI
1213 select DRM_PANEL
1314 select MEMORY
14− select MTK_MMSYS
1515 select MTK_SMI
1616 select VIDEOMODE_HELPERS
1717 help
drivers/gpu/drm/mediatek/mtk_drm_crtc.c+2−6
@@ -193,7 +193,6 @@ static int mtk_crtc_ddp_clk_enable(struct mtk_drm_crtc *mtk_crtc) · 192 unmodified lines
193193 int ret;
194194 int i;
195195
196− DRM_DEBUG_DRIVER("%s\n", __func__);
197196 for (i = 0; i < mtk_crtc->ddp_comp_nr; i++) {
198197 ret = clk_prepare_enable(mtk_crtc->ddp_comp[i]->clk);
199198 if (ret) {
@@ -213,7 +212,6 @@ static void mtk_crtc_ddp_clk_disable(struct mtk_drm_crtc *mtk_crtc) · 13 unmodified lines
213212 {
214213 int i;
215214
216− DRM_DEBUG_DRIVER("%s\n", __func__);
217215 for (i = 0; i < mtk_crtc->ddp_comp_nr; i++)
218216 clk_disable_unprepare(mtk_crtc->ddp_comp[i]->clk);
219217 }
@@ -258,7 +256,6 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc) · 38 unmodified lines
258256 int ret;
259257 int i;
260258
261− DRM_DEBUG_DRIVER("%s\n", __func__);
262259 if (WARN_ON(!crtc->state))
263260 return -EINVAL;
264261
@@ -299,7 +296,6 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc) · 34 unmodified lines
299296 goto err_mutex_unprepare;
300297 }
301298
302− DRM_DEBUG_DRIVER("mediatek_ddp_ddp_path_setup\n");
303299 for (i = 0; i < mtk_crtc->ddp_comp_nr - 1; i++) {
304300 mtk_mmsys_ddp_connect(mtk_crtc->mmsys_dev,
305301 mtk_crtc->ddp_comp[i]->id,
@@ -349,7 +345,6 @@ static void mtk_crtc_ddp_hw_fini(struct mtk_drm_crtc *mtk_crtc) · 43 unmodified lines
349345 struct drm_crtc *crtc = &mtk_crtc->base;
350346 int i;
351347
352− DRM_DEBUG_DRIVER("%s\n", __func__);
353348 for (i = 0; i < mtk_crtc->ddp_comp_nr; i++) {
354349 mtk_ddp_comp_stop(mtk_crtc->ddp_comp[i]);
355350 if (i == 1)
@@ -831,7 +826,8 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev, · 475 unmodified lines
831826
832827 #if IS_REACHABLE(CONFIG_MTK_CMDQ)
833828 mtk_crtc->cmdq_client =
834− cmdq_mbox_create(dev, drm_crtc_index(&mtk_crtc->base),
829+ cmdq_mbox_create(mtk_crtc->mmsys_dev,
830+ drm_crtc_index(&mtk_crtc->base),
835831 2000);
836832 if (IS_ERR(mtk_crtc->cmdq_client)) {
837833 dev_dbg(dev, "mtk_crtc %d failed to create mailbox client, writing register by CPU now\n",
drivers/gpu/drm/mediatek/mtk_drm_drv.c+2−4
@@ -444,7 +444,6 @@ static int mtk_drm_probe(struct platform_device *pdev) · 443 unmodified lines
444444 if (!private)
445445 return -ENOMEM;
446446
447− private->data = of_device_get_match_data(dev);
448447 private->mmsys_dev = dev->parent;
449448 if (!private->mmsys_dev) {
450449 dev_err(dev, "Failed to get MMSYS device\n");
@@ -514,7 +513,8 @@ static int mtk_drm_probe(struct platform_device *pdev) · 63 unmodified lines
514513 goto err_node;
515514 }
516515
517− ret = mtk_ddp_comp_init(dev, node, comp, comp_id, NULL);
516+ ret = mtk_ddp_comp_init(dev->parent, node, comp,
517+ comp_id, NULL);
518518 if (ret) {
519519 of_node_put(node);
520520 goto err_node;
@@ -571,7 +571,6 @@ static int mtk_drm_sys_suspend(struct device *dev) · 50 unmodified lines
571571 int ret;
572572
573573 ret = drm_mode_config_helper_suspend(drm);
574− DRM_DEBUG_DRIVER("mtk_drm_sys_suspend\n");
575574
576575 return ret;
577576 }
@@ -583,7 +582,6 @@ static int mtk_drm_sys_resume(struct device *dev) · 5 unmodified lines
583582 int ret;
584583
585584 ret = drm_mode_config_helper_resume(drm);
586− DRM_DEBUG_DRIVER("mtk_drm_sys_resume\n");
587585
588586 return ret;
589587 }
drivers/gpu/drm/mediatek/mtk_drm_plane.c+15−10
@@ -164,6 +164,16 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, · 163 unmodified lines
164164 true, true);
165165 }
166166
167+static void mtk_plane_atomic_disable(struct drm_plane *plane,
168+ struct drm_plane_state *old_state)
169+{
170+ struct mtk_plane_state *state = to_mtk_plane_state(plane->state);
171+
172+ state->pending.enable = false;
173+ wmb(); /* Make sure the above parameter is set before update */
174+ state->pending.dirty = true;
175+}
176+
167177 static void mtk_plane_atomic_update(struct drm_plane *plane,
168178 struct drm_plane_state *old_state)
169179 {
@@ -178,6 +188,11 @@ static void mtk_plane_atomic_update(struct drm_plane *plane, · 8 unmodified lines
178188 if (!crtc || WARN_ON(!fb))
179189 return;
180190
191+ if (!plane->state->visible) {
192+ mtk_plane_atomic_disable(plane, old_state);
193+ return;
194+ }
195+
181196 gem = fb->obj[0];
182197 mtk_gem = to_mtk_gem_obj(gem);
183198 addr = mtk_gem->dma_addr;
@@ -200,16 +215,6 @@ static void mtk_plane_atomic_update(struct drm_plane *plane, · 16 unmodified lines
200215 state->pending.dirty = true;
201216 }
202217
203−static void mtk_plane_atomic_disable(struct drm_plane *plane,
204− struct drm_plane_state *old_state)
205−{
206− struct mtk_plane_state *state = to_mtk_plane_state(plane->state);
207−
208− state->pending.enable = false;
209− wmb(); /* Make sure the above parameter is set before update */
210− state->pending.dirty = true;
211−}
212−
213218 static const struct drm_plane_helper_funcs mtk_plane_helper_funcs = {
214219 .prepare_fb = drm_gem_fb_prepare_fb,
215220 .atomic_check = mtk_plane_atomic_check,
drivers/gpu/drm/mediatek/mtk_dsi.c+1−4
@@ -316,10 +316,7 @@ static void mtk_dsi_lane0_ulp_mode_leave(struct mtk_dsi *dsi) · 315 unmodified lines
316316
317317 static bool mtk_dsi_clk_hs_state(struct mtk_dsi *dsi)
318318 {
319− u32 tmp_reg1;
320−
321− tmp_reg1 = readl(dsi->regs + DSI_PHY_LCCON);
322− return ((tmp_reg1 & LC_HS_TX_EN) == 1) ? true : false;
319+ return readl(dsi->regs + DSI_PHY_LCCON) & LC_HS_TX_EN;
323320 }
324321
325322 static void mtk_dsi_clk_hs_mode(struct mtk_dsi *dsi, bool enter)
drivers/gpu/drm/mediatek/mtk_hdmi.c+1−11
@@ -1630,8 +1630,6 @@ static int mtk_hdmi_audio_startup(struct device *dev, void *data) · 1629 unmodified lines
16301630 {
16311631 struct mtk_hdmi *hdmi = dev_get_drvdata(dev);
16321632
1633− dev_dbg(dev, "%s\n", __func__);
1634−
16351633 mtk_hdmi_audio_enable(hdmi);
16361634
16371635 return 0;
@@ -1641,8 +1639,6 @@ static void mtk_hdmi_audio_shutdown(struct device *dev, void *data) · 3 unmodified lines
16411639 {
16421640 struct mtk_hdmi *hdmi = dev_get_drvdata(dev);
16431641
1644− dev_dbg(dev, "%s\n", __func__);
1645−
16461642 mtk_hdmi_audio_disable(hdmi);
16471643 }
16481644
@@ -1651,8 +1647,6 @@ mtk_hdmi_audio_digital_mute(struct device *dev, void *data, bool enable) · 2 unmodified lines
16511647 {
16521648 struct mtk_hdmi *hdmi = dev_get_drvdata(dev);
16531649
1654− dev_dbg(dev, "%s(%d)\n", __func__, enable);
1655−
16561650 if (enable)
16571651 mtk_hdmi_hw_aud_mute(hdmi);
16581652 else
@@ -1665,8 +1659,6 @@ static int mtk_hdmi_audio_get_eld(struct device *dev, void *data, uint8_t *buf, · 6 unmodified lines
16651659 {
16661660 struct mtk_hdmi *hdmi = dev_get_drvdata(dev);
16671661
1668− dev_dbg(dev, "%s\n", __func__);
1669−
16701662 memcpy(buf, hdmi->conn.eld, min(sizeof(hdmi->conn.eld), len));
16711663
16721664 return 0;
@@ -1766,7 +1758,6 @@ static int mtk_drm_hdmi_probe(struct platform_device *pdev) · 93 unmodified lines
17661758 goto err_bridge_remove;
17671759 }
17681760
1769− dev_dbg(dev, "mediatek hdmi probe success\n");
17701761 return 0;
17711762
17721763 err_bridge_remove:
@@ -1789,7 +1780,7 @@ static int mtk_hdmi_suspend(struct device *dev) · 16 unmodified lines
17891780 struct mtk_hdmi *hdmi = dev_get_drvdata(dev);
17901781
17911782 mtk_hdmi_clk_disable_audio(hdmi);
1792− dev_dbg(dev, "hdmi suspend success!\n");
1783+
17931784 return 0;
17941785 }
17951786
@@ -1804,7 +1795,6 @@ static int mtk_hdmi_resume(struct device *dev) · 8 unmodified lines
18041795 return ret;
18051796 }
18061797
1807− dev_dbg(dev, "hdmi resume success!\n");
18081798 return 0;
18091799 }
18101800 #endif
drivers/gpu/drm/mediatek/mtk_mt8173_hdmi_phy.c+0−52
@@ -107,60 +107,10 @@ · 106 unmodified lines
107107 #define RGS_HDMITX_5T1_EDG (0xf << 4)
108108 #define RGS_HDMITX_PLUG_TST BIT(0)
109109
110−static const u8 PREDIV[3][4] = {
111− {0x0, 0x0, 0x0, 0x0}, /* 27Mhz */
112− {0x1, 0x1, 0x1, 0x1}, /* 74Mhz */
113− {0x1, 0x1, 0x1, 0x1} /* 148Mhz */
114−};
115−
116−static const u8 TXDIV[3][4] = {
117− {0x3, 0x3, 0x3, 0x2}, /* 27Mhz */
118− {0x2, 0x1, 0x1, 0x1}, /* 74Mhz */
119− {0x1, 0x0, 0x0, 0x0} /* 148Mhz */
120−};
121−
122−static const u8 FBKSEL[3][4] = {
123− {0x1, 0x1, 0x1, 0x1}, /* 27Mhz */
124− {0x1, 0x0, 0x1, 0x1}, /* 74Mhz */
125− {0x1, 0x0, 0x1, 0x1} /* 148Mhz */
126−};
127−
128−static const u8 FBKDIV[3][4] = {
129− {19, 24, 29, 19}, /* 27Mhz */
130− {19, 24, 14, 19}, /* 74Mhz */
131− {19, 24, 14, 19} /* 148Mhz */
132−};
133−
134−static const u8 DIVEN[3][4] = {
135− {0x2, 0x1, 0x1, 0x2}, /* 27Mhz */
136− {0x2, 0x2, 0x2, 0x2}, /* 74Mhz */
137− {0x2, 0x2, 0x2, 0x2} /* 148Mhz */
138−};
139−
140−static const u8 HTPLLBP[3][4] = {
141− {0xc, 0xc, 0x8, 0xc}, /* 27Mhz */
142− {0xc, 0xf, 0xf, 0xc}, /* 74Mhz */
143− {0xc, 0xf, 0xf, 0xc} /* 148Mhz */
144−};
145−
146−static const u8 HTPLLBC[3][4] = {
147− {0x2, 0x3, 0x3, 0x2}, /* 27Mhz */
148− {0x2, 0x3, 0x3, 0x2}, /* 74Mhz */
149− {0x2, 0x3, 0x3, 0x2} /* 148Mhz */
150−};
151−
152−static const u8 HTPLLBR[3][4] = {
153− {0x1, 0x1, 0x0, 0x1}, /* 27Mhz */
154− {0x1, 0x2, 0x2, 0x1}, /* 74Mhz */
155− {0x1, 0x2, 0x2, 0x1} /* 148Mhz */
156−};
157−
158110 static int mtk_hdmi_pll_prepare(struct clk_hw *hw)
159111 {
160112 struct mtk_hdmi_phy *hdmi_phy = to_mtk_hdmi_phy(hw);
161113
162− dev_dbg(hdmi_phy->dev, "%s\n", __func__);
163−
164114 mtk_hdmi_phy_set_bits(hdmi_phy, HDMI_CON1, RG_HDMITX_PLL_AUTOK_EN);
165115 mtk_hdmi_phy_set_bits(hdmi_phy, HDMI_CON0, RG_HDMITX_PLL_POSDIV);
166116 mtk_hdmi_phy_clear_bits(hdmi_phy, HDMI_CON3, RG_HDMITX_MHLCK_EN);
@@ -178,8 +128,6 @@ static void mtk_hdmi_pll_unprepare(struct clk_hw *hw) · 11 unmodified lines
178128 {
179129 struct mtk_hdmi_phy *hdmi_phy = to_mtk_hdmi_phy(hw);
180130
181− dev_dbg(hdmi_phy->dev, "%s\n", __func__);
182−
183131 mtk_hdmi_phy_clear_bits(hdmi_phy, HDMI_CON1, RG_HDMITX_PLL_TXDIV_EN);
184132 mtk_hdmi_phy_clear_bits(hdmi_phy, HDMI_CON1, RG_HDMITX_PLL_BIAS_LPF_EN);
185133 usleep_range(100, 150);
drivers/gpu/drm/meson/meson_registers.h+6−0
@@ -261,6 +261,12 @@ · 260 unmodified lines
261261 #define VIU_OSD_FIFO_DEPTH_VAL(val) ((val & 0x7f) << 12)
262262 #define VIU_OSD_WORDS_PER_BURST(words) (((words & 0x4) >> 1) << 22)
263263 #define VIU_OSD_FIFO_LIMITS(size) ((size & 0xf) << 24)
264+#define VIU_OSD_BURST_LENGTH_24 (0x0 << 31 | 0x0 << 10)
265+#define VIU_OSD_BURST_LENGTH_32 (0x0 << 31 | 0x1 << 10)
266+#define VIU_OSD_BURST_LENGTH_48 (0x0 << 31 | 0x2 << 10)
267+#define VIU_OSD_BURST_LENGTH_64 (0x0 << 31 | 0x3 << 10)
268+#define VIU_OSD_BURST_LENGTH_96 (0x1 << 31 | 0x0 << 10)
269+#define VIU_OSD_BURST_LENGTH_128 (0x1 << 31 | 0x1 << 10)
264270
265271 #define VD1_IF0_GEN_REG 0x1a50
266272 #define VD1_IF0_CANVAS0 0x1a51
drivers/gpu/drm/meson/meson_viu.c+2−9
@@ -411,13 +411,6 @@ void meson_viu_gxm_disable_osd1_afbc(struct meson_drm *priv) · 410 unmodified lines
411411 priv->io_base + _REG(VIU_MISC_CTRL1));
412412 }
413413
414−static inline uint32_t meson_viu_osd_burst_length_reg(uint32_t length)
415−{
416− uint32_t val = (((length & 0x80) % 24) / 12);
417−
418− return (((val & 0x3) << 10) | (((val & 0x4) >> 2) << 31));
419−}
420−
421414 void meson_viu_init(struct meson_drm *priv)
422415 {
423416 uint32_t reg;
@@ -444,9 +437,9 @@ void meson_viu_init(struct meson_drm *priv) · 20 unmodified lines
444437 VIU_OSD_FIFO_LIMITS(2); /* fifo_lim: 2*16=32 */
445438
446439 if (meson_vpu_is_compatible(priv, VPU_COMPATIBLE_G12A))
447− reg |= meson_viu_osd_burst_length_reg(32);
440+ reg |= VIU_OSD_BURST_LENGTH_32;
448441 else
449− reg |= meson_viu_osd_burst_length_reg(64);
442+ reg |= VIU_OSD_BURST_LENGTH_64;
450443
451444 writel_relaxed(reg, priv->io_base + _REG(VIU_OSD1_FIFO_CTRL_STAT));
452445 writel_relaxed(reg, priv->io_base + _REG(VIU_OSD2_FIFO_CTRL_STAT));
drivers/gpu/drm/nouveau/dispnv50/disp.c+5−2
@@ -601,6 +601,9 @@ nv50_audio_disable(struct drm_encoder *encoder, struct nouveau_crtc *nv_crtc) · 600 unmodified lines
601601 (0x0100 << nv_crtc->index),
602602 };
603603
604+ if (!nv_encoder->audio)
605+ return;
606+
604607 nv_encoder->audio = false;
605608 nvif_mthd(&disp->disp->object, 0, &args, sizeof(args));
606609
@@ -2070,7 +2073,7 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state) · 1463 unmodified lines
20702073 */
20712074 if (core->assign_windows) {
20722075 core->func->wndw.owner(core);
2073− core->func->update(core, interlock, false);
2076+ nv50_disp_atomic_commit_core(state, interlock);
20742077 core->assign_windows = false;
20752078 interlock[NV50_DISP_INTERLOCK_CORE] = 0;
20762079 }
@@ -2503,7 +2506,7 @@ nv50_display_create(struct drm_device *dev) · 426 unmodified lines
25032506 if (disp->disp->object.oclass >= TU102_DISP)
25042507 nouveau_display(dev)->format_modifiers = wndwc57e_modifiers;
25052508 else
2506− if (disp->disp->object.oclass >= GF110_DISP)
2509+ if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_FERMI)
25072510 nouveau_display(dev)->format_modifiers = disp90xx_modifiers;
25082511 else
25092512 nouveau_display(dev)->format_modifiers = disp50xx_modifiers;
drivers/gpu/drm/nouveau/nouveau_display.c+25−2
@@ -191,6 +191,7 @@ nouveau_decode_mod(struct nouveau_drm *drm, · 190 unmodified lines
191191 uint32_t *tile_mode,
192192 uint8_t *kind)
193193 {
194+ struct nouveau_display *disp = nouveau_display(drm->dev);
194195 BUG_ON(!tile_mode || !kind);
195196
196197 if (modifier == DRM_FORMAT_MOD_LINEAR) {
@@ -202,6 +203,12 @@ nouveau_decode_mod(struct nouveau_drm *drm, · 5 unmodified lines
202203 * Extract the block height and kind from the corresponding
203204 * modifier fields. See drm_fourcc.h for details.
204205 */
206+
207+ if ((modifier & (0xffull << 12)) == 0ull) {
208+ /* Legacy modifier. Translate to this dev's 'kind.' */
209+ modifier |= disp->format_modifiers[0] & (0xffull << 12);
210+ }
211+
205212 *tile_mode = (uint32_t)(modifier & 0xF);
206213 *kind = (uint8_t)((modifier >> 12) & 0xFF);
207214
@@ -227,6 +234,16 @@ nouveau_framebuffer_get_layout(struct drm_framebuffer *fb, · 19 unmodified lines
227234 }
228235 }
229236
237+static const u64 legacy_modifiers[] = {
238+ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(0),
239+ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(1),
240+ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(2),
241+ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(3),
242+ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(4),
243+ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(5),
244+ DRM_FORMAT_MOD_INVALID
245+};
246+
230247 static int
231248 nouveau_validate_decode_mod(struct nouveau_drm *drm,
232249 uint64_t modifier,
@@ -247,8 +264,14 @@ nouveau_validate_decode_mod(struct nouveau_drm *drm, · 14 unmodified lines
247264 (disp->format_modifiers[mod] != modifier);
248265 mod++);
249266
250− if (disp->format_modifiers[mod] == DRM_FORMAT_MOD_INVALID)
251− return -EINVAL;
267+ if (disp->format_modifiers[mod] == DRM_FORMAT_MOD_INVALID) {
268+ for (mod = 0;
269+ (legacy_modifiers[mod] != DRM_FORMAT_MOD_INVALID) &&
270+ (legacy_modifiers[mod] != modifier);
271+ mod++);
272+ if (legacy_modifiers[mod] == DRM_FORMAT_MOD_INVALID)
273+ return -EINVAL;
274+ }
252275
253276 nouveau_decode_mod(drm, modifier, tile_mode, kind);
254277
drivers/gpu/drm/nouveau/nouveau_dmem.c+1−1
@@ -550,7 +550,7 @@ static unsigned long nouveau_dmem_migrate_copy_one(struct nouveau_drm *drm, · 549 unmodified lines
550550 DMA_BIDIRECTIONAL);
551551 if (dma_mapping_error(dev, *dma_addr))
552552 goto out_free_page;
553− if (drm->dmem->migrate.copy_func(drm, page_size(spage),
553+ if (drm->dmem->migrate.copy_func(drm, 1,
554554 NOUVEAU_APER_VRAM, paddr, NOUVEAU_APER_HOST, *dma_addr))
555555 goto out_dma_unmap;
556556 } else {
drivers/gpu/drm/nouveau/nouveau_fbcon.c+2−1
@@ -315,7 +315,7 @@ nouveau_fbcon_create(struct drm_fb_helper *helper, · 314 unmodified lines
315315 struct drm_framebuffer *fb;
316316 struct nouveau_channel *chan;
317317 struct nouveau_bo *nvbo;
318− struct drm_mode_fb_cmd2 mode_cmd;
318+ struct drm_mode_fb_cmd2 mode_cmd = {};
319319 int ret;
320320
321321 mode_cmd.width = sizes->surface_width;
@@ -590,6 +590,7 @@ fini: · 268 unmodified lines
590590 drm_fb_helper_fini(&fbcon->helper);
591591 free:
592592 kfree(fbcon);
593+ drm->fbcon = NULL;
593594 return ret;
594595 }
595596
drivers/gpu/drm/nouveau/nouveau_svm.c+1−0
@@ -562,6 +562,7 @@ static int nouveau_range_fault(struct nouveau_svmm *svmm, · 561 unmodified lines
562562 .end = notifier->notifier.interval_tree.last + 1,
563563 .pfn_flags_mask = HMM_PFN_REQ_FAULT | HMM_PFN_REQ_WRITE,
564564 .hmm_pfns = hmm_pfns,
565+ .dev_private_owner = drm->dev,
565566 };
566567 struct mm_struct *mm = notifier->notifier.mm;
567568 int ret;
drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c+21−9
@@ -117,15 +117,6 @@ nvkm_outp_acquire_hda(struct nvkm_outp *outp, enum nvkm_ior_type type, · 116 unmodified lines
117117 {
118118 struct nvkm_ior *ior;
119119
120− /* First preference is to reuse the OR that is currently armed
121− * on HW, if any, in order to prevent unnecessary switching.
122− */
123− list_for_each_entry(ior, &outp->disp->ior, head) {
124− if (!ior->identity && !!ior->func->hda.hpd == hda &&
125− !ior->asy.outp && ior->arm.outp == outp)
126− return nvkm_outp_acquire_ior(outp, user, ior);
127− }
128−
129120 /* Failing that, a completely unused OR is the next best thing. */
130121 list_for_each_entry(ior, &outp->disp->ior, head) {
131122 if (!ior->identity && !!ior->func->hda.hpd == hda &&
@@ -173,6 +164,27 @@ nvkm_outp_acquire(struct nvkm_outp *outp, u8 user, bool hda) · 41 unmodified lines
173164 return nvkm_outp_acquire_ior(outp, user, ior);
174165 }
175166
167+ /* First preference is to reuse the OR that is currently armed
168+ * on HW, if any, in order to prevent unnecessary switching.
169+ */
170+ list_for_each_entry(ior, &outp->disp->ior, head) {
171+ if (!ior->identity && !ior->asy.outp && ior->arm.outp == outp) {
172+ /*XXX: For various complicated reasons, we can't outright switch
173+ * the boot-time OR on the first modeset without some fairly
174+ * invasive changes.
175+ *
176+ * The systems that were fixed by modifying the OR selection
177+ * code to account for HDA support shouldn't regress here as
178+ * the HDA-enabled ORs match the relevant output's pad macro
179+ * index, and the firmware seems to select an OR this way.
180+ *
181+ * This warning is to make it obvious if that proves wrong.
182+ */
183+ WARN_ON(hda && !ior->func->hda.hpd);
184+ return nvkm_outp_acquire_ior(outp, user, ior);
185+ }
186+ }
187+
176188 /* If we don't need HDA, first try to acquire an OR that doesn't
177189 * support it to leave free the ones that do.
178190 */
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c+2−2
@@ -118,10 +118,10 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 117 unmodified lines
118118 if (retries)
119119 udelay(400);
120120
121− /* transaction request, wait up to 1ms for it to complete */
121+ /* transaction request, wait up to 2ms for it to complete */
122122 nvkm_wr32(device, 0x00e4e4 + base, 0x00010000 | ctrl);
123123
124− timeout = 1000;
124+ timeout = 2000;
125125 do {
126126 ctrl = nvkm_rd32(device, 0x00e4e4 + base);
127127 udelay(1);
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c+2−2
@@ -118,10 +118,10 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, · 117 unmodified lines
118118 if (retries)
119119 udelay(400);
120120
121− /* transaction request, wait up to 1ms for it to complete */
121+ /* transaction request, wait up to 2ms for it to complete */
122122 nvkm_wr32(device, 0x00d954 + base, 0x00010000 | ctrl);
123123
124− timeout = 1000;
124+ timeout = 2000;
125125 do {
126126 ctrl = nvkm_rd32(device, 0x00d954 + base);
127127 udelay(1);
drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c+3−3
@@ -615,9 +615,9 @@ static const struct panel_desc boe_tv101wum_nl6_desc = { · 614 unmodified lines
615615 static const struct drm_display_mode auo_kd101n80_45na_default_mode = {
616616 .clock = 157000,
617617 .hdisplay = 1200,
618− .hsync_start = 1200 + 80,
619− .hsync_end = 1200 + 80 + 24,
620− .htotal = 1200 + 80 + 24 + 36,
618+ .hsync_start = 1200 + 60,
619+ .hsync_end = 1200 + 60 + 24,
620+ .htotal = 1200 + 60 + 24 + 56,
621621 .vdisplay = 1920,
622622 .vsync_start = 1920 + 16,
623623 .vsync_end = 1920 + 16 + 4,
drivers/gpu/drm/panel/panel-simple.c+15−1
@@ -1250,7 +1250,21 @@ static const struct panel_desc boe_nv133fhm_n61 = { · 1249 unmodified lines
12501250 .height = 165,
12511251 },
12521252 .delay = {
1253− .hpd_absent_delay = 200,
1253+ /*
1254+ * When power is first given to the panel there's a short
1255+ * spike on the HPD line. It was explained that this spike
1256+ * was until the TCON data download was complete. On
1257+ * one system this was measured at 8 ms. We'll put 15 ms
1258+ * in the prepare delay just to be safe and take it away
1259+ * from the hpd_absent_delay (which would otherwise be 200 ms)
1260+ * to handle this. That means:
1261+ * - If HPD isn't hooked up you still have 200 ms delay.
1262+ * - If HPD is hooked up we won't try to look at it for the
1263+ * first 15 ms.
1264+ */
1265+ .prepare = 15,
1266+ .hpd_absent_delay = 185,
1267+
12541268 .unprepare = 500,
12551269 },
12561270 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
drivers/gpu/drm/radeon/ci_dpm.c+3−4
@@ -5563,6 +5563,7 @@ static int ci_parse_power_table(struct radeon_device *rdev) · 5562 unmodified lines
55635563 if (!rdev->pm.dpm.ps)
55645564 return -ENOMEM;
55655565 power_state_offset = (u8 *)state_array->states;
5566+ rdev->pm.dpm.num_ps = 0;
55665567 for (i = 0; i < state_array->ucNumEntries; i++) {
55675568 u8 *idx;
55685569 power_state = (union pplib_power_state *)power_state_offset;
@@ -5572,10 +5573,8 @@ static int ci_parse_power_table(struct radeon_device *rdev) · 3 unmodified lines
55725573 if (!rdev->pm.power_state[i].clock_info)
55735574 return -EINVAL;
55745575 ps = kzalloc(sizeof(struct ci_ps), GFP_KERNEL);
5575− if (ps == NULL) {
5576− kfree(rdev->pm.dpm.ps);
5576+ if (ps == NULL)
55775577 return -ENOMEM;
5578− }
55795578 rdev->pm.dpm.ps[i].ps_priv = ps;
55805579 ci_parse_pplib_non_clock_info(rdev, &rdev->pm.dpm.ps[i],
55815580 non_clock_info,
@@ -5597,8 +5596,8 @@ static int ci_parse_power_table(struct radeon_device *rdev) · 15 unmodified lines
55975596 k++;
55985597 }
55995598 power_state_offset += 2 + power_state->v2.ucNumDPMLevels;
5599+ rdev->pm.dpm.num_ps = i + 1;
56005600 }
5601− rdev->pm.dpm.num_ps = state_array->ucNumEntries;
56025601
56035602 /* fill in the vce power states */
56045603 for (i = 0; i < RADEON_MAX_VCE_LEVELS; i++) {
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c+1−1
@@ -260,7 +260,7 @@ sun4i_hdmi_connector_detect(struct drm_connector *connector, bool force) · 259 unmodified lines
260260 unsigned long reg;
261261
262262 reg = readl(hdmi->base + SUN4I_HDMI_HPD_REG);
263− if (reg & SUN4I_HDMI_HPD_HIGH) {
263+ if (!(reg & SUN4I_HDMI_HPD_HIGH)) {
264264 cec_phys_addr_invalidate(hdmi->cec_adap);
265265 return connector_status_disconnected;
266266 }
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c+4−4
@@ -1069,10 +1069,6 @@ vmw_stdu_primary_plane_prepare_fb(struct drm_plane *plane, · 1068 unmodified lines
10691069 if (new_content_type != SAME_AS_DISPLAY) {
10701070 struct vmw_surface_metadata metadata = {0};
10711071
1072− metadata.base_size.width = hdisplay;
1073− metadata.base_size.height = vdisplay;
1074− metadata.base_size.depth = 1;
1075−
10761072 /*
10771073 * If content buffer is a buffer object, then we have to
10781074 * construct surface info
@@ -1104,6 +1100,10 @@ vmw_stdu_primary_plane_prepare_fb(struct drm_plane *plane, · 25 unmodified lines
11041100 metadata = new_vfbs->surface->metadata;
11051101 }
11061102
1103+ metadata.base_size.width = hdisplay;
1104+ metadata.base_size.height = vdisplay;
1105+ metadata.base_size.depth = 1;
1106+
11071107 if (vps->surf) {
11081108 struct drm_vmw_size cur_base_size =
11091109 vps->surf->metadata.base_size;
drivers/hid/hid-alps.c+2−0
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525
2626 #define U1_MOUSE_REPORT_ID 0x01 /* Mouse data ReportID */
2727 #define U1_ABSOLUTE_REPORT_ID 0x03 /* Absolute data ReportID */
28+#define U1_ABSOLUTE_REPORT_ID_SECD 0x02 /* FW-PTP Absolute data ReportID */
2829 #define U1_FEATURE_REPORT_ID 0x05 /* Feature ReportID */
2930 #define U1_SP_ABSOLUTE_REPORT_ID 0x06 /* Feature ReportID */
3031
@@ -368,6 +369,7 @@ static int u1_raw_event(struct alps_dev *hdata, u8 *data, int size) · 337 unmodified lines
368369 case U1_FEATURE_REPORT_ID:
369370 break;
370371 case U1_ABSOLUTE_REPORT_ID:
372+ case U1_ABSOLUTE_REPORT_ID_SECD:
371373 for (i = 0; i < hdata->max_fingers; i++) {
372374 u8 *contact = &data[i * 5];
373375
drivers/hid/hid-apple.c+18−0
@@ -60,6 +60,7 @@ MODULE_PARM_DESC(swap_fn_leftctrl, "Swap the Fn and left Control keys. " · 59 unmodified lines
6060 struct apple_sc {
6161 unsigned long quirks;
6262 unsigned int fn_on;
63+ unsigned int fn_found;
6364 DECLARE_BITMAP(pressed_numlock, KEY_CNT);
6465 };
6566
@@ -365,12 +366,15 @@ static int apple_input_mapping(struct hid_device *hdev, struct hid_input *hi, · 299 unmodified lines
365366 struct hid_field *field, struct hid_usage *usage,
366367 unsigned long **bit, int *max)
367368 {
369+ struct apple_sc *asc = hid_get_drvdata(hdev);
370+
368371 if (usage->hid == (HID_UP_CUSTOM | 0x0003) ||
369372 usage->hid == (HID_UP_MSVENDOR | 0x0003) ||
370373 usage->hid == (HID_UP_HPVENDOR2 | 0x0003)) {
371374 /* The fn key on Apple USB keyboards */
372375 set_bit(EV_REP, hi->input->evbit);
373376 hid_map_usage_clear(hi, usage, bit, max, EV_KEY, KEY_FN);
377+ asc->fn_found = true;
374378 apple_setup_input(hi->input);
375379 return 1;
376380 }
@@ -397,6 +401,19 @@ static int apple_input_mapped(struct hid_device *hdev, struct hid_input *hi, · 20 unmodified lines
397401 return 0;
398402 }
399403
404+static int apple_input_configured(struct hid_device *hdev,
405+ struct hid_input *hidinput)
406+{
407+ struct apple_sc *asc = hid_get_drvdata(hdev);
408+
409+ if ((asc->quirks & APPLE_HAS_FN) && !asc->fn_found) {
410+ hid_info(hdev, "Fn key not found (Apple Wireless Keyboard clone?), disabling Fn key handling\n");
411+ asc->quirks = 0;
412+ }
413+
414+ return 0;
415+}
416+
400417 static int apple_probe(struct hid_device *hdev,
401418 const struct hid_device_id *id)
402419 {
@@ -611,6 +628,7 @@ static struct hid_driver apple_driver = { · 208 unmodified lines
611628 .event = apple_event,
612629 .input_mapping = apple_input_mapping,
613630 .input_mapped = apple_input_mapped,
631+ .input_configured = apple_input_configured,
614632 };
615633 module_hid_driver(apple_driver);
616634
drivers/hid/hid-ids.h+3−0
@@ -618,6 +618,7 @@ · 617 unmodified lines
618618 #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081 0xa081
619619 #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2 0xa0c2
620620 #define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A096 0xa096
621+#define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A293 0xa293
621622
622623 #define USB_VENDOR_ID_IMATION 0x0718
623624 #define USB_DEVICE_ID_DISC_STAKKA 0xd000
@@ -998,6 +999,8 @@ · 374 unmodified lines
998999 #define USB_DEVICE_ID_ROCCAT_RYOS_MK_PRO 0x3232
9991000 #define USB_DEVICE_ID_ROCCAT_SAVU 0x2d5a
10001001
1002+#define USB_VENDOR_ID_SAI 0x17dd
1003+
10011004 #define USB_VENDOR_ID_SAITEK 0x06a3
10021005 #define USB_DEVICE_ID_SAITEK_RUMBLEPAD 0xff17
10031006 #define USB_DEVICE_ID_SAITEK_PS1000 0x0621
drivers/hid/hid-logitech-dj.c+3−3
@@ -1153,7 +1153,7 @@ static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) · 1152 unmodified lines
11531153 if (!dj_report)
11541154 return -ENOMEM;
11551155 dj_report->report_id = REPORT_ID_DJ_SHORT;
1156− dj_report->device_index = 0xFF;
1156+ dj_report->device_index = HIDPP_RECEIVER_INDEX;
11571157 dj_report->report_type = REPORT_TYPE_CMD_GET_PAIRED_DEVICES;
11581158 retval = logi_dj_recv_send_report(djrcv_dev, dj_report);
11591159 kfree(dj_report);
@@ -1175,7 +1175,7 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, · 15 unmodified lines
11751175
11761176 if (djrcv_dev->type == recvr_type_dj) {
11771177 dj_report->report_id = REPORT_ID_DJ_SHORT;
1178− dj_report->device_index = 0xFF;
1178+ dj_report->device_index = HIDPP_RECEIVER_INDEX;
11791179 dj_report->report_type = REPORT_TYPE_CMD_SWITCH;
11801180 dj_report->report_params[CMD_SWITCH_PARAM_DEVBITFIELD] = 0x3F;
11811181 dj_report->report_params[CMD_SWITCH_PARAM_TIMEOUT_SECONDS] =
@@ -1204,7 +1204,7 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, · 22 unmodified lines
12041204 memset(buf, 0, HIDPP_REPORT_SHORT_LENGTH);
12051205
12061206 buf[0] = REPORT_ID_HIDPP_SHORT;
1207− buf[1] = 0xFF;
1207+ buf[1] = HIDPP_RECEIVER_INDEX;
12081208 buf[2] = 0x80;
12091209 buf[3] = 0x00;
12101210 buf[4] = 0x00;
drivers/hid/hid-logitech-hidpp.c+1−1
@@ -3146,7 +3146,7 @@ static int hi_res_scroll_enable(struct hidpp_device *hidpp) · 3145 unmodified lines
31463146 multiplier = 1;
31473147
31483148 hidpp->vertical_wheel_counter.wheel_multiplier = multiplier;
3149− hid_info(hidpp->hid_dev, "multiplier = %d\n", multiplier);
3149+ hid_dbg(hidpp->hid_dev, "wheel multiplier = %d\n", multiplier);
31503150 return 0;
31513151 }
31523152
drivers/hid/hid-magicmouse.c+6−0
@@ -535,6 +535,12 @@ static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hd · 534 unmodified lines
535535 __set_bit(MSC_RAW, input->mscbit);
536536 }
537537
538+ /*
539+ * hid-input may mark device as using autorepeat, but neither
540+ * the trackpad, nor the mouse actually want it.
541+ */
542+ __clear_bit(EV_REP, input->evbit);
543+
538544 return 0;
539545 }
540546
drivers/hid/hid-quirks.c+2−0
@@ -88,6 +88,7 @@ static const struct hid_device_id hid_quirks[] = { · 87 unmodified lines
8888 { HID_USB_DEVICE(USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING), HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
8989 { HID_USB_DEVICE(USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING), HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
9090 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A096), HID_QUIRK_NO_INIT_REPORTS },
91+ { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A293), HID_QUIRK_ALWAYS_POLL },
9192 { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0A4A), HID_QUIRK_ALWAYS_POLL },
9293 { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0B4A), HID_QUIRK_ALWAYS_POLL },
9394 { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },
@@ -832,6 +833,7 @@ static const struct hid_device_id hid_ignore_list[] = { · 738 unmodified lines
832833 { HID_USB_DEVICE(USB_VENDOR_ID_PETZL, USB_DEVICE_ID_PETZL_HEADLAMP) },
833834 { HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS, USB_DEVICE_ID_PHILIPS_IEEE802154_DONGLE) },
834835 { HID_USB_DEVICE(USB_VENDOR_ID_POWERCOM, USB_DEVICE_ID_POWERCOM_UPS) },
836+ { HID_USB_DEVICE(USB_VENDOR_ID_SAI, USB_DEVICE_ID_CYPRESS_HIDCOM) },
835837 #if IS_ENABLED(CONFIG_MOUSE_SYNAPTICS_USB)
836838 { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_TP) },
837839 { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_INT_TP) },
drivers/hid/hid-steam.c+4−2
@@ -526,7 +526,8 @@ static int steam_register(struct steam_device *steam) · 525 unmodified lines
526526 steam_battery_register(steam);
527527
528528 mutex_lock(&steam_devices_lock);
529− list_add(&steam->list, &steam_devices);
529+ if (list_empty(&steam->list))
530+ list_add(&steam->list, &steam_devices);
530531 mutex_unlock(&steam_devices_lock);
531532 }
532533
@@ -552,7 +553,7 @@ static void steam_unregister(struct steam_device *steam) · 19 unmodified lines
552553 hid_info(steam->hdev, "Steam Controller '%s' disconnected",
553554 steam->serial_no);
554555 mutex_lock(&steam_devices_lock);
555− list_del(&steam->list);
556+ list_del_init(&steam->list);
556557 mutex_unlock(&steam_devices_lock);
557558 steam->serial_no[0] = 0;
558559 }
@@ -738,6 +739,7 @@ static int steam_probe(struct hid_device *hdev, · 179 unmodified lines
738739 mutex_init(&steam->mutex);
739740 steam->quirks = id->driver_data;
740741 INIT_WORK(&steam->work_connect, steam_work_connect_cb);
742+ INIT_LIST_HEAD(&steam->list);
741743
742744 steam->client_hdev = steam_create_client_hid(hdev);
743745 if (IS_ERR(steam->client_hdev)) {
drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c+8−0
@@ -373,6 +373,14 @@ static const struct dmi_system_id i2c_hid_dmi_desc_override_table[] = { · 372 unmodified lines
373373 },
374374 .driver_data = (void *)&sipodev_desc
375375 },
376+ {
377+ .ident = "Mediacom FlexBook edge 13",
378+ .matches = {
379+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "MEDIACOM"),
380+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "FlexBook_edge13-M-FBE13"),
381+ },
382+ .driver_data = (void *)&sipodev_desc
383+ },
376384 {
377385 .ident = "Odys Winbook 13",
378386 .matches = {
drivers/hwmon/amd_energy.c+1−1
@@ -362,7 +362,7 @@ static struct platform_driver amd_energy_driver = { · 361 unmodified lines
362362 static struct platform_device *amd_energy_platdev;
363363
364364 static const struct x86_cpu_id cpu_ids[] __initconst = {
365− X86_MATCH_VENDOR_FAM(AMD, 0x17, NULL),
365+ X86_MATCH_VENDOR_FAM_MODEL(AMD, 0x17, 0x31, NULL),
366366 {}
367367 };
368368 MODULE_DEVICE_TABLE(x86cpu, cpu_ids);
drivers/hwmon/aspeed-pwm-tacho.c+2−0
@@ -851,6 +851,8 @@ static int aspeed_create_fan(struct device *dev, · 850 unmodified lines
851851 ret = of_property_read_u32(child, "reg", &pwm_port);
852852 if (ret)
853853 return ret;
854+ if (pwm_port >= ARRAY_SIZE(pwm_port_params))
855+ return -EINVAL;
854856 aspeed_create_pwm_port(priv, (u8)pwm_port);
855857
856858 ret = of_property_count_u8_elems(child, "cooling-levels");
drivers/hwmon/drivetemp.c+43−0
@@ -285,6 +285,42 @@ static int drivetemp_get_scttemp(struct drivetemp_data *st, u32 attr, long *val) · 284 unmodified lines
285285 return err;
286286 }
287287
288+static const char * const sct_avoid_models[] = {
289+/*
290+ * These drives will have WRITE FPDMA QUEUED command timeouts and sometimes just
291+ * freeze until power-cycled under heavy write loads when their temperature is
292+ * getting polled in SCT mode. The SMART mode seems to be fine, though.
293+ *
294+ * While only the 3 TB model (DT01ACA3) was actually caught exhibiting the
295+ * problem let's play safe here to avoid data corruption and ban the whole
296+ * DT01ACAx family.
297+
298+ * The models from this array are prefix-matched.
299+ */
300+ "TOSHIBA DT01ACA",
301+};
302+
303+static bool drivetemp_sct_avoid(struct drivetemp_data *st)
304+{
305+ struct scsi_device *sdev = st->sdev;
306+ unsigned int ctr;
307+
308+ if (!sdev->model)
309+ return false;
310+
311+ /*
312+ * The "model" field contains just the raw SCSI INQUIRY response
313+ * "product identification" field, which has a width of 16 bytes.
314+ * This field is space-filled, but is NOT NULL-terminated.
315+ */
316+ for (ctr = 0; ctr < ARRAY_SIZE(sct_avoid_models); ctr++)
317+ if (!strncmp(sdev->model, sct_avoid_models[ctr],
318+ strlen(sct_avoid_models[ctr])))
319+ return true;
320+
321+ return false;
322+}
323+
288324 static int drivetemp_identify_sata(struct drivetemp_data *st)
289325 {
290326 struct scsi_device *sdev = st->sdev;
@@ -326,6 +362,13 @@ static int drivetemp_identify_sata(struct drivetemp_data *st) · 35 unmodified lines
326362 /* bail out if this is not a SATA device */
327363 if (!is_ata || !is_sata)
328364 return -ENODEV;
365+
366+ if (have_sct && drivetemp_sct_avoid(st)) {
367+ dev_notice(&sdev->sdev_gendev,
368+ "will avoid using SCT for temperature monitoring\n");
369+ have_sct = false;
370+ }
371+
329372 if (!have_sct)
330373 goto skip_sct;
331374
drivers/hwmon/emc2103.c+1−1
@@ -443,7 +443,7 @@ static ssize_t pwm1_enable_store(struct device *dev, · 442 unmodified lines
443443 }
444444
445445 result = read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg);
446− if (result) {
446+ if (result < 0) {
447447 count = result;
448448 goto err;
449449 }
drivers/hwmon/nct6775.c+3−3
@@ -786,13 +786,13 @@ static const char *const nct6798_temp_label[] = { · 785 unmodified lines
786786 "Agent1 Dimm1",
787787 "BYTE_TEMP0",
788788 "BYTE_TEMP1",
789− "",
790− "",
789+ "PECI Agent 0 Calibration", /* undocumented */
790+ "PECI Agent 1 Calibration", /* undocumented */
791791 "",
792792 "Virtual_TEMP"
793793 };
794794
795−#define NCT6798_TEMP_MASK 0x8fff0ffe
795+#define NCT6798_TEMP_MASK 0xbfff0ffe
796796 #define NCT6798_VIRT_TEMP_MASK 0x80000c00
797797
798798 /* NCT6102D/NCT6106D specific data */
drivers/hwmon/pmbus/adm1275.c+8−2
@@ -465,6 +465,7 @@ MODULE_DEVICE_TABLE(i2c, adm1275_id); · 464 unmodified lines
465465 static int adm1275_probe(struct i2c_client *client,
466466 const struct i2c_device_id *id)
467467 {
468+ s32 (*config_read_fn)(const struct i2c_client *client, u8 reg);
468469 u8 block_buffer[I2C_SMBUS_BLOCK_MAX + 1];
469470 int config, device_config;
470471 int ret;
@@ -510,11 +511,16 @@ static int adm1275_probe(struct i2c_client *client, · 39 unmodified lines
510511 "Device mismatch: Configured %s, detected %s\n",
511512 id->name, mid->name);
512513
513− config = i2c_smbus_read_byte_data(client, ADM1275_PMON_CONFIG);
514+ if (mid->driver_data == adm1272 || mid->driver_data == adm1278 ||
515+ mid->driver_data == adm1293 || mid->driver_data == adm1294)
516+ config_read_fn = i2c_smbus_read_word_data;
517+ else
518+ config_read_fn = i2c_smbus_read_byte_data;
519+ config = config_read_fn(client, ADM1275_PMON_CONFIG);
514520 if (config < 0)
515521 return config;
516522
517− device_config = i2c_smbus_read_byte_data(client, ADM1275_DEVICE_CONFIG);
523+ device_config = config_read_fn(client, ADM1275_DEVICE_CONFIG);
518524 if (device_config < 0)
519525 return device_config;
520526
drivers/hwmon/scmi-hwmon.c+1−1
@@ -147,7 +147,7 @@ static enum hwmon_sensor_types scmi_types[] = { · 146 unmodified lines
147147 [ENERGY] = hwmon_energy,
148148 };
149149
150−static u32 hwmon_attributes[] = {
150+static u32 hwmon_attributes[hwmon_max] = {
151151 [hwmon_chip] = HWMON_C_REGISTER_TZ,
152152 [hwmon_temp] = HWMON_T_INPUT | HWMON_T_LABEL,
153153 [hwmon_in] = HWMON_I_INPUT | HWMON_I_LABEL,
drivers/hwtracing/coresight/coresight-cti.c+54−42
@@ -747,17 +747,50 @@ static int cti_dying_cpu(unsigned int cpu) · 746 unmodified lines
747747 return 0;
748748 }
749749
750+static int cti_pm_setup(struct cti_drvdata *drvdata)
751+{
752+ int ret;
753+
754+ if (drvdata->ctidev.cpu == -1)
755+ return 0;
756+
757+ if (nr_cti_cpu)
758+ goto done;
759+
760+ cpus_read_lock();
761+ ret = cpuhp_setup_state_nocalls_cpuslocked(
762+ CPUHP_AP_ARM_CORESIGHT_CTI_STARTING,
763+ "arm/coresight_cti:starting",
764+ cti_starting_cpu, cti_dying_cpu);
765+ if (ret) {
766+ cpus_read_unlock();
767+ return ret;
768+ }
769+
770+ ret = cpu_pm_register_notifier(&cti_cpu_pm_nb);
771+ cpus_read_unlock();
772+ if (ret) {
773+ cpuhp_remove_state_nocalls(CPUHP_AP_ARM_CORESIGHT_CTI_STARTING);
774+ return ret;
775+ }
776+
777+done:
778+ nr_cti_cpu++;
779+ cti_cpu_drvdata[drvdata->ctidev.cpu] = drvdata;
780+
781+ return 0;
782+}
783+
750784 /* release PM registrations */
751785 static void cti_pm_release(struct cti_drvdata *drvdata)
752786 {
753− if (drvdata->ctidev.cpu >= 0) {
754− if (--nr_cti_cpu == 0) {
755− cpu_pm_unregister_notifier(&cti_cpu_pm_nb);
787+ if (drvdata->ctidev.cpu == -1)
788+ return;
756789
757− cpuhp_remove_state_nocalls(
758− CPUHP_AP_ARM_CORESIGHT_CTI_STARTING);
759− }
760− cti_cpu_drvdata[drvdata->ctidev.cpu] = NULL;
790+ cti_cpu_drvdata[drvdata->ctidev.cpu] = NULL;
791+ if (--nr_cti_cpu == 0) {
792+ cpu_pm_unregister_notifier(&cti_cpu_pm_nb);
793+ cpuhp_remove_state_nocalls(CPUHP_AP_ARM_CORESIGHT_CTI_STARTING);
761794 }
762795 }
763796
@@ -823,19 +856,14 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id) · 59 unmodified lines
823856
824857 /* driver data*/
825858 drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
826− if (!drvdata) {
827− ret = -ENOMEM;
828− dev_info(dev, "%s, mem err\n", __func__);
829− goto err_out;
830− }
859+ if (!drvdata)
860+ return -ENOMEM;
831861
832862 /* Validity for the resource is already checked by the AMBA core */
833863 base = devm_ioremap_resource(dev, res);
834− if (IS_ERR(base)) {
835− ret = PTR_ERR(base);
836− dev_err(dev, "%s, remap err\n", __func__);
837− goto err_out;
838− }
864+ if (IS_ERR(base))
865+ return PTR_ERR(base);
866+
839867 drvdata->base = base;
840868
841869 dev_set_drvdata(dev, drvdata);
@@ -854,8 +882,7 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id) · 12 unmodified lines
854882 pdata = coresight_cti_get_platform_data(dev);
855883 if (IS_ERR(pdata)) {
856884 dev_err(dev, "coresight_cti_get_platform_data err\n");
857− ret = PTR_ERR(pdata);
858− goto err_out;
885+ return PTR_ERR(pdata);
859886 }
860887
861888 /* default to powered - could change on PM notifications */
@@ -867,35 +894,20 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id) · 5 unmodified lines
867894 drvdata->ctidev.cpu);
868895 else
869896 cti_desc.name = coresight_alloc_device_name(&cti_sys_devs, dev);
870− if (!cti_desc.name) {
871− ret = -ENOMEM;
872− goto err_out;
873− }
897+ if (!cti_desc.name)
898+ return -ENOMEM;
874899
875900 /* setup CPU power management handling for CPU bound CTI devices. */
876− if (drvdata->ctidev.cpu >= 0) {
877− cti_cpu_drvdata[drvdata->ctidev.cpu] = drvdata;
878− if (!nr_cti_cpu++) {
879− cpus_read_lock();
880− ret = cpuhp_setup_state_nocalls_cpuslocked(
881− CPUHP_AP_ARM_CORESIGHT_CTI_STARTING,
882− "arm/coresight_cti:starting",
883− cti_starting_cpu, cti_dying_cpu);
884−
885− if (!ret)
886− ret = cpu_pm_register_notifier(&cti_cpu_pm_nb);
887− cpus_read_unlock();
888− if (ret)
889− goto err_out;
890− }
891− }
901+ ret = cti_pm_setup(drvdata);
902+ if (ret)
903+ return ret;
892904
893905 /* create dynamic attributes for connections */
894906 ret = cti_create_cons_sysfs(dev, drvdata);
895907 if (ret) {
896908 dev_err(dev, "%s: create dynamic sysfs entries failed\n",
897909 cti_desc.name);
898− goto err_out;
910+ goto pm_release;
899911 }
900912
901913 /* set up coresight component description */
@@ -908,7 +920,7 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id) · 6 unmodified lines
908920 drvdata->csdev = coresight_register(&cti_desc);
909921 if (IS_ERR(drvdata->csdev)) {
910922 ret = PTR_ERR(drvdata->csdev);
911− goto err_out;
923+ goto pm_release;
912924 }
913925
914926 /* add to list of CTI devices */
@@ -927,7 +939,7 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id) · 12 unmodified lines
927939 dev_info(&drvdata->csdev->dev, "CTI initialized\n");
928940 return 0;
929941
930−err_out:
942+pm_release:
931943 cti_pm_release(drvdata);
932944 return ret;
933945 }
drivers/hwtracing/coresight/coresight-etm4x.c+53−29
@@ -1388,18 +1388,57 @@ static struct notifier_block etm4_cpu_pm_nb = { · 1387 unmodified lines
13881388 .notifier_call = etm4_cpu_pm_notify,
13891389 };
13901390
1391−static int etm4_cpu_pm_register(void)
1391+/* Setup PM. Called with cpus locked. Deals with error conditions and counts */
1392+static int etm4_pm_setup_cpuslocked(void)
13921393 {
1393− if (IS_ENABLED(CONFIG_CPU_PM))
1394− return cpu_pm_register_notifier(&etm4_cpu_pm_nb);
1394+ int ret;
13951395
1396− return 0;
1396+ if (etm4_count++)
1397+ return 0;
1398+
1399+ ret = cpu_pm_register_notifier(&etm4_cpu_pm_nb);
1400+ if (ret)
1401+ goto reduce_count;
1402+
1403+ ret = cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ARM_CORESIGHT_STARTING,
1404+ "arm/coresight4:starting",
1405+ etm4_starting_cpu, etm4_dying_cpu);
1406+
1407+ if (ret)
1408+ goto unregister_notifier;
1409+
1410+ ret = cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ONLINE_DYN,
1411+ "arm/coresight4:online",
1412+ etm4_online_cpu, NULL);
1413+
1414+ /* HP dyn state ID returned in ret on success */
1415+ if (ret > 0) {
1416+ hp_online = ret;
1417+ return 0;
1418+ }
1419+
1420+ /* failed dyn state - remove others */
1421+ cpuhp_remove_state_nocalls_cpuslocked(CPUHP_AP_ARM_CORESIGHT_STARTING);
1422+
1423+unregister_notifier:
1424+ cpu_pm_unregister_notifier(&etm4_cpu_pm_nb);
1425+
1426+reduce_count:
1427+ --etm4_count;
1428+ return ret;
13971429 }
13981430
1399−static void etm4_cpu_pm_unregister(void)
1431+static void etm4_pm_clear(void)
14001432 {
1401− if (IS_ENABLED(CONFIG_CPU_PM))
1402− cpu_pm_unregister_notifier(&etm4_cpu_pm_nb);
1433+ if (--etm4_count != 0)
1434+ return;
1435+
1436+ cpu_pm_unregister_notifier(&etm4_cpu_pm_nb);
1437+ cpuhp_remove_state_nocalls(CPUHP_AP_ARM_CORESIGHT_STARTING);
1438+ if (hp_online) {
1439+ cpuhp_remove_state_nocalls(hp_online);
1440+ hp_online = 0;
1441+ }
14031442 }
14041443
14051444 static int etm4_probe(struct amba_device *adev, const struct amba_id *id)
@@ -1453,24 +1492,15 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) · 47 unmodified lines
14531492 etm4_init_arch_data, drvdata, 1))
14541493 dev_err(dev, "ETM arch init failed\n");
14551494
1456− if (!etm4_count++) {
1457− cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ARM_CORESIGHT_STARTING,
1458− "arm/coresight4:starting",
1459− etm4_starting_cpu, etm4_dying_cpu);
1460− ret = cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ONLINE_DYN,
1461− "arm/coresight4:online",
1462− etm4_online_cpu, NULL);
1463− if (ret < 0)
1464− goto err_arch_supported;
1465− hp_online = ret;
1495+ ret = etm4_pm_setup_cpuslocked();
1496+ cpus_read_unlock();
14661497
1467− ret = etm4_cpu_pm_register();
1468− if (ret)
1469− goto err_arch_supported;
1498+ /* etm4_pm_setup_cpuslocked() does its own cleanup - exit on error */
1499+ if (ret) {
1500+ etmdrvdata[drvdata->cpu] = NULL;
1501+ return ret;
14701502 }
14711503
1472− cpus_read_unlock();
1473−
14741504 if (etm4_arch_supported(drvdata->arch) == false) {
14751505 ret = -EINVAL;
14761506 goto err_arch_supported;
@@ -1517,13 +1547,7 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) · 40 unmodified lines
15171547
15181548 err_arch_supported:
15191549 etmdrvdata[drvdata->cpu] = NULL;
1520− if (--etm4_count == 0) {
1521− etm4_cpu_pm_unregister();
1522−
1523− cpuhp_remove_state_nocalls(CPUHP_AP_ARM_CORESIGHT_STARTING);
1524− if (hp_online)
1525− cpuhp_remove_state_nocalls(hp_online);
1526− }
1550+ etm4_pm_clear();
15271551 return ret;
15281552 }
15291553
drivers/hwtracing/intel_th/core.c+18−3
@@ -1021,15 +1021,30 @@ int intel_th_set_output(struct intel_th_device *thdev, · 1020 unmodified lines
10211021 {
10221022 struct intel_th_device *hub = to_intel_th_hub(thdev);
10231023 struct intel_th_driver *hubdrv = to_intel_th_driver(hub->dev.driver);
1024+ int ret;
10241025
10251026 /* In host mode, this is up to the external debugger, do nothing. */
10261027 if (hub->host_mode)
10271028 return 0;
10281029
1029− if (!hubdrv->set_output)
1030− return -ENOTSUPP;
1030+ /*
1031+ * hub is instantiated together with the source device that
1032+ * calls here, so guaranteed to be present.
1033+ */
1034+ hubdrv = to_intel_th_driver(hub->dev.driver);
1035+ if (!hubdrv || !try_module_get(hubdrv->driver.owner))
1036+ return -EINVAL;
1037+
1038+ if (!hubdrv->set_output) {
1039+ ret = -ENOTSUPP;
1040+ goto out;
1041+ }
1042+
1043+ ret = hubdrv->set_output(hub, master);
10311044
1032− return hubdrv->set_output(hub, master);
1045+out:
1046+ module_put(hubdrv->driver.owner);
1047+ return ret;
10331048 }
10341049 EXPORT_SYMBOL_GPL(intel_th_set_output);
10351050
drivers/hwtracing/intel_th/pci.c+15−0
@@ -233,11 +233,21 @@ static const struct pci_device_id intel_th_pci_id_table[] = { · 232 unmodified lines
233233 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa0a6),
234234 .driver_data = (kernel_ulong_t)&intel_th_2x,
235235 },
236+ {
237+ /* Tiger Lake PCH-H */
238+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x43a6),
239+ .driver_data = (kernel_ulong_t)&intel_th_2x,
240+ },
236241 {
237242 /* Jasper Lake PCH */
238243 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4da6),
239244 .driver_data = (kernel_ulong_t)&intel_th_2x,
240245 },
246+ {
247+ /* Jasper Lake CPU */
248+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4e29),
249+ .driver_data = (kernel_ulong_t)&intel_th_2x,
250+ },
241251 {
242252 /* Elkhart Lake CPU */
243253 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4529),
@@ -248,6 +258,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = { · 4 unmodified lines
248258 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4b26),
249259 .driver_data = (kernel_ulong_t)&intel_th_2x,
250260 },
261+ {
262+ /* Emmitsburg PCH */
263+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x1bcc),
264+ .driver_data = (kernel_ulong_t)&intel_th_2x,
265+ },
251266 { 0 },
252267 };
253268
drivers/hwtracing/intel_th/sth.c+1−3
@@ -161,9 +161,7 @@ static int sth_stm_link(struct stm_data *stm_data, unsigned int master, · 160 unmodified lines
161161 {
162162 struct sth_device *sth = container_of(stm_data, struct sth_device, stm);
163163
164− intel_th_set_output(to_intel_th_device(sth->dev), master);
165−
166− return 0;
164+ return intel_th_set_output(to_intel_th_device(sth->dev), master);
167165 }
168166
169167 static int intel_th_sw_init(struct sth_device *sth)
drivers/i2c/busses/i2c-cadence.c+12−16
@@ -421,20 +421,21 @@ static irqreturn_t cdns_i2c_master_isr(void *ptr) · 420 unmodified lines
421421 /* Read data if receive data valid is set */
422422 while (cdns_i2c_readreg(CDNS_I2C_SR_OFFSET) &
423423 CDNS_I2C_SR_RXDV) {
424− /*
425− * Clear hold bit that was set for FIFO control if
426− * RX data left is less than FIFO depth, unless
427− * repeated start is selected.
428− */
429− if ((id->recv_count < CDNS_I2C_FIFO_DEPTH) &&
430− !id->bus_hold_flag)
431− cdns_i2c_clear_bus_hold(id);
432−
433424 if (id->recv_count > 0) {
434425 *(id->p_recv_buf)++ =
435426 cdns_i2c_readreg(CDNS_I2C_DATA_OFFSET);
436427 id->recv_count--;
437428 id->curr_recv_count--;
429+
430+ /*
431+ * Clear hold bit that was set for FIFO control
432+ * if RX data left is less than or equal to
433+ * FIFO DEPTH unless repeated start is selected
434+ */
435+ if (id->recv_count <= CDNS_I2C_FIFO_DEPTH &&
436+ !id->bus_hold_flag)
437+ cdns_i2c_clear_bus_hold(id);
438+
438439 } else {
439440 dev_err(id->adap.dev.parent,
440441 "xfer_size reg rollover. xfer aborted!\n");
@@ -594,10 +595,8 @@ static void cdns_i2c_mrecv(struct cdns_i2c *id) · 153 unmodified lines
594595 * Check for the message size against FIFO depth and set the
595596 * 'hold bus' bit if it is greater than FIFO depth.
596597 */
597− if ((id->recv_count > CDNS_I2C_FIFO_DEPTH) || id->bus_hold_flag)
598+ if (id->recv_count > CDNS_I2C_FIFO_DEPTH)
598599 ctrl_reg |= CDNS_I2C_CR_HOLD;
599− else
600− ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD;
601600
602601 cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET);
603602
@@ -654,11 +653,8 @@ static void cdns_i2c_msend(struct cdns_i2c *id) · 50 unmodified lines
654653 * Check for the message size against FIFO depth and set the
655654 * 'hold bus' bit if it is greater than FIFO depth.
656655 */
657− if ((id->send_count > CDNS_I2C_FIFO_DEPTH) || id->bus_hold_flag)
656+ if (id->send_count > CDNS_I2C_FIFO_DEPTH)
658657 ctrl_reg |= CDNS_I2C_CR_HOLD;
659− else
660− ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD;
661−
662658 cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET);
663659
664660 /* Clear the interrupts in interrupt status register. */
drivers/i2c/busses/i2c-qcom-geni.c+4−2
@@ -367,7 +367,6 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, · 366 unmodified lines
367367 geni_se_select_mode(se, GENI_SE_FIFO);
368368
369369 writel_relaxed(len, se->base + SE_I2C_RX_TRANS_LEN);
370− geni_se_setup_m_cmd(se, I2C_READ, m_param);
371370
372371 if (dma_buf && geni_se_rx_dma_prep(se, dma_buf, len, &rx_dma)) {
373372 geni_se_select_mode(se, GENI_SE_FIFO);
@@ -375,6 +374,8 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, · 1 unmodified line
375374 dma_buf = NULL;
376375 }
377376
377+ geni_se_setup_m_cmd(se, I2C_READ, m_param);
378+
378379 time_left = wait_for_completion_timeout(&gi2c->done, XFER_TIMEOUT);
379380 if (!time_left)
380381 geni_i2c_abort_xfer(gi2c);
@@ -408,7 +409,6 @@ static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, · 27 unmodified lines
408409 geni_se_select_mode(se, GENI_SE_FIFO);
409410
410411 writel_relaxed(len, se->base + SE_I2C_TX_TRANS_LEN);
411− geni_se_setup_m_cmd(se, I2C_WRITE, m_param);
412412
413413 if (dma_buf && geni_se_tx_dma_prep(se, dma_buf, len, &tx_dma)) {
414414 geni_se_select_mode(se, GENI_SE_FIFO);
@@ -416,6 +416,8 @@ static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, · 1 unmodified line
416416 dma_buf = NULL;
417417 }
418418
419+ geni_se_setup_m_cmd(se, I2C_WRITE, m_param);
420+
419421 if (!dma_buf) /* Get FIFO IRQ */
420422 writel_relaxed(1, se->base + SE_GENI_TX_WATERMARK_REG);
421423
drivers/i2c/busses/i2c-rcar.c+3−0
@@ -868,6 +868,7 @@ static int rcar_unreg_slave(struct i2c_client *slave) · 867 unmodified lines
868868 /* disable irqs and ensure none is running before clearing ptr */
869869 rcar_i2c_write(priv, ICSIER, 0);
870870 rcar_i2c_write(priv, ICSCR, 0);
871+ rcar_i2c_write(priv, ICSAR, 0); /* Gen2: must be 0 if not using slave */
871872
872873 synchronize_irq(priv->irq);
873874 priv->slave = NULL;
@@ -969,6 +970,8 @@ static int rcar_i2c_probe(struct platform_device *pdev) · 95 unmodified lines
969970 if (ret < 0)
970971 goto out_pm_put;
971972
973+ rcar_i2c_write(priv, ICSAR, 0); /* Gen2: must be 0 if not using slave */
974+
972975 if (priv->devtype == I2C_RCAR_GEN3) {
973976 priv->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
974977 if (!IS_ERR(priv->rstc)) {
drivers/i2c/i2c-core-slave.c+4−3
@@ -18,10 +18,8 @@ int i2c_slave_register(struct i2c_client *client, i2c_slave_cb_t slave_cb) · 17 unmodified lines
1818 {
1919 int ret;
2020
21− if (!client || !slave_cb) {
22− WARN(1, "insufficient data\n");
21+ if (WARN(IS_ERR_OR_NULL(client) || !slave_cb, "insufficient data\n"))
2322 return -EINVAL;
24− }
2523
2624 if (!(client->flags & I2C_CLIENT_SLAVE))
2725 dev_warn(&client->dev, "%s: client slave flag not set. You might see address collisions\n",
@@ -60,6 +58,9 @@ int i2c_slave_unregister(struct i2c_client *client) · 32 unmodified lines
6058 {
6159 int ret;
6260
61+ if (IS_ERR_OR_NULL(client))
62+ return -EINVAL;
63+
6364 if (!client->adapter->algo->unreg_slave) {
6465 dev_err(&client->dev, "%s: not supported by adapter\n", __func__);
6566 return -EOPNOTSUPP;
drivers/iio/accel/mma8452.c+4−1
@@ -1685,10 +1685,13 @@ static int mma8452_probe(struct i2c_client *client, · 1684 unmodified lines
16851685
16861686 ret = mma8452_set_freefall_mode(data, false);
16871687 if (ret < 0)
1688− goto buffer_cleanup;
1688+ goto unregister_device;
16891689
16901690 return 0;
16911691
1692+unregister_device:
1693+ iio_device_unregister(indio_dev);
1694+
16921695 buffer_cleanup:
16931696 iio_triggered_buffer_cleanup(indio_dev);
16941697
drivers/iio/adc/ad7780.c+1−1
@@ -329,7 +329,7 @@ static int ad7780_probe(struct spi_device *spi) · 328 unmodified lines
329329
330330 ret = ad7780_init_gpios(&spi->dev, st);
331331 if (ret)
332− goto error_cleanup_buffer_and_trigger;
332+ return ret;
333333
334334 st->reg = devm_regulator_get(&spi->dev, "avdd");
335335 if (IS_ERR(st->reg))
drivers/iio/adc/adi-axi-adc.c+2−2
@@ -332,12 +332,12 @@ static struct adi_axi_adc_client *adi_axi_adc_attach_client(struct device *dev) · 331 unmodified lines
332332 if (cl->dev->of_node != cln)
333333 continue;
334334
335− if (!try_module_get(dev->driver->owner)) {
335+ if (!try_module_get(cl->dev->driver->owner)) {
336336 mutex_unlock(&registered_clients_lock);
337337 return ERR_PTR(-ENODEV);
338338 }
339339
340− get_device(dev);
340+ get_device(cl->dev);
341341 cl->info = info;
342342 mutex_unlock(&registered_clients_lock);
343343 return cl;
drivers/iio/health/afe4403.c+6−3
@@ -65,6 +65,7 @@ static const struct reg_field afe4403_reg_fields[] = { · 64 unmodified lines
6565 * @regulator: Pointer to the regulator for the IC
6666 * @trig: IIO trigger for this device
6767 * @irq: ADC_RDY line interrupt number
68+ * @buffer: Used to construct data layout to push into IIO buffer.
6869 */
6970 struct afe4403_data {
7071 struct device *dev;
@@ -74,6 +75,8 @@ struct afe4403_data { · 3 unmodified lines
7475 struct regulator *regulator;
7576 struct iio_trigger *trig;
7677 int irq;
78+ /* Ensure suitable alignment for timestamp */
79+ s32 buffer[8] __aligned(8);
7780 };
7881
7982 enum afe4403_chan_id {
@@ -309,7 +312,6 @@ static irqreturn_t afe4403_trigger_handler(int irq, void *private) · 229 unmodified lines
309312 struct iio_dev *indio_dev = pf->indio_dev;
310313 struct afe4403_data *afe = iio_priv(indio_dev);
311314 int ret, bit, i = 0;
312− s32 buffer[8];
313315 u8 tx[4] = {AFE440X_CONTROL0, 0x0, 0x0, AFE440X_CONTROL0_READ};
314316 u8 rx[3];
315317
@@ -326,7 +328,7 @@ static irqreturn_t afe4403_trigger_handler(int irq, void *private) · 10 unmodified lines
326328 if (ret)
327329 goto err;
328330
329− buffer[i++] = get_unaligned_be24(&rx[0]);
331+ afe->buffer[i++] = get_unaligned_be24(&rx[0]);
330332 }
331333
332334 /* Disable reading from the device */
@@ -335,7 +337,8 @@ static irqreturn_t afe4403_trigger_handler(int irq, void *private) · 2 unmodified lines
335337 if (ret)
336338 goto err;
337339
338− iio_push_to_buffers_with_timestamp(indio_dev, buffer, pf->timestamp);
340+ iio_push_to_buffers_with_timestamp(indio_dev, afe->buffer,
341+ pf->timestamp);
339342 err:
340343 iio_trigger_notify_done(indio_dev->trig);
341344
drivers/iio/health/afe4404.c+5−3
@@ -83,6 +83,7 @@ static const struct reg_field afe4404_reg_fields[] = { · 82 unmodified lines
8383 * @regulator: Pointer to the regulator for the IC
8484 * @trig: IIO trigger for this device
8585 * @irq: ADC_RDY line interrupt number
86+ * @buffer: Used to construct a scan to push to the iio buffer.
8687 */
8788 struct afe4404_data {
8889 struct device *dev;
@@ -91,6 +92,7 @@ struct afe4404_data { · 2 unmodified lines
9192 struct regulator *regulator;
9293 struct iio_trigger *trig;
9394 int irq;
95+ s32 buffer[10] __aligned(8);
9496 };
9597
9698 enum afe4404_chan_id {
@@ -328,17 +330,17 @@ static irqreturn_t afe4404_trigger_handler(int irq, void *private) · 231 unmodified lines
328330 struct iio_dev *indio_dev = pf->indio_dev;
329331 struct afe4404_data *afe = iio_priv(indio_dev);
330332 int ret, bit, i = 0;
331− s32 buffer[10];
332333
333334 for_each_set_bit(bit, indio_dev->active_scan_mask,
334335 indio_dev->masklength) {
335336 ret = regmap_read(afe->regmap, afe4404_channel_values[bit],
336− &buffer[i++]);
337+ &afe->buffer[i++]);
337338 if (ret)
338339 goto err;
339340 }
340341
341− iio_push_to_buffers_with_timestamp(indio_dev, buffer, pf->timestamp);
342+ iio_push_to_buffers_with_timestamp(indio_dev, afe->buffer,
343+ pf->timestamp);
342344 err:
343345 iio_trigger_notify_done(indio_dev->trig);
344346
drivers/iio/humidity/hdc100x.c+7−3
@@ -38,6 +38,11 @@ struct hdc100x_data { · 37 unmodified lines
3838
3939 /* integration time of the sensor */
4040 int adc_int_us[2];
41+ /* Ensure natural alignment of timestamp */
42+ struct {
43+ __be16 channels[2];
44+ s64 ts __aligned(8);
45+ } scan;
4146 };
4247
4348 /* integration time in us */
@@ -322,7 +327,6 @@ static irqreturn_t hdc100x_trigger_handler(int irq, void *p) · 278 unmodified lines
322327 struct i2c_client *client = data->client;
323328 int delay = data->adc_int_us[0] + data->adc_int_us[1];
324329 int ret;
325− s16 buf[8]; /* 2x s16 + padding + 8 byte timestamp */
326330
327331 /* dual read starts at temp register */
328332 mutex_lock(&data->lock);
@@ -333,13 +337,13 @@ static irqreturn_t hdc100x_trigger_handler(int irq, void *p) · 4 unmodified lines
333337 }
334338 usleep_range(delay, delay + 1000);
335339
336− ret = i2c_master_recv(client, (u8 *)buf, 4);
340+ ret = i2c_master_recv(client, (u8 *)data->scan.channels, 4);
337341 if (ret < 0) {
338342 dev_err(&client->dev, "cannot read sensor data\n");
339343 goto err;
340344 }
341345
342− iio_push_to_buffers_with_timestamp(indio_dev, buf,
346+ iio_push_to_buffers_with_timestamp(indio_dev, &data->scan,
343347 iio_get_time_ns(indio_dev));
344348 err:
345349 mutex_unlock(&data->lock);
drivers/iio/humidity/hts221.h+5−2
@@ -14,8 +14,6 @@ · 13 unmodified lines
1414
1515 #include <linux/iio/iio.h>
1616
17−#define HTS221_DATA_SIZE 2
18−
1917 enum hts221_sensor_type {
2018 HTS221_SENSOR_H,
2119 HTS221_SENSOR_T,
@@ -39,6 +37,11 @@ struct hts221_hw { · 17 unmodified lines
3937
4038 bool enabled;
4139 u8 odr;
40+ /* Ensure natural alignment of timestamp */
41+ struct {
42+ __le16 channels[2];
43+ s64 ts __aligned(8);
44+ } scan;
4245 };
4346
4447 extern const struct dev_pm_ops hts221_pm_ops;
drivers/iio/humidity/hts221_buffer.c+5−4
@@ -160,7 +160,6 @@ static const struct iio_buffer_setup_ops hts221_buffer_ops = { · 159 unmodified lines
160160
161161 static irqreturn_t hts221_buffer_handler_thread(int irq, void *p)
162162 {
163− u8 buffer[ALIGN(2 * HTS221_DATA_SIZE, sizeof(s64)) + sizeof(s64)];
164163 struct iio_poll_func *pf = p;
165164 struct iio_dev *iio_dev = pf->indio_dev;
166165 struct hts221_hw *hw = iio_priv(iio_dev);
@@ -170,18 +169,20 @@ static irqreturn_t hts221_buffer_handler_thread(int irq, void *p) · 3 unmodified lines
170169 /* humidity data */
171170 ch = &iio_dev->channels[HTS221_SENSOR_H];
172171 err = regmap_bulk_read(hw->regmap, ch->address,
173− buffer, HTS221_DATA_SIZE);
172+ &hw->scan.channels[0],
173+ sizeof(hw->scan.channels[0]));
174174 if (err < 0)
175175 goto out;
176176
177177 /* temperature data */
178178 ch = &iio_dev->channels[HTS221_SENSOR_T];
179179 err = regmap_bulk_read(hw->regmap, ch->address,
180− buffer + HTS221_DATA_SIZE, HTS221_DATA_SIZE);
180+ &hw->scan.channels[1],
181+ sizeof(hw->scan.channels[1]));
181182 if (err < 0)
182183 goto out;
183184
184− iio_push_to_buffers_with_timestamp(iio_dev, buffer,
185+ iio_push_to_buffers_with_timestamp(iio_dev, &hw->scan,
185186 iio_get_time_ns(iio_dev));
186187
187188 out:
drivers/iio/industrialio-core.c+2−0
@@ -130,6 +130,8 @@ static const char * const iio_modifier_names[] = { · 129 unmodified lines
130130 [IIO_MOD_PM2P5] = "pm2p5",
131131 [IIO_MOD_PM4] = "pm4",
132132 [IIO_MOD_PM10] = "pm10",
133+ [IIO_MOD_ETHANOL] = "ethanol",
134+ [IIO_MOD_H2] = "h2",
133135 };
134136
135137 /* relies on pairs of these shared then separate */
drivers/iio/magnetometer/ak8974.c+17−12
@@ -192,6 +192,11 @@ struct ak8974 { · 191 unmodified lines
192192 bool drdy_irq;
193193 struct completion drdy_complete;
194194 bool drdy_active_low;
195+ /* Ensure timestamp is naturally aligned */
196+ struct {
197+ __le16 channels[3];
198+ s64 ts __aligned(8);
199+ } scan;
195200 };
196201
197202 static const char ak8974_reg_avdd[] = "avdd";
@@ -657,7 +662,6 @@ static void ak8974_fill_buffer(struct iio_dev *indio_dev) · 459 unmodified lines
657662 {
658663 struct ak8974 *ak8974 = iio_priv(indio_dev);
659664 int ret;
660− __le16 hw_values[8]; /* Three axes + 64bit padding */
661665
662666 pm_runtime_get_sync(&ak8974->i2c->dev);
663667 mutex_lock(&ak8974->lock);
@@ -667,13 +671,13 @@ static void ak8974_fill_buffer(struct iio_dev *indio_dev) · 3 unmodified lines
667671 dev_err(&ak8974->i2c->dev, "error triggering measure\n");
668672 goto out_unlock;
669673 }
670− ret = ak8974_getresult(ak8974, hw_values);
674+ ret = ak8974_getresult(ak8974, ak8974->scan.channels);
671675 if (ret) {
672676 dev_err(&ak8974->i2c->dev, "error getting measures\n");
673677 goto out_unlock;
674678 }
675679
676− iio_push_to_buffers_with_timestamp(indio_dev, hw_values,
680+ iio_push_to_buffers_with_timestamp(indio_dev, &ak8974->scan,
677681 iio_get_time_ns(indio_dev));
678682
679683 out_unlock:
@@ -862,19 +866,21 @@ static int ak8974_probe(struct i2c_client *i2c, · 182 unmodified lines
862866 ak8974->map = devm_regmap_init_i2c(i2c, &ak8974_regmap_config);
863867 if (IS_ERR(ak8974->map)) {
864868 dev_err(&i2c->dev, "failed to allocate register map\n");
869+ pm_runtime_put_noidle(&i2c->dev);
870+ pm_runtime_disable(&i2c->dev);
865871 return PTR_ERR(ak8974->map);
866872 }
867873
868874 ret = ak8974_set_power(ak8974, AK8974_PWR_ON);
869875 if (ret) {
870876 dev_err(&i2c->dev, "could not power on\n");
871− goto power_off;
877+ goto disable_pm;
872878 }
873879
874880 ret = ak8974_detect(ak8974);
875881 if (ret) {
876882 dev_err(&i2c->dev, "neither AK8974 nor AMI30x found\n");
877− goto power_off;
883+ goto disable_pm;
878884 }
879885
880886 ret = ak8974_selftest(ak8974);
@@ -884,14 +890,9 @@ static int ak8974_probe(struct i2c_client *i2c, · 3 unmodified lines
884890 ret = ak8974_reset(ak8974);
885891 if (ret) {
886892 dev_err(&i2c->dev, "AK8974 reset failed\n");
887− goto power_off;
893+ goto disable_pm;
888894 }
889895
890− pm_runtime_set_autosuspend_delay(&i2c->dev,
891− AK8974_AUTOSUSPEND_DELAY);
892− pm_runtime_use_autosuspend(&i2c->dev);
893− pm_runtime_put(&i2c->dev);
894−
895896 indio_dev->dev.parent = &i2c->dev;
896897 switch (ak8974->variant) {
897898 case AK8974_WHOAMI_VALUE_AMI306:
@@ -957,6 +958,11 @@ no_irq: · 59 unmodified lines
957958 goto cleanup_buffer;
958959 }
959960
961+ pm_runtime_set_autosuspend_delay(&i2c->dev,
962+ AK8974_AUTOSUSPEND_DELAY);
963+ pm_runtime_use_autosuspend(&i2c->dev);
964+ pm_runtime_put(&i2c->dev);
965+
960966 return 0;
961967
962968 cleanup_buffer:
@@ -965,7 +971,6 @@ disable_pm: · 2 unmodified lines
965971 pm_runtime_put_noidle(&i2c->dev);
966972 pm_runtime_disable(&i2c->dev);
967973 ak8974_set_power(ak8974, AK8974_PWR_OFF);
968−power_off:
969974 regulator_bulk_disable(ARRAY_SIZE(ak8974->regs), ak8974->regs);
970975
971976 return ret;
drivers/iio/pressure/ms5611_core.c+8−3
@@ -212,16 +212,21 @@ static irqreturn_t ms5611_trigger_handler(int irq, void *p) · 211 unmodified lines
212212 struct iio_poll_func *pf = p;
213213 struct iio_dev *indio_dev = pf->indio_dev;
214214 struct ms5611_state *st = iio_priv(indio_dev);
215− s32 buf[4]; /* s32 (pressure) + s32 (temp) + 2 * s32 (timestamp) */
215+ /* Ensure buffer elements are naturally aligned */
216+ struct {
217+ s32 channels[2];
218+ s64 ts __aligned(8);
219+ } scan;
216220 int ret;
217221
218222 mutex_lock(&st->lock);
219− ret = ms5611_read_temp_and_pressure(indio_dev, &buf[1], &buf[0]);
223+ ret = ms5611_read_temp_and_pressure(indio_dev, &scan.channels[1],
224+ &scan.channels[0]);
220225 mutex_unlock(&st->lock);
221226 if (ret < 0)
222227 goto err;
223228
224− iio_push_to_buffers_with_timestamp(indio_dev, buf,
229+ iio_push_to_buffers_with_timestamp(indio_dev, &scan,
225230 iio_get_time_ns(indio_dev));
226231
227232 err:
drivers/iio/pressure/zpa2326.c+3−1
@@ -665,8 +665,10 @@ static int zpa2326_resume(const struct iio_dev *indio_dev) · 664 unmodified lines
665665 int err;
666666
667667 err = pm_runtime_get_sync(indio_dev->dev.parent);
668− if (err < 0)
668+ if (err < 0) {
669+ pm_runtime_put(indio_dev->dev.parent);
669670 return err;
671+ }
670672
671673 if (err > 0) {
672674 /*
drivers/infiniband/core/cm.c+2−0
@@ -3676,10 +3676,12 @@ static int cm_send_sidr_rep_locked(struct cm_id_private *cm_id_priv, · 3675 unmodified lines
36763676 return ret;
36773677 }
36783678 cm_id_priv->id.state = IB_CM_IDLE;
3679+ spin_lock_irq(&cm.lock);
36793680 if (!RB_EMPTY_NODE(&cm_id_priv->sidr_id_node)) {
36803681 rb_erase(&cm_id_priv->sidr_id_node, &cm.remote_sidr_table);
36813682 RB_CLEAR_NODE(&cm_id_priv->sidr_id_node);
36823683 }
3684+ spin_unlock_irq(&cm.lock);
36833685 return 0;
36843686 }
36853687
drivers/infiniband/core/cq.c+11−3
@@ -72,6 +72,15 @@ static void rdma_dim_init(struct ib_cq *cq) · 71 unmodified lines
7272 INIT_WORK(&dim->work, ib_cq_rdma_dim_work);
7373 }
7474
75+static void rdma_dim_destroy(struct ib_cq *cq)
76+{
77+ if (!cq->dim)
78+ return;
79+
80+ cancel_work_sync(&cq->dim->work);
81+ kfree(cq->dim);
82+}
83+
7584 static int __poll_cq(struct ib_cq *cq, int num_entries, struct ib_wc *wc)
7685 {
7786 int rc;
@@ -266,6 +275,7 @@ struct ib_cq *__ib_alloc_cq_user(struct ib_device *dev, void *private, · 188 unmodified lines
266275 return cq;
267276
268277 out_destroy_cq:
278+ rdma_dim_destroy(cq);
269279 rdma_restrack_del(&cq->res);
270280 cq->device->ops.destroy_cq(cq, udata);
271281 out_free_wc:
@@ -331,12 +341,10 @@ void ib_free_cq_user(struct ib_cq *cq, struct ib_udata *udata) · 59 unmodified lines
331341 WARN_ON_ONCE(1);
332342 }
333343
344+ rdma_dim_destroy(cq);
334345 trace_cq_free(cq);
335346 rdma_restrack_del(&cq->res);
336347 cq->device->ops.destroy_cq(cq, udata);
337− if (cq->dim)
338− cancel_work_sync(&cq->dim->work);
339− kfree(cq->dim);
340348 kfree(cq->wc);
341349 kfree(cq);
342350 }
drivers/infiniband/core/rdma_core.c+3−3
@@ -649,9 +649,6 @@ void rdma_alloc_commit_uobject(struct ib_uobject *uobj, · 648 unmodified lines
649649 {
650650 struct ib_uverbs_file *ufile = attrs->ufile;
651651
652− /* alloc_commit consumes the uobj kref */
653− uobj->uapi_object->type_class->alloc_commit(uobj);
654−
655652 /* kref is held so long as the uobj is on the uobj list. */
656653 uverbs_uobject_get(uobj);
657654 spin_lock_irq(&ufile->uobjects_lock);
@@ -661,6 +658,9 @@ void rdma_alloc_commit_uobject(struct ib_uobject *uobj, · 3 unmodified lines
661658 /* matches atomic_set(-1) in alloc_uobj */
662659 atomic_set(&uobj->usecnt, 0);
663660
661+ /* alloc_commit consumes the uobj kref */
662+ uobj->uapi_object->type_class->alloc_commit(uobj);
663+
664664 /* Matches the down_read in rdma_alloc_begin_uobject */
665665 up_read(&ufile->hw_destroy_rwsem);
666666 }
drivers/infiniband/core/sa_query.c+17−21
@@ -829,13 +829,20 @@ static int ib_nl_get_path_rec_attrs_len(ib_sa_comp_mask comp_mask) · 828 unmodified lines
829829 return len;
830830 }
831831
832−static int ib_nl_send_msg(struct ib_sa_query *query, gfp_t gfp_mask)
832+static int ib_nl_make_request(struct ib_sa_query *query, gfp_t gfp_mask)
833833 {
834834 struct sk_buff *skb = NULL;
835835 struct nlmsghdr *nlh;
836836 void *data;
837837 struct ib_sa_mad *mad;
838838 int len;
839+ unsigned long flags;
840+ unsigned long delay;
841+ gfp_t gfp_flag;
842+ int ret;
843+
844+ INIT_LIST_HEAD(&query->list);
845+ query->seq = (u32)atomic_inc_return(&ib_nl_sa_request_seq);
839846
840847 mad = query->mad_buf->mad;
841848 len = ib_nl_get_path_rec_attrs_len(mad->sa_hdr.comp_mask);
@@ -860,36 +867,25 @@ static int ib_nl_send_msg(struct ib_sa_query *query, gfp_t gfp_mask) · 18 unmodified lines
860867 /* Repair the nlmsg header length */
861868 nlmsg_end(skb, nlh);
862869
863− return rdma_nl_multicast(&init_net, skb, RDMA_NL_GROUP_LS, gfp_mask);
864−}
870+ gfp_flag = ((gfp_mask & GFP_ATOMIC) == GFP_ATOMIC) ? GFP_ATOMIC :
871+ GFP_NOWAIT;
865872
866−static int ib_nl_make_request(struct ib_sa_query *query, gfp_t gfp_mask)
867−{
868− unsigned long flags;
869− unsigned long delay;
870− int ret;
873+ spin_lock_irqsave(&ib_nl_request_lock, flags);
874+ ret = rdma_nl_multicast(&init_net, skb, RDMA_NL_GROUP_LS, gfp_flag);
871875
872− INIT_LIST_HEAD(&query->list);
873− query->seq = (u32)atomic_inc_return(&ib_nl_sa_request_seq);
876+ if (ret)
877+ goto out;
874878
875− /* Put the request on the list first.*/
876− spin_lock_irqsave(&ib_nl_request_lock, flags);
879+ /* Put the request on the list.*/
877880 delay = msecs_to_jiffies(sa_local_svc_timeout_ms);
878881 query->timeout = delay + jiffies;
879882 list_add_tail(&query->list, &ib_nl_request_list);
880883 /* Start the timeout if this is the only request */
881884 if (ib_nl_request_list.next == &query->list)
882885 queue_delayed_work(ib_nl_wq, &ib_nl_timed_work, delay);
883− spin_unlock_irqrestore(&ib_nl_request_lock, flags);
884886
885− ret = ib_nl_send_msg(query, gfp_mask);
886− if (ret) {
887− ret = -EIO;
888− /* Remove the request */
889− spin_lock_irqsave(&ib_nl_request_lock, flags);
890− list_del(&query->list);
891− spin_unlock_irqrestore(&ib_nl_request_lock, flags);
892− }
887+out:
888+ spin_unlock_irqrestore(&ib_nl_request_lock, flags);
893889
894890 return ret;
895891 }
drivers/infiniband/core/ucma.c+4−0
@@ -1084,6 +1084,8 @@ static ssize_t ucma_connect(struct ucma_file *file, const char __user *inbuf, · 1083 unmodified lines
10841084 size_t in_size;
10851085 int ret;
10861086
1087+ if (in_len < offsetofend(typeof(cmd), reserved))
1088+ return -EINVAL;
10871089 in_size = min_t(size_t, in_len, sizeof(cmd));
10881090 if (copy_from_user(&cmd, inbuf, in_size))
10891091 return -EFAULT;
@@ -1141,6 +1143,8 @@ static ssize_t ucma_accept(struct ucma_file *file, const char __user *inbuf, · 51 unmodified lines
11411143 size_t in_size;
11421144 int ret;
11431145
1146+ if (in_len < offsetofend(typeof(cmd), reserved))
1147+ return -EINVAL;
11441148 in_size = min_t(size_t, in_len, sizeof(cmd));
11451149 if (copy_from_user(&cmd, inbuf, in_size))
11461150 return -EFAULT;
drivers/infiniband/hw/hfi1/init.c+28−9
@@ -830,6 +830,29 @@ wq_error: · 829 unmodified lines
830830 return -ENOMEM;
831831 }
832832
833+/**
834+ * destroy_workqueues - destroy per port workqueues
835+ * @dd: the hfi1_ib device
836+ */
837+static void destroy_workqueues(struct hfi1_devdata *dd)
838+{
839+ int pidx;
840+ struct hfi1_pportdata *ppd;
841+
842+ for (pidx = 0; pidx < dd->num_pports; ++pidx) {
843+ ppd = dd->pport + pidx;
844+
845+ if (ppd->hfi1_wq) {
846+ destroy_workqueue(ppd->hfi1_wq);
847+ ppd->hfi1_wq = NULL;
848+ }
849+ if (ppd->link_wq) {
850+ destroy_workqueue(ppd->link_wq);
851+ ppd->link_wq = NULL;
852+ }
853+ }
854+}
855+
833856 /**
834857 * enable_general_intr() - Enable the IRQs that will be handled by the
835858 * general interrupt handler.
@@ -1103,15 +1126,10 @@ static void shutdown_device(struct hfi1_devdata *dd) · 267 unmodified lines
11031126 * We can't count on interrupts since we are stopping.
11041127 */
11051128 hfi1_quiet_serdes(ppd);
1106−
1107− if (ppd->hfi1_wq) {
1108− destroy_workqueue(ppd->hfi1_wq);
1109− ppd->hfi1_wq = NULL;
1110− }
1111− if (ppd->link_wq) {
1112− destroy_workqueue(ppd->link_wq);
1113− ppd->link_wq = NULL;
1114− }
1129+ if (ppd->hfi1_wq)
1130+ flush_workqueue(ppd->hfi1_wq);
1131+ if (ppd->link_wq)
1132+ flush_workqueue(ppd->link_wq);
11151133 }
11161134 sdma_exit(dd);
11171135 }
@@ -1756,6 +1774,7 @@ static void remove_one(struct pci_dev *pdev) · 638 unmodified lines
17561774 * clear dma engines, etc.
17571775 */
17581776 shutdown_device(dd);
1777+ destroy_workqueues(dd);
17591778
17601779 stop_timers(dd);
17611780
drivers/infiniband/hw/hfi1/qp.c+5−2
@@ -195,7 +195,7 @@ static inline int verbs_mtu_enum_to_int(struct ib_device *dev, enum ib_mtu mtu) · 194 unmodified lines
195195 {
196196 /* Constraining 10KB packets to 8KB packets */
197197 if (mtu == (enum ib_mtu)OPA_MTU_10240)
198− mtu = OPA_MTU_8192;
198+ mtu = (enum ib_mtu)OPA_MTU_8192;
199199 return opa_mtu_enum_to_int((enum opa_mtu)mtu);
200200 }
201201
@@ -367,7 +367,10 @@ bool _hfi1_schedule_send(struct rvt_qp *qp) · 165 unmodified lines
367367 struct hfi1_ibport *ibp =
368368 to_iport(qp->ibqp.device, qp->port_num);
369369 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
370− struct hfi1_devdata *dd = dd_from_ibdev(qp->ibqp.device);
370+ struct hfi1_devdata *dd = ppd->dd;
371+
372+ if (dd->flags & HFI1_SHUTDOWN)
373+ return true;
371374
372375 return iowait_schedule(&priv->s_iowait, ppd->hfi1_wq,
373376 priv->s_sde ?
drivers/infiniband/hw/hfi1/tid_rdma.c+4−1
@@ -5406,7 +5406,10 @@ static bool _hfi1_schedule_tid_send(struct rvt_qp *qp) · 5405 unmodified lines
54065406 struct hfi1_ibport *ibp =
54075407 to_iport(qp->ibqp.device, qp->port_num);
54085408 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
5409− struct hfi1_devdata *dd = dd_from_ibdev(qp->ibqp.device);
5409+ struct hfi1_devdata *dd = ppd->dd;
5410+
5411+ if ((dd->flags & HFI1_SHUTDOWN))
5412+ return true;
54105413
54115414 return iowait_tid_schedule(&priv->s_iowait, ppd->hfi1_wq,
54125415 priv->s_sde ?
drivers/infiniband/hw/hns/hns_roce_hw_v2.c+22−12
@@ -3954,6 +3954,15 @@ static int config_qp_sq_buf(struct hns_roce_dev *hr_dev, · 3953 unmodified lines
39543954 return 0;
39553955 }
39563956
3957+static inline enum ib_mtu get_mtu(struct ib_qp *ibqp,
3958+ const struct ib_qp_attr *attr)
3959+{
3960+ if (ibqp->qp_type == IB_QPT_GSI || ibqp->qp_type == IB_QPT_UD)
3961+ return IB_MTU_4096;
3962+
3963+ return attr->path_mtu;
3964+}
3965+
39573966 static int modify_qp_init_to_rtr(struct ib_qp *ibqp,
39583967 const struct ib_qp_attr *attr, int attr_mask,
39593968 struct hns_roce_v2_qp_context *context,
@@ -3965,6 +3974,7 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp, · 5 unmodified lines
39653974 struct ib_device *ibdev = &hr_dev->ib_dev;
39663975 dma_addr_t trrl_ba;
39673976 dma_addr_t irrl_ba;
3977+ enum ib_mtu mtu;
39683978 u8 port_num;
39693979 u64 *mtts;
39703980 u8 *dmac;
@@ -4062,23 +4072,23 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp, · 91 unmodified lines
40624072 roce_set_field(qpc_mask->byte_52_udpspn_dmac, V2_QPC_BYTE_52_DMAC_M,
40634073 V2_QPC_BYTE_52_DMAC_S, 0);
40644074
4065− /* mtu*(2^LP_PKTN_INI) should not bigger than 1 message length 64kb */
4075+ mtu = get_mtu(ibqp, attr);
4076+
4077+ if (attr_mask & IB_QP_PATH_MTU) {
4078+ roce_set_field(context->byte_24_mtu_tc, V2_QPC_BYTE_24_MTU_M,
4079+ V2_QPC_BYTE_24_MTU_S, mtu);
4080+ roce_set_field(qpc_mask->byte_24_mtu_tc, V2_QPC_BYTE_24_MTU_M,
4081+ V2_QPC_BYTE_24_MTU_S, 0);
4082+ }
4083+
4084+#define MAX_LP_MSG_LEN 65536
4085+ /* MTU*(2^LP_PKTN_INI) shouldn't be bigger than 64kb */
40664086 roce_set_field(context->byte_56_dqpn_err, V2_QPC_BYTE_56_LP_PKTN_INI_M,
40674087 V2_QPC_BYTE_56_LP_PKTN_INI_S,
4068− ilog2(hr_dev->caps.max_sq_inline / IB_MTU_4096));
4088+ ilog2(MAX_LP_MSG_LEN / ib_mtu_enum_to_int(mtu)));
40694089 roce_set_field(qpc_mask->byte_56_dqpn_err, V2_QPC_BYTE_56_LP_PKTN_INI_M,
40704090 V2_QPC_BYTE_56_LP_PKTN_INI_S, 0);
40714091
4072− if (ibqp->qp_type == IB_QPT_GSI || ibqp->qp_type == IB_QPT_UD)
4073− roce_set_field(context->byte_24_mtu_tc, V2_QPC_BYTE_24_MTU_M,
4074− V2_QPC_BYTE_24_MTU_S, IB_MTU_4096);
4075− else if (attr_mask & IB_QP_PATH_MTU)
4076− roce_set_field(context->byte_24_mtu_tc, V2_QPC_BYTE_24_MTU_M,
4077− V2_QPC_BYTE_24_MTU_S, attr->path_mtu);
4078−
4079− roce_set_field(qpc_mask->byte_24_mtu_tc, V2_QPC_BYTE_24_MTU_M,
4080− V2_QPC_BYTE_24_MTU_S, 0);
4081−
40824092 roce_set_bit(qpc_mask->byte_108_rx_reqepsn,
40834093 V2_QPC_BYTE_108_RX_REQ_PSN_ERR_S, 0);
40844094 roce_set_field(qpc_mask->byte_96_rx_reqmsn, V2_QPC_BYTE_96_RX_REQ_MSN_M,
drivers/infiniband/hw/hns/hns_roce_mr.c+1−1
@@ -120,7 +120,7 @@ static int alloc_mr_pbl(struct hns_roce_dev *hr_dev, struct hns_roce_mr *mr, · 119 unmodified lines
120120
121121 mr->pbl_hop_num = is_fast ? 1 : hr_dev->caps.pbl_hop_num;
122122 buf_attr.page_shift = is_fast ? PAGE_SHIFT :
123− hr_dev->caps.pbl_buf_pg_sz + HNS_HW_PAGE_SHIFT;
123+ hr_dev->caps.pbl_buf_pg_sz + PAGE_SHIFT;
124124 buf_attr.region[0].size = length;
125125 buf_attr.region[0].hopnum = mr->pbl_hop_num;
126126 buf_attr.region_count = 1;
drivers/infiniband/hw/mlx5/main.c+1−1
@@ -511,7 +511,7 @@ static int mlx5_query_port_roce(struct ib_device *device, u8 port_num, · 510 unmodified lines
511511 mdev_port_num);
512512 if (err)
513513 goto out;
514− ext = MLX5_CAP_PCAM_FEATURE(dev->mdev, ptys_extended_ethernet);
514+ ext = !!MLX5_GET_ETH_PROTO(ptys_reg, out, true, eth_proto_capability);
515515 eth_prot_oper = MLX5_GET_ETH_PROTO(ptys_reg, out, ext, eth_proto_oper);
516516
517517 props->active_width = IB_WIDTH_4X;
drivers/infiniband/hw/mlx5/odp.c+21−6
@@ -601,6 +601,23 @@ void mlx5_ib_free_implicit_mr(struct mlx5_ib_mr *imr) · 600 unmodified lines
601601 */
602602 synchronize_srcu(&dev->odp_srcu);
603603
604+ /*
605+ * All work on the prefetch list must be completed, xa_erase() prevented
606+ * new work from being created.
607+ */
608+ wait_event(imr->q_deferred_work, !atomic_read(&imr->num_deferred_work));
609+
610+ /*
611+ * At this point it is forbidden for any other thread to enter
612+ * pagefault_mr() on this imr. It is already forbidden to call
613+ * pagefault_mr() on an implicit child. Due to this additions to
614+ * implicit_children are prevented.
615+ */
616+
617+ /*
618+ * Block destroy_unused_implicit_child_mr() from incrementing
619+ * num_deferred_work.
620+ */
604621 xa_lock(&imr->implicit_children);
605622 xa_for_each (&imr->implicit_children, idx, mtt) {
606623 __xa_erase(&imr->implicit_children, idx);
@@ -609,9 +626,8 @@ void mlx5_ib_free_implicit_mr(struct mlx5_ib_mr *imr) · 2 unmodified lines
609626 xa_unlock(&imr->implicit_children);
610627
611628 /*
612− * num_deferred_work can only be incremented inside the odp_srcu, or
613− * under xa_lock while the child is in the xarray. Thus at this point
614− * it is only decreasing, and all work holding it is now on the wq.
629+ * Wait for any concurrent destroy_unused_implicit_child_mr() to
630+ * complete.
615631 */
616632 wait_event(imr->q_deferred_work, !atomic_read(&imr->num_deferred_work));
617633
@@ -1781,9 +1797,7 @@ static bool init_prefetch_work(struct ib_pd *pd, · 1163 unmodified lines
17811797 work->frags[i].mr =
17821798 get_prefetchable_mr(pd, advice, sg_list[i].lkey);
17831799 if (!work->frags[i].mr) {
1784− work->num_sge = i - 1;
1785− if (i)
1786− destroy_prefetch_work(work);
1800+ work->num_sge = i;
17871801 return false;
17881802 }
17891803
@@ -1849,6 +1863,7 @@ int mlx5_ib_advise_mr_prefetch(struct ib_pd *pd, · 59 unmodified lines
18491863 srcu_key = srcu_read_lock(&dev->odp_srcu);
18501864 if (!init_prefetch_work(pd, advice, pf_flags, work, sg_list, num_sge)) {
18511865 srcu_read_unlock(&dev->odp_srcu, srcu_key);
1866+ destroy_prefetch_work(work);
18521867 return -EINVAL;
18531868 }
18541869 queue_work(system_unbound_wq, &work->work);
drivers/infiniband/hw/mlx5/qp.c+22−14
@@ -1766,15 +1766,14 @@ err: · 1765 unmodified lines
17661766 }
17671767
17681768 static void configure_requester_scat_cqe(struct mlx5_ib_dev *dev,
1769+ struct mlx5_ib_qp *qp,
17691770 struct ib_qp_init_attr *init_attr,
1770− struct mlx5_ib_create_qp *ucmd,
17711771 void *qpc)
17721772 {
17731773 int scqe_sz;
17741774 bool allow_scat_cqe = false;
17751775
1776− if (ucmd)
1777− allow_scat_cqe = ucmd->flags & MLX5_QP_FLAG_ALLOW_SCATTER_CQE;
1776+ allow_scat_cqe = qp->flags_en & MLX5_QP_FLAG_ALLOW_SCATTER_CQE;
17781777
17791778 if (!allow_scat_cqe && init_attr->sq_sig_type != IB_SIGNAL_ALL_WR)
17801779 return;
@@ -1853,8 +1852,6 @@ static int create_xrc_tgt_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp, · 72 unmodified lines
18531852 u32 *in;
18541853 int err;
18551854
1856− mutex_init(&qp->mutex);
1857−
18581855 if (attr->sq_sig_type == IB_SIGNAL_ALL_WR)
18591856 qp->sq_signal_bits = MLX5_WQE_CTRL_CQ_UPDATE;
18601857
@@ -1938,7 +1935,6 @@ static int create_user_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd, · 77 unmodified lines
19381935 u32 *in;
19391936 int err;
19401937
1941− mutex_init(&qp->mutex);
19421938 spin_lock_init(&qp->sq.lock);
19431939 spin_lock_init(&qp->rq.lock);
19441940
@@ -2012,7 +2008,7 @@ static int create_user_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd, · 67 unmodified lines
20122008 }
20132009 if ((qp->flags_en & MLX5_QP_FLAG_SCATTER_CQE) &&
20142010 (qp->type == MLX5_IB_QPT_DCI || qp->type == IB_QPT_RC))
2015− configure_requester_scat_cqe(dev, init_attr, ucmd, qpc);
2011+ configure_requester_scat_cqe(dev, qp, init_attr, qpc);
20162012
20172013 if (qp->rq.wqe_cnt) {
20182014 MLX5_SET(qpc, qpc, log_rq_stride, qp->rq.wqe_shift - 4);
@@ -2129,7 +2125,6 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd, · 110 unmodified lines
21292125 u32 *in;
21302126 int err;
21312127
2132− mutex_init(&qp->mutex);
21332128 spin_lock_init(&qp->sq.lock);
21342129 spin_lock_init(&qp->rq.lock);
21352130
@@ -2543,13 +2538,18 @@ static void process_vendor_flag(struct mlx5_ib_dev *dev, int *flags, int flag, · 407 unmodified lines
25432538 return;
25442539 }
25452540
2546− if (flag == MLX5_QP_FLAG_SCATTER_CQE) {
2541+ switch (flag) {
2542+ case MLX5_QP_FLAG_SCATTER_CQE:
2543+ case MLX5_QP_FLAG_ALLOW_SCATTER_CQE:
25472544 /*
2548− * We don't return error if this flag was provided,
2549− * and mlx5 doesn't have right capability.
2550− */
2551− *flags &= ~MLX5_QP_FLAG_SCATTER_CQE;
2545+ * We don't return error if these flags were provided,
2546+ * and mlx5 doesn't have right capability.
2547+ */
2548+ *flags &= ~(MLX5_QP_FLAG_SCATTER_CQE |
2549+ MLX5_QP_FLAG_ALLOW_SCATTER_CQE);
25522550 return;
2551+ default:
2552+ break;
25532553 }
25542554 mlx5_ib_dbg(dev, "Vendor create QP flag 0x%X is not supported\n", flag);
25552555 }
@@ -2589,6 +2589,8 @@ static int process_vendor_flags(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp, · 33 unmodified lines
25892589 process_vendor_flag(dev, &flags, MLX5_QP_FLAG_SIGNATURE, true, qp);
25902590 process_vendor_flag(dev, &flags, MLX5_QP_FLAG_SCATTER_CQE,
25912591 MLX5_CAP_GEN(mdev, sctr_data_cqe), qp);
2592+ process_vendor_flag(dev, &flags, MLX5_QP_FLAG_ALLOW_SCATTER_CQE,
2593+ MLX5_CAP_GEN(mdev, sctr_data_cqe), qp);
25922594
25932595 if (qp->type == IB_QPT_RAW_PACKET) {
25942596 cond = MLX5_CAP_ETH(mdev, tunnel_stateless_vxlan) ||
@@ -2668,6 +2670,10 @@ static int process_create_flags(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp, · 73 unmodified lines
26682670 if (qp_type == IB_QPT_RAW_PACKET && attr->rwq_ind_tbl)
26692671 return (create_flags) ? -EINVAL : 0;
26702672
2673+ process_create_flag(dev, &create_flags, IB_QP_CREATE_NETIF_QP,
2674+ mlx5_get_flow_namespace(dev->mdev,
2675+ MLX5_FLOW_NAMESPACE_BYPASS),
2676+ qp);
26712677 process_create_flag(dev, &create_flags,
26722678 IB_QP_CREATE_INTEGRITY_EN,
26732679 MLX5_CAP_GEN(mdev, sho), qp);
@@ -2959,6 +2965,7 @@ struct ib_qp *mlx5_ib_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attr, · 285 unmodified lines
29592965 goto free_ucmd;
29602966 }
29612967
2968+ mutex_init(&qp->mutex);
29622969 qp->type = type;
29632970 if (udata) {
29642971 err = process_vendor_flags(dev, qp, params.ucmd, attr);
@@ -3001,11 +3008,12 @@ destroy_qp: · 36 unmodified lines
30013008 mlx5_ib_destroy_dct(qp);
30023009 } else {
30033010 /*
3004− * The two lines below are temp solution till QP allocation
3011+ * These lines below are temp solution till QP allocation
30053012 * will be moved to be under IB/core responsiblity.
30063013 */
30073014 qp->ibqp.send_cq = attr->send_cq;
30083015 qp->ibqp.recv_cq = attr->recv_cq;
3016+ qp->ibqp.pd = pd;
30093017 destroy_qp_common(dev, qp, udata);
30103018 }
30113019
drivers/infiniband/hw/mlx5/srq_cmd.c+2−2
@@ -83,11 +83,11 @@ struct mlx5_core_srq *mlx5_cmd_get_srq(struct mlx5_ib_dev *dev, u32 srqn) · 82 unmodified lines
8383 struct mlx5_srq_table *table = &dev->srq_table;
8484 struct mlx5_core_srq *srq;
8585
86− xa_lock(&table->array);
86+ xa_lock_irq(&table->array);
8787 srq = xa_load(&table->array, srqn);
8888 if (srq)
8989 refcount_inc(&srq->common.refcount);
90− xa_unlock(&table->array);
90+ xa_unlock_irq(&table->array);
9191
9292 return srq;
9393 }
drivers/infiniband/sw/rdmavt/qp.c+4−29
@@ -901,8 +901,6 @@ static void rvt_init_qp(struct rvt_dev_info *rdi, struct rvt_qp *qp, · 900 unmodified lines
901901 qp->s_tail_ack_queue = 0;
902902 qp->s_acked_ack_queue = 0;
903903 qp->s_num_rd_atomic = 0;
904− if (qp->r_rq.kwq)
905− qp->r_rq.kwq->count = qp->r_rq.size;
906904 qp->r_sge.num_sge = 0;
907905 atomic_set(&qp->s_reserved_used, 0);
908906 }
@@ -2366,31 +2364,6 @@ bad_lkey: · 1457 unmodified lines
23662364 return 0;
23672365 }
23682366
2369−/**
2370− * get_count - count numbers of request work queue entries
2371− * in circular buffer
2372− * @rq: data structure for request queue entry
2373− * @tail: tail indices of the circular buffer
2374− * @head: head indices of the circular buffer
2375− *
2376− * Return - total number of entries in the circular buffer
2377− */
2378−static u32 get_count(struct rvt_rq *rq, u32 tail, u32 head)
2379−{
2380− u32 count;
2381−
2382− count = head;
2383−
2384− if (count >= rq->size)
2385− count = 0;
2386− if (count < tail)
2387− count += rq->size - tail;
2388− else
2389− count -= tail;
2390−
2391− return count;
2392−}
2393−
23942367 /**
23952368 * get_rvt_head - get head indices of the circular buffer
23962369 * @rq: data structure for request queue entry
@@ -2465,7 +2438,7 @@ int rvt_get_rwqe(struct rvt_qp *qp, bool wr_id_only) · 68 unmodified lines
24652438
24662439 if (kwq->count < RVT_RWQ_COUNT_THRESHOLD) {
24672440 head = get_rvt_head(rq, ip);
2468− kwq->count = get_count(rq, tail, head);
2441+ kwq->count = rvt_get_rq_count(rq, head, tail);
24692442 }
24702443 if (unlikely(kwq->count == 0)) {
24712444 ret = 0;
@@ -2500,7 +2473,9 @@ int rvt_get_rwqe(struct rvt_qp *qp, bool wr_id_only) · 28 unmodified lines
25002473 * the number of remaining WQEs.
25012474 */
25022475 if (kwq->count < srq->limit) {
2503− kwq->count = get_count(rq, tail, get_rvt_head(rq, ip));
2476+ kwq->count =
2477+ rvt_get_rq_count(rq,
2478+ get_rvt_head(rq, ip), tail);
25042479 if (kwq->count < srq->limit) {
25052480 struct ib_event ev;
25062481
drivers/infiniband/sw/rdmavt/rc.c+1−3
@@ -127,9 +127,7 @@ __be32 rvt_compute_aeth(struct rvt_qp *qp) · 126 unmodified lines
127127 * not atomic, which is OK, since the fuzziness is
128128 * resolved as further ACKs go out.
129129 */
130− credits = head - tail;
131− if ((int)credits < 0)
132− credits += qp->r_rq.size;
130+ credits = rvt_get_rq_count(&qp->r_rq, head, tail);
133131 }
134132 /*
135133 * Binary search the credit table to find the code to
drivers/infiniband/sw/siw/siw_main.c+2−1
@@ -67,12 +67,13 @@ static int siw_device_register(struct siw_device *sdev, const char *name) · 66 unmodified lines
6767 static int dev_id = 1;
6868 int rv;
6969
70+ sdev->vendor_part_id = dev_id++;
71+
7072 rv = ib_register_device(base_dev, name);
7173 if (rv) {
7274 pr_warn("siw: device registration error %d\n", rv);
7375 return rv;
7476 }
75− sdev->vendor_part_id = dev_id++;
7677
7778 siw_dbg(base_dev, "HWaddr=%pM\n", sdev->netdev->dev_addr);
7879
drivers/input/mouse/elan_i2c_core.c+5−4
@@ -951,6 +951,8 @@ static void elan_report_absolute(struct elan_tp_data *data, u8 *packet) · 950 unmodified lines
951951 u8 hover_info = packet[ETP_HOVER_INFO_OFFSET];
952952 bool contact_valid, hover_event;
953953
954+ pm_wakeup_event(&data->client->dev, 0);
955+
954956 hover_event = hover_info & 0x40;
955957 for (i = 0; i < ETP_MAX_FINGERS; i++) {
956958 contact_valid = tp_info & (1U << (3 + i));
@@ -974,6 +976,8 @@ static void elan_report_trackpoint(struct elan_tp_data *data, u8 *report) · 17 unmodified lines
974976 u8 *packet = &report[ETP_REPORT_ID_OFFSET + 1];
975977 int x, y;
976978
979+ pm_wakeup_event(&data->client->dev, 0);
980+
977981 if (!data->tp_input) {
978982 dev_warn_once(&data->client->dev,
979983 "received a trackpoint report while no trackpoint device has been created. Please report upstream.\n");
@@ -998,7 +1002,6 @@ static void elan_report_trackpoint(struct elan_tp_data *data, u8 *report) · 18 unmodified lines
9981002 static irqreturn_t elan_isr(int irq, void *dev_id)
9991003 {
10001004 struct elan_tp_data *data = dev_id;
1001− struct device *dev = &data->client->dev;
10021005 int error;
10031006 u8 report[ETP_MAX_REPORT_LEN];
10041007
@@ -1016,8 +1019,6 @@ static irqreturn_t elan_isr(int irq, void *dev_id) · 11 unmodified lines
10161019 if (error)
10171020 goto out;
10181021
1019− pm_wakeup_event(dev, 0);
1020−
10211022 switch (report[ETP_REPORT_ID_OFFSET]) {
10221023 case ETP_REPORT_ID:
10231024 elan_report_absolute(data, report);
@@ -1026,7 +1027,7 @@ static irqreturn_t elan_isr(int irq, void *dev_id) · 2 unmodified lines
10261027 elan_report_trackpoint(data, report);
10271028 break;
10281029 default:
1029− dev_err(dev, "invalid report id data (%x)\n",
1030+ dev_err(&data->client->dev, "invalid report id data (%x)\n",
10301031 report[ETP_REPORT_ID_OFFSET]);
10311032 }
10321033
drivers/input/mouse/synaptics.c+1−0
@@ -179,6 +179,7 @@ static const char * const smbus_pnp_ids[] = { · 178 unmodified lines
179179 "LEN0093", /* T480 */
180180 "LEN0096", /* X280 */
181181 "LEN0097", /* X280 -> ALPS trackpoint */
182+ "LEN0099", /* X1 Extreme 1st */
182183 "LEN009b", /* T580 */
183184 "LEN200f", /* T450s */
184185 "LEN2044", /* L470 */
drivers/input/serio/i8042-x86ia64io.h+7−0
@@ -425,6 +425,13 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = { · 424 unmodified lines
425425 DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
426426 },
427427 },
428+ {
429+ /* Lenovo XiaoXin Air 12 */
430+ .matches = {
431+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
432+ DMI_MATCH(DMI_PRODUCT_NAME, "80UN"),
433+ },
434+ },
428435 {
429436 .matches = {
430437 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
drivers/input/touchscreen/elants_i2c.c+0−1
@@ -1325,7 +1325,6 @@ static int elants_i2c_probe(struct i2c_client *client, · 1324 unmodified lines
13251325 0, MT_TOOL_PALM, 0, 0);
13261326 input_abs_set_res(ts->input, ABS_MT_POSITION_X, ts->x_res);
13271327 input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->y_res);
1328− input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, 1);
13291328
13301329 touchscreen_parse_properties(ts->input, true, &ts->prop);
13311330
drivers/interconnect/core.c+9−3
@@ -243,6 +243,7 @@ static int aggregate_requests(struct icc_node *node) · 242 unmodified lines
243243 {
244244 struct icc_provider *p = node->provider;
245245 struct icc_req *r;
246+ u32 avg_bw, peak_bw;
246247
247248 node->avg_bw = 0;
248249 node->peak_bw = 0;
@@ -251,9 +252,14 @@ static int aggregate_requests(struct icc_node *node) · 2 unmodified lines
251252 p->pre_aggregate(node);
252253
253254 hlist_for_each_entry(r, &node->req_list, req_node) {
254− if (!r->enabled)
255− continue;
256− p->aggregate(node, r->tag, r->avg_bw, r->peak_bw,
255+ if (r->enabled) {
256+ avg_bw = r->avg_bw;
257+ peak_bw = r->peak_bw;
258+ } else {
259+ avg_bw = 0;
260+ peak_bw = 0;
261+ }
262+ p->aggregate(node, r->tag, avg_bw, peak_bw,
257263 &node->avg_bw, &node->peak_bw);
258264 }
259265
drivers/interconnect/qcom/msm8916.c+7−7
@@ -197,13 +197,13 @@ DEFINE_QNODE(pcnoc_int_0, MSM8916_PNOC_INT_0, 8, -1, -1, MSM8916_PNOC_SNOC_MAS, · 196 unmodified lines
197197 DEFINE_QNODE(pcnoc_int_1, MSM8916_PNOC_INT_1, 8, -1, -1, MSM8916_PNOC_SNOC_MAS);
198198 DEFINE_QNODE(pcnoc_m_0, MSM8916_PNOC_MAS_0, 8, -1, -1, MSM8916_PNOC_INT_0);
199199 DEFINE_QNODE(pcnoc_m_1, MSM8916_PNOC_MAS_1, 8, -1, -1, MSM8916_PNOC_SNOC_MAS);
200−DEFINE_QNODE(pcnoc_s_0, MSM8916_PNOC_SLV_0, 8, -1, -1, MSM8916_SLAVE_CLK_CTL, MSM8916_SLAVE_TLMM, MSM8916_SLAVE_TCSR, MSM8916_SLAVE_SECURITY, MSM8916_SLAVE_MSS);
201−DEFINE_QNODE(pcnoc_s_1, MSM8916_PNOC_SLV_1, 8, -1, -1, MSM8916_SLAVE_IMEM_CFG, MSM8916_SLAVE_CRYPTO_0_CFG, MSM8916_SLAVE_MSG_RAM, MSM8916_SLAVE_PDM, MSM8916_SLAVE_PRNG);
202−DEFINE_QNODE(pcnoc_s_2, MSM8916_PNOC_SLV_2, 8, -1, -1, MSM8916_SLAVE_SPDM, MSM8916_SLAVE_BOOT_ROM, MSM8916_SLAVE_BIMC_CFG, MSM8916_SLAVE_PNOC_CFG, MSM8916_SLAVE_PMIC_ARB);
203−DEFINE_QNODE(pcnoc_s_3, MSM8916_PNOC_SLV_3, 8, -1, -1, MSM8916_SLAVE_MPM, MSM8916_SLAVE_SNOC_CFG, MSM8916_SLAVE_RBCPR_CFG, MSM8916_SLAVE_QDSS_CFG, MSM8916_SLAVE_DEHR_CFG);
204−DEFINE_QNODE(pcnoc_s_4, MSM8916_PNOC_SLV_4, 8, -1, -1, MSM8916_SLAVE_VENUS_CFG, MSM8916_SLAVE_CAMERA_CFG, MSM8916_SLAVE_DISPLAY_CFG);
205−DEFINE_QNODE(pcnoc_s_8, MSM8916_PNOC_SLV_8, 8, -1, -1, MSM8916_SLAVE_USB_HS, MSM8916_SLAVE_SDCC_1, MSM8916_SLAVE_BLSP_1);
206−DEFINE_QNODE(pcnoc_s_9, MSM8916_PNOC_SLV_9, 8, -1, -1, MSM8916_SLAVE_SDCC_2, MSM8916_SLAVE_LPASS, MSM8916_SLAVE_GRAPHICS_3D_CFG);
200+DEFINE_QNODE(pcnoc_s_0, MSM8916_PNOC_SLV_0, 4, -1, -1, MSM8916_SLAVE_CLK_CTL, MSM8916_SLAVE_TLMM, MSM8916_SLAVE_TCSR, MSM8916_SLAVE_SECURITY, MSM8916_SLAVE_MSS);
201+DEFINE_QNODE(pcnoc_s_1, MSM8916_PNOC_SLV_1, 4, -1, -1, MSM8916_SLAVE_IMEM_CFG, MSM8916_SLAVE_CRYPTO_0_CFG, MSM8916_SLAVE_MSG_RAM, MSM8916_SLAVE_PDM, MSM8916_SLAVE_PRNG);
202+DEFINE_QNODE(pcnoc_s_2, MSM8916_PNOC_SLV_2, 4, -1, -1, MSM8916_SLAVE_SPDM, MSM8916_SLAVE_BOOT_ROM, MSM8916_SLAVE_BIMC_CFG, MSM8916_SLAVE_PNOC_CFG, MSM8916_SLAVE_PMIC_ARB);
203+DEFINE_QNODE(pcnoc_s_3, MSM8916_PNOC_SLV_3, 4, -1, -1, MSM8916_SLAVE_MPM, MSM8916_SLAVE_SNOC_CFG, MSM8916_SLAVE_RBCPR_CFG, MSM8916_SLAVE_QDSS_CFG, MSM8916_SLAVE_DEHR_CFG);
204+DEFINE_QNODE(pcnoc_s_4, MSM8916_PNOC_SLV_4, 4, -1, -1, MSM8916_SLAVE_VENUS_CFG, MSM8916_SLAVE_CAMERA_CFG, MSM8916_SLAVE_DISPLAY_CFG);
205+DEFINE_QNODE(pcnoc_s_8, MSM8916_PNOC_SLV_8, 4, -1, -1, MSM8916_SLAVE_USB_HS, MSM8916_SLAVE_SDCC_1, MSM8916_SLAVE_BLSP_1);
206+DEFINE_QNODE(pcnoc_s_9, MSM8916_PNOC_SLV_9, 4, -1, -1, MSM8916_SLAVE_SDCC_2, MSM8916_SLAVE_LPASS, MSM8916_SLAVE_GRAPHICS_3D_CFG);
207207 DEFINE_QNODE(pcnoc_snoc_mas, MSM8916_PNOC_SNOC_MAS, 8, 29, -1, MSM8916_PNOC_SNOC_SLV);
208208 DEFINE_QNODE(pcnoc_snoc_slv, MSM8916_PNOC_SNOC_SLV, 8, -1, 45, MSM8916_SNOC_INT_0, MSM8916_SNOC_INT_BIMC, MSM8916_SNOC_INT_1);
209209 DEFINE_QNODE(qdss_int, MSM8916_SNOC_QDSS_INT, 8, -1, -1, MSM8916_SNOC_INT_0, MSM8916_SNOC_INT_BIMC);
drivers/iommu/Kconfig+1−0
@@ -305,6 +305,7 @@ config ROCKCHIP_IOMMU · 304 unmodified lines
305305
306306 config SUN50I_IOMMU
307307 bool "Allwinner H6 IOMMU Support"
308+ depends on HAS_DMA
308309 depends on ARCH_SUNXI || COMPILE_TEST
309310 select ARM_DMA_USE_IOMMU
310311 select IOMMU_API
drivers/iommu/amd/amd_iommu.h+1−1
@@ -102,7 +102,7 @@ extern int __init add_special_device(u8 type, u8 id, u16 *devid, · 101 unmodified lines
102102 #ifdef CONFIG_DMI
103103 void amd_iommu_apply_ivrs_quirks(void);
104104 #else
105−static void amd_iommu_apply_ivrs_quirks(void) { }
105+static inline void amd_iommu_apply_ivrs_quirks(void) { }
106106 #endif
107107
108108 #endif
drivers/iommu/amd/iommu.c+3−2
@@ -3985,9 +3985,10 @@ int amd_iommu_create_irq_domain(struct amd_iommu *iommu) · 3984 unmodified lines
39853985 if (!fn)
39863986 return -ENOMEM;
39873987 iommu->ir_domain = irq_domain_create_tree(fn, &amd_ir_domain_ops, iommu);
3988− irq_domain_free_fwnode(fn);
3989− if (!iommu->ir_domain)
3988+ if (!iommu->ir_domain) {
3989+ irq_domain_free_fwnode(fn);
39903990 return -ENOMEM;
3991+ }
39913992
39923993 iommu->ir_domain->parent = arch_get_ir_parent_domain();
39933994 iommu->msi_domain = arch_create_remap_msi_irq_domain(iommu->ir_domain,
drivers/iommu/arm-smmu-qcom.c+1−1
@@ -12,7 +12,7 @@ struct qcom_smmu { · 11 unmodified lines
1212 struct arm_smmu_device smmu;
1313 };
1414
15−static const struct of_device_id qcom_smmu_client_of_match[] = {
15+static const struct of_device_id qcom_smmu_client_of_match[] __maybe_unused = {
1616 { .compatible = "qcom,adreno" },
1717 { .compatible = "qcom,mdp4" },
1818 { .compatible = "qcom,mdss" },
drivers/iommu/hyperv-iommu.c+4−1
@@ -155,7 +155,10 @@ static int __init hyperv_prepare_irq_remapping(void) · 154 unmodified lines
155155 0, IOAPIC_REMAPPING_ENTRY, fn,
156156 &hyperv_ir_domain_ops, NULL);
157157
158− irq_domain_free_fwnode(fn);
158+ if (!ioapic_ir_domain) {
159+ irq_domain_free_fwnode(fn);
160+ return -ENOMEM;
161+ }
159162
160163 /*
161164 * Hyper-V doesn't provide irq remapping function for
drivers/iommu/intel/irq_remapping.c+1−1
@@ -563,8 +563,8 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu) · 562 unmodified lines
563563 0, INTR_REMAP_TABLE_ENTRIES,
564564 fn, &intel_ir_domain_ops,
565565 iommu);
566− irq_domain_free_fwnode(fn);
567566 if (!iommu->ir_domain) {
567+ irq_domain_free_fwnode(fn);
568568 pr_err("IR%d: failed to allocate irqdomain\n", iommu->seq_id);
569569 goto out_free_bitmap;
570570 }
drivers/iommu/iommu.c+1−1
@@ -295,10 +295,10 @@ void iommu_release_device(struct device *dev) · 294 unmodified lines
295295 return;
296296
297297 iommu_device_unlink(dev->iommu->iommu_dev, dev);
298− iommu_group_remove_device(dev);
299298
300299 ops->release_device(dev);
301300
301+ iommu_group_remove_device(dev);
302302 module_put(ops->owner);
303303 dev_iommu_free(dev);
304304 }
drivers/iommu/qcom_iommu.c+17−20
@@ -65,6 +65,7 @@ struct qcom_iommu_domain { · 64 unmodified lines
6565 struct mutex init_mutex; /* Protects iommu pointer */
6666 struct iommu_domain domain;
6767 struct qcom_iommu_dev *iommu;
68+ struct iommu_fwspec *fwspec;
6869 };
6970
7071 static struct qcom_iommu_domain *to_qcom_iommu_domain(struct iommu_domain *dom)
@@ -84,9 +85,9 @@ static struct qcom_iommu_dev * to_iommu(struct device *dev) · 13 unmodified lines
8485 return dev_iommu_priv_get(dev);
8586 }
8687
87−static struct qcom_iommu_ctx * to_ctx(struct device *dev, unsigned asid)
88+static struct qcom_iommu_ctx * to_ctx(struct qcom_iommu_domain *d, unsigned asid)
8889 {
89− struct qcom_iommu_dev *qcom_iommu = to_iommu(dev);
90+ struct qcom_iommu_dev *qcom_iommu = d->iommu;
9091 if (!qcom_iommu)
9192 return NULL;
9293 return qcom_iommu->ctxs[asid - 1];
@@ -118,14 +119,12 @@ iommu_readq(struct qcom_iommu_ctx *ctx, unsigned reg) · 25 unmodified lines
118119
119120 static void qcom_iommu_tlb_sync(void *cookie)
120121 {
121− struct iommu_fwspec *fwspec;
122− struct device *dev = cookie;
122+ struct qcom_iommu_domain *qcom_domain = cookie;
123+ struct iommu_fwspec *fwspec = qcom_domain->fwspec;
123124 unsigned i;
124125
125− fwspec = dev_iommu_fwspec_get(dev);
126−
127126 for (i = 0; i < fwspec->num_ids; i++) {
128− struct qcom_iommu_ctx *ctx = to_ctx(dev, fwspec->ids[i]);
127+ struct qcom_iommu_ctx *ctx = to_ctx(qcom_domain, fwspec->ids[i]);
129128 unsigned int val, ret;
130129
131130 iommu_writel(ctx, ARM_SMMU_CB_TLBSYNC, 0);
@@ -139,14 +138,12 @@ static void qcom_iommu_tlb_sync(void *cookie) · 7 unmodified lines
139138
140139 static void qcom_iommu_tlb_inv_context(void *cookie)
141140 {
142− struct device *dev = cookie;
143− struct iommu_fwspec *fwspec;
141+ struct qcom_iommu_domain *qcom_domain = cookie;
142+ struct iommu_fwspec *fwspec = qcom_domain->fwspec;
144143 unsigned i;
145144
146− fwspec = dev_iommu_fwspec_get(dev);
147−
148145 for (i = 0; i < fwspec->num_ids; i++) {
149− struct qcom_iommu_ctx *ctx = to_ctx(dev, fwspec->ids[i]);
146+ struct qcom_iommu_ctx *ctx = to_ctx(qcom_domain, fwspec->ids[i]);
150147 iommu_writel(ctx, ARM_SMMU_CB_S1_TLBIASID, ctx->asid);
151148 }
152149
@@ -156,16 +153,14 @@ static void qcom_iommu_tlb_inv_context(void *cookie) · 3 unmodified lines
156153 static void qcom_iommu_tlb_inv_range_nosync(unsigned long iova, size_t size,
157154 size_t granule, bool leaf, void *cookie)
158155 {
159− struct device *dev = cookie;
160− struct iommu_fwspec *fwspec;
156+ struct qcom_iommu_domain *qcom_domain = cookie;
157+ struct iommu_fwspec *fwspec = qcom_domain->fwspec;
161158 unsigned i, reg;
162159
163160 reg = leaf ? ARM_SMMU_CB_S1_TLBIVAL : ARM_SMMU_CB_S1_TLBIVA;
164161
165− fwspec = dev_iommu_fwspec_get(dev);
166−
167162 for (i = 0; i < fwspec->num_ids; i++) {
168− struct qcom_iommu_ctx *ctx = to_ctx(dev, fwspec->ids[i]);
163+ struct qcom_iommu_ctx *ctx = to_ctx(qcom_domain, fwspec->ids[i]);
169164 size_t s = size;
170165
171166 iova = (iova >> 12) << 12;
@@ -256,7 +251,9 @@ static int qcom_iommu_init_domain(struct iommu_domain *domain, · 84 unmodified lines
256251 };
257252
258253 qcom_domain->iommu = qcom_iommu;
259− pgtbl_ops = alloc_io_pgtable_ops(ARM_32_LPAE_S1, &pgtbl_cfg, dev);
254+ qcom_domain->fwspec = fwspec;
255+
256+ pgtbl_ops = alloc_io_pgtable_ops(ARM_32_LPAE_S1, &pgtbl_cfg, qcom_domain);
260257 if (!pgtbl_ops) {
261258 dev_err(qcom_iommu->dev, "failed to allocate pagetable ops\n");
262259 ret = -ENOMEM;
@@ -269,7 +266,7 @@ static int qcom_iommu_init_domain(struct iommu_domain *domain, · 6 unmodified lines
269266 domain->geometry.force_aperture = true;
270267
271268 for (i = 0; i < fwspec->num_ids; i++) {
272− struct qcom_iommu_ctx *ctx = to_ctx(dev, fwspec->ids[i]);
269+ struct qcom_iommu_ctx *ctx = to_ctx(qcom_domain, fwspec->ids[i]);
273270
274271 if (!ctx->secure_init) {
275272 ret = qcom_scm_restore_sec_cfg(qcom_iommu->sec_id, ctx->asid);
@@ -419,7 +416,7 @@ static void qcom_iommu_detach_dev(struct iommu_domain *domain, struct device *de · 143 unmodified lines
419416
420417 pm_runtime_get_sync(qcom_iommu->dev);
421418 for (i = 0; i < fwspec->num_ids; i++) {
422− struct qcom_iommu_ctx *ctx = to_ctx(dev, fwspec->ids[i]);
419+ struct qcom_iommu_ctx *ctx = to_ctx(qcom_domain, fwspec->ids[i]);
423420
424421 /* Disable the context bank: */
425422 iommu_writel(ctx, ARM_SMMU_CB_SCTLR, 0);
drivers/iommu/sun50i-iommu.c+3−5
@@ -313,9 +313,9 @@ static int sun50i_iommu_flush_all_tlb(struct sun50i_iommu *iommu) · 312 unmodified lines
313313 IOMMU_TLB_FLUSH_MICRO_TLB(1) |
314314 IOMMU_TLB_FLUSH_MICRO_TLB(0));
315315
316− ret = readl_poll_timeout(iommu->base + IOMMU_TLB_FLUSH_REG,
317− reg, !reg,
318− 1, 2000);
316+ ret = readl_poll_timeout_atomic(iommu->base + IOMMU_TLB_FLUSH_REG,
317+ reg, !reg,
318+ 1, 2000);
319319 if (ret)
320320 dev_warn(iommu->dev, "TLB Flush timed out!\n");
321321
@@ -556,7 +556,6 @@ static size_t sun50i_iommu_unmap(struct iommu_domain *domain, unsigned long iova · 234 unmodified lines
556556 {
557557 struct sun50i_iommu_domain *sun50i_domain = to_sun50i_domain(domain);
558558 phys_addr_t pt_phys;
559− dma_addr_t pte_dma;
560559 u32 *pte_addr;
561560 u32 dte;
562561
@@ -566,7 +565,6 @@ static size_t sun50i_iommu_unmap(struct iommu_domain *domain, unsigned long iova · 3 unmodified lines
566565
567566 pt_phys = sun50i_dte_get_pt_address(dte);
568567 pte_addr = (u32 *)phys_to_virt(pt_phys) + sun50i_iova_get_pte_index(iova);
569− pte_dma = pt_phys + sun50i_iova_get_pte_index(iova) * PT_ENTRY_SIZE;
570568
571569 if (!sun50i_pte_is_page_valid(*pte_addr))
572570 return 0;
drivers/md/dm-integrity.c+2−2
@@ -2420,7 +2420,7 @@ static void integrity_writer(struct work_struct *w) · 2419 unmodified lines
24202420 unsigned prev_free_sectors;
24212421
24222422 /* the following test is not needed, but it tests the replay code */
2423− if (unlikely(dm_suspended(ic->ti)) && !ic->meta_dev)
2423+ if (unlikely(dm_post_suspending(ic->ti)) && !ic->meta_dev)
24242424 return;
24252425
24262426 spin_lock_irq(&ic->endio_wait.lock);
@@ -2481,7 +2481,7 @@ static void integrity_recalc(struct work_struct *w) · 54 unmodified lines
24812481
24822482 next_chunk:
24832483
2484− if (unlikely(dm_suspended(ic->ti)))
2484+ if (unlikely(dm_post_suspending(ic->ti)))
24852485 goto unlock_ret;
24862486
24872487 range.logical_sector = le64_to_cpu(ic->sb->recalc_sector);
drivers/md/dm-rq.c+0−4
@@ -146,10 +146,6 @@ static void rq_end_stats(struct mapped_device *md, struct request *orig) · 145 unmodified lines
146146 */
147147 static void rq_completed(struct mapped_device *md)
148148 {
149− /* nudge anyone waiting on suspend queue */
150− if (unlikely(wq_has_sleeper(&md->wait)))
151− wake_up(&md->wait);
152−
153149 /*
154150 * dm_put() must be at the end of this function. See the comment above
155151 */
drivers/md/dm-writecache.c+6−0
@@ -2266,6 +2266,12 @@ invalid_optional: · 2265 unmodified lines
22662266 }
22672267
22682268 if (WC_MODE_PMEM(wc)) {
2269+ if (!dax_synchronous(wc->ssd_dev->dax_dev)) {
2270+ r = -EOPNOTSUPP;
2271+ ti->error = "Asynchronous persistent memory not supported as pmem cache";
2272+ goto bad;
2273+ }
2274+
22692275 r = persistent_memory_claim(wc);
22702276 if (r) {
22712277 ti->error = "Unable to map persistent memory for cache";
drivers/md/dm-zoned-metadata.c+8−1
@@ -2217,8 +2217,15 @@ struct dm_zone *dmz_alloc_zone(struct dmz_metadata *zmd, unsigned int dev_idx, · 2216 unmodified lines
22172217 {
22182218 struct list_head *list;
22192219 struct dm_zone *zone;
2220− int i = 0;
2220+ int i;
2221+
2222+ /* Schedule reclaim to ensure free zones are available */
2223+ if (!(flags & DMZ_ALLOC_RECLAIM)) {
2224+ for (i = 0; i < zmd->nr_devs; i++)
2225+ dmz_schedule_reclaim(zmd->dev[i].reclaim);
2226+ }
22212227
2228+ i = 0;
22222229 again:
22232230 if (flags & DMZ_ALLOC_CACHE)
22242231 list = &zmd->unmap_cache_list;
drivers/md/dm-zoned-reclaim.c+3−4
@@ -456,6 +456,8 @@ static unsigned int dmz_reclaim_percentage(struct dmz_reclaim *zrc) · 455 unmodified lines
456456 nr_zones = dmz_nr_rnd_zones(zmd, zrc->dev_idx);
457457 nr_unmap = dmz_nr_unmap_rnd_zones(zmd, zrc->dev_idx);
458458 }
459+ if (nr_unmap <= 1)
460+ return 0;
459461 return nr_unmap * 100 / nr_zones;
460462 }
461463
@@ -501,7 +503,7 @@ static void dmz_reclaim_work(struct work_struct *work) · 39 unmodified lines
501503 {
502504 struct dmz_reclaim *zrc = container_of(work, struct dmz_reclaim, work.work);
503505 struct dmz_metadata *zmd = zrc->metadata;
504− unsigned int p_unmap, nr_unmap_rnd = 0, nr_rnd = 0;
506+ unsigned int p_unmap;
505507 int ret;
506508
507509 if (dmz_dev_is_dying(zmd))
@@ -527,9 +529,6 @@ static void dmz_reclaim_work(struct work_struct *work) · 19 unmodified lines
527529 zrc->kc_throttle.throttle = min(75U, 100U - p_unmap / 2);
528530 }
529531
530− nr_unmap_rnd = dmz_nr_unmap_rnd_zones(zmd, zrc->dev_idx);
531− nr_rnd = dmz_nr_rnd_zones(zmd, zrc->dev_idx);
532−
533532 DMDEBUG("(%s/%u): Reclaim (%u): %s, %u%% free zones (%u/%u cache %u/%u random)",
534533 dmz_metadata_label(zmd), zrc->dev_idx,
535534 zrc->kc_throttle.throttle,
drivers/md/dm-zoned-target.c+1−9
@@ -400,15 +400,7 @@ static void dmz_handle_bio(struct dmz_target *dmz, struct dm_chunk_work *cw, · 399 unmodified lines
400400 dm_per_bio_data(bio, sizeof(struct dmz_bioctx));
401401 struct dmz_metadata *zmd = dmz->metadata;
402402 struct dm_zone *zone;
403− int i, ret;
404−
405− /*
406− * Write may trigger a zone allocation. So make sure the
407− * allocation can succeed.
408− */
409− if (bio_op(bio) == REQ_OP_WRITE)
410− for (i = 0; i < dmz->nr_ddevs; i++)
411− dmz_schedule_reclaim(dmz->dev[i].reclaim);
403+ int ret;
412404
413405 dmz_lock_metadata(zmd);
414406
drivers/md/dm.c+70−31
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/init.h>
1313 #include <linux/module.h>
1414 #include <linux/mutex.h>
15+#include <linux/sched/mm.h>
1516 #include <linux/sched/signal.h>
1617 #include <linux/blkpg.h>
1718 #include <linux/bio.h>
@@ -142,6 +143,7 @@ EXPORT_SYMBOL_GPL(dm_bio_get_target_bio_nr); · 124 unmodified lines
142143 #define DMF_NOFLUSH_SUSPENDING 5
143144 #define DMF_DEFERRED_REMOVE 6
144145 #define DMF_SUSPENDED_INTERNALLY 7
146+#define DMF_POST_SUSPENDING 8
145147
146148 #define DM_NUMA_NODE NUMA_NO_NODE
147149 static int dm_numa_node = DM_NUMA_NODE;
@@ -654,28 +656,6 @@ static void free_tio(struct dm_target_io *tio) · 506 unmodified lines
654656 bio_put(&tio->clone);
655657 }
656658
657−static bool md_in_flight_bios(struct mapped_device *md)
658−{
659− int cpu;
660− struct hd_struct *part = &dm_disk(md)->part0;
661− long sum = 0;
662−
663− for_each_possible_cpu(cpu) {
664− sum += part_stat_local_read_cpu(part, in_flight[0], cpu);
665− sum += part_stat_local_read_cpu(part, in_flight[1], cpu);
666− }
667−
668− return sum != 0;
669−}
670−
671−static bool md_in_flight(struct mapped_device *md)
672−{
673− if (queue_is_mq(md->queue))
674− return blk_mq_queue_inflight(md->queue);
675− else
676− return md_in_flight_bios(md);
677−}
678−
679659 u64 dm_start_time_ns_from_clone(struct bio *bio)
680660 {
681661 struct dm_target_io *tio = container_of(bio, struct dm_target_io, clone);
@@ -1465,9 +1445,6 @@ static int __send_empty_flush(struct clone_info *ci) · 783 unmodified lines
14651445 BUG_ON(bio_has_data(ci->bio));
14661446 while ((ti = dm_table_get_target(ci->map, target_nr++)))
14671447 __send_duplicate_bios(ci, ti, ti->num_flush_bios, NULL);
1468−
1469− bio_disassociate_blkg(ci->bio);
1470−
14711448 return 0;
14721449 }
14731450
@@ -1655,6 +1632,7 @@ static blk_qc_t __split_and_process_bio(struct mapped_device *md, · 181 unmodified lines
16551632 ci.bio = &flush_bio;
16561633 ci.sector_count = 0;
16571634 error = __send_empty_flush(&ci);
1635+ bio_uninit(ci.bio);
16581636 /* dec_pending submits any data associated with flush */
16591637 } else if (op_is_zone_mgmt(bio_op(bio))) {
16601638 ci.bio = bio;
@@ -1729,6 +1707,7 @@ static blk_qc_t __process_bio(struct mapped_device *md, struct dm_table *map, · 68 unmodified lines
17291707 ci.bio = &flush_bio;
17301708 ci.sector_count = 0;
17311709 error = __send_empty_flush(&ci);
1710+ bio_uninit(ci.bio);
17321711 /* dec_pending submits any data associated with flush */
17331712 } else {
17341713 struct dm_target_io *tio;
@@ -2430,6 +2409,7 @@ static void __dm_destroy(struct mapped_device *md, bool wait) · 695 unmodified lines
24302409 if (!dm_suspended_md(md)) {
24312410 dm_table_presuspend_targets(map);
24322411 set_bit(DMF_SUSPENDED, &md->flags);
2412+ set_bit(DMF_POST_SUSPENDING, &md->flags);
24332413 dm_table_postsuspend_targets(map);
24342414 }
24352415 /* dm_put_live_table must be before msleep, otherwise deadlock is possible */
@@ -2470,15 +2450,29 @@ void dm_put(struct mapped_device *md) · 34 unmodified lines
24702450 }
24712451 EXPORT_SYMBOL_GPL(dm_put);
24722452
2473−static int dm_wait_for_completion(struct mapped_device *md, long task_state)
2453+static bool md_in_flight_bios(struct mapped_device *md)
2454+{
2455+ int cpu;
2456+ struct hd_struct *part = &dm_disk(md)->part0;
2457+ long sum = 0;
2458+
2459+ for_each_possible_cpu(cpu) {
2460+ sum += part_stat_local_read_cpu(part, in_flight[0], cpu);
2461+ sum += part_stat_local_read_cpu(part, in_flight[1], cpu);
2462+ }
2463+
2464+ return sum != 0;
2465+}
2466+
2467+static int dm_wait_for_bios_completion(struct mapped_device *md, long task_state)
24742468 {
24752469 int r = 0;
24762470 DEFINE_WAIT(wait);
24772471
2478− while (1) {
2472+ while (true) {
24792473 prepare_to_wait(&md->wait, &wait, task_state);
24802474
2481− if (!md_in_flight(md))
2475+ if (!md_in_flight_bios(md))
24822476 break;
24832477
24842478 if (signal_pending_state(task_state, current)) {
@@ -2493,6 +2487,28 @@ static int dm_wait_for_completion(struct mapped_device *md, long task_state) · 8 unmodified lines
24932487 return r;
24942488 }
24952489
2490+static int dm_wait_for_completion(struct mapped_device *md, long task_state)
2491+{
2492+ int r = 0;
2493+
2494+ if (!queue_is_mq(md->queue))
2495+ return dm_wait_for_bios_completion(md, task_state);
2496+
2497+ while (true) {
2498+ if (!blk_mq_queue_inflight(md->queue))
2499+ break;
2500+
2501+ if (signal_pending_state(task_state, current)) {
2502+ r = -EINTR;
2503+ break;
2504+ }
2505+
2506+ msleep(5);
2507+ }
2508+
2509+ return r;
2510+}
2511+
24962512 /*
24972513 * Process the deferred bios
24982514 */
@@ -2752,7 +2768,9 @@ retry: · 253 unmodified lines
27522768 if (r)
27532769 goto out_unlock;
27542770
2771+ set_bit(DMF_POST_SUSPENDING, &md->flags);
27552772 dm_table_postsuspend_targets(map);
2773+ clear_bit(DMF_POST_SUSPENDING, &md->flags);
27562774
27572775 out_unlock:
27582776 mutex_unlock(&md->suspend_lock);
@@ -2849,7 +2867,9 @@ static void __dm_internal_suspend(struct mapped_device *md, unsigned suspend_fla · 90 unmodified lines
28492867 (void) __dm_suspend(md, map, suspend_flags, TASK_UNINTERRUPTIBLE,
28502868 DMF_SUSPENDED_INTERNALLY);
28512869
2870+ set_bit(DMF_POST_SUSPENDING, &md->flags);
28522871 dm_table_postsuspend_targets(map);
2872+ clear_bit(DMF_POST_SUSPENDING, &md->flags);
28532873 }
28542874
28552875 static void __dm_internal_resume(struct mapped_device *md)
@@ -2926,17 +2946,25 @@ EXPORT_SYMBOL_GPL(dm_internal_resume_fast); · 70 unmodified lines
29262946 int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action,
29272947 unsigned cookie)
29282948 {
2949+ int r;
2950+ unsigned noio_flag;
29292951 char udev_cookie[DM_COOKIE_LENGTH];
29302952 char *envp[] = { udev_cookie, NULL };
29312953
2954+ noio_flag = memalloc_noio_save();
2955+
29322956 if (!cookie)
2933− return kobject_uevent(&disk_to_dev(md->disk)->kobj, action);
2957+ r = kobject_uevent(&disk_to_dev(md->disk)->kobj, action);
29342958 else {
29352959 snprintf(udev_cookie, DM_COOKIE_LENGTH, "%s=%u",
29362960 DM_COOKIE_ENV_VAR_NAME, cookie);
2937− return kobject_uevent_env(&disk_to_dev(md->disk)->kobj,
2938− action, envp);
2961+ r = kobject_uevent_env(&disk_to_dev(md->disk)->kobj,
2962+ action, envp);
29392963 }
2964+
2965+ memalloc_noio_restore(noio_flag);
2966+
2967+ return r;
29402968 }
29412969
29422970 uint32_t dm_next_uevent_seq(struct mapped_device *md)
@@ -3002,6 +3030,11 @@ int dm_suspended_md(struct mapped_device *md) · 59 unmodified lines
30023030 return test_bit(DMF_SUSPENDED, &md->flags);
30033031 }
30043032
3033+static int dm_post_suspending_md(struct mapped_device *md)
3034+{
3035+ return test_bit(DMF_POST_SUSPENDING, &md->flags);
3036+}
3037+
30053038 int dm_suspended_internally_md(struct mapped_device *md)
30063039 {
30073040 return test_bit(DMF_SUSPENDED_INTERNALLY, &md->flags);
@@ -3018,6 +3051,12 @@ int dm_suspended(struct dm_target *ti) · 10 unmodified lines
30183051 }
30193052 EXPORT_SYMBOL_GPL(dm_suspended);
30203053
3054+int dm_post_suspending(struct dm_target *ti)
3055+{
3056+ return dm_post_suspending_md(dm_table_get_md(ti->table));
3057+}
3058+EXPORT_SYMBOL_GPL(dm_post_suspending);
3059+
30213060 int dm_noflush_suspending(struct dm_target *ti)
30223061 {
30233062 return __noflush_suspending(dm_table_get_md(ti->table));
drivers/mfd/ioc3.c+3−2
@@ -142,10 +142,11 @@ static int ioc3_irq_domain_setup(struct ioc3_priv_data *ipd, int irq) · 141 unmodified lines
142142 goto err;
143143
144144 domain = irq_domain_create_linear(fn, 24, &ioc3_irq_domain_ops, ipd);
145− if (!domain)
145+ if (!domain) {
146+ irq_domain_free_fwnode(fn);
146147 goto err;
148+ }
147149
148− irq_domain_free_fwnode(fn);
149150 ipd->domain = domain;
150151
151152 irq_set_chained_handler_and_data(irq, ioc3_irq_handler, domain);
drivers/misc/atmel-ssc.c+12−12
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 #include <linux/clk.h>
1111 #include <linux/err.h>
1212 #include <linux/io.h>
13−#include <linux/spinlock.h>
13+#include <linux/mutex.h>
1414 #include <linux/atmel-ssc.h>
1515 #include <linux/slab.h>
1616 #include <linux/module.h>
@@ -20,7 +20,7 @@ · 3 unmodified lines
2020 #include "../../sound/soc/atmel/atmel_ssc_dai.h"
2121
2222 /* Serialize access to ssc_list and user count */
23−static DEFINE_SPINLOCK(user_lock);
23+static DEFINE_MUTEX(user_lock);
2424 static LIST_HEAD(ssc_list);
2525
2626 struct ssc_device *ssc_request(unsigned int ssc_num)
@@ -28,7 +28,7 @@ struct ssc_device *ssc_request(unsigned int ssc_num) · 1 unmodified line
2828 int ssc_valid = 0;
2929 struct ssc_device *ssc;
3030
31− spin_lock(&user_lock);
31+ mutex_lock(&user_lock);
3232 list_for_each_entry(ssc, &ssc_list, list) {
3333 if (ssc->pdev->dev.of_node) {
3434 if (of_alias_get_id(ssc->pdev->dev.of_node, "ssc")
@@ -44,18 +44,18 @@ struct ssc_device *ssc_request(unsigned int ssc_num) · 9 unmodified lines
4444 }
4545
4646 if (!ssc_valid) {
47− spin_unlock(&user_lock);
47+ mutex_unlock(&user_lock);
4848 pr_err("ssc: ssc%d platform device is missing\n", ssc_num);
4949 return ERR_PTR(-ENODEV);
5050 }
5151
5252 if (ssc->user) {
53− spin_unlock(&user_lock);
53+ mutex_unlock(&user_lock);
5454 dev_dbg(&ssc->pdev->dev, "module busy\n");
5555 return ERR_PTR(-EBUSY);
5656 }
5757 ssc->user++;
58− spin_unlock(&user_lock);
58+ mutex_unlock(&user_lock);
5959
6060 clk_prepare(ssc->clk);
6161
@@ -67,14 +67,14 @@ void ssc_free(struct ssc_device *ssc) · 5 unmodified lines
6767 {
6868 bool disable_clk = true;
6969
70− spin_lock(&user_lock);
70+ mutex_lock(&user_lock);
7171 if (ssc->user)
7272 ssc->user--;
7373 else {
7474 disable_clk = false;
7575 dev_dbg(&ssc->pdev->dev, "device already free\n");
7676 }
77− spin_unlock(&user_lock);
77+ mutex_unlock(&user_lock);
7878
7979 if (disable_clk)
8080 clk_unprepare(ssc->clk);
@@ -237,9 +237,9 @@ static int ssc_probe(struct platform_device *pdev) · 156 unmodified lines
237237 return -ENXIO;
238238 }
239239
240− spin_lock(&user_lock);
240+ mutex_lock(&user_lock);
241241 list_add_tail(&ssc->list, &ssc_list);
242− spin_unlock(&user_lock);
242+ mutex_unlock(&user_lock);
243243
244244 platform_set_drvdata(pdev, ssc);
245245
@@ -258,9 +258,9 @@ static int ssc_remove(struct platform_device *pdev) · 12 unmodified lines
258258
259259 ssc_sound_dai_remove(ssc);
260260
261− spin_lock(&user_lock);
261+ mutex_lock(&user_lock);
262262 list_del(&ssc->list);
263− spin_unlock(&user_lock);
263+ mutex_unlock(&user_lock);
264264
265265 return 0;
266266 }
drivers/misc/habanalabs/command_submission.c+11−3
@@ -499,11 +499,19 @@ static int validate_queue_index(struct hl_device *hdev, · 498 unmodified lines
499499 struct asic_fixed_properties *asic = &hdev->asic_prop;
500500 struct hw_queue_properties *hw_queue_prop;
501501
502+ /* This must be checked here to prevent out-of-bounds access to
503+ * hw_queues_props array
504+ */
505+ if (chunk->queue_index >= HL_MAX_QUEUES) {
506+ dev_err(hdev->dev, "Queue index %d is invalid\n",
507+ chunk->queue_index);
508+ return -EINVAL;
509+ }
510+
502511 hw_queue_prop = &asic->hw_queues_props[chunk->queue_index];
503512
504− if ((chunk->queue_index >= HL_MAX_QUEUES) ||
505− (hw_queue_prop->type == QUEUE_TYPE_NA)) {
506− dev_err(hdev->dev, "Queue index %d is invalid\n",
513+ if (hw_queue_prop->type == QUEUE_TYPE_NA) {
514+ dev_err(hdev->dev, "Queue index %d is not applicable\n",
507515 chunk->queue_index);
508516 return -EINVAL;
509517 }
drivers/misc/habanalabs/debugfs.c+8−15
@@ -36,7 +36,7 @@ static int hl_debugfs_i2c_read(struct hl_device *hdev, u8 i2c_bus, u8 i2c_addr, · 35 unmodified lines
3636 pkt.i2c_reg = i2c_reg;
3737
3838 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
39− HL_DEVICE_TIMEOUT_USEC, (long *) val);
39+ 0, (long *) val);
4040
4141 if (rc)
4242 dev_err(hdev->dev, "Failed to read from I2C, error %d\n", rc);
@@ -63,7 +63,7 @@ static int hl_debugfs_i2c_write(struct hl_device *hdev, u8 i2c_bus, u8 i2c_addr, · 20 unmodified lines
6363 pkt.value = cpu_to_le64(val);
6464
6565 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
66− HL_DEVICE_TIMEOUT_USEC, NULL);
66+ 0, NULL);
6767
6868 if (rc)
6969 dev_err(hdev->dev, "Failed to write to I2C, error %d\n", rc);
@@ -87,7 +87,7 @@ static void hl_debugfs_led_set(struct hl_device *hdev, u8 led, u8 state) · 17 unmodified lines
8787 pkt.value = cpu_to_le64(state);
8888
8989 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
90− HL_DEVICE_TIMEOUT_USEC, NULL);
90+ 0, NULL);
9191
9292 if (rc)
9393 dev_err(hdev->dev, "Failed to set LED %d, error %d\n", led, rc);
@@ -981,7 +981,7 @@ static ssize_t hl_clk_gate_read(struct file *f, char __user *buf, · 887 unmodified lines
981981 if (*ppos)
982982 return 0;
983983
984− sprintf(tmp_buf, "%d\n", hdev->clock_gating);
984+ sprintf(tmp_buf, "0x%llx\n", hdev->clock_gating_mask);
985985 rc = simple_read_from_buffer(buf, strlen(tmp_buf) + 1, ppos, tmp_buf,
986986 strlen(tmp_buf) + 1);
987987
@@ -993,7 +993,7 @@ static ssize_t hl_clk_gate_write(struct file *f, const char __user *buf, · 5 unmodified lines
993993 {
994994 struct hl_dbg_device_entry *entry = file_inode(f)->i_private;
995995 struct hl_device *hdev = entry->hdev;
996− u32 value;
996+ u64 value;
997997 ssize_t rc;
998998
999999 if (atomic_read(&hdev->in_reset)) {
@@ -1002,19 +1002,12 @@ static ssize_t hl_clk_gate_write(struct file *f, const char __user *buf, · 2 unmodified lines
10021002 return 0;
10031003 }
10041004
1005− rc = kstrtouint_from_user(buf, count, 10, &value);
1005+ rc = kstrtoull_from_user(buf, count, 16, &value);
10061006 if (rc)
10071007 return rc;
10081008
1009− if (value) {
1010− hdev->clock_gating = 1;
1011− if (hdev->asic_funcs->enable_clock_gating)
1012− hdev->asic_funcs->enable_clock_gating(hdev);
1013− } else {
1014− if (hdev->asic_funcs->disable_clock_gating)
1015− hdev->asic_funcs->disable_clock_gating(hdev);
1016− hdev->clock_gating = 0;
1017− }
1009+ hdev->clock_gating_mask = value;
1010+ hdev->asic_funcs->set_clock_gating(hdev);
10181011
10191012 return count;
10201013 }
drivers/misc/habanalabs/device.c+1−1
@@ -608,7 +608,7 @@ int hl_device_set_debug_mode(struct hl_device *hdev, bool enable) · 607 unmodified lines
608608 hdev->in_debug = 0;
609609
610610 if (!hdev->hard_reset_pending)
611− hdev->asic_funcs->enable_clock_gating(hdev);
611+ hdev->asic_funcs->set_clock_gating(hdev);
612612
613613 goto out;
614614 }
drivers/misc/habanalabs/firmware_if.c+5−5
@@ -61,7 +61,7 @@ int hl_fw_send_pci_access_msg(struct hl_device *hdev, u32 opcode) · 60 unmodified lines
6161 pkt.ctl = cpu_to_le32(opcode << ARMCP_PKT_CTL_OPCODE_SHIFT);
6262
6363 return hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt,
64− sizeof(pkt), HL_DEVICE_TIMEOUT_USEC, NULL);
64+ sizeof(pkt), 0, NULL);
6565 }
6666
6767 int hl_fw_send_cpu_message(struct hl_device *hdev, u32 hw_queue_id, u32 *msg,
@@ -144,7 +144,7 @@ int hl_fw_unmask_irq(struct hl_device *hdev, u16 event_type) · 76 unmodified lines
144144 pkt.value = cpu_to_le64(event_type);
145145
146146 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
147− HL_DEVICE_TIMEOUT_USEC, &result);
147+ 0, &result);
148148
149149 if (rc)
150150 dev_err(hdev->dev, "failed to unmask RAZWI IRQ %d", event_type);
@@ -183,7 +183,7 @@ int hl_fw_unmask_irq_arr(struct hl_device *hdev, const u32 *irq_arr, · 32 unmodified lines
183183 ARMCP_PKT_CTL_OPCODE_SHIFT);
184184
185185 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) pkt,
186− total_pkt_size, HL_DEVICE_TIMEOUT_USEC, &result);
186+ total_pkt_size, 0, &result);
187187
188188 if (rc)
189189 dev_err(hdev->dev, "failed to unmask IRQ array\n");
@@ -204,7 +204,7 @@ int hl_fw_test_cpu_queue(struct hl_device *hdev) · 14 unmodified lines
204204 test_pkt.value = cpu_to_le64(ARMCP_PACKET_FENCE_VAL);
205205
206206 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &test_pkt,
207− sizeof(test_pkt), HL_DEVICE_TIMEOUT_USEC, &result);
207+ sizeof(test_pkt), 0, &result);
208208
209209 if (!rc) {
210210 if (result != ARMCP_PACKET_FENCE_VAL)
@@ -248,7 +248,7 @@ int hl_fw_send_heartbeat(struct hl_device *hdev) · 37 unmodified lines
248248 hb_pkt.value = cpu_to_le64(ARMCP_PACKET_FENCE_VAL);
249249
250250 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &hb_pkt,
251− sizeof(hb_pkt), HL_DEVICE_TIMEOUT_USEC, &result);
251+ sizeof(hb_pkt), 0, &result);
252252
253253 if ((rc) || (result != ARMCP_PACKET_FENCE_VAL))
254254 rc = -EIO;
drivers/misc/habanalabs/gaudi/gaudi.c+84−39
@@ -80,6 +80,7 @@ · 79 unmodified lines
8080 #define GAUDI_PLDM_QMAN0_TIMEOUT_USEC (HL_DEVICE_TIMEOUT_USEC * 30)
8181 #define GAUDI_PLDM_TPC_KERNEL_WAIT_USEC (HL_DEVICE_TIMEOUT_USEC * 30)
8282 #define GAUDI_BOOT_FIT_REQ_TIMEOUT_USEC 1000000 /* 1s */
83+#define GAUDI_MSG_TO_CPU_TIMEOUT_USEC 4000000 /* 4s */
8384
8485 #define GAUDI_QMAN0_FENCE_VAL 0x72E91AB9
8586
@@ -98,6 +99,11 @@ · 12 unmodified lines
9899
99100 #define GAUDI_ARB_WDT_TIMEOUT 0x1000000
100101
102+#define GAUDI_CLK_GATE_DEBUGFS_MASK (\
103+ BIT(GAUDI_ENGINE_ID_MME_0) |\
104+ BIT(GAUDI_ENGINE_ID_MME_2) |\
105+ GENMASK_ULL(GAUDI_ENGINE_ID_TPC_7, GAUDI_ENGINE_ID_TPC_0))
106+
101107 static const char gaudi_irq_name[GAUDI_MSI_ENTRIES][GAUDI_MAX_STRING_LEN] = {
102108 "gaudi cq 0_0", "gaudi cq 0_1", "gaudi cq 0_2", "gaudi cq 0_3",
103109 "gaudi cq 1_0", "gaudi cq 1_1", "gaudi cq 1_2", "gaudi cq 1_3",
@@ -106,14 +112,14 @@ static const char gaudi_irq_name[GAUDI_MSI_ENTRIES][GAUDI_MAX_STRING_LEN] = { · 2 unmodified lines
106112 };
107113
108114 static const u8 gaudi_dma_assignment[GAUDI_DMA_MAX] = {
109− [GAUDI_PCI_DMA_1] = 0,
110− [GAUDI_PCI_DMA_2] = 1,
111− [GAUDI_PCI_DMA_3] = 5,
112− [GAUDI_HBM_DMA_1] = 2,
113− [GAUDI_HBM_DMA_2] = 3,
114− [GAUDI_HBM_DMA_3] = 4,
115− [GAUDI_HBM_DMA_4] = 6,
116− [GAUDI_HBM_DMA_5] = 7
115+ [GAUDI_PCI_DMA_1] = GAUDI_ENGINE_ID_DMA_0,
116+ [GAUDI_PCI_DMA_2] = GAUDI_ENGINE_ID_DMA_1,
117+ [GAUDI_PCI_DMA_3] = GAUDI_ENGINE_ID_DMA_5,
118+ [GAUDI_HBM_DMA_1] = GAUDI_ENGINE_ID_DMA_2,
119+ [GAUDI_HBM_DMA_2] = GAUDI_ENGINE_ID_DMA_3,
120+ [GAUDI_HBM_DMA_3] = GAUDI_ENGINE_ID_DMA_4,
121+ [GAUDI_HBM_DMA_4] = GAUDI_ENGINE_ID_DMA_6,
122+ [GAUDI_HBM_DMA_5] = GAUDI_ENGINE_ID_DMA_7
117123 };
118124
119125 static const u8 gaudi_cq_assignment[NUMBER_OF_CMPLT_QUEUES] = {
@@ -1819,7 +1825,7 @@ static void gaudi_init_golden_registers(struct hl_device *hdev) · 1699 unmodified lines
18191825
18201826 gaudi_init_rate_limiter(hdev);
18211827
1822− gaudi_disable_clock_gating(hdev);
1828+ hdev->asic_funcs->disable_clock_gating(hdev);
18231829
18241830 for (tpc_id = 0, tpc_offset = 0;
18251831 tpc_id < TPC_NUMBER_OF_ENGINES;
@@ -2531,46 +2537,55 @@ static void gaudi_tpc_stall(struct hl_device *hdev) · 705 unmodified lines
25312537 WREG32(mmTPC7_CFG_TPC_STALL, 1 << TPC0_CFG_TPC_STALL_V_SHIFT);
25322538 }
25332539
2534−static void gaudi_enable_clock_gating(struct hl_device *hdev)
2540+static void gaudi_set_clock_gating(struct hl_device *hdev)
25352541 {
25362542 struct gaudi_device *gaudi = hdev->asic_specific;
25372543 u32 qman_offset;
25382544 int i;
25392545
2540− if (!hdev->clock_gating)
2541− return;
2542−
2543− if (gaudi->hw_cap_initialized & HW_CAP_CLK_GATE)
2544− return;
2545−
25462546 /* In case we are during debug session, don't enable the clock gate
25472547 * as it may interfere
25482548 */
25492549 if (hdev->in_debug)
25502550 return;
25512551
2552− for (i = 0, qman_offset = 0 ; i < PCI_DMA_NUMBER_OF_CHNLS ; i++) {
2552+ for (i = GAUDI_PCI_DMA_1, qman_offset = 0 ; i < GAUDI_HBM_DMA_1 ; i++) {
2553+ if (!(hdev->clock_gating_mask &
2554+ (BIT_ULL(gaudi_dma_assignment[i]))))
2555+ continue;
2556+
25532557 qman_offset = gaudi_dma_assignment[i] * DMA_QMAN_OFFSET;
25542558 WREG32(mmDMA0_QM_CGM_CFG1 + qman_offset, QMAN_CGM1_PWR_GATE_EN);
25552559 WREG32(mmDMA0_QM_CGM_CFG + qman_offset,
25562560 QMAN_UPPER_CP_CGM_PWR_GATE_EN);
25572561 }
25582562
2559− for (; i < HBM_DMA_NUMBER_OF_CHNLS ; i++) {
2563+ for (i = GAUDI_HBM_DMA_1 ; i < GAUDI_DMA_MAX ; i++) {
2564+ if (!(hdev->clock_gating_mask &
2565+ (BIT_ULL(gaudi_dma_assignment[i]))))
2566+ continue;
2567+
25602568 qman_offset = gaudi_dma_assignment[i] * DMA_QMAN_OFFSET;
25612569 WREG32(mmDMA0_QM_CGM_CFG1 + qman_offset, QMAN_CGM1_PWR_GATE_EN);
25622570 WREG32(mmDMA0_QM_CGM_CFG + qman_offset,
25632571 QMAN_COMMON_CP_CGM_PWR_GATE_EN);
25642572 }
25652573
2566− WREG32(mmMME0_QM_CGM_CFG1, QMAN_CGM1_PWR_GATE_EN);
2567− WREG32(mmMME0_QM_CGM_CFG,
2568− QMAN_COMMON_CP_CGM_PWR_GATE_EN);
2569− WREG32(mmMME2_QM_CGM_CFG1, QMAN_CGM1_PWR_GATE_EN);
2570− WREG32(mmMME2_QM_CGM_CFG,
2571− QMAN_COMMON_CP_CGM_PWR_GATE_EN);
2574+ if (hdev->clock_gating_mask & (BIT_ULL(GAUDI_ENGINE_ID_MME_0))) {
2575+ WREG32(mmMME0_QM_CGM_CFG1, QMAN_CGM1_PWR_GATE_EN);
2576+ WREG32(mmMME0_QM_CGM_CFG, QMAN_COMMON_CP_CGM_PWR_GATE_EN);
2577+ }
2578+
2579+ if (hdev->clock_gating_mask & (BIT_ULL(GAUDI_ENGINE_ID_MME_2))) {
2580+ WREG32(mmMME2_QM_CGM_CFG1, QMAN_CGM1_PWR_GATE_EN);
2581+ WREG32(mmMME2_QM_CGM_CFG, QMAN_COMMON_CP_CGM_PWR_GATE_EN);
2582+ }
25722583
25732584 for (i = 0, qman_offset = 0 ; i < TPC_NUMBER_OF_ENGINES ; i++) {
2585+ if (!(hdev->clock_gating_mask &
2586+ (BIT_ULL(GAUDI_ENGINE_ID_TPC_0 + i))))
2587+ continue;
2588+
25742589 WREG32(mmTPC0_QM_CGM_CFG1 + qman_offset,
25752590 QMAN_CGM1_PWR_GATE_EN);
25762591 WREG32(mmTPC0_QM_CGM_CFG + qman_offset,
@@ -2663,7 +2678,7 @@ static void gaudi_halt_engines(struct hl_device *hdev, bool hard_reset) · 86 unmodified lines
26632678 gaudi_stop_hbm_dma_qmans(hdev);
26642679 gaudi_stop_pci_dma_qmans(hdev);
26652680
2666− gaudi_disable_clock_gating(hdev);
2681+ hdev->asic_funcs->disable_clock_gating(hdev);
26672682
26682683 msleep(wait_timeout_ms);
26692684
@@ -3003,7 +3018,7 @@ static int gaudi_hw_init(struct hl_device *hdev) · 333 unmodified lines
30033018
30043019 gaudi_init_tpc_qmans(hdev);
30053020
3006− gaudi_enable_clock_gating(hdev);
3021+ hdev->asic_funcs->set_clock_gating(hdev);
30073022
30083023 gaudi_enable_timestamp(hdev);
30093024
@@ -3112,7 +3127,9 @@ static void gaudi_hw_fini(struct hl_device *hdev, bool hard_reset) · 102 unmodified lines
31123127 HW_CAP_HBM_DMA | HW_CAP_PLL |
31133128 HW_CAP_MMU |
31143129 HW_CAP_SRAM_SCRAMBLER |
3115− HW_CAP_HBM_SCRAMBLER);
3130+ HW_CAP_HBM_SCRAMBLER |
3131+ HW_CAP_CLK_GATE);
3132+
31163133 memset(gaudi->events_stat, 0, sizeof(gaudi->events_stat));
31173134 }
31183135
@@ -3463,6 +3480,9 @@ static int gaudi_send_cpu_message(struct hl_device *hdev, u32 *msg, · 344 unmodified lines
34633480 return 0;
34643481 }
34653482
3483+ if (!timeout)
3484+ timeout = GAUDI_MSG_TO_CPU_TIMEOUT_USEC;
3485+
34663486 return hl_fw_send_cpu_message(hdev, GAUDI_QUEUE_ID_CPU_PQ, msg, len,
34673487 timeout, result);
34683488 }
@@ -3865,6 +3885,12 @@ static int gaudi_validate_cb(struct hl_device *hdev, · 396 unmodified lines
38653885 rc = -EPERM;
38663886 break;
38673887
3888+ case PACKET_WREG_BULK:
3889+ dev_err(hdev->dev,
3890+ "User not allowed to use WREG_BULK\n");
3891+ rc = -EPERM;
3892+ break;
3893+
38683894 case PACKET_LOAD_AND_EXE:
38693895 rc = gaudi_validate_load_and_exe_pkt(hdev, parser,
38703896 (struct packet_load_and_exe *) user_pkt);
@@ -3880,7 +3906,6 @@ static int gaudi_validate_cb(struct hl_device *hdev, · 9 unmodified lines
38803906 break;
38813907
38823908 case PACKET_WREG_32:
3883− case PACKET_WREG_BULK:
38843909 case PACKET_MSG_LONG:
38853910 case PACKET_MSG_SHORT:
38863911 case PACKET_REPEAT:
@@ -4521,13 +4546,18 @@ static int gaudi_debugfs_read32(struct hl_device *hdev, u64 addr, u32 *val) · 634 unmodified lines
45214546 int rc = 0;
45224547
45234548 if ((addr >= CFG_BASE) && (addr < CFG_BASE + CFG_SIZE)) {
4524− if (gaudi->hw_cap_initialized & HW_CAP_CLK_GATE) {
4549+
4550+ if ((gaudi->hw_cap_initialized & HW_CAP_CLK_GATE) &&
4551+ (hdev->clock_gating_mask &
4552+ GAUDI_CLK_GATE_DEBUGFS_MASK)) {
4553+
45254554 dev_err_ratelimited(hdev->dev,
45264555 "Can't read register - clock gating is enabled!\n");
45274556 rc = -EFAULT;
45284557 } else {
45294558 *val = RREG32(addr - CFG_BASE);
45304559 }
4560+
45314561 } else if ((addr >= SRAM_BASE_ADDR) &&
45324562 (addr < SRAM_BASE_ADDR + SRAM_BAR_SIZE)) {
45334563 *val = readl(hdev->pcie_bar[SRAM_BAR_ID] +
@@ -4563,13 +4593,18 @@ static int gaudi_debugfs_write32(struct hl_device *hdev, u64 addr, u32 val) · 29 unmodified lines
45634593 int rc = 0;
45644594
45654595 if ((addr >= CFG_BASE) && (addr < CFG_BASE + CFG_SIZE)) {
4566− if (gaudi->hw_cap_initialized & HW_CAP_CLK_GATE) {
4596+
4597+ if ((gaudi->hw_cap_initialized & HW_CAP_CLK_GATE) &&
4598+ (hdev->clock_gating_mask &
4599+ GAUDI_CLK_GATE_DEBUGFS_MASK)) {
4600+
45674601 dev_err_ratelimited(hdev->dev,
45684602 "Can't write register - clock gating is enabled!\n");
45694603 rc = -EFAULT;
45704604 } else {
45714605 WREG32(addr - CFG_BASE, val);
45724606 }
4607+
45734608 } else if ((addr >= SRAM_BASE_ADDR) &&
45744609 (addr < SRAM_BASE_ADDR + SRAM_BAR_SIZE)) {
45754610 writel(val, hdev->pcie_bar[SRAM_BAR_ID] +
@@ -4605,7 +4640,11 @@ static int gaudi_debugfs_read64(struct hl_device *hdev, u64 addr, u64 *val) · 29 unmodified lines
46054640 int rc = 0;
46064641
46074642 if ((addr >= CFG_BASE) && (addr <= CFG_BASE + CFG_SIZE - sizeof(u64))) {
4608− if (gaudi->hw_cap_initialized & HW_CAP_CLK_GATE) {
4643+
4644+ if ((gaudi->hw_cap_initialized & HW_CAP_CLK_GATE) &&
4645+ (hdev->clock_gating_mask &
4646+ GAUDI_CLK_GATE_DEBUGFS_MASK)) {
4647+
46094648 dev_err_ratelimited(hdev->dev,
46104649 "Can't read register - clock gating is enabled!\n");
46114650 rc = -EFAULT;
@@ -4615,6 +4654,7 @@ static int gaudi_debugfs_read64(struct hl_device *hdev, u64 addr, u64 *val) · 3 unmodified lines
46154654
46164655 *val = (((u64) val_h) << 32) | val_l;
46174656 }
4657+
46184658 } else if ((addr >= SRAM_BASE_ADDR) &&
46194659 (addr <= SRAM_BASE_ADDR + SRAM_BAR_SIZE - sizeof(u64))) {
46204660 *val = readq(hdev->pcie_bar[SRAM_BAR_ID] +
@@ -4651,7 +4691,11 @@ static int gaudi_debugfs_write64(struct hl_device *hdev, u64 addr, u64 val) · 30 unmodified lines
46514691 int rc = 0;
46524692
46534693 if ((addr >= CFG_BASE) && (addr <= CFG_BASE + CFG_SIZE - sizeof(u64))) {
4654− if (gaudi->hw_cap_initialized & HW_CAP_CLK_GATE) {
4694+
4695+ if ((gaudi->hw_cap_initialized & HW_CAP_CLK_GATE) &&
4696+ (hdev->clock_gating_mask &
4697+ GAUDI_CLK_GATE_DEBUGFS_MASK)) {
4698+
46554699 dev_err_ratelimited(hdev->dev,
46564700 "Can't write register - clock gating is enabled!\n");
46574701 rc = -EFAULT;
@@ -4660,6 +4704,7 @@ static int gaudi_debugfs_write64(struct hl_device *hdev, u64 addr, u64 val) · 2 unmodified lines
46604704 WREG32(addr + sizeof(u32) - CFG_BASE,
46614705 upper_32_bits(val));
46624706 }
4707+
46634708 } else if ((addr >= SRAM_BASE_ADDR) &&
46644709 (addr <= SRAM_BASE_ADDR + SRAM_BAR_SIZE - sizeof(u64))) {
46654710 writeq(val, hdev->pcie_bar[SRAM_BAR_ID] +
@@ -4881,7 +4926,7 @@ static void gaudi_mmu_prepare(struct hl_device *hdev, u32 asid) · 215 unmodified lines
48814926 gaudi_mmu_prepare_reg(hdev, mmPSOC_GLOBAL_CONF_TRACE_ARUSER, asid);
48824927 gaudi_mmu_prepare_reg(hdev, mmPSOC_GLOBAL_CONF_TRACE_AWUSER, asid);
48834928
4884− hdev->asic_funcs->enable_clock_gating(hdev);
4929+ hdev->asic_funcs->set_clock_gating(hdev);
48854930
48864931 mutex_unlock(&gaudi->clk_gate_mutex);
48874932 }
@@ -5262,7 +5307,7 @@ static void gaudi_print_ecc_info_generic(struct hl_device *hdev, · 374 unmodified lines
52625307 }
52635308
52645309 if (disable_clock_gating) {
5265− hdev->asic_funcs->enable_clock_gating(hdev);
5310+ hdev->asic_funcs->set_clock_gating(hdev);
52665311 mutex_unlock(&gaudi->clk_gate_mutex);
52675312 }
52685313 }
@@ -5749,7 +5794,7 @@ static bool gaudi_tpc_read_interrupts(struct hl_device *hdev, u8 tpc_id, · 480 unmodified lines
57495794 /* Clear interrupts */
57505795 WREG32(mmTPC0_CFG_TPC_INTR_CAUSE + tpc_offset, 0);
57515796
5752− hdev->asic_funcs->enable_clock_gating(hdev);
5797+ hdev->asic_funcs->set_clock_gating(hdev);
57535798
57545799 mutex_unlock(&gaudi->clk_gate_mutex);
57555800
@@ -6265,7 +6310,7 @@ static bool gaudi_is_device_idle(struct hl_device *hdev, u32 *mask, · 509 unmodified lines
62656310 if (s)
62666311 seq_puts(s, "\n");
62676312
6268− hdev->asic_funcs->enable_clock_gating(hdev);
6313+ hdev->asic_funcs->set_clock_gating(hdev);
62696314
62706315 mutex_unlock(&gaudi->clk_gate_mutex);
62716316
@@ -6366,7 +6411,7 @@ static int gaudi_run_tpc_kernel(struct hl_device *hdev, u64 tpc_kernel, · 94 unmodified lines
63666411 dev_err(hdev->dev,
63676412 "Timeout while waiting for TPC%d icache prefetch\n",
63686413 tpc_id);
6369− hdev->asic_funcs->enable_clock_gating(hdev);
6414+ hdev->asic_funcs->set_clock_gating(hdev);
63706415 mutex_unlock(&gaudi->clk_gate_mutex);
63716416 return -EIO;
63726417 }
@@ -6395,7 +6440,7 @@ static int gaudi_run_tpc_kernel(struct hl_device *hdev, u64 tpc_kernel, · 22 unmodified lines
63956440 1000,
63966441 kernel_timeout);
63976442
6398− hdev->asic_funcs->enable_clock_gating(hdev);
6443+ hdev->asic_funcs->set_clock_gating(hdev);
63996444 mutex_unlock(&gaudi->clk_gate_mutex);
64006445
64016446 if (rc) {
@@ -6736,7 +6781,7 @@ static const struct hl_asic_funcs gaudi_funcs = { · 334 unmodified lines
67366781 .mmu_invalidate_cache = gaudi_mmu_invalidate_cache,
67376782 .mmu_invalidate_cache_range = gaudi_mmu_invalidate_cache_range,
67386783 .send_heartbeat = gaudi_send_heartbeat,
6739− .enable_clock_gating = gaudi_enable_clock_gating,
6784+ .set_clock_gating = gaudi_set_clock_gating,
67406785 .disable_clock_gating = gaudi_disable_clock_gating,
67416786 .debug_coresight = gaudi_debug_coresight,
67426787 .is_device_idle = gaudi_is_device_idle,
drivers/misc/habanalabs/goya/goya.c+12−8
@@ -88,6 +88,7 @@ · 87 unmodified lines
8888 #define GOYA_PLDM_MMU_TIMEOUT_USEC (MMU_CONFIG_TIMEOUT_USEC * 100)
8989 #define GOYA_PLDM_QMAN0_TIMEOUT_USEC (HL_DEVICE_TIMEOUT_USEC * 30)
9090 #define GOYA_BOOT_FIT_REQ_TIMEOUT_USEC 1000000 /* 1s */
91+#define GOYA_MSG_TO_CPU_TIMEOUT_USEC 4000000 /* 4s */
9192
9293 #define GOYA_QMAN0_FENCE_VAL 0xD169B243
9394
@@ -2830,6 +2831,9 @@ int goya_send_cpu_message(struct hl_device *hdev, u32 *msg, u16 len, · 2736 unmodified lines
28302831 return 0;
28312832 }
28322833
2834+ if (!timeout)
2835+ timeout = GOYA_MSG_TO_CPU_TIMEOUT_USEC;
2836+
28332837 return hl_fw_send_cpu_message(hdev, GOYA_QUEUE_ID_CPU_PQ, msg, len,
28342838 timeout, result);
28352839 }
@@ -4431,8 +4435,8 @@ static int goya_unmask_irq_arr(struct hl_device *hdev, u32 *irq_arr, · 1595 unmodified lines
44314435 pkt->armcp_pkt.ctl = cpu_to_le32(ARMCP_PACKET_UNMASK_RAZWI_IRQ_ARRAY <<
44324436 ARMCP_PKT_CTL_OPCODE_SHIFT);
44334437
4434− rc = goya_send_cpu_message(hdev, (u32 *) pkt, total_pkt_size,
4435− HL_DEVICE_TIMEOUT_USEC, &result);
4438+ rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) pkt,
4439+ total_pkt_size, 0, &result);
44364440
44374441 if (rc)
44384442 dev_err(hdev->dev, "failed to unmask IRQ array\n");
@@ -4464,8 +4468,8 @@ static int goya_unmask_irq(struct hl_device *hdev, u16 event_type) · 25 unmodified lines
44644468 ARMCP_PKT_CTL_OPCODE_SHIFT);
44654469 pkt.value = cpu_to_le64(event_type);
44664470
4467− rc = goya_send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
4468− HL_DEVICE_TIMEOUT_USEC, &result);
4471+ rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
4472+ 0, &result);
44694473
44704474 if (rc)
44714475 dev_err(hdev->dev, "failed to unmask RAZWI IRQ %d", event_type);
@@ -5028,14 +5032,14 @@ int goya_armcp_info_get(struct hl_device *hdev) · 556 unmodified lines
50285032 return 0;
50295033 }
50305034
5031−static void goya_enable_clock_gating(struct hl_device *hdev)
5035+static void goya_set_clock_gating(struct hl_device *hdev)
50325036 {
5033−
5037+ /* clock gating not supported in Goya */
50345038 }
50355039
50365040 static void goya_disable_clock_gating(struct hl_device *hdev)
50375041 {
5038−
5042+ /* clock gating not supported in Goya */
50395043 }
50405044
50415045 static bool goya_is_device_idle(struct hl_device *hdev, u32 *mask,
@@ -5259,7 +5263,7 @@ static const struct hl_asic_funcs goya_funcs = { · 217 unmodified lines
52595263 .mmu_invalidate_cache = goya_mmu_invalidate_cache,
52605264 .mmu_invalidate_cache_range = goya_mmu_invalidate_cache_range,
52615265 .send_heartbeat = goya_send_heartbeat,
5262− .enable_clock_gating = goya_enable_clock_gating,
5266+ .set_clock_gating = goya_set_clock_gating,
52635267 .disable_clock_gating = goya_disable_clock_gating,
52645268 .debug_coresight = goya_debug_coresight,
52655269 .is_device_idle = goya_is_device_idle,
drivers/misc/habanalabs/habanalabs.h+13−6
@@ -578,8 +578,9 @@ enum hl_pll_frequency { · 577 unmodified lines
578578 * @mmu_invalidate_cache_range: flush specific MMU STLB cache lines with
579579 * ASID-VA-size mask.
580580 * @send_heartbeat: send is-alive packet to ArmCP and verify response.
581− * @enable_clock_gating: enable clock gating for reducing power consumption.
582− * @disable_clock_gating: disable clock for accessing registers on HBW.
581+ * @set_clock_gating: enable/disable clock gating per engine according to
582+ * clock gating mask in hdev
583+ * @disable_clock_gating: disable clock gating completely
583584 * @debug_coresight: perform certain actions on Coresight for debugging.
584585 * @is_device_idle: return true if device is idle, false otherwise.
585586 * @soft_reset_late_init: perform certain actions needed after soft reset.
@@ -587,7 +588,11 @@ enum hl_pll_frequency { · 1 unmodified line
587588 * @hw_queues_unlock: release H/W queues lock.
588589 * @get_pci_id: retrieve PCI ID.
589590 * @get_eeprom_data: retrieve EEPROM data from F/W.
590− * @send_cpu_message: send buffer to ArmCP.
591+ * @send_cpu_message: send message to F/W. If the message is timedout, the
592+ * driver will eventually reset the device. The timeout can
593+ * be determined by the calling function or it can be 0 and
594+ * then the timeout is the default timeout for the specific
595+ * ASIC
591596 * @get_hw_state: retrieve the H/W state
592597 * @pci_bars_map: Map PCI BARs.
593598 * @set_dram_bar_base: Set DRAM BAR to map specific device address. Returns
@@ -680,7 +685,7 @@ struct hl_asic_funcs { · 86 unmodified lines
680685 int (*mmu_invalidate_cache_range)(struct hl_device *hdev, bool is_hard,
681686 u32 asid, u64 va, u64 size);
682687 int (*send_heartbeat)(struct hl_device *hdev);
683− void (*enable_clock_gating)(struct hl_device *hdev);
688+ void (*set_clock_gating)(struct hl_device *hdev);
684689 void (*disable_clock_gating)(struct hl_device *hdev);
685690 int (*debug_coresight)(struct hl_device *hdev, void *data);
686691 bool (*is_device_idle)(struct hl_device *hdev, u32 *mask,
@@ -1398,6 +1403,9 @@ struct hl_device_idle_busy_ts { · 711 unmodified lines
13981403 * @max_power: the max power of the device, as configured by the sysadmin. This
13991404 * value is saved so in case of hard-reset, the driver will restore
14001405 * this value and update the F/W after the re-initialization
1406+ * @clock_gating_mask: is clock gating enabled. bitmask that represents the
1407+ * different engines. See debugfs-driver-habanalabs for
1408+ * details.
14011409 * @in_reset: is device in reset flow.
14021410 * @curr_pll_profile: current PLL profile.
14031411 * @cs_active_cnt: number of active command submissions on this device (active
@@ -1425,7 +1433,6 @@ struct hl_device_idle_busy_ts { · 21 unmodified lines
14251433 * @init_done: is the initialization of the device done.
14261434 * @mmu_enable: is MMU enabled.
14271435 * @mmu_huge_page_opt: is MMU huge pages optimization enabled.
1428− * @clock_gating: is clock gating enabled.
14291436 * @device_cpu_disabled: is the device CPU disabled (due to timeouts)
14301437 * @dma_mask: the dma mask that was set for this device
14311438 * @in_debug: is device under debug. This, together with fpriv_list, enforces
@@ -1493,6 +1500,7 @@ struct hl_device { · 61 unmodified lines
14931500 atomic64_t dram_used_mem;
14941501 u64 timeout_jiffies;
14951502 u64 max_power;
1503+ u64 clock_gating_mask;
14961504 atomic_t in_reset;
14971505 enum hl_pll_frequency curr_pll_profile;
14981506 int cs_active_cnt;
@@ -1514,7 +1522,6 @@ struct hl_device { · 15 unmodified lines
15141522 u8 dram_default_page_mapping;
15151523 u8 pmmu_huge_range;
15161524 u8 init_done;
1517− u8 clock_gating;
15181525 u8 device_cpu_disabled;
15191526 u8 dma_mask;
15201527 u8 in_debug;
drivers/misc/habanalabs/habanalabs_drv.c+1−1
@@ -232,7 +232,7 @@ static void set_driver_behavior_per_device(struct hl_device *hdev) · 231 unmodified lines
232232 hdev->fw_loading = 1;
233233 hdev->cpu_queues_enable = 1;
234234 hdev->heartbeat = 1;
235− hdev->clock_gating = 1;
235+ hdev->clock_gating_mask = ULONG_MAX;
236236
237237 hdev->reset_pcilink = 0;
238238 hdev->axi_drain = 0;
drivers/misc/habanalabs/hwmon.c+9−10
@@ -10,7 +10,6 @@ · 9 unmodified lines
1010 #include <linux/pci.h>
1111 #include <linux/hwmon.h>
1212
13−#define SENSORS_PKT_TIMEOUT 1000000 /* 1s */
1413 #define HWMON_NR_SENSOR_TYPES (hwmon_pwm + 1)
1514
1615 int hl_build_hwmon_channel_info(struct hl_device *hdev,
@@ -323,7 +322,7 @@ int hl_get_temperature(struct hl_device *hdev, · 306 unmodified lines
323322 pkt.type = __cpu_to_le16(attr);
324323
325324 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
326− SENSORS_PKT_TIMEOUT, value);
325+ 0, value);
327326
328327 if (rc) {
329328 dev_err(hdev->dev,
@@ -350,7 +349,7 @@ int hl_set_temperature(struct hl_device *hdev, · 20 unmodified lines
350349 pkt.value = __cpu_to_le64(value);
351350
352351 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
353− SENSORS_PKT_TIMEOUT, NULL);
352+ 0, NULL);
354353
355354 if (rc)
356355 dev_err(hdev->dev,
@@ -374,7 +373,7 @@ int hl_get_voltage(struct hl_device *hdev, · 17 unmodified lines
374373 pkt.type = __cpu_to_le16(attr);
375374
376375 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
377− SENSORS_PKT_TIMEOUT, value);
376+ 0, value);
378377
379378 if (rc) {
380379 dev_err(hdev->dev,
@@ -400,7 +399,7 @@ int hl_get_current(struct hl_device *hdev, · 19 unmodified lines
400399 pkt.type = __cpu_to_le16(attr);
401400
402401 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
403− SENSORS_PKT_TIMEOUT, value);
402+ 0, value);
404403
405404 if (rc) {
406405 dev_err(hdev->dev,
@@ -426,7 +425,7 @@ int hl_get_fan_speed(struct hl_device *hdev, · 19 unmodified lines
426425 pkt.type = __cpu_to_le16(attr);
427426
428427 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
429− SENSORS_PKT_TIMEOUT, value);
428+ 0, value);
430429
431430 if (rc) {
432431 dev_err(hdev->dev,
@@ -452,7 +451,7 @@ int hl_get_pwm_info(struct hl_device *hdev, · 19 unmodified lines
452451 pkt.type = __cpu_to_le16(attr);
453452
454453 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
455− SENSORS_PKT_TIMEOUT, value);
454+ 0, value);
456455
457456 if (rc) {
458457 dev_err(hdev->dev,
@@ -479,7 +478,7 @@ void hl_set_pwm_info(struct hl_device *hdev, int sensor_index, u32 attr, · 20 unmodified lines
479478 pkt.value = cpu_to_le64(value);
480479
481480 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
482− SENSORS_PKT_TIMEOUT, NULL);
481+ 0, NULL);
483482
484483 if (rc)
485484 dev_err(hdev->dev,
@@ -502,7 +501,7 @@ int hl_set_voltage(struct hl_device *hdev, · 16 unmodified lines
502501 pkt.value = __cpu_to_le64(value);
503502
504503 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
505− SENSORS_PKT_TIMEOUT, NULL);
504+ 0, NULL);
506505
507506 if (rc)
508507 dev_err(hdev->dev,
@@ -527,7 +526,7 @@ int hl_set_current(struct hl_device *hdev, · 18 unmodified lines
527526 pkt.value = __cpu_to_le64(value);
528527
529528 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
530− SENSORS_PKT_TIMEOUT, NULL);
529+ 0, NULL);
531530
532531 if (rc)
533532 dev_err(hdev->dev,
drivers/misc/habanalabs/sysfs.c+4−7
@@ -9,9 +9,6 @@ · 8 unmodified lines
99
1010 #include <linux/pci.h>
1111
12−#define SET_CLK_PKT_TIMEOUT 1000000 /* 1s */
13−#define SET_PWR_PKT_TIMEOUT 1000000 /* 1s */
14−
1512 long hl_get_frequency(struct hl_device *hdev, u32 pll_index, bool curr)
1613 {
1714 struct armcp_packet pkt;
@@ -29,7 +26,7 @@ long hl_get_frequency(struct hl_device *hdev, u32 pll_index, bool curr) · 11 unmodified lines
2926 pkt.pll_index = cpu_to_le32(pll_index);
3027
3128 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
32− SET_CLK_PKT_TIMEOUT, &result);
29+ 0, &result);
3330
3431 if (rc) {
3532 dev_err(hdev->dev,
@@ -54,7 +51,7 @@ void hl_set_frequency(struct hl_device *hdev, u32 pll_index, u64 freq) · 18 unmodified lines
5451 pkt.value = cpu_to_le64(freq);
5552
5653 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
57− SET_CLK_PKT_TIMEOUT, NULL);
54+ 0, NULL);
5855
5956 if (rc)
6057 dev_err(hdev->dev,
@@ -74,7 +71,7 @@ u64 hl_get_max_power(struct hl_device *hdev) · 13 unmodified lines
7471 ARMCP_PKT_CTL_OPCODE_SHIFT);
7572
7673 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
77− SET_PWR_PKT_TIMEOUT, &result);
74+ 0, &result);
7875
7976 if (rc) {
8077 dev_err(hdev->dev, "Failed to get max power, error %d\n", rc);
@@ -96,7 +93,7 @@ void hl_set_max_power(struct hl_device *hdev, u64 value) · 15 unmodified lines
9693 pkt.value = cpu_to_le64(value);
9794
9895 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt),
99− SET_PWR_PKT_TIMEOUT, NULL);
96+ 0, NULL);
10097
10198 if (rc)
10299 dev_err(hdev->dev, "Failed to set max power, error %d\n", rc);
drivers/misc/mei/bus.c+1−2
@@ -745,9 +745,8 @@ static int mei_cl_device_remove(struct device *dev) · 744 unmodified lines
745745
746746 mei_cl_bus_module_put(cldev);
747747 module_put(THIS_MODULE);
748− dev->driver = NULL;
749− return ret;
750748
749+ return ret;
751750 }
752751
753752 static ssize_t name_show(struct device *dev, struct device_attribute *a,
drivers/mmc/host/meson-gx-mmc.c+4−2
@@ -1146,9 +1146,11 @@ static int meson_mmc_probe(struct platform_device *pdev) · 1145 unmodified lines
11461146
11471147 mmc->caps |= MMC_CAP_CMD23;
11481148 if (host->dram_access_quirk) {
1149+ /* Limit segments to 1 due to low available sram memory */
1150+ mmc->max_segs = 1;
11491151 /* Limit to the available sram memory */
1150− mmc->max_segs = SD_EMMC_SRAM_DATA_BUF_LEN / mmc->max_blk_size;
1151− mmc->max_blk_count = mmc->max_segs;
1152+ mmc->max_blk_count = SD_EMMC_SRAM_DATA_BUF_LEN /
1153+ mmc->max_blk_size;
11521154 } else {
11531155 mmc->max_blk_count = CMD_CFG_LENGTH_MASK;
11541156 mmc->max_segs = SD_EMMC_DESC_BUF_LEN /
drivers/mmc/host/owl-mmc.c+1−1
@@ -689,7 +689,7 @@ MODULE_DEVICE_TABLE(of, owl_mmc_of_match); · 688 unmodified lines
689689 static struct platform_driver owl_mmc_driver = {
690690 .driver = {
691691 .name = "owl_mmc",
692− .of_match_table = of_match_ptr(owl_mmc_of_match),
692+ .of_match_table = owl_mmc_of_match,
693693 },
694694 .probe = owl_mmc_probe,
695695 .remove = owl_mmc_remove,
drivers/mmc/host/sdhci-msm.c+3−2
@@ -618,8 +618,9 @@ static int msm_init_cm_dll(struct sdhci_host *host) · 617 unmodified lines
618618 config &= ~CORE_CLK_PWRSAVE;
619619 writel_relaxed(config, host->ioaddr + msm_offset->core_vendor_spec);
620620
621− config = msm_host->dll_config;
622− writel_relaxed(config, host->ioaddr + msm_offset->core_dll_config);
621+ if (msm_host->dll_config)
622+ writel_relaxed(msm_host->dll_config,
623+ host->ioaddr + msm_offset->core_dll_config);
623624
624625 if (msm_host->use_14lpp_dll_reset) {
625626 config = readl_relaxed(host->ioaddr +
drivers/mmc/host/sdhci-of-aspeed.c+1−1
@@ -68,7 +68,7 @@ static void aspeed_sdhci_set_clock(struct sdhci_host *host, unsigned int clock) · 67 unmodified lines
6868 if (WARN_ON(clock > host->max_clk))
6969 clock = host->max_clk;
7070
71− for (div = 1; div < 256; div *= 2) {
71+ for (div = 2; div < 256; div *= 2) {
7272 if ((parent / div) <= clock)
7373 break;
7474 }
drivers/net/bareudp.c+22−7
@@ -407,19 +407,34 @@ free_dst: · 406 unmodified lines
407407 return err;
408408 }
409409
410+static bool bareudp_proto_valid(struct bareudp_dev *bareudp, __be16 proto)
411+{
412+ if (bareudp->ethertype == proto)
413+ return true;
414+
415+ if (!bareudp->multi_proto_mode)
416+ return false;
417+
418+ if (bareudp->ethertype == htons(ETH_P_MPLS_UC) &&
419+ proto == htons(ETH_P_MPLS_MC))
420+ return true;
421+
422+ if (bareudp->ethertype == htons(ETH_P_IP) &&
423+ proto == htons(ETH_P_IPV6))
424+ return true;
425+
426+ return false;
427+}
428+
410429 static netdev_tx_t bareudp_xmit(struct sk_buff *skb, struct net_device *dev)
411430 {
412431 struct bareudp_dev *bareudp = netdev_priv(dev);
413432 struct ip_tunnel_info *info = NULL;
414433 int err;
415434
416− if (skb->protocol != bareudp->ethertype) {
417− if (!bareudp->multi_proto_mode ||
418− (skb->protocol != htons(ETH_P_MPLS_MC) &&
419− skb->protocol != htons(ETH_P_IPV6))) {
420− err = -EINVAL;
421− goto tx_error;
422− }
435+ if (!bareudp_proto_valid(bareudp, skb->protocol)) {
436+ err = -EINVAL;
437+ goto tx_error;
423438 }
424439
425440 info = skb_tunnel_info(skb);
drivers/net/bonding/bond_main.c+7−3
@@ -5053,15 +5053,19 @@ int bond_create(struct net *net, const char *name) · 5052 unmodified lines
50535053 bond_dev->rtnl_link_ops = &bond_link_ops;
50545054
50555055 res = register_netdevice(bond_dev);
5056+ if (res < 0) {
5057+ free_netdev(bond_dev);
5058+ rtnl_unlock();
5059+
5060+ return res;
5061+ }
50565062
50575063 netif_carrier_off(bond_dev);
50585064
50595065 bond_work_init_all(bond);
50605066
50615067 rtnl_unlock();
5062− if (res < 0)
5063− free_netdev(bond_dev);
5064− return res;
5068+ return 0;
50655069 }
50665070
50675071 static int __net_init bond_net_init(struct net *net)
drivers/net/bonding/bond_netlink.c+1−2
@@ -456,11 +456,10 @@ static int bond_newlink(struct net *src_net, struct net_device *bond_dev, · 455 unmodified lines
456456 return err;
457457
458458 err = register_netdevice(bond_dev);
459−
460− netif_carrier_off(bond_dev);
461459 if (!err) {
462460 struct bonding *bond = netdev_priv(bond_dev);
463461
462+ netif_carrier_off(bond_dev);
464463 bond_work_init_all(bond);
465464 }
466465
drivers/net/dsa/microchip/ksz8795.c+3−0
@@ -1268,6 +1268,9 @@ static int ksz8795_switch_init(struct ksz_device *dev) · 1267 unmodified lines
12681268 return -ENOMEM;
12691269 }
12701270
1271+ /* set the real number of ports */
1272+ dev->ds->num_ports = dev->port_cnt;
1273+
12711274 return 0;
12721275 }
12731276
drivers/net/dsa/microchip/ksz9477.c+26−19
@@ -974,23 +974,6 @@ static void ksz9477_port_mirror_del(struct dsa_switch *ds, int port, · 973 unmodified lines
974974 PORT_MIRROR_SNIFFER, false);
975975 }
976976
977−static void ksz9477_phy_setup(struct ksz_device *dev, int port,
978− struct phy_device *phy)
979−{
980− /* Only apply to port with PHY. */
981− if (port >= dev->phy_port_cnt)
982− return;
983−
984− /* The MAC actually cannot run in 1000 half-duplex mode. */
985− phy_remove_link_mode(phy,
986− ETHTOOL_LINK_MODE_1000baseT_Half_BIT);
987−
988− /* PHY does not support gigabit. */
989− if (!(dev->features & GBIT_SUPPORT))
990− phy_remove_link_mode(phy,
991− ETHTOOL_LINK_MODE_1000baseT_Full_BIT);
992−}
993−
994977 static bool ksz9477_get_gbit(struct ksz_device *dev, u8 data)
995978 {
996979 bool gbit;
@@ -1588,6 +1571,9 @@ static int ksz9477_switch_init(struct ksz_device *dev) · 591 unmodified lines
15881571 return -ENOMEM;
15891572 }
15901573
1574+ /* set the real number of ports */
1575+ dev->ds->num_ports = dev->port_cnt;
1576+
15911577 return 0;
15921578 }
15931579
@@ -1600,7 +1586,6 @@ static const struct ksz_dev_ops ksz9477_dev_ops = { · 6 unmodified lines
16001586 .get_port_addr = ksz9477_get_port_addr,
16011587 .cfg_port_member = ksz9477_cfg_port_member,
16021588 .flush_dyn_mac_table = ksz9477_flush_dyn_mac_table,
1603− .phy_setup = ksz9477_phy_setup,
16041589 .port_setup = ksz9477_port_setup,
16051590 .r_mib_cnt = ksz9477_r_mib_cnt,
16061591 .r_mib_pkt = ksz9477_r_mib_pkt,
@@ -1614,7 +1599,29 @@ static const struct ksz_dev_ops ksz9477_dev_ops = { · 7 unmodified lines
16141599
16151600 int ksz9477_switch_register(struct ksz_device *dev)
16161601 {
1617− return ksz_switch_register(dev, &ksz9477_dev_ops);
1602+ int ret, i;
1603+ struct phy_device *phydev;
1604+
1605+ ret = ksz_switch_register(dev, &ksz9477_dev_ops);
1606+ if (ret)
1607+ return ret;
1608+
1609+ for (i = 0; i < dev->phy_port_cnt; ++i) {
1610+ if (!dsa_is_user_port(dev->ds, i))
1611+ continue;
1612+
1613+ phydev = dsa_to_port(dev->ds, i)->slave->phydev;
1614+
1615+ /* The MAC actually cannot run in 1000 half-duplex mode. */
1616+ phy_remove_link_mode(phydev,
1617+ ETHTOOL_LINK_MODE_1000baseT_Half_BIT);
1618+
1619+ /* PHY does not support gigabit. */
1620+ if (!(dev->features & GBIT_SUPPORT))
1621+ phy_remove_link_mode(phydev,
1622+ ETHTOOL_LINK_MODE_1000baseT_Full_BIT);
1623+ }
1624+ return ret;
16181625 }
16191626 EXPORT_SYMBOL(ksz9477_switch_register);
16201627
drivers/net/dsa/microchip/ksz9477_i2c.c+1−0
@@ -79,6 +79,7 @@ MODULE_DEVICE_TABLE(i2c, ksz9477_i2c_id); · 78 unmodified lines
7979 static const struct of_device_id ksz9477_dt_ids[] = {
8080 { .compatible = "microchip,ksz9477" },
8181 { .compatible = "microchip,ksz9897" },
82+ { .compatible = "microchip,ksz9893" },
8283 { .compatible = "microchip,ksz9567" },
8384 {},
8485 };
drivers/net/dsa/microchip/ksz_common.c+0−2
@@ -358,8 +358,6 @@ int ksz_enable_port(struct dsa_switch *ds, int port, struct phy_device *phy) · 357 unmodified lines
358358
359359 /* setup slave port */
360360 dev->dev_ops->port_setup(dev, port, false);
361− if (dev->dev_ops->phy_setup)
362− dev->dev_ops->phy_setup(dev, port, phy);
363361
364362 /* port_stp_state_set() will be called after to enable the port so
365363 * there is no need to do anything.
drivers/net/dsa/microchip/ksz_common.h+0−2
@@ -119,8 +119,6 @@ struct ksz_dev_ops { · 118 unmodified lines
119119 u32 (*get_port_addr)(int port, int offset);
120120 void (*cfg_port_member)(struct ksz_device *dev, int port, u8 member);
121121 void (*flush_dyn_mac_table)(struct ksz_device *dev, int port);
122− void (*phy_setup)(struct ksz_device *dev, int port,
123− struct phy_device *phy);
124122 void (*port_cleanup)(struct ksz_device *dev, int port);
125123 void (*port_setup)(struct ksz_device *dev, int port, bool cpu_port);
126124 void (*r_phy)(struct ksz_device *dev, u16 phy, u16 reg, u16 *val);
drivers/net/dsa/mv88e6xxx/chip.c+19−3
@@ -664,8 +664,11 @@ static void mv88e6xxx_mac_config(struct dsa_switch *ds, int port, · 663 unmodified lines
664664 const struct phylink_link_state *state)
665665 {
666666 struct mv88e6xxx_chip *chip = ds->priv;
667+ struct mv88e6xxx_port *p;
667668 int err;
668669
670+ p = &chip->ports[port];
671+
669672 /* FIXME: is this the correct test? If we're in fixed mode on an
670673 * internal port, why should we process this any different from
671674 * PHY mode? On the other hand, the port may be automedia between
@@ -675,10 +678,14 @@ static void mv88e6xxx_mac_config(struct dsa_switch *ds, int port, · 3 unmodified lines
675678 return;
676679
677680 mv88e6xxx_reg_lock(chip);
678− /* FIXME: should we force the link down here - but if we do, how
679− * do we restore the link force/unforce state? The driver layering
680− * gets in the way.
681+ /* In inband mode, the link may come up at any time while the link
682+ * is not forced down. Force the link down while we reconfigure the
683+ * interface mode.
681684 */
685+ if (mode == MLO_AN_INBAND && p->interface != state->interface &&
686+ chip->info->ops->port_set_link)
687+ chip->info->ops->port_set_link(chip, port, LINK_FORCED_DOWN);
688+
682689 err = mv88e6xxx_port_config_interface(chip, port, state->interface);
683690 if (err && err != -EOPNOTSUPP)
684691 goto err_unlock;
@@ -691,6 +698,15 @@ static void mv88e6xxx_mac_config(struct dsa_switch *ds, int port, · 6 unmodified lines
691698 if (err > 0)
692699 err = 0;
693700
701+ /* Undo the forced down state above after completing configuration
702+ * irrespective of its state on entry, which allows the link to come up.
703+ */
704+ if (mode == MLO_AN_INBAND && p->interface != state->interface &&
705+ chip->info->ops->port_set_link)
706+ chip->info->ops->port_set_link(chip, port, LINK_UNFORCED);
707+
708+ p->interface = state->interface;
709+
694710 err_unlock:
695711 mv88e6xxx_reg_unlock(chip);
696712
drivers/net/dsa/mv88e6xxx/chip.h+1−0
@@ -232,6 +232,7 @@ struct mv88e6xxx_port { · 231 unmodified lines
232232 u64 atu_full_violation;
233233 u64 vtu_member_violation;
234234 u64 vtu_miss_violation;
235+ phy_interface_t interface;
235236 u8 cmode;
236237 bool mirror_ingress;
237238 bool mirror_egress;
drivers/net/ethernet/aquantia/atlantic/aq_hw.h+1−0
@@ -64,6 +64,7 @@ struct aq_hw_caps_s { · 63 unmodified lines
6464 u8 rx_rings;
6565 bool flow_control;
6666 bool is_64_dma;
67+ u32 quirks;
6768 u32 priv_data_len;
6869 };
6970
drivers/net/ethernet/aquantia/atlantic/aq_nic.c+9−0
@@ -415,6 +415,15 @@ int aq_nic_init(struct aq_nic_s *self) · 414 unmodified lines
415415 self->aq_nic_cfg.aq_hw_caps->media_type == AQ_HW_MEDIA_TYPE_TP) {
416416 self->aq_hw->phy_id = HW_ATL_PHY_ID_MAX;
417417 err = aq_phy_init(self->aq_hw);
418+
419+ /* Disable the PTP on NICs where it's known to cause datapath
420+ * problems.
421+ * Ideally this should have been done by PHY provisioning, but
422+ * many units have been shipped with enabled PTP block already.
423+ */
424+ if (self->aq_nic_cfg.aq_hw_caps->quirks & AQ_NIC_QUIRK_BAD_PTP)
425+ if (self->aq_hw->phy_id != HW_ATL_PHY_ID_MAX)
426+ aq_phy_disable_ptp(self->aq_hw);
418427 }
419428
420429 for (i = 0U; i < self->aq_vecs; i++) {
drivers/net/ethernet/aquantia/atlantic/aq_nic.h+2−0
@@ -81,6 +81,8 @@ struct aq_nic_cfg_s { · 80 unmodified lines
8181 #define AQ_NIC_FLAG_ERR_UNPLUG 0x40000000U
8282 #define AQ_NIC_FLAG_ERR_HW 0x80000000U
8383
84+#define AQ_NIC_QUIRK_BAD_PTP BIT(0)
85+
8486 #define AQ_NIC_WOL_MODES (WAKE_MAGIC |\
8587 WAKE_PHY)
8688
drivers/net/ethernet/aquantia/atlantic/aq_phy.c+27−2
@@ -1,10 +1,14 @@
11 // SPDX-License-Identifier: GPL-2.0-only
2−/* aQuantia Corporation Network Driver
3− * Copyright (C) 2018-2019 aQuantia Corporation. All rights reserved
2+/* Atlantic Network Driver
3+ *
4+ * Copyright (C) 2018-2019 aQuantia Corporation
5+ * Copyright (C) 2019-2020 Marvell International Ltd.
46 */
57
68 #include "aq_phy.h"
79
10+#define HW_ATL_PTP_DISABLE_MSK BIT(10)
11+
812 bool aq_mdio_busy_wait(struct aq_hw_s *aq_hw)
913 {
1014 int err = 0;
@@ -145,3 +149,24 @@ bool aq_phy_init(struct aq_hw_s *aq_hw) · 134 unmodified lines
145149
146150 return true;
147151 }
152+
153+void aq_phy_disable_ptp(struct aq_hw_s *aq_hw)
154+{
155+ static const u16 ptp_registers[] = {
156+ 0x031e,
157+ 0x031d,
158+ 0x031c,
159+ 0x031b,
160+ };
161+ u16 val;
162+ int i;
163+
164+ for (i = 0; i < ARRAY_SIZE(ptp_registers); i++) {
165+ val = aq_phy_read_reg(aq_hw, MDIO_MMD_VEND1,
166+ ptp_registers[i]);
167+
168+ aq_phy_write_reg(aq_hw, MDIO_MMD_VEND1,
169+ ptp_registers[i],
170+ val & ~HW_ATL_PTP_DISABLE_MSK);
171+ }
172+}
drivers/net/ethernet/aquantia/atlantic/aq_phy.h+6−2
@@ -1,6 +1,8 @@
11 /* SPDX-License-Identifier: GPL-2.0-only */
2−/* aQuantia Corporation Network Driver
3− * Copyright (C) 2018-2019 aQuantia Corporation. All rights reserved
2+/* Atlantic Network Driver
3+ *
4+ * Copyright (C) 2018-2019 aQuantia Corporation
5+ * Copyright (C) 2019-2020 Marvell International Ltd.
46 */
57
68 #ifndef AQ_PHY_H
@@ -29,4 +31,6 @@ bool aq_phy_init_phy_id(struct aq_hw_s *aq_hw); · 22 unmodified lines
2931
3032 bool aq_phy_init(struct aq_hw_s *aq_hw);
3133
34+void aq_phy_disable_ptp(struct aq_hw_s *aq_hw);
35+
3236 #endif /* AQ_PHY_H */
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c+25−1
@@ -93,6 +93,25 @@ const struct aq_hw_caps_s hw_atl_b0_caps_aqc109 = { · 92 unmodified lines
9393 AQ_NIC_RATE_100M,
9494 };
9595
96+const struct aq_hw_caps_s hw_atl_b0_caps_aqc111 = {
97+ DEFAULT_B0_BOARD_BASIC_CAPABILITIES,
98+ .media_type = AQ_HW_MEDIA_TYPE_TP,
99+ .link_speed_msk = AQ_NIC_RATE_5G |
100+ AQ_NIC_RATE_2G5 |
101+ AQ_NIC_RATE_1G |
102+ AQ_NIC_RATE_100M,
103+ .quirks = AQ_NIC_QUIRK_BAD_PTP,
104+};
105+
106+const struct aq_hw_caps_s hw_atl_b0_caps_aqc112 = {
107+ DEFAULT_B0_BOARD_BASIC_CAPABILITIES,
108+ .media_type = AQ_HW_MEDIA_TYPE_TP,
109+ .link_speed_msk = AQ_NIC_RATE_2G5 |
110+ AQ_NIC_RATE_1G |
111+ AQ_NIC_RATE_100M,
112+ .quirks = AQ_NIC_QUIRK_BAD_PTP,
113+};
114+
96115 static int hw_atl_b0_hw_reset(struct aq_hw_s *self)
97116 {
98117 int err = 0;
@@ -354,8 +373,13 @@ static int hw_atl_b0_hw_init_tx_tc_rate_limit(struct aq_hw_s *self) · 255 unmodified lines
354373
355374 /* WSP, if min_rate is set for at least one TC.
356375 * RR otherwise.
376+ *
377+ * NB! MAC FW sets arb mode itself if PTP is enabled. We shouldn't
378+ * overwrite it here in that case.
357379 */
358− hw_atl_tps_tx_pkt_shed_data_arb_mode_set(self, min_rate_msk ? 1U : 0U);
380+ if (!nic_cfg->is_ptp)
381+ hw_atl_tps_tx_pkt_shed_data_arb_mode_set(self, min_rate_msk ? 1U : 0U);
382+
359383 /* Data TC Arbiter takes precedence over Descriptor TC Arbiter,
360384 * leave Descriptor TC Arbiter as RR.
361385 */
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.h+4−6
@@ -18,17 +18,15 @@ extern const struct aq_hw_caps_s hw_atl_b0_caps_aqc100; · 17 unmodified lines
1818 extern const struct aq_hw_caps_s hw_atl_b0_caps_aqc107;
1919 extern const struct aq_hw_caps_s hw_atl_b0_caps_aqc108;
2020 extern const struct aq_hw_caps_s hw_atl_b0_caps_aqc109;
21−
22−#define hw_atl_b0_caps_aqc111 hw_atl_b0_caps_aqc108
23−#define hw_atl_b0_caps_aqc112 hw_atl_b0_caps_aqc109
21+extern const struct aq_hw_caps_s hw_atl_b0_caps_aqc111;
22+extern const struct aq_hw_caps_s hw_atl_b0_caps_aqc112;
2423
2524 #define hw_atl_b0_caps_aqc100s hw_atl_b0_caps_aqc100
2625 #define hw_atl_b0_caps_aqc107s hw_atl_b0_caps_aqc107
2726 #define hw_atl_b0_caps_aqc108s hw_atl_b0_caps_aqc108
2827 #define hw_atl_b0_caps_aqc109s hw_atl_b0_caps_aqc109
29−
30−#define hw_atl_b0_caps_aqc111s hw_atl_b0_caps_aqc108
31−#define hw_atl_b0_caps_aqc112s hw_atl_b0_caps_aqc109
28+#define hw_atl_b0_caps_aqc111s hw_atl_b0_caps_aqc111
29+#define hw_atl_b0_caps_aqc112s hw_atl_b0_caps_aqc112
3230
3331 extern const struct aq_hw_ops hw_atl_ops_b0;
3432
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c+2−2
@@ -1700,7 +1700,7 @@ void hw_atl_rpfl3l4_ipv6_src_addr_set(struct aq_hw_s *aq_hw, u8 location, · 1699 unmodified lines
17001700 for (i = 0; i < 4; ++i)
17011701 aq_hw_write_reg(aq_hw,
17021702 HW_ATL_RPF_L3_SRCA_ADR(location + i),
1703− ipv6_src[i]);
1703+ ipv6_src[3 - i]);
17041704 }
17051705
17061706 void hw_atl_rpfl3l4_ipv6_dest_addr_set(struct aq_hw_s *aq_hw, u8 location,
@@ -1711,7 +1711,7 @@ void hw_atl_rpfl3l4_ipv6_dest_addr_set(struct aq_hw_s *aq_hw, u8 location, · 4 unmodified lines
17111711 for (i = 0; i < 4; ++i)
17121712 aq_hw_write_reg(aq_hw,
17131713 HW_ATL_RPF_L3_DSTA_ADR(location + i),
1714− ipv6_dest[i]);
1714+ ipv6_dest[3 - i]);
17151715 }
17161716
17171717 u32 hw_atl_sem_ram_get(struct aq_hw_s *self)
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h+1−1
@@ -1360,7 +1360,7 @@ · 1359 unmodified lines
13601360 */
13611361
13621362 /* Register address for bitfield pif_rpf_l3_da0_i[31:0] */
1363−#define HW_ATL_RPF_L3_DSTA_ADR(filter) (0x000053B0 + (filter) * 0x4)
1363+#define HW_ATL_RPF_L3_DSTA_ADR(filter) (0x000053D0 + (filter) * 0x4)
13641364 /* Bitmask for bitfield l3_da0[1F:0] */
13651365 #define HW_ATL_RPF_L3_DSTA_MSK 0xFFFFFFFFu
13661366 /* Inverted bitmask for bitfield l3_da0[1F:0] */
drivers/net/ethernet/atheros/ag71xx.c+2−1
@@ -556,7 +556,8 @@ static int ag71xx_mdio_probe(struct ag71xx *ag) · 555 unmodified lines
556556 ag->mdio_reset = of_reset_control_get_exclusive(np, "mdio");
557557 if (IS_ERR(ag->mdio_reset)) {
558558 netif_err(ag, probe, ndev, "Failed to get reset mdio.\n");
559− return PTR_ERR(ag->mdio_reset);
559+ err = PTR_ERR(ag->mdio_reset);
560+ goto mdio_err_put_clk;
560561 }
561562
562563 mii_bus->name = "ag71xx_mdio";
drivers/net/ethernet/broadcom/bnxt/bnxt.c+15−7
@@ -3418,7 +3418,7 @@ void bnxt_set_tpa_flags(struct bnxt *bp) · 3417 unmodified lines
34183418 */
34193419 void bnxt_set_ring_params(struct bnxt *bp)
34203420 {
3421− u32 ring_size, rx_size, rx_space;
3421+ u32 ring_size, rx_size, rx_space, max_rx_cmpl;
34223422 u32 agg_factor = 0, agg_ring_size = 0;
34233423
34243424 /* 8 for CRC and VLAN */
@@ -3474,7 +3474,15 @@ void bnxt_set_ring_params(struct bnxt *bp) · 49 unmodified lines
34743474 bp->tx_nr_pages = bnxt_calc_nr_ring_pages(ring_size, TX_DESC_CNT);
34753475 bp->tx_ring_mask = (bp->tx_nr_pages * TX_DESC_CNT) - 1;
34763476
3477− ring_size = bp->rx_ring_size * (2 + agg_factor) + bp->tx_ring_size;
3477+ max_rx_cmpl = bp->rx_ring_size;
3478+ /* MAX TPA needs to be added because TPA_START completions are
3479+ * immediately recycled, so the TPA completions are not bound by
3480+ * the RX ring size.
3481+ */
3482+ if (bp->flags & BNXT_FLAG_TPA)
3483+ max_rx_cmpl += bp->max_tpa;
3484+ /* RX and TPA completions are 32-byte, all others are 16-byte */
3485+ ring_size = max_rx_cmpl * 2 + agg_ring_size + bp->tx_ring_size;
34783486 bp->cp_ring_size = ring_size;
34793487
34803488 bp->cp_nr_pages = bnxt_calc_nr_ring_pages(ring_size, CP_DESC_CNT);
@@ -10385,15 +10393,15 @@ static void bnxt_sp_task(struct work_struct *work) · 6904 unmodified lines
1038510393 &bp->sp_event))
1038610394 bnxt_hwrm_phy_qcaps(bp);
1038710395
10388− if (test_and_clear_bit(BNXT_LINK_CFG_CHANGE_SP_EVENT,
10389− &bp->sp_event))
10390− bnxt_init_ethtool_link_settings(bp);
10391−
1039210396 rc = bnxt_update_link(bp, true);
10393− mutex_unlock(&bp->link_lock);
1039410397 if (rc)
1039510398 netdev_err(bp->dev, "SP task can't update link (rc: %x)\n",
1039610399 rc);
10400+
10401+ if (test_and_clear_bit(BNXT_LINK_CFG_CHANGE_SP_EVENT,
10402+ &bp->sp_event))
10403+ bnxt_init_ethtool_link_settings(bp);
10404+ mutex_unlock(&bp->link_lock);
1039710405 }
1039810406 if (test_and_clear_bit(BNXT_UPDATE_PHY_SP_EVENT, &bp->sp_event)) {
1039910407 int rc;
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c+4−1
@@ -1765,8 +1765,11 @@ static int bnxt_set_pauseparam(struct net_device *dev, · 1764 unmodified lines
17651765 if (epause->tx_pause)
17661766 link_info->req_flow_ctrl |= BNXT_LINK_PAUSE_TX;
17671767
1768− if (netif_running(dev))
1768+ if (netif_running(dev)) {
1769+ mutex_lock(&bp->link_lock);
17691770 rc = bnxt_hwrm_set_pause(bp);
1771+ mutex_unlock(&bp->link_lock);
1772+ }
17701773 return rc;
17711774 }
17721775
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c+1−1
@@ -396,6 +396,7 @@ static void bnxt_free_vf_resources(struct bnxt *bp) · 395 unmodified lines
396396 }
397397 }
398398
399+ bp->pf.active_vfs = 0;
399400 kfree(bp->pf.vf);
400401 bp->pf.vf = NULL;
401402 }
@@ -835,7 +836,6 @@ void bnxt_sriov_disable(struct bnxt *bp) · 433 unmodified lines
835836
836837 bnxt_free_vf_resources(bp);
837838
838− bp->pf.active_vfs = 0;
839839 /* Reclaim all resources for the PF. */
840840 rtnl_lock();
841841 bnxt_restore_pf_fw_resources(bp);
drivers/net/ethernet/broadcom/genet/bcmgenet.c+65−79
@@ -543,14 +543,14 @@ static int bcmgenet_hfb_validate_mask(void *mask, size_t size) · 542 unmodified lines
543543 #define VALIDATE_MASK(x) \
544544 bcmgenet_hfb_validate_mask(&(x), sizeof(x))
545545
546−static int bcmgenet_hfb_insert_data(u32 *f, int offset,
547− void *val, void *mask, size_t size)
546+static int bcmgenet_hfb_insert_data(struct bcmgenet_priv *priv, u32 f_index,
547+ u32 offset, void *val, void *mask,
548+ size_t size)
548549 {
549− int index;
550− u32 tmp;
550+ u32 index, tmp;
551551
552− index = offset / 2;
553− tmp = f[index];
552+ index = f_index * priv->hw_params->hfb_filter_size + offset / 2;
553+ tmp = bcmgenet_hfb_readl(priv, index * sizeof(u32));
554554
555555 while (size--) {
556556 if (offset++ & 1) {
@@ -567,9 +567,10 @@ static int bcmgenet_hfb_insert_data(u32 *f, int offset, · 10 unmodified lines
567567 tmp |= 0x10000;
568568 break;
569569 }
570− f[index++] = tmp;
570+ bcmgenet_hfb_writel(priv, tmp, index++ * sizeof(u32));
571571 if (size)
572− tmp = f[index];
572+ tmp = bcmgenet_hfb_readl(priv,
573+ index * sizeof(u32));
573574 } else {
574575 tmp &= ~0xCFF00;
575576 tmp |= (*(unsigned char *)val++) << 8;
@@ -585,44 +586,26 @@ static int bcmgenet_hfb_insert_data(u32 *f, int offset, · 9 unmodified lines
585586 break;
586587 }
587588 if (!size)
588− f[index] = tmp;
589+ bcmgenet_hfb_writel(priv, tmp, index * sizeof(u32));
589590 }
590591 }
591592
592593 return 0;
593594 }
594595
595−static void bcmgenet_hfb_set_filter(struct bcmgenet_priv *priv, u32 *f_data,
596− u32 f_length, u32 rx_queue, int f_index)
597−{
598− u32 base = f_index * priv->hw_params->hfb_filter_size;
599− int i;
600−
601− for (i = 0; i < f_length; i++)
602− bcmgenet_hfb_writel(priv, f_data[i], (base + i) * sizeof(u32));
603−
604− bcmgenet_hfb_set_filter_length(priv, f_index, 2 * f_length);
605− bcmgenet_hfb_set_filter_rx_queue_mapping(priv, f_index, rx_queue);
606−}
607−
608−static int bcmgenet_hfb_create_rxnfc_filter(struct bcmgenet_priv *priv,
609− struct bcmgenet_rxnfc_rule *rule)
596+static void bcmgenet_hfb_create_rxnfc_filter(struct bcmgenet_priv *priv,
597+ struct bcmgenet_rxnfc_rule *rule)
610598 {
611599 struct ethtool_rx_flow_spec *fs = &rule->fs;
612− int err = 0, offset = 0, f_length = 0;
600+ u32 offset = 0, f_length = 0, f;
613601 u8 val_8, mask_8;
614602 __be16 val_16;
615603 u16 mask_16;
616604 size_t size;
617− u32 *f_data;
618−
619− f_data = kcalloc(priv->hw_params->hfb_filter_size, sizeof(u32),
620− GFP_KERNEL);
621− if (!f_data)
622− return -ENOMEM;
623605
606+ f = fs->location;
624607 if (fs->flow_type & FLOW_MAC_EXT) {
625− bcmgenet_hfb_insert_data(f_data, 0,
608+ bcmgenet_hfb_insert_data(priv, f, 0,
626609 &fs->h_ext.h_dest, &fs->m_ext.h_dest,
627610 sizeof(fs->h_ext.h_dest));
628611 }
@@ -630,11 +613,11 @@ static int bcmgenet_hfb_create_rxnfc_filter(struct bcmgenet_priv *priv, · 1 unmodified line
630613 if (fs->flow_type & FLOW_EXT) {
631614 if (fs->m_ext.vlan_etype ||
632615 fs->m_ext.vlan_tci) {
633− bcmgenet_hfb_insert_data(f_data, 12,
616+ bcmgenet_hfb_insert_data(priv, f, 12,
634617 &fs->h_ext.vlan_etype,
635618 &fs->m_ext.vlan_etype,
636619 sizeof(fs->h_ext.vlan_etype));
637− bcmgenet_hfb_insert_data(f_data, 14,
620+ bcmgenet_hfb_insert_data(priv, f, 14,
638621 &fs->h_ext.vlan_tci,
639622 &fs->m_ext.vlan_tci,
640623 sizeof(fs->h_ext.vlan_tci));
@@ -646,15 +629,15 @@ static int bcmgenet_hfb_create_rxnfc_filter(struct bcmgenet_priv *priv, · 5 unmodified lines
646629 switch (fs->flow_type & ~(FLOW_EXT | FLOW_MAC_EXT)) {
647630 case ETHER_FLOW:
648631 f_length += DIV_ROUND_UP(ETH_HLEN, 2);
649− bcmgenet_hfb_insert_data(f_data, 0,
632+ bcmgenet_hfb_insert_data(priv, f, 0,
650633 &fs->h_u.ether_spec.h_dest,
651634 &fs->m_u.ether_spec.h_dest,
652635 sizeof(fs->h_u.ether_spec.h_dest));
653− bcmgenet_hfb_insert_data(f_data, ETH_ALEN,
636+ bcmgenet_hfb_insert_data(priv, f, ETH_ALEN,
654637 &fs->h_u.ether_spec.h_source,
655638 &fs->m_u.ether_spec.h_source,
656639 sizeof(fs->h_u.ether_spec.h_source));
657− bcmgenet_hfb_insert_data(f_data, (2 * ETH_ALEN) + offset,
640+ bcmgenet_hfb_insert_data(priv, f, (2 * ETH_ALEN) + offset,
658641 &fs->h_u.ether_spec.h_proto,
659642 &fs->m_u.ether_spec.h_proto,
660643 sizeof(fs->h_u.ether_spec.h_proto));
@@ -664,21 +647,21 @@ static int bcmgenet_hfb_create_rxnfc_filter(struct bcmgenet_priv *priv, · 3 unmodified lines
664647 /* Specify IP Ether Type */
665648 val_16 = htons(ETH_P_IP);
666649 mask_16 = 0xFFFF;
667− bcmgenet_hfb_insert_data(f_data, (2 * ETH_ALEN) + offset,
650+ bcmgenet_hfb_insert_data(priv, f, (2 * ETH_ALEN) + offset,
668651 &val_16, &mask_16, sizeof(val_16));
669− bcmgenet_hfb_insert_data(f_data, 15 + offset,
652+ bcmgenet_hfb_insert_data(priv, f, 15 + offset,
670653 &fs->h_u.usr_ip4_spec.tos,
671654 &fs->m_u.usr_ip4_spec.tos,
672655 sizeof(fs->h_u.usr_ip4_spec.tos));
673− bcmgenet_hfb_insert_data(f_data, 23 + offset,
656+ bcmgenet_hfb_insert_data(priv, f, 23 + offset,
674657 &fs->h_u.usr_ip4_spec.proto,
675658 &fs->m_u.usr_ip4_spec.proto,
676659 sizeof(fs->h_u.usr_ip4_spec.proto));
677− bcmgenet_hfb_insert_data(f_data, 26 + offset,
660+ bcmgenet_hfb_insert_data(priv, f, 26 + offset,
678661 &fs->h_u.usr_ip4_spec.ip4src,
679662 &fs->m_u.usr_ip4_spec.ip4src,
680663 sizeof(fs->h_u.usr_ip4_spec.ip4src));
681− bcmgenet_hfb_insert_data(f_data, 30 + offset,
664+ bcmgenet_hfb_insert_data(priv, f, 30 + offset,
682665 &fs->h_u.usr_ip4_spec.ip4dst,
683666 &fs->m_u.usr_ip4_spec.ip4dst,
684667 sizeof(fs->h_u.usr_ip4_spec.ip4dst));
@@ -688,11 +671,11 @@ static int bcmgenet_hfb_create_rxnfc_filter(struct bcmgenet_priv *priv, · 3 unmodified lines
688671 /* Only supports 20 byte IPv4 header */
689672 val_8 = 0x45;
690673 mask_8 = 0xFF;
691− bcmgenet_hfb_insert_data(f_data, ETH_HLEN + offset,
674+ bcmgenet_hfb_insert_data(priv, f, ETH_HLEN + offset,
692675 &val_8, &mask_8,
693676 sizeof(val_8));
694677 size = sizeof(fs->h_u.usr_ip4_spec.l4_4_bytes);
695− bcmgenet_hfb_insert_data(f_data,
678+ bcmgenet_hfb_insert_data(priv, f,
696679 ETH_HLEN + 20 + offset,
697680 &fs->h_u.usr_ip4_spec.l4_4_bytes,
698681 &fs->m_u.usr_ip4_spec.l4_4_bytes,
@@ -701,34 +684,42 @@ static int bcmgenet_hfb_create_rxnfc_filter(struct bcmgenet_priv *priv, · 2 unmodified lines
701684 break;
702685 }
703686
687+ bcmgenet_hfb_set_filter_length(priv, f, 2 * f_length);
704688 if (!fs->ring_cookie || fs->ring_cookie == RX_CLS_FLOW_WAKE) {
705689 /* Ring 0 flows can be handled by the default Descriptor Ring
706690 * We'll map them to ring 0, but don't enable the filter
707691 */
708− bcmgenet_hfb_set_filter(priv, f_data, f_length, 0,
709− fs->location);
692+ bcmgenet_hfb_set_filter_rx_queue_mapping(priv, f, 0);
710693 rule->state = BCMGENET_RXNFC_STATE_DISABLED;
711694 } else {
712695 /* Other Rx rings are direct mapped here */
713− bcmgenet_hfb_set_filter(priv, f_data, f_length,
714− fs->ring_cookie, fs->location);
715− bcmgenet_hfb_enable_filter(priv, fs->location);
696+ bcmgenet_hfb_set_filter_rx_queue_mapping(priv, f,
697+ fs->ring_cookie);
698+ bcmgenet_hfb_enable_filter(priv, f);
716699 rule->state = BCMGENET_RXNFC_STATE_ENABLED;
717700 }
718−
719− kfree(f_data);
720−
721− return err;
722701 }
723702
724703 /* bcmgenet_hfb_clear
725704 *
726705 * Clear Hardware Filter Block and disable all filtering.
727706 */
707+static void bcmgenet_hfb_clear_filter(struct bcmgenet_priv *priv, u32 f_index)
708+{
709+ u32 base, i;
710+
711+ base = f_index * priv->hw_params->hfb_filter_size;
712+ for (i = 0; i < priv->hw_params->hfb_filter_size; i++)
713+ bcmgenet_hfb_writel(priv, 0x0, (base + i) * sizeof(u32));
714+}
715+
728716 static void bcmgenet_hfb_clear(struct bcmgenet_priv *priv)
729717 {
730718 u32 i;
731719
720+ if (GENET_IS_V1(priv) || GENET_IS_V2(priv))
721+ return;
722+
732723 bcmgenet_hfb_reg_writel(priv, 0x0, HFB_CTRL);
733724 bcmgenet_hfb_reg_writel(priv, 0x0, HFB_FLT_ENABLE_V3PLUS);
734725 bcmgenet_hfb_reg_writel(priv, 0x0, HFB_FLT_ENABLE_V3PLUS + 4);
@@ -740,19 +731,18 @@ static void bcmgenet_hfb_clear(struct bcmgenet_priv *priv) · 5 unmodified lines
740731 bcmgenet_hfb_reg_writel(priv, 0x0,
741732 HFB_FLT_LEN_V3PLUS + i * sizeof(u32));
742733
743− for (i = 0; i < priv->hw_params->hfb_filter_cnt *
744− priv->hw_params->hfb_filter_size; i++)
745− bcmgenet_hfb_writel(priv, 0x0, i * sizeof(u32));
734+ for (i = 0; i < priv->hw_params->hfb_filter_cnt; i++)
735+ bcmgenet_hfb_clear_filter(priv, i);
746736 }
747737
748738 static void bcmgenet_hfb_init(struct bcmgenet_priv *priv)
749739 {
750740 int i;
751741
742+ INIT_LIST_HEAD(&priv->rxnfc_list);
752743 if (GENET_IS_V1(priv) || GENET_IS_V2(priv))
753744 return;
754745
755− INIT_LIST_HEAD(&priv->rxnfc_list);
756746 for (i = 0; i < MAX_NUM_OF_FS_RULES; i++) {
757747 INIT_LIST_HEAD(&priv->rxnfc_rules[i].list);
758748 priv->rxnfc_rules[i].state = BCMGENET_RXNFC_STATE_UNUSED;
@@ -1437,18 +1427,15 @@ static int bcmgenet_insert_flow(struct net_device *dev, · 678 unmodified lines
14371427 loc_rule = &priv->rxnfc_rules[cmd->fs.location];
14381428 if (loc_rule->state == BCMGENET_RXNFC_STATE_ENABLED)
14391429 bcmgenet_hfb_disable_filter(priv, cmd->fs.location);
1440− if (loc_rule->state != BCMGENET_RXNFC_STATE_UNUSED)
1430+ if (loc_rule->state != BCMGENET_RXNFC_STATE_UNUSED) {
14411431 list_del(&loc_rule->list);
1432+ bcmgenet_hfb_clear_filter(priv, cmd->fs.location);
1433+ }
14421434 loc_rule->state = BCMGENET_RXNFC_STATE_UNUSED;
14431435 memcpy(&loc_rule->fs, &cmd->fs,
14441436 sizeof(struct ethtool_rx_flow_spec));
14451437
1446− err = bcmgenet_hfb_create_rxnfc_filter(priv, loc_rule);
1447− if (err) {
1448− netdev_err(dev, "rxnfc: Could not install rule (%d)\n",
1449− err);
1450− return err;
1451− }
1438+ bcmgenet_hfb_create_rxnfc_filter(priv, loc_rule);
14521439
14531440 list_add_tail(&loc_rule->list, &priv->rxnfc_list);
14541441
@@ -1473,8 +1460,10 @@ static int bcmgenet_delete_flow(struct net_device *dev, · 18 unmodified lines
14731460
14741461 if (rule->state == BCMGENET_RXNFC_STATE_ENABLED)
14751462 bcmgenet_hfb_disable_filter(priv, cmd->fs.location);
1476− if (rule->state != BCMGENET_RXNFC_STATE_UNUSED)
1463+ if (rule->state != BCMGENET_RXNFC_STATE_UNUSED) {
14771464 list_del(&rule->list);
1465+ bcmgenet_hfb_clear_filter(priv, cmd->fs.location);
1466+ }
14781467 rule->state = BCMGENET_RXNFC_STATE_UNUSED;
14791468 memset(&rule->fs, 0, sizeof(struct ethtool_rx_flow_spec));
14801469
@@ -3999,7 +3988,7 @@ static int bcmgenet_probe(struct platform_device *pdev) · 2518 unmodified lines
39993988 if (err)
40003989 err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
40013990 if (err)
4002− goto err;
3991+ goto err_clk_disable;
40033992
40043993 /* Mii wait queue */
40053994 init_waitqueue_head(&priv->wq);
@@ -4011,14 +4000,14 @@ static int bcmgenet_probe(struct platform_device *pdev) · 5 unmodified lines
40114000 if (IS_ERR(priv->clk_wol)) {
40124001 dev_dbg(&priv->pdev->dev, "failed to get enet-wol clock\n");
40134002 err = PTR_ERR(priv->clk_wol);
4014− goto err;
4003+ goto err_clk_disable;
40154004 }
40164005
40174006 priv->clk_eee = devm_clk_get_optional(&priv->pdev->dev, "enet-eee");
40184007 if (IS_ERR(priv->clk_eee)) {
40194008 dev_dbg(&priv->pdev->dev, "failed to get enet-eee clock\n");
40204009 err = PTR_ERR(priv->clk_eee);
4021− goto err;
4010+ goto err_clk_disable;
40224011 }
40234012
40244013 /* If this is an internal GPHY, power it on now, before UniMAC is
@@ -4129,8 +4118,9 @@ static int bcmgenet_resume(struct device *d) · 104 unmodified lines
41294118 {
41304119 struct net_device *dev = dev_get_drvdata(d);
41314120 struct bcmgenet_priv *priv = netdev_priv(dev);
4121+ struct bcmgenet_rxnfc_rule *rule;
41324122 unsigned long dma_ctrl;
4133− u32 offset, reg;
4123+ u32 reg;
41344124 int ret;
41354125
41364126 if (!netif_running(dev))
@@ -4161,10 +4151,11 @@ static int bcmgenet_resume(struct device *d) · 24 unmodified lines
41614151
41624152 bcmgenet_set_hw_addr(priv, dev->dev_addr);
41634153
4164− offset = HFB_FLT_ENABLE_V3PLUS;
4165− bcmgenet_hfb_reg_writel(priv, priv->hfb_en[1], offset);
4166− bcmgenet_hfb_reg_writel(priv, priv->hfb_en[2], offset + sizeof(u32));
4167− bcmgenet_hfb_reg_writel(priv, priv->hfb_en[0], HFB_CTRL);
4154+ /* Restore hardware filters */
4155+ bcmgenet_hfb_clear(priv);
4156+ list_for_each_entry(rule, &priv->rxnfc_list, list)
4157+ if (rule->state != BCMGENET_RXNFC_STATE_UNUSED)
4158+ bcmgenet_hfb_create_rxnfc_filter(priv, rule);
41684159
41694160 if (priv->internal_phy) {
41704161 reg = bcmgenet_ext_readl(priv, EXT_EXT_PWR_MGMT);
@@ -4208,7 +4199,6 @@ static int bcmgenet_suspend(struct device *d) · 37 unmodified lines
42084199 {
42094200 struct net_device *dev = dev_get_drvdata(d);
42104201 struct bcmgenet_priv *priv = netdev_priv(dev);
4211− u32 offset;
42124202
42134203 if (!netif_running(dev))
42144204 return 0;
@@ -4220,11 +4210,7 @@ static int bcmgenet_suspend(struct device *d) · 5 unmodified lines
42204210 if (!device_may_wakeup(d))
42214211 phy_suspend(dev->phydev);
42224212
4223− /* Preserve filter state and disable filtering */
4224− priv->hfb_en[0] = bcmgenet_hfb_reg_readl(priv, HFB_CTRL);
4225− offset = HFB_FLT_ENABLE_V3PLUS;
4226− priv->hfb_en[1] = bcmgenet_hfb_reg_readl(priv, offset);
4227− priv->hfb_en[2] = bcmgenet_hfb_reg_readl(priv, offset + sizeof(u32));
4213+ /* Disable filtering */
42284214 bcmgenet_hfb_reg_writel(priv, 0, HFB_CTRL);
42294215
42304216 return 0;
drivers/net/ethernet/broadcom/genet/bcmgenet.h+0−1
@@ -696,7 +696,6 @@ struct bcmgenet_priv { · 695 unmodified lines
696696 u32 wolopts;
697697 u8 sopass[SOPASS_MAX];
698698 bool wol_active;
699− u32 hfb_en[3];
700699
701700 struct bcmgenet_mib_counters mib;
702701
drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c+15−7
@@ -217,20 +217,28 @@ void bcmgenet_wol_power_up_cfg(struct bcmgenet_priv *priv, · 216 unmodified lines
217217
218218 priv->wol_active = 0;
219219 clk_disable_unprepare(priv->clk_wol);
220+ priv->crc_fwd_en = 0;
220221
221222 /* Disable Magic Packet Detection */
222− reg = bcmgenet_umac_readl(priv, UMAC_MPD_CTRL);
223− reg &= ~(MPD_EN | MPD_PW_EN);
224− bcmgenet_umac_writel(priv, reg, UMAC_MPD_CTRL);
223+ if (priv->wolopts & (WAKE_MAGIC | WAKE_MAGICSECURE)) {
224+ reg = bcmgenet_umac_readl(priv, UMAC_MPD_CTRL);
225+ if (!(reg & MPD_EN))
226+ return; /* already reset so skip the rest */
227+ reg &= ~(MPD_EN | MPD_PW_EN);
228+ bcmgenet_umac_writel(priv, reg, UMAC_MPD_CTRL);
229+ }
225230
226231 /* Disable WAKE_FILTER Detection */
227− reg = bcmgenet_hfb_reg_readl(priv, HFB_CTRL);
228− reg &= ~(RBUF_HFB_EN | RBUF_ACPI_EN);
229− bcmgenet_hfb_reg_writel(priv, reg, HFB_CTRL);
232+ if (priv->wolopts & WAKE_FILTER) {
233+ reg = bcmgenet_hfb_reg_readl(priv, HFB_CTRL);
234+ if (!(reg & RBUF_ACPI_EN))
235+ return; /* already reset so skip the rest */
236+ reg &= ~(RBUF_HFB_EN | RBUF_ACPI_EN);
237+ bcmgenet_hfb_reg_writel(priv, reg, HFB_CTRL);
238+ }
230239
231240 /* Disable CRC Forward */
232241 reg = bcmgenet_umac_readl(priv, UMAC_CMD);
233242 reg &= ~CMD_CRC_FWD;
234243 bcmgenet_umac_writel(priv, reg, UMAC_CMD);
235− priv->crc_fwd_en = 0;
236244 }
drivers/net/ethernet/cadence/macb_main.c+20−13
@@ -2821,11 +2821,13 @@ static void macb_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) · 2820 unmodified lines
28212821 {
28222822 struct macb *bp = netdev_priv(netdev);
28232823
2824− wol->supported = 0;
2825− wol->wolopts = 0;
2826−
2827− if (bp->wol & MACB_WOL_HAS_MAGIC_PACKET)
2824+ if (bp->wol & MACB_WOL_HAS_MAGIC_PACKET) {
28282825 phylink_ethtool_get_wol(bp->phylink, wol);
2826+ wol->supported |= WAKE_MAGIC;
2827+
2828+ if (bp->wol & MACB_WOL_ENABLED)
2829+ wol->wolopts |= WAKE_MAGIC;
2830+ }
28292831 }
28302832
28312833 static int macb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
@@ -2833,9 +2835,13 @@ static int macb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) · 1 unmodified line
28332835 struct macb *bp = netdev_priv(netdev);
28342836 int ret;
28352837
2838+ /* Pass the order to phylink layer */
28362839 ret = phylink_ethtool_set_wol(bp->phylink, wol);
2837− if (!ret)
2838− return 0;
2840+ /* Don't manage WoL on MAC if handled by the PHY
2841+ * or if there's a failure in talking to the PHY
2842+ */
2843+ if (!ret || ret != -EOPNOTSUPP)
2844+ return ret;
28392845
28402846 if (!(bp->wol & MACB_WOL_HAS_MAGIC_PACKET) ||
28412847 (wol->wolopts & ~WAKE_MAGIC))
@@ -3730,7 +3736,7 @@ static int macb_init(struct platform_device *pdev) · 888 unmodified lines
37303736
37313737 if (!(bp->caps & MACB_CAPS_USRIO_DISABLED)) {
37323738 val = 0;
3733− if (bp->phy_interface == PHY_INTERFACE_MODE_RGMII)
3739+ if (phy_interface_mode_is_rgmii(bp->phy_interface))
37343740 val = GEM_BIT(RGMII);
37353741 else if (bp->phy_interface == PHY_INTERFACE_MODE_RMII &&
37363742 (bp->caps & MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII))
@@ -4422,7 +4428,7 @@ static int macb_probe(struct platform_device *pdev) · 685 unmodified lines
44224428 bp->wol = 0;
44234429 if (of_get_property(np, "magic-packet", NULL))
44244430 bp->wol |= MACB_WOL_HAS_MAGIC_PACKET;
4425− device_init_wakeup(&pdev->dev, bp->wol & MACB_WOL_HAS_MAGIC_PACKET);
4431+ device_set_wakeup_capable(&pdev->dev, bp->wol & MACB_WOL_HAS_MAGIC_PACKET);
44264432
44274433 spin_lock_init(&bp->lock);
44284434
@@ -4598,10 +4604,10 @@ static int __maybe_unused macb_suspend(struct device *dev) · 169 unmodified lines
45984604 bp->pm_data.scrt2 = gem_readl_n(bp, ETHT, SCRT2_ETHT);
45994605 }
46004606
4601− netif_carrier_off(netdev);
46024607 if (bp->ptp_info)
46034608 bp->ptp_info->ptp_remove(netdev);
4604− pm_runtime_force_suspend(dev);
4609+ if (!device_may_wakeup(dev))
4610+ pm_runtime_force_suspend(dev);
46054611
46064612 return 0;
46074613 }
@@ -4616,7 +4622,8 @@ static int __maybe_unused macb_resume(struct device *dev) · 8 unmodified lines
46164622 if (!netif_running(netdev))
46174623 return 0;
46184624
4619− pm_runtime_force_resume(dev);
4625+ if (!device_may_wakeup(dev))
4626+ pm_runtime_force_resume(dev);
46204627
46214628 if (bp->wol & MACB_WOL_ENABLED) {
46224629 macb_writel(bp, IDR, MACB_BIT(WOL));
@@ -4654,7 +4661,7 @@ static int __maybe_unused macb_runtime_suspend(struct device *dev) · 31 unmodified lines
46544661 struct net_device *netdev = dev_get_drvdata(dev);
46554662 struct macb *bp = netdev_priv(netdev);
46564663
4657− if (!(device_may_wakeup(&bp->dev->dev))) {
4664+ if (!(device_may_wakeup(dev))) {
46584665 clk_disable_unprepare(bp->tx_clk);
46594666 clk_disable_unprepare(bp->hclk);
46604667 clk_disable_unprepare(bp->pclk);
@@ -4670,7 +4677,7 @@ static int __maybe_unused macb_runtime_resume(struct device *dev) · 9 unmodified lines
46704677 struct net_device *netdev = dev_get_drvdata(dev);
46714678 struct macb *bp = netdev_priv(netdev);
46724679
4673− if (!(device_may_wakeup(&bp->dev->dev))) {
4680+ if (!(device_may_wakeup(dev))) {
46744681 clk_prepare_enable(bp->pclk);
46754682 clk_prepare_enable(bp->hclk);
46764683 clk_prepare_enable(bp->tx_clk);
drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c+5−5
@@ -1112,16 +1112,16 @@ static bool is_addr_all_mask(u8 *ipmask, int family) · 1111 unmodified lines
11121112 struct in_addr *addr;
11131113
11141114 addr = (struct in_addr *)ipmask;
1115− if (ntohl(addr->s_addr) == 0xffffffff)
1115+ if (addr->s_addr == htonl(0xffffffff))
11161116 return true;
11171117 } else if (family == AF_INET6) {
11181118 struct in6_addr *addr6;
11191119
11201120 addr6 = (struct in6_addr *)ipmask;
1121− if (ntohl(addr6->s6_addr32[0]) == 0xffffffff &&
1122− ntohl(addr6->s6_addr32[1]) == 0xffffffff &&
1123− ntohl(addr6->s6_addr32[2]) == 0xffffffff &&
1124− ntohl(addr6->s6_addr32[3]) == 0xffffffff)
1121+ if (addr6->s6_addr32[0] == htonl(0xffffffff) &&
1122+ addr6->s6_addr32[1] == htonl(0xffffffff) &&
1123+ addr6->s6_addr32[2] == htonl(0xffffffff) &&
1124+ addr6->s6_addr32[3] == htonl(0xffffffff))
11251125 return true;
11261126 }
11271127 return false;
drivers/net/ethernet/chelsio/cxgb4/sge.c+1−0
@@ -2938,6 +2938,7 @@ static inline int uld_send(struct adapter *adap, struct sk_buff *skb, · 2937 unmodified lines
29382938 txq_info = adap->sge.uld_txq_info[tx_uld_type];
29392939 if (unlikely(!txq_info)) {
29402940 WARN_ON(true);
2941+ kfree_skb(skb);
29412942 return NET_XMIT_DROP;
29422943 }
29432944
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c+4−4
@@ -3493,7 +3493,7 @@ int t4_prep_fw(struct adapter *adap, struct fw_info *fw_info, · 3492 unmodified lines
34933493 drv_fw = &fw_info->fw_hdr;
34943494
34953495 /* Read the header of the firmware on the card */
3496− ret = -t4_read_flash(adap, FLASH_FW_START,
3496+ ret = t4_read_flash(adap, FLASH_FW_START,
34973497 sizeof(*card_fw) / sizeof(uint32_t),
34983498 (uint32_t *)card_fw, 1);
34993499 if (ret == 0) {
@@ -3522,8 +3522,8 @@ int t4_prep_fw(struct adapter *adap, struct fw_info *fw_info, · 22 unmodified lines
35223522 should_install_fs_fw(adap, card_fw_usable,
35233523 be32_to_cpu(fs_fw->fw_ver),
35243524 be32_to_cpu(card_fw->fw_ver))) {
3525− ret = -t4_fw_upgrade(adap, adap->mbox, fw_data,
3526− fw_size, 0);
3525+ ret = t4_fw_upgrade(adap, adap->mbox, fw_data,
3526+ fw_size, 0);
35273527 if (ret != 0) {
35283528 dev_err(adap->pdev_dev,
35293529 "failed to install firmware: %d\n", ret);
@@ -3554,7 +3554,7 @@ int t4_prep_fw(struct adapter *adap, struct fw_info *fw_info, · 24 unmodified lines
35543554 FW_HDR_FW_VER_MICRO_G(c), FW_HDR_FW_VER_BUILD_G(c),
35553555 FW_HDR_FW_VER_MAJOR_G(k), FW_HDR_FW_VER_MINOR_G(k),
35563556 FW_HDR_FW_VER_MICRO_G(k), FW_HDR_FW_VER_BUILD_G(k));
3557− ret = EINVAL;
3557+ ret = -EINVAL;
35583558 goto bye;
35593559 }
35603560
drivers/net/ethernet/cortina/gemini.c+4−1
@@ -2446,6 +2446,7 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev) · 2445 unmodified lines
24462446 port->reset = devm_reset_control_get_exclusive(dev, NULL);
24472447 if (IS_ERR(port->reset)) {
24482448 dev_err(dev, "no reset\n");
2449+ clk_disable_unprepare(port->pclk);
24492450 return PTR_ERR(port->reset);
24502451 }
24512452 reset_control_reset(port->reset);
@@ -2501,8 +2502,10 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev) · 49 unmodified lines
25012502 IRQF_SHARED,
25022503 port_names[port->id],
25032504 port);
2504− if (ret)
2505+ if (ret) {
2506+ clk_disable_unprepare(port->pclk);
25052507 return ret;
2508+ }
25062509
25072510 ret = register_netdev(netdev);
25082511 if (!ret) {
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c+1−1
@@ -2938,7 +2938,7 @@ static int dpaa_eth_probe(struct platform_device *pdev) · 2937 unmodified lines
29382938 DMA_BIT_MASK(40));
29392939 if (err) {
29402940 netdev_err(net_dev, "dma_coerce_mask_and_coherent() failed\n");
2941− return err;
2941+ goto free_netdev;
29422942 }
29432943
29442944 /* If fsl_fm_max_frm is set to a higher value than the all-common 1500,
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c+1−1
@@ -3632,7 +3632,7 @@ static int dpaa2_eth_connect_mac(struct dpaa2_eth_priv *priv) · 3631 unmodified lines
36323632
36333633 dpni_dev = to_fsl_mc_device(priv->net_dev->dev.parent);
36343634 dpmac_dev = fsl_mc_get_endpoint(dpni_dev);
3635− if (IS_ERR(dpmac_dev) || dpmac_dev->dev.type != &fsl_mc_bus_dpmac_type)
3635+ if (IS_ERR_OR_NULL(dpmac_dev) || dpmac_dev->dev.type != &fsl_mc_bus_dpmac_type)
36363636 return 0;
36373637
36383638 if (dpaa2_mac_is_type_fixed(dpmac_dev, priv->mc_io))
drivers/net/ethernet/freescale/enetc/enetc.c+2−2
@@ -266,7 +266,7 @@ static irqreturn_t enetc_msix(int irq, void *data) · 265 unmodified lines
266266 /* disable interrupts */
267267 enetc_wr_reg(v->rbier, 0);
268268
269− for_each_set_bit(i, &v->tx_rings_map, v->count_tx_rings)
269+ for_each_set_bit(i, &v->tx_rings_map, ENETC_MAX_NUM_TXQS)
270270 enetc_wr_reg(v->tbier_base + ENETC_BDR_OFF(i), 0);
271271
272272 napi_schedule_irqoff(&v->napi);
@@ -302,7 +302,7 @@ static int enetc_poll(struct napi_struct *napi, int budget) · 29 unmodified lines
302302 /* enable interrupts */
303303 enetc_wr_reg(v->rbier, ENETC_RBIER_RXTIE);
304304
305− for_each_set_bit(i, &v->tx_rings_map, v->count_tx_rings)
305+ for_each_set_bit(i, &v->tx_rings_map, ENETC_MAX_NUM_TXQS)
306306 enetc_wr_reg(v->tbier_base + ENETC_BDR_OFF(i),
307307 ENETC_TBIER_TXTIE);
308308
drivers/net/ethernet/freescale/enetc/enetc_pf.c+1−0
@@ -906,6 +906,7 @@ static int enetc_pf_probe(struct pci_dev *pdev, · 905 unmodified lines
906906 return 0;
907907
908908 err_reg_netdev:
909+ enetc_mdio_remove(pf);
909910 enetc_of_put_phy(priv);
910911 enetc_free_msix(priv);
911912 err_alloc_msix:
drivers/net/ethernet/freescale/fec.h+1−5
@@ -525,11 +525,6 @@ struct fec_enet_private { · 524 unmodified lines
525525 unsigned int total_tx_ring_size;
526526 unsigned int total_rx_ring_size;
527527
528− unsigned long work_tx;
529− unsigned long work_rx;
530− unsigned long work_ts;
531− unsigned long work_mdio;
532−
533528 struct platform_device *pdev;
534529
535530 int dev_id;
@@ -595,6 +590,7 @@ struct fec_enet_private { · 59 unmodified lines
595590 void fec_ptp_init(struct platform_device *pdev, int irq_idx);
596591 void fec_ptp_stop(struct platform_device *pdev);
597592 void fec_ptp_start_cyclecounter(struct net_device *ndev);
593+void fec_ptp_disable_hwts(struct net_device *ndev);
598594 int fec_ptp_set(struct net_device *ndev, struct ifreq *ifr);
599595 int fec_ptp_get(struct net_device *ndev, struct ifreq *ifr);
600596
drivers/net/ethernet/freescale/fec_main.c+48−69
@@ -75,8 +75,6 @@ static void fec_enet_itr_coal_init(struct net_device *ndev); · 74 unmodified lines
7575
7676 #define DRIVER_NAME "fec"
7777
78−#define FEC_ENET_GET_QUQUE(_x) ((_x == 0) ? 1 : ((_x == 1) ? 2 : 0))
79−
8078 /* Pause frame feild and FIFO threshold */
8179 #define FEC_ENET_FCE (1 << 5)
8280 #define FEC_ENET_RSEM_V 0x84
@@ -1248,8 +1246,6 @@ fec_enet_tx_queue(struct net_device *ndev, u16 queue_id) · 1165 unmodified lines
12481246
12491247 fep = netdev_priv(ndev);
12501248
1251− queue_id = FEC_ENET_GET_QUQUE(queue_id);
1252−
12531249 txq = fep->tx_queue[queue_id];
12541250 /* get next bdp of dirty_tx */
12551251 nq = netdev_get_tx_queue(ndev, queue_id);
@@ -1298,8 +1294,13 @@ fec_enet_tx_queue(struct net_device *ndev, u16 queue_id) · 42 unmodified lines
12981294 ndev->stats.tx_bytes += skb->len;
12991295 }
13001296
1301− if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS) &&
1302− fep->bufdesc_ex) {
1297+ /* NOTE: SKBTX_IN_PROGRESS being set does not imply it's we who
1298+ * are to time stamp the packet, so we still need to check time
1299+ * stamping enabled flag.
1300+ */
1301+ if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS &&
1302+ fep->hwts_tx_en) &&
1303+ fep->bufdesc_ex) {
13031304 struct skb_shared_hwtstamps shhwtstamps;
13041305 struct bufdesc_ex *ebdp = (struct bufdesc_ex *)bdp;
13051306
@@ -1340,17 +1341,14 @@ skb_done: · 34 unmodified lines
13401341 writel(0, txq->bd.reg_desc_active);
13411342 }
13421343
1343−static void
1344−fec_enet_tx(struct net_device *ndev)
1344+static void fec_enet_tx(struct net_device *ndev)
13451345 {
13461346 struct fec_enet_private *fep = netdev_priv(ndev);
1347− u16 queue_id;
1348− /* First process class A queue, then Class B and Best Effort queue */
1349− for_each_set_bit(queue_id, &fep->work_tx, FEC_ENET_MAX_TX_QS) {
1350− clear_bit(queue_id, &fep->work_tx);
1351− fec_enet_tx_queue(ndev, queue_id);
1352− }
1353− return;
1347+ int i;
1348+
1349+ /* Make sure that AVB queues are processed first. */
1350+ for (i = fep->num_tx_queues - 1; i >= 0; i--)
1351+ fec_enet_tx_queue(ndev, i);
13541352 }
13551353
13561354 static int
@@ -1426,7 +1424,6 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id) · 69 unmodified lines
14261424 #ifdef CONFIG_M532x
14271425 flush_cache_all();
14281426 #endif
1429− queue_id = FEC_ENET_GET_QUQUE(queue_id);
14301427 rxq = fep->rx_queue[queue_id];
14311428
14321429 /* First, grab all of the stats for the incoming packet.
@@ -1550,6 +1547,7 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id) · 117 unmodified lines
15501547 htons(ETH_P_8021Q),
15511548 vlan_tag);
15521549
1550+ skb_record_rx_queue(skb, queue_id);
15531551 napi_gro_receive(&fep->napi, skb);
15541552
15551553 if (is_copybreak) {
@@ -1595,48 +1593,30 @@ rx_processing_done: · 39 unmodified lines
15951593 return pkt_received;
15961594 }
15971595
1598−static int
1599−fec_enet_rx(struct net_device *ndev, int budget)
1596+static int fec_enet_rx(struct net_device *ndev, int budget)
16001597 {
1601− int pkt_received = 0;
1602− u16 queue_id;
16031598 struct fec_enet_private *fep = netdev_priv(ndev);
1599+ int i, done = 0;
16041600
1605− for_each_set_bit(queue_id, &fep->work_rx, FEC_ENET_MAX_RX_QS) {
1606− int ret;
1601+ /* Make sure that AVB queues are processed first. */
1602+ for (i = fep->num_rx_queues - 1; i >= 0; i--)
1603+ done += fec_enet_rx_queue(ndev, budget - done, i);
16071604
1608− ret = fec_enet_rx_queue(ndev,
1609− budget - pkt_received, queue_id);
1610−
1611− if (ret < budget - pkt_received)
1612− clear_bit(queue_id, &fep->work_rx);
1613−
1614− pkt_received += ret;
1615− }
1616− return pkt_received;
1605+ return done;
16171606 }
16181607
1619−static bool
1620−fec_enet_collect_events(struct fec_enet_private *fep, uint int_events)
1608+static bool fec_enet_collect_events(struct fec_enet_private *fep)
16211609 {
1622− if (int_events == 0)
1623− return false;
1610+ uint int_events;
1611+
1612+ int_events = readl(fep->hwp + FEC_IEVENT);
16241613
1625− if (int_events & FEC_ENET_RXF_0)
1626− fep->work_rx |= (1 << 2);
1627− if (int_events & FEC_ENET_RXF_1)
1628− fep->work_rx |= (1 << 0);
1629− if (int_events & FEC_ENET_RXF_2)
1630− fep->work_rx |= (1 << 1);
1614+ /* Don't clear MDIO events, we poll for those */
1615+ int_events &= ~FEC_ENET_MII;
16311616
1632− if (int_events & FEC_ENET_TXF_0)
1633− fep->work_tx |= (1 << 2);
1634− if (int_events & FEC_ENET_TXF_1)
1635− fep->work_tx |= (1 << 0);
1636− if (int_events & FEC_ENET_TXF_2)
1637− fep->work_tx |= (1 << 1);
1617+ writel(int_events, fep->hwp + FEC_IEVENT);
16381618
1639− return true;
1619+ return int_events != 0;
16401620 }
16411621
16421622 static irqreturn_t
@@ -1644,18 +1624,9 @@ fec_enet_interrupt(int irq, void *dev_id) · 1 unmodified line
16441624 {
16451625 struct net_device *ndev = dev_id;
16461626 struct fec_enet_private *fep = netdev_priv(ndev);
1647− uint int_events;
16481627 irqreturn_t ret = IRQ_NONE;
16491628
1650− int_events = readl(fep->hwp + FEC_IEVENT);
1651−
1652− /* Don't clear MDIO events, we poll for those */
1653− int_events &= ~FEC_ENET_MII;
1654−
1655− writel(int_events, fep->hwp + FEC_IEVENT);
1656− fec_enet_collect_events(fep, int_events);
1657−
1658− if ((fep->work_tx || fep->work_rx) && fep->link) {
1629+ if (fec_enet_collect_events(fep) && fep->link) {
16591630 ret = IRQ_HANDLED;
16601631
16611632 if (napi_schedule_prep(&fep->napi)) {
@@ -1672,17 +1643,19 @@ static int fec_enet_rx_napi(struct napi_struct *napi, int budget) · 10 unmodified lines
16721643 {
16731644 struct net_device *ndev = napi->dev;
16741645 struct fec_enet_private *fep = netdev_priv(ndev);
1675− int pkts;
1646+ int done = 0;
16761647
1677− pkts = fec_enet_rx(ndev, budget);
1678−
1679− fec_enet_tx(ndev);
1648+ do {
1649+ done += fec_enet_rx(ndev, budget - done);
1650+ fec_enet_tx(ndev);
1651+ } while ((done < budget) && fec_enet_collect_events(fep));
16801652
1681− if (pkts < budget) {
1682− napi_complete_done(napi, pkts);
1653+ if (done < budget) {
1654+ napi_complete_done(napi, done);
16831655 writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
16841656 }
1685− return pkts;
1657+
1658+ return done;
16861659 }
16871660
16881661 /* ------------------------------------------------------------------------- */
@@ -2755,10 +2728,16 @@ static int fec_enet_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) · 1066 unmodified lines
27552728 return -ENODEV;
27562729
27572730 if (fep->bufdesc_ex) {
2758− if (cmd == SIOCSHWTSTAMP)
2759− return fec_ptp_set(ndev, rq);
2760− if (cmd == SIOCGHWTSTAMP)
2761− return fec_ptp_get(ndev, rq);
2731+ bool use_fec_hwts = !phy_has_hwtstamp(phydev);
2732+
2733+ if (cmd == SIOCSHWTSTAMP) {
2734+ if (use_fec_hwts)
2735+ return fec_ptp_set(ndev, rq);
2736+ fec_ptp_disable_hwts(ndev);
2737+ } else if (cmd == SIOCGHWTSTAMP) {
2738+ if (use_fec_hwts)
2739+ return fec_ptp_get(ndev, rq);
2740+ }
27622741 }
27632742
27642743 return phy_mii_ioctl(phydev, rq, cmd);
drivers/net/ethernet/freescale/fec_ptp.c+12−0
@@ -452,6 +452,18 @@ static int fec_ptp_enable(struct ptp_clock_info *ptp, · 451 unmodified lines
452452 return -EOPNOTSUPP;
453453 }
454454
455+/**
456+ * fec_ptp_disable_hwts - disable hardware time stamping
457+ * @ndev: pointer to net_device
458+ */
459+void fec_ptp_disable_hwts(struct net_device *ndev)
460+{
461+ struct fec_enet_private *fep = netdev_priv(ndev);
462+
463+ fep->hwts_tx_en = 0;
464+ fep->hwts_rx_en = 0;
465+}
466+
455467 int fec_ptp_set(struct net_device *ndev, struct ifreq *ifr)
456468 {
457469 struct fec_enet_private *fep = netdev_priv(ndev);
drivers/net/ethernet/freescale/gianfar.c+5−1
@@ -779,8 +779,12 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev) · 778 unmodified lines
779779
780780 mac_addr = of_get_mac_address(np);
781781
782− if (!IS_ERR(mac_addr))
782+ if (!IS_ERR(mac_addr)) {
783783 ether_addr_copy(dev->dev_addr, mac_addr);
784+ } else {
785+ eth_hw_addr_random(dev);
786+ dev_info(&ofdev->dev, "Using random MAC address: %pM\n", dev->dev_addr);
787+ }
784788
785789 if (model && !strcasecmp(model, "TSEC"))
786790 priv->device_flags |= FSL_GIANFAR_DEV_HAS_GIGABIT |
drivers/net/ethernet/hisilicon/hns3/hnae3.h+1−0
@@ -77,6 +77,7 @@ · 76 unmodified lines
7777 ((ring)->p = ((ring)->p - 1 + (ring)->desc_num) % (ring)->desc_num)
7878
7979 enum hns_desc_type {
80+ DESC_TYPE_UNKNOWN,
8081 DESC_TYPE_SKB,
8182 DESC_TYPE_FRAGLIST_SKB,
8283 DESC_TYPE_PAGE,
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c+20−25
@@ -1093,16 +1093,8 @@ static int hns3_fill_desc(struct hns3_enet_ring *ring, void *priv, · 1092 unmodified lines
10931093 int k, sizeoflast;
10941094 dma_addr_t dma;
10951095
1096− if (type == DESC_TYPE_SKB) {
1097− struct sk_buff *skb = (struct sk_buff *)priv;
1098− int ret;
1099−
1100− ret = hns3_fill_skb_desc(ring, skb, desc);
1101− if (unlikely(ret < 0))
1102− return ret;
1103−
1104− dma = dma_map_single(dev, skb->data, size, DMA_TO_DEVICE);
1105− } else if (type == DESC_TYPE_FRAGLIST_SKB) {
1096+ if (type == DESC_TYPE_FRAGLIST_SKB ||
1097+ type == DESC_TYPE_SKB) {
11061098 struct sk_buff *skb = (struct sk_buff *)priv;
11071099
11081100 dma = dma_map_single(dev, skb->data, size, DMA_TO_DEVICE);
@@ -1118,12 +1110,12 @@ static int hns3_fill_desc(struct hns3_enet_ring *ring, void *priv, · 9 unmodified lines
11181110 return -ENOMEM;
11191111 }
11201112
1113+ desc_cb->priv = priv;
11211114 desc_cb->length = size;
1115+ desc_cb->dma = dma;
1116+ desc_cb->type = type;
11221117
11231118 if (likely(size <= HNS3_MAX_BD_SIZE)) {
1124− desc_cb->priv = priv;
1125− desc_cb->dma = dma;
1126− desc_cb->type = type;
11271119 desc->addr = cpu_to_le64(dma);
11281120 desc->tx.send_size = cpu_to_le16(size);
11291121 desc->tx.bdtp_fe_sc_vld_ra_ri =
@@ -1135,18 +1127,11 @@ static int hns3_fill_desc(struct hns3_enet_ring *ring, void *priv, · 5 unmodified lines
11351127 }
11361128
11371129 frag_buf_num = hns3_tx_bd_count(size);
1138− sizeoflast = size & HNS3_TX_LAST_SIZE_M;
1130+ sizeoflast = size % HNS3_MAX_BD_SIZE;
11391131 sizeoflast = sizeoflast ? sizeoflast : HNS3_MAX_BD_SIZE;
11401132
11411133 /* When frag size is bigger than hardware limit, split this frag */
11421134 for (k = 0; k < frag_buf_num; k++) {
1143− /* The txbd's baseinfo of DESC_TYPE_PAGE & DESC_TYPE_SKB */
1144− desc_cb->priv = priv;
1145− desc_cb->dma = dma + HNS3_MAX_BD_SIZE * k;
1146− desc_cb->type = ((type == DESC_TYPE_FRAGLIST_SKB ||
1147− type == DESC_TYPE_SKB) && !k) ?
1148− type : DESC_TYPE_PAGE;
1149−
11501135 /* now, fill the descriptor */
11511136 desc->addr = cpu_to_le64(dma + HNS3_MAX_BD_SIZE * k);
11521137 desc->tx.send_size = cpu_to_le16((k == frag_buf_num - 1) ?
@@ -1158,7 +1143,6 @@ static int hns3_fill_desc(struct hns3_enet_ring *ring, void *priv, · 5 unmodified lines
11581143 /* move ring pointer to next */
11591144 ring_ptr_move_fw(ring, next_to_use);
11601145
1161− desc_cb = &ring->desc_cb[ring->next_to_use];
11621146 desc = &ring->desc[ring->next_to_use];
11631147 }
11641148
@@ -1346,6 +1330,10 @@ static void hns3_clear_desc(struct hns3_enet_ring *ring, int next_to_use_orig) · 181 unmodified lines
13461330 unsigned int i;
13471331
13481332 for (i = 0; i < ring->desc_num; i++) {
1333+ struct hns3_desc *desc = &ring->desc[ring->next_to_use];
1334+
1335+ memset(desc, 0, sizeof(*desc));
1336+
13491337 /* check if this is where we started */
13501338 if (ring->next_to_use == next_to_use_orig)
13511339 break;
@@ -1353,6 +1341,9 @@ static void hns3_clear_desc(struct hns3_enet_ring *ring, int next_to_use_orig) · 1 unmodified line
13531341 /* rollback one */
13541342 ring_ptr_move_bw(ring, next_to_use);
13551343
1344+ if (!ring->desc_cb[ring->next_to_use].dma)
1345+ continue;
1346+
13561347 /* unmap the descriptor dma address */
13571348 if (ring->desc_cb[ring->next_to_use].type == DESC_TYPE_SKB ||
13581349 ring->desc_cb[ring->next_to_use].type ==
@@ -1369,6 +1360,7 @@ static void hns3_clear_desc(struct hns3_enet_ring *ring, int next_to_use_orig) · 10 unmodified lines
13691360
13701361 ring->desc_cb[ring->next_to_use].length = 0;
13711362 ring->desc_cb[ring->next_to_use].dma = 0;
1363+ ring->desc_cb[ring->next_to_use].type = DESC_TYPE_UNKNOWN;
13721364 }
13731365 }
13741366
@@ -1439,6 +1431,10 @@ netdev_tx_t hns3_nic_net_xmit(struct sk_buff *skb, struct net_device *netdev) · 64 unmodified lines
14391431
14401432 next_to_use_head = ring->next_to_use;
14411433
1434+ ret = hns3_fill_skb_desc(ring, skb, &ring->desc[ring->next_to_use]);
1435+ if (unlikely(ret < 0))
1436+ goto fill_err;
1437+
14421438 ret = hns3_fill_skb_to_desc(ring, skb, DESC_TYPE_SKB);
14431439 if (unlikely(ret < 0))
14441440 goto fill_err;
@@ -4127,9 +4123,8 @@ static void hns3_client_uninit(struct hnae3_handle *handle, bool reset) · 2682 unmodified lines
41274123
41284124 hns3_put_ring_config(priv);
41294125
4130− hns3_dbg_uninit(handle);
4131−
41324126 out_netdev_free:
4127+ hns3_dbg_uninit(handle);
41334128 free_netdev(netdev);
41344129 }
41354130
@@ -4141,8 +4136,8 @@ static void hns3_link_status_change(struct hnae3_handle *handle, bool linkup) · 5 unmodified lines
41414136 return;
41424137
41434138 if (linkup) {
4144− netif_carrier_on(netdev);
41454139 netif_tx_wake_all_queues(netdev);
4140+ netif_carrier_on(netdev);
41464141 if (netif_msg_link(handle))
41474142 netdev_info(netdev, "link up\n");
41484143 } else {
drivers/net/ethernet/hisilicon/hns3/hns3_enet.h+0−2
@@ -165,8 +165,6 @@ enum hns3_nic_state { · 164 unmodified lines
165165 #define HNS3_TXD_MSS_S 0
166166 #define HNS3_TXD_MSS_M (0x3fff << HNS3_TXD_MSS_S)
167167
168−#define HNS3_TX_LAST_SIZE_M 0xffff
169−
170168 #define HNS3_VECTOR_TX_IRQ BIT_ULL(0)
171169 #define HNS3_VECTOR_RX_IRQ BIT_ULL(1)
172170
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c+6−3
@@ -180,18 +180,21 @@ static void hns3_lb_check_skb_data(struct hns3_enet_ring *ring, · 179 unmodified lines
180180 {
181181 struct hns3_enet_tqp_vector *tqp_vector = ring->tqp_vector;
182182 unsigned char *packet = skb->data;
183+ u32 len = skb_headlen(skb);
183184 u32 i;
184185
185− for (i = 0; i < skb->len; i++)
186+ len = min_t(u32, len, HNS3_NIC_LB_TEST_PACKET_SIZE);
187+
188+ for (i = 0; i < len; i++)
186189 if (packet[i] != (unsigned char)(i & 0xff))
187190 break;
188191
189192 /* The packet is correctly received */
190− if (i == skb->len)
193+ if (i == HNS3_NIC_LB_TEST_PACKET_SIZE)
191194 tqp_vector->rx_group.total_packets++;
192195 else
193196 print_hex_dump(KERN_ERR, "selftest:", DUMP_PREFIX_OFFSET, 16, 1,
194− skb->data, skb->len, true);
197+ skb->data, len, true);
195198
196199 dev_kfree_skb_any(skb);
197200 }
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c+42−44
@@ -2673,11 +2673,10 @@ void hclge_task_schedule(struct hclge_dev *hdev, unsigned long delay_time) · 2672 unmodified lines
26732673 delay_time);
26742674 }
26752675
2676−static int hclge_get_mac_link_status(struct hclge_dev *hdev)
2676+static int hclge_get_mac_link_status(struct hclge_dev *hdev, int *link_status)
26772677 {
26782678 struct hclge_link_status_cmd *req;
26792679 struct hclge_desc desc;
2680− int link_status;
26812680 int ret;
26822681
26832682 hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_QUERY_LINK_STATUS, true);
@@ -2689,33 +2688,25 @@ static int hclge_get_mac_link_status(struct hclge_dev *hdev) · 5 unmodified lines
26892688 }
26902689
26912690 req = (struct hclge_link_status_cmd *)desc.data;
2692− link_status = req->status & HCLGE_LINK_STATUS_UP_M;
2691+ *link_status = (req->status & HCLGE_LINK_STATUS_UP_M) > 0 ?
2692+ HCLGE_LINK_STATUS_UP : HCLGE_LINK_STATUS_DOWN;
26932693
2694− return !!link_status;
2694+ return 0;
26952695 }
26962696
2697−static int hclge_get_mac_phy_link(struct hclge_dev *hdev)
2697+static int hclge_get_mac_phy_link(struct hclge_dev *hdev, int *link_status)
26982698 {
2699− unsigned int mac_state;
2700− int link_stat;
2699+ struct phy_device *phydev = hdev->hw.mac.phydev;
2700+
2701+ *link_status = HCLGE_LINK_STATUS_DOWN;
27012702
27022703 if (test_bit(HCLGE_STATE_DOWN, &hdev->state))
27032704 return 0;
27042705
2705− mac_state = hclge_get_mac_link_status(hdev);
2706−
2707− if (hdev->hw.mac.phydev) {
2708− if (hdev->hw.mac.phydev->state == PHY_RUNNING)
2709− link_stat = mac_state &
2710− hdev->hw.mac.phydev->link;
2711− else
2712− link_stat = 0;
2713−
2714− } else {
2715− link_stat = mac_state;
2716− }
2706+ if (phydev && (phydev->state != PHY_RUNNING || !phydev->link))
2707+ return 0;
27172708
2718− return !!link_stat;
2709+ return hclge_get_mac_link_status(hdev, link_status);
27192710 }
27202711
27212712 static void hclge_update_link_status(struct hclge_dev *hdev)
@@ -2725,6 +2716,7 @@ static void hclge_update_link_status(struct hclge_dev *hdev) · 3 unmodified lines
27252716 struct hnae3_handle *rhandle;
27262717 struct hnae3_handle *handle;
27272718 int state;
2719+ int ret;
27282720 int i;
27292721
27302722 if (!client)
@@ -2733,7 +2725,12 @@ static void hclge_update_link_status(struct hclge_dev *hdev) · 2 unmodified lines
27332725 if (test_and_set_bit(HCLGE_STATE_LINK_UPDATING, &hdev->state))
27342726 return;
27352727
2736− state = hclge_get_mac_phy_link(hdev);
2728+ ret = hclge_get_mac_phy_link(hdev, &state);
2729+ if (ret) {
2730+ clear_bit(HCLGE_STATE_LINK_UPDATING, &hdev->state);
2731+ return;
2732+ }
2733+
27372734 if (state != hdev->hw.mac.link) {
27382735 for (i = 0; i < hdev->num_vmdq_vport + 1; i++) {
27392736 handle = &hdev->vport[i].nic;
@@ -5809,9 +5806,9 @@ static int hclge_add_fd_entry(struct hnae3_handle *handle, · 3069 unmodified lines
58095806 /* to avoid rule conflict, when user configure rule by ethtool,
58105807 * we need to clear all arfs rules
58115808 */
5809+ spin_lock_bh(&hdev->fd_rule_lock);
58125810 hclge_clear_arfs_rules(handle);
58135811
5814− spin_lock_bh(&hdev->fd_rule_lock);
58155812 ret = hclge_fd_config_rule(hdev, rule);
58165813
58175814 spin_unlock_bh(&hdev->fd_rule_lock);
@@ -5854,6 +5851,7 @@ static int hclge_del_fd_entry(struct hnae3_handle *handle, · 36 unmodified lines
58545851 return ret;
58555852 }
58565853
5854+/* make sure being called after lock up with fd_rule_lock */
58575855 static void hclge_del_all_fd_entries(struct hnae3_handle *handle,
58585856 bool clear_list)
58595857 {
@@ -5866,7 +5864,6 @@ static void hclge_del_all_fd_entries(struct hnae3_handle *handle, · 6 unmodified lines
58665864 if (!hnae3_dev_fd_supported(hdev))
58675865 return;
58685866
5869− spin_lock_bh(&hdev->fd_rule_lock);
58705867 for_each_set_bit(location, hdev->fd_bmap,
58715868 hdev->fd_cfg.rule_num[HCLGE_FD_STAGE_1])
58725869 hclge_fd_tcam_config(hdev, HCLGE_FD_STAGE_1, true, location,
@@ -5883,8 +5880,6 @@ static void hclge_del_all_fd_entries(struct hnae3_handle *handle, · 10 unmodified lines
58835880 bitmap_zero(hdev->fd_bmap,
58845881 hdev->fd_cfg.rule_num[HCLGE_FD_STAGE_1]);
58855882 }
5886−
5887− spin_unlock_bh(&hdev->fd_rule_lock);
58885883 }
58895884
58905885 static int hclge_restore_fd_entries(struct hnae3_handle *handle)
@@ -6266,7 +6261,7 @@ static int hclge_add_fd_entry_by_arfs(struct hnae3_handle *handle, u16 queue_id, · 375 unmodified lines
62666261 u16 flow_id, struct flow_keys *fkeys)
62676262 {
62686263 struct hclge_vport *vport = hclge_get_vport(handle);
6269− struct hclge_fd_rule_tuples new_tuples;
6264+ struct hclge_fd_rule_tuples new_tuples = {};
62706265 struct hclge_dev *hdev = vport->back;
62716266 struct hclge_fd_rule *rule;
62726267 u16 tmp_queue_id;
@@ -6276,19 +6271,17 @@ static int hclge_add_fd_entry_by_arfs(struct hnae3_handle *handle, u16 queue_id, · 3 unmodified lines
62766271 if (!hnae3_dev_fd_supported(hdev))
62776272 return -EOPNOTSUPP;
62786273
6279− memset(&new_tuples, 0, sizeof(new_tuples));
6280− hclge_fd_get_flow_tuples(fkeys, &new_tuples);
6281−
6282− spin_lock_bh(&hdev->fd_rule_lock);
6283−
62846274 /* when there is already fd rule existed add by user,
62856275 * arfs should not work
62866276 */
6277+ spin_lock_bh(&hdev->fd_rule_lock);
62876278 if (hdev->fd_active_type == HCLGE_FD_EP_ACTIVE) {
62886279 spin_unlock_bh(&hdev->fd_rule_lock);
62896280 return -EOPNOTSUPP;
62906281 }
62916282
6283+ hclge_fd_get_flow_tuples(fkeys, &new_tuples);
6284+
62926285 /* check is there flow director filter existed for this flow,
62936286 * if not, create a new filter for it;
62946287 * if filter exist with different queue id, modify the filter;
@@ -6371,6 +6364,7 @@ static void hclge_rfs_filter_expire(struct hclge_dev *hdev) · 76 unmodified lines
63716364 #endif
63726365 }
63736366
6367+/* make sure being called after lock up with fd_rule_lock */
63746368 static void hclge_clear_arfs_rules(struct hnae3_handle *handle)
63756369 {
63766370 #ifdef CONFIG_RFS_ACCEL
@@ -6423,10 +6417,14 @@ static void hclge_enable_fd(struct hnae3_handle *handle, bool enable) · 46 unmodified lines
64236417
64246418 hdev->fd_en = enable;
64256419 clear = hdev->fd_active_type == HCLGE_FD_ARFS_ACTIVE;
6426− if (!enable)
6420+
6421+ if (!enable) {
6422+ spin_lock_bh(&hdev->fd_rule_lock);
64276423 hclge_del_all_fd_entries(handle, clear);
6428− else
6424+ spin_unlock_bh(&hdev->fd_rule_lock);
6425+ } else {
64296426 hclge_restore_fd_entries(handle);
6427+ }
64306428 }
64316429
64326430 static void hclge_cfg_mac_mode(struct hclge_dev *hdev, bool enable)
@@ -6524,14 +6522,15 @@ static int hclge_mac_link_status_wait(struct hclge_dev *hdev, int link_ret) · 91 unmodified lines
65246522 {
65256523 #define HCLGE_MAC_LINK_STATUS_NUM 100
65266524
6525+ int link_status;
65276526 int i = 0;
65286527 int ret;
65296528
65306529 do {
6531− ret = hclge_get_mac_link_status(hdev);
6532− if (ret < 0)
6530+ ret = hclge_get_mac_link_status(hdev, &link_status);
6531+ if (ret)
65336532 return ret;
6534− else if (ret == link_ret)
6533+ if (link_status == link_ret)
65356534 return 0;
65366535
65376536 msleep(HCLGE_LINK_STATUS_MS);
@@ -6542,9 +6541,6 @@ static int hclge_mac_link_status_wait(struct hclge_dev *hdev, int link_ret) · 4 unmodified lines
65426541 static int hclge_mac_phy_link_status_wait(struct hclge_dev *hdev, bool en,
65436542 bool is_phy)
65446543 {
6545−#define HCLGE_LINK_STATUS_DOWN 0
6546−#define HCLGE_LINK_STATUS_UP 1
6547−
65486544 int link_ret;
65496545
65506546 link_ret = en ? HCLGE_LINK_STATUS_UP : HCLGE_LINK_STATUS_DOWN;
@@ -6891,8 +6887,9 @@ static void hclge_ae_stop(struct hnae3_handle *handle) · 340 unmodified lines
68916887 int i;
68926888
68936889 set_bit(HCLGE_STATE_DOWN, &hdev->state);
6894−
6890+ spin_lock_bh(&hdev->fd_rule_lock);
68956891 hclge_clear_arfs_rules(handle);
6892+ spin_unlock_bh(&hdev->fd_rule_lock);
68966893
68976894 /* If it is not PF reset, the firmware will disable the MAC,
68986895 * so it only need to stop phy here.
@@ -9045,11 +9042,12 @@ int hclge_set_vlan_filter(struct hnae3_handle *handle, __be16 proto, · 2146 unmodified lines
90459042 bool writen_to_tbl = false;
90469043 int ret = 0;
90479044
9048− /* When device is resetting, firmware is unable to handle
9049− * mailbox. Just record the vlan id, and remove it after
9045+ /* When device is resetting or reset failed, firmware is unable to
9046+ * handle mailbox. Just record the vlan id, and remove it after
90509047 * reset finished.
90519048 */
9052− if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state) && is_kill) {
9049+ if ((test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state) ||
9050+ test_bit(HCLGE_STATE_RST_FAIL, &hdev->state)) && is_kill) {
90539051 set_bit(vlan_id, vport->vlan_del_fail_bmap);
90549052 return -EBUSY;
90559053 }
@@ -9859,7 +9857,7 @@ retry: · 803 unmodified lines
98599857 set_bit(HCLGE_STATE_RST_HANDLING, &hdev->state);
98609858 hdev->reset_type = HNAE3_FLR_RESET;
98619859 ret = hclge_reset_prepare(hdev);
9862− if (ret) {
9860+ if (ret || hdev->reset_pending) {
98639861 dev_err(&hdev->pdev->dev, "fail to prepare FLR, ret=%d\n",
98649862 ret);
98659863 if (hdev->reset_pending ||
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h+3−0
@@ -317,6 +317,9 @@ enum hclge_link_fail_code { · 316 unmodified lines
317317 HCLGE_LF_XSFP_ABSENT,
318318 };
319319
320+#define HCLGE_LINK_STATUS_DOWN 0
321+#define HCLGE_LINK_STATUS_UP 1
322+
320323 #define HCLGE_PG_NUM 4
321324 #define HCLGE_SCH_MODE_SP 0
322325 #define HCLGE_SCH_MODE_DWRR 1
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c+31−12
@@ -1592,11 +1592,12 @@ static int hclgevf_set_vlan_filter(struct hnae3_handle *handle, · 1591 unmodified lines
15921592 if (proto != htons(ETH_P_8021Q))
15931593 return -EPROTONOSUPPORT;
15941594
1595− /* When device is resetting, firmware is unable to handle
1596− * mailbox. Just record the vlan id, and remove it after
1595+ /* When device is resetting or reset failed, firmware is unable to
1596+ * handle mailbox. Just record the vlan id, and remove it after
15971597 * reset finished.
15981598 */
1599− if (test_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state) && is_kill) {
1599+ if ((test_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state) ||
1600+ test_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state)) && is_kill) {
16001601 set_bit(vlan_id, hdev->vlan_del_fail_bmap);
16011602 return -EBUSY;
16021603 }
@@ -1793,6 +1794,11 @@ static int hclgevf_reset_prepare_wait(struct hclgevf_dev *hdev) · 190 unmodified lines
17931794 if (hdev->reset_type == HNAE3_VF_FUNC_RESET) {
17941795 hclgevf_build_send_msg(&send_msg, HCLGE_MBX_RESET, 0);
17951796 ret = hclgevf_send_mbx_msg(hdev, &send_msg, true, NULL, 0);
1797+ if (ret) {
1798+ dev_err(&hdev->pdev->dev,
1799+ "failed to assert VF reset, ret = %d\n", ret);
1800+ return ret;
1801+ }
17961802 hdev->rst_stats.vf_func_rst_cnt++;
17971803 }
17981804
@@ -3434,23 +3440,36 @@ void hclgevf_update_port_base_vlan_info(struct hclgevf_dev *hdev, u16 state, · 1635 unmodified lines
34343440 {
34353441 struct hnae3_handle *nic = &hdev->nic;
34363442 struct hclge_vf_to_pf_msg send_msg;
3443+ int ret;
34373444
34383445 rtnl_lock();
3439− hclgevf_notify_client(hdev, HNAE3_DOWN_CLIENT);
3440− rtnl_unlock();
3446+
3447+ if (test_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state) ||
3448+ test_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state)) {
3449+ dev_warn(&hdev->pdev->dev,
3450+ "is resetting when updating port based vlan info\n");
3451+ rtnl_unlock();
3452+ return;
3453+ }
3454+
3455+ ret = hclgevf_notify_client(hdev, HNAE3_DOWN_CLIENT);
3456+ if (ret) {
3457+ rtnl_unlock();
3458+ return;
3459+ }
34413460
34423461 /* send msg to PF and wait update port based vlan info */
34433462 hclgevf_build_send_msg(&send_msg, HCLGE_MBX_SET_VLAN,
34443463 HCLGE_MBX_PORT_BASE_VLAN_CFG);
34453464 memcpy(send_msg.data, port_base_vlan_info, data_size);
3446− hclgevf_send_mbx_msg(hdev, &send_msg, false, NULL, 0);
3447−
3448− if (state == HNAE3_PORT_BASE_VLAN_DISABLE)
3449− nic->port_base_vlan_state = HNAE3_PORT_BASE_VLAN_DISABLE;
3450− else
3451− nic->port_base_vlan_state = HNAE3_PORT_BASE_VLAN_ENABLE;
3465+ ret = hclgevf_send_mbx_msg(hdev, &send_msg, false, NULL, 0);
3466+ if (!ret) {
3467+ if (state == HNAE3_PORT_BASE_VLAN_DISABLE)
3468+ nic->port_base_vlan_state = state;
3469+ else
3470+ nic->port_base_vlan_state = HNAE3_PORT_BASE_VLAN_ENABLE;
3471+ }
34523472
3453− rtnl_lock();
34543473 hclgevf_notify_client(hdev, HNAE3_UP_CLIENT);
34553474 rtnl_unlock();
34563475 }
drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c+2−0
@@ -814,6 +814,8 @@ err_aeqs_init: · 813 unmodified lines
814814 err_init_msix:
815815 err_pfhwdev_alloc:
816816 hinic_free_hwif(hwif);
817+ if (err > 0)
818+ err = -EIO;
817819 return ERR_PTR(err);
818820 }
819821
drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c+72−19
@@ -370,48 +370,89 @@ int hinic_msg_to_mgmt(struct hinic_pf_to_mgmt *pf_to_mgmt, · 369 unmodified lines
370370 MSG_NOT_RESP, timeout);
371371 }
372372
373−/**
374− * mgmt_recv_msg_handler - handler for message from mgmt cpu
375− * @pf_to_mgmt: PF to MGMT channel
376− * @recv_msg: received message details
377− **/
378−static void mgmt_recv_msg_handler(struct hinic_pf_to_mgmt *pf_to_mgmt,
379− struct hinic_recv_msg *recv_msg)
373+static void recv_mgmt_msg_work_handler(struct work_struct *work)
380374 {
381− struct hinic_hwif *hwif = pf_to_mgmt->hwif;
382− struct pci_dev *pdev = hwif->pdev;
383− u8 *buf_out = recv_msg->buf_out;
375+ struct hinic_mgmt_msg_handle_work *mgmt_work =
376+ container_of(work, struct hinic_mgmt_msg_handle_work, work);
377+ struct hinic_pf_to_mgmt *pf_to_mgmt = mgmt_work->pf_to_mgmt;
378+ struct pci_dev *pdev = pf_to_mgmt->hwif->pdev;
379+ u8 *buf_out = pf_to_mgmt->mgmt_ack_buf;
384380 struct hinic_mgmt_cb *mgmt_cb;
385381 unsigned long cb_state;
386382 u16 out_size = 0;
387383
388− if (recv_msg->mod >= HINIC_MOD_MAX) {
384+ memset(buf_out, 0, MAX_PF_MGMT_BUF_SIZE);
385+
386+ if (mgmt_work->mod >= HINIC_MOD_MAX) {
389387 dev_err(&pdev->dev, "Unknown MGMT MSG module = %d\n",
390− recv_msg->mod);
388+ mgmt_work->mod);
389+ kfree(mgmt_work->msg);
390+ kfree(mgmt_work);
391391 return;
392392 }
393393
394− mgmt_cb = &pf_to_mgmt->mgmt_cb[recv_msg->mod];
394+ mgmt_cb = &pf_to_mgmt->mgmt_cb[mgmt_work->mod];
395395
396396 cb_state = cmpxchg(&mgmt_cb->state,
397397 HINIC_MGMT_CB_ENABLED,
398398 HINIC_MGMT_CB_ENABLED | HINIC_MGMT_CB_RUNNING);
399399
400400 if ((cb_state == HINIC_MGMT_CB_ENABLED) && (mgmt_cb->cb))
401− mgmt_cb->cb(mgmt_cb->handle, recv_msg->cmd,
402− recv_msg->msg, recv_msg->msg_len,
401+ mgmt_cb->cb(mgmt_cb->handle, mgmt_work->cmd,
402+ mgmt_work->msg, mgmt_work->msg_len,
403403 buf_out, &out_size);
404404 else
405405 dev_err(&pdev->dev, "No MGMT msg handler, mod: %d, cmd: %d\n",
406− recv_msg->mod, recv_msg->cmd);
406+ mgmt_work->mod, mgmt_work->cmd);
407407
408408 mgmt_cb->state &= ~HINIC_MGMT_CB_RUNNING;
409409
410− if (!recv_msg->async_mgmt_to_pf)
410+ if (!mgmt_work->async_mgmt_to_pf)
411411 /* MGMT sent sync msg, send the response */
412− msg_to_mgmt_async(pf_to_mgmt, recv_msg->mod, recv_msg->cmd,
412+ msg_to_mgmt_async(pf_to_mgmt, mgmt_work->mod, mgmt_work->cmd,
413413 buf_out, out_size, MGMT_RESP,
414− recv_msg->msg_id);
414+ mgmt_work->msg_id);
415+
416+ kfree(mgmt_work->msg);
417+ kfree(mgmt_work);
418+}
419+
420+/**
421+ * mgmt_recv_msg_handler - handler for message from mgmt cpu
422+ * @pf_to_mgmt: PF to MGMT channel
423+ * @recv_msg: received message details
424+ **/
425+static void mgmt_recv_msg_handler(struct hinic_pf_to_mgmt *pf_to_mgmt,
426+ struct hinic_recv_msg *recv_msg)
427+{
428+ struct hinic_mgmt_msg_handle_work *mgmt_work = NULL;
429+ struct pci_dev *pdev = pf_to_mgmt->hwif->pdev;
430+
431+ mgmt_work = kzalloc(sizeof(*mgmt_work), GFP_KERNEL);
432+ if (!mgmt_work) {
433+ dev_err(&pdev->dev, "Allocate mgmt work memory failed\n");
434+ return;
435+ }
436+
437+ if (recv_msg->msg_len) {
438+ mgmt_work->msg = kzalloc(recv_msg->msg_len, GFP_KERNEL);
439+ if (!mgmt_work->msg) {
440+ dev_err(&pdev->dev, "Allocate mgmt msg memory failed\n");
441+ kfree(mgmt_work);
442+ return;
443+ }
444+ }
445+
446+ mgmt_work->pf_to_mgmt = pf_to_mgmt;
447+ mgmt_work->msg_len = recv_msg->msg_len;
448+ memcpy(mgmt_work->msg, recv_msg->msg, recv_msg->msg_len);
449+ mgmt_work->msg_id = recv_msg->msg_id;
450+ mgmt_work->mod = recv_msg->mod;
451+ mgmt_work->cmd = recv_msg->cmd;
452+ mgmt_work->async_mgmt_to_pf = recv_msg->async_mgmt_to_pf;
453+
454+ INIT_WORK(&mgmt_work->work, recv_mgmt_msg_work_handler);
455+ queue_work(pf_to_mgmt->workq, &mgmt_work->work);
415456 }
416457
417458 /**
@@ -546,6 +587,12 @@ static int alloc_msg_buf(struct hinic_pf_to_mgmt *pf_to_mgmt) · 128 unmodified lines
546587 if (!pf_to_mgmt->sync_msg_buf)
547588 return -ENOMEM;
548589
590+ pf_to_mgmt->mgmt_ack_buf = devm_kzalloc(&pdev->dev,
591+ MAX_PF_MGMT_BUF_SIZE,
592+ GFP_KERNEL);
593+ if (!pf_to_mgmt->mgmt_ack_buf)
594+ return -ENOMEM;
595+
549596 return 0;
550597 }
551598
@@ -571,6 +618,11 @@ int hinic_pf_to_mgmt_init(struct hinic_pf_to_mgmt *pf_to_mgmt, · 19 unmodified lines
571618 return 0;
572619
573620 sema_init(&pf_to_mgmt->sync_msg_lock, 1);
621+ pf_to_mgmt->workq = create_singlethread_workqueue("hinic_mgmt");
622+ if (!pf_to_mgmt->workq) {
623+ dev_err(&pdev->dev, "Failed to initialize MGMT workqueue\n");
624+ return -ENOMEM;
625+ }
574626 pf_to_mgmt->sync_msg_id = 0;
575627
576628 err = alloc_msg_buf(pf_to_mgmt);
@@ -605,4 +657,5 @@ void hinic_pf_to_mgmt_free(struct hinic_pf_to_mgmt *pf_to_mgmt) · 28 unmodified lines
605657
606658 hinic_aeq_unregister_hw_cb(&hwdev->aeqs, HINIC_MSG_FROM_MGMT_CPU);
607659 hinic_api_cmd_free(pf_to_mgmt->cmd_chain);
660+ destroy_workqueue(pf_to_mgmt->workq);
608661 }
drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.h+16−0
@@ -119,6 +119,7 @@ struct hinic_pf_to_mgmt { · 118 unmodified lines
119119 struct semaphore sync_msg_lock;
120120 u16 sync_msg_id;
121121 u8 *sync_msg_buf;
122+ void *mgmt_ack_buf;
122123
123124 struct hinic_recv_msg recv_resp_msg_from_mgmt;
124125 struct hinic_recv_msg recv_msg_from_mgmt;
@@ -126,6 +127,21 @@ struct hinic_pf_to_mgmt { · 1 unmodified line
126127 struct hinic_api_cmd_chain *cmd_chain[HINIC_API_CMD_MAX];
127128
128129 struct hinic_mgmt_cb mgmt_cb[HINIC_MOD_MAX];
130+
131+ struct workqueue_struct *workq;
132+};
133+
134+struct hinic_mgmt_msg_handle_work {
135+ struct work_struct work;
136+ struct hinic_pf_to_mgmt *pf_to_mgmt;
137+
138+ void *msg;
139+ u16 msg_len;
140+
141+ enum hinic_mod_type mod;
142+ u8 cmd;
143+ u16 msg_id;
144+ int async_mgmt_to_pf;
129145 };
130146
131147 void hinic_register_mgmt_msg_cb(struct hinic_pf_to_mgmt *pf_to_mgmt,
drivers/net/ethernet/ibm/ibmvnic.c+1−1
@@ -3206,7 +3206,7 @@ req_rx_irq_failed: · 3205 unmodified lines
32063206 req_tx_irq_failed:
32073207 for (j = 0; j < i; j++) {
32083208 free_irq(adapter->tx_scrq[j]->irq, adapter->tx_scrq[j]);
3209− irq_dispose_mapping(adapter->rx_scrq[j]->irq);
3209+ irq_dispose_mapping(adapter->tx_scrq[j]->irq);
32103210 }
32113211 release_sub_crqs(adapter, 1);
32123212 return rc;
drivers/net/ethernet/intel/e1000e/ich8lan.c+1−3
@@ -301,10 +301,8 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) · 300 unmodified lines
301301 */
302302 hw->dev_spec.ich8lan.ulp_state = e1000_ulp_state_unknown;
303303 ret_val = e1000_disable_ulp_lpt_lp(hw, true);
304− if (ret_val) {
304+ if (ret_val)
305305 e_warn("Failed to disable ULP\n");
306− goto out;
307− }
308306
309307 ret_val = hw->phy.ops.acquire(hw);
310308 if (ret_val) {
drivers/net/ethernet/intel/igb/igb_main.c+9−0
@@ -6224,9 +6224,18 @@ static void igb_reset_task(struct work_struct *work) · 6223 unmodified lines
62246224 struct igb_adapter *adapter;
62256225 adapter = container_of(work, struct igb_adapter, reset_task);
62266226
6227+ rtnl_lock();
6228+ /* If we're already down or resetting, just bail */
6229+ if (test_bit(__IGB_DOWN, &adapter->state) ||
6230+ test_bit(__IGB_RESETTING, &adapter->state)) {
6231+ rtnl_unlock();
6232+ return;
6233+ }
6234+
62276235 igb_dump(adapter);
62286236 netdev_err(adapter->netdev, "Reset adapter\n");
62296237 igb_reinit_locked(adapter);
6238+ rtnl_unlock();
62306239 }
62316240
62326241 /**
drivers/net/ethernet/marvell/mvneta.c+1−1
@@ -3959,7 +3959,7 @@ static void mvneta_mac_config(struct phylink_config *config, unsigned int mode, · 3958 unmodified lines
39593959 /* When at 2.5G, the link partner can send frames with shortened
39603960 * preambles.
39613961 */
3962− if (state->speed == SPEED_2500)
3962+ if (state->interface == PHY_INTERFACE_MODE_2500BASEX)
39633963 new_ctrl4 |= MVNETA_GMAC4_SHORT_PREAMBLE_ENABLE;
39643964
39653965 if (pp->phy_interface != state->interface) {
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c+3−0
@@ -1730,10 +1730,12 @@ static void otx2_reset_task(struct work_struct *work) · 1729 unmodified lines
17301730 if (!netif_running(pf->netdev))
17311731 return;
17321732
1733+ rtnl_lock();
17331734 otx2_stop(pf->netdev);
17341735 pf->reset_count++;
17351736 otx2_open(pf->netdev);
17361737 netif_trans_update(pf->netdev);
1738+ rtnl_unlock();
17371739 }
17381740
17391741 static const struct net_device_ops otx2_netdev_ops = {
@@ -2111,6 +2113,7 @@ static void otx2_remove(struct pci_dev *pdev) · 371 unmodified lines
21112113
21122114 pf = netdev_priv(netdev);
21132115
2116+ cancel_work_sync(&pf->reset_task);
21142117 /* Disable link notifications */
21152118 otx2_cgx_config_linkevents(pf, false);
21162119
drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c+2−0
@@ -617,6 +617,8 @@ static void otx2vf_remove(struct pci_dev *pdev) · 616 unmodified lines
617617
618618 vf = netdev_priv(netdev);
619619
620+ cancel_work_sync(&vf->reset_task);
621+ unregister_netdev(netdev);
620622 otx2vf_disable_mbox_intr(vf);
621623
622624 otx2_detach_resources(&vf->mbox);
drivers/net/ethernet/marvell/sky2.c+1−1
@@ -203,7 +203,7 @@ io_error: · 202 unmodified lines
203203
204204 static inline u16 gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg)
205205 {
206− u16 v;
206+ u16 v = 0;
207207 __gm_phy_read(hw, port, reg, &v);
208208 return v;
209209 }
drivers/net/ethernet/mediatek/mtk_eth_soc.c+16−5
@@ -171,11 +171,21 @@ static int mt7621_gmac0_rgmii_adjust(struct mtk_eth *eth, · 170 unmodified lines
171171 return 0;
172172 }
173173
174−static void mtk_gmac0_rgmii_adjust(struct mtk_eth *eth, int speed)
174+static void mtk_gmac0_rgmii_adjust(struct mtk_eth *eth,
175+ phy_interface_t interface, int speed)
175176 {
176177 u32 val;
177178 int ret;
178179
180+ if (interface == PHY_INTERFACE_MODE_TRGMII) {
181+ mtk_w32(eth, TRGMII_MODE, INTF_MODE);
182+ val = 500000000;
183+ ret = clk_set_rate(eth->clks[MTK_CLK_TRGPLL], val);
184+ if (ret)
185+ dev_err(eth->dev, "Failed to set trgmii pll: %d\n", ret);
186+ return;
187+ }
188+
179189 val = (speed == SPEED_1000) ?
180190 INTF_MODE_RGMII_1000 : INTF_MODE_RGMII_10_100;
181191 mtk_w32(eth, val, INTF_MODE);
@@ -262,10 +272,9 @@ static void mtk_mac_config(struct phylink_config *config, unsigned int mode, · 80 unmodified lines
262272 state->interface))
263273 goto err_phy;
264274 } else {
265− if (state->interface !=
266− PHY_INTERFACE_MODE_TRGMII)
267− mtk_gmac0_rgmii_adjust(mac->hw,
268− state->speed);
275+ mtk_gmac0_rgmii_adjust(mac->hw,
276+ state->interface,
277+ state->speed);
269278
270279 /* mt7623_pad_clk_setup */
271280 for (i = 0 ; i < NUM_TRGMII_CTRL; i++)
@@ -2882,6 +2891,8 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) · 2610 unmodified lines
28822891 eth->netdev[id]->irq = eth->irq[0];
28832892 eth->netdev[id]->dev.of_node = np;
28842893
2894+ eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH - MTK_RX_ETH_HLEN;
2895+
28852896 return 0;
28862897
28872898 free_netdev:
drivers/net/ethernet/mellanox/mlx4/main.c+2−0
@@ -4356,12 +4356,14 @@ end: · 4355 unmodified lines
43564356 static void mlx4_shutdown(struct pci_dev *pdev)
43574357 {
43584358 struct mlx4_dev_persistent *persist = pci_get_drvdata(pdev);
4359+ struct mlx4_dev *dev = persist->dev;
43594360
43604361 mlx4_info(persist->dev, "mlx4_shutdown was called\n");
43614362 mutex_lock(&persist->interface_state_mutex);
43624363 if (persist->interface_state & MLX4_INTERFACE_STATE_UP)
43634364 mlx4_unload_one(pdev);
43644365 mutex_unlock(&persist->interface_state_mutex);
4366+ mlx4_pci_disable_device(dev);
43654367 }
43664368
43674369 static const struct pci_error_handlers mlx4_err_handler = {
drivers/net/ethernet/mellanox/mlx5/core/en/dcbnl.h+1−0
@@ -29,6 +29,7 @@ struct mlx5e_dcbx { · 28 unmodified lines
2929 bool manual_buffer;
3030 u32 cable_len;
3131 u32 xoff;
32+ u16 port_buff_cell_sz;
3233 };
3334
3435 #define MLX5E_MAX_DSCP (64)
drivers/net/ethernet/mellanox/mlx5/core/en/port.c+18−3
@@ -78,11 +78,26 @@ static const u32 mlx5e_ext_link_speed[MLX5E_EXT_LINK_MODES_NUMBER] = { · 77 unmodified lines
7878 [MLX5E_400GAUI_8] = 400000,
7979 };
8080
81+bool mlx5e_ptys_ext_supported(struct mlx5_core_dev *mdev)
82+{
83+ struct mlx5e_port_eth_proto eproto;
84+ int err;
85+
86+ if (MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet))
87+ return true;
88+
89+ err = mlx5_port_query_eth_proto(mdev, 1, true, &eproto);
90+ if (err)
91+ return false;
92+
93+ return !!eproto.cap;
94+}
95+
8196 static void mlx5e_port_get_speed_arr(struct mlx5_core_dev *mdev,
8297 const u32 **arr, u32 *size,
8398 bool force_legacy)
8499 {
85− bool ext = force_legacy ? false : MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
100+ bool ext = force_legacy ? false : mlx5e_ptys_ext_supported(mdev);
86101
87102 *size = ext ? ARRAY_SIZE(mlx5e_ext_link_speed) :
88103 ARRAY_SIZE(mlx5e_link_speed);
@@ -177,7 +192,7 @@ int mlx5e_port_linkspeed(struct mlx5_core_dev *mdev, u32 *speed) · 88 unmodified lines
177192 bool ext;
178193 int err;
179194
180− ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
195+ ext = mlx5e_ptys_ext_supported(mdev);
181196 err = mlx5_port_query_eth_proto(mdev, 1, ext, &eproto);
182197 if (err)
183198 goto out;
@@ -205,7 +220,7 @@ int mlx5e_port_max_linkspeed(struct mlx5_core_dev *mdev, u32 *speed) · 21 unmodified lines
205220 int err;
206221 int i;
207222
208− ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
223+ ext = mlx5e_ptys_ext_supported(mdev);
209224 err = mlx5_port_query_eth_proto(mdev, 1, ext, &eproto);
210225 if (err)
211226 return err;
drivers/net/ethernet/mellanox/mlx5/core/en/port.h+1−1
@@ -54,7 +54,7 @@ int mlx5e_port_linkspeed(struct mlx5_core_dev *mdev, u32 *speed); · 53 unmodified lines
5454 int mlx5e_port_max_linkspeed(struct mlx5_core_dev *mdev, u32 *speed);
5555 u32 mlx5e_port_speed2linkmodes(struct mlx5_core_dev *mdev, u32 speed,
5656 bool force_legacy);
57−
57+bool mlx5e_ptys_ext_supported(struct mlx5_core_dev *mdev);
5858 int mlx5e_port_query_pbmc(struct mlx5_core_dev *mdev, void *out);
5959 int mlx5e_port_set_pbmc(struct mlx5_core_dev *mdev, void *in);
6060 int mlx5e_port_query_priority2buffer(struct mlx5_core_dev *mdev, u8 *buffer);
drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.c+29−24
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 int mlx5e_port_query_buffer(struct mlx5e_priv *priv,
3535 struct mlx5e_port_buffer *port_buffer)
3636 {
37+ u16 port_buff_cell_sz = priv->dcbx.port_buff_cell_sz;
3738 struct mlx5_core_dev *mdev = priv->mdev;
3839 int sz = MLX5_ST_SZ_BYTES(pbmc_reg);
3940 u32 total_used = 0;
@@ -57,11 +58,11 @@ int mlx5e_port_query_buffer(struct mlx5e_priv *priv, · 17 unmodified lines
5758 port_buffer->buffer[i].epsb =
5859 MLX5_GET(bufferx_reg, buffer, epsb);
5960 port_buffer->buffer[i].size =
60− MLX5_GET(bufferx_reg, buffer, size) << MLX5E_BUFFER_CELL_SHIFT;
61+ MLX5_GET(bufferx_reg, buffer, size) * port_buff_cell_sz;
6162 port_buffer->buffer[i].xon =
62− MLX5_GET(bufferx_reg, buffer, xon_threshold) << MLX5E_BUFFER_CELL_SHIFT;
63+ MLX5_GET(bufferx_reg, buffer, xon_threshold) * port_buff_cell_sz;
6364 port_buffer->buffer[i].xoff =
64− MLX5_GET(bufferx_reg, buffer, xoff_threshold) << MLX5E_BUFFER_CELL_SHIFT;
65+ MLX5_GET(bufferx_reg, buffer, xoff_threshold) * port_buff_cell_sz;
6566 total_used += port_buffer->buffer[i].size;
6667
6768 mlx5e_dbg(HW, priv, "buffer %d: size=%d, xon=%d, xoff=%d, epsb=%d, lossy=%d\n", i,
@@ -73,7 +74,7 @@ int mlx5e_port_query_buffer(struct mlx5e_priv *priv, · 5 unmodified lines
7374 }
7475
7576 port_buffer->port_buffer_size =
76− MLX5_GET(pbmc_reg, out, port_buffer_size) << MLX5E_BUFFER_CELL_SHIFT;
77+ MLX5_GET(pbmc_reg, out, port_buffer_size) * port_buff_cell_sz;
7778 port_buffer->spare_buffer_size =
7879 port_buffer->port_buffer_size - total_used;
7980
@@ -88,9 +89,9 @@ out: · 8 unmodified lines
8889 static int port_set_buffer(struct mlx5e_priv *priv,
8990 struct mlx5e_port_buffer *port_buffer)
9091 {
92+ u16 port_buff_cell_sz = priv->dcbx.port_buff_cell_sz;
9193 struct mlx5_core_dev *mdev = priv->mdev;
9294 int sz = MLX5_ST_SZ_BYTES(pbmc_reg);
93− void *buffer;
9495 void *in;
9596 int err;
9697 int i;
@@ -104,16 +105,18 @@ static int port_set_buffer(struct mlx5e_priv *priv, · 7 unmodified lines
104105 goto out;
105106
106107 for (i = 0; i < MLX5E_MAX_BUFFER; i++) {
107− buffer = MLX5_ADDR_OF(pbmc_reg, in, buffer[i]);
108−
109− MLX5_SET(bufferx_reg, buffer, size,
110− port_buffer->buffer[i].size >> MLX5E_BUFFER_CELL_SHIFT);
111− MLX5_SET(bufferx_reg, buffer, lossy,
112− port_buffer->buffer[i].lossy);
113− MLX5_SET(bufferx_reg, buffer, xoff_threshold,
114− port_buffer->buffer[i].xoff >> MLX5E_BUFFER_CELL_SHIFT);
115− MLX5_SET(bufferx_reg, buffer, xon_threshold,
116− port_buffer->buffer[i].xon >> MLX5E_BUFFER_CELL_SHIFT);
108+ void *buffer = MLX5_ADDR_OF(pbmc_reg, in, buffer[i]);
109+ u64 size = port_buffer->buffer[i].size;
110+ u64 xoff = port_buffer->buffer[i].xoff;
111+ u64 xon = port_buffer->buffer[i].xon;
112+
113+ do_div(size, port_buff_cell_sz);
114+ do_div(xoff, port_buff_cell_sz);
115+ do_div(xon, port_buff_cell_sz);
116+ MLX5_SET(bufferx_reg, buffer, size, size);
117+ MLX5_SET(bufferx_reg, buffer, lossy, port_buffer->buffer[i].lossy);
118+ MLX5_SET(bufferx_reg, buffer, xoff_threshold, xoff);
119+ MLX5_SET(bufferx_reg, buffer, xon_threshold, xon);
117120 }
118121
119122 err = mlx5e_port_set_pbmc(mdev, in);
@@ -143,7 +146,7 @@ static u32 calculate_xoff(struct mlx5e_priv *priv, unsigned int mtu) · 23 unmodified lines
143146 }
144147
145148 static int update_xoff_threshold(struct mlx5e_port_buffer *port_buffer,
146− u32 xoff, unsigned int max_mtu)
149+ u32 xoff, unsigned int max_mtu, u16 port_buff_cell_sz)
147150 {
148151 int i;
149152
@@ -155,7 +158,7 @@ static int update_xoff_threshold(struct mlx5e_port_buffer *port_buffer, · 5 unmodified lines
155158 }
156159
157160 if (port_buffer->buffer[i].size <
158− (xoff + max_mtu + (1 << MLX5E_BUFFER_CELL_SHIFT))) {
161+ (xoff + max_mtu + port_buff_cell_sz)) {
159162 pr_err("buffer_size[%d]=%d is not enough for lossless buffer\n",
160163 i, port_buffer->buffer[i].size);
161164 return -ENOMEM;
@@ -175,6 +178,7 @@ static int update_xoff_threshold(struct mlx5e_port_buffer *port_buffer, · 13 unmodified lines
175178 * @pfc_en: <input> current pfc configuration
176179 * @buffer: <input> current prio to buffer mapping
177180 * @xoff: <input> xoff value
181+ * @port_buff_cell_sz: <input> port buffer cell_size
178182 * @port_buffer: <output> port receive buffer configuration
179183 * @change: <output>
180184 *
@@ -189,7 +193,7 @@ static int update_xoff_threshold(struct mlx5e_port_buffer *port_buffer, · 8 unmodified lines
189193 * sets change to true if buffer configuration was modified.
190194 */
191195 static int update_buffer_lossy(unsigned int max_mtu,
192− u8 pfc_en, u8 *buffer, u32 xoff,
196+ u8 pfc_en, u8 *buffer, u32 xoff, u16 port_buff_cell_sz,
193197 struct mlx5e_port_buffer *port_buffer,
194198 bool *change)
195199 {
@@ -225,7 +229,7 @@ static int update_buffer_lossy(unsigned int max_mtu, · 29 unmodified lines
225229 }
226230
227231 if (changed) {
228− err = update_xoff_threshold(port_buffer, xoff, max_mtu);
232+ err = update_xoff_threshold(port_buffer, xoff, max_mtu, port_buff_cell_sz);
229233 if (err)
230234 return err;
231235
@@ -262,6 +266,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv, · 30 unmodified lines
262266 u32 *buffer_size,
263267 u8 *prio2buffer)
264268 {
269+ u16 port_buff_cell_sz = priv->dcbx.port_buff_cell_sz;
265270 struct mlx5e_port_buffer port_buffer;
266271 u32 xoff = calculate_xoff(priv, mtu);
267272 bool update_prio2buffer = false;
@@ -282,7 +287,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv, · 14 unmodified lines
282287
283288 if (change & MLX5E_PORT_BUFFER_CABLE_LEN) {
284289 update_buffer = true;
285− err = update_xoff_threshold(&port_buffer, xoff, max_mtu);
290+ err = update_xoff_threshold(&port_buffer, xoff, max_mtu, port_buff_cell_sz);
286291 if (err)
287292 return err;
288293 }
@@ -292,7 +297,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv, · 3 unmodified lines
292297 if (err)
293298 return err;
294299
295− err = update_buffer_lossy(max_mtu, pfc->pfc_en, buffer, xoff,
300+ err = update_buffer_lossy(max_mtu, pfc->pfc_en, buffer, xoff, port_buff_cell_sz,
296301 &port_buffer, &update_buffer);
297302 if (err)
298303 return err;
@@ -304,7 +309,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv, · 5 unmodified lines
304309 if (err)
305310 return err;
306311
307− err = update_buffer_lossy(max_mtu, curr_pfc_en, prio2buffer,
312+ err = update_buffer_lossy(max_mtu, curr_pfc_en, prio2buffer, port_buff_cell_sz,
308313 xoff, &port_buffer, &update_buffer);
309314 if (err)
310315 return err;
@@ -329,7 +334,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv, · 18 unmodified lines
329334 return -EINVAL;
330335
331336 update_buffer = true;
332− err = update_xoff_threshold(&port_buffer, xoff, max_mtu);
337+ err = update_xoff_threshold(&port_buffer, xoff, max_mtu, port_buff_cell_sz);
333338 if (err)
334339 return err;
335340 }
@@ -337,7 +342,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv, · 1 unmodified line
337342 /* Need to update buffer configuration if xoff value is changed */
338343 if (!update_buffer && xoff != priv->dcbx.xoff) {
339344 update_buffer = true;
340− err = update_xoff_threshold(&port_buffer, xoff, max_mtu);
345+ err = update_xoff_threshold(&port_buffer, xoff, max_mtu, port_buff_cell_sz);
341346 if (err)
342347 return err;
343348 }
drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.h+0−1
@@ -36,7 +36,6 @@ · 35 unmodified lines
3636 #include "port.h"
3737
3838 #define MLX5E_MAX_BUFFER 8
39−#define MLX5E_BUFFER_CELL_SHIFT 7
4039 #define MLX5E_DEFAULT_CABLE_LEN 7 /* 7 meters */
4140
4241 #define MLX5_BUFFER_SUPPORTED(mdev) (MLX5_CAP_GEN(mdev, pcam_reg) && \
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bond.c+5−2
@@ -183,13 +183,16 @@ void mlx5e_rep_bond_unslave(struct mlx5_eswitch *esw, · 182 unmodified lines
183183
184184 static bool mlx5e_rep_is_lag_netdev(struct net_device *netdev)
185185 {
186− struct mlx5e_priv *priv = netdev_priv(netdev);
187− struct mlx5e_rep_priv *rpriv = priv->ppriv;
186+ struct mlx5e_rep_priv *rpriv;
187+ struct mlx5e_priv *priv;
188188
189189 /* A given netdev is not a representor or not a slave of LAG configuration */
190190 if (!mlx5e_eswitch_rep(netdev) || !bond_slave_get_rtnl(netdev))
191191 return false;
192192
193+ priv = netdev_priv(netdev);
194+ rpriv = priv->ppriv;
195+
193196 /* Egress acl forward to vport is supported only non-uplink representor */
194197 return rpriv->rep->vport != MLX5_VPORT_UPLINK;
195198 }
drivers/net/ethernet/mellanox/mlx5/core/en/rep/neigh.c+0−1
@@ -6,7 +6,6 @@ · 5 unmodified lines
66 #include <linux/rculist.h>
77 #include <linux/rtnetlink.h>
88 #include <linux/workqueue.h>
9−#include <linux/rwlock.h>
109 #include <linux/spinlock.h>
1110 #include <linux/notifier.h>
1211 #include <net/netevent.h>
drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c+21−9
@@ -551,19 +551,31 @@ static bool mlx5e_restore_tunnel(struct mlx5e_priv *priv, struct sk_buff *skb, · 550 unmodified lines
551551 }
552552 }
553553
554− tun_dst = tun_rx_dst(enc_opts.key.len);
554+ if (key.enc_control.addr_type == FLOW_DISSECTOR_KEY_IPV4_ADDRS) {
555+ tun_dst = __ip_tun_set_dst(key.enc_ipv4.src, key.enc_ipv4.dst,
556+ key.enc_ip.tos, key.enc_ip.ttl,
557+ key.enc_tp.dst, TUNNEL_KEY,
558+ key32_to_tunnel_id(key.enc_key_id.keyid),
559+ enc_opts.key.len);
560+ } else if (key.enc_control.addr_type == FLOW_DISSECTOR_KEY_IPV6_ADDRS) {
561+ tun_dst = __ipv6_tun_set_dst(&key.enc_ipv6.src, &key.enc_ipv6.dst,
562+ key.enc_ip.tos, key.enc_ip.ttl,
563+ key.enc_tp.dst, 0, TUNNEL_KEY,
564+ key32_to_tunnel_id(key.enc_key_id.keyid),
565+ enc_opts.key.len);
566+ } else {
567+ netdev_dbg(priv->netdev,
568+ "Couldn't restore tunnel, unsupported addr_type: %d\n",
569+ key.enc_control.addr_type);
570+ return false;
571+ }
572+
555573 if (!tun_dst) {
556− WARN_ON_ONCE(true);
574+ netdev_dbg(priv->netdev, "Couldn't restore tunnel, no tun_dst\n");
557575 return false;
558576 }
559577
560− ip_tunnel_key_init(&tun_dst->u.tun_info.key,
561− key.enc_ipv4.src, key.enc_ipv4.dst,
562− key.enc_ip.tos, key.enc_ip.ttl,
563− 0, /* label */
564− key.enc_tp.src, key.enc_tp.dst,
565− key32_to_tunnel_id(key.enc_key_id.keyid),
566− TUNNEL_KEY);
578+ tun_dst->u.tun_info.key.tp_src = key.enc_tp.src;
567579
568580 if (enc_opts.key.len)
569581 ip_tunnel_info_opts_set(&tun_dst->u.tun_info,
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c+1−0
@@ -1097,6 +1097,7 @@ mlx5_tc_ct_flush_ft_entry(void *ptr, void *arg) · 1096 unmodified lines
10971097 struct mlx5_ct_entry *entry = ptr;
10981098
10991099 mlx5_tc_ct_entry_del_rules(ct_priv, entry);
1100+ kfree(entry);
11001101 }
11011102
11021103 static void
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c+2−0
@@ -301,6 +301,8 @@ static int mlx5e_tc_tun_parse_geneve_params(struct mlx5e_priv *priv, · 300 unmodified lines
301301 MLX5_SET(fte_match_set_misc, misc_v, geneve_protocol_type, ETH_P_TEB);
302302 }
303303
304+ spec->match_criteria_enable |= MLX5_MATCH_MISC_PARAMETERS;
305+
304306 return 0;
305307 }
306308
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_gre.c+2−0
@@ -80,6 +80,8 @@ static int mlx5e_tc_tun_parse_gretap(struct mlx5e_priv *priv, · 79 unmodified lines
8080 gre_key.key, be32_to_cpu(enc_keyid.key->keyid));
8181 }
8282
83+ spec->match_criteria_enable |= MLX5_MATCH_MISC_PARAMETERS;
84+
8385 return 0;
8486 }
8587
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_vxlan.c+2−0
@@ -136,6 +136,8 @@ static int mlx5e_tc_tun_parse_vxlan(struct mlx5e_priv *priv, · 135 unmodified lines
136136 MLX5_SET(fte_match_set_misc, misc_v, vxlan_vni,
137137 be32_to_cpu(enc_keyid.key->keyid));
138138
139+ spec->match_criteria_enable |= MLX5_MATCH_MISC_PARAMETERS;
140+
139141 return 0;
140142 }
141143
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c+19−0
@@ -1217,6 +1217,24 @@ static int mlx5e_trust_initialize(struct mlx5e_priv *priv) · 1216 unmodified lines
12171217 return 0;
12181218 }
12191219
1220+#define MLX5E_BUFFER_CELL_SHIFT 7
1221+
1222+static u16 mlx5e_query_port_buffers_cell_size(struct mlx5e_priv *priv)
1223+{
1224+ struct mlx5_core_dev *mdev = priv->mdev;
1225+ u32 out[MLX5_ST_SZ_DW(sbcam_reg)] = {};
1226+ u32 in[MLX5_ST_SZ_DW(sbcam_reg)] = {};
1227+
1228+ if (!MLX5_CAP_GEN(mdev, sbcam_reg))
1229+ return (1 << MLX5E_BUFFER_CELL_SHIFT);
1230+
1231+ if (mlx5_core_access_reg(mdev, in, sizeof(in), out, sizeof(out),
1232+ MLX5_REG_SBCAM, 0, 0))
1233+ return (1 << MLX5E_BUFFER_CELL_SHIFT);
1234+
1235+ return MLX5_GET(sbcam_reg, out, cap_cell_size);
1236+}
1237+
12201238 void mlx5e_dcbnl_initialize(struct mlx5e_priv *priv)
12211239 {
12221240 struct mlx5e_dcbx *dcbx = &priv->dcbx;
@@ -1234,6 +1252,7 @@ void mlx5e_dcbnl_initialize(struct mlx5e_priv *priv) · 11 unmodified lines
12341252 if (priv->dcbx.mode == MLX5E_DCBX_PARAM_VER_OPER_HOST)
12351253 priv->dcbx.cap |= DCB_CAP_DCBX_HOST;
12361254
1255+ priv->dcbx.port_buff_cell_sz = mlx5e_query_port_buffers_cell_size(priv);
12371256 priv->dcbx.manual_buffer = false;
12381257 priv->dcbx.cable_len = MLX5E_DEFAULT_CABLE_LEN;
12391258
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c+4−4
@@ -200,7 +200,7 @@ static void mlx5e_ethtool_get_speed_arr(struct mlx5_core_dev *mdev, · 199 unmodified lines
200200 struct ptys2ethtool_config **arr,
201201 u32 *size)
202202 {
203− bool ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
203+ bool ext = mlx5e_ptys_ext_supported(mdev);
204204
205205 *arr = ext ? ptys2ext_ethtool_table : ptys2legacy_ethtool_table;
206206 *size = ext ? ARRAY_SIZE(ptys2ext_ethtool_table) :
@@ -883,7 +883,7 @@ static void get_lp_advertising(struct mlx5_core_dev *mdev, u32 eth_proto_lp, · 676 unmodified lines
883883 struct ethtool_link_ksettings *link_ksettings)
884884 {
885885 unsigned long *lp_advertising = link_ksettings->link_modes.lp_advertising;
886− bool ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
886+ bool ext = mlx5e_ptys_ext_supported(mdev);
887887
888888 ptys2ethtool_adver_link(lp_advertising, eth_proto_lp, ext);
889889 }
@@ -913,7 +913,7 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, · 23 unmodified lines
913913 __func__, err);
914914 goto err_query_regs;
915915 }
916− ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
916+ ext = !!MLX5_GET_ETH_PROTO(ptys_reg, out, true, eth_proto_capability);
917917 eth_proto_cap = MLX5_GET_ETH_PROTO(ptys_reg, out, ext,
918918 eth_proto_capability);
919919 eth_proto_admin = MLX5_GET_ETH_PROTO(ptys_reg, out, ext,
@@ -1066,7 +1066,7 @@ int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv, · 146 unmodified lines
10661066 autoneg = link_ksettings->base.autoneg;
10671067 speed = link_ksettings->base.speed;
10681068
1069− ext_supported = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
1069+ ext_supported = mlx5e_ptys_ext_supported(mdev);
10701070 ext = ext_requested(autoneg, adver, ext_supported);
10711071 if (!ext_supported && ext)
10721072 return -EOPNOTSUPP;
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+34−12
@@ -419,7 +419,7 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c, · 418 unmodified lines
419419 err = mlx5_wq_ll_create(mdev, &rqp->wq, rqc_wq, &rq->mpwqe.wq,
420420 &rq->wq_ctrl);
421421 if (err)
422− return err;
422+ goto err_rq_wq_destroy;
423423
424424 rq->mpwqe.wq.db = &rq->mpwqe.wq.db[MLX5_RCV_DBR];
425425
@@ -470,7 +470,7 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c, · 44 unmodified lines
470470 err = mlx5_wq_cyc_create(mdev, &rqp->wq, rqc_wq, &rq->wqe.wq,
471471 &rq->wq_ctrl);
472472 if (err)
473− return err;
473+ goto err_rq_wq_destroy;
474474
475475 rq->wqe.wq.db = &rq->wqe.wq.db[MLX5_RCV_DBR];
476476
@@ -3069,6 +3069,25 @@ void mlx5e_timestamp_init(struct mlx5e_priv *priv) · 2592 unmodified lines
30693069 priv->tstamp.rx_filter = HWTSTAMP_FILTER_NONE;
30703070 }
30713071
3072+static void mlx5e_modify_admin_state(struct mlx5_core_dev *mdev,
3073+ enum mlx5_port_status state)
3074+{
3075+ struct mlx5_eswitch *esw = mdev->priv.eswitch;
3076+ int vport_admin_state;
3077+
3078+ mlx5_set_port_admin_status(mdev, state);
3079+
3080+ if (!MLX5_ESWITCH_MANAGER(mdev) || mlx5_eswitch_mode(esw) == MLX5_ESWITCH_OFFLOADS)
3081+ return;
3082+
3083+ if (state == MLX5_PORT_UP)
3084+ vport_admin_state = MLX5_VPORT_ADMIN_STATE_AUTO;
3085+ else
3086+ vport_admin_state = MLX5_VPORT_ADMIN_STATE_DOWN;
3087+
3088+ mlx5_eswitch_set_vport_state(esw, MLX5_VPORT_UPLINK, vport_admin_state);
3089+}
3090+
30723091 int mlx5e_open_locked(struct net_device *netdev)
30733092 {
30743093 struct mlx5e_priv *priv = netdev_priv(netdev);
@@ -3101,12 +3120,9 @@ int mlx5e_open(struct net_device *netdev) · 26 unmodified lines
31013120 mutex_lock(&priv->state_lock);
31023121 err = mlx5e_open_locked(netdev);
31033122 if (!err)
3104− mlx5_set_port_admin_status(priv->mdev, MLX5_PORT_UP);
3123+ mlx5e_modify_admin_state(priv->mdev, MLX5_PORT_UP);
31053124 mutex_unlock(&priv->state_lock);
31063125
3107− if (mlx5_vxlan_allowed(priv->mdev->vxlan))
3108− udp_tunnel_get_rx_info(netdev);
3109−
31103126 return err;
31113127 }
31123128
@@ -3138,7 +3154,7 @@ int mlx5e_close(struct net_device *netdev) · 25 unmodified lines
31383154 return -ENODEV;
31393155
31403156 mutex_lock(&priv->state_lock);
3141− mlx5_set_port_admin_status(priv->mdev, MLX5_PORT_DOWN);
3157+ mlx5e_modify_admin_state(priv->mdev, MLX5_PORT_DOWN);
31423158 err = mlx5e_close_locked(netdev);
31433159 mutex_unlock(&priv->state_lock);
31443160
@@ -5121,6 +5137,10 @@ static int mlx5e_init_nic_rx(struct mlx5e_priv *priv) · 1976 unmodified lines
51215137 if (err)
51225138 goto err_destroy_flow_steering;
51235139
5140+#ifdef CONFIG_MLX5_EN_ARFS
5141+ priv->netdev->rx_cpu_rmap = mlx5_eq_table_get_rmap(priv->mdev);
5142+#endif
5143+
51245144 return 0;
51255145
51265146 err_destroy_flow_steering:
@@ -5181,7 +5201,7 @@ static void mlx5e_nic_enable(struct mlx5e_priv *priv) · 54 unmodified lines
51815201
51825202 /* Marking the link as currently not needed by the Driver */
51835203 if (!netif_running(netdev))
5184− mlx5_set_port_admin_status(mdev, MLX5_PORT_DOWN);
5204+ mlx5e_modify_admin_state(mdev, MLX5_PORT_DOWN);
51855205
51865206 mlx5e_set_netdev_mtu_boundaries(priv);
51875207 mlx5e_set_dev_port_mtu(priv);
@@ -5202,6 +5222,8 @@ static void mlx5e_nic_enable(struct mlx5e_priv *priv) · 14 unmodified lines
52025222 rtnl_lock();
52035223 if (netif_running(netdev))
52045224 mlx5e_open(netdev);
5225+ if (mlx5_vxlan_allowed(priv->mdev->vxlan))
5226+ udp_tunnel_get_rx_info(netdev);
52055227 netif_device_attach(netdev);
52065228 rtnl_unlock();
52075229 }
@@ -5216,6 +5238,8 @@ static void mlx5e_nic_disable(struct mlx5e_priv *priv) · 8 unmodified lines
52165238 rtnl_lock();
52175239 if (netif_running(priv->netdev))
52185240 mlx5e_close(priv->netdev);
5241+ if (mlx5_vxlan_allowed(priv->mdev->vxlan))
5242+ udp_tunnel_drop_rx_info(priv->netdev);
52195243 netif_device_detach(priv->netdev);
52205244 rtnl_unlock();
52215245
@@ -5288,10 +5312,6 @@ int mlx5e_netdev_init(struct net_device *netdev, · 66 unmodified lines
52885312 /* netdev init */
52895313 netif_carrier_off(netdev);
52905314
5291−#ifdef CONFIG_MLX5_EN_ARFS
5292− netdev->rx_cpu_rmap = mlx5_eq_table_get_rmap(mdev);
5293−#endif
5294−
52955315 return 0;
52965316
52975317 err_free_cpumask:
@@ -5389,6 +5409,8 @@ err_cleanup_tx: · 91 unmodified lines
53895409 profile->cleanup_tx(priv);
53905410
53915411 out:
5412+ set_bit(MLX5E_STATE_DESTROYING, &priv->state);
5413+ cancel_work_sync(&priv->update_stats_work);
53925414 return err;
53935415 }
53945416
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+3−0
@@ -936,6 +936,7 @@ err_close_drop_rq: · 935 unmodified lines
936936
937937 static void mlx5e_cleanup_rep_rx(struct mlx5e_priv *priv)
938938 {
939+ mlx5e_ethtool_cleanup_steering(priv);
939940 rep_vport_rx_rule_destroy(priv);
940941 mlx5e_destroy_rep_root_ft(priv);
941942 mlx5e_destroy_ttc_table(priv, &priv->fs.ttc);
@@ -1080,6 +1081,8 @@ static void mlx5e_uplink_rep_enable(struct mlx5e_priv *priv) · 138 unmodified lines
10801081
10811082 mlx5e_rep_tc_enable(priv);
10821083
1084+ mlx5_modify_vport_admin_state(mdev, MLX5_VPORT_STATE_OP_MOD_UPLINK,
1085+ 0, 0, MLX5_VPORT_ADMIN_STATE_AUTO);
10831086 mlx5_lag_add(mdev, netdev);
10841087 priv->events_nb.notifier_call = uplink_rep_async_event;
10851088 mlx5_notifier_register(mdev, &priv->events_nb);
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+10−5
@@ -2356,6 +2356,7 @@ static int __parse_cls_flower(struct mlx5e_priv *priv, · 2355 unmodified lines
23562356 match.key->vlan_priority);
23572357
23582358 *match_level = MLX5_MATCH_L2;
2359+ spec->match_criteria_enable |= MLX5_MATCH_MISC_PARAMETERS;
23592360 }
23602361 }
23612362
@@ -4670,9 +4671,10 @@ static bool is_flow_rule_duplicate_allowed(struct net_device *dev, · 2308 unmodified lines
46704671 struct mlx5e_rep_priv *rpriv)
46714672 {
46724673 /* Offloaded flow rule is allowed to duplicate on non-uplink representor
4673− * sharing tc block with other slaves of a lag device.
4674+ * sharing tc block with other slaves of a lag device. Rpriv can be NULL if this
4675+ * function is called from NIC mode.
46744676 */
4675− return netif_is_lag_port(dev) && rpriv->rep->vport != MLX5_VPORT_UPLINK;
4677+ return netif_is_lag_port(dev) && rpriv && rpriv->rep->vport != MLX5_VPORT_UPLINK;
46764678 }
46774679
46784680 int mlx5e_configure_flower(struct net_device *dev, struct mlx5e_priv *priv,
@@ -4686,13 +4688,12 @@ int mlx5e_configure_flower(struct net_device *dev, struct mlx5e_priv *priv, · 7 unmodified lines
46864688
46874689 rcu_read_lock();
46884690 flow = rhashtable_lookup(tc_ht, &f->cookie, tc_ht_params);
4689− rcu_read_unlock();
46904691 if (flow) {
46914692 /* Same flow rule offloaded to non-uplink representor sharing tc block,
46924693 * just return 0.
46934694 */
46944695 if (is_flow_rule_duplicate_allowed(dev, rpriv) && flow->orig_dev != dev)
4695− goto out;
4696+ goto rcu_unlock;
46964697
46974698 NL_SET_ERR_MSG_MOD(extack,
46984699 "flow cookie already exists, ignoring");
@@ -4700,8 +4701,12 @@ int mlx5e_configure_flower(struct net_device *dev, struct mlx5e_priv *priv, · 1 unmodified line
47004701 "flow cookie %lx already exists, ignoring\n",
47014702 f->cookie);
47024703 err = -EEXIST;
4703− goto out;
4704+ goto rcu_unlock;
47044705 }
4706+rcu_unlock:
4707+ rcu_read_unlock();
4708+ if (flow)
4709+ goto out;
47054710
47064711 trace_mlx5e_configure_flower(f);
47074712 err = mlx5e_tc_add_flow(priv, f, flags, dev, &flow);
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c+0−1
@@ -217,7 +217,6 @@ int esw_acl_ingress_lgcy_setup(struct mlx5_eswitch *esw, · 216 unmodified lines
217217 }
218218
219219 /* Create ingress allow rule */
220− memset(spec, 0, sizeof(*spec));
221220 spec->match_criteria_enable = MLX5_MATCH_OUTER_HEADERS;
222221 flow_act.action = MLX5_FLOW_CONTEXT_ACTION_ALLOW;
223222 vport->ingress.allow_rule = mlx5_add_flow_rules(vport->ingress.acl, spec,
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c+16−11
@@ -1608,7 +1608,7 @@ abort: · 1607 unmodified lines
16081608 mlx5_reload_interface(esw->dev, MLX5_INTERFACE_PROTOCOL_IB);
16091609 mlx5_reload_interface(esw->dev, MLX5_INTERFACE_PROTOCOL_ETH);
16101610 }
1611−
1611+ esw_destroy_tsar(esw);
16121612 return err;
16131613 }
16141614
@@ -1653,8 +1653,6 @@ void mlx5_eswitch_disable_locked(struct mlx5_eswitch *esw, bool clear_vf) · 38 unmodified lines
16531653 else if (esw->mode == MLX5_ESWITCH_OFFLOADS)
16541654 esw_offloads_disable(esw);
16551655
1656− esw_destroy_tsar(esw);
1657−
16581656 old_mode = esw->mode;
16591657 esw->mode = MLX5_ESWITCH_NONE;
16601658
@@ -1664,6 +1662,8 @@ void mlx5_eswitch_disable_locked(struct mlx5_eswitch *esw, bool clear_vf) · 3 unmodified lines
16641662 mlx5_reload_interface(esw->dev, MLX5_INTERFACE_PROTOCOL_IB);
16651663 mlx5_reload_interface(esw->dev, MLX5_INTERFACE_PROTOCOL_ETH);
16661664 }
1665+ esw_destroy_tsar(esw);
1666+
16671667 if (clear_vf)
16681668 mlx5_eswitch_clear_vf_vports_info(esw);
16691669 }
@@ -1826,6 +1826,8 @@ int mlx5_eswitch_set_vport_state(struct mlx5_eswitch *esw, · 156 unmodified lines
18261826 u16 vport, int link_state)
18271827 {
18281828 struct mlx5_vport *evport = mlx5_eswitch_get_vport(esw, vport);
1829+ int opmod = MLX5_VPORT_STATE_OP_MOD_ESW_VPORT;
1830+ int other_vport = 1;
18291831 int err = 0;
18301832
18311833 if (!ESW_ALLOWED(esw))
@@ -1833,15 +1835,17 @@ int mlx5_eswitch_set_vport_state(struct mlx5_eswitch *esw, · 1 unmodified line
18331835 if (IS_ERR(evport))
18341836 return PTR_ERR(evport);
18351837
1838+ if (vport == MLX5_VPORT_UPLINK) {
1839+ opmod = MLX5_VPORT_STATE_OP_MOD_UPLINK;
1840+ other_vport = 0;
1841+ vport = 0;
1842+ }
18361843 mutex_lock(&esw->state_lock);
18371844
1838− err = mlx5_modify_vport_admin_state(esw->dev,
1839− MLX5_VPORT_STATE_OP_MOD_ESW_VPORT,
1840− vport, 1, link_state);
1845+ err = mlx5_modify_vport_admin_state(esw->dev, opmod, vport, other_vport, link_state);
18411846 if (err) {
1842− mlx5_core_warn(esw->dev,
1843− "Failed to set vport %d link state, err = %d",
1844− vport, err);
1847+ mlx5_core_warn(esw->dev, "Failed to set vport %d link state, opmod = %d, err = %d",
1848+ vport, opmod, err);
18451849 goto unlock;
18461850 }
18471851
@@ -1883,8 +1887,6 @@ int __mlx5_eswitch_set_vport_vlan(struct mlx5_eswitch *esw, · 35 unmodified lines
18831887 struct mlx5_vport *evport = mlx5_eswitch_get_vport(esw, vport);
18841888 int err = 0;
18851889
1886− if (!ESW_ALLOWED(esw))
1887− return -EPERM;
18881890 if (IS_ERR(evport))
18891891 return PTR_ERR(evport);
18901892 if (vlan > 4095 || qos > 7)
@@ -1912,6 +1914,9 @@ int mlx5_eswitch_set_vport_vlan(struct mlx5_eswitch *esw, · 21 unmodified lines
19121914 u8 set_flags = 0;
19131915 int err;
19141916
1917+ if (!ESW_ALLOWED(esw))
1918+ return -EPERM;
1919+
19151920 if (vlan || qos)
19161921 set_flags = SET_VLAN_STRIP | SET_VLAN_INSERT;
19171922
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h+2−0
@@ -680,6 +680,8 @@ static inline int mlx5_eswitch_enable(struct mlx5_eswitch *esw, int num_vfs) { r · 679 unmodified lines
680680 static inline void mlx5_eswitch_disable(struct mlx5_eswitch *esw, bool clear_vf) {}
681681 static inline bool mlx5_esw_lag_prereq(struct mlx5_core_dev *dev0, struct mlx5_core_dev *dev1) { return true; }
682682 static inline bool mlx5_eswitch_is_funcs_handler(struct mlx5_core_dev *dev) { return false; }
683+static inline
684+int mlx5_eswitch_set_vport_state(struct mlx5_eswitch *esw, u16 vport, int link_state) { return 0; }
683685 static inline const u32 *mlx5_esw_query_functions(struct mlx5_core_dev *dev)
684686 {
685687 return ERR_PTR(-EOPNOTSUPP);
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c+12−7
@@ -236,6 +236,15 @@ static struct mlx5_eswitch_rep *mlx5_eswitch_get_rep(struct mlx5_eswitch *esw, · 235 unmodified lines
236236 return &esw->offloads.vport_reps[idx];
237237 }
238238
239+static void
240+mlx5_eswitch_set_rule_flow_source(struct mlx5_eswitch *esw,
241+ struct mlx5_flow_spec *spec,
242+ struct mlx5_esw_flow_attr *attr)
243+{
244+ if (MLX5_CAP_ESW_FLOWTABLE(esw->dev, flow_source) &&
245+ attr && attr->in_rep && attr->in_rep->vport == MLX5_VPORT_UPLINK)
246+ spec->flow_context.flow_source = MLX5_FLOW_CONTEXT_FLOW_SOURCE_UPLINK;
247+}
239248
240249 static void
241250 mlx5_eswitch_set_rule_source_port(struct mlx5_eswitch *esw,
@@ -259,9 +268,6 @@ mlx5_eswitch_set_rule_source_port(struct mlx5_eswitch *esw, · 17 unmodified lines
259268 mlx5_eswitch_get_vport_metadata_mask());
260269
261270 spec->match_criteria_enable |= MLX5_MATCH_MISC_PARAMETERS_2;
262− misc = MLX5_ADDR_OF(fte_match_param, spec->match_criteria, misc_parameters);
263− if (memchr_inv(misc, 0, MLX5_ST_SZ_BYTES(fte_match_set_misc)))
264− spec->match_criteria_enable |= MLX5_MATCH_MISC_PARAMETERS;
265271 } else {
266272 misc = MLX5_ADDR_OF(fte_match_param, spec->match_value, misc_parameters);
267273 MLX5_SET(fte_match_set_misc, misc, source_port, attr->in_rep->vport);
@@ -279,10 +285,6 @@ mlx5_eswitch_set_rule_source_port(struct mlx5_eswitch *esw, · 11 unmodified lines
279285
280286 spec->match_criteria_enable |= MLX5_MATCH_MISC_PARAMETERS;
281287 }
282−
283− if (MLX5_CAP_ESW_FLOWTABLE(esw->dev, flow_source) &&
284− attr->in_rep->vport == MLX5_VPORT_UPLINK)
285− spec->flow_context.flow_source = MLX5_FLOW_CONTEXT_FLOW_SOURCE_UPLINK;
286288 }
287289
288290 struct mlx5_flow_handle *
@@ -396,6 +398,8 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw, · 107 unmodified lines
396398 goto err_esw_get;
397399 }
398400
401+ mlx5_eswitch_set_rule_flow_source(esw, spec, attr);
402+
399403 if (mlx5_eswitch_termtbl_required(esw, attr, &flow_act, spec))
400404 rule = mlx5_eswitch_add_termtbl_rule(esw, fdb, spec, attr,
401405 &flow_act, dest, i);
@@ -462,6 +466,7 @@ mlx5_eswitch_add_fwd_rule(struct mlx5_eswitch *esw, · 60 unmodified lines
462466 i++;
463467
464468 mlx5_eswitch_set_rule_source_port(esw, spec, attr);
469+ mlx5_eswitch_set_rule_flow_source(esw, spec, attr);
465470
466471 if (attr->outer_match_level != MLX5_MATCH_NONE)
467472 spec->match_criteria_enable |= MLX5_MATCH_OUTER_HEADERS;
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c+5−23
@@ -797,7 +797,7 @@ static struct mlx5_flow_table *find_closest_ft_recursive(struct fs_node *root, · 796 unmodified lines
797797 return ft;
798798 }
799799
800−/* If reverse if false then return the first flow table in next priority of
800+/* If reverse is false then return the first flow table in next priority of
801801 * prio in the tree, else return the last flow table in the previous priority
802802 * of prio in the tree.
803803 */
@@ -829,34 +829,16 @@ static struct mlx5_flow_table *find_prev_chained_ft(struct fs_prio *prio) · 25 unmodified lines
829829 return find_closest_ft(prio, true);
830830 }
831831
832−static struct fs_prio *find_fwd_ns_prio(struct mlx5_flow_root_namespace *root,
833− struct mlx5_flow_namespace *ns)
834−{
835− struct mlx5_flow_namespace *root_ns = &root->ns;
836− struct fs_prio *iter_prio;
837− struct fs_prio *prio;
838−
839− fs_get_obj(prio, ns->node.parent);
840− list_for_each_entry(iter_prio, &root_ns->node.children, node.list) {
841− if (iter_prio == prio &&
842− !list_is_last(&prio->node.children, &iter_prio->node.list))
843− return list_next_entry(iter_prio, node.list);
844− }
845− return NULL;
846−}
847−
848832 static struct mlx5_flow_table *find_next_fwd_ft(struct mlx5_flow_table *ft,
849833 struct mlx5_flow_act *flow_act)
850834 {
851− struct mlx5_flow_root_namespace *root = find_root(&ft->node);
852835 struct fs_prio *prio;
836+ bool next_ns;
853837
854− if (flow_act->action & MLX5_FLOW_CONTEXT_ACTION_FWD_NEXT_NS)
855− prio = find_fwd_ns_prio(root, ft->ns);
856− else
857− fs_get_obj(prio, ft->node.parent);
838+ next_ns = flow_act->action & MLX5_FLOW_CONTEXT_ACTION_FWD_NEXT_NS;
839+ fs_get_obj(prio, next_ns ? ft->ns->node.parent : ft->node.parent);
858840
859− return (prio) ? find_next_chained_ft(prio) : NULL;
841+ return find_next_chained_ft(prio);
860842 }
861843
862844 static int connect_fts_in_prio(struct mlx5_core_dev *dev,
drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c+65−13
@@ -273,17 +273,17 @@ static int mlx5_extts_configure(struct ptp_clock_info *ptp, · 272 unmodified lines
273273 if (rq->extts.index >= clock->ptp_info.n_pins)
274274 return -EINVAL;
275275
276+ pin = ptp_find_pin(clock->ptp, PTP_PF_EXTTS, rq->extts.index);
277+ if (pin < 0)
278+ return -EBUSY;
279+
276280 if (on) {
277− pin = ptp_find_pin(clock->ptp, PTP_PF_EXTTS, rq->extts.index);
278− if (pin < 0)
279− return -EBUSY;
280281 pin_mode = MLX5_PIN_MODE_IN;
281282 pattern = !!(rq->extts.flags & PTP_FALLING_EDGE);
282283 field_select = MLX5_MTPPS_FS_PIN_MODE |
283284 MLX5_MTPPS_FS_PATTERN |
284285 MLX5_MTPPS_FS_ENABLE;
285286 } else {
286− pin = rq->extts.index;
287287 field_select = MLX5_MTPPS_FS_ENABLE;
288288 }
289289
@@ -331,12 +331,12 @@ static int mlx5_perout_configure(struct ptp_clock_info *ptp, · 41 unmodified lines
331331 if (rq->perout.index >= clock->ptp_info.n_pins)
332332 return -EINVAL;
333333
334− if (on) {
335− pin = ptp_find_pin(clock->ptp, PTP_PF_PEROUT,
336− rq->perout.index);
337− if (pin < 0)
338− return -EBUSY;
334+ pin = ptp_find_pin(clock->ptp, PTP_PF_PEROUT,
335+ rq->perout.index);
336+ if (pin < 0)
337+ return -EBUSY;
339338
339+ if (on) {
340340 pin_mode = MLX5_PIN_MODE_OUT;
341341 pattern = MLX5_OUT_PATTERN_PERIODIC;
342342 ts.tv_sec = rq->perout.period.sec;
@@ -362,7 +362,6 @@ static int mlx5_perout_configure(struct ptp_clock_info *ptp, · 19 unmodified lines
362362 MLX5_MTPPS_FS_ENABLE |
363363 MLX5_MTPPS_FS_TIME_STAMP;
364364 } else {
365− pin = rq->perout.index;
366365 field_select = MLX5_MTPPS_FS_ENABLE;
367366 }
368367
@@ -409,10 +408,31 @@ static int mlx5_ptp_enable(struct ptp_clock_info *ptp, · 40 unmodified lines
409408 return 0;
410409 }
411410
411+enum {
412+ MLX5_MTPPS_REG_CAP_PIN_X_MODE_SUPPORT_PPS_IN = BIT(0),
413+ MLX5_MTPPS_REG_CAP_PIN_X_MODE_SUPPORT_PPS_OUT = BIT(1),
414+};
415+
412416 static int mlx5_ptp_verify(struct ptp_clock_info *ptp, unsigned int pin,
413417 enum ptp_pin_function func, unsigned int chan)
414418 {
415− return (func == PTP_PF_PHYSYNC) ? -EOPNOTSUPP : 0;
419+ struct mlx5_clock *clock = container_of(ptp, struct mlx5_clock,
420+ ptp_info);
421+
422+ switch (func) {
423+ case PTP_PF_NONE:
424+ return 0;
425+ case PTP_PF_EXTTS:
426+ return !(clock->pps_info.pin_caps[pin] &
427+ MLX5_MTPPS_REG_CAP_PIN_X_MODE_SUPPORT_PPS_IN);
428+ case PTP_PF_PEROUT:
429+ return !(clock->pps_info.pin_caps[pin] &
430+ MLX5_MTPPS_REG_CAP_PIN_X_MODE_SUPPORT_PPS_OUT);
431+ default:
432+ return -EOPNOTSUPP;
433+ }
434+
435+ return -EOPNOTSUPP;
416436 }
417437
418438 static const struct ptp_clock_info mlx5_ptp_clock_info = {
@@ -432,6 +452,38 @@ static const struct ptp_clock_info mlx5_ptp_clock_info = { · 13 unmodified lines
432452 .verify = NULL,
433453 };
434454
455+static int mlx5_query_mtpps_pin_mode(struct mlx5_core_dev *mdev, u8 pin,
456+ u32 *mtpps, u32 mtpps_size)
457+{
458+ u32 in[MLX5_ST_SZ_DW(mtpps_reg)] = {};
459+
460+ MLX5_SET(mtpps_reg, in, pin, pin);
461+
462+ return mlx5_core_access_reg(mdev, in, sizeof(in), mtpps,
463+ mtpps_size, MLX5_REG_MTPPS, 0, 0);
464+}
465+
466+static int mlx5_get_pps_pin_mode(struct mlx5_clock *clock, u8 pin)
467+{
468+ struct mlx5_core_dev *mdev = clock->mdev;
469+ u32 out[MLX5_ST_SZ_DW(mtpps_reg)] = {};
470+ u8 mode;
471+ int err;
472+
473+ err = mlx5_query_mtpps_pin_mode(mdev, pin, out, sizeof(out));
474+ if (err || !MLX5_GET(mtpps_reg, out, enable))
475+ return PTP_PF_NONE;
476+
477+ mode = MLX5_GET(mtpps_reg, out, pin_mode);
478+
479+ if (mode == MLX5_PIN_MODE_IN)
480+ return PTP_PF_EXTTS;
481+ else if (mode == MLX5_PIN_MODE_OUT)
482+ return PTP_PF_PEROUT;
483+
484+ return PTP_PF_NONE;
485+}
486+
435487 static int mlx5_init_pin_config(struct mlx5_clock *clock)
436488 {
437489 int i;
@@ -451,8 +503,8 @@ static int mlx5_init_pin_config(struct mlx5_clock *clock) · 13 unmodified lines
451503 sizeof(clock->ptp_info.pin_config[i].name),
452504 "mlx5_pps%d", i);
453505 clock->ptp_info.pin_config[i].index = i;
454− clock->ptp_info.pin_config[i].func = PTP_PF_NONE;
455− clock->ptp_info.pin_config[i].chan = i;
506+ clock->ptp_info.pin_config[i].func = mlx5_get_pps_pin_mode(clock, i);
507+ clock->ptp_info.pin_config[i].chan = 0;
456508 }
457509
458510 return 0;
drivers/net/ethernet/mellanox/mlx5/core/port.c+77−16
@@ -293,7 +293,40 @@ static int mlx5_query_module_num(struct mlx5_core_dev *dev, int *module_num) · 292 unmodified lines
293293 return 0;
294294 }
295295
296−static int mlx5_eeprom_page(int offset)
296+static int mlx5_query_module_id(struct mlx5_core_dev *dev, int module_num,
297+ u8 *module_id)
298+{
299+ u32 in[MLX5_ST_SZ_DW(mcia_reg)] = {};
300+ u32 out[MLX5_ST_SZ_DW(mcia_reg)];
301+ int err, status;
302+ u8 *ptr;
303+
304+ MLX5_SET(mcia_reg, in, i2c_device_address, MLX5_I2C_ADDR_LOW);
305+ MLX5_SET(mcia_reg, in, module, module_num);
306+ MLX5_SET(mcia_reg, in, device_address, 0);
307+ MLX5_SET(mcia_reg, in, page_number, 0);
308+ MLX5_SET(mcia_reg, in, size, 1);
309+ MLX5_SET(mcia_reg, in, l, 0);
310+
311+ err = mlx5_core_access_reg(dev, in, sizeof(in), out,
312+ sizeof(out), MLX5_REG_MCIA, 0, 0);
313+ if (err)
314+ return err;
315+
316+ status = MLX5_GET(mcia_reg, out, status);
317+ if (status) {
318+ mlx5_core_err(dev, "query_mcia_reg failed: status: 0x%x\n",
319+ status);
320+ return -EIO;
321+ }
322+ ptr = MLX5_ADDR_OF(mcia_reg, out, dword_0);
323+
324+ *module_id = ptr[0];
325+
326+ return 0;
327+}
328+
329+static int mlx5_qsfp_eeprom_page(u16 offset)
297330 {
298331 if (offset < MLX5_EEPROM_PAGE_LENGTH)
299332 /* Addresses between 0-255 - page 00 */
@@ -307,7 +340,7 @@ static int mlx5_eeprom_page(int offset) · 7 unmodified lines
307340 MLX5_EEPROM_HIGH_PAGE_LENGTH);
308341 }
309342
310−static int mlx5_eeprom_high_page_offset(int page_num)
343+static int mlx5_qsfp_eeprom_high_page_offset(int page_num)
311344 {
312345 if (!page_num) /* Page 0 always start from low page */
313346 return 0;
@@ -316,35 +349,62 @@ static int mlx5_eeprom_high_page_offset(int page_num) · 2 unmodified lines
316349 return page_num * MLX5_EEPROM_HIGH_PAGE_LENGTH;
317350 }
318351
352+static void mlx5_qsfp_eeprom_params_set(u16 *i2c_addr, int *page_num, u16 *offset)
353+{
354+ *i2c_addr = MLX5_I2C_ADDR_LOW;
355+ *page_num = mlx5_qsfp_eeprom_page(*offset);
356+ *offset -= mlx5_qsfp_eeprom_high_page_offset(*page_num);
357+}
358+
359+static void mlx5_sfp_eeprom_params_set(u16 *i2c_addr, int *page_num, u16 *offset)
360+{
361+ *i2c_addr = MLX5_I2C_ADDR_LOW;
362+ *page_num = 0;
363+
364+ if (*offset < MLX5_EEPROM_PAGE_LENGTH)
365+ return;
366+
367+ *i2c_addr = MLX5_I2C_ADDR_HIGH;
368+ *offset -= MLX5_EEPROM_PAGE_LENGTH;
369+}
370+
319371 int mlx5_query_module_eeprom(struct mlx5_core_dev *dev,
320372 u16 offset, u16 size, u8 *data)
321373 {
322− int module_num, page_num, status, err;
374+ int module_num, status, err, page_num = 0;
375+ u32 in[MLX5_ST_SZ_DW(mcia_reg)] = {};
323376 u32 out[MLX5_ST_SZ_DW(mcia_reg)];
324− u32 in[MLX5_ST_SZ_DW(mcia_reg)];
325− u16 i2c_addr;
326− void *ptr = MLX5_ADDR_OF(mcia_reg, out, dword_0);
377+ u16 i2c_addr = 0;
378+ u8 module_id;
379+ void *ptr;
327380
328381 err = mlx5_query_module_num(dev, &module_num);
329382 if (err)
330383 return err;
331384
332− memset(in, 0, sizeof(in));
333− size = min_t(int, size, MLX5_EEPROM_MAX_BYTES);
334−
335− /* Get the page number related to the given offset */
336− page_num = mlx5_eeprom_page(offset);
385+ err = mlx5_query_module_id(dev, module_num, &module_id);
386+ if (err)
387+ return err;
337388
338− /* Set the right offset according to the page number,
339− * For page_num > 0, relative offset is always >= 128 (high page).
340− */
341− offset -= mlx5_eeprom_high_page_offset(page_num);
389+ switch (module_id) {
390+ case MLX5_MODULE_ID_SFP:
391+ mlx5_sfp_eeprom_params_set(&i2c_addr, &page_num, &offset);
392+ break;
393+ case MLX5_MODULE_ID_QSFP:
394+ case MLX5_MODULE_ID_QSFP_PLUS:
395+ case MLX5_MODULE_ID_QSFP28:
396+ mlx5_qsfp_eeprom_params_set(&i2c_addr, &page_num, &offset);
397+ break;
398+ default:
399+ mlx5_core_err(dev, "Module ID not recognized: 0x%x\n", module_id);
400+ return -EINVAL;
401+ }
342402
343403 if (offset + size > MLX5_EEPROM_PAGE_LENGTH)
344404 /* Cross pages read, read until offset 256 in low page */
345405 size -= offset + size - MLX5_EEPROM_PAGE_LENGTH;
346406
347− i2c_addr = MLX5_I2C_ADDR_LOW;
407+ size = min_t(int, size, MLX5_EEPROM_MAX_BYTES);
348408
349409 MLX5_SET(mcia_reg, in, l, 0);
350410 MLX5_SET(mcia_reg, in, module, module_num);
@@ -365,6 +425,7 @@ int mlx5_query_module_eeprom(struct mlx5_core_dev *dev, · 14 unmodified lines
365425 return -EIO;
366426 }
367427
428+ ptr = MLX5_ADDR_OF(mcia_reg, out, dword_0);
368429 memcpy(data, ptr, size);
369430
370431 return size;
drivers/net/ethernet/mellanox/mlxsw/core.c+7−4
@@ -710,7 +710,7 @@ static int mlxsw_emad_init(struct mlxsw_core *mlxsw_core) · 709 unmodified lines
710710 err = mlxsw_core_trap_register(mlxsw_core, &mlxsw_emad_rx_listener,
711711 mlxsw_core);
712712 if (err)
713− return err;
713+ goto err_trap_register;
714714
715715 err = mlxsw_core->driver->basic_trap_groups_set(mlxsw_core);
716716 if (err)
@@ -722,6 +722,7 @@ static int mlxsw_emad_init(struct mlxsw_core *mlxsw_core) · 5 unmodified lines
722722 err_emad_trap_set:
723723 mlxsw_core_trap_unregister(mlxsw_core, &mlxsw_emad_rx_listener,
724724 mlxsw_core);
725+err_trap_register:
725726 destroy_workqueue(mlxsw_core->emad_wq);
726727 return err;
727728 }
@@ -1813,7 +1814,7 @@ static int mlxsw_core_reg_access_emad(struct mlxsw_core *mlxsw_core, · 1085 unmodified lines
18131814 err = mlxsw_emad_reg_access(mlxsw_core, reg, payload, type, trans,
18141815 bulk_list, cb, cb_priv, tid);
18151816 if (err) {
1816− kfree(trans);
1817+ kfree_rcu(trans, rcu);
18171818 return err;
18181819 }
18191820 return 0;
@@ -2050,11 +2051,13 @@ void mlxsw_core_skb_receive(struct mlxsw_core *mlxsw_core, struct sk_buff *skb, · 230 unmodified lines
20502051 break;
20512052 }
20522053 }
2053− rcu_read_unlock();
2054− if (!found)
2054+ if (!found) {
2055+ rcu_read_unlock();
20552056 goto drop;
2057+ }
20562058
20572059 rxl->func(skb, local_port, rxl_item->priv);
2060+ rcu_read_unlock();
20582061 return;
20592062
20602063 drop:
drivers/net/ethernet/mellanox/mlxsw/core_env.c+32−16
@@ -45,7 +45,7 @@ static int mlxsw_env_validate_cable_ident(struct mlxsw_core *core, int id, · 44 unmodified lines
4545 static int
4646 mlxsw_env_query_module_eeprom(struct mlxsw_core *mlxsw_core, int module,
4747 u16 offset, u16 size, void *data,
48− unsigned int *p_read_size)
48+ bool qsfp, unsigned int *p_read_size)
4949 {
5050 char eeprom_tmp[MLXSW_REG_MCIA_EEPROM_SIZE];
5151 char mcia_pl[MLXSW_REG_MCIA_LEN];
@@ -54,6 +54,10 @@ mlxsw_env_query_module_eeprom(struct mlxsw_core *mlxsw_core, int module, · 2 unmodified lines
5454 int status;
5555 int err;
5656
57+ /* MCIA register accepts buffer size <= 48. Page of size 128 should be
58+ * read by chunks of size 48, 48, 32. Align the size of the last chunk
59+ * to avoid reading after the end of the page.
60+ */
5761 size = min_t(u16, size, MLXSW_REG_MCIA_EEPROM_SIZE);
5862
5963 if (offset < MLXSW_REG_MCIA_EEPROM_PAGE_LENGTH &&
@@ -63,18 +67,25 @@ mlxsw_env_query_module_eeprom(struct mlxsw_core *mlxsw_core, int module, · 3 unmodified lines
6367
6468 i2c_addr = MLXSW_REG_MCIA_I2C_ADDR_LOW;
6569 if (offset >= MLXSW_REG_MCIA_EEPROM_PAGE_LENGTH) {
66− page = MLXSW_REG_MCIA_PAGE_GET(offset);
67− offset -= MLXSW_REG_MCIA_EEPROM_UP_PAGE_LENGTH * page;
68− /* When reading upper pages 1, 2 and 3 the offset starts at
69− * 128. Please refer to "QSFP+ Memory Map" figure in SFF-8436
70− * specification for graphical depiction.
71− * MCIA register accepts buffer size <= 48. Page of size 128
72− * should be read by chunks of size 48, 48, 32. Align the size
73− * of the last chunk to avoid reading after the end of the
74− * page.
75− */
76− if (offset + size > MLXSW_REG_MCIA_EEPROM_PAGE_LENGTH)
77− size = MLXSW_REG_MCIA_EEPROM_PAGE_LENGTH - offset;
70+ if (qsfp) {
71+ /* When reading upper pages 1, 2 and 3 the offset
72+ * starts at 128. Please refer to "QSFP+ Memory Map"
73+ * figure in SFF-8436 specification for graphical
74+ * depiction.
75+ */
76+ page = MLXSW_REG_MCIA_PAGE_GET(offset);
77+ offset -= MLXSW_REG_MCIA_EEPROM_UP_PAGE_LENGTH * page;
78+ if (offset + size > MLXSW_REG_MCIA_EEPROM_PAGE_LENGTH)
79+ size = MLXSW_REG_MCIA_EEPROM_PAGE_LENGTH - offset;
80+ } else {
81+ /* When reading upper pages 1, 2 and 3 the offset
82+ * starts at 0 and I2C high address is used. Please refer
83+ * refer to "Memory Organization" figure in SFF-8472
84+ * specification for graphical depiction.
85+ */
86+ i2c_addr = MLXSW_REG_MCIA_I2C_ADDR_HIGH;
87+ offset -= MLXSW_REG_MCIA_EEPROM_PAGE_LENGTH;
88+ }
7889 }
7990
8091 mlxsw_reg_mcia_pack(mcia_pl, module, 0, page, offset, size, i2c_addr);
@@ -166,7 +177,7 @@ int mlxsw_env_get_module_info(struct mlxsw_core *mlxsw_core, int module, · 85 unmodified lines
166177 int err;
167178
168179 err = mlxsw_env_query_module_eeprom(mlxsw_core, module, 0, offset,
169− module_info, &read_size);
180+ module_info, false, &read_size);
170181 if (err)
171182 return err;
172183
@@ -197,7 +208,7 @@ int mlxsw_env_get_module_info(struct mlxsw_core *mlxsw_core, int module, · 24 unmodified lines
197208 /* Verify if transceiver provides diagnostic monitoring page */
198209 err = mlxsw_env_query_module_eeprom(mlxsw_core, module,
199210 SFP_DIAGMON, 1, &diag_mon,
200− &read_size);
211+ false, &read_size);
201212 if (err)
202213 return err;
203214
@@ -225,17 +236,22 @@ int mlxsw_env_get_module_eeprom(struct net_device *netdev, · 21 unmodified lines
225236 int offset = ee->offset;
226237 unsigned int read_size;
227238 int i = 0;
239+ bool qsfp;
228240 int err;
229241
230242 if (!ee->len)
231243 return -EINVAL;
232244
233245 memset(data, 0, ee->len);
246+ /* Validate module identifier value. */
247+ err = mlxsw_env_validate_cable_ident(mlxsw_core, module, &qsfp);
248+ if (err)
249+ return err;
234250
235251 while (i < ee->len) {
236252 err = mlxsw_env_query_module_eeprom(mlxsw_core, module, offset,
237253 ee->len - i, data + i,
238− &read_size);
254+ qsfp, &read_size);
239255 if (err) {
240256 netdev_err(netdev, "Eeprom query failed\n");
241257 return err;
drivers/net/ethernet/mellanox/mlxsw/pci.c+38−16
@@ -1414,23 +1414,12 @@ static int mlxsw_pci_init(void *bus_priv, struct mlxsw_core *mlxsw_core, · 1413 unmodified lines
14141414 u16 num_pages;
14151415 int err;
14161416
1417− mutex_init(&mlxsw_pci->cmd.lock);
1418− init_waitqueue_head(&mlxsw_pci->cmd.wait);
1419−
14201417 mlxsw_pci->core = mlxsw_core;
14211418
14221419 mbox = mlxsw_cmd_mbox_alloc();
14231420 if (!mbox)
14241421 return -ENOMEM;
14251422
1426− err = mlxsw_pci_mbox_alloc(mlxsw_pci, &mlxsw_pci->cmd.in_mbox);
1427− if (err)
1428− goto mbox_put;
1429−
1430− err = mlxsw_pci_mbox_alloc(mlxsw_pci, &mlxsw_pci->cmd.out_mbox);
1431− if (err)
1432− goto err_out_mbox_alloc;
1433−
14341423 err = mlxsw_pci_sw_reset(mlxsw_pci, mlxsw_pci->id);
14351424 if (err)
14361425 goto err_sw_reset;
@@ -1537,9 +1526,6 @@ err_query_fw: · 100 unmodified lines
15371526 mlxsw_pci_free_irq_vectors(mlxsw_pci);
15381527 err_alloc_irq:
15391528 err_sw_reset:
1540− mlxsw_pci_mbox_free(mlxsw_pci, &mlxsw_pci->cmd.out_mbox);
1541−err_out_mbox_alloc:
1542− mlxsw_pci_mbox_free(mlxsw_pci, &mlxsw_pci->cmd.in_mbox);
15431529 mbox_put:
15441530 mlxsw_cmd_mbox_free(mbox);
15451531 return err;
@@ -1553,8 +1539,6 @@ static void mlxsw_pci_fini(void *bus_priv) · 7 unmodified lines
15531539 mlxsw_pci_aqs_fini(mlxsw_pci);
15541540 mlxsw_pci_fw_area_fini(mlxsw_pci);
15551541 mlxsw_pci_free_irq_vectors(mlxsw_pci);
1556− mlxsw_pci_mbox_free(mlxsw_pci, &mlxsw_pci->cmd.out_mbox);
1557− mlxsw_pci_mbox_free(mlxsw_pci, &mlxsw_pci->cmd.in_mbox);
15581542 }
15591543
15601544 static struct mlxsw_pci_queue *
@@ -1776,6 +1760,37 @@ static const struct mlxsw_bus mlxsw_pci_bus = { · 215 unmodified lines
17761760 .features = MLXSW_BUS_F_TXRX | MLXSW_BUS_F_RESET,
17771761 };
17781762
1763+static int mlxsw_pci_cmd_init(struct mlxsw_pci *mlxsw_pci)
1764+{
1765+ int err;
1766+
1767+ mutex_init(&mlxsw_pci->cmd.lock);
1768+ init_waitqueue_head(&mlxsw_pci->cmd.wait);
1769+
1770+ err = mlxsw_pci_mbox_alloc(mlxsw_pci, &mlxsw_pci->cmd.in_mbox);
1771+ if (err)
1772+ goto err_in_mbox_alloc;
1773+
1774+ err = mlxsw_pci_mbox_alloc(mlxsw_pci, &mlxsw_pci->cmd.out_mbox);
1775+ if (err)
1776+ goto err_out_mbox_alloc;
1777+
1778+ return 0;
1779+
1780+err_out_mbox_alloc:
1781+ mlxsw_pci_mbox_free(mlxsw_pci, &mlxsw_pci->cmd.in_mbox);
1782+err_in_mbox_alloc:
1783+ mutex_destroy(&mlxsw_pci->cmd.lock);
1784+ return err;
1785+}
1786+
1787+static void mlxsw_pci_cmd_fini(struct mlxsw_pci *mlxsw_pci)
1788+{
1789+ mlxsw_pci_mbox_free(mlxsw_pci, &mlxsw_pci->cmd.out_mbox);
1790+ mlxsw_pci_mbox_free(mlxsw_pci, &mlxsw_pci->cmd.in_mbox);
1791+ mutex_destroy(&mlxsw_pci->cmd.lock);
1792+}
1793+
17791794 static int mlxsw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
17801795 {
17811796 const char *driver_name = pdev->driver->name;
@@ -1831,6 +1846,10 @@ static int mlxsw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 49 unmodified lines
18311846 mlxsw_pci->pdev = pdev;
18321847 pci_set_drvdata(pdev, mlxsw_pci);
18331848
1849+ err = mlxsw_pci_cmd_init(mlxsw_pci);
1850+ if (err)
1851+ goto err_pci_cmd_init;
1852+
18341853 mlxsw_pci->bus_info.device_kind = driver_name;
18351854 mlxsw_pci->bus_info.device_name = pci_name(mlxsw_pci->pdev);
18361855 mlxsw_pci->bus_info.dev = &pdev->dev;
@@ -1848,6 +1867,8 @@ static int mlxsw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 11 unmodified lines
18481867 return 0;
18491868
18501869 err_bus_device_register:
1870+ mlxsw_pci_cmd_fini(mlxsw_pci);
1871+err_pci_cmd_init:
18511872 iounmap(mlxsw_pci->hw_addr);
18521873 err_ioremap:
18531874 err_pci_resource_len_check:
@@ -1865,6 +1886,7 @@ static void mlxsw_pci_remove(struct pci_dev *pdev) · 11 unmodified lines
18651886 struct mlxsw_pci *mlxsw_pci = pci_get_drvdata(pdev);
18661887
18671888 mlxsw_core_bus_device_unregister(mlxsw_pci->core, false);
1889+ mlxsw_pci_cmd_fini(mlxsw_pci);
18681890 iounmap(mlxsw_pci->hw_addr);
18691891 pci_release_regions(mlxsw_pci->pdev);
18701892 pci_disable_device(mlxsw_pci->pdev);
drivers/net/ethernet/mellanox/mlxsw/reg.h+1−0
@@ -5536,6 +5536,7 @@ enum mlxsw_reg_htgt_trap_group { · 5535 unmodified lines
55365536 MLXSW_REG_HTGT_TRAP_GROUP_SP_MULTICAST,
55375537 MLXSW_REG_HTGT_TRAP_GROUP_SP_NEIGH_DISCOVERY,
55385538 MLXSW_REG_HTGT_TRAP_GROUP_SP_ROUTER_EXP,
5539+ MLXSW_REG_HTGT_TRAP_GROUP_SP_EXTERNAL_ROUTE,
55395540 MLXSW_REG_HTGT_TRAP_GROUP_SP_IP2ME,
55405541 MLXSW_REG_HTGT_TRAP_GROUP_SP_DHCP,
55415542 MLXSW_REG_HTGT_TRAP_GROUP_SP_EVENT,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+27−34
@@ -5001,15 +5001,6 @@ static void mlxsw_sp_router_fib4_del(struct mlxsw_sp *mlxsw_sp, · 5000 unmodified lines
50015001
50025002 static bool mlxsw_sp_fib6_rt_should_ignore(const struct fib6_info *rt)
50035003 {
5004− /* Packets with link-local destination IP arriving to the router
5005− * are trapped to the CPU, so no need to program specific routes
5006− * for them. Only allow prefix routes (usually one fe80::/64) so
5007− * that packets are trapped for the right reason.
5008− */
5009− if ((ipv6_addr_type(&rt->fib6_dst.addr) & IPV6_ADDR_LINKLOCAL) &&
5010− (rt->fib6_flags & (RTF_LOCAL | RTF_ANYCAST)))
5011− return true;
5012−
50135004 /* Multicast routes aren't supported, so ignore them. Neighbour
50145005 * Discovery packets are specifically trapped.
50155006 */
@@ -6262,7 +6253,7 @@ static int mlxsw_sp_router_fib_event(struct notifier_block *nb, · 1246 unmodified lines
62626253 }
62636254
62646255 fib_work = kzalloc(sizeof(*fib_work), GFP_ATOMIC);
6265− if (WARN_ON(!fib_work))
6256+ if (!fib_work)
62666257 return NOTIFY_BAD;
62676258
62686259 fib_work->mlxsw_sp = router->mlxsw_sp;
@@ -8078,16 +8069,6 @@ int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp, · 1809 unmodified lines
80788069 mlxsw_sp->router = router;
80798070 router->mlxsw_sp = mlxsw_sp;
80808071
8081− router->inetaddr_nb.notifier_call = mlxsw_sp_inetaddr_event;
8082− err = register_inetaddr_notifier(&router->inetaddr_nb);
8083− if (err)
8084− goto err_register_inetaddr_notifier;
8085−
8086− router->inet6addr_nb.notifier_call = mlxsw_sp_inet6addr_event;
8087− err = register_inet6addr_notifier(&router->inet6addr_nb);
8088− if (err)
8089− goto err_register_inet6addr_notifier;
8090−
80918072 INIT_LIST_HEAD(&mlxsw_sp->router->nexthop_neighs_list);
80928073 err = __mlxsw_sp_router_init(mlxsw_sp);
80938074 if (err)
@@ -8128,12 +8109,6 @@ int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp, · 34 unmodified lines
81288109 if (err)
81298110 goto err_neigh_init;
81308111
8131− mlxsw_sp->router->netevent_nb.notifier_call =
8132− mlxsw_sp_router_netevent_event;
8133− err = register_netevent_notifier(&mlxsw_sp->router->netevent_nb);
8134− if (err)
8135− goto err_register_netevent_notifier;
8136−
81378112 err = mlxsw_sp_mp_hash_init(mlxsw_sp);
81388113 if (err)
81398114 goto err_mp_hash_init;
@@ -8142,6 +8117,22 @@ int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp, · 2 unmodified lines
81428117 if (err)
81438118 goto err_dscp_init;
81448119
8120+ router->inetaddr_nb.notifier_call = mlxsw_sp_inetaddr_event;
8121+ err = register_inetaddr_notifier(&router->inetaddr_nb);
8122+ if (err)
8123+ goto err_register_inetaddr_notifier;
8124+
8125+ router->inet6addr_nb.notifier_call = mlxsw_sp_inet6addr_event;
8126+ err = register_inet6addr_notifier(&router->inet6addr_nb);
8127+ if (err)
8128+ goto err_register_inet6addr_notifier;
8129+
8130+ mlxsw_sp->router->netevent_nb.notifier_call =
8131+ mlxsw_sp_router_netevent_event;
8132+ err = register_netevent_notifier(&mlxsw_sp->router->netevent_nb);
8133+ if (err)
8134+ goto err_register_netevent_notifier;
8135+
81458136 mlxsw_sp->router->fib_nb.notifier_call = mlxsw_sp_router_fib_event;
81468137 err = register_fib_notifier(mlxsw_sp_net(mlxsw_sp),
81478138 &mlxsw_sp->router->fib_nb,
@@ -8152,10 +8143,15 @@ int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp, · 4 unmodified lines
81528143 return 0;
81538144
81548145 err_register_fib_notifier:
8155−err_dscp_init:
8156−err_mp_hash_init:
81578146 unregister_netevent_notifier(&mlxsw_sp->router->netevent_nb);
81588147 err_register_netevent_notifier:
8148+ unregister_inet6addr_notifier(&router->inet6addr_nb);
8149+err_register_inet6addr_notifier:
8150+ unregister_inetaddr_notifier(&router->inetaddr_nb);
8151+err_register_inetaddr_notifier:
8152+ mlxsw_core_flush_owq();
8153+err_dscp_init:
8154+err_mp_hash_init:
81598155 mlxsw_sp_neigh_fini(mlxsw_sp);
81608156 err_neigh_init:
81618157 mlxsw_sp_vrs_fini(mlxsw_sp);
@@ -8174,10 +8170,6 @@ err_ipips_init: · 12 unmodified lines
81748170 err_rifs_init:
81758171 __mlxsw_sp_router_fini(mlxsw_sp);
81768172 err_router_init:
8177− unregister_inet6addr_notifier(&router->inet6addr_nb);
8178−err_register_inet6addr_notifier:
8179− unregister_inetaddr_notifier(&router->inetaddr_nb);
8180−err_register_inetaddr_notifier:
81818173 mutex_destroy(&mlxsw_sp->router->lock);
81828174 kfree(mlxsw_sp->router);
81838175 return err;
@@ -8188,6 +8180,9 @@ void mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp) · 4 unmodified lines
81888180 unregister_fib_notifier(mlxsw_sp_net(mlxsw_sp),
81898181 &mlxsw_sp->router->fib_nb);
81908182 unregister_netevent_notifier(&mlxsw_sp->router->netevent_nb);
8183+ unregister_inet6addr_notifier(&mlxsw_sp->router->inet6addr_nb);
8184+ unregister_inetaddr_notifier(&mlxsw_sp->router->inetaddr_nb);
8185+ mlxsw_core_flush_owq();
81918186 mlxsw_sp_neigh_fini(mlxsw_sp);
81928187 mlxsw_sp_vrs_fini(mlxsw_sp);
81938188 mlxsw_sp_mr_fini(mlxsw_sp);
@@ -8197,8 +8192,6 @@ void mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp) · 3 unmodified lines
81978192 mlxsw_sp_ipips_fini(mlxsw_sp);
81988193 mlxsw_sp_rifs_fini(mlxsw_sp);
81998194 __mlxsw_sp_router_fini(mlxsw_sp);
8200− unregister_inet6addr_notifier(&mlxsw_sp->router->inet6addr_nb);
8201− unregister_inetaddr_notifier(&mlxsw_sp->router->inetaddr_nb);
82028195 mutex_destroy(&mlxsw_sp->router->lock);
82038196 kfree(mlxsw_sp->router);
82048197 }
drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c+11−3
@@ -328,6 +328,9 @@ mlxsw_sp_trap_policer_items_arr[] = { · 327 unmodified lines
328328 {
329329 .policer = MLXSW_SP_TRAP_POLICER(18, 1024, 128),
330330 },
331+ {
332+ .policer = MLXSW_SP_TRAP_POLICER(19, 1024, 512),
333+ },
331334 };
332335
333336 static const struct mlxsw_sp_trap_group_item mlxsw_sp_trap_group_items_arr[] = {
@@ -421,6 +424,11 @@ static const struct mlxsw_sp_trap_group_item mlxsw_sp_trap_group_items_arr[] = { · 87 unmodified lines
421424 .hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_IP2ME,
422425 .priority = 2,
423426 },
427+ {
428+ .group = DEVLINK_TRAP_GROUP_GENERIC(EXTERNAL_DELIVERY, 19),
429+ .hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_EXTERNAL_ROUTE,
430+ .priority = 1,
431+ },
424432 {
425433 .group = DEVLINK_TRAP_GROUP_GENERIC(IPV6, 15),
426434 .hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_IPV6,
@@ -882,11 +890,11 @@ static const struct mlxsw_sp_trap_item mlxsw_sp_trap_items_arr[] = { · 455 unmodified lines
882890 },
883891 },
884892 {
885− .trap = MLXSW_SP_TRAP_CONTROL(EXTERNAL_ROUTE, LOCAL_DELIVERY,
893+ .trap = MLXSW_SP_TRAP_CONTROL(EXTERNAL_ROUTE, EXTERNAL_DELIVERY,
886894 TRAP),
887895 .listeners_arr = {
888− MLXSW_SP_RXL_MARK(RTR_INGRESS0, IP2ME, TRAP_TO_CPU,
889− false),
896+ MLXSW_SP_RXL_MARK(RTR_INGRESS0, EXTERNAL_ROUTE,
897+ TRAP_TO_CPU, false),
890898 },
891899 },
892900 {
drivers/net/ethernet/mscc/ocelot.c+5−5
@@ -748,21 +748,21 @@ void ocelot_get_txtstamp(struct ocelot *ocelot) · 747 unmodified lines
748748
749749 spin_unlock_irqrestore(&port->tx_skbs.lock, flags);
750750
751− /* Next ts */
752− ocelot_write(ocelot, SYS_PTP_NXT_PTP_NXT, SYS_PTP_NXT);
751+ /* Get the h/w timestamp */
752+ ocelot_get_hwtimestamp(ocelot, &ts);
753753
754754 if (unlikely(!skb_match))
755755 continue;
756756
757− /* Get the h/w timestamp */
758− ocelot_get_hwtimestamp(ocelot, &ts);
759−
760757 /* Set the timestamp into the skb */
761758 memset(&shhwtstamps, 0, sizeof(shhwtstamps));
762759 shhwtstamps.hwtstamp = ktime_set(ts.tv_sec, ts.tv_nsec);
763760 skb_tstamp_tx(skb_match, &shhwtstamps);
764761
765762 dev_kfree_skb_any(skb_match);
763+
764+ /* Next ts */
765+ ocelot_write(ocelot, SYS_PTP_NXT_PTP_NXT, SYS_PTP_NXT);
766766 }
767767 }
768768 EXPORT_SYMBOL(ocelot_get_txtstamp);
drivers/net/ethernet/neterion/vxge/vxge-main.c+1−1
@@ -98,7 +98,7 @@ static inline void VXGE_COMPLETE_VPATH_TX(struct vxge_fifo *fifo) · 97 unmodified lines
9898 {
9999 struct sk_buff **skb_ptr = NULL;
100100 struct sk_buff **temp;
101−#define NR_SKB_COMPLETED 128
101+#define NR_SKB_COMPLETED 16
102102 struct sk_buff *completed[NR_SKB_COMPLETED];
103103 int more;
104104
drivers/net/ethernet/ni/nixge.c+5−3
@@ -1299,19 +1299,21 @@ static int nixge_probe(struct platform_device *pdev) · 1298 unmodified lines
12991299 netif_napi_add(ndev, &priv->napi, nixge_poll, NAPI_POLL_WEIGHT);
13001300 err = nixge_of_get_resources(pdev);
13011301 if (err)
1302− return err;
1302+ goto free_netdev;
13031303 __nixge_hw_set_mac_address(ndev);
13041304
13051305 priv->tx_irq = platform_get_irq_byname(pdev, "tx");
13061306 if (priv->tx_irq < 0) {
13071307 netdev_err(ndev, "could not find 'tx' irq");
1308− return priv->tx_irq;
1308+ err = priv->tx_irq;
1309+ goto free_netdev;
13091310 }
13101311
13111312 priv->rx_irq = platform_get_irq_byname(pdev, "rx");
13121313 if (priv->rx_irq < 0) {
13131314 netdev_err(ndev, "could not find 'rx' irq");
1314− return priv->rx_irq;
1315+ err = priv->rx_irq;
1316+ goto free_netdev;
13151317 }
13161318
13171319 priv->coalesce_count_rx = XAXIDMA_DFT_RX_THRESHOLD;
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c+22−37
@@ -103,15 +103,18 @@ static void ionic_get_regs(struct net_device *netdev, struct ethtool_regs *regs, · 102 unmodified lines
103103 void *p)
104104 {
105105 struct ionic_lif *lif = netdev_priv(netdev);
106+ unsigned int offset;
106107 unsigned int size;
107108
108109 regs->version = IONIC_DEV_CMD_REG_VERSION;
109110
111+ offset = 0;
110112 size = IONIC_DEV_INFO_REG_COUNT * sizeof(u32);
111− memcpy_fromio(p, lif->ionic->idev.dev_info_regs->words, size);
113+ memcpy_fromio(p + offset, lif->ionic->idev.dev_info_regs->words, size);
112114
115+ offset += size;
113116 size = IONIC_DEV_CMD_REG_COUNT * sizeof(u32);
114− memcpy_fromio(p, lif->ionic->idev.dev_cmd_regs->words, size);
117+ memcpy_fromio(p + offset, lif->ionic->idev.dev_cmd_regs->words, size);
115118 }
116119
117120 static int ionic_get_link_ksettings(struct net_device *netdev,
@@ -468,12 +471,18 @@ static void ionic_get_ringparam(struct net_device *netdev, · 350 unmodified lines
468471 ring->rx_pending = lif->nrxq_descs;
469472 }
470473
474+static void ionic_set_ringsize(struct ionic_lif *lif, void *arg)
475+{
476+ struct ethtool_ringparam *ring = arg;
477+
478+ lif->ntxq_descs = ring->tx_pending;
479+ lif->nrxq_descs = ring->rx_pending;
480+}
481+
471482 static int ionic_set_ringparam(struct net_device *netdev,
472483 struct ethtool_ringparam *ring)
473484 {
474485 struct ionic_lif *lif = netdev_priv(netdev);
475− bool running;
476− int err;
477486
478487 if (ring->rx_mini_pending || ring->rx_jumbo_pending) {
479488 netdev_info(netdev, "Changing jumbo or mini descriptors not supported\n");
@@ -491,22 +500,7 @@ static int ionic_set_ringparam(struct net_device *netdev, · 11 unmodified lines
491500 ring->rx_pending == lif->nrxq_descs)
492501 return 0;
493502
494− err = ionic_wait_for_bit(lif, IONIC_LIF_F_QUEUE_RESET);
495− if (err)
496− return err;
497−
498− running = test_bit(IONIC_LIF_F_UP, lif->state);
499− if (running)
500− ionic_stop(netdev);
501−
502− lif->ntxq_descs = ring->tx_pending;
503− lif->nrxq_descs = ring->rx_pending;
504−
505− if (running)
506− ionic_open(netdev);
507− clear_bit(IONIC_LIF_F_QUEUE_RESET, lif->state);
508−
509− return 0;
503+ return ionic_reset_queues(lif, ionic_set_ringsize, ring);
510504 }
511505
512506 static void ionic_get_channels(struct net_device *netdev,
@@ -521,12 +515,17 @@ static void ionic_get_channels(struct net_device *netdev, · 8 unmodified lines
521515 ch->combined_count = lif->nxqs;
522516 }
523517
518+static void ionic_set_queuecount(struct ionic_lif *lif, void *arg)
519+{
520+ struct ethtool_channels *ch = arg;
521+
522+ lif->nxqs = ch->combined_count;
523+}
524+
524525 static int ionic_set_channels(struct net_device *netdev,
525526 struct ethtool_channels *ch)
526527 {
527528 struct ionic_lif *lif = netdev_priv(netdev);
528− bool running;
529− int err;
530529
531530 if (!ch->combined_count || ch->other_count ||
532531 ch->rx_count || ch->tx_count)
@@ -535,21 +534,7 @@ static int ionic_set_channels(struct net_device *netdev, · 2 unmodified lines
535534 if (ch->combined_count == lif->nxqs)
536535 return 0;
537536
538− err = ionic_wait_for_bit(lif, IONIC_LIF_F_QUEUE_RESET);
539− if (err)
540− return err;
541−
542− running = test_bit(IONIC_LIF_F_UP, lif->state);
543− if (running)
544− ionic_stop(netdev);
545−
546− lif->nxqs = ch->combined_count;
547−
548− if (running)
549− ionic_open(netdev);
550− clear_bit(IONIC_LIF_F_QUEUE_RESET, lif->state);
551−
552− return 0;
537+ return ionic_reset_queues(lif, ionic_set_queuecount, ch);
553538 }
554539
555540 static u32 ionic_get_priv_flags(struct net_device *netdev)
drivers/net/ethernet/pensando/ionic/ionic_lif.c+44−27
@@ -96,8 +96,7 @@ static void ionic_link_status_check(struct ionic_lif *lif) · 95 unmodified lines
9696 u16 link_status;
9797 bool link_up;
9898
99− if (!test_bit(IONIC_LIF_F_LINK_CHECK_REQUESTED, lif->state) ||
100− test_bit(IONIC_LIF_F_QUEUE_RESET, lif->state))
99+ if (!test_bit(IONIC_LIF_F_LINK_CHECK_REQUESTED, lif->state))
101100 return;
102101
103102 link_status = le16_to_cpu(lif->info->status.link_status);
@@ -114,16 +113,22 @@ static void ionic_link_status_check(struct ionic_lif *lif) · 10 unmodified lines
114113 netif_carrier_on(netdev);
115114 }
116115
117− if (lif->netdev->flags & IFF_UP && netif_running(lif->netdev))
116+ if (lif->netdev->flags & IFF_UP && netif_running(lif->netdev)) {
117+ mutex_lock(&lif->queue_lock);
118118 ionic_start_queues(lif);
119+ mutex_unlock(&lif->queue_lock);
120+ }
119121 } else {
120122 if (netif_carrier_ok(netdev)) {
121123 netdev_info(netdev, "Link down\n");
122124 netif_carrier_off(netdev);
123125 }
124126
125− if (lif->netdev->flags & IFF_UP && netif_running(lif->netdev))
127+ if (lif->netdev->flags & IFF_UP && netif_running(lif->netdev)) {
128+ mutex_lock(&lif->queue_lock);
126129 ionic_stop_queues(lif);
130+ mutex_unlock(&lif->queue_lock);
131+ }
127132 }
128133
129134 clear_bit(IONIC_LIF_F_LINK_CHECK_REQUESTED, lif->state);
@@ -863,8 +868,7 @@ static int ionic_lif_addr_add(struct ionic_lif *lif, const u8 *addr) · 733 unmodified lines
863868 if (f)
864869 return 0;
865870
866− netdev_dbg(lif->netdev, "rx_filter add ADDR %pM (id %d)\n", addr,
867− ctx.comp.rx_filter_add.filter_id);
871+ netdev_dbg(lif->netdev, "rx_filter add ADDR %pM\n", addr);
868872
869873 memcpy(ctx.cmd.rx_filter_add.mac.addr, addr, ETH_ALEN);
870874 err = ionic_adminq_post_wait(lif, &ctx);
@@ -893,6 +897,9 @@ static int ionic_lif_addr_del(struct ionic_lif *lif, const u8 *addr) · 22 unmodified lines
893897 return -ENOENT;
894898 }
895899
900+ netdev_dbg(lif->netdev, "rx_filter del ADDR %pM (id %d)\n",
901+ addr, f->filter_id);
902+
896903 ctx.cmd.rx_filter_del.filter_id = cpu_to_le32(f->filter_id);
897904 ionic_rx_filter_free(lif, f);
898905 spin_unlock_bh(&lif->rx_filters.lock);
@@ -901,9 +908,6 @@ static int ionic_lif_addr_del(struct ionic_lif *lif, const u8 *addr) · 2 unmodified lines
901908 if (err && err != -EEXIST)
902909 return err;
903910
904− netdev_dbg(lif->netdev, "rx_filter del ADDR %pM (id %d)\n", addr,
905− ctx.cmd.rx_filter_del.filter_id);
906−
907911 return 0;
908912 }
909913
@@ -1313,7 +1317,7 @@ static int ionic_change_mtu(struct net_device *netdev, int new_mtu) · 403 unmodified lines
13131317 return err;
13141318
13151319 netdev->mtu = new_mtu;
1316− err = ionic_reset_queues(lif);
1320+ err = ionic_reset_queues(lif, NULL, NULL);
13171321
13181322 return err;
13191323 }
@@ -1325,7 +1329,7 @@ static void ionic_tx_timeout_work(struct work_struct *ws) · 5 unmodified lines
13251329 netdev_info(lif->netdev, "Tx Timeout recovery\n");
13261330
13271331 rtnl_lock();
1328− ionic_reset_queues(lif);
1332+ ionic_reset_queues(lif, NULL, NULL);
13291333 rtnl_unlock();
13301334 }
13311335
@@ -1351,13 +1355,11 @@ static int ionic_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, · 19 unmodified lines
13511355 };
13521356 int err;
13531357
1358+ netdev_dbg(netdev, "rx_filter add VLAN %d\n", vid);
13541359 err = ionic_adminq_post_wait(lif, &ctx);
13551360 if (err)
13561361 return err;
13571362
1358− netdev_dbg(netdev, "rx_filter add VLAN %d (id %d)\n", vid,
1359− ctx.comp.rx_filter_add.filter_id);
1360−
13611363 return ionic_rx_filter_save(lif, 0, IONIC_RXQ_INDEX_ANY, 0, &ctx);
13621364 }
13631365
@@ -1382,8 +1384,8 @@ static int ionic_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, · 18 unmodified lines
13821384 return -ENOENT;
13831385 }
13841386
1385− netdev_dbg(netdev, "rx_filter del VLAN %d (id %d)\n", vid,
1386− le32_to_cpu(ctx.cmd.rx_filter_del.filter_id));
1387+ netdev_dbg(netdev, "rx_filter del VLAN %d (id %d)\n",
1388+ vid, f->filter_id);
13871389
13881390 ctx.cmd.rx_filter_del.filter_id = cpu_to_le32(f->filter_id);
13891391 ionic_rx_filter_free(lif, f);
@@ -1673,6 +1675,14 @@ int ionic_open(struct net_device *netdev) · 283 unmodified lines
16731675 if (err)
16741676 goto err_out;
16751677
1678+ err = netif_set_real_num_tx_queues(netdev, lif->nxqs);
1679+ if (err)
1680+ goto err_txrx_deinit;
1681+
1682+ err = netif_set_real_num_rx_queues(netdev, lif->nxqs);
1683+ if (err)
1684+ goto err_txrx_deinit;
1685+
16761686 /* don't start the queues until we have link */
16771687 if (netif_carrier_ok(netdev)) {
16781688 err = ionic_start_queues(lif);
@@ -1980,26 +1990,30 @@ static const struct net_device_ops ionic_netdev_ops = { · 301 unmodified lines
19801990 .ndo_get_vf_stats = ionic_get_vf_stats,
19811991 };
19821992
1983−int ionic_reset_queues(struct ionic_lif *lif)
1993+int ionic_reset_queues(struct ionic_lif *lif, ionic_reset_cb cb, void *arg)
19841994 {
19851995 bool running;
19861996 int err = 0;
19871997
1988− err = ionic_wait_for_bit(lif, IONIC_LIF_F_QUEUE_RESET);
1989− if (err)
1990− return err;
1991−
1998+ mutex_lock(&lif->queue_lock);
19921999 running = netif_running(lif->netdev);
19932000 if (running) {
19942001 netif_device_detach(lif->netdev);
19952002 err = ionic_stop(lif->netdev);
2003+ if (err)
2004+ goto reset_out;
19962005 }
1997− if (!err && running) {
1998− ionic_open(lif->netdev);
2006+
2007+ if (cb)
2008+ cb(lif, arg);
2009+
2010+ if (running) {
2011+ err = ionic_open(lif->netdev);
19992012 netif_device_attach(lif->netdev);
20002013 }
20012014
2002− clear_bit(IONIC_LIF_F_QUEUE_RESET, lif->state);
2015+reset_out:
2016+ mutex_unlock(&lif->queue_lock);
20032017
20042018 return err;
20052019 }
@@ -2146,7 +2160,9 @@ static void ionic_lif_handle_fw_down(struct ionic_lif *lif) · 140 unmodified lines
21462160
21472161 if (test_bit(IONIC_LIF_F_UP, lif->state)) {
21482162 dev_info(ionic->dev, "Surprise FW stop, stopping queues\n");
2163+ mutex_lock(&lif->queue_lock);
21492164 ionic_stop_queues(lif);
2165+ mutex_unlock(&lif->queue_lock);
21502166 }
21512167
21522168 if (netif_running(lif->netdev)) {
@@ -2265,15 +2281,15 @@ static void ionic_lif_deinit(struct ionic_lif *lif) · 112 unmodified lines
22652281 cancel_work_sync(&lif->deferred.work);
22662282 cancel_work_sync(&lif->tx_timeout_work);
22672283 ionic_rx_filters_deinit(lif);
2284+ if (lif->netdev->features & NETIF_F_RXHASH)
2285+ ionic_lif_rss_deinit(lif);
22682286 }
22692287
2270− if (lif->netdev->features & NETIF_F_RXHASH)
2271− ionic_lif_rss_deinit(lif);
2272−
22732288 napi_disable(&lif->adminqcq->napi);
22742289 ionic_lif_qcq_deinit(lif, lif->notifyqcq);
22752290 ionic_lif_qcq_deinit(lif, lif->adminqcq);
22762291
2292+ mutex_destroy(&lif->queue_lock);
22772293 ionic_lif_reset(lif);
22782294 }
22792295
@@ -2450,6 +2466,7 @@ static int ionic_lif_init(struct ionic_lif *lif) · 170 unmodified lines
24502466 return err;
24512467
24522468 lif->hw_index = le16_to_cpu(comp.hw_index);
2469+ mutex_init(&lif->queue_lock);
24532470
24542471 /* now that we have the hw_index we can figure out our doorbell page */
24552472 lif->dbid_count = le32_to_cpu(lif->ionic->ident.dev.ndbpgs_per_lif);
drivers/net/ethernet/pensando/ionic/ionic_lif.h+4−8
@@ -135,7 +135,6 @@ enum ionic_lif_state_flags { · 134 unmodified lines
135135 IONIC_LIF_F_SW_DEBUG_STATS,
136136 IONIC_LIF_F_UP,
137137 IONIC_LIF_F_LINK_CHECK_REQUESTED,
138− IONIC_LIF_F_QUEUE_RESET,
139138 IONIC_LIF_F_FW_RESET,
140139
141140 /* leave this as last */
@@ -165,6 +164,7 @@ struct ionic_lif { · 23 unmodified lines
165164 unsigned int hw_index;
166165 unsigned int kern_pid;
167166 u64 __iomem *kern_dbpage;
167+ struct mutex queue_lock; /* lock for queue structures */
168168 spinlock_t adminq_lock; /* lock for AdminQ operations */
169169 struct ionic_qcq *adminqcq;
170170 struct ionic_qcq *notifyqcq;
@@ -213,12 +213,6 @@ struct ionic_lif { · 42 unmodified lines
213213 #define lif_to_txq(lif, i) (&lif_to_txqcq((lif), i)->q)
214214 #define lif_to_rxq(lif, i) (&lif_to_txqcq((lif), i)->q)
215215
216−/* return 0 if successfully set the bit, else non-zero */
217−static inline int ionic_wait_for_bit(struct ionic_lif *lif, int bitname)
218−{
219− return wait_on_bit_lock(lif->state, bitname, TASK_INTERRUPTIBLE);
220−}
221−
222216 static inline u32 ionic_coal_usec_to_hw(struct ionic *ionic, u32 usecs)
223217 {
224218 u32 mult = le32_to_cpu(ionic->ident.dev.intr_coal_mult);
@@ -248,6 +242,8 @@ static inline u32 ionic_coal_hw_to_usec(struct ionic *ionic, u32 units) · 23 unmodified lines
248242 return (units * div) / mult;
249243 }
250244
245+typedef void (*ionic_reset_cb)(struct ionic_lif *lif, void *arg);
246+
251247 void ionic_link_status_check_request(struct ionic_lif *lif);
252248 void ionic_get_stats64(struct net_device *netdev,
253249 struct rtnl_link_stats64 *ns);
@@ -267,7 +263,7 @@ int ionic_lif_rss_config(struct ionic_lif *lif, u16 types, · 13 unmodified lines
267263
268264 int ionic_open(struct net_device *netdev);
269265 int ionic_stop(struct net_device *netdev);
270−int ionic_reset_queues(struct ionic_lif *lif);
266+int ionic_reset_queues(struct ionic_lif *lif, ionic_reset_cb cb, void *arg);
271267
272268 static inline void debug_stats_txq_post(struct ionic_qcq *qcq,
273269 struct ionic_txq_desc *desc, bool dbell)
drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c+29−0
@@ -21,13 +21,16 @@ void ionic_rx_filter_free(struct ionic_lif *lif, struct ionic_rx_filter *f) · 20 unmodified lines
2121 void ionic_rx_filter_replay(struct ionic_lif *lif)
2222 {
2323 struct ionic_rx_filter_add_cmd *ac;
24+ struct hlist_head new_id_list;
2425 struct ionic_admin_ctx ctx;
2526 struct ionic_rx_filter *f;
2627 struct hlist_head *head;
2728 struct hlist_node *tmp;
29+ unsigned int key;
2830 unsigned int i;
2931 int err;
3032
33+ INIT_HLIST_HEAD(&new_id_list);
3134 ac = &ctx.cmd.rx_filter_add;
3235
3336 for (i = 0; i < IONIC_RX_FILTER_HLISTS; i++) {
@@ -58,9 +61,30 @@ void ionic_rx_filter_replay(struct ionic_lif *lif) · 24 unmodified lines
5861 ac->mac.addr);
5962 break;
6063 }
64+ spin_lock_bh(&lif->rx_filters.lock);
65+ ionic_rx_filter_free(lif, f);
66+ spin_unlock_bh(&lif->rx_filters.lock);
67+
68+ continue;
6169 }
70+
71+ /* remove from old id list, save new id in tmp list */
72+ spin_lock_bh(&lif->rx_filters.lock);
73+ hlist_del(&f->by_id);
74+ spin_unlock_bh(&lif->rx_filters.lock);
75+ f->filter_id = le32_to_cpu(ctx.comp.rx_filter_add.filter_id);
76+ hlist_add_head(&f->by_id, &new_id_list);
6277 }
6378 }
79+
80+ /* rebuild the by_id hash lists with the new filter ids */
81+ spin_lock_bh(&lif->rx_filters.lock);
82+ hlist_for_each_entry_safe(f, tmp, &new_id_list, by_id) {
83+ key = f->filter_id & IONIC_RX_FILTER_HLISTS_MASK;
84+ head = &lif->rx_filters.by_id[key];
85+ hlist_add_head(&f->by_id, head);
86+ }
87+ spin_unlock_bh(&lif->rx_filters.lock);
6488 }
6589
6690 int ionic_rx_filters_init(struct ionic_lif *lif)
@@ -69,10 +93,12 @@ int ionic_rx_filters_init(struct ionic_lif *lif) · 2 unmodified lines
6993
7094 spin_lock_init(&lif->rx_filters.lock);
7195
96+ spin_lock_bh(&lif->rx_filters.lock);
7297 for (i = 0; i < IONIC_RX_FILTER_HLISTS; i++) {
7398 INIT_HLIST_HEAD(&lif->rx_filters.by_hash[i]);
7499 INIT_HLIST_HEAD(&lif->rx_filters.by_id[i]);
75100 }
101+ spin_unlock_bh(&lif->rx_filters.lock);
76102
77103 return 0;
78104 }
@@ -84,11 +110,13 @@ void ionic_rx_filters_deinit(struct ionic_lif *lif) · 5 unmodified lines
84110 struct hlist_node *tmp;
85111 unsigned int i;
86112
113+ spin_lock_bh(&lif->rx_filters.lock);
87114 for (i = 0; i < IONIC_RX_FILTER_HLISTS; i++) {
88115 head = &lif->rx_filters.by_id[i];
89116 hlist_for_each_entry_safe(f, tmp, head, by_id)
90117 ionic_rx_filter_free(lif, f);
91118 }
119+ spin_unlock_bh(&lif->rx_filters.lock);
92120 }
93121
94122 int ionic_rx_filter_save(struct ionic_lif *lif, u32 flow_id, u16 rxq_index,
@@ -124,6 +152,7 @@ int ionic_rx_filter_save(struct ionic_lif *lif, u32 flow_id, u16 rxq_index, · 29 unmodified lines
124152 f->filter_id = le32_to_cpu(ctx->comp.rx_filter_add.filter_id);
125153 f->rxq_index = rxq_index;
126154 memcpy(&f->cmd, ac, sizeof(f->cmd));
155+ netdev_dbg(lif->netdev, "rx_filter add filter_id %d\n", f->filter_id);
127156
128157 INIT_HLIST_NODE(&f->by_hash);
129158 INIT_HLIST_NODE(&f->by_id);
drivers/net/ethernet/pensando/ionic/ionic_txrx.c+0−6
@@ -161,12 +161,6 @@ static void ionic_rx_clean(struct ionic_queue *q, · 160 unmodified lines
161161 return;
162162 }
163163
164− /* no packet processing while resetting */
165− if (unlikely(test_bit(IONIC_LIF_F_QUEUE_RESET, q->lif->state))) {
166− stats->dropped++;
167− return;
168− }
169−
170164 stats->pkts++;
171165 stats->bytes += le16_to_cpu(comp->len);
172166
drivers/net/ethernet/qlogic/qed/qed.h+2−0
@@ -876,6 +876,8 @@ struct qed_dev { · 875 unmodified lines
876876 struct qed_dbg_feature dbg_features[DBG_FEATURE_NUM];
877877 u8 engine_for_debug;
878878 bool disable_ilt_dump;
879+ bool dbg_bin_dump;
880+
879881 DECLARE_HASHTABLE(connections, 10);
880882 const struct firmware *firmware;
881883
drivers/net/ethernet/qlogic/qed/qed_cxt.c+2−2
@@ -2008,8 +2008,8 @@ static void qed_rdma_set_pf_params(struct qed_hwfn *p_hwfn, · 2007 unmodified lines
20082008 enum protocol_type proto;
20092009
20102010 if (p_hwfn->mcp_info->func_info.protocol == QED_PCI_ETH_RDMA) {
2011− DP_NOTICE(p_hwfn,
2012− "Current day drivers don't support RoCE & iWARP simultaneously on the same PF. Default to RoCE-only\n");
2011+ DP_VERBOSE(p_hwfn, QED_MSG_SP,
2012+ "Current day drivers don't support RoCE & iWARP simultaneously on the same PF. Default to RoCE-only\n");
20132013 p_hwfn->hw_info.personality = QED_PCI_ETH_ROCE;
20142014 }
20152015
drivers/net/ethernet/qlogic/qed/qed_debug.c+16−1
@@ -7506,6 +7506,12 @@ static enum dbg_status format_feature(struct qed_hwfn *p_hwfn, · 7505 unmodified lines
75067506 if (p_hwfn->cdev->print_dbg_data)
75077507 qed_dbg_print_feature(text_buf, text_size_bytes);
75087508
7509+ /* Just return the original binary buffer if requested */
7510+ if (p_hwfn->cdev->dbg_bin_dump) {
7511+ vfree(text_buf);
7512+ return DBG_STATUS_OK;
7513+ }
7514+
75097515 /* Free the old dump_buf and point the dump_buf to the newly allocagted
75107516 * and formatted text buffer.
75117517 */
@@ -7733,7 +7739,9 @@ int qed_dbg_mcp_trace_size(struct qed_dev *cdev) · 221 unmodified lines
77337739 #define REGDUMP_HEADER_SIZE_SHIFT 0
77347740 #define REGDUMP_HEADER_SIZE_MASK 0xffffff
77357741 #define REGDUMP_HEADER_FEATURE_SHIFT 24
7736−#define REGDUMP_HEADER_FEATURE_MASK 0x3f
7742+#define REGDUMP_HEADER_FEATURE_MASK 0x1f
7743+#define REGDUMP_HEADER_BIN_DUMP_SHIFT 29
7744+#define REGDUMP_HEADER_BIN_DUMP_MASK 0x1
77377745 #define REGDUMP_HEADER_OMIT_ENGINE_SHIFT 30
77387746 #define REGDUMP_HEADER_OMIT_ENGINE_MASK 0x1
77397747 #define REGDUMP_HEADER_ENGINE_SHIFT 31
@@ -7771,6 +7779,7 @@ static u32 qed_calc_regdump_header(struct qed_dev *cdev, · 31 unmodified lines
77717779 feature, feature_size);
77727780
77737781 SET_FIELD(res, REGDUMP_HEADER_FEATURE, feature);
7782+ SET_FIELD(res, REGDUMP_HEADER_BIN_DUMP, 1);
77747783 SET_FIELD(res, REGDUMP_HEADER_OMIT_ENGINE, omit_engine);
77757784 SET_FIELD(res, REGDUMP_HEADER_ENGINE, engine);
77767785
@@ -7794,6 +7803,7 @@ int qed_dbg_all_data(struct qed_dev *cdev, void *buffer) · 17 unmodified lines
77947803 omit_engine = 1;
77957804
77967805 mutex_lock(&qed_dbg_lock);
7806+ cdev->dbg_bin_dump = true;
77977807
77987808 org_engine = qed_get_debug_engine(cdev);
77997809 for (cur_engine = 0; cur_engine < cdev->num_hwfns; cur_engine++) {
@@ -7931,6 +7941,10 @@ int qed_dbg_all_data(struct qed_dev *cdev, void *buffer) · 131 unmodified lines
79317941 DP_ERR(cdev, "qed_dbg_mcp_trace failed. rc = %d\n", rc);
79327942 }
79337943
7944+ /* Re-populate nvm attribute info */
7945+ qed_mcp_nvm_info_free(p_hwfn);
7946+ qed_mcp_nvm_info_populate(p_hwfn);
7947+
79347948 /* nvm cfg1 */
79357949 rc = qed_dbg_nvm_image(cdev,
79367950 (u8 *)buffer + offset +
@@ -7993,6 +8007,7 @@ int qed_dbg_all_data(struct qed_dev *cdev, void *buffer) · 56 unmodified lines
79938007 QED_NVM_IMAGE_MDUMP, "QED_NVM_IMAGE_MDUMP", rc);
79948008 }
79958009
8010+ cdev->dbg_bin_dump = false;
79968011 mutex_unlock(&qed_dbg_lock);
79978012
79988013 return 0;
drivers/net/ethernet/qlogic/qed/qed_dev.c+4−10
@@ -3102,7 +3102,7 @@ int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params) · 3101 unmodified lines
31023102 }
31033103
31043104 /* Log and clear previous pglue_b errors if such exist */
3105− qed_pglueb_rbc_attn_handler(p_hwfn, p_hwfn->p_main_ptt);
3105+ qed_pglueb_rbc_attn_handler(p_hwfn, p_hwfn->p_main_ptt, true);
31063106
31073107 /* Enable the PF's internal FID_enable in the PXP */
31083108 rc = qed_pglueb_set_pfid_enable(p_hwfn, p_hwfn->p_main_ptt,
@@ -4472,12 +4472,6 @@ static int qed_get_dev_info(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) · 1363 unmodified lines
44724472 return 0;
44734473 }
44744474
4475−static void qed_nvm_info_free(struct qed_hwfn *p_hwfn)
4476−{
4477− kfree(p_hwfn->nvm_info.image_att);
4478− p_hwfn->nvm_info.image_att = NULL;
4479−}
4480−
44814475 static int qed_hw_prepare_single(struct qed_hwfn *p_hwfn,
44824476 void __iomem *p_regview,
44834477 void __iomem *p_doorbells,
@@ -4562,7 +4556,7 @@ static int qed_hw_prepare_single(struct qed_hwfn *p_hwfn, · 78 unmodified lines
45624556 return rc;
45634557 err3:
45644558 if (IS_LEAD_HWFN(p_hwfn))
4565− qed_nvm_info_free(p_hwfn);
4559+ qed_mcp_nvm_info_free(p_hwfn);
45664560 err2:
45674561 if (IS_LEAD_HWFN(p_hwfn))
45684562 qed_iov_free_hw_info(p_hwfn->cdev);
@@ -4623,7 +4617,7 @@ int qed_hw_prepare(struct qed_dev *cdev, · 54 unmodified lines
46234617 if (rc) {
46244618 if (IS_PF(cdev)) {
46254619 qed_init_free(p_hwfn);
4626− qed_nvm_info_free(p_hwfn);
4620+ qed_mcp_nvm_info_free(p_hwfn);
46274621 qed_mcp_free(p_hwfn);
46284622 qed_hw_hwfn_free(p_hwfn);
46294623 }
@@ -4657,7 +4651,7 @@ void qed_hw_remove(struct qed_dev *cdev) · 27 unmodified lines
46574651
46584652 qed_iov_free_hw_info(cdev);
46594653
4660− qed_nvm_info_free(p_hwfn);
4654+ qed_mcp_nvm_info_free(p_hwfn);
46614655 }
46624656
46634657 static void qed_chain_free_next_ptr(struct qed_dev *cdev,
drivers/net/ethernet/qlogic/qed/qed_int.c+31−22
@@ -257,9 +257,10 @@ out: · 256 unmodified lines
257257 #define PGLUE_ATTENTION_ZLR_VALID (1 << 25)
258258 #define PGLUE_ATTENTION_ILT_VALID (1 << 23)
259259
260−int qed_pglueb_rbc_attn_handler(struct qed_hwfn *p_hwfn,
261− struct qed_ptt *p_ptt)
260+int qed_pglueb_rbc_attn_handler(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
261+ bool hw_init)
262262 {
263+ char msg[256];
263264 u32 tmp;
264265
265266 tmp = qed_rd(p_hwfn, p_ptt, PGLUE_B_REG_TX_ERR_WR_DETAILS2);
@@ -273,22 +274,23 @@ int qed_pglueb_rbc_attn_handler(struct qed_hwfn *p_hwfn, · 7 unmodified lines
273274 details = qed_rd(p_hwfn, p_ptt,
274275 PGLUE_B_REG_TX_ERR_WR_DETAILS);
275276
276− DP_NOTICE(p_hwfn,
277− "Illegal write by chip to [%08x:%08x] blocked.\n"
278− "Details: %08x [PFID %02x, VFID %02x, VF_VALID %02x]\n"
279− "Details2 %08x [Was_error %02x BME deassert %02x FID_enable deassert %02x]\n",
280− addr_hi, addr_lo, details,
281− (u8)GET_FIELD(details, PGLUE_ATTENTION_DETAILS_PFID),
282− (u8)GET_FIELD(details, PGLUE_ATTENTION_DETAILS_VFID),
283− GET_FIELD(details,
284− PGLUE_ATTENTION_DETAILS_VF_VALID) ? 1 : 0,
285− tmp,
286− GET_FIELD(tmp,
287− PGLUE_ATTENTION_DETAILS2_WAS_ERR) ? 1 : 0,
288− GET_FIELD(tmp,
289− PGLUE_ATTENTION_DETAILS2_BME) ? 1 : 0,
290− GET_FIELD(tmp,
291− PGLUE_ATTENTION_DETAILS2_FID_EN) ? 1 : 0);
277+ snprintf(msg, sizeof(msg),
278+ "Illegal write by chip to [%08x:%08x] blocked.\n"
279+ "Details: %08x [PFID %02x, VFID %02x, VF_VALID %02x]\n"
280+ "Details2 %08x [Was_error %02x BME deassert %02x FID_enable deassert %02x]",
281+ addr_hi, addr_lo, details,
282+ (u8)GET_FIELD(details, PGLUE_ATTENTION_DETAILS_PFID),
283+ (u8)GET_FIELD(details, PGLUE_ATTENTION_DETAILS_VFID),
284+ !!GET_FIELD(details, PGLUE_ATTENTION_DETAILS_VF_VALID),
285+ tmp,
286+ !!GET_FIELD(tmp, PGLUE_ATTENTION_DETAILS2_WAS_ERR),
287+ !!GET_FIELD(tmp, PGLUE_ATTENTION_DETAILS2_BME),
288+ !!GET_FIELD(tmp, PGLUE_ATTENTION_DETAILS2_FID_EN));
289+
290+ if (hw_init)
291+ DP_VERBOSE(p_hwfn, NETIF_MSG_INTR, "%s\n", msg);
292+ else
293+ DP_NOTICE(p_hwfn, "%s\n", msg);
292294 }
293295
294296 tmp = qed_rd(p_hwfn, p_ptt, PGLUE_B_REG_TX_ERR_RD_DETAILS2);
@@ -321,8 +323,14 @@ int qed_pglueb_rbc_attn_handler(struct qed_hwfn *p_hwfn, · 26 unmodified lines
321323 }
322324
323325 tmp = qed_rd(p_hwfn, p_ptt, PGLUE_B_REG_TX_ERR_WR_DETAILS_ICPL);
324− if (tmp & PGLUE_ATTENTION_ICPL_VALID)
325− DP_NOTICE(p_hwfn, "ICPL error - %08x\n", tmp);
326+ if (tmp & PGLUE_ATTENTION_ICPL_VALID) {
327+ snprintf(msg, sizeof(msg), "ICPL error - %08x", tmp);
328+
329+ if (hw_init)
330+ DP_VERBOSE(p_hwfn, NETIF_MSG_INTR, "%s\n", msg);
331+ else
332+ DP_NOTICE(p_hwfn, "%s\n", msg);
333+ }
326334
327335 tmp = qed_rd(p_hwfn, p_ptt, PGLUE_B_REG_MASTER_ZLR_ERR_DETAILS);
328336 if (tmp & PGLUE_ATTENTION_ZLR_VALID) {
@@ -361,7 +369,7 @@ int qed_pglueb_rbc_attn_handler(struct qed_hwfn *p_hwfn, · 32 unmodified lines
361369
362370 static int qed_pglueb_rbc_attn_cb(struct qed_hwfn *p_hwfn)
363371 {
364− return qed_pglueb_rbc_attn_handler(p_hwfn, p_hwfn->p_dpc_ptt);
372+ return qed_pglueb_rbc_attn_handler(p_hwfn, p_hwfn->p_dpc_ptt, false);
365373 }
366374
367375 static int qed_fw_assertion(struct qed_hwfn *p_hwfn)
@@ -1193,7 +1201,8 @@ static int qed_int_attentions(struct qed_hwfn *p_hwfn) · 825 unmodified lines
11931201 index, attn_bits, attn_acks, asserted_bits,
11941202 deasserted_bits, p_sb_attn_sw->known_attn);
11951203 } else if (asserted_bits == 0x100) {
1196− DP_INFO(p_hwfn, "MFW indication via attention\n");
1204+ DP_VERBOSE(p_hwfn, NETIF_MSG_INTR,
1205+ "MFW indication via attention\n");
11971206 } else {
11981207 DP_VERBOSE(p_hwfn, NETIF_MSG_INTR,
11991208 "MFW indication [deassertion]\n");
drivers/net/ethernet/qlogic/qed/qed_int.h+2−2
@@ -442,7 +442,7 @@ int qed_int_set_timer_res(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, · 441 unmodified lines
442442
443443 #define QED_MAPPING_MEMORY_SIZE(dev) (NUM_OF_SBS(dev))
444444
445−int qed_pglueb_rbc_attn_handler(struct qed_hwfn *p_hwfn,
446− struct qed_ptt *p_ptt);
445+int qed_pglueb_rbc_attn_handler(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
446+ bool hw_init);
447447
448448 #endif
drivers/net/ethernet/qlogic/qed/qed_mcp.c+7−0
@@ -3280,6 +3280,13 @@ err0: · 3279 unmodified lines
32803280 return rc;
32813281 }
32823282
3283+void qed_mcp_nvm_info_free(struct qed_hwfn *p_hwfn)
3284+{
3285+ kfree(p_hwfn->nvm_info.image_att);
3286+ p_hwfn->nvm_info.image_att = NULL;
3287+ p_hwfn->nvm_info.valid = false;
3288+}
3289+
32833290 int
32843291 qed_mcp_get_nvm_image_att(struct qed_hwfn *p_hwfn,
32853292 enum qed_nvm_images image_id,
drivers/net/ethernet/qlogic/qed/qed_mcp.h+7−0
@@ -1220,6 +1220,13 @@ void qed_mcp_read_ufp_config(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt); · 1219 unmodified lines
12201220 */
12211221 int qed_mcp_nvm_info_populate(struct qed_hwfn *p_hwfn);
12221222
1223+/**
1224+ * @brief Delete nvm info shadow in the given hardware function
1225+ *
1226+ * @param p_hwfn
1227+ */
1228+void qed_mcp_nvm_info_free(struct qed_hwfn *p_hwfn);
1229+
12231230 /**
12241231 * @brief Get the engine affinity configuration.
12251232 *
drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c+13−5
@@ -47,15 +47,23 @@ static int rmnet_unregister_real_device(struct net_device *real_dev) · 46 unmodified lines
4747 return 0;
4848 }
4949
50−static int rmnet_register_real_device(struct net_device *real_dev)
50+static int rmnet_register_real_device(struct net_device *real_dev,
51+ struct netlink_ext_ack *extack)
5152 {
5253 struct rmnet_port *port;
5354 int rc, entry;
5455
5556 ASSERT_RTNL();
5657
57− if (rmnet_is_real_dev_registered(real_dev))
58+ if (rmnet_is_real_dev_registered(real_dev)) {
59+ port = rmnet_get_port_rtnl(real_dev);
60+ if (port->rmnet_mode != RMNET_EPMODE_VND) {
61+ NL_SET_ERR_MSG_MOD(extack, "bridge device already exists");
62+ return -EINVAL;
63+ }
64+
5865 return 0;
66+ }
5967
6068 port = kzalloc(sizeof(*port), GFP_KERNEL);
6169 if (!port)
@@ -133,7 +141,7 @@ static int rmnet_newlink(struct net *src_net, struct net_device *dev, · 71 unmodified lines
133141
134142 mux_id = nla_get_u16(data[IFLA_RMNET_MUX_ID]);
135143
136− err = rmnet_register_real_device(real_dev);
144+ err = rmnet_register_real_device(real_dev, extack);
137145 if (err)
138146 goto err0;
139147
@@ -422,7 +430,7 @@ int rmnet_add_bridge(struct net_device *rmnet_dev, · 282 unmodified lines
422430 }
423431
424432 if (port->rmnet_mode != RMNET_EPMODE_VND) {
425− NL_SET_ERR_MSG_MOD(extack, "bridge device already exists");
433+ NL_SET_ERR_MSG_MOD(extack, "more than one bridge dev attached");
426434 return -EINVAL;
427435 }
428436
@@ -433,7 +441,7 @@ int rmnet_add_bridge(struct net_device *rmnet_dev, · 4 unmodified lines
433441 return -EBUSY;
434442 }
435443
436− err = rmnet_register_real_device(slave_dev);
444+ err = rmnet_register_real_device(slave_dev, extack);
437445 if (err)
438446 return -EBUSY;
439447
drivers/net/ethernet/renesas/ravb_main.c+24−2
@@ -1450,6 +1450,7 @@ static void ravb_tx_timeout_work(struct work_struct *work) · 1449 unmodified lines
14501450 struct ravb_private *priv = container_of(work, struct ravb_private,
14511451 work);
14521452 struct net_device *ndev = priv->ndev;
1453+ int error;
14531454
14541455 netif_tx_stop_all_queues(ndev);
14551456
@@ -1458,15 +1459,36 @@ static void ravb_tx_timeout_work(struct work_struct *work) · 2 unmodified lines
14581459 ravb_ptp_stop(ndev);
14591460
14601461 /* Wait for DMA stopping */
1461− ravb_stop_dma(ndev);
1462+ if (ravb_stop_dma(ndev)) {
1463+ /* If ravb_stop_dma() fails, the hardware is still operating
1464+ * for TX and/or RX. So, this should not call the following
1465+ * functions because ravb_dmac_init() is possible to fail too.
1466+ * Also, this should not retry ravb_stop_dma() again and again
1467+ * here because it's possible to wait forever. So, this just
1468+ * re-enables the TX and RX and skip the following
1469+ * re-initialization procedure.
1470+ */
1471+ ravb_rcv_snd_enable(ndev);
1472+ goto out;
1473+ }
14621474
14631475 ravb_ring_free(ndev, RAVB_BE);
14641476 ravb_ring_free(ndev, RAVB_NC);
14651477
14661478 /* Device init */
1467− ravb_dmac_init(ndev);
1479+ error = ravb_dmac_init(ndev);
1480+ if (error) {
1481+ /* If ravb_dmac_init() fails, descriptors are freed. So, this
1482+ * should return here to avoid re-enabling the TX and RX in
1483+ * ravb_emac_init().
1484+ */
1485+ netdev_err(ndev, "%s: ravb_dmac_init() failed, error %d\n",
1486+ __func__, error);
1487+ return;
1488+ }
14681489 ravb_emac_init(ndev);
14691490
1491+out:
14701492 /* Initialise PTP Clock driver */
14711493 if (priv->chip_id == RCAR_GEN2)
14721494 ravb_ptp_init(ndev, priv->pdev);
drivers/net/ethernet/smsc/smc91x.c+2−2
@@ -2274,7 +2274,7 @@ static int smc_drv_probe(struct platform_device *pdev) · 2273 unmodified lines
22742274 ret = try_toggle_control_gpio(&pdev->dev, &lp->power_gpio,
22752275 "power", 0, 0, 100);
22762276 if (ret)
2277− return ret;
2277+ goto out_free_netdev;
22782278
22792279 /*
22802280 * Optional reset GPIO configured? Minimum 100 ns reset needed
@@ -2283,7 +2283,7 @@ static int smc_drv_probe(struct platform_device *pdev) · 2 unmodified lines
22832283 ret = try_toggle_control_gpio(&pdev->dev, &lp->reset_gpio,
22842284 "reset", 0, 0, 100);
22852285 if (ret)
2286− return ret;
2286+ goto out_free_netdev;
22872287
22882288 /*
22892289 * Need to wait for optional EEPROM to load, max 750 us according
drivers/net/ethernet/socionext/sni_ave.c+1−1
@@ -1191,7 +1191,7 @@ static int ave_init(struct net_device *ndev) · 1190 unmodified lines
11911191 ret = regmap_update_bits(priv->regmap, SG_ETPINMODE,
11921192 priv->pinmode_mask, priv->pinmode_val);
11931193 if (ret)
1194− return ret;
1194+ goto out_reset_assert;
11951195
11961196 ave_global_reset(ndev);
11971197
drivers/net/ethernet/ti/am65-cpsw-nuss.c+2−1
@@ -1850,7 +1850,8 @@ static int am65_cpsw_nuss_init_ndev_2g(struct am65_cpsw_common *common) · 1849 unmodified lines
18501850 port->ndev->max_mtu = AM65_CPSW_MAX_PACKET_SIZE;
18511851 port->ndev->hw_features = NETIF_F_SG |
18521852 NETIF_F_RXCSUM |
1853− NETIF_F_HW_CSUM;
1853+ NETIF_F_HW_CSUM |
1854+ NETIF_F_HW_TC;
18541855 port->ndev->features = port->ndev->hw_features |
18551856 NETIF_F_HW_VLAN_CTAG_FILTER;
18561857 port->ndev->vlan_features |= NETIF_F_SG;
drivers/net/geneve.c+1−1
@@ -1615,11 +1615,11 @@ static int geneve_changelink(struct net_device *dev, struct nlattr *tb[], · 1614 unmodified lines
16151615 struct netlink_ext_ack *extack)
16161616 {
16171617 struct geneve_dev *geneve = netdev_priv(dev);
1618+ enum ifla_geneve_df df = geneve->df;
16181619 struct geneve_sock *gs4, *gs6;
16191620 struct ip_tunnel_info info;
16201621 bool metadata;
16211622 bool use_udp6_rx_checksums;
1622− enum ifla_geneve_df df;
16231623 bool ttl_inherit;
16241624 int err;
16251625
drivers/net/hippi/rrunner.c+1−1
@@ -1242,7 +1242,7 @@ static int rr_open(struct net_device *dev) · 1241 unmodified lines
12421242 rrpriv->info = NULL;
12431243 }
12441244 if (rrpriv->rx_ctrl) {
1245− pci_free_consistent(pdev, sizeof(struct ring_ctrl),
1245+ pci_free_consistent(pdev, 256 * sizeof(struct ring_ctrl),
12461246 rrpriv->rx_ctrl, rrpriv->rx_ctrl_dma);
12471247 rrpriv->rx_ctrl = NULL;
12481248 }
drivers/net/ieee802154/adf7242.c+4−2
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 *
55 * Copyright 2009-2017 Analog Devices Inc.
66 *
7− * http://www.analog.com/ADF7242
7+ * https://www.analog.com/ADF7242
88 */
99
1010 #include <linux/kernel.h>
@@ -1262,7 +1262,7 @@ static int adf7242_probe(struct spi_device *spi) · 1251 unmodified lines
12621262 WQ_MEM_RECLAIM);
12631263 if (unlikely(!lp->wqueue)) {
12641264 ret = -ENOMEM;
1265− goto err_hw_init;
1265+ goto err_alloc_wq;
12661266 }
12671267
12681268 ret = adf7242_hw_init(lp);
@@ -1294,6 +1294,8 @@ static int adf7242_probe(struct spi_device *spi) · 25 unmodified lines
12941294 return ret;
12951295
12961296 err_hw_init:
1297+ destroy_workqueue(lp->wqueue);
1298+err_alloc_wq:
12971299 mutex_destroy(&lp->bmux);
12981300 ieee802154_free_hw(lp->hw);
12991301
drivers/net/ipa/gsi.c+7−9
@@ -500,6 +500,13 @@ static int gsi_channel_stop_command(struct gsi_channel *channel) · 499 unmodified lines
500500 int ret;
501501
502502 state = gsi_channel_state(channel);
503+
504+ /* Channel could have entered STOPPED state since last call
505+ * if it timed out. If so, we're done.
506+ */
507+ if (state == GSI_CHANNEL_STATE_STOPPED)
508+ return 0;
509+
503510 if (state != GSI_CHANNEL_STATE_STARTED &&
504511 state != GSI_CHANNEL_STATE_STOP_IN_PROC)
505512 return -EINVAL;
@@ -789,20 +796,11 @@ int gsi_channel_start(struct gsi *gsi, u32 channel_id) · 283 unmodified lines
789796 int gsi_channel_stop(struct gsi *gsi, u32 channel_id)
790797 {
791798 struct gsi_channel *channel = &gsi->channel[channel_id];
792− enum gsi_channel_state state;
793799 u32 retries;
794800 int ret;
795801
796802 gsi_channel_freeze(channel);
797803
798− /* Channel could have entered STOPPED state since last call if the
799− * STOP command timed out. We won't stop a channel if stopping it
800− * was successful previously (so we still want the freeze above).
801− */
802− state = gsi_channel_state(channel);
803− if (state == GSI_CHANNEL_STATE_STOPPED)
804− return 0;
805−
806804 /* RX channels might require a little time to enter STOPPED state */
807805 retries = channel->toward_ipa ? 0 : GSI_CHANNEL_STOP_RX_RETRIES;
808806
drivers/net/ipa/ipa_cmd.c+15−0
@@ -586,6 +586,21 @@ u32 ipa_cmd_tag_process_count(void) · 585 unmodified lines
586586 return 4;
587587 }
588588
589+void ipa_cmd_tag_process(struct ipa *ipa)
590+{
591+ u32 count = ipa_cmd_tag_process_count();
592+ struct gsi_trans *trans;
593+
594+ trans = ipa_cmd_trans_alloc(ipa, count);
595+ if (trans) {
596+ ipa_cmd_tag_process_add(trans);
597+ gsi_trans_commit_wait(trans);
598+ } else {
599+ dev_err(&ipa->pdev->dev,
600+ "error allocating %u entry tag transaction\n", count);
601+ }
602+}
603+
589604 static struct ipa_cmd_info *
590605 ipa_cmd_info_alloc(struct ipa_endpoint *endpoint, u32 tre_count)
591606 {
drivers/net/ipa/ipa_cmd.h+8−0
@@ -171,6 +171,14 @@ void ipa_cmd_tag_process_add(struct gsi_trans *trans); · 170 unmodified lines
171171 */
172172 u32 ipa_cmd_tag_process_count(void);
173173
174+/**
175+ * ipa_cmd_tag_process() - Perform a tag process
176+ *
177+ * @Return: The number of elements to allocate in a transaction
178+ * to hold tag process commands
179+ */
180+void ipa_cmd_tag_process(struct ipa *ipa);
181+
174182 /**
175183 * ipa_cmd_trans_alloc() - Allocate a transaction for the command TX endpoint
176184 * @ipa: IPA pointer
drivers/net/ipa/ipa_data-sdm845.c+0−1
@@ -44,7 +44,6 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { · 43 unmodified lines
4444 .endpoint = {
4545 .seq_type = IPA_SEQ_INVALID,
4646 .config = {
47− .checksum = true,
4847 .aggregation = true,
4948 .status_enable = true,
5049 .rx = {
drivers/net/ipa/ipa_endpoint.c+2−0
@@ -1450,6 +1450,8 @@ void ipa_endpoint_suspend(struct ipa *ipa) · 1449 unmodified lines
14501450 if (ipa->modem_netdev)
14511451 ipa_modem_suspend(ipa->modem_netdev);
14521452
1453+ ipa_cmd_tag_process(ipa);
1454+
14531455 ipa_endpoint_suspend_one(ipa->name_map[IPA_ENDPOINT_AP_LAN_RX]);
14541456 ipa_endpoint_suspend_one(ipa->name_map[IPA_ENDPOINT_AP_COMMAND_TX]);
14551457 }
drivers/net/ipa/ipa_gsi.c+1−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66
77 #include <linux/types.h>
88
9+#include "ipa_gsi.h"
910 #include "gsi_trans.h"
1011 #include "ipa.h"
1112 #include "ipa_endpoint.h"
drivers/net/ipa/ipa_gsi.h+2−0
@@ -8,7 +8,9 @@ · 7 unmodified lines
88
99 #include <linux/types.h>
1010
11+struct gsi;
1112 struct gsi_trans;
13+struct ipa_gsi_endpoint_data;
1214
1315 /**
1416 * ipa_gsi_trans_complete() - GSI transaction completion callback
drivers/net/ipa/ipa_qmi_msg.c+3−3
@@ -119,7 +119,7 @@ struct qmi_elem_info ipa_driver_init_complete_rsp_ei[] = { · 118 unmodified lines
119119 sizeof_field(struct ipa_driver_init_complete_rsp,
120120 rsp),
121121 .tlv_type = 0x02,
122− .elem_size = offsetof(struct ipa_driver_init_complete_rsp,
122+ .offset = offsetof(struct ipa_driver_init_complete_rsp,
123123 rsp),
124124 .ei_array = qmi_response_type_v01_ei,
125125 },
@@ -137,7 +137,7 @@ struct qmi_elem_info ipa_init_complete_ind_ei[] = { · 11 unmodified lines
137137 sizeof_field(struct ipa_init_complete_ind,
138138 status),
139139 .tlv_type = 0x02,
140− .elem_size = offsetof(struct ipa_init_complete_ind,
140+ .offset = offsetof(struct ipa_init_complete_ind,
141141 status),
142142 .ei_array = qmi_response_type_v01_ei,
143143 },
@@ -218,7 +218,7 @@ struct qmi_elem_info ipa_init_modem_driver_req_ei[] = { · 74 unmodified lines
218218 sizeof_field(struct ipa_init_modem_driver_req,
219219 platform_type_valid),
220220 .tlv_type = 0x10,
221− .elem_size = offsetof(struct ipa_init_modem_driver_req,
221+ .offset = offsetof(struct ipa_init_modem_driver_req,
222222 platform_type_valid),
223223 },
224224 {
drivers/net/macsec.c+2−3
@@ -4052,9 +4052,8 @@ static int macsec_newlink(struct net *net, struct net_device *dev, · 4051 unmodified lines
40524052 return err;
40534053
40544054 netdev_lockdep_set_classes(dev);
4055− lockdep_set_class_and_subclass(&dev->addr_list_lock,
4056− &macsec_netdev_addr_lock_key,
4057− dev->lower_level);
4055+ lockdep_set_class(&dev->addr_list_lock,
4056+ &macsec_netdev_addr_lock_key);
40584057
40594058 err = netdev_upper_dev_link(real_dev, dev, extack);
40604059 if (err < 0)
drivers/net/macvlan.c+2−3
@@ -880,9 +880,8 @@ static struct lock_class_key macvlan_netdev_addr_lock_key; · 879 unmodified lines
880880 static void macvlan_set_lockdep_class(struct net_device *dev)
881881 {
882882 netdev_lockdep_set_classes(dev);
883− lockdep_set_class_and_subclass(&dev->addr_list_lock,
884− &macvlan_netdev_addr_lock_key,
885− dev->lower_level);
883+ lockdep_set_class(&dev->addr_list_lock,
884+ &macvlan_netdev_addr_lock_key);
886885 }
887886
888887 static int macvlan_init(struct net_device *dev)
drivers/net/netdevsim/netdev.c+2−2
@@ -302,7 +302,7 @@ nsim_create(struct nsim_dev *nsim_dev, struct nsim_dev_port *nsim_dev_port) · 301 unmodified lines
302302 rtnl_lock();
303303 err = nsim_bpf_init(ns);
304304 if (err)
305− goto err_free_netdev;
305+ goto err_rtnl_unlock;
306306
307307 nsim_ipsec_init(ns);
308308
@@ -316,8 +316,8 @@ nsim_create(struct nsim_dev *nsim_dev, struct nsim_dev_port *nsim_dev_port) · 7 unmodified lines
316316 err_ipsec_teardown:
317317 nsim_ipsec_teardown(ns);
318318 nsim_bpf_uninit(ns);
319+err_rtnl_unlock:
319320 rtnl_unlock();
320−err_free_netdev:
321321 free_netdev(dev);
322322 return ERR_PTR(err);
323323 }
drivers/net/phy/dp83640.c+4−0
@@ -1260,6 +1260,7 @@ static int dp83640_hwtstamp(struct mii_timestamper *mii_ts, struct ifreq *ifr) · 1259 unmodified lines
12601260 dp83640->hwts_rx_en = 1;
12611261 dp83640->layer = PTP_CLASS_L4;
12621262 dp83640->version = PTP_CLASS_V1;
1263+ cfg.rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT;
12631264 break;
12641265 case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
12651266 case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
@@ -1267,6 +1268,7 @@ static int dp83640_hwtstamp(struct mii_timestamper *mii_ts, struct ifreq *ifr) · 1 unmodified line
12671268 dp83640->hwts_rx_en = 1;
12681269 dp83640->layer = PTP_CLASS_L4;
12691270 dp83640->version = PTP_CLASS_V2;
1271+ cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_EVENT;
12701272 break;
12711273 case HWTSTAMP_FILTER_PTP_V2_L2_EVENT:
12721274 case HWTSTAMP_FILTER_PTP_V2_L2_SYNC:
@@ -1274,6 +1276,7 @@ static int dp83640_hwtstamp(struct mii_timestamper *mii_ts, struct ifreq *ifr) · 1 unmodified line
12741276 dp83640->hwts_rx_en = 1;
12751277 dp83640->layer = PTP_CLASS_L2;
12761278 dp83640->version = PTP_CLASS_V2;
1279+ cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_L2_EVENT;
12771280 break;
12781281 case HWTSTAMP_FILTER_PTP_V2_EVENT:
12791282 case HWTSTAMP_FILTER_PTP_V2_SYNC:
@@ -1281,6 +1284,7 @@ static int dp83640_hwtstamp(struct mii_timestamper *mii_ts, struct ifreq *ifr) · 1 unmodified line
12811284 dp83640->hwts_rx_en = 1;
12821285 dp83640->layer = PTP_CLASS_L4 | PTP_CLASS_L2;
12831286 dp83640->version = PTP_CLASS_V2;
1287+ cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
12841288 break;
12851289 default:
12861290 return -ERANGE;
drivers/net/tun.c+2−0
@@ -62,6 +62,7 @@ · 61 unmodified lines
6262 #include <net/rtnetlink.h>
6363 #include <net/sock.h>
6464 #include <net/xdp.h>
65+#include <net/ip_tunnels.h>
6566 #include <linux/seq_file.h>
6667 #include <linux/uio.h>
6768 #include <linux/skb_array.h>
@@ -1351,6 +1352,7 @@ static void tun_net_init(struct net_device *dev) · 1283 unmodified lines
13511352 switch (tun->flags & TUN_TYPE_MASK) {
13521353 case IFF_TUN:
13531354 dev->netdev_ops = &tun_netdev_ops;
1355+ dev->header_ops = &ip_tunnel_header_ops;
13541356
13551357 /* Point-to-Point TUN Device */
13561358 dev->hard_header_len = 0;
drivers/net/usb/ax88172a.c+1−0
@@ -187,6 +187,7 @@ static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf) · 186 unmodified lines
187187 ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf, 0);
188188 if (ret < ETH_ALEN) {
189189 netdev_err(dev->net, "Failed to read MAC address: %d\n", ret);
190+ ret = -EIO;
190191 goto free;
191192 }
192193 memcpy(dev->net->dev_addr, buf, ETH_ALEN);
drivers/net/usb/hso.c+7−3
@@ -1390,8 +1390,9 @@ static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old) · 1389 unmodified lines
13901390 unsigned long flags;
13911391
13921392 if (old)
1393− hso_dbg(0x16, "Termios called with: cflags new[%d] - old[%d]\n",
1394− tty->termios.c_cflag, old->c_cflag);
1393+ hso_dbg(0x16, "Termios called with: cflags new[%u] - old[%u]\n",
1394+ (unsigned int)tty->termios.c_cflag,
1395+ (unsigned int)old->c_cflag);
13951396
13961397 /* the actual setup */
13971398 spin_lock_irqsave(&serial->serial_lock, flags);
@@ -2260,12 +2261,14 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs, · 862 unmodified lines
22602261
22612262 minor = get_free_serial_index();
22622263 if (minor < 0)
2263− goto exit;
2264+ goto exit2;
22642265
22652266 /* register our minor number */
22662267 serial->parent->dev = tty_port_register_device_attr(&serial->port,
22672268 tty_drv, minor, &serial->parent->interface->dev,
22682269 serial->parent, hso_serial_dev_groups);
2270+ if (IS_ERR(serial->parent->dev))
2271+ goto exit2;
22692272
22702273 /* fill in specific data for later use */
22712274 serial->minor = minor;
@@ -2310,6 +2313,7 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs, · 38 unmodified lines
23102313 return 0;
23112314 exit:
23122315 hso_serial_tty_unregister(serial);
2316+exit2:
23132317 hso_serial_common_free(serial);
23142318 return -1;
23152319 }
drivers/net/usb/lan78xx.c+31−82
@@ -377,10 +377,6 @@ struct lan78xx_net { · 376 unmodified lines
377377 struct tasklet_struct bh;
378378 struct delayed_work wq;
379379
380− struct usb_host_endpoint *ep_blkin;
381− struct usb_host_endpoint *ep_blkout;
382− struct usb_host_endpoint *ep_intr;
383−
384380 int msg_enable;
385381
386382 struct urb *urb_intr;
@@ -2860,78 +2856,12 @@ lan78xx_start_xmit(struct sk_buff *skb, struct net_device *net) · 2473 unmodified lines
28602856 return NETDEV_TX_OK;
28612857 }
28622858
2863−static int
2864−lan78xx_get_endpoints(struct lan78xx_net *dev, struct usb_interface *intf)
2865−{
2866− int tmp;
2867− struct usb_host_interface *alt = NULL;
2868− struct usb_host_endpoint *in = NULL, *out = NULL;
2869− struct usb_host_endpoint *status = NULL;
2870−
2871− for (tmp = 0; tmp < intf->num_altsetting; tmp++) {
2872− unsigned ep;
2873−
2874− in = NULL;
2875− out = NULL;
2876− status = NULL;
2877− alt = intf->altsetting + tmp;
2878−
2879− for (ep = 0; ep < alt->desc.bNumEndpoints; ep++) {
2880− struct usb_host_endpoint *e;
2881− int intr = 0;
2882−
2883− e = alt->endpoint + ep;
2884− switch (e->desc.bmAttributes) {
2885− case USB_ENDPOINT_XFER_INT:
2886− if (!usb_endpoint_dir_in(&e->desc))
2887− continue;
2888− intr = 1;
2889− /* FALLTHROUGH */
2890− case USB_ENDPOINT_XFER_BULK:
2891− break;
2892− default:
2893− continue;
2894− }
2895− if (usb_endpoint_dir_in(&e->desc)) {
2896− if (!intr && !in)
2897− in = e;
2898− else if (intr && !status)
2899− status = e;
2900− } else {
2901− if (!out)
2902− out = e;
2903− }
2904− }
2905− if (in && out)
2906− break;
2907− }
2908− if (!alt || !in || !out)
2909− return -EINVAL;
2910−
2911− dev->pipe_in = usb_rcvbulkpipe(dev->udev,
2912− in->desc.bEndpointAddress &
2913− USB_ENDPOINT_NUMBER_MASK);
2914− dev->pipe_out = usb_sndbulkpipe(dev->udev,
2915− out->desc.bEndpointAddress &
2916− USB_ENDPOINT_NUMBER_MASK);
2917− dev->ep_intr = status;
2918−
2919− return 0;
2920−}
2921−
29222859 static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf)
29232860 {
29242861 struct lan78xx_priv *pdata = NULL;
29252862 int ret;
29262863 int i;
29272864
2928− ret = lan78xx_get_endpoints(dev, intf);
2929− if (ret) {
2930− netdev_warn(dev->net, "lan78xx_get_endpoints failed: %d\n",
2931− ret);
2932− return ret;
2933− }
2934−
29352865 dev->data[0] = (unsigned long)kzalloc(sizeof(*pdata), GFP_KERNEL);
29362866
29372867 pdata = (struct lan78xx_priv *)(dev->data[0]);
@@ -3700,6 +3630,7 @@ static void lan78xx_stat_monitor(struct timer_list *t) · 762 unmodified lines
37003630 static int lan78xx_probe(struct usb_interface *intf,
37013631 const struct usb_device_id *id)
37023632 {
3633+ struct usb_host_endpoint *ep_blkin, *ep_blkout, *ep_intr;
37033634 struct lan78xx_net *dev;
37043635 struct net_device *netdev;
37053636 struct usb_device *udev;
@@ -3748,6 +3679,34 @@ static int lan78xx_probe(struct usb_interface *intf, · 42 unmodified lines
37483679
37493680 mutex_init(&dev->stats.access_lock);
37503681
3682+ if (intf->cur_altsetting->desc.bNumEndpoints < 3) {
3683+ ret = -ENODEV;
3684+ goto out2;
3685+ }
3686+
3687+ dev->pipe_in = usb_rcvbulkpipe(udev, BULK_IN_PIPE);
3688+ ep_blkin = usb_pipe_endpoint(udev, dev->pipe_in);
3689+ if (!ep_blkin || !usb_endpoint_is_bulk_in(&ep_blkin->desc)) {
3690+ ret = -ENODEV;
3691+ goto out2;
3692+ }
3693+
3694+ dev->pipe_out = usb_sndbulkpipe(udev, BULK_OUT_PIPE);
3695+ ep_blkout = usb_pipe_endpoint(udev, dev->pipe_out);
3696+ if (!ep_blkout || !usb_endpoint_is_bulk_out(&ep_blkout->desc)) {
3697+ ret = -ENODEV;
3698+ goto out2;
3699+ }
3700+
3701+ ep_intr = &intf->cur_altsetting->endpoint[2];
3702+ if (!usb_endpoint_is_int_in(&ep_intr->desc)) {
3703+ ret = -ENODEV;
3704+ goto out2;
3705+ }
3706+
3707+ dev->pipe_intr = usb_rcvintpipe(dev->udev,
3708+ usb_endpoint_num(&ep_intr->desc));
3709+
37513710 ret = lan78xx_bind(dev, intf);
37523711 if (ret < 0)
37533712 goto out2;
@@ -3759,18 +3718,7 @@ static int lan78xx_probe(struct usb_interface *intf, · 5 unmodified lines
37593718 netdev->max_mtu = MAX_SINGLE_PACKET_SIZE;
37603719 netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER);
37613720
3762− dev->ep_blkin = (intf->cur_altsetting)->endpoint + 0;
3763− dev->ep_blkout = (intf->cur_altsetting)->endpoint + 1;
3764− dev->ep_intr = (intf->cur_altsetting)->endpoint + 2;
3765−
3766− dev->pipe_in = usb_rcvbulkpipe(udev, BULK_IN_PIPE);
3767− dev->pipe_out = usb_sndbulkpipe(udev, BULK_OUT_PIPE);
3768−
3769− dev->pipe_intr = usb_rcvintpipe(dev->udev,
3770− dev->ep_intr->desc.bEndpointAddress &
3771− USB_ENDPOINT_NUMBER_MASK);
3772− period = dev->ep_intr->desc.bInterval;
3773−
3721+ period = ep_intr->desc.bInterval;
37743722 maxp = usb_maxpacket(dev->udev, dev->pipe_intr, 0);
37753723 buf = kmalloc(maxp, GFP_KERNEL);
37763724 if (buf) {
@@ -3783,6 +3731,7 @@ static int lan78xx_probe(struct usb_interface *intf, · 6 unmodified lines
37833731 usb_fill_int_urb(dev->urb_intr, dev->udev,
37843732 dev->pipe_intr, buf, maxp,
37853733 intr_complete, dev, period);
3734+ dev->urb_intr->transfer_flags |= URB_FREE_BUFFER;
37863735 }
37873736 }
37883737
drivers/net/usb/qmi_wwan.c+1−0
@@ -1370,6 +1370,7 @@ static const struct usb_device_id products[] = { · 1369 unmodified lines
13701370 {QMI_QUIRK_SET_DTR(0x1e0e, 0x9001, 5)}, /* SIMCom 7100E, 7230E, 7600E ++ */
13711371 {QMI_QUIRK_SET_DTR(0x2c7c, 0x0121, 4)}, /* Quectel EC21 Mini PCIe */
13721372 {QMI_QUIRK_SET_DTR(0x2c7c, 0x0191, 4)}, /* Quectel EG91 */
1373+ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0195, 4)}, /* Quectel EG95 */
13731374 {QMI_FIXED_INTF(0x2c7c, 0x0296, 4)}, /* Quectel BG96 */
13741375 {QMI_QUIRK_SET_DTR(0x2cb7, 0x0104, 4)}, /* Fibocom NL678 series */
13751376 {QMI_FIXED_INTF(0x0489, 0xe0b4, 0)}, /* Foxconn T77W968 LTE */
drivers/net/usb/smsc95xx.c+8−1
@@ -1287,11 +1287,14 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) · 1286 unmodified lines
12871287
12881288 /* Init all registers */
12891289 ret = smsc95xx_reset(dev);
1290+ if (ret)
1291+ goto free_pdata;
12901292
12911293 /* detect device revision as different features may be available */
12921294 ret = smsc95xx_read_reg(dev, ID_REV, &val);
12931295 if (ret < 0)
1294− return ret;
1296+ goto free_pdata;
1297+
12951298 val >>= 16;
12961299 pdata->chip_id = val;
12971300 pdata->mdix_ctrl = get_mdix_status(dev->net);
@@ -1317,6 +1320,10 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) · 19 unmodified lines
13171320 schedule_delayed_work(&pdata->carrier_check, CARRIER_CHECK_DELAY);
13181321
13191322 return 0;
1323+
1324+free_pdata:
1325+ kfree(pdata);
1326+ return ret;
13201327 }
13211328
13221329 static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf)
drivers/net/vxlan.c+12−4
@@ -1376,6 +1376,7 @@ static int vxlan_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, · 1375 unmodified lines
13761376 for (h = 0; h < FDB_HASH_SIZE; ++h) {
13771377 struct vxlan_fdb *f;
13781378
1379+ rcu_read_lock();
13791380 hlist_for_each_entry_rcu(f, &vxlan->fdb_head[h], hlist) {
13801381 struct vxlan_rdst *rd;
13811382
@@ -1387,8 +1388,10 @@ static int vxlan_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, · 5 unmodified lines
13871388 cb->nlh->nlmsg_seq,
13881389 RTM_NEWNEIGH,
13891390 NLM_F_MULTI, NULL);
1390− if (err < 0)
1391+ if (err < 0) {
1392+ rcu_read_unlock();
13911393 goto out;
1394+ }
13921395 skip_nh:
13931396 *idx += 1;
13941397 continue;
@@ -1403,12 +1406,15 @@ skip_nh: · 8 unmodified lines
14031406 cb->nlh->nlmsg_seq,
14041407 RTM_NEWNEIGH,
14051408 NLM_F_MULTI, rd);
1406− if (err < 0)
1409+ if (err < 0) {
1410+ rcu_read_unlock();
14071411 goto out;
1412+ }
14081413 skip:
14091414 *idx += 1;
14101415 }
14111416 }
1417+ rcu_read_unlock();
14121418 }
14131419 out:
14141420 return err;
@@ -3070,8 +3076,10 @@ static void vxlan_flush(struct vxlan_dev *vxlan, bool do_all) · 1655 unmodified lines
30703076 if (!do_all && (f->state & (NUD_PERMANENT | NUD_NOARP)))
30713077 continue;
30723078 /* the all_zeros_mac entry is deleted at vxlan_uninit */
3073− if (!is_zero_ether_addr(f->eth_addr))
3074− vxlan_fdb_destroy(vxlan, f, true, true);
3079+ if (is_zero_ether_addr(f->eth_addr) &&
3080+ f->vni == vxlan->cfg.vni)
3081+ continue;
3082+ vxlan_fdb_destroy(vxlan, f, true, true);
30753083 }
30763084 spin_unlock_bh(&vxlan->hash_lock[h]);
30773085 }
drivers/net/wan/hdlc_x25.c+3−1
@@ -71,8 +71,10 @@ static int x25_data_indication(struct net_device *dev, struct sk_buff *skb) · 70 unmodified lines
7171 {
7272 unsigned char *ptr;
7373
74− if (skb_cow(skb, 1))
74+ if (skb_cow(skb, 1)) {
75+ kfree_skb(skb);
7576 return NET_RX_DROP;
77+ }
7678
7779 skb_push(skb, 1);
7880 skb_reset_network_header(skb);
drivers/net/wan/lapbether.c+13−4
@@ -128,10 +128,12 @@ static int lapbeth_data_indication(struct net_device *dev, struct sk_buff *skb) · 127 unmodified lines
128128 {
129129 unsigned char *ptr;
130130
131− skb_push(skb, 1);
132−
133− if (skb_cow(skb, 1))
131+ if (skb_cow(skb, 1)) {
132+ kfree_skb(skb);
134133 return NET_RX_DROP;
134+ }
135+
136+ skb_push(skb, 1);
135137
136138 ptr = skb->data;
137139 *ptr = X25_IFACE_DATA;
@@ -303,7 +305,6 @@ static void lapbeth_setup(struct net_device *dev) · 165 unmodified lines
303305 dev->netdev_ops = &lapbeth_netdev_ops;
304306 dev->needs_free_netdev = true;
305307 dev->type = ARPHRD_X25;
306− dev->hard_header_len = 3;
307308 dev->mtu = 1000;
308309 dev->addr_len = 0;
309310 }
@@ -324,6 +325,14 @@ static int lapbeth_new_device(struct net_device *dev) · 14 unmodified lines
324325 if (!ndev)
325326 goto out;
326327
328+ /* When transmitting data:
329+ * first this driver removes a pseudo header of 1 byte,
330+ * then the lapb module prepends an LAPB header of at most 3 bytes,
331+ * then this driver prepends a length field of 2 bytes,
332+ * then the underlying Ethernet device prepends its own header.
333+ */
334+ ndev->hard_header_len = -1 + 3 + 2 + dev->hard_header_len;
335+
327336 lapbeth = netdev_priv(ndev);
328337 lapbeth->axdev = ndev;
329338
drivers/net/wan/x25_asy.c+14−7
@@ -183,7 +183,7 @@ static inline void x25_asy_unlock(struct x25_asy *sl) · 182 unmodified lines
183183 netif_wake_queue(sl->dev);
184184 }
185185
186−/* Send one completely decapsulated IP datagram to the IP layer. */
186+/* Send an LAPB frame to the LAPB module to process. */
187187
188188 static void x25_asy_bump(struct x25_asy *sl)
189189 {
@@ -195,13 +195,12 @@ static void x25_asy_bump(struct x25_asy *sl) · 5 unmodified lines
195195 count = sl->rcount;
196196 dev->stats.rx_bytes += count;
197197
198− skb = dev_alloc_skb(count+1);
198+ skb = dev_alloc_skb(count);
199199 if (skb == NULL) {
200200 netdev_warn(sl->dev, "memory squeeze, dropping packet\n");
201201 dev->stats.rx_dropped++;
202202 return;
203203 }
204− skb_push(skb, 1); /* LAPB internal control */
205204 skb_put_data(skb, sl->rbuff, count);
206205 skb->protocol = x25_type_trans(skb, sl->dev);
207206 err = lapb_data_received(skb->dev, skb);
@@ -209,7 +208,6 @@ static void x25_asy_bump(struct x25_asy *sl) · 1 unmodified line
209208 kfree_skb(skb);
210209 printk(KERN_DEBUG "x25_asy: data received err - %d\n", err);
211210 } else {
212− netif_rx(skb);
213211 dev->stats.rx_packets++;
214212 }
215213 }
@@ -356,12 +354,21 @@ static netdev_tx_t x25_asy_xmit(struct sk_buff *skb, · 140 unmodified lines
356354 */
357355
358356 /*
359− * Called when I frame data arrives. We did the work above - throw it
360− * at the net layer.
357+ * Called when I frame data arrive. We add a pseudo header for upper
358+ * layers and pass it to upper layers.
361359 */
362360
363361 static int x25_asy_data_indication(struct net_device *dev, struct sk_buff *skb)
364362 {
363+ if (skb_cow(skb, 1)) {
364+ kfree_skb(skb);
365+ return NET_RX_DROP;
366+ }
367+ skb_push(skb, 1);
368+ skb->data[0] = X25_IFACE_DATA;
369+
370+ skb->protocol = x25_type_trans(skb, dev);
371+
365372 return netif_rx(skb);
366373 }
367374
@@ -657,7 +664,7 @@ static void x25_asy_unesc(struct x25_asy *sl, unsigned char s) · 289 unmodified lines
657664 switch (s) {
658665 case X25_END:
659666 if (!test_and_clear_bit(SLF_ERROR, &sl->flags) &&
660− sl->rcount > 2)
667+ sl->rcount >= 2)
661668 x25_asy_bump(sl);
662669 clear_bit(SLF_ESCAPE, &sl->flags);
663670 sl->rcount = 0;
drivers/net/wireguard/device.c+1−0
@@ -262,6 +262,7 @@ static void wg_setup(struct net_device *dev) · 261 unmodified lines
262262 max(sizeof(struct ipv6hdr), sizeof(struct iphdr));
263263
264264 dev->netdev_ops = &netdev_ops;
265+ dev->header_ops = &ip_tunnel_header_ops;
265266 dev->hard_header_len = 0;
266267 dev->addr_len = 0;
267268 dev->needed_headroom = DATA_PACKET_HEAD_ROOM;
drivers/net/wireguard/queueing.h+2−17
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/skbuff.h>
1212 #include <linux/ip.h>
1313 #include <linux/ipv6.h>
14+#include <net/ip_tunnels.h>
1415
1516 struct wg_device;
1617 struct wg_peer;
@@ -65,25 +66,9 @@ struct packet_cb { · 48 unmodified lines
6566 #define PACKET_CB(skb) ((struct packet_cb *)((skb)->cb))
6667 #define PACKET_PEER(skb) (PACKET_CB(skb)->keypair->entry.peer)
6768
68−/* Returns either the correct skb->protocol value, or 0 if invalid. */
69−static inline __be16 wg_examine_packet_protocol(struct sk_buff *skb)
70−{
71− if (skb_network_header(skb) >= skb->head &&
72− (skb_network_header(skb) + sizeof(struct iphdr)) <=
73− skb_tail_pointer(skb) &&
74− ip_hdr(skb)->version == 4)
75− return htons(ETH_P_IP);
76− if (skb_network_header(skb) >= skb->head &&
77− (skb_network_header(skb) + sizeof(struct ipv6hdr)) <=
78− skb_tail_pointer(skb) &&
79− ipv6_hdr(skb)->version == 6)
80− return htons(ETH_P_IPV6);
81− return 0;
82−}
83−
8469 static inline bool wg_check_packet_protocol(struct sk_buff *skb)
8570 {
86− __be16 real_protocol = wg_examine_packet_protocol(skb);
71+ __be16 real_protocol = ip_tunnel_parse_protocol(skb);
8772 return real_protocol && skb->protocol == real_protocol;
8873 }
8974
drivers/net/wireguard/receive.c+1−1
@@ -387,7 +387,7 @@ static void wg_packet_consume_data_done(struct wg_peer *peer, · 386 unmodified lines
387387 */
388388 skb->ip_summed = CHECKSUM_UNNECESSARY;
389389 skb->csum_level = ~0; /* All levels */
390− skb->protocol = wg_examine_packet_protocol(skb);
390+ skb->protocol = ip_tunnel_parse_protocol(skb);
391391 if (skb->protocol == htons(ETH_P_IP)) {
392392 len = ntohs(ip_hdr(skb)->tot_len);
393393 if (unlikely(len < sizeof(struct iphdr)))
drivers/net/wireless/ath/ath10k/ahb.c+1−1
@@ -820,7 +820,7 @@ err_free_irq: · 819 unmodified lines
820820 ath10k_ahb_release_irq_legacy(ar);
821821
822822 err_free_pipes:
823− ath10k_pci_free_pipes(ar);
823+ ath10k_pci_release_resource(ar);
824824
825825 err_resource_deinit:
826826 ath10k_ahb_resource_deinit(ar);
drivers/net/wireless/ath/ath10k/pci.c+37−41
@@ -3473,6 +3473,28 @@ int ath10k_pci_setup_resource(struct ath10k *ar) · 3472 unmodified lines
34733473
34743474 timer_setup(&ar_pci->rx_post_retry, ath10k_pci_rx_replenish_retry, 0);
34753475
3476+ ar_pci->attr = kmemdup(pci_host_ce_config_wlan,
3477+ sizeof(pci_host_ce_config_wlan),
3478+ GFP_KERNEL);
3479+ if (!ar_pci->attr)
3480+ return -ENOMEM;
3481+
3482+ ar_pci->pipe_config = kmemdup(pci_target_ce_config_wlan,
3483+ sizeof(pci_target_ce_config_wlan),
3484+ GFP_KERNEL);
3485+ if (!ar_pci->pipe_config) {
3486+ ret = -ENOMEM;
3487+ goto err_free_attr;
3488+ }
3489+
3490+ ar_pci->serv_to_pipe = kmemdup(pci_target_service_to_ce_map_wlan,
3491+ sizeof(pci_target_service_to_ce_map_wlan),
3492+ GFP_KERNEL);
3493+ if (!ar_pci->serv_to_pipe) {
3494+ ret = -ENOMEM;
3495+ goto err_free_pipe_config;
3496+ }
3497+
34763498 if (QCA_REV_6174(ar) || QCA_REV_9377(ar))
34773499 ath10k_pci_override_ce_config(ar);
34783500
@@ -3480,18 +3502,31 @@ int ath10k_pci_setup_resource(struct ath10k *ar) · 1 unmodified line
34803502 if (ret) {
34813503 ath10k_err(ar, "failed to allocate copy engine pipes: %d\n",
34823504 ret);
3483− return ret;
3505+ goto err_free_serv_to_pipe;
34843506 }
34853507
34863508 return 0;
3509+
3510+err_free_serv_to_pipe:
3511+ kfree(ar_pci->serv_to_pipe);
3512+err_free_pipe_config:
3513+ kfree(ar_pci->pipe_config);
3514+err_free_attr:
3515+ kfree(ar_pci->attr);
3516+ return ret;
34873517 }
34883518
34893519 void ath10k_pci_release_resource(struct ath10k *ar)
34903520 {
3521+ struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
3522+
34913523 ath10k_pci_rx_retry_sync(ar);
34923524 netif_napi_del(&ar->napi);
34933525 ath10k_pci_ce_deinit(ar);
34943526 ath10k_pci_free_pipes(ar);
3527+ kfree(ar_pci->attr);
3528+ kfree(ar_pci->pipe_config);
3529+ kfree(ar_pci->serv_to_pipe);
34953530 }
34963531
34973532 static const struct ath10k_bus_ops ath10k_pci_bus_ops = {
@@ -3601,30 +3636,6 @@ static int ath10k_pci_probe(struct pci_dev *pdev, · 103 unmodified lines
36013636
36023637 timer_setup(&ar_pci->ps_timer, ath10k_pci_ps_timer, 0);
36033638
3604− ar_pci->attr = kmemdup(pci_host_ce_config_wlan,
3605− sizeof(pci_host_ce_config_wlan),
3606− GFP_KERNEL);
3607− if (!ar_pci->attr) {
3608− ret = -ENOMEM;
3609− goto err_free;
3610− }
3611−
3612− ar_pci->pipe_config = kmemdup(pci_target_ce_config_wlan,
3613− sizeof(pci_target_ce_config_wlan),
3614− GFP_KERNEL);
3615− if (!ar_pci->pipe_config) {
3616− ret = -ENOMEM;
3617− goto err_free;
3618− }
3619−
3620− ar_pci->serv_to_pipe = kmemdup(pci_target_service_to_ce_map_wlan,
3621− sizeof(pci_target_service_to_ce_map_wlan),
3622− GFP_KERNEL);
3623− if (!ar_pci->serv_to_pipe) {
3624− ret = -ENOMEM;
3625− goto err_free;
3626− }
3627−
36283639 ret = ath10k_pci_setup_resource(ar);
36293640 if (ret) {
36303641 ath10k_err(ar, "failed to setup resource: %d\n", ret);
@@ -3705,10 +3716,9 @@ err_unsupported: · 74 unmodified lines
37053716
37063717 err_free_irq:
37073718 ath10k_pci_free_irq(ar);
3708− ath10k_pci_rx_retry_sync(ar);
37093719
37103720 err_deinit_irq:
3711− ath10k_pci_deinit_irq(ar);
3721+ ath10k_pci_release_resource(ar);
37123722
37133723 err_sleep:
37143724 ath10k_pci_sleep_sync(ar);
@@ -3720,29 +3730,18 @@ err_free_pipes: · 5 unmodified lines
37203730 err_core_destroy:
37213731 ath10k_core_destroy(ar);
37223732
3723−err_free:
3724− kfree(ar_pci->attr);
3725− kfree(ar_pci->pipe_config);
3726− kfree(ar_pci->serv_to_pipe);
3727−
37283733 return ret;
37293734 }
37303735
37313736 static void ath10k_pci_remove(struct pci_dev *pdev)
37323737 {
37333738 struct ath10k *ar = pci_get_drvdata(pdev);
3734− struct ath10k_pci *ar_pci;
37353739
37363740 ath10k_dbg(ar, ATH10K_DBG_PCI, "pci remove\n");
37373741
37383742 if (!ar)
37393743 return;
37403744
3741− ar_pci = ath10k_pci_priv(ar);
3742−
3743− if (!ar_pci)
3744− return;
3745−
37463745 ath10k_core_unregister(ar);
37473746 ath10k_pci_free_irq(ar);
37483747 ath10k_pci_deinit_irq(ar);
@@ -3750,9 +3749,6 @@ static void ath10k_pci_remove(struct pci_dev *pdev) · 1 unmodified line
37503749 ath10k_pci_sleep_sync(ar);
37513750 ath10k_pci_release(ar);
37523751 ath10k_core_destroy(ar);
3753− kfree(ar_pci->attr);
3754− kfree(ar_pci->pipe_config);
3755− kfree(ar_pci->serv_to_pipe);
37563752 }
37573753
37583754 MODULE_DEVICE_TABLE(pci, ath10k_pci_id_table);
drivers/net/wireless/ath/ath9k/hif_usb.c+3−1
@@ -733,11 +733,13 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb) · 732 unmodified lines
733733 return;
734734 }
735735
736+ rx_buf->skb = nskb;
737+
736738 usb_fill_int_urb(urb, hif_dev->udev,
737739 usb_rcvintpipe(hif_dev->udev,
738740 USB_REG_IN_PIPE),
739741 nskb->data, MAX_REG_IN_BUF_SIZE,
740− ath9k_hif_usb_reg_in_cb, nskb, 1);
742+ ath9k_hif_usb_reg_in_cb, rx_buf, 1);
741743 }
742744
743745 resubmit:
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c+14−2
@@ -271,6 +271,8 @@ static int iwl_dbg_tlv_alloc_trigger(struct iwl_trans *trans, · 270 unmodified lines
271271 {
272272 struct iwl_fw_ini_trigger_tlv *trig = (void *)tlv->data;
273273 u32 tp = le32_to_cpu(trig->time_point);
274+ struct iwl_ucode_tlv *dup = NULL;
275+ int ret;
274276
275277 if (le32_to_cpu(tlv->length) < sizeof(*trig))
276278 return -EINVAL;
@@ -283,10 +285,20 @@ static int iwl_dbg_tlv_alloc_trigger(struct iwl_trans *trans, · 6 unmodified lines
283285 return -EINVAL;
284286 }
285287
286− if (!le32_to_cpu(trig->occurrences))
288+ if (!le32_to_cpu(trig->occurrences)) {
289+ dup = kmemdup(tlv, sizeof(*tlv) + le32_to_cpu(tlv->length),
290+ GFP_KERNEL);
291+ if (!dup)
292+ return -ENOMEM;
293+ trig = (void *)dup->data;
287294 trig->occurrences = cpu_to_le32(-1);
295+ tlv = dup;
296+ }
297+
298+ ret = iwl_dbg_tlv_add(tlv, &trans->dbg.time_point[tp].trig_list);
299+ kfree(dup);
288300
289− return iwl_dbg_tlv_add(tlv, &trans->dbg.time_point[tp].trig_list);
301+ return ret;
290302 }
291303
292304 static int (*dbg_tlv_alloc[])(struct iwl_trans *trans,
drivers/net/wireless/intel/iwlwifi/mvm/sta.c+3−5
@@ -1189,17 +1189,15 @@ static int iwl_mvm_inactivity_check(struct iwl_mvm *mvm, u8 alloc_for_sta) · 1188 unmodified lines
11891189 for_each_set_bit(i, &changetid_queues, IWL_MAX_HW_QUEUES)
11901190 iwl_mvm_change_queue_tid(mvm, i);
11911191
1192+ rcu_read_unlock();
1193+
11921194 if (free_queue >= 0 && alloc_for_sta != IWL_MVM_INVALID_STA) {
11931195 ret = iwl_mvm_free_inactive_queue(mvm, free_queue, queue_owner,
11941196 alloc_for_sta);
1195− if (ret) {
1196− rcu_read_unlock();
1197+ if (ret)
11971198 return ret;
1198− }
11991199 }
12001200
1201− rcu_read_unlock();
1202−
12031201 return free_queue;
12041202 }
12051203
drivers/net/wireless/intel/iwlwifi/pcie/drv.c+2−0
@@ -582,6 +582,8 @@ static const struct iwl_dev_info iwl_dev_info_table[] = { · 581 unmodified lines
582582 IWL_DEV_INFO(0x30DC, 0x1552, iwl9560_2ac_cfg_soc, iwl9560_killer_1550i_name),
583583 IWL_DEV_INFO(0x31DC, 0x1551, iwl9560_2ac_cfg_soc, iwl9560_killer_1550s_name),
584584 IWL_DEV_INFO(0x31DC, 0x1552, iwl9560_2ac_cfg_soc, iwl9560_killer_1550i_name),
585+ IWL_DEV_INFO(0xA370, 0x1551, iwl9560_2ac_cfg_soc, iwl9560_killer_1550s_name),
586+ IWL_DEV_INFO(0xA370, 0x1552, iwl9560_2ac_cfg_soc, iwl9560_killer_1550i_name),
585587
586588 IWL_DEV_INFO(0x271C, 0x0214, iwl9260_2ac_cfg, iwl9260_1_name),
587589
drivers/net/wireless/mediatek/mt76/mt76.h+1−0
@@ -301,6 +301,7 @@ struct mt76_hw_cap { · 300 unmodified lines
301301 #define MT_DRV_TX_ALIGNED4_SKBS BIT(1)
302302 #define MT_DRV_SW_RX_AIRTIME BIT(2)
303303 #define MT_DRV_RX_DMA_HDR BIT(3)
304+#define MT_DRV_HW_MGMT_TXQ BIT(4)
304305
305306 struct mt76_driver_ops {
306307 u32 drv_flags;
drivers/net/wireless/mediatek/mt76/mt7603/main.c+2−0
@@ -642,8 +642,10 @@ mt7603_set_coverage_class(struct ieee80211_hw *hw, s16 coverage_class) · 641 unmodified lines
642642 {
643643 struct mt7603_dev *dev = hw->priv;
644644
645+ mutex_lock(&dev->mt76.mutex);
645646 dev->coverage_class = max_t(s16, coverage_class, 0);
646647 mt7603_mac_set_timing(dev);
648+ mutex_unlock(&dev->mt76.mutex);
647649 }
648650
649651 static void mt7603_tx(struct ieee80211_hw *hw,
drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c+5−4
@@ -234,10 +234,11 @@ mt7615_queues_acq(struct seq_file *s, void *data) · 233 unmodified lines
234234 int i;
235235
236236 for (i = 0; i < 16; i++) {
237− int j, acs = i / 4, index = i % 4;
237+ int j, wmm_idx = i % MT7615_MAX_WMM_SETS;
238+ int acs = i / MT7615_MAX_WMM_SETS;
238239 u32 ctrl, val, qlen = 0;
239240
240− val = mt76_rr(dev, MT_PLE_AC_QEMPTY(acs, index));
241+ val = mt76_rr(dev, MT_PLE_AC_QEMPTY(acs, wmm_idx));
241242 ctrl = BIT(31) | BIT(15) | (acs << 8);
242243
243244 for (j = 0; j < 32; j++) {
@@ -245,11 +246,11 @@ mt7615_queues_acq(struct seq_file *s, void *data) · 1 unmodified line
245246 continue;
246247
247248 mt76_wr(dev, MT_PLE_FL_Q0_CTRL,
248− ctrl | (j + (index << 5)));
249+ ctrl | (j + (wmm_idx << 5)));
249250 qlen += mt76_get_field(dev, MT_PLE_FL_Q3_CTRL,
250251 GENMASK(11, 0));
251252 }
252− seq_printf(s, "AC%d%d: queued=%d\n", acs, index, qlen);
253+ seq_printf(s, "AC%d%d: queued=%d\n", wmm_idx, acs, qlen);
253254 }
254255
255256 return 0;
drivers/net/wireless/mediatek/mt76/mt7615/dma.c+5−4
@@ -36,10 +36,10 @@ static int · 35 unmodified lines
3636 mt7622_init_tx_queues_multi(struct mt7615_dev *dev)
3737 {
3838 static const u8 wmm_queue_map[] = {
39− MT7622_TXQ_AC0,
40− MT7622_TXQ_AC1,
41− MT7622_TXQ_AC2,
42− MT7622_TXQ_AC3,
39+ [IEEE80211_AC_BK] = MT7622_TXQ_AC0,
40+ [IEEE80211_AC_BE] = MT7622_TXQ_AC1,
41+ [IEEE80211_AC_VI] = MT7622_TXQ_AC2,
42+ [IEEE80211_AC_VO] = MT7622_TXQ_AC3,
4343 };
4444 int ret;
4545 int i;
@@ -100,6 +100,7 @@ mt7615_tx_cleanup(struct mt7615_dev *dev) · 54 unmodified lines
100100 int i;
101101
102102 mt76_queue_tx_cleanup(dev, MT_TXQ_MCU, false);
103+ mt76_queue_tx_cleanup(dev, MT_TXQ_PSD, false);
103104 if (is_mt7615(&dev->mt76)) {
104105 mt76_queue_tx_cleanup(dev, MT_TXQ_BE, false);
105106 } else {
drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c+1−2
@@ -72,8 +72,7 @@ static int mt7615_eeprom_load(struct mt7615_dev *dev, u32 addr) · 71 unmodified lines
7272 {
7373 int ret;
7474
75− ret = mt76_eeprom_init(&dev->mt76, MT7615_EEPROM_SIZE +
76− MT7615_EEPROM_EXTRA_DATA);
75+ ret = mt76_eeprom_init(&dev->mt76, MT7615_EEPROM_FULL_SIZE);
7776 if (ret < 0)
7877 return ret;
7978
drivers/net/wireless/mediatek/mt76/mt7615/eeprom.h+1−1
@@ -17,7 +17,7 @@ · 16 unmodified lines
1717 #define MT7615_EEPROM_TXDPD_SIZE 216
1818 #define MT7615_EEPROM_TXDPD_COUNT (44 + 3)
1919
20−#define MT7615_EEPROM_EXTRA_DATA (MT7615_EEPROM_TXDPD_OFFSET + \
20+#define MT7615_EEPROM_FULL_SIZE (MT7615_EEPROM_TXDPD_OFFSET + \
2121 MT7615_EEPROM_TXDPD_COUNT * \
2222 MT7615_EEPROM_TXDPD_SIZE)
2323
drivers/net/wireless/mediatek/mt76/mt7615/mac.c+7−13
@@ -526,22 +526,16 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi, · 525 unmodified lines
526526 fc_type = (le16_to_cpu(fc) & IEEE80211_FCTL_FTYPE) >> 2;
527527 fc_stype = (le16_to_cpu(fc) & IEEE80211_FCTL_STYPE) >> 4;
528528
529− if (ieee80211_is_data(fc) || ieee80211_is_bufferable_mmpdu(fc)) {
530− q_idx = wmm_idx * MT7615_MAX_WMM_SETS +
531− skb_get_queue_mapping(skb);
532− p_fmt = is_usb ? MT_TX_TYPE_SF : MT_TX_TYPE_CT;
533− } else if (beacon) {
534− if (ext_phy)
535− q_idx = MT_LMAC_BCN1;
536− else
537− q_idx = MT_LMAC_BCN0;
529+ if (beacon) {
538530 p_fmt = MT_TX_TYPE_FW;
531+ q_idx = ext_phy ? MT_LMAC_BCN1 : MT_LMAC_BCN0;
532+ } else if (skb_get_queue_mapping(skb) >= MT_TXQ_PSD) {
533+ p_fmt = is_usb ? MT_TX_TYPE_SF : MT_TX_TYPE_CT;
534+ q_idx = ext_phy ? MT_LMAC_ALTX1 : MT_LMAC_ALTX0;
539535 } else {
540− if (ext_phy)
541− q_idx = MT_LMAC_ALTX1;
542− else
543− q_idx = MT_LMAC_ALTX0;
544536 p_fmt = is_usb ? MT_TX_TYPE_SF : MT_TX_TYPE_CT;
537+ q_idx = wmm_idx * MT7615_MAX_WMM_SETS +
538+ mt7615_lmac_mapping(dev, skb_get_queue_mapping(skb));
545539 }
546540
547541 val = FIELD_PREP(MT_TXD0_TX_BYTES, skb->len + sz_txd) |
drivers/net/wireless/mediatek/mt76/mt7615/mac.h+0−15
@@ -124,21 +124,6 @@ enum tx_pkt_type { · 123 unmodified lines
124124 MT_TX_TYPE_FW,
125125 };
126126
127−enum tx_pkt_queue_idx {
128− MT_LMAC_AC00,
129− MT_LMAC_AC01,
130− MT_LMAC_AC02,
131− MT_LMAC_AC03,
132− MT_LMAC_ALTX0 = 0x10,
133− MT_LMAC_BMC0,
134− MT_LMAC_BCN0,
135− MT_LMAC_PSMP0,
136− MT_LMAC_ALTX1,
137− MT_LMAC_BMC1,
138− MT_LMAC_BCN1,
139− MT_LMAC_PSMP1,
140−};
141−
142127 enum tx_port_idx {
143128 MT_TX_PORT_IDX_LMAC,
144129 MT_TX_PORT_IDX_MCU
drivers/net/wireless/mediatek/mt76/mt7615/main.c+4−0
@@ -397,6 +397,7 @@ mt7615_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue, · 396 unmodified lines
397397 struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv;
398398 struct mt7615_dev *dev = mt7615_hw_dev(hw);
399399
400+ queue = mt7615_lmac_mapping(dev, queue);
400401 queue += mvif->wmm_idx * MT7615_MAX_WMM_SETS;
401402
402403 return mt7615_mcu_set_wmm(dev, queue, params);
@@ -735,9 +736,12 @@ static void · 332 unmodified lines
735736 mt7615_set_coverage_class(struct ieee80211_hw *hw, s16 coverage_class)
736737 {
737738 struct mt7615_phy *phy = mt7615_hw_phy(hw);
739+ struct mt7615_dev *dev = phy->dev;
738740
741+ mutex_lock(&dev->mt76.mutex);
739742 phy->coverage_class = max_t(s16, coverage_class, 0);
740743 mt7615_mac_set_timing(phy);
744+ mutex_unlock(&dev->mt76.mutex);
741745 }
742746
743747 static int
drivers/net/wireless/mediatek/mt76/mt7615/mmio.c+1−1
@@ -146,7 +146,7 @@ int mt7615_mmio_probe(struct device *pdev, void __iomem *mem_base, · 145 unmodified lines
146146 static const struct mt76_driver_ops drv_ops = {
147147 /* txwi_size = txd size + txp size */
148148 .txwi_size = MT_TXD_SIZE + sizeof(struct mt7615_txp_common),
149− .drv_flags = MT_DRV_TXWI_NO_FREE,
149+ .drv_flags = MT_DRV_TXWI_NO_FREE | MT_DRV_HW_MGMT_TXQ,
150150 .survey_flags = SURVEY_INFO_TIME_TX |
151151 SURVEY_INFO_TIME_RX |
152152 SURVEY_INFO_TIME_BSS_RX,
drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h+30−0
@@ -282,6 +282,21 @@ struct mt7615_dev { · 281 unmodified lines
282282 struct list_head wd_head;
283283 };
284284
285+enum tx_pkt_queue_idx {
286+ MT_LMAC_AC00,
287+ MT_LMAC_AC01,
288+ MT_LMAC_AC02,
289+ MT_LMAC_AC03,
290+ MT_LMAC_ALTX0 = 0x10,
291+ MT_LMAC_BMC0,
292+ MT_LMAC_BCN0,
293+ MT_LMAC_PSMP0,
294+ MT_LMAC_ALTX1,
295+ MT_LMAC_BMC1,
296+ MT_LMAC_BCN1,
297+ MT_LMAC_PSMP1,
298+};
299+
285300 enum {
286301 HW_BSSID_0 = 0x0,
287302 HW_BSSID_1,
@@ -447,6 +462,21 @@ static inline u16 mt7615_wtbl_size(struct mt7615_dev *dev) · 159 unmodified lines
447462 return MT7615_WTBL_SIZE;
448463 }
449464
465+static inline u8 mt7615_lmac_mapping(struct mt7615_dev *dev, u8 ac)
466+{
467+ static const u8 lmac_queue_map[] = {
468+ [IEEE80211_AC_BK] = MT_LMAC_AC00,
469+ [IEEE80211_AC_BE] = MT_LMAC_AC01,
470+ [IEEE80211_AC_VI] = MT_LMAC_AC02,
471+ [IEEE80211_AC_VO] = MT_LMAC_AC03,
472+ };
473+
474+ if (WARN_ON_ONCE(ac >= ARRAY_SIZE(lmac_queue_map)))
475+ return MT_LMAC_AC01; /* BE */
476+
477+ return lmac_queue_map[ac];
478+}
479+
450480 void mt7615_dma_reset(struct mt7615_dev *dev);
451481 void mt7615_scan_work(struct work_struct *work);
452482 void mt7615_roc_work(struct work_struct *work);
drivers/net/wireless/mediatek/mt76/mt7615/usb.c+7−6
@@ -270,7 +270,7 @@ static int mt7663u_probe(struct usb_interface *usb_intf, · 269 unmodified lines
270270 {
271271 static const struct mt76_driver_ops drv_ops = {
272272 .txwi_size = MT_USB_TXD_SIZE,
273− .drv_flags = MT_DRV_RX_DMA_HDR,
273+ .drv_flags = MT_DRV_RX_DMA_HDR | MT_DRV_HW_MGMT_TXQ,
274274 .tx_prepare_skb = mt7663u_tx_prepare_skb,
275275 .tx_complete_skb = mt7663u_tx_complete_skb,
276276 .tx_status_data = mt7663u_tx_status_data,
@@ -329,25 +329,26 @@ static int mt7663u_probe(struct usb_interface *usb_intf, · 52 unmodified lines
329329 if (!mt76_poll_msec(dev, MT_CONN_ON_MISC, MT_TOP_MISC2_FW_PWR_ON,
330330 FW_STATE_PWR_ON << 1, 500)) {
331331 dev_err(dev->mt76.dev, "Timeout for power on\n");
332− return -EIO;
332+ ret = -EIO;
333+ goto error;
333334 }
334335
335336 alloc_queues:
336337 ret = mt76u_alloc_mcu_queue(&dev->mt76);
337338 if (ret)
338− goto error;
339+ goto error_free_q;
339340
340341 ret = mt76u_alloc_queues(&dev->mt76);
341342 if (ret)
342− goto error;
343+ goto error_free_q;
343344
344345 ret = mt7663u_register_device(dev);
345346 if (ret)
346− goto error_freeq;
347+ goto error_free_q;
347348
348349 return 0;
349350
350−error_freeq:
351+error_free_q:
351352 mt76u_queues_deinit(&dev->mt76);
352353 error:
353354 mt76u_deinit(&dev->mt76);
drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c+3−2
@@ -456,8 +456,9 @@ static void mt76x02_watchdog_reset(struct mt76x02_dev *dev) · 455 unmodified lines
456456 tasklet_disable(&dev->mt76.tx_tasklet);
457457 napi_disable(&dev->mt76.tx_napi);
458458
459− for (i = 0; i < ARRAY_SIZE(dev->mt76.napi); i++)
459+ mt76_for_each_q_rx(&dev->mt76, i) {
460460 napi_disable(&dev->mt76.napi[i]);
461+ }
461462
462463 mutex_lock(&dev->mt76.mutex);
463464
@@ -515,7 +516,7 @@ static void mt76x02_watchdog_reset(struct mt76x02_dev *dev) · 51 unmodified lines
515516
516517 tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
517518
518− for (i = 0; i < ARRAY_SIZE(dev->mt76.napi); i++) {
519+ mt76_for_each_q_rx(&dev->mt76, i) {
519520 napi_enable(&dev->mt76.napi[i]);
520521 napi_schedule(&dev->mt76.napi[i]);
521522 }
drivers/net/wireless/mediatek/mt76/mt7915/main.c+3−0
@@ -716,9 +716,12 @@ static void · 715 unmodified lines
716716 mt7915_set_coverage_class(struct ieee80211_hw *hw, s16 coverage_class)
717717 {
718718 struct mt7915_phy *phy = mt7915_hw_phy(hw);
719+ struct mt7915_dev *dev = phy->dev;
719720
721+ mutex_lock(&dev->mt76.mutex);
720722 phy->coverage_class = max_t(s16, coverage_class, 0);
721723 mt7915_mac_set_timing(phy);
724+ mutex_unlock(&dev->mt76.mutex);
722725 }
723726
724727 static int
drivers/net/wireless/mediatek/mt76/tx.c+7−0
@@ -264,6 +264,13 @@ mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta, · 263 unmodified lines
264264 skb_set_queue_mapping(skb, qid);
265265 }
266266
267+ if ((dev->drv->drv_flags & MT_DRV_HW_MGMT_TXQ) &&
268+ !ieee80211_is_data(hdr->frame_control) &&
269+ !ieee80211_is_bufferable_mmpdu(hdr->frame_control)) {
270+ qid = MT_TXQ_PSD;
271+ skb_set_queue_mapping(skb, qid);
272+ }
273+
267274 if (!(wcid->tx_info & MT_WCID_TX_INFO_SET))
268275 ieee80211_get_tx_rates(info->control.vif, sta, skb,
269276 info->control.rates, 1);
drivers/net/wireless/mediatek/mt76/usb.c+26−13
@@ -1010,17 +1010,18 @@ static void mt76u_tx_kick(struct mt76_dev *dev, struct mt76_queue *q) · 1009 unmodified lines
10101010 static u8 mt76u_ac_to_hwq(struct mt76_dev *dev, u8 ac)
10111011 {
10121012 if (mt76_chip(dev) == 0x7663) {
1013− static const u8 wmm_queue_map[] = {
1014− [IEEE80211_AC_VO] = 0,
1015− [IEEE80211_AC_VI] = 1,
1016− [IEEE80211_AC_BE] = 2,
1017− [IEEE80211_AC_BK] = 4,
1013+ static const u8 lmac_queue_map[] = {
1014+ /* ac to lmac mapping */
1015+ [IEEE80211_AC_BK] = 0,
1016+ [IEEE80211_AC_BE] = 1,
1017+ [IEEE80211_AC_VI] = 2,
1018+ [IEEE80211_AC_VO] = 4,
10181019 };
10191020
1020− if (WARN_ON(ac >= ARRAY_SIZE(wmm_queue_map)))
1021− return 2; /* BE */
1021+ if (WARN_ON(ac >= ARRAY_SIZE(lmac_queue_map)))
1022+ return 1; /* BE */
10221023
1023− return wmm_queue_map[ac];
1024+ return lmac_queue_map[ac];
10241025 }
10251026
10261027 return mt76_ac_to_hwq(ac);
@@ -1066,11 +1067,16 @@ static int mt76u_alloc_tx(struct mt76_dev *dev) · 39 unmodified lines
10661067
10671068 static void mt76u_free_tx(struct mt76_dev *dev)
10681069 {
1069− struct mt76_queue *q;
1070− int i, j;
1070+ int i;
10711071
10721072 for (i = 0; i < IEEE80211_NUM_ACS; i++) {
1073+ struct mt76_queue *q;
1074+ int j;
1075+
10731076 q = dev->q_tx[i].q;
1077+ if (!q)
1078+ continue;
1079+
10741080 for (j = 0; j < q->ndesc; j++)
10751081 usb_free_urb(q->entry[j].urb);
10761082 }
@@ -1078,17 +1084,22 @@ static void mt76u_free_tx(struct mt76_dev *dev) · 1 unmodified line
10781084
10791085 void mt76u_stop_tx(struct mt76_dev *dev)
10801086 {
1081− struct mt76_queue_entry entry;
1082− struct mt76_queue *q;
1083− int i, j, ret;
1087+ int ret;
10841088
10851089 ret = wait_event_timeout(dev->tx_wait, !mt76_has_tx_pending(&dev->phy),
10861090 HZ / 5);
10871091 if (!ret) {
1092+ struct mt76_queue_entry entry;
1093+ struct mt76_queue *q;
1094+ int i, j;
1095+
10881096 dev_err(dev->dev, "timed out waiting for pending tx\n");
10891097
10901098 for (i = 0; i < IEEE80211_NUM_ACS; i++) {
10911099 q = dev->q_tx[i].q;
1100+ if (!q)
1101+ continue;
1102+
10921103 for (j = 0; j < q->ndesc; j++)
10931104 usb_kill_urb(q->entry[j].urb);
10941105 }
@@ -1100,6 +1111,8 @@ void mt76u_stop_tx(struct mt76_dev *dev) · 5 unmodified lines
11001111 */
11011112 for (i = 0; i < IEEE80211_NUM_ACS; i++) {
11021113 q = dev->q_tx[i].q;
1114+ if (!q)
1115+ continue;
11031116
11041117 /* Assure we are in sync with killed tasklet. */
11051118 spin_lock_bh(&q->lock);
drivers/net/xen-netfront.c+42−22
@@ -63,6 +63,8 @@ module_param_named(max_queues, xennet_max_queues, uint, 0644); · 62 unmodified lines
6363 MODULE_PARM_DESC(max_queues,
6464 "Maximum number of queues per virtual interface");
6565
66+#define XENNET_TIMEOUT (5 * HZ)
67+
6668 static const struct ethtool_ops xennet_ethtool_ops;
6769
6870 struct netfront_cb {
@@ -1334,12 +1336,15 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev) · 1265 unmodified lines
13341336
13351337 netif_carrier_off(netdev);
13361338
1337− xenbus_switch_state(dev, XenbusStateInitialising);
1338− wait_event(module_wq,
1339− xenbus_read_driver_state(dev->otherend) !=
1340− XenbusStateClosed &&
1341− xenbus_read_driver_state(dev->otherend) !=
1342− XenbusStateUnknown);
1339+ do {
1340+ xenbus_switch_state(dev, XenbusStateInitialising);
1341+ err = wait_event_timeout(module_wq,
1342+ xenbus_read_driver_state(dev->otherend) !=
1343+ XenbusStateClosed &&
1344+ xenbus_read_driver_state(dev->otherend) !=
1345+ XenbusStateUnknown, XENNET_TIMEOUT);
1346+ } while (!err);
1347+
13431348 return netdev;
13441349
13451350 exit:
@@ -2139,28 +2144,43 @@ static const struct attribute_group xennet_dev_group = { · 793 unmodified lines
21392144 };
21402145 #endif /* CONFIG_SYSFS */
21412146
2142−static int xennet_remove(struct xenbus_device *dev)
2147+static void xennet_bus_close(struct xenbus_device *dev)
21432148 {
2144− struct netfront_info *info = dev_get_drvdata(&dev->dev);
2145−
2146− dev_dbg(&dev->dev, "%s\n", dev->nodename);
2149+ int ret;
21472150
2148− if (xenbus_read_driver_state(dev->otherend) != XenbusStateClosed) {
2151+ if (xenbus_read_driver_state(dev->otherend) == XenbusStateClosed)
2152+ return;
2153+ do {
21492154 xenbus_switch_state(dev, XenbusStateClosing);
2150− wait_event(module_wq,
2151− xenbus_read_driver_state(dev->otherend) ==
2152− XenbusStateClosing ||
2153− xenbus_read_driver_state(dev->otherend) ==
2154− XenbusStateUnknown);
2155+ ret = wait_event_timeout(module_wq,
2156+ xenbus_read_driver_state(dev->otherend) ==
2157+ XenbusStateClosing ||
2158+ xenbus_read_driver_state(dev->otherend) ==
2159+ XenbusStateClosed ||
2160+ xenbus_read_driver_state(dev->otherend) ==
2161+ XenbusStateUnknown,
2162+ XENNET_TIMEOUT);
2163+ } while (!ret);
2164+
2165+ if (xenbus_read_driver_state(dev->otherend) == XenbusStateClosed)
2166+ return;
21552167
2168+ do {
21562169 xenbus_switch_state(dev, XenbusStateClosed);
2157− wait_event(module_wq,
2158− xenbus_read_driver_state(dev->otherend) ==
2159− XenbusStateClosed ||
2160− xenbus_read_driver_state(dev->otherend) ==
2161− XenbusStateUnknown);
2162− }
2170+ ret = wait_event_timeout(module_wq,
2171+ xenbus_read_driver_state(dev->otherend) ==
2172+ XenbusStateClosed ||
2173+ xenbus_read_driver_state(dev->otherend) ==
2174+ XenbusStateUnknown,
2175+ XENNET_TIMEOUT);
2176+ } while (!ret);
2177+}
2178+
2179+static int xennet_remove(struct xenbus_device *dev)
2180+{
2181+ struct netfront_info *info = dev_get_drvdata(&dev->dev);
21632182
2183+ xennet_bus_close(dev);
21642184 xennet_disconnect_backend(info);
21652185
21662186 if (info->netdev->reg_state == NETREG_REGISTERED)
drivers/nfc/s3fwrn5/core.c+1−0
@@ -198,6 +198,7 @@ int s3fwrn5_recv_frame(struct nci_dev *ndev, struct sk_buff *skb, · 197 unmodified lines
198198 case S3FWRN5_MODE_FW:
199199 return s3fwrn5_fw_recv_frame(ndev, skb);
200200 default:
201+ kfree_skb(skb);
201202 return -ENODEV;
202203 }
203204 }
drivers/nvdimm/security.c+1−1
@@ -95,7 +95,7 @@ static struct key *nvdimm_lookup_user_key(struct nvdimm *nvdimm, · 94 unmodified lines
9595 struct encrypted_key_payload *epayload;
9696 struct device *dev = &nvdimm->dev;
9797
98− keyref = lookup_user_key(id, 0, 0);
98+ keyref = lookup_user_key(id, 0, KEY_NEED_SEARCH);
9999 if (IS_ERR(keyref))
100100 return NULL;
101101
drivers/nvme/host/core.c+4−12
@@ -1102,6 +1102,9 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid, · 1101 unmodified lines
11021102 int pos;
11031103 int len;
11041104
1105+ if (ctrl->quirks & NVME_QUIRK_NO_NS_DESC_LIST)
1106+ return 0;
1107+
11051108 c.identify.opcode = nvme_admin_identify;
11061109 c.identify.nsid = cpu_to_le32(nsid);
11071110 c.identify.cns = NVME_ID_CNS_NS_DESC_LIST;
@@ -1115,18 +1118,6 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid, · 7 unmodified lines
11151118 if (status) {
11161119 dev_warn(ctrl->device,
11171120 "Identify Descriptors failed (%d)\n", status);
1118− /*
1119− * Don't treat non-retryable errors as fatal, as we potentially
1120− * already have a NGUID or EUI-64. If we failed with DNR set,
1121− * we want to silently ignore the error as we can still
1122− * identify the device, but if the status has DNR set, we want
1123− * to propagate the error back specifically for the disk
1124− * revalidation flow to make sure we don't abandon the
1125− * device just because of a temporal retry-able error (such
1126− * as path of transport errors).
1127− */
1128− if (status > 0 && (status & NVME_SC_DNR))
1129− status = 0;
11301121 goto free_data;
11311122 }
11321123
@@ -1980,6 +1971,7 @@ static int __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id) · 847 unmodified lines
19801971 if (ns->head->disk) {
19811972 nvme_update_disk_info(ns->head->disk, ns, id);
19821973 blk_queue_stack_limits(ns->head->disk->queue, ns->queue);
1974+ nvme_mpath_update_disk_size(ns->head->disk);
19831975 }
19841976 #endif
19851977 return 0;
drivers/nvme/host/nvme.h+20−0
@@ -129,6 +129,13 @@ enum nvme_quirks { · 128 unmodified lines
129129 * Don't change the value of the temperature threshold feature
130130 */
131131 NVME_QUIRK_NO_TEMP_THRESH_CHANGE = (1 << 14),
132+
133+ /*
134+ * The controller doesn't handle the Identify Namespace
135+ * Identification Descriptor list subcommand despite claiming
136+ * NVMe 1.3 compliance.
137+ */
138+ NVME_QUIRK_NO_NS_DESC_LIST = (1 << 15),
132139 };
133140
134141 /*
@@ -604,6 +611,16 @@ static inline void nvme_trace_bio_complete(struct request *req, · 469 unmodified lines
604611 trace_block_bio_complete(ns->head->disk->queue, req->bio);
605612 }
606613
614+static inline void nvme_mpath_update_disk_size(struct gendisk *disk)
615+{
616+ struct block_device *bdev = bdget_disk(disk, 0);
617+
618+ if (bdev) {
619+ bd_set_size(bdev, get_capacity(disk) << SECTOR_SHIFT);
620+ bdput(bdev);
621+ }
622+}
623+
607624 extern struct device_attribute dev_attr_ana_grpid;
608625 extern struct device_attribute dev_attr_ana_state;
609626 extern struct device_attribute subsys_attr_iopolicy;
@@ -679,6 +696,9 @@ static inline void nvme_mpath_wait_freeze(struct nvme_subsystem *subsys) · 69 unmodified lines
679696 static inline void nvme_mpath_start_freeze(struct nvme_subsystem *subsys)
680697 {
681698 }
699+static inline void nvme_mpath_update_disk_size(struct gendisk *disk)
700+{
701+}
682702 #endif /* CONFIG_NVME_MULTIPATH */
683703
684704 #ifdef CONFIG_NVM
drivers/nvme/host/pci.c+4−0
@@ -3099,6 +3099,8 @@ static const struct pci_device_id nvme_id_table[] = { · 3098 unmodified lines
30993099 { PCI_VDEVICE(INTEL, 0x5845), /* Qemu emulated controller */
31003100 .driver_data = NVME_QUIRK_IDENTIFY_CNS |
31013101 NVME_QUIRK_DISABLE_WRITE_ZEROES, },
3102+ { PCI_DEVICE(0x126f, 0x2263), /* Silicon Motion unidentified */
3103+ .driver_data = NVME_QUIRK_NO_NS_DESC_LIST, },
31023104 { PCI_DEVICE(0x1bb1, 0x0100), /* Seagate Nytro Flash Storage */
31033105 .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, },
31043106 { PCI_DEVICE(0x1c58, 0x0003), /* HGST adapter */
@@ -3122,6 +3124,8 @@ static const struct pci_device_id nvme_id_table[] = { · 17 unmodified lines
31223124 { PCI_DEVICE(0x1cc1, 0x8201), /* ADATA SX8200PNP 512GB */
31233125 .driver_data = NVME_QUIRK_NO_DEEPEST_PS |
31243126 NVME_QUIRK_IGNORE_DEV_SUBNQN, },
3127+ { PCI_DEVICE(0x1c5c, 0x1504), /* SK Hynix PC400 */
3128+ .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
31253129 { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
31263130 { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001),
31273131 .driver_data = NVME_QUIRK_SINGLE_VECTOR },
drivers/nvme/host/tcp.c+3−0
@@ -1382,6 +1382,9 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, · 1381 unmodified lines
13821382 if (nctrl->opts->tos >= 0)
13831383 ip_sock_set_tos(queue->sock->sk, nctrl->opts->tos);
13841384
1385+ /* Set 10 seconds timeout for icresp recvmsg */
1386+ queue->sock->sk->sk_rcvtimeo = 10 * HZ;
1387+
13851388 queue->sock->sk->sk_allocation = GFP_ATOMIC;
13861389 nvme_tcp_set_queue_io_cpu(queue);
13871390 queue->request = NULL;
drivers/opp/of.c+4−0
@@ -902,6 +902,10 @@ static int _of_add_opp_table_v1(struct device *dev, struct opp_table *opp_table) · 901 unmodified lines
902902 return -EINVAL;
903903 }
904904
905+ mutex_lock(&opp_table->lock);
906+ opp_table->parsed_static_opps = 1;
907+ mutex_unlock(&opp_table->lock);
908+
905909 val = prop->value;
906910 while (nr) {
907911 unsigned long freq = be32_to_cpup(val++) * 1000;
drivers/pci/controller/vmd.c+3−2
@@ -546,9 +546,10 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features) · 545 unmodified lines
546546
547547 vmd->irq_domain = pci_msi_create_irq_domain(fn, &vmd_msi_domain_info,
548548 x86_vector_domain);
549− irq_domain_free_fwnode(fn);
550− if (!vmd->irq_domain)
549+ if (!vmd->irq_domain) {
550+ irq_domain_free_fwnode(fn);
551551 return -ENODEV;
552+ }
552553
553554 pci_add_resource(&resources, &vmd->resources[0]);
554555 pci_add_resource_offset(&resources, &vmd->resources[1], offset[0]);
drivers/pci/pci.c+9−21
@@ -4638,8 +4638,7 @@ static int pci_pm_reset(struct pci_dev *dev, int probe) · 4637 unmodified lines
46384638 * pcie_wait_for_link_delay - Wait until link is active or inactive
46394639 * @pdev: Bridge device
46404640 * @active: waiting for active or inactive?
4641− * @delay: Delay to wait after link has become active (in ms). Specify %0
4642− * for no delay.
4641+ * @delay: Delay to wait after link has become active (in ms)
46434642 *
46444643 * Use this to wait till link becomes active or inactive.
46454644 */
@@ -4680,7 +4679,7 @@ static bool pcie_wait_for_link_delay(struct pci_dev *pdev, bool active, · 34 unmodified lines
46804679 msleep(10);
46814680 timeout -= 10;
46824681 }
4683− if (active && ret && delay)
4682+ if (active && ret)
46844683 msleep(delay);
46854684 else if (ret != active)
46864685 pci_info(pdev, "Data Link Layer Link Active not %s in 1000 msec\n",
@@ -4801,28 +4800,17 @@ void pci_bridge_wait_for_secondary_bus(struct pci_dev *dev) · 114 unmodified lines
48014800 if (!pcie_downstream_port(dev))
48024801 return;
48034802
4804− /*
4805− * Per PCIe r5.0, sec 6.6.1, for downstream ports that support
4806− * speeds > 5 GT/s, we must wait for link training to complete
4807− * before the mandatory delay.
4808− *
4809− * We can only tell when link training completes via DLL Link
4810− * Active, which is required for downstream ports that support
4811− * speeds > 5 GT/s (sec 7.5.3.6). Unfortunately some common
4812− * devices do not implement Link Active reporting even when it's
4813− * required, so we'll check for that directly instead of checking
4814− * the supported link speed. We assume devices without Link Active
4815− * reporting can train in 100 ms regardless of speed.
4816− */
4817− if (dev->link_active_reporting) {
4818− pci_dbg(dev, "waiting for link to train\n");
4819− if (!pcie_wait_for_link_delay(dev, true, 0)) {
4803+ if (pcie_get_speed_cap(dev) <= PCIE_SPEED_5_0GT) {
4804+ pci_dbg(dev, "waiting %d ms for downstream link\n", delay);
4805+ msleep(delay);
4806+ } else {
4807+ pci_dbg(dev, "waiting %d ms for downstream link, after activation\n",
4808+ delay);
4809+ if (!pcie_wait_for_link_delay(dev, true, delay)) {
48204810 /* Did not train, no need to wait any further */
48214811 return;
48224812 }
48234813 }
4824− pci_dbg(child, "waiting %d ms to become accessible\n", delay);
4825− msleep(delay);
48264814
48274815 if (!pci_device_is_present(child)) {
48284816 pci_dbg(child, "waiting additional %d ms to become accessible\n", delay);
drivers/pci/quirks.c+13−0
@@ -2330,6 +2330,19 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10f1, quirk_disable_aspm_l0s); · 2329 unmodified lines
23302330 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10f4, quirk_disable_aspm_l0s);
23312331 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1508, quirk_disable_aspm_l0s);
23322332
2333+static void quirk_disable_aspm_l0s_l1(struct pci_dev *dev)
2334+{
2335+ pci_info(dev, "Disabling ASPM L0s/L1\n");
2336+ pci_disable_link_state(dev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1);
2337+}
2338+
2339+/*
2340+ * ASM1083/1085 PCIe-PCI bridge devices cause AER timeout errors on the
2341+ * upstream PCIe root port when ASPM is enabled. At least L0s mode is affected;
2342+ * disable both L0s and L1 for now to be safe.
2343+ */
2344+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x1080, quirk_disable_aspm_l0s_l1);
2345+
23332346 /*
23342347 * Some Pericom PCIe-to-PCI bridges in reverse mode need the PCIe Retrain
23352348 * Link bit cleared after starting the link retrain process to allow this
drivers/perf/arm-cci.c+1−0
@@ -1718,6 +1718,7 @@ static struct platform_driver cci_pmu_driver = { · 1717 unmodified lines
17181718 .driver = {
17191719 .name = DRIVER_NAME,
17201720 .of_match_table = arm_cci_pmu_matches,
1721+ .suppress_bind_attrs = true,
17211722 },
17221723 .probe = cci_pmu_probe,
17231724 .remove = cci_pmu_remove,
drivers/perf/arm-ccn.c+1−0
@@ -1545,6 +1545,7 @@ static struct platform_driver arm_ccn_driver = { · 1544 unmodified lines
15451545 .driver = {
15461546 .name = "arm-ccn",
15471547 .of_match_table = arm_ccn_match,
1548+ .suppress_bind_attrs = true,
15481549 },
15491550 .probe = arm_ccn_probe,
15501551 .remove = arm_ccn_remove,
drivers/perf/arm_dsu_pmu.c+1−0
@@ -757,6 +757,7 @@ static struct platform_driver dsu_pmu_driver = { · 756 unmodified lines
757757 .driver = {
758758 .name = DRVNAME,
759759 .of_match_table = of_match_ptr(dsu_pmu_of_match),
760+ .suppress_bind_attrs = true,
760761 },
761762 .probe = dsu_pmu_device_probe,
762763 .remove = dsu_pmu_device_remove,
drivers/perf/arm_smmuv3_pmu.c+2−0
@@ -742,6 +742,7 @@ static int smmu_pmu_probe(struct platform_device *pdev) · 741 unmodified lines
742742 platform_set_drvdata(pdev, smmu_pmu);
743743
744744 smmu_pmu->pmu = (struct pmu) {
745+ .module = THIS_MODULE,
745746 .task_ctx_nr = perf_invalid_context,
746747 .pmu_enable = smmu_pmu_enable,
747748 .pmu_disable = smmu_pmu_disable,
@@ -859,6 +860,7 @@ static void smmu_pmu_shutdown(struct platform_device *pdev) · 111 unmodified lines
859860 static struct platform_driver smmu_pmu_driver = {
860861 .driver = {
861862 .name = "arm-smmu-v3-pmcg",
863+ .suppress_bind_attrs = true,
862864 },
863865 .probe = smmu_pmu_probe,
864866 .remove = smmu_pmu_remove,
drivers/perf/arm_spe_pmu.c+1−0
@@ -1226,6 +1226,7 @@ static struct platform_driver arm_spe_pmu_driver = { · 1225 unmodified lines
12261226 .driver = {
12271227 .name = DRVNAME,
12281228 .of_match_table = of_match_ptr(arm_spe_pmu_of_match),
1229+ .suppress_bind_attrs = true,
12291230 },
12301231 .probe = arm_spe_pmu_device_probe,
12311232 .remove = arm_spe_pmu_device_remove,
drivers/perf/fsl_imx8_ddr_perf.c+2−0
@@ -512,6 +512,7 @@ static int ddr_perf_init(struct ddr_pmu *pmu, void __iomem *base, · 511 unmodified lines
512512 {
513513 *pmu = (struct ddr_pmu) {
514514 .pmu = (struct pmu) {
515+ .module = THIS_MODULE,
515516 .capabilities = PERF_PMU_CAP_NO_EXCLUDE,
516517 .task_ctx_nr = perf_invalid_context,
517518 .attr_groups = attr_groups,
@@ -706,6 +707,7 @@ static struct platform_driver imx_ddr_pmu_driver = { · 188 unmodified lines
706707 .driver = {
707708 .name = "imx-ddr-pmu",
708709 .of_match_table = imx_ddr_pmu_dt_ids,
710+ .suppress_bind_attrs = true,
709711 },
710712 .probe = ddr_perf_probe,
711713 .remove = ddr_perf_remove,
drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c+2−0
@@ -378,6 +378,7 @@ static int hisi_ddrc_pmu_probe(struct platform_device *pdev) · 377 unmodified lines
378378 ddrc_pmu->sccl_id, ddrc_pmu->index_id);
379379 ddrc_pmu->pmu = (struct pmu) {
380380 .name = name,
381+ .module = THIS_MODULE,
381382 .task_ctx_nr = perf_invalid_context,
382383 .event_init = hisi_uncore_pmu_event_init,
383384 .pmu_enable = hisi_uncore_pmu_enable,
@@ -418,6 +419,7 @@ static struct platform_driver hisi_ddrc_pmu_driver = { · 34 unmodified lines
418419 .driver = {
419420 .name = "hisi_ddrc_pmu",
420421 .acpi_match_table = ACPI_PTR(hisi_ddrc_pmu_acpi_match),
422+ .suppress_bind_attrs = true,
421423 },
422424 .probe = hisi_ddrc_pmu_probe,
423425 .remove = hisi_ddrc_pmu_remove,
drivers/perf/hisilicon/hisi_uncore_hha_pmu.c+2−0
@@ -390,6 +390,7 @@ static int hisi_hha_pmu_probe(struct platform_device *pdev) · 389 unmodified lines
390390 hha_pmu->sccl_id, hha_pmu->index_id);
391391 hha_pmu->pmu = (struct pmu) {
392392 .name = name,
393+ .module = THIS_MODULE,
393394 .task_ctx_nr = perf_invalid_context,
394395 .event_init = hisi_uncore_pmu_event_init,
395396 .pmu_enable = hisi_uncore_pmu_enable,
@@ -430,6 +431,7 @@ static struct platform_driver hisi_hha_pmu_driver = { · 34 unmodified lines
430431 .driver = {
431432 .name = "hisi_hha_pmu",
432433 .acpi_match_table = ACPI_PTR(hisi_hha_pmu_acpi_match),
434+ .suppress_bind_attrs = true,
433435 },
434436 .probe = hisi_hha_pmu_probe,
435437 .remove = hisi_hha_pmu_remove,
drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c+2−0
@@ -380,6 +380,7 @@ static int hisi_l3c_pmu_probe(struct platform_device *pdev) · 379 unmodified lines
380380 l3c_pmu->sccl_id, l3c_pmu->index_id);
381381 l3c_pmu->pmu = (struct pmu) {
382382 .name = name,
383+ .module = THIS_MODULE,
383384 .task_ctx_nr = perf_invalid_context,
384385 .event_init = hisi_uncore_pmu_event_init,
385386 .pmu_enable = hisi_uncore_pmu_enable,
@@ -420,6 +421,7 @@ static struct platform_driver hisi_l3c_pmu_driver = { · 34 unmodified lines
420421 .driver = {
421422 .name = "hisi_l3c_pmu",
422423 .acpi_match_table = ACPI_PTR(hisi_l3c_pmu_acpi_match),
424+ .suppress_bind_attrs = true,
423425 },
424426 .probe = hisi_l3c_pmu_probe,
425427 .remove = hisi_l3c_pmu_remove,
drivers/perf/qcom_l2_pmu.c+1−0
@@ -1028,6 +1028,7 @@ static struct platform_driver l2_cache_pmu_driver = { · 1027 unmodified lines
10281028 .driver = {
10291029 .name = "qcom-l2cache-pmu",
10301030 .acpi_match_table = ACPI_PTR(l2_cache_pmu_acpi_match),
1031+ .suppress_bind_attrs = true,
10311032 },
10321033 .probe = l2_cache_pmu_probe,
10331034 .remove = l2_cache_pmu_remove,
drivers/perf/qcom_l3_pmu.c+1−0
@@ -814,6 +814,7 @@ static struct platform_driver qcom_l3_cache_pmu_driver = { · 813 unmodified lines
814814 .driver = {
815815 .name = "qcom-l3cache-pmu",
816816 .acpi_match_table = ACPI_PTR(qcom_l3_cache_pmu_acpi_match),
817+ .suppress_bind_attrs = true,
817818 },
818819 .probe = qcom_l3_cache_pmu_probe,
819820 };
drivers/perf/thunderx2_pmu.c+1−0
@@ -1017,6 +1017,7 @@ static struct platform_driver tx2_uncore_driver = { · 1016 unmodified lines
10171017 .driver = {
10181018 .name = "tx2-uncore-pmu",
10191019 .acpi_match_table = ACPI_PTR(tx2_uncore_acpi_match),
1020+ .suppress_bind_attrs = true,
10201021 },
10211022 .probe = tx2_uncore_probe,
10221023 .remove = tx2_uncore_remove,
drivers/perf/xgene_pmu.c+1−0
@@ -1975,6 +1975,7 @@ static struct platform_driver xgene_pmu_driver = { · 1974 unmodified lines
19751975 .name = "xgene-pmu",
19761976 .of_match_table = xgene_pmu_of_match,
19771977 .acpi_match_table = ACPI_PTR(xgene_pmu_acpi_match),
1978+ .suppress_bind_attrs = true,
19781979 },
19791980 };
19801981
drivers/phy/allwinner/phy-sun4i-usb.c+3−2
@@ -545,13 +545,14 @@ static void sun4i_usb_phy0_id_vbus_det_scan(struct work_struct *work) · 544 unmodified lines
545545 struct sun4i_usb_phy_data *data =
546546 container_of(work, struct sun4i_usb_phy_data, detect.work);
547547 struct phy *phy0 = data->phys[0].phy;
548− struct sun4i_usb_phy *phy = phy_get_drvdata(phy0);
548+ struct sun4i_usb_phy *phy;
549549 bool force_session_end, id_notify = false, vbus_notify = false;
550550 int id_det, vbus_det;
551551
552− if (phy0 == NULL)
552+ if (!phy0)
553553 return;
554554
555+ phy = phy_get_drvdata(phy0);
555556 id_det = sun4i_usb_phy0_get_id_det(data);
556557 vbus_det = sun4i_usb_phy0_get_vbus_det(data);
557558
drivers/phy/intel/phy-intel-combo.c+8−6
@@ -134,7 +134,7 @@ static inline void combo_phy_w32_off_mask(void __iomem *base, unsigned int reg, · 133 unmodified lines
134134
135135 reg_val = readl(base + reg);
136136 reg_val &= ~mask;
137− reg_val |= FIELD_PREP(mask, val);
137+ reg_val |= val;
138138 writel(reg_val, base + reg);
139139 }
140140
@@ -169,7 +169,7 @@ static int intel_cbphy_pcie_en_pad_refclk(struct intel_cbphy_iphy *iphy) · 28 unmodified lines
169169 return 0;
170170
171171 combo_phy_w32_off_mask(cbphy->app_base, PCIE_PHY_GEN_CTRL,
172− PCIE_PHY_CLK_PAD, 0);
172+ PCIE_PHY_CLK_PAD, FIELD_PREP(PCIE_PHY_CLK_PAD, 0));
173173
174174 /* Delay for stable clock PLL */
175175 usleep_range(50, 100);
@@ -192,14 +192,14 @@ static int intel_cbphy_pcie_dis_pad_refclk(struct intel_cbphy_iphy *iphy) · 16 unmodified lines
192192 return 0;
193193
194194 combo_phy_w32_off_mask(cbphy->app_base, PCIE_PHY_GEN_CTRL,
195− PCIE_PHY_CLK_PAD, 1);
195+ PCIE_PHY_CLK_PAD, FIELD_PREP(PCIE_PHY_CLK_PAD, 1));
196196
197197 return 0;
198198 }
199199
200200 static int intel_cbphy_set_mode(struct intel_combo_phy *cbphy)
201201 {
202− enum intel_combo_mode cb_mode = PHY_PCIE_MODE;
202+ enum intel_combo_mode cb_mode;
203203 enum aggregated_mode aggr = cbphy->aggr_mode;
204204 struct device *dev = cbphy->dev;
205205 enum intel_phy_mode mode;
@@ -224,6 +224,8 @@ static int intel_cbphy_set_mode(struct intel_combo_phy *cbphy) · 18 unmodified lines
224224
225225 cb_mode = SATA0_SATA1_MODE;
226226 break;
227+ default:
228+ return -EINVAL;
227229 }
228230
229231 ret = regmap_write(cbphy->hsiocfg, REG_COMBO_MODE(cbphy->bid), cb_mode);
@@ -385,7 +387,7 @@ static int intel_cbphy_calibrate(struct phy *phy) · 155 unmodified lines
385387
386388 /* trigger auto RX adaptation */
387389 combo_phy_w32_off_mask(cr_base, CR_ADDR(PCS_XF_ATE_OVRD_IN_2, id),
388− ADAPT_REQ_MSK, 3);
390+ ADAPT_REQ_MSK, FIELD_PREP(ADAPT_REQ_MSK, 3));
389391 /* Wait RX adaptation to finish */
390392 ret = readl_poll_timeout(cr_base + CR_ADDR(PCS_XF_RX_ADAPT_ACK, id),
391393 val, val & RX_ADAPT_ACK_BIT, 10, 5000);
@@ -396,7 +398,7 @@ static int intel_cbphy_calibrate(struct phy *phy) · 4 unmodified lines
396398
397399 /* Stop RX adaptation */
398400 combo_phy_w32_off_mask(cr_base, CR_ADDR(PCS_XF_ATE_OVRD_IN_2, id),
399− ADAPT_REQ_MSK, 0);
401+ ADAPT_REQ_MSK, FIELD_PREP(ADAPT_REQ_MSK, 0));
400402
401403 return ret;
402404 }
drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c+2−2
@@ -607,8 +607,8 @@ static int inno_dsidphy_probe(struct platform_device *pdev) · 606 unmodified lines
607607 platform_set_drvdata(pdev, inno);
608608
609609 inno->phy_base = devm_platform_ioremap_resource(pdev, 0);
610− if (!inno->phy_base)
611− return -ENOMEM;
610+ if (IS_ERR(inno->phy_base))
611+ return PTR_ERR(inno->phy_base);
612612
613613 inno->ref_clk = devm_clk_get(dev, "ref");
614614 if (IS_ERR(inno->ref_clk)) {
drivers/phy/ti/phy-am654-serdes.c+1−1
@@ -72,7 +72,7 @@ struct serdes_am654_clk_mux { · 71 unmodified lines
7272 #define to_serdes_am654_clk_mux(_hw) \
7373 container_of(_hw, struct serdes_am654_clk_mux, hw)
7474
75−static struct regmap_config serdes_am654_regmap_config = {
75+static const struct regmap_config serdes_am654_regmap_config = {
7676 .reg_bits = 32,
7777 .val_bits = 32,
7878 .reg_stride = 4,
drivers/phy/ti/phy-j721e-wiz.c+5−5
@@ -117,7 +117,7 @@ struct wiz_clk_mux { · 116 unmodified lines
117117 struct wiz_clk_divider {
118118 struct clk_hw hw;
119119 struct regmap_field *field;
120− struct clk_div_table *table;
120+ const struct clk_div_table *table;
121121 struct clk_init_data clk_data;
122122 };
123123
@@ -131,7 +131,7 @@ struct wiz_clk_mux_sel { · 7 unmodified lines
131131
132132 struct wiz_clk_div_sel {
133133 struct regmap_field *field;
134− struct clk_div_table *table;
134+ const struct clk_div_table *table;
135135 const char *node_name;
136136 };
137137
@@ -173,7 +173,7 @@ static struct wiz_clk_mux_sel clk_mux_sel_10g[] = { · 35 unmodified lines
173173 },
174174 };
175175
176−static struct clk_div_table clk_div_table[] = {
176+static const struct clk_div_table clk_div_table[] = {
177177 { .val = 0, .div = 1, },
178178 { .val = 1, .div = 2, },
179179 { .val = 2, .div = 4, },
@@ -559,7 +559,7 @@ static const struct clk_ops wiz_clk_div_ops = { · 379 unmodified lines
559559
560560 static int wiz_div_clk_register(struct wiz *wiz, struct device_node *node,
561561 struct regmap_field *field,
562− struct clk_div_table *table)
562+ const struct clk_div_table *table)
563563 {
564564 struct device *dev = wiz->dev;
565565 struct wiz_clk_divider *div;
@@ -756,7 +756,7 @@ static const struct reset_control_ops wiz_phy_reset_ops = { · 190 unmodified lines
756756 .deassert = wiz_phy_reset_deassert,
757757 };
758758
759−static struct regmap_config wiz_regmap_config = {
759+static const struct regmap_config wiz_regmap_config = {
760760 .reg_bits = 32,
761761 .val_bits = 32,
762762 .reg_stride = 4,
drivers/pinctrl/intel/pinctrl-baytrail.c+53−14
@@ -800,6 +800,21 @@ static void byt_gpio_disable_free(struct pinctrl_dev *pctl_dev, · 799 unmodified lines
800800 pm_runtime_put(vg->dev);
801801 }
802802
803+static void byt_gpio_direct_irq_check(struct intel_pinctrl *vg,
804+ unsigned int offset)
805+{
806+ void __iomem *conf_reg = byt_gpio_reg(vg, offset, BYT_CONF0_REG);
807+
808+ /*
809+ * Before making any direction modifications, do a check if gpio is set
810+ * for direct IRQ. On Bay Trail, setting GPIO to output does not make
811+ * sense, so let's at least inform the caller before they shoot
812+ * themselves in the foot.
813+ */
814+ if (readl(conf_reg) & BYT_DIRECT_IRQ_EN)
815+ dev_info_once(vg->dev, "Potential Error: Setting GPIO with direct_irq_en to output");
816+}
817+
803818 static int byt_gpio_set_direction(struct pinctrl_dev *pctl_dev,
804819 struct pinctrl_gpio_range *range,
805820 unsigned int offset,
@@ -807,7 +822,6 @@ static int byt_gpio_set_direction(struct pinctrl_dev *pctl_dev, · 1 unmodified line
807822 {
808823 struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctl_dev);
809824 void __iomem *val_reg = byt_gpio_reg(vg, offset, BYT_VAL_REG);
810− void __iomem *conf_reg = byt_gpio_reg(vg, offset, BYT_CONF0_REG);
811825 unsigned long flags;
812826 u32 value;
813827
@@ -817,14 +831,8 @@ static int byt_gpio_set_direction(struct pinctrl_dev *pctl_dev, · 3 unmodified lines
817831 value &= ~BYT_DIR_MASK;
818832 if (input)
819833 value |= BYT_OUTPUT_EN;
820− else if (readl(conf_reg) & BYT_DIRECT_IRQ_EN)
821− /*
822− * Before making any direction modifications, do a check if gpio
823− * is set for direct IRQ. On baytrail, setting GPIO to output
824− * does not make sense, so let's at least inform the caller before
825− * they shoot themselves in the foot.
826− */
827− dev_info_once(vg->dev, "Potential Error: Setting GPIO with direct_irq_en to output");
834+ else
835+ byt_gpio_direct_irq_check(vg, offset);
828836
829837 writel(value, val_reg);
830838
@@ -1165,19 +1173,50 @@ static int byt_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) · 334 unmodified lines
11651173
11661174 static int byt_gpio_direction_input(struct gpio_chip *chip, unsigned int offset)
11671175 {
1168− return pinctrl_gpio_direction_input(chip->base + offset);
1176+ struct intel_pinctrl *vg = gpiochip_get_data(chip);
1177+ void __iomem *val_reg = byt_gpio_reg(vg, offset, BYT_VAL_REG);
1178+ unsigned long flags;
1179+ u32 reg;
1180+
1181+ raw_spin_lock_irqsave(&byt_lock, flags);
1182+
1183+ reg = readl(val_reg);
1184+ reg &= ~BYT_DIR_MASK;
1185+ reg |= BYT_OUTPUT_EN;
1186+ writel(reg, val_reg);
1187+
1188+ raw_spin_unlock_irqrestore(&byt_lock, flags);
1189+ return 0;
11691190 }
11701191
1192+/*
1193+ * Note despite the temptation this MUST NOT be converted into a call to
1194+ * pinctrl_gpio_direction_output() + byt_gpio_set() that does not work this
1195+ * MUST be done as a single BYT_VAL_REG register write.
1196+ * See the commit message of the commit adding this comment for details.
1197+ */
11711198 static int byt_gpio_direction_output(struct gpio_chip *chip,
11721199 unsigned int offset, int value)
11731200 {
1174− int ret = pinctrl_gpio_direction_output(chip->base + offset);
1201+ struct intel_pinctrl *vg = gpiochip_get_data(chip);
1202+ void __iomem *val_reg = byt_gpio_reg(vg, offset, BYT_VAL_REG);
1203+ unsigned long flags;
1204+ u32 reg;
11751205
1176− if (ret)
1177− return ret;
1206+ raw_spin_lock_irqsave(&byt_lock, flags);
1207+
1208+ byt_gpio_direct_irq_check(vg, offset);
11781209
1179− byt_gpio_set(chip, offset, value);
1210+ reg = readl(val_reg);
1211+ reg &= ~BYT_DIR_MASK;
1212+ if (value)
1213+ reg |= BYT_LEVEL;
1214+ else
1215+ reg &= ~BYT_LEVEL;
11801216
1217+ writel(reg, val_reg);
1218+
1219+ raw_spin_unlock_irqrestore(&byt_lock, flags);
11811220 return 0;
11821221 }
11831222
drivers/pinctrl/pinctrl-amd.h+1−1
@@ -252,7 +252,7 @@ static const struct amd_pingroup kerncz_groups[] = { · 251 unmodified lines
252252 {
253253 .name = "uart0",
254254 .pins = uart0_pins,
255− .npins = 9,
255+ .npins = 5,
256256 },
257257 {
258258 .name = "uart1",
drivers/pinctrl/qcom/Kconfig+2−0
@@ -7,6 +7,8 @@ config PINCTRL_MSM · 6 unmodified lines
77 select PINCONF
88 select GENERIC_PINCONF
99 select GPIOLIB_IRQCHIP
10+ select IRQ_DOMAIN_HIERARCHY
11+ select IRQ_FASTEOI_HIERARCHY_HANDLERS
1012
1113 config PINCTRL_APQ8064
1214 tristate "Qualcomm APQ8064 pin controller driver"
drivers/pinctrl/qcom/pinctrl-msm.c+72−2
@@ -832,6 +832,52 @@ static void msm_gpio_irq_unmask(struct irq_data *d) · 831 unmodified lines
832832 msm_gpio_irq_clear_unmask(d, false);
833833 }
834834
835+/**
836+ * msm_gpio_update_dual_edge_parent() - Prime next edge for IRQs handled by parent.
837+ * @d: The irq dta.
838+ *
839+ * This is much like msm_gpio_update_dual_edge_pos() but for IRQs that are
840+ * normally handled by the parent irqchip. The logic here is slightly
841+ * different due to what's easy to do with our parent, but in principle it's
842+ * the same.
843+ */
844+static void msm_gpio_update_dual_edge_parent(struct irq_data *d)
845+{
846+ struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
847+ struct msm_pinctrl *pctrl = gpiochip_get_data(gc);
848+ const struct msm_pingroup *g = &pctrl->soc->groups[d->hwirq];
849+ int loop_limit = 100;
850+ unsigned int val;
851+ unsigned int type;
852+
853+ /* Read the value and make a guess about what edge we need to catch */
854+ val = msm_readl_io(pctrl, g) & BIT(g->in_bit);
855+ type = val ? IRQ_TYPE_EDGE_FALLING : IRQ_TYPE_EDGE_RISING;
856+
857+ do {
858+ /* Set the parent to catch the next edge */
859+ irq_chip_set_type_parent(d, type);
860+
861+ /*
862+ * Possibly the line changed between when we last read "val"
863+ * (and decided what edge we needed) and when set the edge.
864+ * If the value didn't change (or changed and then changed
865+ * back) then we're done.
866+ */
867+ val = msm_readl_io(pctrl, g) & BIT(g->in_bit);
868+ if (type == IRQ_TYPE_EDGE_RISING) {
869+ if (!val)
870+ return;
871+ type = IRQ_TYPE_EDGE_FALLING;
872+ } else if (type == IRQ_TYPE_EDGE_FALLING) {
873+ if (val)
874+ return;
875+ type = IRQ_TYPE_EDGE_RISING;
876+ }
877+ } while (loop_limit-- > 0);
878+ dev_warn_once(pctrl->dev, "dual-edge irq failed to stabilize\n");
879+}
880+
835881 static void msm_gpio_irq_ack(struct irq_data *d)
836882 {
837883 struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
@@ -840,8 +886,11 @@ static void msm_gpio_irq_ack(struct irq_data *d) · 2 unmodified lines
840886 unsigned long flags;
841887 u32 val;
842888
843− if (test_bit(d->hwirq, pctrl->skip_wake_irqs))
889+ if (test_bit(d->hwirq, pctrl->skip_wake_irqs)) {
890+ if (test_bit(d->hwirq, pctrl->dual_edge_irqs))
891+ msm_gpio_update_dual_edge_parent(d);
844892 return;
893+ }
845894
846895 g = &pctrl->soc->groups[d->hwirq];
847896
@@ -860,6 +909,17 @@ static void msm_gpio_irq_ack(struct irq_data *d) · 12 unmodified lines
860909 raw_spin_unlock_irqrestore(&pctrl->lock, flags);
861910 }
862911
912+static bool msm_gpio_needs_dual_edge_parent_workaround(struct irq_data *d,
913+ unsigned int type)
914+{
915+ struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
916+ struct msm_pinctrl *pctrl = gpiochip_get_data(gc);
917+
918+ return type == IRQ_TYPE_EDGE_BOTH &&
919+ pctrl->soc->wakeirq_dual_edge_errata && d->parent_data &&
920+ test_bit(d->hwirq, pctrl->skip_wake_irqs);
921+}
922+
863923 static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int type)
864924 {
865925 struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
@@ -868,11 +928,21 @@ static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int type) · 2 unmodified lines
868928 unsigned long flags;
869929 u32 val;
870930
931+ if (msm_gpio_needs_dual_edge_parent_workaround(d, type)) {
932+ set_bit(d->hwirq, pctrl->dual_edge_irqs);
933+ irq_set_handler_locked(d, handle_fasteoi_ack_irq);
934+ msm_gpio_update_dual_edge_parent(d);
935+ return 0;
936+ }
937+
871938 if (d->parent_data)
872939 irq_chip_set_type_parent(d, type);
873940
874− if (test_bit(d->hwirq, pctrl->skip_wake_irqs))
941+ if (test_bit(d->hwirq, pctrl->skip_wake_irqs)) {
942+ clear_bit(d->hwirq, pctrl->dual_edge_irqs);
943+ irq_set_handler_locked(d, handle_fasteoi_irq);
875944 return 0;
945+ }
876946
877947 g = &pctrl->soc->groups[d->hwirq];
878948
drivers/pinctrl/qcom/pinctrl-msm.h+4−0
@@ -113,6 +113,9 @@ struct msm_gpio_wakeirq_map { · 112 unmodified lines
113113 * @pull_no_keeper: The SoC does not support keeper bias.
114114 * @wakeirq_map: The map of wakeup capable GPIOs and the pin at PDC/MPM
115115 * @nwakeirq_map: The number of entries in @wakeirq_map
116+ * @wakeirq_dual_edge_errata: If true then GPIOs using the wakeirq_map need
117+ * to be aware that their parent can't handle dual
118+ * edge interrupts.
116119 */
117120 struct msm_pinctrl_soc_data {
118121 const struct pinctrl_pin_desc *pins;
@@ -128,6 +131,7 @@ struct msm_pinctrl_soc_data { · 9 unmodified lines
128131 const int *reserved_gpios;
129132 const struct msm_gpio_wakeirq_map *wakeirq_map;
130133 unsigned int nwakeirq_map;
134+ bool wakeirq_dual_edge_errata;
131135 };
132136
133137 extern const struct dev_pm_ops msm_pinctrl_dev_pm_ops;
drivers/pinctrl/qcom/pinctrl-sc7180.c+1−0
@@ -1147,6 +1147,7 @@ static const struct msm_pinctrl_soc_data sc7180_pinctrl = { · 1146 unmodified lines
11471147 .ntiles = ARRAY_SIZE(sc7180_tiles),
11481148 .wakeirq_map = sc7180_pdc_map,
11491149 .nwakeirq_map = ARRAY_SIZE(sc7180_pdc_map),
1150+ .wakeirq_dual_edge_errata = true,
11501151 };
11511152
11521153 static int sc7180_pinctrl_probe(struct platform_device *pdev)
drivers/platform/x86/asus-wmi.c+1−0
@@ -441,6 +441,7 @@ static int asus_wmi_battery_add(struct power_supply *battery) · 440 unmodified lines
441441 * battery is named BATT.
442442 */
443443 if (strcmp(battery->desc->name, "BAT0") != 0 &&
444+ strcmp(battery->desc->name, "BAT1") != 0 &&
444445 strcmp(battery->desc->name, "BATT") != 0)
445446 return -ENODEV;
446447
drivers/platform/x86/intel_speed_select_if/isst_if_common.h+3−0
@@ -13,6 +13,9 @@ · 12 unmodified lines
1313 #define INTEL_RAPL_PRIO_DEVID_0 0x3451
1414 #define INTEL_CFG_MBOX_DEVID_0 0x3459
1515
16+#define INTEL_RAPL_PRIO_DEVID_1 0x3251
17+#define INTEL_CFG_MBOX_DEVID_1 0x3259
18+
1619 /*
1720 * Validate maximum commands in a single request.
1821 * This is enough to handle command to every core in one ioctl, or all
drivers/platform/x86/intel_speed_select_if/isst_if_mbox_pci.c+1−0
@@ -147,6 +147,7 @@ static long isst_if_mbox_proc_cmd(u8 *cmd_ptr, int *write_only, int resume) · 146 unmodified lines
147147
148148 static const struct pci_device_id isst_if_mbox_ids[] = {
149149 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, INTEL_CFG_MBOX_DEVID_0)},
150+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, INTEL_CFG_MBOX_DEVID_1)},
150151 { 0 },
151152 };
152153 MODULE_DEVICE_TABLE(pci, isst_if_mbox_ids);
drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c+1−0
@@ -72,6 +72,7 @@ static long isst_if_mmio_rd_wr(u8 *cmd_ptr, int *write_only, int resume) · 71 unmodified lines
7272
7373 static const struct pci_device_id isst_if_ids[] = {
7474 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, INTEL_RAPL_PRIO_DEVID_0)},
75+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, INTEL_RAPL_PRIO_DEVID_1)},
7576 { 0 },
7677 };
7778 MODULE_DEVICE_TABLE(pci, isst_if_ids);
drivers/platform/x86/thinkpad_acpi.c+11−3
@@ -885,11 +885,19 @@ static ssize_t dispatch_proc_write(struct file *file, · 884 unmodified lines
885885
886886 if (!ibm || !ibm->write)
887887 return -EINVAL;
888+ if (count > PAGE_SIZE - 1)
889+ return -EINVAL;
890+
891+ kernbuf = kmalloc(count + 1, GFP_KERNEL);
892+ if (!kernbuf)
893+ return -ENOMEM;
888894
889− kernbuf = strndup_user(userbuf, PAGE_SIZE);
890− if (IS_ERR(kernbuf))
891− return PTR_ERR(kernbuf);
895+ if (copy_from_user(kernbuf, userbuf, count)) {
896+ kfree(kernbuf);
897+ return -EFAULT;
898+ }
892899
900+ kernbuf[count] = 0;
893901 ret = ibm->write(kernbuf);
894902 if (ret == 0)
895903 ret = count;
drivers/regulator/Makefile+1−1
@@ -31,7 +31,7 @@ obj-$(CONFIG_REGULATOR_BD70528) += bd70528-regulator.o · 30 unmodified lines
3131 obj-$(CONFIG_REGULATOR_BD71828) += bd71828-regulator.o
3232 obj-$(CONFIG_REGULATOR_BD718XX) += bd718x7-regulator.o
3333 obj-$(CONFIG_REGULATOR_BD9571MWV) += bd9571mwv-regulator.o
34−obj-$(CONFIG_REGULATOR_DA903X) += da903x.o
34+obj-$(CONFIG_REGULATOR_DA903X) += da903x-regulator.o
3535 obj-$(CONFIG_REGULATOR_DA9052) += da9052-regulator.o
3636 obj-$(CONFIG_REGULATOR_DA9055) += da9055-regulator.o
3737 obj-$(CONFIG_REGULATOR_DA9062) += da9062-regulator.o
drivers/regulator/da903x-regulator.crenamed from drivers/regulator/da903x.c+0−0

File renamed without changes.

drivers/regulator/qcom_smd-regulator.c+1−1
@@ -821,7 +821,7 @@ static const struct rpm_regulator_data rpm_pm8994_regulators[] = { · 820 unmodified lines
821821 static const struct rpm_regulator_data rpm_pmi8994_regulators[] = {
822822 { "s1", QCOM_SMD_RPM_SMPB, 1, &pmi8994_ftsmps, "vdd_s1" },
823823 { "s2", QCOM_SMD_RPM_SMPB, 2, &pmi8994_hfsmps, "vdd_s2" },
824− { "s2", QCOM_SMD_RPM_SMPB, 3, &pmi8994_hfsmps, "vdd_s3" },
824+ { "s3", QCOM_SMD_RPM_SMPB, 3, &pmi8994_hfsmps, "vdd_s3" },
825825 { "boost-bypass", QCOM_SMD_RPM_BBYB, 1, &pmi8994_bby, "vdd_bst_byp" },
826826 {}
827827 };
drivers/scsi/libiscsi.c+1−1
@@ -2629,7 +2629,7 @@ struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht, · 2628 unmodified lines
26292629 "iscsi_q_%d", shost->host_no);
26302630 ihost->workq = alloc_workqueue("%s",
26312631 WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
2632− 2, ihost->workq_name);
2632+ 1, ihost->workq_name);
26332633 if (!ihost->workq)
26342634 goto free_host;
26352635 }
drivers/scsi/megaraid/megaraid_sas_fusion.c+0−2
@@ -3739,10 +3739,8 @@ static irqreturn_t megasas_isr_fusion(int irq, void *devp) · 3738 unmodified lines
37393739 if (instance->mask_interrupts)
37403740 return IRQ_NONE;
37413741
3742−#if defined(ENABLE_IRQ_POLL)
37433742 if (irq_context->irq_poll_scheduled)
37443743 return IRQ_HANDLED;
3745−#endif
37463744
37473745 if (!instance->msix_vectors) {
37483746 mfiStatus = instance->instancet->clear_intr(instance);
drivers/scsi/mpt3sas/mpt3sas_ctl.c+7−5
@@ -3145,19 +3145,18 @@ BRM_status_show(struct device *cdev, struct device_attribute *attr, · 3144 unmodified lines
31453145 if (!ioc->is_warpdrive) {
31463146 ioc_err(ioc, "%s: BRM attribute is only for warpdrive\n",
31473147 __func__);
3148− goto out;
3148+ return 0;
31493149 }
31503150 /* pci_access_mutex lock acquired by sysfs show path */
31513151 mutex_lock(&ioc->pci_access_mutex);
3152− if (ioc->pci_error_recovery || ioc->remove_host) {
3153− mutex_unlock(&ioc->pci_access_mutex);
3154− return 0;
3155− }
3152+ if (ioc->pci_error_recovery || ioc->remove_host)
3153+ goto out;
31563154
31573155 /* allocate upto GPIOVal 36 entries */
31583156 sz = offsetof(Mpi2IOUnitPage3_t, GPIOVal) + (sizeof(u16) * 36);
31593157 io_unit_pg3 = kzalloc(sz, GFP_KERNEL);
31603158 if (!io_unit_pg3) {
3159+ rc = -ENOMEM;
31613160 ioc_err(ioc, "%s: failed allocating memory for iounit_pg3: (%d) bytes\n",
31623161 __func__, sz);
31633162 goto out;
@@ -3167,6 +3166,7 @@ BRM_status_show(struct device *cdev, struct device_attribute *attr, · 3 unmodified lines
31673166 0) {
31683167 ioc_err(ioc, "%s: failed reading iounit_pg3\n",
31693168 __func__);
3169+ rc = -EINVAL;
31703170 goto out;
31713171 }
31723172
@@ -3174,12 +3174,14 @@ BRM_status_show(struct device *cdev, struct device_attribute *attr, · 1 unmodified line
31743174 if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
31753175 ioc_err(ioc, "%s: iounit_pg3 failed with ioc_status(0x%04x)\n",
31763176 __func__, ioc_status);
3177+ rc = -EINVAL;
31773178 goto out;
31783179 }
31793180
31803181 if (io_unit_pg3->GPIOCount < 25) {
31813182 ioc_err(ioc, "%s: iounit_pg3->GPIOCount less than 25 entries, detected (%d) entries\n",
31823183 __func__, io_unit_pg3->GPIOCount);
3184+ rc = -EINVAL;
31833185 goto out;
31843186 }
31853187
drivers/scsi/scsi_devinfo.c+1−0
@@ -239,6 +239,7 @@ static struct { · 238 unmodified lines
239239 {"LSI", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
240240 {"ENGENIO", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
241241 {"LENOVO", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
242+ {"FUJITSU", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
242243 {"SanDisk", "Cruzer Blade", NULL, BLIST_TRY_VPD_PAGES |
243244 BLIST_INQUIRY_36},
244245 {"SMSC", "USB 2 HS-CF", NULL, BLIST_SPARSELUN | BLIST_INQUIRY_36},
drivers/scsi/scsi_dh.c+1−0
@@ -63,6 +63,7 @@ static const struct scsi_dh_blist scsi_dh_blist[] = { · 62 unmodified lines
6363 {"LSI", "INF-01-00", "rdac", },
6464 {"ENGENIO", "INF-01-00", "rdac", },
6565 {"LENOVO", "DE_Series", "rdac", },
66+ {"FUJITSU", "ETERNUS_AHB", "rdac", },
6667 {NULL, NULL, NULL },
6768 };
6869
drivers/scsi/scsi_lib.c+11−5
@@ -547,6 +547,15 @@ static void scsi_mq_uninit_cmd(struct scsi_cmnd *cmd) · 546 unmodified lines
547547 scsi_uninit_cmd(cmd);
548548 }
549549
550+static void scsi_run_queue_async(struct scsi_device *sdev)
551+{
552+ if (scsi_target(sdev)->single_lun ||
553+ !list_empty(&sdev->host->starved_list))
554+ kblockd_schedule_work(&sdev->requeue_work);
555+ else
556+ blk_mq_run_hw_queues(sdev->request_queue, true);
557+}
558+
550559 /* Returns false when no more bytes to process, true if there are more */
551560 static bool scsi_end_request(struct request *req, blk_status_t error,
552561 unsigned int bytes)
@@ -591,11 +600,7 @@ static bool scsi_end_request(struct request *req, blk_status_t error, · 38 unmodified lines
591600
592601 __blk_mq_end_request(req, error);
593602
594− if (scsi_target(sdev)->single_lun ||
595− !list_empty(&sdev->host->starved_list))
596− kblockd_schedule_work(&sdev->requeue_work);
597− else
598− blk_mq_run_hw_queues(q, true);
603+ scsi_run_queue_async(sdev);
599604
600605 percpu_ref_put(&q->q_usage_counter);
601606 return false;
@@ -1702,6 +1707,7 @@ out_put_budget: · 1100 unmodified lines
17021707 */
17031708 if (req->rq_flags & RQF_DONTPREP)
17041709 scsi_mq_uninit_cmd(cmd);
1710+ scsi_run_queue_async(sdev);
17051711 break;
17061712 }
17071713 return ret;
drivers/scsi/scsi_transport_iscsi.c+1−1
@@ -4760,7 +4760,7 @@ static __init int iscsi_transport_init(void) · 4759 unmodified lines
47604760
47614761 iscsi_eh_timer_workq = alloc_workqueue("%s",
47624762 WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
4763− 2, "iscsi_eh");
4763+ 1, "iscsi_eh");
47644764 if (!iscsi_eh_timer_workq) {
47654765 err = -ENOMEM;
47664766 goto release_nls;
drivers/scsi/scsi_transport_spi.c+1−1
@@ -339,7 +339,7 @@ store_spi_transport_##field(struct device *dev, \ · 338 unmodified lines
339339 struct spi_transport_attrs *tp \
340340 = (struct spi_transport_attrs *)&starget->starget_data; \
341341 \
342− if (i->f->set_##field) \
342+ if (!i->f->set_##field) \
343343 return -EINVAL; \
344344 val = simple_strtoul(buf, NULL, 0); \
345345 if (val > tp->max_##field) \
drivers/soc/amlogic/meson-gx-socinfo.c+5−3
@@ -66,10 +66,12 @@ static const struct meson_gx_package_id { · 65 unmodified lines
6666 { "A113D", 0x25, 0x22, 0xff },
6767 { "S905D2", 0x28, 0x10, 0xf0 },
6868 { "S905X2", 0x28, 0x40, 0xf0 },
69− { "S922X", 0x29, 0x40, 0xf0 },
7069 { "A311D", 0x29, 0x10, 0xf0 },
71− { "S905X3", 0x2b, 0x5, 0xf },
72− { "S905D3", 0x2b, 0xb0, 0xf0 },
70+ { "S922X", 0x29, 0x40, 0xf0 },
71+ { "S905D3", 0x2b, 0x4, 0xf5 },
72+ { "S905X3", 0x2b, 0x5, 0xf5 },
73+ { "S905X3", 0x2b, 0x10, 0x3f },
74+ { "S905D3", 0x2b, 0x30, 0x3f },
7375 { "A113L", 0x2c, 0x0, 0xf8 },
7476 };
7577
drivers/soc/imx/soc-imx.c+3−0
@@ -33,6 +33,9 @@ static int __init imx_soc_device_init(void) · 32 unmodified lines
3333 u32 val;
3434 int ret;
3535
36+ if (of_machine_is_compatible("fsl,ls1021a"))
37+ return 0;
38+
3639 soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
3740 if (!soc_dev_attr)
3841 return -ENOMEM;
drivers/soundwire/intel.c+3−2
@@ -930,8 +930,9 @@ static int intel_create_dai(struct sdw_cdns *cdns, · 929 unmodified lines
930930
931931 /* TODO: Read supported rates/formats from hardware */
932932 for (i = off; i < (off + num); i++) {
933− dais[i].name = kasprintf(GFP_KERNEL, "SDW%d Pin%d",
934− cdns->instance, i);
933+ dais[i].name = devm_kasprintf(cdns->dev, GFP_KERNEL,
934+ "SDW%d Pin%d",
935+ cdns->instance, i);
935936 if (!dais[i].name)
936937 return -ENOMEM;
937938
drivers/spi/spi-mt65xx.c+8−7
@@ -36,7 +36,6 @@ · 35 unmodified lines
3636 #define SPI_CFG0_SCK_LOW_OFFSET 8
3737 #define SPI_CFG0_CS_HOLD_OFFSET 16
3838 #define SPI_CFG0_CS_SETUP_OFFSET 24
39−#define SPI_ADJUST_CFG0_SCK_LOW_OFFSET 16
4039 #define SPI_ADJUST_CFG0_CS_HOLD_OFFSET 0
4140 #define SPI_ADJUST_CFG0_CS_SETUP_OFFSET 16
4241
@@ -48,6 +47,8 @@ · 5 unmodified lines
4847 #define SPI_CFG1_CS_IDLE_MASK 0xff
4948 #define SPI_CFG1_PACKET_LOOP_MASK 0xff00
5049 #define SPI_CFG1_PACKET_LENGTH_MASK 0x3ff0000
50+#define SPI_CFG2_SCK_HIGH_OFFSET 0
51+#define SPI_CFG2_SCK_LOW_OFFSET 16
5152
5253 #define SPI_CMD_ACT BIT(0)
5354 #define SPI_CMD_RESUME BIT(1)
@@ -283,7 +284,7 @@ static void mtk_spi_set_cs(struct spi_device *spi, bool enable) · 229 unmodified lines
283284 static void mtk_spi_prepare_transfer(struct spi_master *master,
284285 struct spi_transfer *xfer)
285286 {
286− u32 spi_clk_hz, div, sck_time, cs_time, reg_val = 0;
287+ u32 spi_clk_hz, div, sck_time, cs_time, reg_val;
287288 struct mtk_spi *mdata = spi_master_get_devdata(master);
288289
289290 spi_clk_hz = clk_get_rate(mdata->spi_clk);
@@ -296,18 +297,18 @@ static void mtk_spi_prepare_transfer(struct spi_master *master, · 6 unmodified lines
296297 cs_time = sck_time * 2;
297298
298299 if (mdata->dev_comp->enhance_timing) {
300+ reg_val = (((sck_time - 1) & 0xffff)
301+ << SPI_CFG2_SCK_HIGH_OFFSET);
299302 reg_val |= (((sck_time - 1) & 0xffff)
300− << SPI_CFG0_SCK_HIGH_OFFSET);
301− reg_val |= (((sck_time - 1) & 0xffff)
302− << SPI_ADJUST_CFG0_SCK_LOW_OFFSET);
303+ << SPI_CFG2_SCK_LOW_OFFSET);
303304 writel(reg_val, mdata->base + SPI_CFG2_REG);
304− reg_val |= (((cs_time - 1) & 0xffff)
305+ reg_val = (((cs_time - 1) & 0xffff)
305306 << SPI_ADJUST_CFG0_CS_HOLD_OFFSET);
306307 reg_val |= (((cs_time - 1) & 0xffff)
307308 << SPI_ADJUST_CFG0_CS_SETUP_OFFSET);
308309 writel(reg_val, mdata->base + SPI_CFG0_REG);
309310 } else {
310− reg_val |= (((sck_time - 1) & 0xff)
311+ reg_val = (((sck_time - 1) & 0xff)
311312 << SPI_CFG0_SCK_HIGH_OFFSET);
312313 reg_val |= (((sck_time - 1) & 0xff) << SPI_CFG0_SCK_LOW_OFFSET);
313314 reg_val |= (((cs_time - 1) & 0xff) << SPI_CFG0_CS_HOLD_OFFSET);
drivers/spi/spi-sun6i.c+6−8
@@ -198,7 +198,7 @@ static int sun6i_spi_transfer_one(struct spi_master *master, · 197 unmodified lines
198198 struct spi_transfer *tfr)
199199 {
200200 struct sun6i_spi *sspi = spi_master_get_devdata(master);
201− unsigned int mclk_rate, div, timeout;
201+ unsigned int mclk_rate, div, div_cdr1, div_cdr2, timeout;
202202 unsigned int start, end, tx_time;
203203 unsigned int trig_level;
204204 unsigned int tx_len = 0;
@@ -287,14 +287,12 @@ static int sun6i_spi_transfer_one(struct spi_master *master, · 82 unmodified lines
287287 * First try CDR2, and if we can't reach the expected
288288 * frequency, fall back to CDR1.
289289 */
290− div = mclk_rate / (2 * tfr->speed_hz);
291− if (div <= (SUN6I_CLK_CTL_CDR2_MASK + 1)) {
292− if (div > 0)
293− div--;
294−
295− reg = SUN6I_CLK_CTL_CDR2(div) | SUN6I_CLK_CTL_DRS;
290+ div_cdr1 = DIV_ROUND_UP(mclk_rate, tfr->speed_hz);
291+ div_cdr2 = DIV_ROUND_UP(div_cdr1, 2);
292+ if (div_cdr2 <= (SUN6I_CLK_CTL_CDR2_MASK + 1)) {
293+ reg = SUN6I_CLK_CTL_CDR2(div_cdr2 - 1) | SUN6I_CLK_CTL_DRS;
296294 } else {
297− div = ilog2(mclk_rate) - ilog2(tfr->speed_hz);
295+ div = min(SUN6I_CLK_CTL_CDR1_MASK, order_base_2(div_cdr1));
298296 reg = SUN6I_CLK_CTL_CDR1(div);
299297 }
300298
drivers/staging/comedi/drivers/addi_apci_1032.c+14−6
@@ -106,14 +106,22 @@ static int apci1032_cos_insn_config(struct comedi_device *dev, · 105 unmodified lines
106106 unsigned int *data)
107107 {
108108 struct apci1032_private *devpriv = dev->private;
109− unsigned int shift, oldmask;
109+ unsigned int shift, oldmask, himask, lomask;
110110
111111 switch (data[0]) {
112112 case INSN_CONFIG_DIGITAL_TRIG:
113113 if (data[1] != 0)
114114 return -EINVAL;
115115 shift = data[3];
116− oldmask = (1U << shift) - 1;
116+ if (shift < 32) {
117+ oldmask = (1U << shift) - 1;
118+ himask = data[4] << shift;
119+ lomask = data[5] << shift;
120+ } else {
121+ oldmask = 0xffffffffu;
122+ himask = 0;
123+ lomask = 0;
124+ }
117125 switch (data[2]) {
118126 case COMEDI_DIGITAL_TRIG_DISABLE:
119127 devpriv->ctrl = 0;
@@ -136,8 +144,8 @@ static int apci1032_cos_insn_config(struct comedi_device *dev, · 16 unmodified lines
136144 devpriv->mode2 &= oldmask;
137145 }
138146 /* configure specified channels */
139− devpriv->mode1 |= data[4] << shift;
140− devpriv->mode2 |= data[5] << shift;
147+ devpriv->mode1 |= himask;
148+ devpriv->mode2 |= lomask;
141149 break;
142150 case COMEDI_DIGITAL_TRIG_ENABLE_LEVELS:
143151 if (devpriv->ctrl != (APCI1032_CTRL_INT_ENA |
@@ -154,8 +162,8 @@ static int apci1032_cos_insn_config(struct comedi_device *dev, · 10 unmodified lines
154162 devpriv->mode2 &= oldmask;
155163 }
156164 /* configure specified channels */
157− devpriv->mode1 |= data[4] << shift;
158− devpriv->mode2 |= data[5] << shift;
165+ devpriv->mode1 |= himask;
166+ devpriv->mode2 |= lomask;
159167 break;
160168 default:
161169 return -EINVAL;
drivers/staging/comedi/drivers/addi_apci_1500.c+26−8
@@ -452,13 +452,14 @@ static int apci1500_di_cfg_trig(struct comedi_device *dev, · 451 unmodified lines
452452 struct apci1500_private *devpriv = dev->private;
453453 unsigned int trig = data[1];
454454 unsigned int shift = data[3];
455− unsigned int hi_mask = data[4] << shift;
456− unsigned int lo_mask = data[5] << shift;
457− unsigned int chan_mask = hi_mask | lo_mask;
458− unsigned int old_mask = (1 << shift) - 1;
459− unsigned int pm = devpriv->pm[trig] & old_mask;
460− unsigned int pt = devpriv->pt[trig] & old_mask;
461− unsigned int pp = devpriv->pp[trig] & old_mask;
455+ unsigned int hi_mask;
456+ unsigned int lo_mask;
457+ unsigned int chan_mask;
458+ unsigned int old_mask;
459+ unsigned int pm;
460+ unsigned int pt;
461+ unsigned int pp;
462+ unsigned int invalid_chan;
462463
463464 if (trig > 1) {
464465 dev_dbg(dev->class_dev,
@@ -466,11 +467,28 @@ static int apci1500_di_cfg_trig(struct comedi_device *dev, · 1 unmodified line
466467 return -EINVAL;
467468 }
468469
469− if (chan_mask > 0xffff) {
470+ if (shift <= 16) {
471+ hi_mask = data[4] << shift;
472+ lo_mask = data[5] << shift;
473+ old_mask = (1U << shift) - 1;
474+ invalid_chan = (data[4] | data[5]) >> (16 - shift);
475+ } else {
476+ hi_mask = 0;
477+ lo_mask = 0;
478+ old_mask = 0xffff;
479+ invalid_chan = data[4] | data[5];
480+ }
481+ chan_mask = hi_mask | lo_mask;
482+
483+ if (invalid_chan) {
470484 dev_dbg(dev->class_dev, "invalid digital trigger channel\n");
471485 return -EINVAL;
472486 }
473487
488+ pm = devpriv->pm[trig] & old_mask;
489+ pt = devpriv->pt[trig] & old_mask;
490+ pp = devpriv->pp[trig] & old_mask;
491+
474492 switch (data[2]) {
475493 case COMEDI_DIGITAL_TRIG_DISABLE:
476494 /* clear trigger configuration */
drivers/staging/comedi/drivers/addi_apci_1564.c+14−6
@@ -331,14 +331,22 @@ static int apci1564_cos_insn_config(struct comedi_device *dev, · 330 unmodified lines
331331 unsigned int *data)
332332 {
333333 struct apci1564_private *devpriv = dev->private;
334− unsigned int shift, oldmask;
334+ unsigned int shift, oldmask, himask, lomask;
335335
336336 switch (data[0]) {
337337 case INSN_CONFIG_DIGITAL_TRIG:
338338 if (data[1] != 0)
339339 return -EINVAL;
340340 shift = data[3];
341− oldmask = (1U << shift) - 1;
341+ if (shift < 32) {
342+ oldmask = (1U << shift) - 1;
343+ himask = data[4] << shift;
344+ lomask = data[5] << shift;
345+ } else {
346+ oldmask = 0xffffffffu;
347+ himask = 0;
348+ lomask = 0;
349+ }
342350 switch (data[2]) {
343351 case COMEDI_DIGITAL_TRIG_DISABLE:
344352 devpriv->ctrl = 0;
@@ -362,8 +370,8 @@ static int apci1564_cos_insn_config(struct comedi_device *dev, · 17 unmodified lines
362370 devpriv->mode2 &= oldmask;
363371 }
364372 /* configure specified channels */
365− devpriv->mode1 |= data[4] << shift;
366− devpriv->mode2 |= data[5] << shift;
373+ devpriv->mode1 |= himask;
374+ devpriv->mode2 |= lomask;
367375 break;
368376 case COMEDI_DIGITAL_TRIG_ENABLE_LEVELS:
369377 if (devpriv->ctrl != (APCI1564_DI_IRQ_ENA |
@@ -380,8 +388,8 @@ static int apci1564_cos_insn_config(struct comedi_device *dev, · 10 unmodified lines
380388 devpriv->mode2 &= oldmask;
381389 }
382390 /* configure specified channels */
383− devpriv->mode1 |= data[4] << shift;
384− devpriv->mode2 |= data[5] << shift;
391+ devpriv->mode1 |= himask;
392+ devpriv->mode2 |= lomask;
385393 break;
386394 default:
387395 return -EINVAL;
drivers/staging/comedi/drivers/ni_6527.c+1−1
@@ -332,7 +332,7 @@ static int ni6527_intr_insn_config(struct comedi_device *dev, · 331 unmodified lines
332332 case COMEDI_DIGITAL_TRIG_ENABLE_EDGES:
333333 /* check shift amount */
334334 shift = data[3];
335− if (shift >= s->n_chan) {
335+ if (shift >= 32) {
336336 mask = 0;
337337 rising = 0;
338338 falling = 0;
drivers/staging/media/atomisp/Kconfig+1−1
@@ -22,7 +22,7 @@ config VIDEO_ATOMISP · 21 unmodified lines
2222 module will be called atomisp
2323
2424 config VIDEO_ATOMISP_ISP2401
25− bool "VIDEO_ATOMISP_ISP2401"
25+ bool "Use Intel Atom ISP on Cherrytail/Anniedale (ISP2401)"
2626 depends on VIDEO_ATOMISP
2727 help
2828 Enable support for Atom ISP2401-based boards.
drivers/staging/media/atomisp/Makefile+1−5
@@ -156,6 +156,7 @@ atomisp-objs += \ · 155 unmodified lines
156156 pci/hive_isp_css_common/host/timed_ctrl.o \
157157 pci/hive_isp_css_common/host/vmem.o \
158158 pci/hive_isp_css_shared/host/tag.o \
159+ pci/system_local.o \
159160
160161 obj-byt = \
161162 pci/css_2400_system/hive/ia_css_isp_configs.o \
@@ -182,7 +183,6 @@ INCLUDES += \ · 20 unmodified lines
182183 -I$(atomisp)/include/hmm/ \
183184 -I$(atomisp)/include/mmu/ \
184185 -I$(atomisp)/pci/ \
185− -I$(atomisp)/pci/hrt/ \
186186 -I$(atomisp)/pci/base/circbuf/interface/ \
187187 -I$(atomisp)/pci/base/refcount/interface/ \
188188 -I$(atomisp)/pci/camera/pipe/interface/ \
@@ -192,7 +192,6 @@ INCLUDES += \ · 3 unmodified lines
192192 -I$(atomisp)/pci/hive_isp_css_include/ \
193193 -I$(atomisp)/pci/hive_isp_css_include/device_access/ \
194194 -I$(atomisp)/pci/hive_isp_css_include/host/ \
195− -I$(atomisp)/pci/hive_isp_css_include/memory_access/ \
196195 -I$(atomisp)/pci/hive_isp_css_shared/ \
197196 -I$(atomisp)/pci/hive_isp_css_shared/host/ \
198197 -I$(atomisp)/pci/isp/kernels/ \
@@ -311,9 +310,7 @@ INCLUDES += \ · 112 unmodified lines
311310 -I$(atomisp)/pci/runtime/tagger/interface/
312311
313312 INCLUDES_byt += \
314− -I$(atomisp)/pci/css_2400_system/ \
315313 -I$(atomisp)/pci/css_2400_system/hive/ \
316− -I$(atomisp)/pci/css_2400_system/hrt/ \
317314
318315 INCLUDES_cht += \
319316 -I$(atomisp)/pci/css_2401_system/ \
@@ -321,7 +318,6 @@ INCLUDES_cht += \ · 1 unmodified line
321318 -I$(atomisp)/pci/css_2401_system/hive/ \
322319 -I$(atomisp)/pci/css_2401_system/hrt/ \
323320
324−# -I$(atomisp)/pci/css_2401_system/hrt/ \
325321 # -I$(atomisp)/pci/css_2401_system/hive_isp_css_2401_system_generated/ \
326322
327323 DEFINES := -DHRT_HW -DHRT_ISP_CSS_CUSTOM_HOST -DHRT_USE_VIR_ADDRS -D__HOST__
drivers/staging/media/atomisp/i2c/atomisp-ov2680.c+3−3
@@ -495,11 +495,11 @@ static int ov2680_h_flip(struct v4l2_subdev *sd, s32 value) · 494 unmodified lines
495495 ret = ov2680_read_reg(client, 1, OV2680_MIRROR_REG, &val);
496496 if (ret)
497497 return ret;
498− if (value) {
498+ if (value)
499499 val |= OV2680_FLIP_MIRROR_BIT_ENABLE;
500− } else {
500+ else
501501 val &= ~OV2680_FLIP_MIRROR_BIT_ENABLE;
502− }
502+
503503 ret = ov2680_write_reg(client, 1,
504504 OV2680_MIRROR_REG, val);
505505 if (ret)
drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c+4−2
@@ -1899,7 +1899,7 @@ static int ov5693_probe(struct i2c_client *client) · 1898 unmodified lines
18991899 {
19001900 struct ov5693_device *dev;
19011901 int i2c;
1902− int ret = 0;
1902+ int ret;
19031903 void *pdata;
19041904 unsigned int i;
19051905
@@ -1929,8 +1929,10 @@ static int ov5693_probe(struct i2c_client *client) · 23 unmodified lines
19291929 pdata = gmin_camera_platform_data(&dev->sd,
19301930 ATOMISP_INPUT_FORMAT_RAW_10,
19311931 atomisp_bayer_order_bggr);
1932− if (!pdata)
1932+ if (!pdata) {
1933+ ret = -EINVAL;
19331934 goto out_free;
1935+ }
19341936
19351937 ret = ov5693_s_config(&dev->sd, client->irq, pdata);
19361938 if (ret)
drivers/staging/media/atomisp/include/linux/atomisp_platform.h+1−0
@@ -250,6 +250,7 @@ const struct atomisp_camera_caps *atomisp_get_default_camera_caps(void); · 249 unmodified lines
250250 #define IS_MFLD __IS_SOC(INTEL_FAM6_ATOM_SALTWELL_MID)
251251 #define IS_BYT __IS_SOC(INTEL_FAM6_ATOM_SILVERMONT)
252252 #define IS_CHT __IS_SOC(INTEL_FAM6_ATOM_AIRMONT)
253+#define IS_MRFD __IS_SOC(INTEL_FAM6_ATOM_SILVERMONT_MID)
253254 #define IS_MOFD __IS_SOC(INTEL_FAM6_ATOM_AIRMONT_MID)
254255
255256 /* Both CHT and MOFD come with ISP2401 */
drivers/staging/media/atomisp/pci/atomisp-regs.h+0−3
@@ -20,9 +20,6 @@ · 19 unmodified lines
2020 #define ATOMISP_REGS_H
2121
2222 /* common register definitions */
23−#define PUNIT_PORT 0x04
24−#define CCK_PORT 0x14
25−
2623 #define PCICMDSTS 0x01
2724 #define INTR 0x0f
2825 #define MSI_CAPID 0x24
drivers/staging/media/atomisp/pci/atomisp_acc.c+2−2
@@ -355,11 +355,11 @@ int atomisp_acc_map(struct atomisp_sub_device *asd, struct atomisp_acc_map *map) · 354 unmodified lines
355355
356356 pgnr = DIV_ROUND_UP(map->length, PAGE_SIZE);
357357 if (pgnr < ((PAGE_ALIGN(map->length)) >> PAGE_SHIFT)) {
358− dev_err(atomisp_dev,
358+ dev_err(asd->isp->dev,
359359 "user space memory size is less than the expected size..\n");
360360 return -ENOMEM;
361361 } else if (pgnr > ((PAGE_ALIGN(map->length)) >> PAGE_SHIFT)) {
362− dev_err(atomisp_dev,
362+ dev_err(asd->isp->dev,
363363 "user space memory size is large than the expected size..\n");
364364 return -ENOMEM;
365365 }
drivers/staging/media/atomisp/pci/atomisp_cmd.c+32−27
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <linux/firmware.h>
2222 #include <linux/pci.h>
2323 #include <linux/interrupt.h>
24+#include <linux/io.h>
2425 #include <linux/kernel.h>
2526 #include <linux/kfifo.h>
2627 #include <linux/pm_runtime.h>
@@ -109,7 +110,7 @@ struct atomisp_acc_pipe *atomisp_to_acc_pipe(struct video_device *dev) · 82 unmodified lines
109110
110111 static unsigned short atomisp_get_sensor_fps(struct atomisp_sub_device *asd)
111112 {
112− struct v4l2_subdev_frame_interval fi;
113+ struct v4l2_subdev_frame_interval fi = { 0 };
113114 struct atomisp_device *isp = asd->isp;
114115
115116 unsigned short fps = 0;
@@ -206,6 +207,7 @@ int atomisp_freq_scaling(struct atomisp_device *isp, · 90 unmodified lines
206207 enum atomisp_dfs_mode mode,
207208 bool force)
208209 {
210+ struct pci_dev *pdev = to_pci_dev(isp->dev);
209211 /* FIXME! Only use subdev[0] status yet */
210212 struct atomisp_sub_device *asd = &isp->asd[0];
211213 const struct atomisp_dfs_config *dfs;
@@ -219,7 +221,7 @@ int atomisp_freq_scaling(struct atomisp_device *isp, · 7 unmodified lines
219221 return -EINVAL;
220222 }
221223
222− if ((isp->pdev->device & ATOMISP_PCI_DEVICE_SOC_MASK) ==
224+ if ((pdev->device & ATOMISP_PCI_DEVICE_SOC_MASK) ==
223225 ATOMISP_PCI_DEVICE_SOC_CHT && ATOMISP_USE_YUVPP(asd))
224226 isp->dfs = &dfs_config_cht_soc;
225227
@@ -357,39 +359,41 @@ static void clear_isp_irq(enum hrt_isp_css_irq irq) · 131 unmodified lines
357359 irq_clear_all(IRQ0_ID);
358360 }
359361
360−void atomisp_msi_irq_init(struct atomisp_device *isp, struct pci_dev *dev)
362+void atomisp_msi_irq_init(struct atomisp_device *isp)
361363 {
364+ struct pci_dev *pdev = to_pci_dev(isp->dev);
362365 u32 msg32;
363366 u16 msg16;
364367
365− pci_read_config_dword(dev, PCI_MSI_CAPID, &msg32);
368+ pci_read_config_dword(pdev, PCI_MSI_CAPID, &msg32);
366369 msg32 |= 1 << MSI_ENABLE_BIT;
367− pci_write_config_dword(dev, PCI_MSI_CAPID, msg32);
370+ pci_write_config_dword(pdev, PCI_MSI_CAPID, msg32);
368371
369372 msg32 = (1 << INTR_IER) | (1 << INTR_IIR);
370− pci_write_config_dword(dev, PCI_INTERRUPT_CTRL, msg32);
373+ pci_write_config_dword(pdev, PCI_INTERRUPT_CTRL, msg32);
371374
372− pci_read_config_word(dev, PCI_COMMAND, &msg16);
375+ pci_read_config_word(pdev, PCI_COMMAND, &msg16);
373376 msg16 |= (PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |
374377 PCI_COMMAND_INTX_DISABLE);
375− pci_write_config_word(dev, PCI_COMMAND, msg16);
378+ pci_write_config_word(pdev, PCI_COMMAND, msg16);
376379 }
377380
378−void atomisp_msi_irq_uninit(struct atomisp_device *isp, struct pci_dev *dev)
381+void atomisp_msi_irq_uninit(struct atomisp_device *isp)
379382 {
383+ struct pci_dev *pdev = to_pci_dev(isp->dev);
380384 u32 msg32;
381385 u16 msg16;
382386
383− pci_read_config_dword(dev, PCI_MSI_CAPID, &msg32);
387+ pci_read_config_dword(pdev, PCI_MSI_CAPID, &msg32);
384388 msg32 &= ~(1 << MSI_ENABLE_BIT);
385− pci_write_config_dword(dev, PCI_MSI_CAPID, msg32);
389+ pci_write_config_dword(pdev, PCI_MSI_CAPID, msg32);
386390
387391 msg32 = 0x0;
388− pci_write_config_dword(dev, PCI_INTERRUPT_CTRL, msg32);
392+ pci_write_config_dword(pdev, PCI_INTERRUPT_CTRL, msg32);
389393
390− pci_read_config_word(dev, PCI_COMMAND, &msg16);
394+ pci_read_config_word(pdev, PCI_COMMAND, &msg16);
391395 msg16 &= ~(PCI_COMMAND_MASTER);
392− pci_write_config_word(dev, PCI_COMMAND, msg16);
396+ pci_write_config_word(pdev, PCI_COMMAND, msg16);
393397 }
394398
395399 static void atomisp_sof_event(struct atomisp_sub_device *asd)
@@ -480,11 +484,12 @@ static void print_csi_rx_errors(enum mipi_port_id port, · 84 unmodified lines
480484 /* Clear irq reg */
481485 static void clear_irq_reg(struct atomisp_device *isp)
482486 {
487+ struct pci_dev *pdev = to_pci_dev(isp->dev);
483488 u32 msg_ret;
484489
485− pci_read_config_dword(isp->pdev, PCI_INTERRUPT_CTRL, &msg_ret);
490+ pci_read_config_dword(pdev, PCI_INTERRUPT_CTRL, &msg_ret);
486491 msg_ret |= 1 << INTR_IIR;
487− pci_write_config_dword(isp->pdev, PCI_INTERRUPT_CTRL, msg_ret);
492+ pci_write_config_dword(pdev, PCI_INTERRUPT_CTRL, msg_ret);
488493 }
489494
490495 static struct atomisp_sub_device *
@@ -665,11 +670,10 @@ bool atomisp_buffers_queued_pipe(struct atomisp_video_pipe *pipe) · 174 unmodified lines
665670 void dump_sp_dmem(struct atomisp_device *isp, unsigned int addr,
666671 unsigned int size)
667672 {
668− u32 __iomem *io_virt_addr;
669673 unsigned int data = 0;
670674 unsigned int size32 = DIV_ROUND_UP(size, sizeof(u32));
671675
672− dev_dbg(isp->dev, "atomisp_io_base:%p\n", atomisp_io_base);
676+ dev_dbg(isp->dev, "atomisp mmio base: %p\n", isp->base);
673677 dev_dbg(isp->dev, "%s, addr:0x%x, size: %d, size32: %d\n", __func__,
674678 addr, size, size32);
675679 if (size32 * 4 + addr > 0x4000) {
@@ -678,13 +682,12 @@ void dump_sp_dmem(struct atomisp_device *isp, unsigned int addr, · 2 unmodified lines
678682 return;
679683 }
680684 addr += SP_DMEM_BASE;
681− io_virt_addr = atomisp_io_base + (addr & 0x003FFFFF);
685+ addr &= 0x003FFFFF;
682686 do {
683− data = *io_virt_addr;
687+ data = readl(isp->base + addr);
684688 dev_dbg(isp->dev, "%s, \t [0x%x]:0x%x\n", __func__, addr, data);
685− io_virt_addr += sizeof(u32);
686− size32 -= 1;
687− } while (size32 > 0);
689+ addr += sizeof(u32);
690+ } while (--size32);
688691 }
689692
690693 static struct videobuf_buffer *atomisp_css_frame_to_vbuf(
@@ -1289,6 +1292,7 @@ void atomisp_delayed_init_work(struct work_struct *work) · 598 unmodified lines
12891292
12901293 static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout)
12911294 {
1295+ struct pci_dev *pdev = to_pci_dev(isp->dev);
12921296 enum ia_css_pipe_id css_pipe_id;
12931297 bool stream_restart[MAX_STREAM_NUM] = {0};
12941298 bool depth_mode = false;
@@ -1372,8 +1376,8 @@ static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout) · 77 unmodified lines
13721376 clear_isp_irq(hrt_isp_css_irq_sp);
13731377
13741378 /* Set the SRSE to 3 before resetting */
1375− pci_write_config_dword(isp->pdev, PCI_I_CONTROL, isp->saved_regs.i_control |
1376− MRFLD_PCI_I_CONTROL_SRSE_RESET_MASK);
1379+ pci_write_config_dword(pdev, PCI_I_CONTROL,
1380+ isp->saved_regs.i_control | MRFLD_PCI_I_CONTROL_SRSE_RESET_MASK);
13771381
13781382 /* reset ISP and restore its state */
13791383 isp->isp_timeout = true;
@@ -6158,6 +6162,7 @@ out: · 4778 unmodified lines
61586162 /*Turn off ISP dphy */
61596163 int atomisp_ospm_dphy_down(struct atomisp_device *isp)
61606164 {
6165+ struct pci_dev *pdev = to_pci_dev(isp->dev);
61616166 unsigned long flags;
61626167 u32 reg;
61636168
@@ -6179,9 +6184,9 @@ done: · 15 unmodified lines
61796184 * MRFLD HW design need all CSI ports are disabled before
61806185 * powering down the IUNIT.
61816186 */
6182− pci_read_config_dword(isp->pdev, MRFLD_PCI_CSI_CONTROL, &reg);
6187+ pci_read_config_dword(pdev, MRFLD_PCI_CSI_CONTROL, &reg);
61836188 reg |= MRFLD_ALL_CSI_PORTS_OFF_MASK;
6184− pci_write_config_dword(isp->pdev, MRFLD_PCI_CSI_CONTROL, reg);
6189+ pci_write_config_dword(pdev, MRFLD_PCI_CSI_CONTROL, reg);
61856190 return 0;
61866191 }
61876192
drivers/staging/media/atomisp/pci/atomisp_cmd.h+2−2
@@ -68,8 +68,8 @@ bool atomisp_buffers_queued_pipe(struct atomisp_video_pipe *pipe); · 67 unmodified lines
6868 /*
6969 * Interrupt functions
7070 */
71−void atomisp_msi_irq_init(struct atomisp_device *isp, struct pci_dev *dev);
72−void atomisp_msi_irq_uninit(struct atomisp_device *isp, struct pci_dev *dev);
71+void atomisp_msi_irq_init(struct atomisp_device *isp);
72+void atomisp_msi_irq_uninit(struct atomisp_device *isp);
7373 void atomisp_wdt_work(struct work_struct *work);
7474 void atomisp_wdt(struct timer_list *t);
7575 void atomisp_setup_flash(struct atomisp_sub_device *asd);
drivers/staging/media/atomisp/pci/atomisp_compat.h+0−2
@@ -29,8 +29,6 @@ struct atomisp_sub_device; · 28 unmodified lines
2929 struct video_device;
3030 enum atomisp_input_stream_id;
3131
32−extern void __iomem *atomisp_io_base;
33−
3432 struct atomisp_metadata_buf {
3533 struct ia_css_metadata *metadata;
3634 void *md_vptr;
drivers/staging/media/atomisp/pci/atomisp_compat_css20.c+34−36
@@ -33,13 +33,12 @@ · 32 unmodified lines
3333 #include "atomisp_ioctl.h"
3434 #include "atomisp_acc.h"
3535
36−#include <asm/intel-mid.h>
37−
3836 #include "ia_css_debug.h"
3937 #include "ia_css_isp_param.h"
4038 #include "sh_css_hrt.h"
4139 #include "ia_css_isys.h"
4240
41+#include <linux/io.h>
4342 #include <linux/pm_runtime.h>
4443
4544 /* Assume max number of ACC stages */
@@ -69,92 +68,94 @@ struct bayer_ds_factor { · 23 unmodified lines
6968
7069 static void atomisp_css2_hw_store_8(hrt_address addr, uint8_t data)
7170 {
72− s8 __iomem *io_virt_addr = atomisp_io_base + (addr & 0x003FFFFF);
71+ struct atomisp_device *isp = dev_get_drvdata(atomisp_dev);
7372 unsigned long flags;
7473
7574 spin_lock_irqsave(&mmio_lock, flags);
76− *io_virt_addr = data;
75+ writeb(data, isp->base + (addr & 0x003FFFFF));
7776 spin_unlock_irqrestore(&mmio_lock, flags);
7877 }
7978
8079 static void atomisp_css2_hw_store_16(hrt_address addr, uint16_t data)
8180 {
82− s16 __iomem *io_virt_addr = atomisp_io_base + (addr & 0x003FFFFF);
81+ struct atomisp_device *isp = dev_get_drvdata(atomisp_dev);
8382 unsigned long flags;
8483
8584 spin_lock_irqsave(&mmio_lock, flags);
86− *io_virt_addr = data;
85+ writew(data, isp->base + (addr & 0x003FFFFF));
8786 spin_unlock_irqrestore(&mmio_lock, flags);
8887 }
8988
9089 void atomisp_css2_hw_store_32(hrt_address addr, uint32_t data)
9190 {
92− s32 __iomem *io_virt_addr = atomisp_io_base + (addr & 0x003FFFFF);
91+ struct atomisp_device *isp = dev_get_drvdata(atomisp_dev);
9392 unsigned long flags;
9493
9594 spin_lock_irqsave(&mmio_lock, flags);
96− *io_virt_addr = data;
95+ writel(data, isp->base + (addr & 0x003FFFFF));
9796 spin_unlock_irqrestore(&mmio_lock, flags);
9897 }
9998
10099 static uint8_t atomisp_css2_hw_load_8(hrt_address addr)
101100 {
102− s8 __iomem *io_virt_addr = atomisp_io_base + (addr & 0x003FFFFF);
101+ struct atomisp_device *isp = dev_get_drvdata(atomisp_dev);
103102 unsigned long flags;
104103 u8 ret;
105104
106105 spin_lock_irqsave(&mmio_lock, flags);
107− ret = *io_virt_addr;
106+ ret = readb(isp->base + (addr & 0x003FFFFF));
108107 spin_unlock_irqrestore(&mmio_lock, flags);
109108 return ret;
110109 }
111110
112111 static uint16_t atomisp_css2_hw_load_16(hrt_address addr)
113112 {
114− s16 __iomem *io_virt_addr = atomisp_io_base + (addr & 0x003FFFFF);
113+ struct atomisp_device *isp = dev_get_drvdata(atomisp_dev);
115114 unsigned long flags;
116115 u16 ret;
117116
118117 spin_lock_irqsave(&mmio_lock, flags);
119− ret = *io_virt_addr;
118+ ret = readw(isp->base + (addr & 0x003FFFFF));
120119 spin_unlock_irqrestore(&mmio_lock, flags);
121120 return ret;
122121 }
123122
124123 static uint32_t atomisp_css2_hw_load_32(hrt_address addr)
125124 {
126− s32 __iomem *io_virt_addr = atomisp_io_base + (addr & 0x003FFFFF);
125+ struct atomisp_device *isp = dev_get_drvdata(atomisp_dev);
127126 unsigned long flags;
128127 u32 ret;
129128
130129 spin_lock_irqsave(&mmio_lock, flags);
131− ret = *io_virt_addr;
130+ ret = readl(isp->base + (addr & 0x003FFFFF));
132131 spin_unlock_irqrestore(&mmio_lock, flags);
133132 return ret;
134133 }
135134
136−static void atomisp_css2_hw_store(hrt_address addr,
137− const void *from, uint32_t n)
135+static void atomisp_css2_hw_store(hrt_address addr, const void *from, uint32_t n)
138136 {
139− s8 __iomem *io_virt_addr = atomisp_io_base + (addr & 0x003FFFFF);
137+ struct atomisp_device *isp = dev_get_drvdata(atomisp_dev);
140138 unsigned long flags;
141139 unsigned int i;
142140
141+ addr &= 0x003FFFFF;
143142 spin_lock_irqsave(&mmio_lock, flags);
144− for (i = 0; i < n; i++, io_virt_addr++, from++)
145− *io_virt_addr = *(s8 *)from;
143+ for (i = 0; i < n; i++, from++)
144+ writeb(*(s8 *)from, isp->base + addr + i);
145+
146146 spin_unlock_irqrestore(&mmio_lock, flags);
147147 }
148148
149149 static void atomisp_css2_hw_load(hrt_address addr, void *to, uint32_t n)
150150 {
151− s8 __iomem *io_virt_addr = atomisp_io_base + (addr & 0x003FFFFF);
151+ struct atomisp_device *isp = dev_get_drvdata(atomisp_dev);
152152 unsigned long flags;
153153 unsigned int i;
154154
155+ addr &= 0x003FFFFF;
155156 spin_lock_irqsave(&mmio_lock, flags);
156− for (i = 0; i < n; i++, to++, io_virt_addr++)
157− *(s8 *)to = *io_virt_addr;
157+ for (i = 0; i < n; i++, to++)
158+ *(s8 *)to = readb(isp->base + addr + i);
158159 spin_unlock_irqrestore(&mmio_lock, flags);
159160 }
160161
@@ -181,10 +182,10 @@ void atomisp_load_uint32(hrt_address addr, uint32_t *data) · 20 unmodified lines
181182 *data = atomisp_css2_hw_load_32(addr);
182183 }
183184
184−static int hmm_get_mmu_base_addr(unsigned int *mmu_base_addr)
185+static int hmm_get_mmu_base_addr(struct device *dev, unsigned int *mmu_base_addr)
185186 {
186187 if (!sh_mmu_mrfld.get_pd_base) {
187− dev_err(atomisp_dev, "get mmu base address failed.\n");
188+ dev_err(dev, "get mmu base address failed.\n");
188189 return -EINVAL;
189190 }
190191
@@ -839,7 +840,7 @@ int atomisp_css_init(struct atomisp_device *isp) · 648 unmodified lines
839840 int ret;
840841 int err;
841842
842− ret = hmm_get_mmu_base_addr(&mmu_base_addr);
843+ ret = hmm_get_mmu_base_addr(isp->dev, &mmu_base_addr);
843844 if (ret)
844845 return ret;
845846
@@ -941,7 +942,7 @@ int atomisp_css_resume(struct atomisp_device *isp) · 95 unmodified lines
941942 unsigned int mmu_base_addr;
942943 int ret;
943944
944− ret = hmm_get_mmu_base_addr(&mmu_base_addr);
945+ ret = hmm_get_mmu_base_addr(isp->dev, &mmu_base_addr);
945946 if (ret) {
946947 dev_err(isp->dev, "get base address error.\n");
947948 return -EINVAL;
@@ -1966,8 +1967,7 @@ void atomisp_css_input_set_mode(struct atomisp_sub_device *asd, · 1018 unmodified lines
19661967 true,
19671968 0x13000,
19681969 &size_mem_words) != 0) {
1969− if (intel_mid_identify_cpu() ==
1970− INTEL_MID_CPU_CHIP_TANGIER)
1970+ if (IS_MRFD)
19711971 size_mem_words = CSS_MIPI_FRAME_BUFFER_SIZE_2;
19721972 else
19731973 size_mem_words = CSS_MIPI_FRAME_BUFFER_SIZE_1;
@@ -2414,13 +2414,13 @@ static void __configure_preview_pp_input(struct atomisp_sub_device *asd, · 440 unmodified lines
24142414 struct ia_css_resolution *effective_res =
24152415 &stream_config->input_config.effective_res;
24162416
2417− const struct bayer_ds_factor bds_fct[] = {{2, 1}, {3, 2}, {5, 4} };
2417+ static const struct bayer_ds_factor bds_fct[] = {{2, 1}, {3, 2}, {5, 4} };
24182418 /*
24192419 * BZ201033: YUV decimation factor of 4 causes couple of rightmost
24202420 * columns to be shaded. Remove this factor to work around the CSS bug.
24212421 * const unsigned int yuv_dec_fct[] = {4, 2};
24222422 */
2423− const unsigned int yuv_dec_fct[] = { 2 };
2423+ static const unsigned int yuv_dec_fct[] = { 2 };
24242424 unsigned int i;
24252425
24262426 if (width == 0 && height == 0)
@@ -2540,7 +2540,7 @@ static void __configure_video_pp_input(struct atomisp_sub_device *asd, · 113 unmodified lines
25402540 struct ia_css_resolution *effective_res =
25412541 &stream_config->input_config.effective_res;
25422542
2543− const struct bayer_ds_factor bds_factors[] = {
2543+ static const struct bayer_ds_factor bds_factors[] = {
25442544 {8, 1}, {6, 1}, {4, 1}, {3, 1}, {2, 1}, {3, 2}
25452545 };
25462546 unsigned int i;
@@ -4337,7 +4337,7 @@ static const char * const fw_acc_type_name[] = { · 1790 unmodified lines
43374337 [IA_CSS_ACC_STANDALONE] = "Stand-alone acceleration",
43384338 };
43394339
4340−int atomisp_css_dump_blob_infor(void)
4340+int atomisp_css_dump_blob_infor(struct atomisp_device *isp)
43414341 {
43424342 struct ia_css_blob_descr *bd = sh_css_blob_info;
43434343 unsigned int i, nm = sh_css_num_binaries;
@@ -4354,8 +4354,7 @@ int atomisp_css_dump_blob_infor(void) · 10 unmodified lines
43544354 for (i = 0; i < sh_css_num_binaries - NUM_OF_SPS; i++) {
43554355 switch (bd[i].header.type) {
43564356 case ia_css_isp_firmware:
4357− dev_dbg(atomisp_dev,
4358− "Num%2d type %s (%s), binary id is %2d, name is %s\n",
4357+ dev_dbg(isp->dev, "Num%2d type %s (%s), binary id is %2d, name is %s\n",
43594358 i + NUM_OF_SPS,
43604359 fw_type_name[bd[i].header.type],
43614360 fw_acc_type_name[bd[i].header.info.isp.type],
@@ -4363,8 +4362,7 @@ int atomisp_css_dump_blob_infor(void) · 1 unmodified line
43634362 bd[i].name);
43644363 break;
43654364 default:
4366− dev_dbg(atomisp_dev,
4367− "Num%2d type %s, name is %s\n",
4365+ dev_dbg(isp->dev, "Num%2d type %s, name is %s\n",
43684366 i + NUM_OF_SPS, fw_type_name[bd[i].header.type],
43694367 bd[i].name);
43704368 }
drivers/staging/media/atomisp/pci/atomisp_compat_css20.h+1−1
@@ -153,7 +153,7 @@ int atomisp_css_debug_dump_isp_binary(void); · 152 unmodified lines
153153
154154 int atomisp_css_dump_sp_raw_copy_linecount(bool reduced);
155155
156−int atomisp_css_dump_blob_infor(void);
156+int atomisp_css_dump_blob_infor(struct atomisp_device *isp);
157157
158158 void atomisp_css_set_isp_config_id(struct atomisp_sub_device *asd,
159159 uint32_t isp_config_id);
drivers/staging/media/atomisp/pci/atomisp_drvfs.c+7−7
@@ -62,9 +62,9 @@ static inline int iunit_dump_dbgopt(struct atomisp_device *isp, · 61 unmodified lines
6262
6363 if (opt & OPTION_VALID) {
6464 if (opt & OPTION_BIN_LIST) {
65− ret = atomisp_css_dump_blob_infor();
65+ ret = atomisp_css_dump_blob_infor(isp);
6666 if (ret) {
67− dev_err(atomisp_dev, "%s dump blob infor err[ret:%d]\n",
67+ dev_err(isp->dev, "%s dump blob infor err[ret:%d]\n",
6868 __func__, ret);
6969 goto opt_err;
7070 }
@@ -76,7 +76,7 @@ static inline int iunit_dump_dbgopt(struct atomisp_device *isp, · 5 unmodified lines
7676 atomisp_css_debug_dump_isp_binary();
7777 } else {
7878 ret = -EPERM;
79− dev_err(atomisp_dev, "%s dump running bin err[ret:%d]\n",
79+ dev_err(isp->dev, "%s dump running bin err[ret:%d]\n",
8080 __func__, ret);
8181 goto opt_err;
8282 }
@@ -86,8 +86,7 @@ static inline int iunit_dump_dbgopt(struct atomisp_device *isp, · 3 unmodified lines
8686 hmm_show_mem_stat(__func__, __LINE__);
8787 } else {
8888 ret = -EINVAL;
89− dev_err(atomisp_dev, "%s dump nothing[ret=%d]\n", __func__,
90− ret);
89+ dev_err(isp->dev, "%s dump nothing[ret=%d]\n", __func__, ret);
9190 }
9291
9392 opt_err:
@@ -185,8 +184,9 @@ static void iunit_drvfs_remove_files(struct device_driver *drv) · 91 unmodified lines
185184 driver_remove_file(drv, &iunit_drvfs_attrs[i]);
186185 }
187186
188−int atomisp_drvfs_init(struct device_driver *drv, struct atomisp_device *isp)
187+int atomisp_drvfs_init(struct atomisp_device *isp)
189188 {
189+ struct device_driver *drv = isp->dev->driver;
190190 int ret;
191191
192192 iunit_debug.isp = isp;
@@ -194,7 +194,7 @@ int atomisp_drvfs_init(struct device_driver *drv, struct atomisp_device *isp) · 1 unmodified line
194194
195195 ret = iunit_drvfs_create_files(iunit_debug.drv);
196196 if (ret) {
197− dev_err(atomisp_dev, "drvfs_create_files error: %d\n", ret);
197+ dev_err(isp->dev, "drvfs_create_files error: %d\n", ret);
198198 iunit_drvfs_remove_files(iunit_debug.drv);
199199 }
200200
drivers/staging/media/atomisp/pci/atomisp_drvfs.h+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 #ifndef __ATOMISP_DRVFS_H__
2020 #define __ATOMISP_DRVFS_H__
2121
22−int atomisp_drvfs_init(struct device_driver *drv, struct atomisp_device *isp);
22+int atomisp_drvfs_init(struct atomisp_device *isp);
2323 void atomisp_drvfs_exit(void);
2424
2525 #endif /* __ATOMISP_DRVFS_H__ */
drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c+351−186
@@ -26,6 +26,9 @@ enum clock_rate { · 25 unmodified lines
2626 #define CLK_RATE_19_2MHZ 19200000
2727 #define CLK_RATE_25_0MHZ 25000000
2828
29+/* Valid clock number range from 0 to 5 */
30+#define MAX_CLK_COUNT 5
31+
2932 /* X-Powers AXP288 register set */
3033 #define ALDO1_SEL_REG 0x28
3134 #define ALDO1_CTRL3_REG 0x13
@@ -61,9 +64,7 @@ enum clock_rate { · 29 unmodified lines
6164
6265 struct gmin_subdev {
6366 struct v4l2_subdev *subdev;
64− int clock_num;
6567 enum clock_rate clock_src;
66− bool clock_on;
6768 struct clk *pmc_clk;
6869 struct gpio_desc *gpio0;
6970 struct gpio_desc *gpio1;
@@ -75,11 +76,16 @@ struct gmin_subdev { · 5 unmodified lines
7576 unsigned int csi_lanes;
7677 enum atomisp_input_format csi_fmt;
7778 enum atomisp_bayer_order csi_bayer;
79+
80+ bool clock_on;
7881 bool v1p8_on;
7982 bool v2p8_on;
8083 bool v1p2_on;
8184 bool v2p8_vcm_on;
8285
86+ int v1p8_gpio;
87+ int v2p8_gpio;
88+
8389 u8 pwm_i2c_addr;
8490
8591 /* For PMIC AXP */
@@ -90,9 +96,9 @@ struct gmin_subdev { · 4 unmodified lines
9096 static struct gmin_subdev gmin_subdevs[MAX_SUBDEVS];
9197
9298 /* ACPI HIDs for the PMICs that could be used by this driver */
93−#define PMIC_ACPI_AXP "INT33F4:00" /* XPower AXP288 PMIC */
94−#define PMIC_ACPI_TI "INT33F5:00" /* Dollar Cove TI PMIC */
95−#define PMIC_ACPI_CRYSTALCOVE "INT33FD:00" /* Crystal Cove PMIC */
99+#define PMIC_ACPI_AXP "INT33F4" /* XPower AXP288 PMIC */
100+#define PMIC_ACPI_TI "INT33F5" /* Dollar Cove TI PMIC */
101+#define PMIC_ACPI_CRYSTALCOVE "INT33FD" /* Crystal Cove PMIC */
96102
97103 #define PMIC_PLATFORM_TI "intel_soc_pmic_chtdc_ti"
98104
@@ -105,7 +111,7 @@ static enum { · 6 unmodified lines
105111 } pmic_id;
106112
107113 static const char *pmic_name[] = {
108− [PMIC_UNSET] = "unset",
114+ [PMIC_UNSET] = "ACPI device PM",
109115 [PMIC_REGULATOR] = "regulator driver",
110116 [PMIC_AXP] = "XPower AXP288 PMIC",
111117 [PMIC_TI] = "Dollar Cove TI PMIC",
@@ -119,24 +125,6 @@ static const struct atomisp_platform_data pdata = { · 7 unmodified lines
119125 .subdevs = pdata_subdevs,
120126 };
121127
122−/*
123− * Something of a hack. The ECS E7 board drives camera 2.8v from an
124− * external regulator instead of the PMIC. There's a gmin_CamV2P8
125− * config variable that specifies the GPIO to handle this particular
126− * case, but this needs a broader architecture for handling camera
127− * power.
128− */
129−enum { V2P8_GPIO_UNSET = -2, V2P8_GPIO_NONE = -1 };
130−static int v2p8_gpio = V2P8_GPIO_UNSET;
131−
132−/*
133− * Something of a hack. The CHT RVP board drives camera 1.8v from an
134− * external regulator instead of the PMIC just like ECS E7 board, see the
135− * comments above.
136− */
137−enum { V1P8_GPIO_UNSET = -2, V1P8_GPIO_NONE = -1 };
138−static int v1p8_gpio = V1P8_GPIO_UNSET;
139−
140128 static LIST_HEAD(vcm_devices);
141129 static DEFINE_MUTEX(vcm_lock);
142130
@@ -199,6 +187,8 @@ int atomisp_register_i2c_module(struct v4l2_subdev *subdev, · 56 unmodified lines
199187 * gmin_subdev struct is already initialized for us.
200188 */
201189 gs = find_gmin_subdev(subdev);
190+ if (!gs)
191+ return -ENODEV;
202192
203193 pdata.subdevs[i].type = type;
204194 pdata.subdevs[i].port = gs->csi_port;
@@ -294,6 +284,7 @@ static struct gmin_cfg_var mrd7_vars[] = { · 89 unmodified lines
294284 {"INT33F8:00_CsiFmt", "13"},
295285 {"INT33F8:00_CsiBayer", "0"},
296286 {"INT33F8:00_CamClk", "0"},
287+
297288 {"INT33F9:00_CamType", "1"},
298289 {"INT33F9:00_CsiPort", "0"},
299290 {"INT33F9:00_CsiLanes", "1"},
@@ -309,6 +300,7 @@ static struct gmin_cfg_var ecs7_vars[] = { · 9 unmodified lines
309300 {"INT33BE:00_CsiFmt", "13"},
310301 {"INT33BE:00_CsiBayer", "2"},
311302 {"INT33BE:00_CamClk", "0"},
303+
312304 {"INT33F0:00_CsiPort", "0"},
313305 {"INT33F0:00_CsiLanes", "1"},
314306 {"INT33F0:00_CsiFmt", "13"},
@@ -322,6 +314,7 @@ static struct gmin_cfg_var i8880_vars[] = { · 7 unmodified lines
322314 {"XXOV2680:00_CsiPort", "1"},
323315 {"XXOV2680:00_CsiLanes", "1"},
324316 {"XXOV2680:00_CamClk", "0"},
317+
325318 {"XXGC0310:00_CsiPort", "0"},
326319 {"XXGC0310:00_CsiLanes", "1"},
327320 {"XXGC0310:00_CamClk", "1"},
@@ -381,34 +374,27 @@ static const guid_t atomisp_dsm_guid = GUID_INIT(0xdc2f6c4f, 0x045b, 0x4f1d, · 53 unmodified lines
381374 #define GMIN_PMC_CLK_NAME 14 /* "pmc_plt_clk_[0..5]" */
382375 static char gmin_pmc_clk_name[GMIN_PMC_CLK_NAME];
383376
384−static int gmin_i2c_match_one(struct device *dev, const void *data)
385−{
386− const char *name = data;
387− struct i2c_client *client;
388−
389− if (dev->type != &i2c_client_type)
390− return 0;
391−
392− client = to_i2c_client(dev);
393−
394− return (!strcmp(name, client->name));
395−}
396−
397377 static struct i2c_client *gmin_i2c_dev_exists(struct device *dev, char *name,
398378 struct i2c_client **client)
399379 {
380+ struct acpi_device *adev;
400381 struct device *d;
401382
402− while ((d = bus_find_device(&i2c_bus_type, NULL, name,
403− gmin_i2c_match_one))) {
404− *client = to_i2c_client(d);
405− dev_dbg(dev, "found '%s' at address 0x%02x, adapter %d\n",
406− (*client)->name, (*client)->addr,
407− (*client)->adapter->nr);
408− return *client;
409− }
383+ adev = acpi_dev_get_first_match_dev(name, NULL, -1);
384+ if (!adev)
385+ return NULL;
410386
411− return NULL;
387+ d = bus_find_device_by_acpi_dev(&i2c_bus_type, adev);
388+ acpi_dev_put(adev);
389+ if (!d)
390+ return NULL;
391+
392+ *client = i2c_verify_client(d);
393+ put_device(d);
394+
395+ dev_dbg(dev, "found '%s' at address 0x%02x, adapter %d\n",
396+ (*client)->name, (*client)->addr, (*client)->adapter->nr);
397+ return *client;
412398 }
413399
414400 static int gmin_i2c_write(struct device *dev, u16 i2c_addr, u8 reg,
@@ -427,94 +413,222 @@ static int gmin_i2c_write(struct device *dev, u16 i2c_addr, u8 reg, · 12 unmodified lines
427413 "I2C write, addr: 0x%02x, reg: 0x%02x, value: 0x%02x, mask: 0x%02x\n",
428414 i2c_addr, reg, value, mask);
429415
430− ret = intel_soc_pmic_exec_mipi_pmic_seq_element(i2c_addr, reg,
431− value, mask);
432−
433− if (ret == -EOPNOTSUPP) {
416+ ret = intel_soc_pmic_exec_mipi_pmic_seq_element(i2c_addr, reg, value, mask);
417+ if (ret == -EOPNOTSUPP)
434418 dev_err(dev,
435419 "ACPI didn't mapped the OpRegion needed to access I2C address 0x%02x.\n"
436− "Need to compile the Kernel using CONFIG_*_PMIC_OPREGION settings\n",
420+ "Need to compile the kernel using CONFIG_*_PMIC_OPREGION settings\n",
437421 i2c_addr);
438− return ret;
439− }
440422
441423 return ret;
442424 }
443425
444−static struct gmin_subdev *gmin_subdev_add(struct v4l2_subdev *subdev)
426+static int atomisp_get_acpi_power(struct device *dev)
445427 {
446− struct i2c_client *power = NULL, *client = v4l2_get_subdevdata(subdev);
447− struct acpi_device *adev;
448− acpi_handle handle;
449− struct device *dev;
450− int i, ret;
428+ char name[5];
429+ struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
430+ struct acpi_buffer b_name = { sizeof(name), name };
431+ union acpi_object *package, *element;
432+ acpi_handle handle = ACPI_HANDLE(dev);
433+ acpi_handle rhandle;
434+ acpi_status status;
435+ int clock_num = -1;
436+ int i;
451437
452− if (!client)
453− return NULL;
438+ status = acpi_evaluate_object(handle, "_PR0", NULL, &buffer);
439+ if (!ACPI_SUCCESS(status))
440+ return -1;
454441
455− dev = &client->dev;
442+ package = buffer.pointer;
456443
457− handle = ACPI_HANDLE(dev);
444+ if (!buffer.length || !package
445+ || package->type != ACPI_TYPE_PACKAGE
446+ || !package->package.count)
447+ goto fail;
458448
459− // FIXME: may need to release resources allocated by acpi_bus_get_device()
460− if (!handle || acpi_bus_get_device(handle, &adev)) {
461− dev_err(dev, "Error could not get ACPI device\n");
462− return NULL;
463− }
449+ for (i = 0; i < package->package.count; i++) {
450+ element = &package->package.elements[i];
464451
465− dev_info(&client->dev, "%s: ACPI detected it on bus ID=%s, HID=%s\n",
466− __func__, acpi_device_bid(adev), acpi_device_hid(adev));
452+ if (element->type != ACPI_TYPE_LOCAL_REFERENCE)
453+ continue;
467454
468− if (!pmic_id) {
469− if (gmin_i2c_dev_exists(dev, PMIC_ACPI_TI, &power))
470− pmic_id = PMIC_TI;
471− else if (gmin_i2c_dev_exists(dev, PMIC_ACPI_AXP, &power))
472− pmic_id = PMIC_AXP;
473− else if (gmin_i2c_dev_exists(dev, PMIC_ACPI_CRYSTALCOVE, &power))
474− pmic_id = PMIC_CRYSTALCOVE;
475− else
476− pmic_id = PMIC_REGULATOR;
455+ rhandle = element->reference.handle;
456+ if (!rhandle)
457+ goto fail;
458+
459+ acpi_get_name(rhandle, ACPI_SINGLE_NAME, &b_name);
460+
461+ dev_dbg(dev, "Found PM resource '%s'\n", name);
462+ if (strlen(name) == 4 && !strncmp(name, "CLK", 3)) {
463+ if (name[3] >= '0' && name[3] <= '4')
464+ clock_num = name[3] - '0';
465+#if 0
466+ /*
467+ * We could abort here, but let's parse all resources,
468+ * as this is helpful for debugging purposes
469+ */
470+ if (clock_num >= 0)
471+ break;
472+#endif
473+ }
477474 }
478475
479− for (i = 0; i < MAX_SUBDEVS && gmin_subdevs[i].subdev; i++)
480− ;
481− if (i >= MAX_SUBDEVS)
482− return NULL;
476+fail:
477+ ACPI_FREE(buffer.pointer);
478+
479+ return clock_num;
480+}
481+
482+static u8 gmin_get_pmic_id_and_addr(struct device *dev)
483+{
484+ struct i2c_client *power;
485+ static u8 pmic_i2c_addr;
486+
487+ if (pmic_id)
488+ return pmic_i2c_addr;
489+
490+ if (gmin_i2c_dev_exists(dev, PMIC_ACPI_TI, &power))
491+ pmic_id = PMIC_TI;
492+ else if (gmin_i2c_dev_exists(dev, PMIC_ACPI_AXP, &power))
493+ pmic_id = PMIC_AXP;
494+ else if (gmin_i2c_dev_exists(dev, PMIC_ACPI_CRYSTALCOVE, &power))
495+ pmic_id = PMIC_CRYSTALCOVE;
496+ else
497+ pmic_id = PMIC_REGULATOR;
498+
499+ pmic_i2c_addr = power ? power->addr : 0;
500+ return pmic_i2c_addr;
501+}
502+
503+static int gmin_detect_pmic(struct v4l2_subdev *subdev)
504+{
505+ struct i2c_client *client = v4l2_get_subdevdata(subdev);
506+ struct device *dev = &client->dev;
507+ u8 pmic_i2c_addr;
508+
509+ pmic_i2c_addr = gmin_get_pmic_id_and_addr(dev);
510+ dev_info(dev, "gmin: power management provided via %s (i2c addr 0x%02x)\n",
511+ pmic_name[pmic_id], pmic_i2c_addr);
512+ return pmic_i2c_addr;
513+}
514+
515+static int gmin_subdev_add(struct gmin_subdev *gs)
516+{
517+ struct i2c_client *client = v4l2_get_subdevdata(gs->subdev);
518+ struct device *dev = &client->dev;
519+ struct acpi_device *adev = ACPI_COMPANION(dev);
520+ int ret, clock_num = -1;
521+
522+ dev_info(dev, "%s: ACPI path is %pfw\n", __func__, dev_fwnode(dev));
523+
524+ /*WA:CHT requires XTAL clock as PLL is not stable.*/
525+ gs->clock_src = gmin_get_var_int(dev, false, "ClkSrc",
526+ VLV2_CLK_PLL_19P2MHZ);
527+
528+ gs->csi_port = gmin_get_var_int(dev, false, "CsiPort", 0);
529+ gs->csi_lanes = gmin_get_var_int(dev, false, "CsiLanes", 1);
530+
531+ gs->gpio0 = gpiod_get_index(dev, NULL, 0, GPIOD_OUT_LOW);
532+ if (IS_ERR(gs->gpio0))
533+ gs->gpio0 = NULL;
534+ else
535+ dev_info(dev, "will handle gpio0 via ACPI\n");
536+
537+ gs->gpio1 = gpiod_get_index(dev, NULL, 1, GPIOD_OUT_LOW);
538+ if (IS_ERR(gs->gpio1))
539+ gs->gpio1 = NULL;
540+ else
541+ dev_info(dev, "will handle gpio1 via ACPI\n");
542+
543+ /*
544+ * Those are used only when there is an external regulator apart
545+ * from the PMIC that would be providing power supply, like on the
546+ * two cases below:
547+ *
548+ * The ECS E7 board drives camera 2.8v from an external regulator
549+ * instead of the PMIC. There's a gmin_CamV2P8 config variable
550+ * that specifies the GPIO to handle this particular case,
551+ * but this needs a broader architecture for handling camera power.
552+ *
553+ * The CHT RVP board drives camera 1.8v from an* external regulator
554+ * instead of the PMIC just like ECS E7 board.
555+ */
483556
484− if (power) {
485− gmin_subdevs[i].pwm_i2c_addr = power->addr;
557+ gs->v1p8_gpio = gmin_get_var_int(dev, true, "V1P8GPIO", -1);
558+ gs->v2p8_gpio = gmin_get_var_int(dev, true, "V2P8GPIO", -1);
559+
560+ /*
561+ * FIXME:
562+ *
563+ * The ACPI handling code checks for the _PR? tables in order to
564+ * know what is required to switch the device from power state
565+ * D0 (_PR0) up to D3COLD (_PR3).
566+ *
567+ * The adev->flags.power_manageable is set to true if the device
568+ * has a _PR0 table, which can be checked by calling
569+ * acpi_device_power_manageable(adev).
570+ *
571+ * However, this only says that the device can be set to power off
572+ * mode.
573+ *
574+ * At least on the DSDT tables we've seen so far, there's no _PR3,
575+ * nor _PS3 (which would have a somewhat similar effect).
576+ * So, using ACPI for power management won't work, except if adding
577+ * an ACPI override logic somewhere.
578+ *
579+ * So, at least for the existing devices we know, the check below
580+ * will always be false.
581+ */
582+ if (acpi_device_can_wakeup(adev) &&
583+ acpi_device_can_poweroff(adev)) {
486584 dev_info(dev,
487− "gmin: power management provided via %s (i2c addr 0x%02x)\n",
488− pmic_name[pmic_id], power->addr);
489− } else {
490− dev_info(dev, "gmin: power management provided via %s\n",
491− pmic_name[pmic_id]);
585+ "gmin: power management provided via device PM\n");
586+ return 0;
492587 }
493588
494− gmin_subdevs[i].subdev = subdev;
495− gmin_subdevs[i].clock_num = gmin_get_var_int(dev, false, "CamClk", 0);
496− /*WA:CHT requires XTAL clock as PLL is not stable.*/
497− gmin_subdevs[i].clock_src = gmin_get_var_int(dev, false, "ClkSrc",
498− VLV2_CLK_PLL_19P2MHZ);
499− gmin_subdevs[i].csi_port = gmin_get_var_int(dev, false, "CsiPort", 0);
500− gmin_subdevs[i].csi_lanes = gmin_get_var_int(dev, false, "CsiLanes", 1);
589+ /*
590+ * The code below is here due to backward compatibility with devices
591+ * whose ACPI BIOS may not contain everything that would be needed
592+ * in order to set clocks and do power management.
593+ */
594+
595+ /*
596+ * According with :
597+ * https://github.com/projectceladon/hardware-intel-kernelflinger/blob/master/doc/fastboot.md
598+ *
599+ * The "CamClk" EFI var is set via fastboot on some Android devices,
600+ * and seems to contain the number of the clock used to feed the
601+ * sensor.
602+ *
603+ * On systems with a proper ACPI table, this is given via the _PR0
604+ * power resource table. The logic below should first check if there
605+ * is a power resource already, falling back to the EFI vars detection
606+ * otherwise.
607+ */
501608
502− /* get PMC clock with clock framework */
503− snprintf(gmin_pmc_clk_name,
504− sizeof(gmin_pmc_clk_name),
505− "%s_%d", "pmc_plt_clk", gmin_subdevs[i].clock_num);
609+ /* Try first to use ACPI to get the clock resource */
610+ if (acpi_device_power_manageable(adev))
611+ clock_num = atomisp_get_acpi_power(dev);
506612
507− gmin_subdevs[i].pmc_clk = devm_clk_get(dev, gmin_pmc_clk_name);
508− if (IS_ERR(gmin_subdevs[i].pmc_clk)) {
509− ret = PTR_ERR(gmin_subdevs[i].pmc_clk);
613+ /* Fall-back use EFI and/or DMI match */
614+ if (clock_num < 0)
615+ clock_num = gmin_get_var_int(dev, false, "CamClk", 0);
510616
511− dev_err(dev,
512− "Failed to get clk from %s : %d\n",
513− gmin_pmc_clk_name,
514− ret);
617+ if (clock_num < 0 || clock_num > MAX_CLK_COUNT) {
618+ dev_err(dev, "Invalid clock number\n");
619+ return -EINVAL;
620+ }
515621
516− return NULL;
622+ snprintf(gmin_pmc_clk_name, sizeof(gmin_pmc_clk_name),
623+ "%s_%d", "pmc_plt_clk", clock_num);
624+
625+ gs->pmc_clk = devm_clk_get(dev, gmin_pmc_clk_name);
626+ if (IS_ERR(gs->pmc_clk)) {
627+ ret = PTR_ERR(gs->pmc_clk);
628+ dev_err(dev, "Failed to get clk from %s: %d\n", gmin_pmc_clk_name, ret);
629+ return ret;
517630 }
631+ dev_info(dev, "Will use CLK%d (%s)\n", clock_num, gmin_pmc_clk_name);
518632
519633 /*
520634 * The firmware might enable the clock at
@@ -526,25 +640,17 @@ static struct gmin_subdev *gmin_subdev_add(struct v4l2_subdev *subdev) · 5 unmodified lines
526640 * to disable a clock that has not been enabled,
527641 * we need to enable the clock first.
528642 */
529− ret = clk_prepare_enable(gmin_subdevs[i].pmc_clk);
643+ ret = clk_prepare_enable(gs->pmc_clk);
530644 if (!ret)
531− clk_disable_unprepare(gmin_subdevs[i].pmc_clk);
532−
533− gmin_subdevs[i].gpio0 = gpiod_get_index(dev, NULL, 0, GPIOD_OUT_LOW);
534− if (IS_ERR(gmin_subdevs[i].gpio0))
535− gmin_subdevs[i].gpio0 = NULL;
536−
537− gmin_subdevs[i].gpio1 = gpiod_get_index(dev, NULL, 1, GPIOD_OUT_LOW);
538− if (IS_ERR(gmin_subdevs[i].gpio1))
539− gmin_subdevs[i].gpio1 = NULL;
645+ clk_disable_unprepare(gs->pmc_clk);
540646
541647 switch (pmic_id) {
542648 case PMIC_REGULATOR:
543− gmin_subdevs[i].v1p8_reg = regulator_get(dev, "V1P8SX");
544− gmin_subdevs[i].v2p8_reg = regulator_get(dev, "V2P8SX");
649+ gs->v1p8_reg = regulator_get(dev, "V1P8SX");
650+ gs->v2p8_reg = regulator_get(dev, "V2P8SX");
545651
546− gmin_subdevs[i].v1p2_reg = regulator_get(dev, "V1P2A");
547− gmin_subdevs[i].v2p8_vcm_reg = regulator_get(dev, "VPROG4B");
652+ gs->v1p2_reg = regulator_get(dev, "V1P2A");
653+ gs->v2p8_vcm_reg = regulator_get(dev, "VPROG4B");
548654
549655 /* Note: ideally we would initialize v[12]p8_on to the
550656 * output of regulator_is_enabled(), but sadly that
@@ -556,32 +662,31 @@ static struct gmin_subdev *gmin_subdev_add(struct v4l2_subdev *subdev) · 5 unmodified lines
556662 break;
557663
558664 case PMIC_AXP:
559− gmin_subdevs[i].eldo1_1p8v = gmin_get_var_int(dev, false,
560− "eldo1_1p8v",
561− ELDO1_1P8V);
562− gmin_subdevs[i].eldo1_sel_reg = gmin_get_var_int(dev, false,
563− "eldo1_sel_reg",
564− ELDO1_SEL_REG);
565− gmin_subdevs[i].eldo1_ctrl_shift = gmin_get_var_int(dev, false,
566− "eldo1_ctrl_shift",
567− ELDO1_CTRL_SHIFT);
568− gmin_subdevs[i].eldo2_1p8v = gmin_get_var_int(dev, false,
569− "eldo2_1p8v",
570− ELDO2_1P8V);
571− gmin_subdevs[i].eldo2_sel_reg = gmin_get_var_int(dev, false,
572− "eldo2_sel_reg",
573− ELDO2_SEL_REG);
574− gmin_subdevs[i].eldo2_ctrl_shift = gmin_get_var_int(dev, false,
575− "eldo2_ctrl_shift",
576− ELDO2_CTRL_SHIFT);
577− gmin_subdevs[i].pwm_i2c_addr = power->addr;
665+ gs->eldo1_1p8v = gmin_get_var_int(dev, false,
666+ "eldo1_1p8v",
667+ ELDO1_1P8V);
668+ gs->eldo1_sel_reg = gmin_get_var_int(dev, false,
669+ "eldo1_sel_reg",
670+ ELDO1_SEL_REG);
671+ gs->eldo1_ctrl_shift = gmin_get_var_int(dev, false,
672+ "eldo1_ctrl_shift",
673+ ELDO1_CTRL_SHIFT);
674+ gs->eldo2_1p8v = gmin_get_var_int(dev, false,
675+ "eldo2_1p8v",
676+ ELDO2_1P8V);
677+ gs->eldo2_sel_reg = gmin_get_var_int(dev, false,
678+ "eldo2_sel_reg",
679+ ELDO2_SEL_REG);
680+ gs->eldo2_ctrl_shift = gmin_get_var_int(dev, false,
681+ "eldo2_ctrl_shift",
682+ ELDO2_CTRL_SHIFT);
578683 break;
579684
580685 default:
581686 break;
582687 }
583688
584− return &gmin_subdevs[i];
689+ return 0;
585690 }
586691
587692 static struct gmin_subdev *find_gmin_subdev(struct v4l2_subdev *subdev)
@@ -591,7 +696,17 @@ static struct gmin_subdev *find_gmin_subdev(struct v4l2_subdev *subdev) · 3 unmodified lines
591696 for (i = 0; i < MAX_SUBDEVS; i++)
592697 if (gmin_subdevs[i].subdev == subdev)
593698 return &gmin_subdevs[i];
594− return gmin_subdev_add(subdev);
699+ return NULL;
700+}
701+
702+static struct gmin_subdev *find_free_gmin_subdev_slot(void)
703+{
704+ unsigned int i;
705+
706+ for (i = 0; i < MAX_SUBDEVS; i++)
707+ if (gmin_subdevs[i].subdev == NULL)
708+ return &gmin_subdevs[i];
709+ return NULL;
595710 }
596711
597712 static int axp_regulator_set(struct device *dev, struct gmin_subdev *gs,
@@ -700,32 +815,24 @@ static int gmin_v1p8_ctrl(struct v4l2_subdev *subdev, int on) · 102 unmodified lines
700815 {
701816 struct gmin_subdev *gs = find_gmin_subdev(subdev);
702817 int ret;
703− struct device *dev;
704− struct i2c_client *client = v4l2_get_subdevdata(subdev);
705818 int value;
706819
707− dev = &client->dev;
708−
709− if (v1p8_gpio == V1P8_GPIO_UNSET) {
710− v1p8_gpio = gmin_get_var_int(dev, true,
711− "V1P8GPIO", V1P8_GPIO_NONE);
712− if (v1p8_gpio != V1P8_GPIO_NONE) {
713− pr_info("atomisp_gmin_platform: 1.8v power on GPIO %d\n",
714− v1p8_gpio);
715− ret = gpio_request(v1p8_gpio, "camera_v1p8_en");
716− if (!ret)
717− ret = gpio_direction_output(v1p8_gpio, 0);
718− if (ret)
719− pr_err("V1P8 GPIO initialization failed\n");
720− }
820+ if (gs->v1p8_gpio >= 0) {
821+ pr_info("atomisp_gmin_platform: 1.8v power on GPIO %d\n",
822+ gs->v1p8_gpio);
823+ ret = gpio_request(gs->v1p8_gpio, "camera_v1p8_en");
824+ if (!ret)
825+ ret = gpio_direction_output(gs->v1p8_gpio, 0);
826+ if (ret)
827+ pr_err("V1P8 GPIO initialization failed\n");
721828 }
722829
723830 if (!gs || gs->v1p8_on == on)
724831 return 0;
725832 gs->v1p8_on = on;
726833
727− if (v1p8_gpio >= 0)
728− gpio_set_value(v1p8_gpio, on);
834+ if (gs->v1p8_gpio >= 0)
835+ gpio_set_value(gs->v1p8_gpio, on);
729836
730837 if (gs->v1p8_reg) {
731838 regulator_set_voltage(gs->v1p8_reg, 1800000, 1800000);
@@ -762,32 +869,24 @@ static int gmin_v2p8_ctrl(struct v4l2_subdev *subdev, int on) · 30 unmodified lines
762869 {
763870 struct gmin_subdev *gs = find_gmin_subdev(subdev);
764871 int ret;
765− struct device *dev;
766− struct i2c_client *client = v4l2_get_subdevdata(subdev);
767872 int value;
768873
769− dev = &client->dev;
770−
771− if (v2p8_gpio == V2P8_GPIO_UNSET) {
772− v2p8_gpio = gmin_get_var_int(dev, true,
773− "V2P8GPIO", V2P8_GPIO_NONE);
774− if (v2p8_gpio != V2P8_GPIO_NONE) {
775− pr_info("atomisp_gmin_platform: 2.8v power on GPIO %d\n",
776− v2p8_gpio);
777− ret = gpio_request(v2p8_gpio, "camera_v2p8");
778− if (!ret)
779− ret = gpio_direction_output(v2p8_gpio, 0);
780− if (ret)
781− pr_err("V2P8 GPIO initialization failed\n");
782− }
874+ if (gs->v2p8_gpio >= 0) {
875+ pr_info("atomisp_gmin_platform: 2.8v power on GPIO %d\n",
876+ gs->v2p8_gpio);
877+ ret = gpio_request(gs->v2p8_gpio, "camera_v2p8");
878+ if (!ret)
879+ ret = gpio_direction_output(gs->v2p8_gpio, 0);
880+ if (ret)
881+ pr_err("V2P8 GPIO initialization failed\n");
783882 }
784883
785884 if (!gs || gs->v2p8_on == on)
786885 return 0;
787886 gs->v2p8_on = on;
788887
789− if (v2p8_gpio >= 0)
790− gpio_set_value(v2p8_gpio, on);
888+ if (gs->v2p8_gpio >= 0)
889+ gpio_set_value(gs->v2p8_gpio, on);
791890
792891 if (gs->v2p8_reg) {
793892 regulator_set_voltage(gs->v2p8_reg, 2900000, 2900000);
@@ -819,6 +918,37 @@ static int gmin_v2p8_ctrl(struct v4l2_subdev *subdev, int on) · 25 unmodified lines
819918 return -EINVAL;
820919 }
821920
921+static int gmin_acpi_pm_ctrl(struct v4l2_subdev *subdev, int on)
922+{
923+ int ret = 0;
924+ struct gmin_subdev *gs = find_gmin_subdev(subdev);
925+ struct i2c_client *client = v4l2_get_subdevdata(subdev);
926+ struct acpi_device *adev = ACPI_COMPANION(&client->dev);
927+
928+ /* Use the ACPI power management to control it */
929+ on = !!on;
930+ if (gs->clock_on == on)
931+ return 0;
932+
933+ dev_dbg(subdev->dev, "Setting power state to %s\n",
934+ on ? "on" : "off");
935+
936+ if (on)
937+ ret = acpi_device_set_power(adev,
938+ ACPI_STATE_D0);
939+ else
940+ ret = acpi_device_set_power(adev,
941+ ACPI_STATE_D3_COLD);
942+
943+ if (!ret)
944+ gs->clock_on = on;
945+ else
946+ dev_err(subdev->dev, "Couldn't set power state to %s\n",
947+ on ? "on" : "off");
948+
949+ return ret;
950+}
951+
822952 static int gmin_flisclk_ctrl(struct v4l2_subdev *subdev, int on)
823953 {
824954 int ret = 0;
@@ -884,7 +1014,7 @@ static struct camera_vcm_control *gmin_get_vcm_ctrl(struct v4l2_subdev *subdev, · 59 unmodified lines
8841014 return NULL;
8851015 }
8861016
887−static struct camera_sensor_platform_data gmin_plat = {
1017+static struct camera_sensor_platform_data pmic_gmin_plat = {
8881018 .gpio0_ctrl = gmin_gpio0_ctrl,
8891019 .gpio1_ctrl = gmin_gpio1_ctrl,
8901020 .v1p8_ctrl = gmin_v1p8_ctrl,
@@ -895,17 +1025,36 @@ static struct camera_sensor_platform_data gmin_plat = { · 4 unmodified lines
8951025 .get_vcm_ctrl = gmin_get_vcm_ctrl,
8961026 };
8971027
1028+static struct camera_sensor_platform_data acpi_gmin_plat = {
1029+ .gpio0_ctrl = gmin_gpio0_ctrl,
1030+ .gpio1_ctrl = gmin_gpio1_ctrl,
1031+ .v1p8_ctrl = gmin_acpi_pm_ctrl,
1032+ .v2p8_ctrl = gmin_acpi_pm_ctrl,
1033+ .v1p2_ctrl = gmin_acpi_pm_ctrl,
1034+ .flisclk_ctrl = gmin_acpi_pm_ctrl,
1035+ .csi_cfg = gmin_csi_cfg,
1036+ .get_vcm_ctrl = gmin_get_vcm_ctrl,
1037+};
1038+
8981039 struct camera_sensor_platform_data *gmin_camera_platform_data(
8991040 struct v4l2_subdev *subdev,
9001041 enum atomisp_input_format csi_format,
9011042 enum atomisp_bayer_order csi_bayer)
9021043 {
903− struct gmin_subdev *gs = find_gmin_subdev(subdev);
1044+ u8 pmic_i2c_addr = gmin_detect_pmic(subdev);
1045+ struct gmin_subdev *gs;
9041046
1047+ gs = find_free_gmin_subdev_slot();
1048+ gs->subdev = subdev;
9051049 gs->csi_fmt = csi_format;
9061050 gs->csi_bayer = csi_bayer;
1051+ gs->pwm_i2c_addr = pmic_i2c_addr;
9071052
908− return &gmin_plat;
1053+ gmin_subdev_add(gs);
1054+ if (gs->pmc_clk)
1055+ return &pmic_gmin_plat;
1056+ else
1057+ return &acpi_gmin_plat;
9091058 }
9101059 EXPORT_SYMBOL_GPL(gmin_camera_platform_data);
9111060
@@ -957,12 +1106,28 @@ static int gmin_get_config_dsm_var(struct device *dev, · 45 unmodified lines
9571106 union acpi_object *obj, *cur = NULL;
9581107 int i;
9591108
1109+ /*
1110+ * The data reported by "CamClk" seems to be either 0 or 1 at the
1111+ * _DSM table.
1112+ *
1113+ * At the ACPI tables we looked so far, this is not related to the
1114+ * actual clock source for the sensor, which is given by the
1115+ * _PR0 ACPI table. So, ignore it, as otherwise this will be
1116+ * set to a wrong value.
1117+ */
1118+ if (!strcmp(var, "CamClk"))
1119+ return -EINVAL;
1120+
9601121 obj = acpi_evaluate_dsm(handle, &atomisp_dsm_guid, 0, 0, NULL);
9611122 if (!obj) {
9621123 dev_info_once(dev, "Didn't find ACPI _DSM table.\n");
9631124 return -EINVAL;
9641125 }
9651126
1127+ /* Return on unexpected object type */
1128+ if (obj->type != ACPI_TYPE_PACKAGE)
1129+ return -EINVAL;
1130+
9661131 #if 0 /* Just for debugging purposes */
9671132 for (i = 0; i < obj->package.count; i++) {
9681133 union acpi_object *cur = &obj->package.elements[i];
@@ -1155,10 +1320,10 @@ EXPORT_SYMBOL_GPL(camera_sensor_csi); · 186 unmodified lines
11551320 * trying. The driver itself does direct calls to the PUNIT to manage
11561321 * ISP power.
11571322 */
1158−static void isp_pm_cap_fixup(struct pci_dev *dev)
1323+static void isp_pm_cap_fixup(struct pci_dev *pdev)
11591324 {
1160− dev_info(&dev->dev, "Disabling PCI power management on camera ISP\n");
1161− dev->pm_cap = 0;
1325+ dev_info(&pdev->dev, "Disabling PCI power management on camera ISP\n");
1326+ pdev->pm_cap = 0;
11621327 }
11631328 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0f38, isp_pm_cap_fixup);
11641329
drivers/staging/media/atomisp/pci/atomisp_internal.h+1−1
@@ -216,12 +216,12 @@ struct atomisp_sw_contex { · 215 unmodified lines
216216 * ci device struct
217217 */
218218 struct atomisp_device {
219− struct pci_dev *pdev;
220219 struct device *dev;
221220 struct v4l2_device v4l2_dev;
222221 struct media_device media_dev;
223222 struct atomisp_platform_data *pdata;
224223 void *mmu_l1_base;
224+ void __iomem *base;
225225 const struct firmware *firmware;
226226
227227 struct pm_qos_request pm_qos;
drivers/staging/media/atomisp/pci/atomisp_ioctl.c+9−10
@@ -549,8 +549,7 @@ static int atomisp_querycap(struct file *file, void *fh, · 548 unmodified lines
549549
550550 strscpy(cap->driver, DRIVER, sizeof(cap->driver));
551551 strscpy(cap->card, CARD, sizeof(cap->card));
552− snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s",
553− pci_name(isp->pdev));
552+ snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s", dev_name(isp->dev));
554553
555554 return 0;
556555 }
@@ -1635,6 +1634,7 @@ static int atomisp_streamon(struct file *file, void *fh, · 1078 unmodified lines
16351634 struct atomisp_video_pipe *pipe = atomisp_to_video_pipe(vdev);
16361635 struct atomisp_sub_device *asd = pipe->asd;
16371636 struct atomisp_device *isp = video_get_drvdata(vdev);
1637+ struct pci_dev *pdev = to_pci_dev(isp->dev);
16381638 enum ia_css_pipe_id css_pipe_id;
16391639 unsigned int sensor_start_stream;
16401640 unsigned int wdt_duration = ATOMISP_ISP_TIMEOUT_DURATION;
@@ -1844,9 +1844,8 @@ start_sensor: · 203 unmodified lines
18441844 /* Enable the CSI interface on ANN B0/K0 */
18451845 if (isp->media_dev.hw_revision >= ((ATOMISP_HW_REVISION_ISP2401 <<
18461846 ATOMISP_HW_REVISION_SHIFT) | ATOMISP_HW_STEPPING_B0)) {
1847− pci_write_config_word(isp->pdev, MRFLD_PCI_CSI_CONTROL,
1848− isp->saved_regs.csi_control |
1849− MRFLD_PCI_CSI_CONTROL_CSI_READY);
1847+ pci_write_config_word(pdev, MRFLD_PCI_CSI_CONTROL,
1848+ isp->saved_regs.csi_control | MRFLD_PCI_CSI_CONTROL_CSI_READY);
18501849 }
18511850
18521851 /* stream on the sensor */
@@ -1891,6 +1890,7 @@ int __atomisp_streamoff(struct file *file, void *fh, enum v4l2_buf_type type) · 38 unmodified lines
18911890 {
18921891 struct video_device *vdev = video_devdata(file);
18931892 struct atomisp_device *isp = video_get_drvdata(vdev);
1893+ struct pci_dev *pdev = to_pci_dev(isp->dev);
18941894 struct atomisp_video_pipe *pipe = atomisp_to_video_pipe(vdev);
18951895 struct atomisp_sub_device *asd = pipe->asd;
18961896 struct atomisp_video_pipe *capture_pipe = NULL;
@@ -2076,9 +2076,8 @@ stopsensor: · 179 unmodified lines
20762076 /* Disable the CSI interface on ANN B0/K0 */
20772077 if (isp->media_dev.hw_revision >= ((ATOMISP_HW_REVISION_ISP2401 <<
20782078 ATOMISP_HW_REVISION_SHIFT) | ATOMISP_HW_STEPPING_B0)) {
2079− pci_write_config_word(isp->pdev, MRFLD_PCI_CSI_CONTROL,
2080− isp->saved_regs.csi_control &
2081− ~MRFLD_PCI_CSI_CONTROL_CSI_READY);
2079+ pci_write_config_word(pdev, MRFLD_PCI_CSI_CONTROL,
2080+ isp->saved_regs.csi_control & ~MRFLD_PCI_CSI_CONTROL_CSI_READY);
20822081 }
20832082
20842083 if (atomisp_freq_scaling(isp, ATOMISP_DFS_MODE_LOW, false))
@@ -2111,8 +2110,8 @@ stopsensor: · 26 unmodified lines
21112110 }
21122111
21132112 /* disable PUNIT/ISP acknowlede/handshake - SRSE=3 */
2114− pci_write_config_dword(isp->pdev, PCI_I_CONTROL, isp->saved_regs.i_control |
2115− MRFLD_PCI_I_CONTROL_SRSE_RESET_MASK);
2113+ pci_write_config_dword(pdev, PCI_I_CONTROL,
2114+ isp->saved_regs.i_control | MRFLD_PCI_I_CONTROL_SRSE_RESET_MASK);
21162115 dev_err(isp->dev, "atomisp_reset");
21172116 atomisp_reset(isp);
21182117 for (i = 0; i < isp->num_of_streams; i++) {
drivers/staging/media/atomisp/pci/atomisp_v4l2.c+127−158
@@ -127,8 +127,6 @@ MODULE_PARM_DESC(pad_h, "extra data for ISP processing"); · 126 unmodified lines
127127
128128 struct device *atomisp_dev;
129129
130−void __iomem *atomisp_io_base;
131−
132130 static const struct atomisp_freq_scaling_rule dfs_rules_merr[] = {
133131 {
134132 .width = ISP_FREQ_RULE_ANY,
@@ -512,30 +510,27 @@ void atomisp_acc_unregister(struct atomisp_acc_pipe *video) · 377 unmodified lines
512510
513511 static int atomisp_save_iunit_reg(struct atomisp_device *isp)
514512 {
515− struct pci_dev *dev = isp->pdev;
513+ struct pci_dev *pdev = to_pci_dev(isp->dev);
516514
517515 dev_dbg(isp->dev, "%s\n", __func__);
518516
519− pci_read_config_word(dev, PCI_COMMAND, &isp->saved_regs.pcicmdsts);
517+ pci_read_config_word(pdev, PCI_COMMAND, &isp->saved_regs.pcicmdsts);
520518 /* isp->saved_regs.ispmmadr is set from the atomisp_pci_probe() */
521− pci_read_config_dword(dev, PCI_MSI_CAPID, &isp->saved_regs.msicap);
522− pci_read_config_dword(dev, PCI_MSI_ADDR, &isp->saved_regs.msi_addr);
523− pci_read_config_word(dev, PCI_MSI_DATA, &isp->saved_regs.msi_data);
524− pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &isp->saved_regs.intr);
525− pci_read_config_dword(dev, PCI_INTERRUPT_CTRL,
526− &isp->saved_regs.interrupt_control);
527−
528− pci_read_config_dword(dev, MRFLD_PCI_PMCS,
529− &isp->saved_regs.pmcs);
519+ pci_read_config_dword(pdev, PCI_MSI_CAPID, &isp->saved_regs.msicap);
520+ pci_read_config_dword(pdev, PCI_MSI_ADDR, &isp->saved_regs.msi_addr);
521+ pci_read_config_word(pdev, PCI_MSI_DATA, &isp->saved_regs.msi_data);
522+ pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, &isp->saved_regs.intr);
523+ pci_read_config_dword(pdev, PCI_INTERRUPT_CTRL, &isp->saved_regs.interrupt_control);
524+
525+ pci_read_config_dword(pdev, MRFLD_PCI_PMCS, &isp->saved_regs.pmcs);
530526 /* Ensure read/write combining is enabled. */
531− pci_read_config_dword(dev, PCI_I_CONTROL,
532− &isp->saved_regs.i_control);
527+ pci_read_config_dword(pdev, PCI_I_CONTROL, &isp->saved_regs.i_control);
533528 isp->saved_regs.i_control |=
534529 MRFLD_PCI_I_CONTROL_ENABLE_READ_COMBINING |
535530 MRFLD_PCI_I_CONTROL_ENABLE_WRITE_COMBINING;
536− pci_read_config_dword(dev, MRFLD_PCI_CSI_ACCESS_CTRL_VIOL,
531+ pci_read_config_dword(pdev, MRFLD_PCI_CSI_ACCESS_CTRL_VIOL,
537532 &isp->saved_regs.csi_access_viol);
538− pci_read_config_dword(dev, MRFLD_PCI_CSI_RCOMP_CONTROL,
533+ pci_read_config_dword(pdev, MRFLD_PCI_CSI_RCOMP_CONTROL,
539534 &isp->saved_regs.csi_rcomp_config);
540535 /*
541536 * Hardware bugs require setting CSI_HS_OVR_CLK_GATE_ON_UPDATE.
@@ -545,65 +540,58 @@ static int atomisp_save_iunit_reg(struct atomisp_device *isp) · 3 unmodified lines
545540 * is missed, and IUNIT can hang.
546541 * For both issues, setting this bit is a workaround.
547542 */
548− isp->saved_regs.csi_rcomp_config |=
549− MRFLD_PCI_CSI_HS_OVR_CLK_GATE_ON_UPDATE;
550− pci_read_config_dword(dev, MRFLD_PCI_CSI_AFE_TRIM_CONTROL,
543+ isp->saved_regs.csi_rcomp_config |= MRFLD_PCI_CSI_HS_OVR_CLK_GATE_ON_UPDATE;
544+ pci_read_config_dword(pdev, MRFLD_PCI_CSI_AFE_TRIM_CONTROL,
551545 &isp->saved_regs.csi_afe_dly);
552− pci_read_config_dword(dev, MRFLD_PCI_CSI_CONTROL,
546+ pci_read_config_dword(pdev, MRFLD_PCI_CSI_CONTROL,
553547 &isp->saved_regs.csi_control);
554548 if (isp->media_dev.hw_revision >=
555549 (ATOMISP_HW_REVISION_ISP2401 << ATOMISP_HW_REVISION_SHIFT))
556− isp->saved_regs.csi_control |=
557− MRFLD_PCI_CSI_CONTROL_PARPATHEN;
550+ isp->saved_regs.csi_control |= MRFLD_PCI_CSI_CONTROL_PARPATHEN;
558551 /*
559552 * On CHT CSI_READY bit should be enabled before stream on
560553 */
561554 if (IS_CHT && (isp->media_dev.hw_revision >= ((ATOMISP_HW_REVISION_ISP2401 <<
562555 ATOMISP_HW_REVISION_SHIFT) | ATOMISP_HW_STEPPING_B0)))
563− isp->saved_regs.csi_control |=
564− MRFLD_PCI_CSI_CONTROL_CSI_READY;
565− pci_read_config_dword(dev, MRFLD_PCI_CSI_AFE_RCOMP_CONTROL,
556+ isp->saved_regs.csi_control |= MRFLD_PCI_CSI_CONTROL_CSI_READY;
557+ pci_read_config_dword(pdev, MRFLD_PCI_CSI_AFE_RCOMP_CONTROL,
566558 &isp->saved_regs.csi_afe_rcomp_config);
567− pci_read_config_dword(dev, MRFLD_PCI_CSI_AFE_HS_CONTROL,
559+ pci_read_config_dword(pdev, MRFLD_PCI_CSI_AFE_HS_CONTROL,
568560 &isp->saved_regs.csi_afe_hs_control);
569− pci_read_config_dword(dev, MRFLD_PCI_CSI_DEADLINE_CONTROL,
561+ pci_read_config_dword(pdev, MRFLD_PCI_CSI_DEADLINE_CONTROL,
570562 &isp->saved_regs.csi_deadline_control);
571563 return 0;
572564 }
573565
574566 static int __maybe_unused atomisp_restore_iunit_reg(struct atomisp_device *isp)
575567 {
576− struct pci_dev *dev = isp->pdev;
568+ struct pci_dev *pdev = to_pci_dev(isp->dev);
577569
578570 dev_dbg(isp->dev, "%s\n", __func__);
579571
580− pci_write_config_word(dev, PCI_COMMAND, isp->saved_regs.pcicmdsts);
581− pci_write_config_dword(dev, PCI_BASE_ADDRESS_0,
582− isp->saved_regs.ispmmadr);
583− pci_write_config_dword(dev, PCI_MSI_CAPID, isp->saved_regs.msicap);
584− pci_write_config_dword(dev, PCI_MSI_ADDR, isp->saved_regs.msi_addr);
585− pci_write_config_word(dev, PCI_MSI_DATA, isp->saved_regs.msi_data);
586− pci_write_config_byte(dev, PCI_INTERRUPT_LINE, isp->saved_regs.intr);
587− pci_write_config_dword(dev, PCI_INTERRUPT_CTRL,
588− isp->saved_regs.interrupt_control);
589− pci_write_config_dword(dev, PCI_I_CONTROL,
590− isp->saved_regs.i_control);
591−
592− pci_write_config_dword(dev, MRFLD_PCI_PMCS,
593− isp->saved_regs.pmcs);
594− pci_write_config_dword(dev, MRFLD_PCI_CSI_ACCESS_CTRL_VIOL,
572+ pci_write_config_word(pdev, PCI_COMMAND, isp->saved_regs.pcicmdsts);
573+ pci_write_config_dword(pdev, PCI_BASE_ADDRESS_0, isp->saved_regs.ispmmadr);
574+ pci_write_config_dword(pdev, PCI_MSI_CAPID, isp->saved_regs.msicap);
575+ pci_write_config_dword(pdev, PCI_MSI_ADDR, isp->saved_regs.msi_addr);
576+ pci_write_config_word(pdev, PCI_MSI_DATA, isp->saved_regs.msi_data);
577+ pci_write_config_byte(pdev, PCI_INTERRUPT_LINE, isp->saved_regs.intr);
578+ pci_write_config_dword(pdev, PCI_INTERRUPT_CTRL, isp->saved_regs.interrupt_control);
579+ pci_write_config_dword(pdev, PCI_I_CONTROL, isp->saved_regs.i_control);
580+
581+ pci_write_config_dword(pdev, MRFLD_PCI_PMCS, isp->saved_regs.pmcs);
582+ pci_write_config_dword(pdev, MRFLD_PCI_CSI_ACCESS_CTRL_VIOL,
595583 isp->saved_regs.csi_access_viol);
596− pci_write_config_dword(dev, MRFLD_PCI_CSI_RCOMP_CONTROL,
584+ pci_write_config_dword(pdev, MRFLD_PCI_CSI_RCOMP_CONTROL,
597585 isp->saved_regs.csi_rcomp_config);
598− pci_write_config_dword(dev, MRFLD_PCI_CSI_AFE_TRIM_CONTROL,
586+ pci_write_config_dword(pdev, MRFLD_PCI_CSI_AFE_TRIM_CONTROL,
599587 isp->saved_regs.csi_afe_dly);
600− pci_write_config_dword(dev, MRFLD_PCI_CSI_CONTROL,
588+ pci_write_config_dword(pdev, MRFLD_PCI_CSI_CONTROL,
601589 isp->saved_regs.csi_control);
602− pci_write_config_dword(dev, MRFLD_PCI_CSI_AFE_RCOMP_CONTROL,
590+ pci_write_config_dword(pdev, MRFLD_PCI_CSI_AFE_RCOMP_CONTROL,
603591 isp->saved_regs.csi_afe_rcomp_config);
604− pci_write_config_dword(dev, MRFLD_PCI_CSI_AFE_HS_CONTROL,
592+ pci_write_config_dword(pdev, MRFLD_PCI_CSI_AFE_HS_CONTROL,
605593 isp->saved_regs.csi_afe_hs_control);
606− pci_write_config_dword(dev, MRFLD_PCI_CSI_DEADLINE_CONTROL,
594+ pci_write_config_dword(pdev, MRFLD_PCI_CSI_DEADLINE_CONTROL,
607595 isp->saved_regs.csi_deadline_control);
608596
609597 /*
@@ -619,7 +607,7 @@ static int __maybe_unused atomisp_restore_iunit_reg(struct atomisp_device *isp) · 9 unmodified lines
619607
620608 static int atomisp_mrfld_pre_power_down(struct atomisp_device *isp)
621609 {
622− struct pci_dev *dev = isp->pdev;
610+ struct pci_dev *pdev = to_pci_dev(isp->dev);
623611 u32 irq;
624612 unsigned long flags;
625613
@@ -635,11 +623,11 @@ static int atomisp_mrfld_pre_power_down(struct atomisp_device *isp) · 9 unmodified lines
635623 * So, here we need to check if there is any pending
636624 * IRQ, if so, waiting for it to be served
637625 */
638− pci_read_config_dword(dev, PCI_INTERRUPT_CTRL, &irq);
626+ pci_read_config_dword(pdev, PCI_INTERRUPT_CTRL, &irq);
639627 irq = irq & 1 << INTR_IIR;
640− pci_write_config_dword(dev, PCI_INTERRUPT_CTRL, irq);
628+ pci_write_config_dword(pdev, PCI_INTERRUPT_CTRL, irq);
641629
642− pci_read_config_dword(dev, PCI_INTERRUPT_CTRL, &irq);
630+ pci_read_config_dword(pdev, PCI_INTERRUPT_CTRL, &irq);
643631 if (!(irq & (1 << INTR_IIR)))
644632 goto done;
645633
@@ -652,11 +640,11 @@ static int atomisp_mrfld_pre_power_down(struct atomisp_device *isp) · 6 unmodified lines
652640 spin_unlock_irqrestore(&isp->lock, flags);
653641 return -EAGAIN;
654642 } else {
655− pci_read_config_dword(dev, PCI_INTERRUPT_CTRL, &irq);
643+ pci_read_config_dword(pdev, PCI_INTERRUPT_CTRL, &irq);
656644 irq = irq & 1 << INTR_IIR;
657− pci_write_config_dword(dev, PCI_INTERRUPT_CTRL, irq);
645+ pci_write_config_dword(pdev, PCI_INTERRUPT_CTRL, irq);
658646
659− pci_read_config_dword(dev, PCI_INTERRUPT_CTRL, &irq);
647+ pci_read_config_dword(pdev, PCI_INTERRUPT_CTRL, &irq);
660648 if (!(irq & (1 << INTR_IIR))) {
661649 atomisp_css2_hw_store_32(MRFLD_INTR_ENABLE_REG, 0x0);
662650 goto done;
@@ -675,11 +663,11 @@ done: · 12 unmodified lines
675663 * to IIR. It could block subsequent interrupt messages.
676664 * HW sighting:4568410.
677665 */
678− pci_read_config_dword(dev, PCI_INTERRUPT_CTRL, &irq);
666+ pci_read_config_dword(pdev, PCI_INTERRUPT_CTRL, &irq);
679667 irq &= ~(1 << INTR_IER);
680− pci_write_config_dword(dev, PCI_INTERRUPT_CTRL, irq);
668+ pci_write_config_dword(pdev, PCI_INTERRUPT_CTRL, irq);
681669
682− atomisp_msi_irq_uninit(isp, dev);
670+ atomisp_msi_irq_uninit(isp);
683671 atomisp_freq_scaling(isp, ATOMISP_DFS_MODE_LOW, true);
684672 spin_unlock_irqrestore(&isp->lock, flags);
685673
@@ -755,7 +743,7 @@ static int atomisp_mrfld_power(struct atomisp_device *isp, bool enable) · 69 unmodified lines
755743
756744 /* Wait until ISPSSPM0 bit[25:24] shows the right value */
757745 iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ, MRFLD_ISPSSPM0, &tmp);
758− tmp = (tmp & MRFLD_ISPSSPM0_ISPSSC_MASK) >> MRFLD_ISPSSPM0_ISPSSS_OFFSET;
746+ tmp = (tmp >> MRFLD_ISPSSPM0_ISPSSS_OFFSET) & MRFLD_ISPSSPM0_ISPSSC_MASK;
759747 if (tmp == val) {
760748 trace_ipu_cstate(enable);
761749 return 0;
@@ -778,15 +766,13 @@ static int atomisp_mrfld_power(struct atomisp_device *isp, bool enable) · 16 unmodified lines
778766 /* Workaround for pmu_nc_set_power_state not ready in MRFLD */
779767 int atomisp_mrfld_power_down(struct atomisp_device *isp)
780768 {
781−// FIXME: at least with ISP2401, enabling this code causes the driver to break
782− return 0 && atomisp_mrfld_power(isp, false);
769+ return atomisp_mrfld_power(isp, false);
783770 }
784771
785772 /* Workaround for pmu_nc_set_power_state not ready in MRFLD */
786773 int atomisp_mrfld_power_up(struct atomisp_device *isp)
787774 {
788−// FIXME: at least with ISP2401, enabling this code causes the driver to break
789− return 0 && atomisp_mrfld_power(isp, true);
775+ return atomisp_mrfld_power(isp, true);
790776 }
791777
792778 int atomisp_runtime_suspend(struct device *dev)
@@ -902,6 +888,7 @@ static int __maybe_unused atomisp_resume(struct device *dev) · 109 unmodified lines
902888
903889 int atomisp_csi_lane_config(struct atomisp_device *isp)
904890 {
891+ struct pci_dev *pdev = to_pci_dev(isp->dev);
905892 static const struct {
906893 u8 code;
907894 u8 lanes[MRFLD_PORT_NUM];
@@ -1003,7 +990,7 @@ int atomisp_csi_lane_config(struct atomisp_device *isp) · 95 unmodified lines
1003990 return -EINVAL;
1004991 }
1005992
1006− pci_read_config_dword(isp->pdev, MRFLD_PCI_CSI_CONTROL, &csi_control);
993+ pci_read_config_dword(pdev, MRFLD_PCI_CSI_CONTROL, &csi_control);
1007994 csi_control &= ~port_config_mask;
1008995 csi_control |= (portconfigs[i].code << MRFLD_PORT_CONFIGCODE_SHIFT)
1009996 | (portconfigs[i].lanes[0] ? 0 : (1 << MRFLD_PORT1_ENABLE_SHIFT))
@@ -1013,7 +1000,7 @@ int atomisp_csi_lane_config(struct atomisp_device *isp) · 3 unmodified lines
10131000 | (((1 << portconfigs[i].lanes[1]) - 1) << MRFLD_PORT2_LANES_SHIFT)
10141001 | (((1 << portconfigs[i].lanes[2]) - 1) << port3_lanes_shift);
10151002
1016− pci_write_config_dword(isp->pdev, MRFLD_PCI_CSI_CONTROL, csi_control);
1003+ pci_write_config_dword(pdev, MRFLD_PCI_CSI_CONTROL, csi_control);
10171004
10181005 dev_dbg(isp->dev,
10191006 "%s: the portconfig is %d-%d-%d, CSI_CONTROL is 0x%08X\n",
@@ -1440,8 +1427,7 @@ atomisp_load_firmware(struct atomisp_device *isp) · 420 unmodified lines
14401427 * Check for flags the driver was compiled with against the PCI
14411428 * device. Always returns true on other than ISP 2400.
14421429 */
1443−static bool is_valid_device(struct pci_dev *dev,
1444− const struct pci_device_id *id)
1430+static bool is_valid_device(struct pci_dev *pdev, const struct pci_device_id *id)
14451431 {
14461432 unsigned int a0_max_id = 0;
14471433 const char *name;
@@ -1465,14 +1451,14 @@ static bool is_valid_device(struct pci_dev *dev, · 17 unmodified lines
14651451 name = "Cherrytrail";
14661452 break;
14671453 default:
1468− dev_err(&dev->dev, "%s: unknown device ID %x04:%x04\n",
1454+ dev_err(&pdev->dev, "%s: unknown device ID %x04:%x04\n",
14691455 product, id->vendor, id->device);
14701456 return false;
14711457 }
14721458
1473− if (dev->revision <= ATOMISP_PCI_REV_BYT_A0_MAX) {
1474− dev_err(&dev->dev, "%s revision %d is not unsupported\n",
1475− name, dev->revision);
1459+ if (pdev->revision <= ATOMISP_PCI_REV_BYT_A0_MAX) {
1460+ dev_err(&pdev->dev, "%s revision %d is not unsupported\n",
1461+ name, pdev->revision);
14761462 return false;
14771463 }
14781464
@@ -1483,22 +1469,20 @@ static bool is_valid_device(struct pci_dev *dev, · 4 unmodified lines
14831469
14841470 #if defined(ISP2400)
14851471 if (IS_ISP2401) {
1486− dev_err(&dev->dev, "Support for %s (ISP2401) was disabled at compile time\n",
1472+ dev_err(&pdev->dev, "Support for %s (ISP2401) was disabled at compile time\n",
14871473 name);
14881474 return false;
14891475 }
14901476 #else
14911477 if (!IS_ISP2401) {
1492− dev_err(&dev->dev, "Support for %s (ISP2400) was disabled at compile time\n",
1478+ dev_err(&pdev->dev, "Support for %s (ISP2400) was disabled at compile time\n",
14931479 name);
14941480 return false;
14951481 }
14961482 #endif
14971483
1498− dev_info(&dev->dev, "Detected %s version %d (ISP240%c) on %s\n",
1499− name, dev->revision,
1500− IS_ISP2401 ? '1' : '0',
1501− product);
1484+ dev_info(&pdev->dev, "Detected %s version %d (ISP240%c) on %s\n",
1485+ name, pdev->revision, IS_ISP2401 ? '1' : '0', product);
15021486
15031487 return true;
15041488 }
@@ -1538,66 +1522,60 @@ alloc_fail: · 33 unmodified lines
15381522
15391523 #define ATOM_ISP_PCI_BAR 0
15401524
1541−static int atomisp_pci_probe(struct pci_dev *dev,
1542− const struct pci_device_id *id)
1525+static int atomisp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
15431526 {
15441527 const struct atomisp_platform_data *pdata;
15451528 struct atomisp_device *isp;
15461529 unsigned int start;
1547− void __iomem *base;
15481530 int err, val;
15491531 u32 irq;
15501532
1551− if (!is_valid_device(dev, id))
1533+ if (!is_valid_device(pdev, id))
15521534 return -ENODEV;
15531535
15541536 /* Pointer to struct device. */
1555− atomisp_dev = &dev->dev;
1537+ atomisp_dev = &pdev->dev;
15561538
15571539 pdata = atomisp_get_platform_data();
15581540 if (!pdata)
1559− dev_warn(&dev->dev, "no platform data available\n");
1541+ dev_warn(&pdev->dev, "no platform data available\n");
15601542
1561− err = pcim_enable_device(dev);
1543+ err = pcim_enable_device(pdev);
15621544 if (err) {
1563− dev_err(&dev->dev, "Failed to enable CI ISP device (%d)\n",
1564− err);
1545+ dev_err(&pdev->dev, "Failed to enable CI ISP device (%d)\n", err);
15651546 return err;
15661547 }
15671548
1568− start = pci_resource_start(dev, ATOM_ISP_PCI_BAR);
1569− dev_dbg(&dev->dev, "start: 0x%x\n", start);
1549+ start = pci_resource_start(pdev, ATOM_ISP_PCI_BAR);
1550+ dev_dbg(&pdev->dev, "start: 0x%x\n", start);
15701551
1571− err = pcim_iomap_regions(dev, 1 << ATOM_ISP_PCI_BAR, pci_name(dev));
1552+ err = pcim_iomap_regions(pdev, 1 << ATOM_ISP_PCI_BAR, pci_name(pdev));
15721553 if (err) {
1573− dev_err(&dev->dev, "Failed to I/O memory remapping (%d)\n",
1574− err);
1554+ dev_err(&pdev->dev, "Failed to I/O memory remapping (%d)\n", err);
15751555 goto ioremap_fail;
15761556 }
15771557
1578− base = pcim_iomap_table(dev)[ATOM_ISP_PCI_BAR];
1579− dev_dbg(&dev->dev, "base: %p\n", base);
1580−
1581− atomisp_io_base = base;
1582−
1583− dev_dbg(&dev->dev, "atomisp_io_base: %p\n", atomisp_io_base);
1584−
1585− isp = devm_kzalloc(&dev->dev, sizeof(struct atomisp_device), GFP_KERNEL);
1558+ isp = devm_kzalloc(&pdev->dev, sizeof(*isp), GFP_KERNEL);
15861559 if (!isp) {
15871560 err = -ENOMEM;
15881561 goto atomisp_dev_alloc_fail;
15891562 }
1590− isp->pdev = dev;
1591− isp->dev = &dev->dev;
1563+
1564+ isp->dev = &pdev->dev;
1565+ isp->base = pcim_iomap_table(pdev)[ATOM_ISP_PCI_BAR];
15921566 isp->sw_contex.power_state = ATOM_ISP_POWER_UP;
15931567 isp->saved_regs.ispmmadr = start;
15941568
1569+ dev_dbg(&pdev->dev, "atomisp mmio base: %p\n", isp->base);
1570+
15951571 rt_mutex_init(&isp->mutex);
15961572 mutex_init(&isp->streamoff_mutex);
15971573 spin_lock_init(&isp->lock);
15981574
15991575 /* This is not a true PCI device on SoC, so the delay is not needed. */
1600− isp->pdev->d3_delay = 0;
1576+ pdev->d3_delay = 0;
1577+
1578+ pci_set_drvdata(pdev, isp);
16011579
16021580 switch (id->device & ATOMISP_PCI_DEVICE_SOC_MASK) {
16031581 case ATOMISP_PCI_DEVICE_SOC_MRFLD:
@@ -1648,15 +1626,14 @@ static int atomisp_pci_probe(struct pci_dev *dev, · 44 unmodified lines
16481626 * have specs yet for exactly how it varies. Default to
16491627 * BYT-CR but let provisioning set it via EFI variable
16501628 */
1651− isp->hpll_freq = gmin_get_var_int(&dev->dev, false, "HpllFreq",
1652− HPLL_FREQ_2000MHZ);
1629+ isp->hpll_freq = gmin_get_var_int(&pdev->dev, false, "HpllFreq", HPLL_FREQ_2000MHZ);
16531630
16541631 /*
16551632 * for BYT/CHT we are put isp into D3cold to avoid pci registers access
16561633 * in power off. Set d3cold_delay to 0 since default 100ms is not
16571634 * necessary.
16581635 */
1659− isp->pdev->d3cold_delay = 0;
1636+ pdev->d3cold_delay = 0;
16601637 break;
16611638 case ATOMISP_PCI_DEVICE_SOC_ANN:
16621639 isp->media_dev.hw_revision = (
@@ -1666,7 +1643,7 @@ static int atomisp_pci_probe(struct pci_dev *dev, · 3 unmodified lines
16661643 ATOMISP_HW_REVISION_ISP2401_LEGACY
16671644 #endif
16681645 << ATOMISP_HW_REVISION_SHIFT);
1669− isp->media_dev.hw_revision |= isp->pdev->revision < 2 ?
1646+ isp->media_dev.hw_revision |= pdev->revision < 2 ?
16701647 ATOMISP_HW_STEPPING_A0 : ATOMISP_HW_STEPPING_B0;
16711648 isp->dfs = &dfs_config_merr;
16721649 isp->hpll_freq = HPLL_FREQ_1600MHZ;
@@ -1679,13 +1656,13 @@ static int atomisp_pci_probe(struct pci_dev *dev, · 6 unmodified lines
16791656 ATOMISP_HW_REVISION_ISP2401_LEGACY
16801657 #endif
16811658 << ATOMISP_HW_REVISION_SHIFT);
1682− isp->media_dev.hw_revision |= isp->pdev->revision < 2 ?
1659+ isp->media_dev.hw_revision |= pdev->revision < 2 ?
16831660 ATOMISP_HW_STEPPING_A0 : ATOMISP_HW_STEPPING_B0;
16841661
16851662 isp->dfs = &dfs_config_cht;
1686− isp->pdev->d3cold_delay = 0;
1663+ pdev->d3cold_delay = 0;
16871664
1688− iosf_mbi_read(CCK_PORT, MBI_REG_READ, CCK_FUSE_REG_0, &val);
1665+ iosf_mbi_read(BT_MBI_UNIT_CCK, MBI_REG_READ, CCK_FUSE_REG_0, &val);
16891666 switch (val & CCK_FUSE_HPLL_FREQ_MASK) {
16901667 case 0x00:
16911668 isp->hpll_freq = HPLL_FREQ_800MHZ;
@@ -1698,18 +1675,16 @@ static int atomisp_pci_probe(struct pci_dev *dev, · 6 unmodified lines
16981675 break;
16991676 default:
17001677 isp->hpll_freq = HPLL_FREQ_1600MHZ;
1701− dev_warn(isp->dev,
1702− "read HPLL from cck failed. Default to 1600 MHz.\n");
1678+ dev_warn(&pdev->dev, "read HPLL from cck failed. Default to 1600 MHz.\n");
17031679 }
17041680 break;
17051681 default:
1706− dev_err(&dev->dev, "un-supported IUNIT device\n");
1682+ dev_err(&pdev->dev, "un-supported IUNIT device\n");
17071683 err = -ENODEV;
17081684 goto atomisp_dev_alloc_fail;
17091685 }
17101686
1711− dev_info(&dev->dev, "ISP HPLL frequency base = %d MHz\n",
1712− isp->hpll_freq);
1687+ dev_info(&pdev->dev, "ISP HPLL frequency base = %d MHz\n", isp->hpll_freq);
17131688
17141689 isp->max_isr_latency = ATOMISP_MAX_ISR_LATENCY;
17151690
@@ -1718,30 +1693,28 @@ static int atomisp_pci_probe(struct pci_dev *dev, · 2 unmodified lines
17181693 isp->firmware = atomisp_load_firmware(isp);
17191694 if (!isp->firmware) {
17201695 err = -ENOENT;
1721− dev_dbg(&dev->dev, "Firmware load failed\n");
1696+ dev_dbg(&pdev->dev, "Firmware load failed\n");
17221697 goto load_fw_fail;
17231698 }
17241699
1725− err = sh_css_check_firmware_version(isp->dev,
1726− isp->firmware->data);
1700+ err = sh_css_check_firmware_version(isp->dev, isp->firmware->data);
17271701 if (err) {
1728− dev_dbg(&dev->dev, "Firmware version check failed\n");
1702+ dev_dbg(&pdev->dev, "Firmware version check failed\n");
17291703 goto fw_validation_fail;
17301704 }
17311705 } else {
1732− dev_info(&dev->dev, "Firmware load will be deferred\n");
1706+ dev_info(&pdev->dev, "Firmware load will be deferred\n");
17331707 }
17341708
1735− pci_set_master(dev);
1736− pci_set_drvdata(dev, isp);
1709+ pci_set_master(pdev);
17371710
1738− err = pci_enable_msi(dev);
1711+ err = pci_enable_msi(pdev);
17391712 if (err) {
1740− dev_err(&dev->dev, "Failed to enable msi (%d)\n", err);
1713+ dev_err(&pdev->dev, "Failed to enable msi (%d)\n", err);
17411714 goto enable_msi_fail;
17421715 }
17431716
1744− atomisp_msi_irq_init(isp, dev);
1717+ atomisp_msi_irq_init(isp);
17451718
17461719 cpu_latency_qos_add_request(&isp->pm_qos, PM_QOS_DEFAULT_VALUE);
17471720
@@ -1762,8 +1735,7 @@ static int atomisp_pci_probe(struct pci_dev *dev, · 14 unmodified lines
17621735 * Workaround for imbalance data eye issue which is observed
17631736 * on TNG B0.
17641737 */
1765− pci_read_config_dword(dev, MRFLD_PCI_CSI_AFE_TRIM_CONTROL,
1766− &csi_afe_trim);
1738+ pci_read_config_dword(pdev, MRFLD_PCI_CSI_AFE_TRIM_CONTROL, &csi_afe_trim);
17671739 csi_afe_trim &= ~((MRFLD_PCI_CSI_HSRXCLKTRIM_MASK <<
17681740 MRFLD_PCI_CSI1_HSRXCLKTRIM_SHIFT) |
17691741 (MRFLD_PCI_CSI_HSRXCLKTRIM_MASK <<
@@ -1776,20 +1748,18 @@ static int atomisp_pci_probe(struct pci_dev *dev, · 6 unmodified lines
17761748 MRFLD_PCI_CSI2_HSRXCLKTRIM_SHIFT) |
17771749 (MRFLD_PCI_CSI3_HSRXCLKTRIM <<
17781750 MRFLD_PCI_CSI3_HSRXCLKTRIM_SHIFT);
1779− pci_write_config_dword(dev, MRFLD_PCI_CSI_AFE_TRIM_CONTROL,
1780− csi_afe_trim);
1751+ pci_write_config_dword(pdev, MRFLD_PCI_CSI_AFE_TRIM_CONTROL, csi_afe_trim);
17811752 }
17821753
17831754 err = atomisp_initialize_modules(isp);
17841755 if (err < 0) {
1785− dev_err(&dev->dev, "atomisp_initialize_modules (%d)\n", err);
1756+ dev_err(&pdev->dev, "atomisp_initialize_modules (%d)\n", err);
17861757 goto initialize_modules_fail;
17871758 }
17881759
17891760 err = atomisp_register_entities(isp);
17901761 if (err < 0) {
1791− dev_err(&dev->dev, "atomisp_register_entities failed (%d)\n",
1792− err);
1762+ dev_err(&pdev->dev, "atomisp_register_entities failed (%d)\n", err);
17931763 goto register_entities_fail;
17941764 }
17951765 err = atomisp_create_pads_links(isp);
@@ -1802,24 +1772,24 @@ static int atomisp_pci_probe(struct pci_dev *dev, · 6 unmodified lines
18021772 /* save the iunit context only once after all the values are init'ed. */
18031773 atomisp_save_iunit_reg(isp);
18041774
1805− pm_runtime_put_noidle(&dev->dev);
1806− pm_runtime_allow(&dev->dev);
1775+ pm_runtime_put_noidle(&pdev->dev);
1776+ pm_runtime_allow(&pdev->dev);
18071777
18081778 hmm_init_mem_stat(repool_pgnr, dypool_enable, dypool_pgnr);
18091779 err = hmm_pool_register(repool_pgnr, HMM_POOL_TYPE_RESERVED);
18101780 if (err) {
1811− dev_err(&dev->dev, "Failed to register reserved memory pool.\n");
1781+ dev_err(&pdev->dev, "Failed to register reserved memory pool.\n");
18121782 goto hmm_pool_fail;
18131783 }
18141784
18151785 /* Init ISP memory management */
18161786 hmm_init();
18171787
1818− err = devm_request_threaded_irq(&dev->dev, dev->irq,
1788+ err = devm_request_threaded_irq(&pdev->dev, pdev->irq,
18191789 atomisp_isr, atomisp_isr_thread,
18201790 IRQF_SHARED, "isp_irq", isp);
18211791 if (err) {
1822− dev_err(&dev->dev, "Failed to request irq (%d)\n", err);
1792+ dev_err(&pdev->dev, "Failed to request irq (%d)\n", err);
18231793 goto request_irq_fail;
18241794 }
18251795
@@ -1827,23 +1797,23 @@ static int atomisp_pci_probe(struct pci_dev *dev, · 1 unmodified line
18271797 if (!defer_fw_load) {
18281798 err = atomisp_css_load_firmware(isp);
18291799 if (err) {
1830− dev_err(&dev->dev, "Failed to init css.\n");
1800+ dev_err(&pdev->dev, "Failed to init css.\n");
18311801 goto css_init_fail;
18321802 }
18331803 } else {
1834− dev_dbg(&dev->dev, "Skip css init.\n");
1804+ dev_dbg(&pdev->dev, "Skip css init.\n");
18351805 }
18361806 /* Clear FW image from memory */
18371807 release_firmware(isp->firmware);
18381808 isp->firmware = NULL;
18391809 isp->css_env.isp_css_fw.data = NULL;
18401810
1841− atomisp_drvfs_init(&dev->driver->driver, isp);
1811+ atomisp_drvfs_init(isp);
18421812
18431813 return 0;
18441814
18451815 css_init_fail:
1846− devm_free_irq(&dev->dev, dev->irq, isp);
1816+ devm_free_irq(&pdev->dev, pdev->irq, isp);
18471817 request_irq_fail:
18481818 hmm_cleanup();
18491819 hmm_pool_unregister(HMM_POOL_TYPE_RESERVED);
@@ -1856,8 +1826,8 @@ register_entities_fail: · 6 unmodified lines
18561826 atomisp_uninitialize_modules(isp);
18571827 initialize_modules_fail:
18581828 cpu_latency_qos_remove_request(&isp->pm_qos);
1859− atomisp_msi_irq_uninit(isp, dev);
1860− pci_disable_msi(dev);
1829+ atomisp_msi_irq_uninit(isp);
1830+ pci_disable_msi(pdev);
18611831 enable_msi_fail:
18621832 fw_validation_fail:
18631833 release_firmware(isp->firmware);
@@ -1869,35 +1839,34 @@ load_fw_fail: · 5 unmodified lines
18691839 * The following lines have been copied from atomisp suspend path
18701840 */
18711841
1872− pci_read_config_dword(dev, PCI_INTERRUPT_CTRL, &irq);
1842+ pci_read_config_dword(pdev, PCI_INTERRUPT_CTRL, &irq);
18731843 irq = irq & 1 << INTR_IIR;
1874− pci_write_config_dword(dev, PCI_INTERRUPT_CTRL, irq);
1844+ pci_write_config_dword(pdev, PCI_INTERRUPT_CTRL, irq);
18751845
1876− pci_read_config_dword(dev, PCI_INTERRUPT_CTRL, &irq);
1846+ pci_read_config_dword(pdev, PCI_INTERRUPT_CTRL, &irq);
18771847 irq &= ~(1 << INTR_IER);
1878− pci_write_config_dword(dev, PCI_INTERRUPT_CTRL, irq);
1848+ pci_write_config_dword(pdev, PCI_INTERRUPT_CTRL, irq);
18791849
1880− atomisp_msi_irq_uninit(isp, dev);
1850+ atomisp_msi_irq_uninit(isp);
18811851
18821852 atomisp_ospm_dphy_down(isp);
18831853
18841854 /* Address later when we worry about the ...field chips */
18851855 if (IS_ENABLED(CONFIG_PM) && atomisp_mrfld_power_down(isp))
1886− dev_err(&dev->dev, "Failed to switch off ISP\n");
1856+ dev_err(&pdev->dev, "Failed to switch off ISP\n");
18871857
18881858 atomisp_dev_alloc_fail:
1889− pcim_iounmap_regions(dev, 1 << ATOM_ISP_PCI_BAR);
1859+ pcim_iounmap_regions(pdev, 1 << ATOM_ISP_PCI_BAR);
18901860
18911861 ioremap_fail:
18921862 return err;
18931863 }
18941864
1895−static void atomisp_pci_remove(struct pci_dev *dev)
1865+static void atomisp_pci_remove(struct pci_dev *pdev)
18961866 {
1897− struct atomisp_device *isp = (struct atomisp_device *)
1898− pci_get_drvdata(dev);
1867+ struct atomisp_device *isp = pci_get_drvdata(pdev);
18991868
1900− dev_info(&dev->dev, "Removing atomisp driver\n");
1869+ dev_info(&pdev->dev, "Removing atomisp driver\n");
19011870
19021871 atomisp_drvfs_exit();
19031872
@@ -1906,11 +1875,11 @@ static void atomisp_pci_remove(struct pci_dev *dev) · 2 unmodified lines
19061875 ia_css_unload_firmware();
19071876 hmm_cleanup();
19081877
1909− pm_runtime_forbid(&dev->dev);
1910− pm_runtime_get_noresume(&dev->dev);
1878+ pm_runtime_forbid(&pdev->dev);
1879+ pm_runtime_get_noresume(&pdev->dev);
19111880 cpu_latency_qos_remove_request(&isp->pm_qos);
19121881
1913− atomisp_msi_irq_uninit(isp, dev);
1882+ atomisp_msi_irq_uninit(isp);
19141883 atomisp_unregister_entities(isp);
19151884
19161885 destroy_workqueue(isp->wdt_work_queue);
drivers/staging/media/atomisp/pci/base/refcount/src/refcount.c+14−14
@@ -48,7 +48,7 @@ static struct ia_css_refcount_entry *refcount_find_entry(ia_css_ptr ptr, · 47 unmodified lines
4848 return NULL;
4949 if (!myrefcount.items) {
5050 ia_css_debug_dtrace(IA_CSS_DEBUG_ERROR,
51− "refcount_find_entry(): Ref count not initialized!\n");
51+ "%s(): Ref count not initialized!\n", __func__);
5252 return NULL;
5353 }
5454
@@ -73,12 +73,12 @@ int ia_css_refcount_init(uint32_t size) · 18 unmodified lines
7373
7474 if (size == 0) {
7575 ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
76− "ia_css_refcount_init(): Size of 0 for Ref count init!\n");
76+ "%s(): Size of 0 for Ref count init!\n", __func__);
7777 return -EINVAL;
7878 }
7979 if (myrefcount.items) {
8080 ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
81− "ia_css_refcount_init(): Ref count is already initialized\n");
81+ "%s(): Ref count is already initialized\n", __func__);
8282 return -EINVAL;
8383 }
8484 myrefcount.items =
@@ -99,7 +99,7 @@ void ia_css_refcount_uninit(void) · 14 unmodified lines
9999 u32 i;
100100
101101 ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
102− "ia_css_refcount_uninit() entry\n");
102+ "%s() entry\n", __func__);
103103 for (i = 0; i < myrefcount.size; i++) {
104104 /* driver verifier tool has issues with &arr[i]
105105 and prefers arr + i; as these are actually equivalent
@@ -120,7 +120,7 @@ void ia_css_refcount_uninit(void) · 14 unmodified lines
120120 myrefcount.items = NULL;
121121 myrefcount.size = 0;
122122 ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
123− "ia_css_refcount_uninit() leave\n");
123+ "%s() leave\n", __func__);
124124 }
125125
126126 ia_css_ptr ia_css_refcount_increment(s32 id, ia_css_ptr ptr)
@@ -133,7 +133,7 @@ ia_css_ptr ia_css_refcount_increment(s32 id, ia_css_ptr ptr) · 6 unmodified lines
133133 entry = refcount_find_entry(ptr, false);
134134
135135 ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
136− "ia_css_refcount_increment(%x) 0x%x\n", id, ptr);
136+ "%s(%x) 0x%x\n", __func__, id, ptr);
137137
138138 if (!entry) {
139139 entry = refcount_find_entry(ptr, true);
@@ -145,7 +145,7 @@ ia_css_ptr ia_css_refcount_increment(s32 id, ia_css_ptr ptr) · 5 unmodified lines
145145
146146 if (entry->id != id) {
147147 ia_css_debug_dtrace(IA_CSS_DEBUG_ERROR,
148− "ia_css_refcount_increment(): Ref count IDS do not match!\n");
148+ "%s(): Ref count IDS do not match!\n", __func__);
149149 return mmgr_NULL;
150150 }
151151
@@ -165,7 +165,7 @@ bool ia_css_refcount_decrement(s32 id, ia_css_ptr ptr) · 13 unmodified lines
165165 struct ia_css_refcount_entry *entry;
166166
167167 ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
168− "ia_css_refcount_decrement(%x) 0x%x\n", id, ptr);
168+ "%s(%x) 0x%x\n", __func__, id, ptr);
169169
170170 if (ptr == mmgr_NULL)
171171 return false;
@@ -175,7 +175,7 @@ bool ia_css_refcount_decrement(s32 id, ia_css_ptr ptr) · 3 unmodified lines
175175 if (entry) {
176176 if (entry->id != id) {
177177 ia_css_debug_dtrace(IA_CSS_DEBUG_ERROR,
178− "ia_css_refcount_decrement(): Ref count IDS do not match!\n");
178+ "%s(): Ref count IDS do not match!\n", __func__);
179179 return false;
180180 }
181181 if (entry->count > 0) {
@@ -225,8 +225,8 @@ void ia_css_refcount_clear(s32 id, clear_func clear_func_ptr) · 43 unmodified lines
225225 u32 count = 0;
226226
227227 assert(clear_func_ptr);
228− ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "ia_css_refcount_clear(%x)\n",
229− id);
228+ ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "%s(%x)\n",
229+ __func__, id);
230230
231231 for (i = 0; i < myrefcount.size; i++) {
232232 /* driver verifier tool has issues with &arr[i]
@@ -236,14 +236,14 @@ void ia_css_refcount_clear(s32 id, clear_func clear_func_ptr) · 3 unmodified lines
236236 entry = myrefcount.items + i;
237237 if ((entry->data != mmgr_NULL) && (entry->id == id)) {
238238 ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
239− "ia_css_refcount_clear: %x: 0x%x\n",
239+ "%s: %x: 0x%x\n", __func__,
240240 id, entry->data);
241241 if (clear_func_ptr) {
242242 /* clear using provided function */
243243 clear_func_ptr(entry->data);
244244 } else {
245245 ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
246− "ia_css_refcount_clear: using hmm_free: no clear_func\n");
246+ "%s: using hmm_free: no clear_func\n", __func__);
247247 hmm_free(entry->data);
248248 }
249249
@@ -260,7 +260,7 @@ void ia_css_refcount_clear(s32 id, clear_func clear_func_ptr) · 10 unmodified lines
260260 }
261261 }
262262 ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
263− "ia_css_refcount_clear(%x): cleared %d\n", id,
263+ "%s(%x): cleared %d\n", __func__, id,
264264 count);
265265 }
266266
drivers/staging/media/atomisp/pci/hive_types.h+3−21
@@ -52,32 +52,14 @@ typedef unsigned short hive_uint16; · 51 unmodified lines
5252 typedef unsigned int hive_uint32;
5353 typedef unsigned long long hive_uint64;
5454
55−/* by default assume 32 bit master port (both data and address) */
56−#ifndef HRT_DATA_WIDTH
57−#define HRT_DATA_WIDTH 32
58−#endif
59−#ifndef HRT_ADDRESS_WIDTH
60−#define HRT_ADDRESS_WIDTH 32
61−#endif
62−
55+#define HRT_DATA_WIDTH 32
56+#define HRT_ADDRESS_WIDTH 64
6357 #define HRT_DATA_BYTES (HRT_DATA_WIDTH / 8)
6458 #define HRT_ADDRESS_BYTES (HRT_ADDRESS_WIDTH / 8)
59+#define SIZEOF_HRT_REG (HRT_DATA_WIDTH >> 3)
6560
66−#if HRT_DATA_WIDTH == 64
67−typedef hive_uint64 hrt_data;
68−#elif HRT_DATA_WIDTH == 32
6961 typedef hive_uint32 hrt_data;
70−#else
71−#error data width not supported
72−#endif
73−
74−#if HRT_ADDRESS_WIDTH == 64
7562 typedef hive_uint64 hrt_address;
76−#elif HRT_ADDRESS_WIDTH == 32
77−typedef hive_uint32 hrt_address;
78−#else
79−#error adddres width not supported
80−#endif
8163
8264 /* use 64 bit addresses in simulation, where possible */
8365 typedef hive_uint64 hive_sim_address;
drivers/staging/media/atomisp/pci/hmm/hmm.c+5−5
@@ -735,11 +735,11 @@ ia_css_ptr hmm_host_vaddr_to_hrt_vaddr(const void *ptr) · 734 unmodified lines
735735
736736 void hmm_show_mem_stat(const char *func, const int line)
737737 {
738− trace_printk("tol_cnt=%d usr_size=%d res_size=%d res_cnt=%d sys_size=%d dyc_thr=%d dyc_size=%d.\n",
739− hmm_mem_stat.tol_cnt,
740− hmm_mem_stat.usr_size, hmm_mem_stat.res_size,
741− hmm_mem_stat.res_cnt, hmm_mem_stat.sys_size,
742− hmm_mem_stat.dyc_thr, hmm_mem_stat.dyc_size);
738+ pr_info("tol_cnt=%d usr_size=%d res_size=%d res_cnt=%d sys_size=%d dyc_thr=%d dyc_size=%d.\n",
739+ hmm_mem_stat.tol_cnt,
740+ hmm_mem_stat.usr_size, hmm_mem_stat.res_size,
741+ hmm_mem_stat.res_cnt, hmm_mem_stat.sys_size,
742+ hmm_mem_stat.dyc_thr, hmm_mem_stat.dyc_size);
743743 }
744744
745745 void hmm_init_mem_stat(int res_pgnr, int dyc_en, int dyc_pgnr)
drivers/staging/media/atomisp/pci/isp2400_system_global.h+0−302
@@ -13,306 +13,4 @@ · 12 unmodified lines
1313 * more details.
1414 */
1515
16−#ifndef __SYSTEM_GLOBAL_H_INCLUDED__
17−#define __SYSTEM_GLOBAL_H_INCLUDED__
18−
19−#include <hive_isp_css_defs.h>
20−#include <type_support.h>
21−
22−/*
23− * The longest allowed (uninteruptible) bus transfer, does not
24− * take stalling into account
25− */
26−#define HIVE_ISP_MAX_BURST_LENGTH 1024
27−
28−/*
29− * Maximum allowed burst length in words for the ISP DMA
30− */
31−#define ISP_DMA_MAX_BURST_LENGTH 128
32−
33−/*
34− * Create a list of HAS and IS properties that defines the system
35− *
36− * The configuration assumes the following
37− * - The system is hetereogeneous; Multiple cells and devices classes
38− * - The cell and device instances are homogeneous, each device type
39− * belongs to the same class
40− * - Device instances supporting a subset of the class capabilities are
41− * allowed
42− *
43− * We could manage different device classes through the enumerated
44− * lists (C) or the use of classes (C++), but that is presently not
45− * fully supported
46− *
47− * N.B. the 3 input formatters are of 2 different classess
48− */
49−
5016 #define USE_INPUT_SYSTEM_VERSION_2
51−
52−#define HAS_MMU_VERSION_2
53−#define HAS_DMA_VERSION_2
54−#define HAS_GDC_VERSION_2
55−#define HAS_VAMEM_VERSION_2
56−#define HAS_HMEM_VERSION_1
57−#define HAS_BAMEM_VERSION_2
58−#define HAS_IRQ_VERSION_2
59−#define HAS_IRQ_MAP_VERSION_2
60−#define HAS_INPUT_FORMATTER_VERSION_2
61−/* 2401: HAS_INPUT_SYSTEM_VERSION_2401 */
62−#define HAS_INPUT_SYSTEM_VERSION_2
63−#define HAS_BUFFERED_SENSOR
64−#define HAS_FIFO_MONITORS_VERSION_2
65−/* #define HAS_GP_REGS_VERSION_2 */
66−#define HAS_GP_DEVICE_VERSION_2
67−#define HAS_GPIO_VERSION_1
68−#define HAS_TIMED_CTRL_VERSION_1
69−#define HAS_RX_VERSION_2
70−
71−#define DMA_DDR_TO_VAMEM_WORKAROUND
72−#define DMA_DDR_TO_HMEM_WORKAROUND
73−
74−/*
75− * Semi global. "HRT" is accessible from SP, but the HRT types do not fully apply
76− */
77−#define HRT_VADDRESS_WIDTH 32
78−//#define HRT_ADDRESS_WIDTH 64 /* Surprise, this is a local property*/
79−#define HRT_DATA_WIDTH 32
80−
81−#define SIZEOF_HRT_REG (HRT_DATA_WIDTH >> 3)
82−#define HIVE_ISP_CTRL_DATA_BYTES (HIVE_ISP_CTRL_DATA_WIDTH / 8)
83−
84−/* The main bus connecting all devices */
85−#define HRT_BUS_WIDTH HIVE_ISP_CTRL_DATA_WIDTH
86−#define HRT_BUS_BYTES HIVE_ISP_CTRL_DATA_BYTES
87−
88−/* per-frame parameter handling support */
89−#define SH_CSS_ENABLE_PER_FRAME_PARAMS
90−
91−typedef u32 hrt_bus_align_t;
92−
93−/*
94− * Enumerate the devices, device access through the API is by ID, through the DLI by address
95− * The enumerator terminators are used to size the wiring arrays and as an exception value.
96− */
97−typedef enum {
98− DDR0_ID = 0,
99− N_DDR_ID
100−} ddr_ID_t;
101−
102−typedef enum {
103− ISP0_ID = 0,
104− N_ISP_ID
105−} isp_ID_t;
106−
107−typedef enum {
108− SP0_ID = 0,
109− N_SP_ID
110−} sp_ID_t;
111−
112−typedef enum {
113− MMU0_ID = 0,
114− MMU1_ID,
115− N_MMU_ID
116−} mmu_ID_t;
117−
118−typedef enum {
119− DMA0_ID = 0,
120− N_DMA_ID
121−} dma_ID_t;
122−
123−typedef enum {
124− GDC0_ID = 0,
125− GDC1_ID,
126− N_GDC_ID
127−} gdc_ID_t;
128−
129−#define N_GDC_ID_CPP 2 // this extra define is needed because we want to use it also in the preprocessor, and that doesn't work with enums.
130−
131−typedef enum {
132− VAMEM0_ID = 0,
133− VAMEM1_ID,
134− VAMEM2_ID,
135− N_VAMEM_ID
136−} vamem_ID_t;
137−
138−typedef enum {
139− BAMEM0_ID = 0,
140− N_BAMEM_ID
141−} bamem_ID_t;
142−
143−typedef enum {
144− HMEM0_ID = 0,
145− N_HMEM_ID
146−} hmem_ID_t;
147−
148−/*
149−typedef enum {
150− IRQ0_ID = 0,
151− N_IRQ_ID
152−} irq_ID_t;
153−*/
154−
155−typedef enum {
156− IRQ0_ID = 0, // GP IRQ block
157− IRQ1_ID, // Input formatter
158− IRQ2_ID, // input system
159− IRQ3_ID, // input selector
160− N_IRQ_ID
161−} irq_ID_t;
162−
163−typedef enum {
164− FIFO_MONITOR0_ID = 0,
165− N_FIFO_MONITOR_ID
166−} fifo_monitor_ID_t;
167−
168−/*
169− * Deprecated: Since all gp_reg instances are different
170− * and put in the address maps of other devices we cannot
171− * enumerate them as that assumes the instrances are the
172− * same.
173− *
174− * We define a single GP_DEVICE containing all gp_regs
175− * w.r.t. a single base address
176− *
177−typedef enum {
178− GP_REGS0_ID = 0,
179− N_GP_REGS_ID
180−} gp_regs_ID_t;
181− */
182−typedef enum {
183− GP_DEVICE0_ID = 0,
184− N_GP_DEVICE_ID
185−} gp_device_ID_t;
186−
187−typedef enum {
188− GP_TIMER0_ID = 0,
189− GP_TIMER1_ID,
190− GP_TIMER2_ID,
191− GP_TIMER3_ID,
192− GP_TIMER4_ID,
193− GP_TIMER5_ID,
194− GP_TIMER6_ID,
195− GP_TIMER7_ID,
196− N_GP_TIMER_ID
197−} gp_timer_ID_t;
198−
199−typedef enum {
200− GPIO0_ID = 0,
201− N_GPIO_ID
202−} gpio_ID_t;
203−
204−typedef enum {
205− TIMED_CTRL0_ID = 0,
206− N_TIMED_CTRL_ID
207−} timed_ctrl_ID_t;
208−
209−typedef enum {
210− INPUT_FORMATTER0_ID = 0,
211− INPUT_FORMATTER1_ID,
212− INPUT_FORMATTER2_ID,
213− INPUT_FORMATTER3_ID,
214− N_INPUT_FORMATTER_ID
215−} input_formatter_ID_t;
216−
217−/* The IF RST is outside the IF */
218−#define INPUT_FORMATTER0_SRST_OFFSET 0x0824
219−#define INPUT_FORMATTER1_SRST_OFFSET 0x0624
220−#define INPUT_FORMATTER2_SRST_OFFSET 0x0424
221−#define INPUT_FORMATTER3_SRST_OFFSET 0x0224
222−
223−#define INPUT_FORMATTER0_SRST_MASK 0x0001
224−#define INPUT_FORMATTER1_SRST_MASK 0x0002
225−#define INPUT_FORMATTER2_SRST_MASK 0x0004
226−#define INPUT_FORMATTER3_SRST_MASK 0x0008
227−
228−typedef enum {
229− INPUT_SYSTEM0_ID = 0,
230− N_INPUT_SYSTEM_ID
231−} input_system_ID_t;
232−
233−typedef enum {
234− RX0_ID = 0,
235− N_RX_ID
236−} rx_ID_t;
237−
238−enum mipi_port_id {
239− MIPI_PORT0_ID = 0,
240− MIPI_PORT1_ID,
241− MIPI_PORT2_ID,
242− N_MIPI_PORT_ID
243−};
244−
245−#define N_RX_CHANNEL_ID 4
246−
247−/* Generic port enumeration with an internal port type ID */
248−typedef enum {
249− CSI_PORT0_ID = 0,
250− CSI_PORT1_ID,
251− CSI_PORT2_ID,
252− TPG_PORT0_ID,
253− PRBS_PORT0_ID,
254− FIFO_PORT0_ID,
255− MEMORY_PORT0_ID,
256− N_INPUT_PORT_ID
257−} input_port_ID_t;
258−
259−typedef enum {
260− CAPTURE_UNIT0_ID = 0,
261− CAPTURE_UNIT1_ID,
262− CAPTURE_UNIT2_ID,
263− ACQUISITION_UNIT0_ID,
264− DMA_UNIT0_ID,
265− CTRL_UNIT0_ID,
266− GPREGS_UNIT0_ID,
267− FIFO_UNIT0_ID,
268− IRQ_UNIT0_ID,
269− N_SUB_SYSTEM_ID
270−} sub_system_ID_t;
271−
272−#define N_CAPTURE_UNIT_ID 3
273−#define N_ACQUISITION_UNIT_ID 1
274−#define N_CTRL_UNIT_ID 1
275−
276−enum ia_css_isp_memories {
277− IA_CSS_ISP_PMEM0 = 0,
278− IA_CSS_ISP_DMEM0,
279− IA_CSS_ISP_VMEM0,
280− IA_CSS_ISP_VAMEM0,
281− IA_CSS_ISP_VAMEM1,
282− IA_CSS_ISP_VAMEM2,
283− IA_CSS_ISP_HMEM0,
284− IA_CSS_SP_DMEM0,
285− IA_CSS_DDR,
286− N_IA_CSS_MEMORIES
287−};
288−
289−#define IA_CSS_NUM_MEMORIES 9
290−/* For driver compatibility */
291−#define N_IA_CSS_ISP_MEMORIES IA_CSS_NUM_MEMORIES
292−#define IA_CSS_NUM_ISP_MEMORIES IA_CSS_NUM_MEMORIES
293−
294−#if 0
295−typedef enum {
296− dev_chn, /* device channels, external resource */
297− ext_mem, /* external memories */
298− int_mem, /* internal memories */
299− int_chn /* internal channels, user defined */
300−} resource_type_t;
301−
302−/* if this enum is extended with other memory resources, pls also extend the function resource_to_memptr() */
303−typedef enum {
304− vied_nci_dev_chn_dma_ext0,
305− int_mem_vmem0,
306− int_mem_dmem0
307−} resource_id_t;
308−
309−/* enum listing the different memories within a program group.
310− This enum is used in the mem_ptr_t type */
311−typedef enum {
312− buf_mem_invalid = 0,
313− buf_mem_vmem_prog0,
314− buf_mem_dmem_prog0
315−} buf_mem_t;
316−
317−#endif
318−#endif /* __SYSTEM_GLOBAL_H_INCLUDED__ */
drivers/staging/media/atomisp/pci/isp2400_system_local.h+0−321
@@ -1,321 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
2−/*
3− * Support for Intel Camera Imaging ISP subsystem.
4− * Copyright (c) 2010-2015, Intel Corporation.
5− *
6− * This program is free software; you can redistribute it and/or modify it
7− * under the terms and conditions of the GNU General Public License,
8− * version 2, as published by the Free Software Foundation.
9− *
10− * This program is distributed in the hope it will be useful, but WITHOUT
11− * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12− * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13− * more details.
14− */
15−
16−#ifndef __SYSTEM_LOCAL_H_INCLUDED__
17−#define __SYSTEM_LOCAL_H_INCLUDED__
18−
19−#ifdef HRT_ISP_CSS_CUSTOM_HOST
20−#ifndef HRT_USE_VIR_ADDRS
21−#define HRT_USE_VIR_ADDRS
22−#endif
23−#endif
24−
25−#include "system_global.h"
26−
27−/* HRT assumes 32 by default (see Linux/include/hive_types.h), overrule it in case it is different */
28−#undef HRT_ADDRESS_WIDTH
29−#define HRT_ADDRESS_WIDTH 64 /* Surprise, this is a local property */
30−
31−/* This interface is deprecated */
32−#include "hive_types.h"
33−
34−/*
35− * Cell specific address maps
36− */
37−#if HRT_ADDRESS_WIDTH == 64
38−
39−#define GP_FIFO_BASE ((hrt_address)0x0000000000090104) /* This is NOT a base address */
40−
41−/* DDR */
42−static const hrt_address DDR_BASE[N_DDR_ID] = {
43− (hrt_address)0x0000000120000000ULL
44−};
45−
46−/* ISP */
47−static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = {
48− (hrt_address)0x0000000000020000ULL
49−};
50−
51−static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = {
52− (hrt_address)0x0000000000200000ULL
53−};
54−
55−static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = {
56− (hrt_address)0x0000000000100000ULL
57−};
58−
59−static const hrt_address ISP_VAMEM_BASE[N_VAMEM_ID] = {
60− (hrt_address)0x00000000001C0000ULL,
61− (hrt_address)0x00000000001D0000ULL,
62− (hrt_address)0x00000000001E0000ULL
63−};
64−
65−static const hrt_address ISP_HMEM_BASE[N_HMEM_ID] = {
66− (hrt_address)0x00000000001F0000ULL
67−};
68−
69−/* SP */
70−static const hrt_address SP_CTRL_BASE[N_SP_ID] = {
71− (hrt_address)0x0000000000010000ULL
72−};
73−
74−static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
75− (hrt_address)0x0000000000300000ULL
76−};
77−
78−static const hrt_address SP_PMEM_BASE[N_SP_ID] = {
79− (hrt_address)0x00000000000B0000ULL
80−};
81−
82−/* MMU */
83−/*
84− * MMU0_ID: The data MMU
85− * MMU1_ID: The icache MMU
86− */
87−static const hrt_address MMU_BASE[N_MMU_ID] = {
88− (hrt_address)0x0000000000070000ULL,
89− (hrt_address)0x00000000000A0000ULL
90−};
91−
92−/* DMA */
93−static const hrt_address DMA_BASE[N_DMA_ID] = {
94− (hrt_address)0x0000000000040000ULL
95−};
96−
97−/* IRQ */
98−static const hrt_address IRQ_BASE[N_IRQ_ID] = {
99− (hrt_address)0x0000000000000500ULL,
100− (hrt_address)0x0000000000030A00ULL,
101− (hrt_address)0x000000000008C000ULL,
102− (hrt_address)0x0000000000090200ULL
103−};
104−
105−/*
106− (hrt_address)0x0000000000000500ULL};
107− */
108−
109−/* GDC */
110−static const hrt_address GDC_BASE[N_GDC_ID] = {
111− (hrt_address)0x0000000000050000ULL,
112− (hrt_address)0x0000000000060000ULL
113−};
114−
115−/* FIFO_MONITOR (not a subset of GP_DEVICE) */
116−static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = {
117− (hrt_address)0x0000000000000000ULL
118−};
119−
120−/*
121−static const hrt_address GP_REGS_BASE[N_GP_REGS_ID] = {
122− (hrt_address)0x0000000000000000ULL};
123−
124−static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
125− (hrt_address)0x0000000000090000ULL};
126−*/
127−
128−/* GP_DEVICE (single base for all separate GP_REG instances) */
129−static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
130− (hrt_address)0x0000000000000000ULL
131−};
132−
133−/*GP TIMER , all timer registers are inter-twined,
134− * so, having multiple base addresses for
135− * different timers does not help*/
136−static const hrt_address GP_TIMER_BASE =
137− (hrt_address)0x0000000000000600ULL;
138−/* GPIO */
139−static const hrt_address GPIO_BASE[N_GPIO_ID] = {
140− (hrt_address)0x0000000000000400ULL
141−};
142−
143−/* TIMED_CTRL */
144−static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = {
145− (hrt_address)0x0000000000000100ULL
146−};
147−
148−/* INPUT_FORMATTER */
149−static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = {
150− (hrt_address)0x0000000000030000ULL,
151− (hrt_address)0x0000000000030200ULL,
152− (hrt_address)0x0000000000030400ULL,
153− (hrt_address)0x0000000000030600ULL
154−}; /* memcpy() */
155−
156−/* INPUT_SYSTEM */
157−static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = {
158− (hrt_address)0x0000000000080000ULL
159−};
160−
161−/* (hrt_address)0x0000000000081000ULL, */ /* capture A */
162−/* (hrt_address)0x0000000000082000ULL, */ /* capture B */
163−/* (hrt_address)0x0000000000083000ULL, */ /* capture C */
164−/* (hrt_address)0x0000000000084000ULL, */ /* Acquisition */
165−/* (hrt_address)0x0000000000085000ULL, */ /* DMA */
166−/* (hrt_address)0x0000000000089000ULL, */ /* ctrl */
167−/* (hrt_address)0x000000000008A000ULL, */ /* GP regs */
168−/* (hrt_address)0x000000000008B000ULL, */ /* FIFO */
169−/* (hrt_address)0x000000000008C000ULL, */ /* IRQ */
170−
171−/* RX, the MIPI lane control regs start at offset 0 */
172−static const hrt_address RX_BASE[N_RX_ID] = {
173− (hrt_address)0x0000000000080100ULL
174−};
175−
176−#elif HRT_ADDRESS_WIDTH == 32
177−
178−#define GP_FIFO_BASE ((hrt_address)0x00090104) /* This is NOT a base address */
179−
180−/* DDR : Attention, this value not defined in 32-bit */
181−static const hrt_address DDR_BASE[N_DDR_ID] = {
182− (hrt_address)0x00000000UL
183−};
184−
185−/* ISP */
186−static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = {
187− (hrt_address)0x00020000UL
188−};
189−
190−static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = {
191− (hrt_address)0x00200000UL
192−};
193−
194−static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = {
195− (hrt_address)0x100000UL
196−};
197−
198−static const hrt_address ISP_VAMEM_BASE[N_VAMEM_ID] = {
199− (hrt_address)0xffffffffUL,
200− (hrt_address)0xffffffffUL,
201− (hrt_address)0xffffffffUL
202−};
203−
204−static const hrt_address ISP_HMEM_BASE[N_HMEM_ID] = {
205− (hrt_address)0xffffffffUL
206−};
207−
208−/* SP */
209−static const hrt_address SP_CTRL_BASE[N_SP_ID] = {
210− (hrt_address)0x00010000UL
211−};
212−
213−static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
214− (hrt_address)0x00300000UL
215−};
216−
217−static const hrt_address SP_PMEM_BASE[N_SP_ID] = {
218− (hrt_address)0x000B0000UL
219−};
220−
221−/* MMU */
222−/*
223− * MMU0_ID: The data MMU
224− * MMU1_ID: The icache MMU
225− */
226−static const hrt_address MMU_BASE[N_MMU_ID] = {
227− (hrt_address)0x00070000UL,
228− (hrt_address)0x000A0000UL
229−};
230−
231−/* DMA */
232−static const hrt_address DMA_BASE[N_DMA_ID] = {
233− (hrt_address)0x00040000UL
234−};
235−
236−/* IRQ */
237−static const hrt_address IRQ_BASE[N_IRQ_ID] = {
238− (hrt_address)0x00000500UL,
239− (hrt_address)0x00030A00UL,
240− (hrt_address)0x0008C000UL,
241− (hrt_address)0x00090200UL
242−};
243−
244−/*
245− (hrt_address)0x00000500UL};

76 more lines aren’t shown here.

drivers/staging/media/atomisp/pci/isp2401_system_global.h+1−409

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

drivers/staging/media/atomisp/pci/isp2401_system_local.h+0−402

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

drivers/staging/media/atomisp/pci/sh_css.c+7−2

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

drivers/staging/media/atomisp/pci/system_global.h+395−0

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

drivers/staging/media/atomisp/pci/system_local.c+179−0

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

drivers/staging/media/atomisp/pci/system_local.h+98−6

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

drivers/staging/wlan-ng/prism2usb.c+15−1

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

drivers/thermal/intel/int340x_thermal/int3400_thermal.c+6−1

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

drivers/thermal/intel/int340x_thermal/int3403_thermal.c+1−1

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

drivers/thermal/mtk_thermal.c+2−4

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

drivers/thunderbolt/tunnel.c+6−6

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

drivers/tty/serial/8250/8250_core.c+1−1

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

drivers/tty/serial/8250/8250_exar.c+11−1

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

drivers/tty/serial/8250/8250_mtk.c+18−0

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

drivers/tty/serial/cpm_uart/cpm_uart_core.c+8−1

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

drivers/tty/serial/mxs-auart.c+8−4

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

drivers/tty/serial/serial-tegra.c+7−9

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

drivers/tty/serial/serial_core.c+17−98

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

drivers/tty/serial/sh-sci.c+3−0

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

drivers/tty/serial/xilinx_uartps.c+6−3

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

drivers/tty/vt/vt.c+18−11

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

drivers/uio/uio_pdrv_genirq.c+2−2

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

drivers/usb/c67x00/c67x00-sched.c+1−1

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

drivers/usb/cdns3/ep0.c+15−15

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

drivers/usb/cdns3/trace.h+3−3

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

drivers/usb/chipidea/core.c+24−0

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

drivers/usb/dwc2/platform.c+2−1

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

drivers/usb/dwc3/dwc3-pci.c+8−0

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

drivers/usb/gadget/function/f_uac1_legacy.c+2−0

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

drivers/usb/gadget/udc/atmel_usba_udc.c+2−8

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

drivers/usb/gadget/udc/gr_udc.c+5−2

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

drivers/usb/gadget/usbstring.c+1−1

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

drivers/usb/host/xhci-mtk-sch.c+4−0

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

drivers/usb/host/xhci-pci.c+3−0

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

drivers/usb/host/xhci-tegra.c+1−1

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

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

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

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

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

drivers/usb/serial/cypress_m8.h+3−0

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

drivers/usb/serial/iuu_phoenix.c+5−3

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

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

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

drivers/vfio/pci/vfio_pci.c+5−0

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

drivers/vhost/scsi.c+1−1

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

drivers/video/fbdev/core/bitblit.c+2−2

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

drivers/video/fbdev/core/fbcon_ccw.c+2−2

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

drivers/video/fbdev/core/fbcon_cw.c+2−2

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

drivers/video/fbdev/core/fbcon_ud.c+2−2

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

drivers/virt/vboxguest/vboxguest_core.c+4−2

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

drivers/virt/vboxguest/vboxguest_core.h+15−0

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

drivers/virt/vboxguest/vboxguest_linux.c+2−1

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

drivers/virt/vboxguest/vmmdev.h+2−0

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

drivers/virtio/Kconfig+1−1

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

drivers/virtio/virtio_balloon.c+10−1

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

drivers/virtio/virtio_mmio.c+2−2

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

drivers/xen/xenbus/xenbus_client.c+1−3

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

fs/afs/fs_operation.c+2−2

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

fs/afs/write.c+1−0

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

fs/autofs/waitq.c+1−1

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

fs/btrfs/backref.c+1−0

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

fs/btrfs/discard.c+1−0

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

fs/btrfs/extent_io.c+2−1

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

fs/btrfs/file.c+1−0

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

fs/btrfs/inode.c+11−21

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

fs/btrfs/volumes.c+8−0

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

fs/cachefiles/rdwr.c+1−1

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

fs/cifs/cifsfs.h+1−1

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

fs/cifs/file.c+6−13

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

fs/cifs/inode.c+2−8

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

fs/cifs/ioctl.c+8−1

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

fs/cifs/smb2misc.c+6−2

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

fs/cifs/smb2ops.c+1−1

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

fs/efivarfs/super.c+3−3

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

fs/exfat/dir.c+1−1

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

fs/exfat/exfat_fs.h+1−1

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

fs/exfat/file.c+1−1

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

fs/exfat/nls.c+4−4

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

fs/fuse/file.c+78−54

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

fs/fuse/inode.c+16−3

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

fs/gfs2/aops.c+1−44

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

fs/gfs2/file.c+50−2

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

fs/io_uring.c+76−36

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

fs/namespace.c+1−0

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

fs/nfs/direct.c+4−9

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

fs/nfs/file.c+0−1

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

fs/nfs/nfs4proc.c+18−2

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

fs/nfsd/nfs4state.c+19−1

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

fs/overlayfs/copy_up.c+1−1

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

fs/overlayfs/export.c+1−1

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

fs/overlayfs/file.c+6−4

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

fs/overlayfs/namei.c+6−9

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

fs/overlayfs/overlayfs.h+0−1

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

fs/overlayfs/super.c+49−24

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

fs/read_write.c+75−56

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

fs/squashfs/block.c+1−1

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

fs/zonefs/super.c+11−7

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

include/asm-generic/io.h+2−2

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

include/asm-generic/mmiowb.h+4−2

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

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

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

include/drm/drm_mode_config.h+12−0

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

include/linux/bits.h+1−2

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

include/linux/bpf-netns.h+3−2

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

include/linux/bpf.h+11−2

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

include/linux/btf.h+5−0

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

include/linux/cgroup-defs.h+6−2

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

include/linux/cgroup.h+3−1

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

include/linux/compiler-gcc.h+1−1

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

include/linux/compiler_types.h+1−26

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

include/linux/device-mapper.h+1−0

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

include/linux/device.h+3−2

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

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

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

include/linux/dma-direct.h+2−0

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

include/linux/dma-mapping.h+5−0

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

include/linux/efi.h+1−0

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

include/linux/filter.h+2−2

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

include/linux/fs.h+2−1

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

include/linux/fs_context.h+1−0

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

include/linux/i2c.h+2−2

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

include/linux/ieee80211.h+4−0

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

include/linux/if_vlan.h+22−7

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

include/linux/input/elan-i2c-ids.h+7−0

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

include/linux/io-mapping.h+4−1

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

include/linux/kallsyms.h+3−2

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

include/linux/kgdb.h+12−0

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

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

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

include/linux/mlx5/mlx5_ifc.h+29−0

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

include/linux/mod_devicetable.h+1−1

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

include/linux/random.h+3−0

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

include/linux/rhashtable.h+32−39

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

include/linux/scatterlist.h+4−4

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

include/linux/sched.h+0−4

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

include/linux/serial_core.h+98−4

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

include/linux/skmsg.h+13−0

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

include/linux/tcp.h+4−2

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

include/linux/xattr.h+2−1

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

include/net/addrconf.h+1−0

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

include/net/devlink.h+3−0

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

include/net/dst.h+9−1

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

include/net/flow_dissector.h+2−1

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

include/net/flow_offload.h+0−1

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

include/net/genetlink.h+0−10

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

include/net/inet_ecn.h+17−8

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

include/net/ip_tunnels.h+3−0

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

include/net/netns/bpf.h+5−2

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

include/net/pkt_sched.h+0−11

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

include/net/sock.h+2−1

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

include/net/xfrm.h+9−6

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

include/net/xsk_buff_pool.h+3−3

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

include/rdma/rdmavt_qp.h+19−0

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

include/sound/compress_driver.h+9−1

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

include/sound/rt5670.h+1−0

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

include/sound/soc-dai.h+1−0

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

include/sound/soc.h+2−0

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

include/uapi/linux/bpf.h+21−20

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

include/uapi/linux/idxd.h+3−0

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

include/uapi/linux/input-event-codes.h+2−1

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

include/uapi/linux/io_uring.h+1−0

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

include/uapi/linux/vboxguest.h+2−2

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

kernel/audit.c+0−1

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

kernel/audit.h+0−8

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

kernel/auditsc.c+3−0

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

kernel/bpf/btf.c+7−2

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

kernel/bpf/hashtab.c+9−3

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

kernel/bpf/net_namespace.c+134−60

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

kernel/bpf/reuseport_array.c+10−4

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

kernel/bpf/ringbuf.c+8−10

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

kernel/bpf/syscall.c+24−21

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

kernel/bpf/verifier.c+10−3

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

kernel/cgroup/cgroup.c+19−12

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

kernel/debug/gdbstub.c+13−0

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

kernel/dma/direct.c+7−1

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

kernel/dma/mapping.c+10−0

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

kernel/dma/pool.c+56−31

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

kernel/events/uprobes.c+1−1

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

kernel/irq/manage.c+35−2

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

kernel/kallsyms.c+11−6

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

kernel/kprobes.c+2−2

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

kernel/module.c+27−24

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

kernel/sched/core.c+58−16

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

kernel/sched/fair.c+13−2

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

kernel/signal.c+1−1

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

kernel/time/timer.c+24−5

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

lib/Kconfig.kgdb+5−0

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

lib/packing.c+1−0

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

lib/random32.c+1−1

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

lib/rhashtable.c+16−19

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

mm/filemap.c+21−2

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

mm/hugetlb.c+10−5

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

mm/khugepaged.c+3−0

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

mm/memcontrol.c+10−3

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

mm/memory.c+1−1

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

mm/migrate.c+1−12

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

mm/mmap.c+14−2

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

mm/mremap.c+21−2

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

mm/shmem.c+1−1

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

mm/slab_common.c+28−7

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

net/8021q/vlan_dev.c+4−5

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

net/9p/trans_fd.c+30−9

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

net/ax25/af_ax25.c+8−2

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

net/bluetooth/hci_event.c+19−7

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

net/bpf/test_run.c+18−1

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

net/bpfilter/bpfilter_kern.c+2−2

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

net/bridge/br_mrp.c+1−1

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

net/bridge/br_multicast.c+1−1

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

net/bridge/br_private.h+1−1

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

net/bridge/br_private_mrp.h+1−1

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

net/compat.c+1−1

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

net/core/dev.c+1−1

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

net/core/dev_addr_lists.c+10−0

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

net/core/devlink.c+19−6

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

net/core/filter.c+7−3

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

net/core/flow_dissector.c+12−20

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

net/core/flow_offload.c+1−0

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

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

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

net/core/rtnetlink.c+2−1

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

net/core/skmsg.c+15−8

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

net/core/sock.c+1−1

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

net/core/sock_map.c+48−5

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

net/core/sock_reuseport.c+1−0

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

net/core/sysctl_net_core.c+1−1

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

net/ethtool/netlink.c+13−14

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

net/hsr/hsr_device.c+7−4

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

net/hsr/hsr_forward.c+13−5

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

net/hsr/hsr_framereg.c+2−1

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

net/ipv4/fib_trie.c+1−1

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

net/ipv4/icmp.c+2−2

This diff is large: its 21 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_core.c+18−0

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

net/ipv4/ip_vti.c+1−0

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

net/ipv4/ipip.c+1−0

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

net/ipv4/ping.c+3−0

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

net/ipv4/route.c+1−1

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

net/ipv4/tcp.c+10−7

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

net/ipv4/tcp_cong.c+1−1

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

net/ipv4/tcp_input.c+8−5

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

net/ipv4/tcp_ipv4.c+16−4

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

net/ipv4/tcp_output.c+13−8

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

net/ipv4/udp.c+10−7

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

net/ipv6/anycast.c+12−5

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

net/ipv6/esp6.c+10−3

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

net/ipv6/icmp.c+2−2

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

net/ipv6/ip6_gre.c+6−5

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

net/ipv6/ip6_tunnel.c+1−0

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

net/ipv6/ip6_vti.c+1−0

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

net/ipv6/ipv6_sockglue.c+1−0

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

net/ipv6/route.c+9−6

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

net/ipv6/sit.c+1−0

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

net/ipv6/udp.c+10−7

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

net/key/af_key.c+9−2

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

net/l2tp/l2tp_core.c+1−4

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

net/llc/af_llc.c+7−3

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

net/mac80211/cfg.c+1−0

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

net/mac80211/mesh.c+13−0

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

net/mac80211/mesh_hwmp.c+2−5

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

net/mac80211/mesh_pathtbl.c+1−0

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

net/mac80211/rx.c+26−0

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

net/mac80211/sta_info.c+1−3

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

net/mac80211/status.c+15−7

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

net/mac80211/tx.c+10−5

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

net/mac80211/util.c+4−0

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

net/mptcp/options.c+3−3

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

net/mptcp/protocol.c+1−1

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

net/netfilter/ipset/ip_set_bitmap_ip.c+1−1

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

net/netfilter/ipset/ip_set_bitmap_ipmac.c+1−1

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

net/netfilter/ipset/ip_set_bitmap_port.c+1−1

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

net/netfilter/ipset/ip_set_hash_gen.h+2−2

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

net/netfilter/ipvs/ip_vs_sync.c+8−4

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

net/netfilter/nf_conntrack_core.c+2−0

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

net/netfilter/nf_tables_api.c+14−27

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

net/netlink/genetlink.c+13−84

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

net/nfc/nci/core.c+4−1

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

net/qrtr/qrtr.c+9−2

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

net/rds/connection.c+11−0

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

net/rds/rds.h+7−0

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

net/rds/recv.c+2−1

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

net/rds/send.c+2−1

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

net/rxrpc/call_object.c+19−8

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

net/rxrpc/conn_object.c+5−3

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

net/rxrpc/recvmsg.c+2−2

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

net/rxrpc/sendmsg.c+4−1

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

net/sched/act_connmark.c+6−3

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

net/sched/act_csum.c+1−1

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

net/sched/act_ct.c+22−9

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

net/sched/act_ctinfo.c+6−3

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

net/sched/act_mpls.c+1−1

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

net/sched/act_skbedit.c+1−1

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

net/sched/cls_api.c+1−2

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

net/sched/cls_flow.c+4−4

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

net/sched/cls_flower.c+1−1

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

net/sched/em_ipset.c+1−1

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

net/sched/em_ipt.c+1−1

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

net/sched/em_meta.c+1−1

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

net/sched/sch_atm.c+4−4

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

net/sched/sch_cake.c+2−2

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

net/sched/sch_dsmark.c+3−3

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

net/sched/sch_teql.c+1−1

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

net/sctp/stream.c+18−9

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

net/smc/af_smc.c+8−4

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

net/smc/smc_cdc.c+5−1

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

net/smc/smc_clc.c+32−13

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

net/smc/smc_clc.h+2−0

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

net/smc/smc_core.c+41−95

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

net/smc/smc_core.h+8−1

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

net/smc/smc_ib.c+19−8

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

net/smc/smc_ib.h+3−1

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

net/smc/smc_ism.c+6−5

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

net/smc/smc_ism.h+2−1

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

net/smc/smc_llc.c+138−74

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

net/smc/smc_llc.h+1−1

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

net/smc/smc_pnet.c+19−18

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

net/smc/smc_wr.c+6−4

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

net/sunrpc/xprtrdma/rpc_rdma.c+2−2

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

net/sunrpc/xprtrdma/transport.c+5−0

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

net/sunrpc/xprtrdma/verbs.c+16−19

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

net/tipc/link.c+19−9

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

net/vmw_vsock/virtio_transport.c+1−1

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

net/wireless/nl80211.c+6−5

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

net/xdp/xsk_buff_pool.c+4−50

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

net/xfrm/espintcp.c+47−15

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

net/xfrm/xfrm_interface.c+2−0

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

net/xfrm/xfrm_policy.c+18−25

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

net/xfrm/xfrm_user.c+11−7

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

scripts/Makefile.extrawarn+2−0

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

scripts/Makefile.modpost+0−3

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

scripts/decode_stacktrace.sh+2−2

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

scripts/gdb/linux/symbols.py+1−1

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

scripts/kconfig/.gitignore+1−1

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

scripts/kconfig/Makefile+8−5

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

scripts/kconfig/qconf.cc+6−17

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

scripts/kconfig/qconf.h+0−4

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

scripts/mod/modpost.c+11−2

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

security/integrity/iint.c+1−13

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

sound/core/compress_offload.c+4−0

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

sound/core/info.c+3−1

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

sound/drivers/opl3/opl3_synth.c+2−0

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

sound/pci/hda/hda_auto_parser.c+6−0

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

sound/pci/hda/hda_codec.c+8−0

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

sound/pci/hda/hda_controller.h+1−1

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

sound/pci/hda/hda_intel.c+14−3

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

sound/pci/hda/patch_hdmi.c+27−16

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

sound/pci/hda/patch_realtek.c+90−5

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

sound/soc/amd/raven/pci-acp3x.c+1−3

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

sound/soc/amd/renoir/Makefile+4−3

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

sound/soc/codecs/max98373.c+0−8

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

sound/soc/codecs/rt286.c+4−4

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

sound/soc/codecs/rt5670.c+58−17

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

sound/soc/codecs/rt5670.h+1−1

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

sound/soc/codecs/rt5682.c+37−18

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

sound/soc/codecs/wm8974.c+5−1

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

sound/soc/fsl/fsl_mqs.c+14−9

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

sound/soc/generic/audio-graph-card.c+2−2

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

sound/soc/generic/simple-card.c+2−2

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

sound/soc/intel/boards/bdw-rt5677.c+1−0

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

sound/soc/intel/boards/bytcht_es8316.c+3−1

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

sound/soc/intel/boards/cht_bsw_rt5672.c+11−12

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

sound/soc/qcom/Kconfig+1−1

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

sound/soc/rockchip/rk3399_gru_sound.c+13−0

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

sound/soc/soc-core.c+27−0

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

sound/soc/soc-dai.c+38−0

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

sound/soc/soc-devres.c+5−3

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

sound/soc/soc-generic-dmaengine-pcm.c+1−1

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

sound/soc/soc-topology.c+18−6

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

sound/soc/sof/core.c+5−5

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

sound/soc/sof/imx/imx8.c+8−0

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

sound/soc/sof/imx/imx8m.c+8−0

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

sound/usb/card.h+3−3

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

sound/usb/endpoint.c+9−9

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

sound/usb/line6/capture.c+2−0

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

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

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

sound/usb/line6/playback.c+2−0

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

sound/usb/midi.c+12−5

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

sound/usb/pcm.c+2−0

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

sound/usb/quirks-table.h+52−0

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

tools/arch/x86/include/uapi/asm/kvm.h+3−2

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

tools/include/linux/bits.h+1−2

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

tools/include/uapi/linux/bpf.h+21−20

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

tools/lib/bpf/bpf.h+2−0

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

tools/lib/bpf/hashmap.h+8−4

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

tools/lib/bpf/libbpf.c+8−2

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

tools/lib/subcmd/parse-options.c+3−0

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

tools/lib/traceevent/event-parse.c+1−0

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

tools/lib/traceevent/plugins/Makefile+1−1

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

tools/perf/pmu-events/arch/s390/cf_z15/extended.json+1−1

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

tools/perf/tests/shell/record+zstd_comp_decomp.sh+2−1

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

tools/perf/util/hashmap.h+8−4

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

tools/testing/selftests/bpf/prog_tests/btf_map_in_map.c+110−14

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

tools/testing/selftests/bpf/prog_tests/fentry_fexit.c+1−1

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

tools/testing/selftests/bpf/prog_tests/flow_dissector.c+2−2

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

tools/testing/selftests/bpf/prog_tests/flow_dissector_reattach.c+34−10

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

tools/testing/selftests/bpf/progs/bpf_iter_netlink.c+1−1

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

tools/testing/selftests/bpf/progs/fentry_test.c+22−0

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

tools/testing/selftests/bpf/progs/fexit_test.c+22−0

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

tools/testing/selftests/bpf/progs/test_sockmap_kern.h+7−1

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

tools/testing/selftests/bpf/progs/test_xdp_with_devmap_helpers.c+1−1

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

tools/testing/selftests/bpf/test_maps.c+6−6

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

tools/testing/selftests/bpf/test_offload.py+3−0

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

tools/testing/selftests/bpf/test_sockmap.c+18−0

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

tools/testing/selftests/bpf/verifier/event_output.c+1−0

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

tools/testing/selftests/kmod/kmod.sh+36−0

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

tools/testing/selftests/kselftest.h+1−1

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

tools/testing/selftests/kvm/x86_64/vmx_set_nested_state_test.c+33−9

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

tools/testing/selftests/net/fib_nexthop_multiprefix.sh+1−1

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

tools/testing/selftests/net/fib_nexthops.sh+13−0

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

tools/testing/selftests/net/forwarding/ethtool.sh+0−2

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

tools/testing/selftests/net/ip_defrag.sh+2−0

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

tools/testing/selftests/net/psock_fanout.c+2−1

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

tools/testing/selftests/net/rxtimestamp.c+1−2

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

tools/testing/selftests/net/so_txtime.c+1−1

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

tools/testing/selftests/net/tcp_mmap.c+3−3

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

tools/testing/selftests/net/txtimestamp.sh+1−1

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

tools/testing/selftests/powerpc/nx-gzip/gunz_test.c+2−2

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

tools/testing/selftests/powerpc/nx-gzip/gzfht_test.c+2−2

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

tools/testing/selftests/tpm2/test_smoke.sh+2−2

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

tools/testing/selftests/tpm2/test_space.sh+1−1

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

tools/testing/selftests/tpm2/tpm2.py+29−27

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

tools/testing/selftests/tpm2/tpm2_tests.py+20−19

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