History

Merge 5.3-rc4 into char-misc-next

We need the char-misc fixes in here as well.

Greg Kroah-Hartman committed 7 years ago

Commit 77e38c12 parents cec2cae d45331b807 files · +8117 −4484Browse files

Unified · Split

807 files
  1. Documentation/admin-guide/hw-vuln/spectre.rst +80 −8
  2. Documentation/admin-guide/kernel-parameters.txt +4 −4
  3. Documentation/devicetree/bindings/riscv/cpus.txt +0 −162
  4. Documentation/devicetree/bindings/riscv/cpus.yaml +16 −0
  5. Documentation/devicetree/bindings/riscv/sifive.yaml +1 −1
  6. Documentation/devicetree/bindings/spi/spi-controller.yaml +0 −1
  7. Documentation/filesystems/cifs/TODO +16 −10
  8. Documentation/networking/tls-offload.rst +17 −6
  9. Documentation/vm/hmm.rst +1 −1
  10. MAINTAINERS +18 −12
  11. Makefile +20 −7
  12. arch/arm/include/asm/dma-mapping.h +3 −1
  13. arch/arm/kernel/hw_breakpoint.c +5 −0
  14. arch/arm/kernel/signal.c +1 −0
  15. arch/arm/kvm/coproc.c +15 −8
  16. arch/arm/mach-ep93xx/crunch.c +1 −0
  17. arch/arm/mach-tegra/reset.c +1 −1
  18. arch/arm/mm/Kconfig +5 −0
  19. arch/arm/mm/alignment.c +3 −1
  20. arch/arm/mm/dma-mapping.c +61 −0
  21. arch/arm/mm/init.c +5 −0
  22. arch/arm/plat-omap/dma.c +5 −9
  23. arch/arm64/Makefile +1 −1
  24. arch/arm64/include/asm/arch_gicv3.h +6 −0
  25. arch/arm64/include/asm/cpufeature.h +4 −3
  26. arch/arm64/include/asm/daifflags.h +2 −0
  27. arch/arm64/include/asm/efi.h +5 −1
  28. arch/arm64/include/asm/kvm_arm.h +4 −3
  29. arch/arm64/include/asm/memory.h +7 −3
  30. arch/arm64/include/asm/pgtable.h +7 −4
  31. arch/arm64/include/asm/ptrace.h +1 −1
  32. arch/arm64/include/asm/vdso/compat_gettimeofday.h +40 −0
  33. arch/arm64/kernel/cpufeature.c +6 −2
  34. arch/arm64/kernel/debug-monitors.c +8 −6
  35. arch/arm64/kernel/hw_breakpoint.c +8 −3
  36. arch/arm64/kernel/module.c +4 −0
  37. arch/arm64/kernel/probes/kprobes.c +6 −34
  38. arch/arm64/kernel/return_address.c +3 −0
  39. arch/arm64/kernel/smp.c +1 −1
  40. arch/arm64/kernel/stacktrace.c +3 −0
  41. arch/arm64/kernel/traps.c +1 −0
  42. arch/arm64/kvm/hyp/debug-sr.c +30 −0
  43. arch/arm64/kvm/regmap.c +5 −0
  44. arch/arm64/kvm/sys_regs.c +18 −14
  45. arch/arm64/mm/fault.c +49 −8
  46. arch/mips/cavium-octeon/octeon-usb.c +1 −0
  47. arch/mips/kernel/cacheinfo.c +2 −0
  48. arch/mips/kernel/i8253.c +2 −1
  49. arch/mips/kvm/emulate.c +1 −0
  50. arch/mips/kvm/mips.c +0 −10
  51. arch/mips/oprofile/op_model_mipsxx.c +13 −0
  52. arch/mips/pci/ops-bcm63xx.c +1 −0
  53. arch/mips/vdso/vdso.h +1 −0
  54. arch/parisc/Makefile +3 −2
  55. arch/parisc/boot/compressed/Makefile +3 −1
  56. arch/parisc/boot/compressed/vmlinux.lds.S +2 −2
  57. arch/parisc/configs/defconfig +0 −0
  58. arch/parisc/kernel/ftrace.c +2 −1
  59. arch/parisc/math-emu/Makefile +1 −0
  60. arch/parisc/mm/fault.c +1 −0
  61. arch/powerpc/include/asm/cache.h +4 −4
  62. arch/powerpc/include/asm/unistd.h +1 −0
  63. arch/powerpc/kernel/align.c +4 −0
  64. arch/powerpc/kernel/entry_32.S +8 −0
  65. arch/powerpc/kernel/entry_64.S +5 −0
  66. arch/powerpc/kernel/syscalls/syscall.tbl +1 −1
  67. arch/powerpc/kvm/book3s_32_mmu.c +1 −0
  68. arch/powerpc/kvm/powerpc.c +5 −10
  69. arch/powerpc/mm/kasan/kasan_init_32.c +5 −2
  70. arch/powerpc/platforms/pseries/papr_scm.c +27 −2
  71. arch/riscv/boot/dts/sifive/fu540-c000.dtsi +0 −1
  72. arch/riscv/configs/defconfig +5 −5
  73. arch/riscv/kernel/vdso/Makefile +1 −1
  74. arch/riscv/lib/Makefile +0 −2
  75. arch/riscv/lib/delay.c +5 −1
  76. arch/riscv/lib/udivdi3.S +0 −32
  77. arch/s390/boot/boot.h +1 −0
  78. arch/s390/boot/ipl_parm.c +0 −2
  79. arch/s390/boot/kaslr.c +1 −0
  80. arch/s390/configs/debug_defconfig +199 −131
  81. arch/s390/configs/defconfig +150 −83
  82. arch/s390/configs/zfcpdump_defconfig +17 −14
  83. arch/s390/include/asm/qdio.h +5 −5
  84. arch/s390/include/asm/setup.h +1 −0
  85. arch/s390/kernel/dumpstack.c +1 −5
  86. arch/s390/kernel/head64.S +0 −7
  87. arch/s390/kernel/ipl.c +0 −9
  88. arch/s390/kernel/machine_kexec_reloc.c +1 −0
  89. arch/s390/kernel/perf_cpum_cf_diag.c +1 −1
  90. arch/s390/kernel/setup.c +1 −2
  91. arch/s390/kernel/vdso.c +0 −5
  92. arch/s390/kernel/vmlinux.lds.S +4 −6
  93. arch/s390/kvm/kvm-s390.c +0 −10
  94. arch/s390/lib/xor.c +1 −0
  95. arch/s390/mm/dump_pagetables.c +6 −6
  96. arch/s390/mm/fault.c +3 −0
  97. arch/s390/mm/gmap.c +2 −2
  98. arch/s390/scripts/Makefile.chkbss +1 −2
  99. arch/x86/boot/string.c +8 −0
  100. arch/x86/entry/calling.h +17 −0
  101. arch/x86/entry/entry_64.S +18 −3
  102. arch/x86/include/asm/cpufeatures.h +3 −0
  103. arch/x86/include/asm/kvm_host.h +3 −0
  104. arch/x86/include/asm/vdso/gettimeofday.h +36 −0
  105. arch/x86/kernel/cpu/bugs.c +96 −9
  106. arch/x86/kernel/cpu/common.c +28 −16
  107. arch/x86/kernel/cpu/mtrr/cyrix.c +1 −0
  108. arch/x86/kernel/kvm.c +0 −8
  109. arch/x86/kernel/ptrace.c +1 −0
  110. arch/x86/kvm/debugfs.c +13 −33
  111. arch/x86/kvm/lapic.c +0 −8
  112. arch/x86/kvm/svm.c +6 −0
  113. arch/x86/kvm/vmx/vmx.c +6 −0
  114. arch/x86/kvm/x86.c +16 −0
  115. arch/x86/lib/cpu.c +1 −0
  116. arch/x86/purgatory/Makefile +31 −5
  117. arch/x86/purgatory/purgatory.c +6 −0
  118. arch/x86/purgatory/string.c +0 −23
  119. arch/xtensa/kernel/coprocessor.S +1 −0
  120. block/bfq-iosched.c +47 −21
  121. drivers/acpi/device_pm.c +3 −1
  122. drivers/acpi/scan.c +6 −0
  123. drivers/ata/libahci_platform.c +3 −0
  124. drivers/ata/libata-scsi.c +21 −0
  125. drivers/ata/libata-sff.c +6 −0
  126. drivers/ata/libata-zpodd.c +1 −1
  127. drivers/ata/pata_rb532_cf.c +0 −1
  128. drivers/atm/iphase.c +6 −2
  129. drivers/base/core.c +52 −1
  130. drivers/base/platform.c +7 −2
  131. drivers/block/aoe/aoedev.c +10 −3
  132. drivers/block/ataflop.c +1 −0
  133. drivers/block/loop.c +10 −8
  134. drivers/block/nbd.c +1 −1
  135. drivers/bluetooth/hci_ath.c +3 −0
  136. drivers/bluetooth/hci_bcm.c +3 −0
  137. drivers/bluetooth/hci_intel.c +3 −0
  138. drivers/bluetooth/hci_ldisc.c +13 −0
  139. drivers/bluetooth/hci_mrvl.c +3 −0
  140. drivers/bluetooth/hci_qca.c +3 −0
  141. drivers/bluetooth/hci_uart.h +1 −0
  142. drivers/char/ipmi/ipmb_dev_int.c +1 −1
  143. drivers/char/tpm/tpm-chip.c +36 −7
  144. drivers/char/tpm/tpm.h +2 −0
  145. drivers/char/tpm/tpm1-cmd.c +24 −12
  146. drivers/char/tpm/tpm2-cmd.c +1 −5
  147. drivers/clk/at91/clk-generated.c +2 −0
  148. drivers/clk/mediatek/clk-mt8183.c +34 −12
  149. drivers/clk/renesas/renesas-cpg-mssr.c +2 −14
  150. drivers/clk/sprd/Kconfig +1 −0
  151. drivers/clocksource/timer-riscv.c +2 −4
  152. drivers/crypto/ccp/ccp-crypto-aes-galois.c +14 −0
  153. drivers/crypto/ccp/ccp-ops.c +24 −9
  154. drivers/crypto/ux500/cryp/cryp.c +6 −0
  155. drivers/gpio/gpiolib.c +15 −8
  156. drivers/gpu/drm/Kconfig +1 −1
  157. drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +2 −1
  158. drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +12 −14
  159. drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +1 −1
  160. drivers/gpu/drm/amd/amdgpu/amdgpu_gds.h +0 −1
  161. drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +49 −25
  162. drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h +1 −0
  163. drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 −11
  164. drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +40 −0
  165. drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +37 −7
  166. drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +0 −28
  167. drivers/gpu/drm/amd/include/kgd_pp_interface.h +1 −0
  168. drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +17 −8
  169. drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +9 −0
  170. drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +1 −1
  171. drivers/gpu/drm/amd/powerplay/navi10_ppt.c +68 −31
  172. drivers/gpu/drm/amd/powerplay/smu_v11_0.c +22 −16
  173. drivers/gpu/drm/amd/powerplay/vega20_ppt.c +11 −23
  174. drivers/gpu/drm/bochs/bochs_kms.c +1 −0
  175. drivers/gpu/drm/bridge/Kconfig +3 −1
  176. drivers/gpu/drm/drm_client.c +49 −11
  177. drivers/gpu/drm/drm_fb_helper.c +40 −11
  178. drivers/gpu/drm/drm_modes.c +3 −1
  179. drivers/gpu/drm/exynos/Kconfig +1 −0
  180. drivers/gpu/drm/exynos/exynos_drm_fimc.c +1 −1
  181. drivers/gpu/drm/exynos/exynos_drm_g2d.c +1 −1
  182. drivers/gpu/drm/exynos/exynos_drm_gsc.c +1 −1
  183. drivers/gpu/drm/exynos/exynos_drm_scaler.c +2 −2
  184. drivers/gpu/drm/i915/display/intel_bios.c +1 −1
  185. drivers/gpu/drm/i915/display/intel_bw.c +10 −5
  186. drivers/gpu/drm/i915/display/intel_cdclk.c +11 −0
  187. drivers/gpu/drm/i915/display/intel_display.c +2 −2
  188. drivers/gpu/drm/i915/display/intel_display_power.c +9 −2
  189. drivers/gpu/drm/i915/display/intel_hdcp.c +2 −1
  190. drivers/gpu/drm/i915/display/intel_vbt_defs.h +3 −3
  191. drivers/gpu/drm/i915/display/vlv_dsi_pll.c +2 −2
  192. drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +9 −11
  193. drivers/gpu/drm/i915/gem/i915_gem_pm.c +4 −3
  194. drivers/gpu/drm/i915/gem/i915_gem_userptr.c +9 −1
  195. drivers/gpu/drm/i915/gt/intel_context.c +18 −9
  196. drivers/gpu/drm/i915/gt/intel_engine_cs.c +11 −9
  197. drivers/gpu/drm/i915/gt/intel_engine_pm.c +0 −24
  198. drivers/gpu/drm/i915/gt/intel_engine_pm.h +9 −3
  199. drivers/gpu/drm/i915/gt/intel_engine_types.h +12 −0
  200. drivers/gpu/drm/i915/gt/intel_gt_pm.c +20 −1
  201. drivers/gpu/drm/i915/gt/intel_gt_pm.h +1 −1
  202. drivers/gpu/drm/i915/gt/intel_lrc.c +2 −8
  203. drivers/gpu/drm/i915/gt/intel_reset.c +42 −16
  204. drivers/gpu/drm/i915/gt/intel_ringbuffer.c +20 −11
  205. drivers/gpu/drm/i915/gt/intel_workarounds.c +35 −3
  206. drivers/gpu/drm/i915/gt/mock_engine.c +1 −0
  207. drivers/gpu/drm/i915/gt/selftest_reset.c +4 −1
  208. drivers/gpu/drm/i915/gt/selftest_workarounds.c +6 −1
  209. drivers/gpu/drm/i915/gvt/cmd_parser.c +0 −10
  210. drivers/gpu/drm/i915/gvt/fb_decoder.c +3 −3
  211. drivers/gpu/drm/i915/gvt/gtt.c +9 −0
  212. drivers/gpu/drm/i915/gvt/kvmgt.c +12 −0
  213. drivers/gpu/drm/i915/gvt/scheduler.c +44 −15
  214. drivers/gpu/drm/i915/gvt/trace_points.c +0 −2
  215. drivers/gpu/drm/i915/i915_drv.h +3 −2
  216. drivers/gpu/drm/i915/i915_gem.c +11 −14
  217. drivers/gpu/drm/i915/i915_gem_gtt.c +6 −2
  218. drivers/gpu/drm/i915/i915_gpu_error.c +4 −2
  219. drivers/gpu/drm/i915/i915_perf.c +43 −24
  220. drivers/gpu/drm/i915/i915_trace.h +33 −43
  221. drivers/gpu/drm/i915/intel_runtime_pm.c +4 −6
  222. drivers/gpu/drm/i915/intel_wakeref.h +15 −0
  223. drivers/gpu/drm/msm/adreno/a5xx_gpu.c +2 −0
  224. drivers/gpu/drm/msm/adreno/a6xx_gpu.c +1 −0
  225. drivers/gpu/drm/msm/adreno/adreno_gpu.c +1 −0
  226. drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +15 −1
  227. drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +1 −1
  228. drivers/gpu/drm/msm/msm_drv.c +2 −1
  229. drivers/gpu/drm/msm/msm_gem.c +42 −5
  230. drivers/gpu/drm/nouveau/dispnv50/disp.c +1 −1
  231. drivers/gpu/drm/nouveau/nouveau_svm.c +44 −3
  232. drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +1 −1
  233. drivers/gpu/drm/tegra/output.c +6 −2
  234. drivers/gpu/drm/vmwgfx/vmwgfx_msg.c +3 −1
  235. drivers/hid/hid-a4tech.c +27 −3
  236. drivers/hid/hid-holtek-kbd.c +7 −2
  237. drivers/hid/hid-ids.h +4 −1
  238. drivers/hid/hid-logitech-dj.c +7 −3
  239. drivers/hid/hid-logitech-hidpp.c +31 −1
  240. drivers/hid/hid-quirks.c +2 −0
  241. drivers/hid/hid-sony.c +12 −3
  242. drivers/hid/hid-tmff.c +12 −0
  243. drivers/hid/usbhid/hiddev.c +12 −0
  244. drivers/hid/wacom_wac.c +6 −6
  245. drivers/hwmon/lm75.c +1 −1
  246. drivers/hwmon/nct7802.c +3 −3
  247. drivers/hwtracing/coresight/coresight-etm-perf.c +1 −0
  248. drivers/i2c/busses/i2c-at91-core.c +1 −1
  249. drivers/i2c/busses/i2c-at91-master.c +5 −4
  250. drivers/i2c/busses/i2c-bcm-iproc.c +6 −4
  251. drivers/i2c/busses/i2c-s3c2410.c +1 −0
  252. drivers/iio/accel/cros_ec_accel_legacy.c +0 −1
  253. drivers/iio/adc/ingenic-adc.c +54 −0
  254. drivers/iio/adc/max9611.c +1 −1
  255. drivers/iio/adc/rcar-gyroadc.c +2 −2
  256. drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +43 −0
  257. drivers/infiniband/core/core_priv.h +4 −1
  258. drivers/infiniband/core/counters.c +7 −4
  259. drivers/infiniband/core/device.c +68 −34
  260. drivers/infiniband/core/mad.c +10 −10
  261. drivers/infiniband/core/user_mad.c +5 −1
  262. drivers/infiniband/hw/bnxt_re/ib_verbs.c +5 −2
  263. drivers/infiniband/hw/bnxt_re/qplib_res.c +9 −4
  264. drivers/infiniband/hw/bnxt_re/qplib_res.h +1 −1
  265. drivers/infiniband/hw/bnxt_re/qplib_sp.c +9 −5
  266. drivers/infiniband/hw/bnxt_re/qplib_sp.h +6 −1
  267. drivers/infiniband/hw/hfi1/chip.c +9 −2
  268. drivers/infiniband/hw/hfi1/rc.c +0 −2
  269. drivers/infiniband/hw/hfi1/tid_rdma.c +2 −41
  270. drivers/infiniband/hw/hfi1/verbs.c +2 −0
  271. drivers/infiniband/hw/hns/Kconfig +3 −3
  272. drivers/infiniband/hw/hns/Makefile +2 −6
  273. drivers/infiniband/hw/hns/hns_roce_db.c +8 −7
  274. drivers/infiniband/hw/hns/hns_roce_hw_v1.c +3 −1
  275. drivers/infiniband/hw/mlx5/main.c +3 −4
  276. drivers/infiniband/hw/mlx5/mlx5_ib.h +1 −0
  277. drivers/infiniband/hw/mlx5/mr.c +23 −27
  278. drivers/infiniband/hw/mlx5/odp.c +4 −3
  279. drivers/infiniband/hw/mlx5/qp.c +8 −5
  280. drivers/infiniband/hw/qedr/main.c +8 −2
  281. drivers/infiniband/sw/siw/siw_cm.c +1 −2
  282. drivers/infiniband/sw/siw/siw_main.c +1 −0
  283. drivers/infiniband/sw/siw/siw_qp.c +4 −2
  284. drivers/input/joystick/iforce/iforce-usb.c +5 −0
  285. drivers/input/keyboard/Kconfig +2 −0
  286. drivers/input/keyboard/applespi.c +16 −13
  287. drivers/input/mouse/elantech.c +26 −29
  288. drivers/input/mouse/synaptics.c +1 −0
  289. drivers/input/tablet/kbtab.c +4 −2
  290. drivers/input/touchscreen/usbtouchscreen.c +2 −0
  291. drivers/iommu/virtio-iommu.c +29 −11
  292. drivers/irqchip/irq-gic-v3-its.c +1 −1
  293. drivers/irqchip/irq-gic-v3.c +4 −0
  294. drivers/irqchip/irq-imx-gpcv2.c +1 −0
  295. drivers/irqchip/irq-mbigen.c +7 −2
  296. drivers/isdn/hardware/mISDN/hfcsusb.c +12 −1
  297. drivers/macintosh/smu.c +1 −0
  298. drivers/md/bcache/sysfs.c +12 −8
  299. drivers/md/dm-table.c +8 −8
  300. drivers/media/platform/vivid/vivid-core.c +4 −4
  301. drivers/mfd/db8500-prcmu.c +2 −0
  302. drivers/mfd/omap-usb-host.c +2 −2
  303. drivers/misc/eeprom/at24.c +1 −1
  304. drivers/misc/habanalabs/command_submission.c +1 −1
  305. drivers/misc/habanalabs/firmware_if.c +4 −18
  306. drivers/misc/habanalabs/goya/goya.c +3 −2
  307. drivers/misc/habanalabs/habanalabs.h +14 −2
  308. drivers/mmc/core/queue.c +5 −0
  309. drivers/mmc/host/cavium.c +3 −1
  310. drivers/mmc/host/dw_mmc.c +1 −2
  311. drivers/mmc/host/meson-mx-sdio.c +1 −1
  312. drivers/mmc/host/sdhci-acpi.c +1 −1
  313. drivers/mmc/host/sdhci-esdhc-imx.c +1 −1
  314. drivers/mmc/host/sdhci-of-at91.c +1 −1
  315. drivers/mmc/host/sdhci-pci-core.c +2 −2
  316. drivers/mmc/host/sdhci-pxav3.c +1 −1
  317. drivers/mmc/host/sdhci-s3c.c +1 −1
  318. drivers/mmc/host/sdhci-sprd.c +2 −1
  319. drivers/mmc/host/sdhci-xenon.c +1 −1
  320. drivers/mmc/host/sdhci.c +2 −2
  321. drivers/mmc/host/sdhci.h +1 −1
  322. drivers/mtd/hyperbus/Kconfig +2 −1
  323. drivers/mtd/nand/raw/nand_micron.c +11 −3
  324. drivers/net/arcnet/arc-rimi.c +3 −0
  325. drivers/net/arcnet/com20020-isa.c +6 −0
  326. drivers/net/arcnet/com90io.c +2 −0
  327. drivers/net/arcnet/com90xx.c +3 −0
  328. drivers/net/bonding/bond_main.c +9 −0
  329. drivers/net/can/dev.c +2 −0
  330. drivers/net/can/flexcan.c +32 −7
  331. drivers/net/can/rcar/rcar_canfd.c +5 −4
  332. drivers/net/can/sja1000/peak_pcmcia.c +1 −1
  333. drivers/net/can/spi/mcp251x.c +22 −27
  334. drivers/net/can/usb/peak_usb/pcan_usb_core.c +5 −5
  335. drivers/net/can/usb/peak_usb/pcan_usb_fd.c +1 −1
  336. drivers/net/can/usb/peak_usb/pcan_usb_pro.c +1 −1
  337. drivers/net/dsa/mv88e6xxx/chip.c +2 −27
  338. drivers/net/dsa/qca8k.c +8 −2
  339. drivers/net/dsa/sja1105/sja1105_dynamic_config.c +13 −1
  340. drivers/net/dsa/sja1105/sja1105_main.c +60 −83
  341. drivers/net/dsa/sja1105/sja1105_ptp.c +3 −4
  342. drivers/net/ethernet/8390/Kconfig +2 −2
  343. drivers/net/ethernet/agere/et131x.c +1 −1
  344. drivers/net/ethernet/allwinner/sun4i-emac.c +3 −1
  345. drivers/net/ethernet/amd/Kconfig +1 −1
  346. drivers/net/ethernet/apple/Kconfig +2 −2
  347. drivers/net/ethernet/atheros/ag71xx.c +1 −1
  348. drivers/net/ethernet/broadcom/Kconfig +3 −3
  349. drivers/net/ethernet/broadcom/bcmsysport.c +1 −1
  350. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +1 −2
  351. drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 −1
  352. drivers/net/ethernet/broadcom/genet/bcmgenet.c +1 −1
  353. drivers/net/ethernet/cavium/thunder/thunder_bgx.c +6 −12
  354. drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +4 −1
  355. drivers/net/ethernet/emulex/benet/be_cmds.c +2 −4
  356. drivers/net/ethernet/emulex/benet/be_main.c +0 −2
  357. drivers/net/ethernet/freescale/enetc/Kconfig +2 −0
  358. drivers/net/ethernet/freescale/fman/fman.c +0 −3
  359. drivers/net/ethernet/google/gve/gve.h +3 −5
  360. drivers/net/ethernet/google/gve/gve_ethtool.c +2 −2
  361. drivers/net/ethernet/google/gve/gve_rx.c +15 −19
  362. drivers/net/ethernet/hisilicon/hip04_eth.c +16 −12
  363. drivers/net/ethernet/ibm/ehea/ehea_main.c +1 −1
  364. drivers/net/ethernet/marvell/mvmdio.c +22 −9
  365. drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +40 −47
  366. drivers/net/ethernet/marvell/sky2.c +7 −0
  367. drivers/net/ethernet/mediatek/Kconfig +0 −1
  368. drivers/net/ethernet/mellanox/mlx5/core/dev.c +1 −1
  369. drivers/net/ethernet/mellanox/mlx5/core/en.h +3 −9
  370. drivers/net/ethernet/mellanox/mlx5/core/en/params.h +3 −2
  371. drivers/net/ethernet/mellanox/mlx5/core/en/port.c +18 −9
  372. drivers/net/ethernet/mellanox/mlx5/core/en/port.h +4 −2
  373. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c +1 −1
  374. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +47 −22
  375. drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c +2 −1
  376. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +18 −23
  377. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +2 −0
  378. drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +4 −4
  379. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +2 −2
  380. drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c +2 −2
  381. drivers/net/ethernet/mellanox/mlx5/core/fs_core.h +3 −2
  382. drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c +5 −0
  383. drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c +3 −4
  384. drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c +1 −0
  385. drivers/net/ethernet/mellanox/mlxsw/spectrum.c +1 −1
  386. drivers/net/ethernet/mellanox/mlxsw/spectrum.h +4 −0
  387. drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c +2 −2
  388. drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c +1 −0
  389. drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.h +1 −0
  390. drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c +59 −17
  391. drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c +17 −0
  392. drivers/net/ethernet/mscc/ocelot.c +1 −0
  393. drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c +2 −2
  394. drivers/net/ethernet/ni/Kconfig +1 −1
  395. drivers/net/ethernet/packetengines/Kconfig +3 −3
  396. drivers/net/ethernet/packetengines/Makefile +1 −1
  397. drivers/net/ethernet/qlogic/qed/qed_int.c +1 −1
  398. drivers/net/ethernet/qlogic/qed/qed_rdma.c +1 −1
  399. drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c +9 −4
  400. drivers/net/ethernet/realtek/r8169_main.c +8 −6
  401. drivers/net/ethernet/rocker/rocker_main.c +2 −0
  402. drivers/net/ethernet/samsung/Kconfig +1 −1
  403. drivers/net/ethernet/smsc/smc911x.c +1 −0
  404. drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +4 −0
  405. drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h +5 −2
  406. drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +78 −9
  407. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +26 −24
  408. drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +7 −0
  409. drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c +1 −1
  410. drivers/net/ethernet/toshiba/spider_net.c +1 −0
  411. drivers/net/ethernet/xscale/Kconfig +1 −1
  412. drivers/net/hamradio/baycom_epp.c +2 −1
  413. drivers/net/phy/fixed_phy.c +4 −2
  414. drivers/net/phy/mscc.c +8 −8
  415. drivers/net/phy/phy_device.c +6 −0
  416. drivers/net/phy/phy_led_triggers.c +2 −1
  417. drivers/net/phy/phylink.c +6 −4
  418. drivers/net/ppp/pppoe.c +3 −0
  419. drivers/net/ppp/pppox.c +13 −0
  420. drivers/net/ppp/pptp.c +3 −0
  421. drivers/net/tun.c +6 −3
  422. drivers/net/usb/pegasus.c +1 −1
  423. drivers/net/usb/qmi_wwan.c +1 −0
  424. drivers/net/usb/r8152.c +6 −6
  425. drivers/net/wan/sdla.c +1 −0
  426. drivers/net/wireless/intel/iwlwifi/fw/api/rx.h +2 −1
  427. drivers/net/wireless/intel/iwlwifi/fw/dbg.c +12 −10
  428. drivers/net/wireless/intel/iwlwifi/iwl-drv.c +3 −1
  429. drivers/net/wireless/intel/iwlwifi/mvm/fw.c +21 −8
  430. drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +42 −16
  431. drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +4 −4
  432. drivers/net/wireless/intel/iwlwifi/mvm/nvm.c +1 −1
  433. drivers/net/wireless/intel/iwlwifi/mvm/ops.c +2 −2
  434. drivers/net/wireless/intel/iwlwifi/mvm/rs.c +289 −250
  435. drivers/net/wireless/intel/iwlwifi/mvm/rs.h +2 −1
  436. drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +134 −51
  437. drivers/net/wireless/intel/iwlwifi/mvm/sta.c +4 −2
  438. drivers/net/wireless/intel/iwlwifi/mvm/sta.h +10 −2
  439. drivers/net/wireless/intel/iwlwifi/mvm/tx.c +2 −1
  440. drivers/net/wireless/intel/iwlwifi/mvm/utils.c +2 −2
  441. drivers/net/wireless/intel/iwlwifi/pcie/drv.c +3 −0
  442. drivers/net/wireless/intel/iwlwifi/pcie/tx.c +2 −0
  443. drivers/net/wireless/mac80211_hwsim.c +5 −3
  444. drivers/net/wireless/marvell/mwifiex/main.h +1 −0
  445. drivers/net/wireless/marvell/mwifiex/scan.c +2 −1
  446. drivers/nfc/nfcmrvl/main.c +2 −2
  447. drivers/nfc/nfcmrvl/uart.c +2 −2
  448. drivers/nfc/nfcmrvl/usb.c +1 −0
  449. drivers/nfc/st-nci/se.c +2 −0
  450. drivers/nfc/st21nfca/se.c +2 −0
  451. drivers/ntb/msi.c +0 −5
  452. drivers/nvmem/nvmem-sysfs.c +11 −4
  453. drivers/pci/pci.c +10 −19
  454. drivers/pci/pci.h +0 −1
  455. drivers/pci/pcie/portdrv_core.c +0 −66
  456. drivers/pcmcia/db1xxx_ss.c +4 −0
  457. drivers/perf/arm_pmu.c +1 −1
  458. drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c +1 −1
  459. drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c +65 −27
  460. drivers/pinctrl/aspeed/pinctrl-aspeed.c +5 −7
  461. drivers/pinctrl/aspeed/pinmux-aspeed.c +1 −1
  462. drivers/pinctrl/aspeed/pinmux-aspeed.h +3 −2
  463. drivers/platform/olpc/olpc-xo175-ec.c +6 −0
  464. drivers/platform/x86/intel_pmc_core.c +1 −0
  465. drivers/platform/x86/pcengines-apuv2.c +2 −4
  466. drivers/pwm/core.c +5 −2
  467. drivers/regulator/axp20x-regulator.c +5 −5
  468. drivers/regulator/lp87565-regulator.c +4 −4
  469. drivers/regulator/of_regulator.c +3 −1
  470. drivers/s390/block/dasd_alias.c +16 −6
  471. drivers/s390/char/con3215.c +1 −0
  472. drivers/s390/char/tape_core.c +3 −0
  473. drivers/s390/cio/vfio_ccw_async.c +1 −1
  474. drivers/s390/crypto/ap_queue.c +1 −0
  475. drivers/s390/crypto/zcrypt_msgtype6.c +4 −13
  476. drivers/s390/net/ctcm_fsms.c +1 −0
  477. drivers/s390/net/ctcm_mpc.c +3 −0
  478. drivers/s390/net/qeth_l2_main.c +1 −1
  479. drivers/scsi/arm/fas216.c +8 −0
  480. drivers/scsi/fcoe/fcoe_ctlr.c +65 −73
  481. drivers/scsi/hpsa.c +11 −3
  482. drivers/scsi/libfc/fc_rport.c +4 −1
  483. drivers/scsi/mpt3sas/mpt3sas_base.c +7 −5
  484. drivers/scsi/qla2xxx/qla_init.c +1 −1
  485. drivers/spi/spi-bcm2835.c +2 −1
  486. drivers/spi/spi-fsl-qspi.c +1 −1
  487. drivers/spi/spi-gpio.c +6 −0
  488. drivers/spi/spi-pxa2xx.c +12 −2
  489. drivers/staging/android/ion/ion_page_pool.c +3 −0
  490. drivers/staging/fbtft/fb_bd663474.c +1 −1
  491. drivers/staging/fbtft/fb_ili9163.c +1 −1
  492. drivers/staging/fbtft/fb_ili9325.c +1 −1
  493. drivers/staging/fbtft/fb_s6d1121.c +1 −1
  494. drivers/staging/fbtft/fb_ssd1289.c +1 −1
  495. drivers/staging/fbtft/fb_ssd1331.c +2 −2
  496. drivers/staging/fbtft/fb_upd161704.c +1 −1
  497. drivers/staging/fbtft/fbtft-bus.c +1 −1
  498. drivers/staging/fbtft/fbtft-core.c +22 −25
  499. drivers/staging/gasket/apex_driver.c +1 −1
  500. drivers/staging/unisys/visornic/visornic_main.c +2 −1
  501. drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +1 −0
  502. drivers/tty/serial/kgdboc.c +4 −0
  503. drivers/usb/core/devio.c +0 −2
  504. drivers/usb/core/hcd.c +0 −123
  505. drivers/usb/core/sysfs.c +121 −0
  506. drivers/usb/core/usb.h +5 −0
  507. drivers/usb/host/xhci-rcar.c +7 −2
  508. drivers/usb/host/xhci.c +10 −0
  509. drivers/usb/misc/iowarrior.c +4 −3
  510. drivers/usb/misc/rio500.c +27 −16
  511. drivers/usb/misc/yurex.c +1 −1
  512. drivers/usb/typec/tcpm/tcpm.c +41 −17
  513. drivers/usb/typec/ucsi/ucsi_ccg.c +1 −1
  514. drivers/vhost/vhost.h +1 −1
  515. drivers/video/fbdev/omap/omapfb_main.c +8 −0
  516. drivers/watchdog/ar7_wdt.c +1 −0
  517. drivers/watchdog/pcwd.c +1 −1
  518. drivers/watchdog/riowd.c +1 −1
  519. drivers/watchdog/sb_wdog.c +1 −0
  520. drivers/watchdog/scx200_wdt.c +1 −0
  521. drivers/watchdog/wdt.c +1 −1
  522. drivers/watchdog/wdt977.c +1 −1
  523. drivers/xen/gntdev.c +1 −1
  524. drivers/xen/privcmd.c +5 −30
  525. drivers/xen/swiotlb-xen.c +10 −24
  526. drivers/xen/xen-pciback/conf_space_capability.c +1 −2
  527. drivers/xen/xlate_mmu.c +32 −0
  528. fs/block_dev.c +73 −40
  529. fs/btrfs/backref.c +1 −1
  530. fs/btrfs/send.c +15 −62
  531. fs/btrfs/transaction.c +28 −4
  532. fs/btrfs/transaction.h +3 −0
  533. fs/cifs/connect.c +1 −0
  534. fs/cifs/smb2ops.c +26 −13
  535. fs/cifs/smb2pdu.c +6 −1
  536. fs/compat_ioctl.c +0 −3
  537. fs/coredump.c +39 −5
  538. fs/dax.c +2 −2
  539. fs/f2fs/file.c +23 −40
  540. fs/f2fs/gc.c +34 −36
  541. fs/f2fs/super.c +24 −24
  542. fs/gfs2/bmap.c +113 −66
  543. fs/io_uring.c +2 −1
  544. fs/nfs/delegation.c +18 −7
  545. fs/nfs/delegation.h +1 −1
  546. fs/nfs/fscache.c +6 −1
  547. fs/nfs/fscache.h +1 −1
  548. fs/nfs/nfs4_fs.h +2 −1
  549. fs/nfs/nfs4client.c +4 −1
  550. fs/nfs/nfs4proc.c +62 −47
  551. fs/nfs/nfs4state.c +39 −10
  552. fs/nfs/pnfs.c +1 −6
  553. fs/nfs/super.c +1 −0
  554. fs/ocfs2/xattr.c +0 −3
  555. fs/super.c +1 −4
  556. fs/xfs/scrub/dabtree.c +5 −1
  557. fs/xfs/xfs_itable.c +3 −0
  558. include/asm-generic/getorder.h +20 −30
  559. include/drm/drm_client.h +2 −0
  560. include/drm/drm_mode_config.h +7 −0
  561. include/kvm/arm_pmu.h +2 −0
  562. include/kvm/arm_vgic.h +1 −0
  563. include/linux/ccp.h +2 −0
  564. include/linux/clk.h +1 −0
  565. include/linux/dim.h +0 −56
  566. include/linux/filter.h +13 −0
  567. include/linux/fs.h +6 −0
  568. include/linux/gpio/consumer.h +32 −32
  569. include/linux/hmm.h +0 −54
  570. include/linux/if_pppox.h +3 −0
  571. include/linux/if_rmnet.h +2 −2
  572. include/linux/kvm_host.h +4 −2
  573. include/linux/mlx5/fs.h +1 −0
  574. include/linux/mlx5/mlx5_ifc.h +4 −2
  575. include/linux/mod_devicetable.h +1 −0
  576. include/linux/page-flags-layout.h +11 −7
  577. include/linux/page-flags.h +4 −0
  578. include/linux/skmsg.h +7 −1
  579. include/net/cfg80211.h +15 −0
  580. include/net/tc_act/tc_police.h +2 −2
  581. include/net/tc_act/tc_sample.h +1 −1
  582. include/net/tcp.h +3 −0
  583. include/net/tls.h +9 −4
  584. include/rdma/ib_verbs.h +3 −1
  585. include/rdma/rdmavt_qp.h +4 −5
  586. include/scsi/libfc.h +26 −26
  587. include/scsi/libfcoe.h +1 −0
  588. include/sound/simple_card_utils.h +4 −0
  589. include/trace/events/dma_fence.h +1 −1
  590. include/trace/events/napi.h +2 −2
  591. include/trace/events/qdisc.h +2 −2
  592. include/trace/events/tegra_apb_dma.h +2 −2
  593. include/uapi/linux/kfd_ioctl.h +1 −19
  594. include/uapi/linux/netfilter/xt_connlabel.h +6 −0
  595. include/uapi/linux/socket.h +13 −6
  596. include/uapi/linux/virtio_iommu.h +18 −14
  597. include/uapi/sound/sof/fw.h +9 −7
  598. include/uapi/sound/sof/header.h +8 −6
  599. include/xen/xen-ops.h +3 −0
  600. kernel/Makefile +0 −1
  601. kernel/bpf/verifier.c +2 −2
  602. kernel/dma/contiguous.c +5 −3
  603. kernel/dma/mapping.c +11 −2
  604. kernel/exit.c +3 −2
  605. kernel/irq/affinity.c +2 −4
  606. kernel/sched/deadline.c +0 −8
  607. kernel/sched/psi.c +2 −2
  608. kernel/signal.c +2 −1
  609. kernel/trace/trace_functions_graph.c +7 −10
  610. lib/Kconfig.kasan +5 −6
  611. lib/Makefile +2 −1
  612. lib/dim/dim.c +2 −2
  613. lib/dim/net_dim.c +56 −0
  614. lib/raid6/Makefile +1 −1
  615. lib/test_meminit.c +1 −1
  616. lib/vdso/gettimeofday.c +47 −32
  617. mm/Makefile +1 −0
  618. mm/balloon_compaction.c +41 −28
  619. mm/compaction.c +7 −4
  620. mm/hmm.c +4 −6
  621. mm/kmemleak.c +1 −1
  622. mm/memory_hotplug.c +0 −2
  623. mm/memremap.c +6 −0
  624. mm/migrate.c +10 −11
  625. mm/slub.c +6 −2
  626. mm/vmscan.c +8 −1
  627. net/bridge/br.c +4 −1
  628. net/bridge/br_multicast.c +3 −0
  629. net/bridge/br_private.h +5 −4
  630. net/bridge/br_vlan.c +16 −13
  631. net/bridge/netfilter/ebtables.c +20 −12
  632. net/bridge/netfilter/nft_meta_bridge.c +2 −8
  633. net/can/gw.c +33 −15
  634. net/core/dev.c +12 −5
  635. net/core/filter.c +3 −3
  636. net/core/skmsg.c +2 −2
  637. net/core/sock_map.c +14 −5
  638. net/dsa/tag_sja1105.c +2 −10
  639. net/ipv4/inet_fragment.c +1 −1
  640. net/ipv4/ipip.c +3 −0
  641. net/ipv4/tcp_ulp.c +13 −0
  642. net/ipv6/ip6_gre.c +2 −1
  643. net/ipv6/ip6_tunnel.c +2 −4
  644. net/ipv6/route.c +1 −1
  645. net/iucv/af_iucv.c +9 −5
  646. net/l2tp/l2tp_ppp.c +3 −0
  647. net/mac80211/iface.c +0 −1
  648. net/mac80211/mlme.c +10 −0
  649. net/mac80211/util.c +3 −4
  650. net/netfilter/ipset/ip_set_bitmap_ipmac.c +1 −1
  651. net/netfilter/ipset/ip_set_core.c +1 −1
  652. net/netfilter/ipset/ip_set_hash_ipmac.c +1 −5
  653. net/netfilter/nft_meta.c +4 −12
  654. net/netrom/af_netrom.c +1 −0
  655. net/openvswitch/datapath.c +8 −7
  656. net/rds/rdma_transport.c +4 −1
  657. net/rxrpc/ar-internal.h +1 −0
  658. net/rxrpc/peer_event.c +1 −1
  659. net/rxrpc/peer_object.c +18 −0
  660. net/rxrpc/sendmsg.c +1 −0
  661. net/sched/act_bpf.c +5 −4
  662. net/sched/act_connmark.c +5 −4
  663. net/sched/act_csum.c +5 −4
  664. net/sched/act_ct.c +5 −4
  665. net/sched/act_ctinfo.c +5 −4
  666. net/sched/act_gact.c +5 −3
  667. net/sched/act_ife.c +10 −3
  668. net/sched/act_mirred.c +7 −6
  669. net/sched/act_mpls.c +5 −3
  670. net/sched/act_nat.c +5 −4
  671. net/sched/act_pedit.c +6 −4
  672. net/sched/act_police.c +5 −3
  673. net/sched/act_sample.c +5 −5
  674. net/sched/act_simple.c +6 −4
  675. net/sched/act_skbedit.c +6 −5
  676. net/sched/act_skbmod.c +6 −5
  677. net/sched/act_tunnel_key.c +5 −3
  678. net/sched/act_vlan.c +18 −7
  679. net/sched/sch_codel.c +3 −3
  680. net/sctp/socket.c +2 −2
  681. net/smc/af_smc.c +10 −5
  682. net/tipc/netlink_compat.c +7 −4
  683. net/tipc/socket.c +1 −2
  684. net/tls/tls_main.c +60 −37
  685. net/tls/tls_sw.c +59 −24
  686. net/vmw_vsock/hyperv_transport.c +8 −0
  687. net/wireless/core.c +2 −4
  688. net/wireless/nl80211.c +1 −3
  689. net/wireless/util.c +25 −2
  690. scripts/Kconfig.include +1 −1
  691. scripts/Makefile.build +10 −1
  692. scripts/Makefile.modpost +44 −42
  693. scripts/headers_install.sh +6 −0
  694. scripts/kconfig/confdata.c +4 −0
  695. scripts/link-vmlinux.sh +1 −1
  696. security/selinux/ss/policydb.c +5 −1
  697. sound/core/pcm_native.c +2 −1
  698. sound/firewire/packets-buffer.c +1 −1
  699. sound/hda/hdac_i915.c +6 −4
  700. sound/pci/hda/hda_controller.c +9 −4
  701. sound/pci/hda/hda_controller.h +1 −1
  702. sound/pci/hda/hda_intel.c +62 −1
  703. sound/soc/amd/raven/acp3x-pcm-dma.c +9 −11
  704. sound/soc/codecs/cs42xx8.c +97 −19
  705. sound/soc/codecs/max98357a.c +4 −21
  706. sound/soc/codecs/max98373.c +6 −0
  707. sound/soc/codecs/max98373.h +2 −0
  708. sound/soc/codecs/pcm3060-i2c.c +2 −2
  709. sound/soc/codecs/pcm3060-spi.c +2 −2
  710. sound/soc/codecs/pcm3060.c +2 −2
  711. sound/soc/codecs/pcm3060.h +1 −1
  712. sound/soc/codecs/rt1011.c +2 −2
  713. sound/soc/codecs/rt1308.c +0 −0
  714. sound/soc/codecs/rt1308.h +0 −0
  715. sound/soc/generic/audio-graph-card.c +16 −14
  716. sound/soc/generic/simple-card-utils.c +7 −0
  717. sound/soc/generic/simple-card.c +13 −13
  718. sound/soc/intel/boards/bytcht_es8316.c +8 −0
  719. sound/soc/intel/common/soc-acpi-intel-bxt-match.c +1 −1
  720. sound/soc/intel/common/soc-acpi-intel-byt-match.c +1 −1
  721. sound/soc/intel/common/soc-acpi-intel-cht-match.c +1 −1
  722. sound/soc/intel/common/soc-acpi-intel-cnl-match.c +1 −1
  723. sound/soc/intel/common/soc-acpi-intel-glk-match.c +1 −1
  724. sound/soc/intel/common/soc-acpi-intel-hda-match.c +1 −1
  725. sound/soc/intel/common/soc-acpi-intel-hsw-bdw-match.c +1 −1
  726. sound/soc/intel/common/soc-acpi-intel-icl-match.c +1 −1
  727. sound/soc/intel/common/soc-acpi-intel-kbl-match.c +1 −1
  728. sound/soc/intel/common/soc-acpi-intel-skl-match.c +1 −1
  729. sound/soc/qcom/apq8016_sbc.c +8 −8
  730. sound/soc/rockchip/rockchip_i2s.c +2 −3
  731. sound/soc/rockchip/rockchip_max98090.c +32 −0
  732. sound/soc/samsung/odroid.c +5 −3
  733. sound/soc/soc-core.c +5 −2
  734. sound/soc/soc-dapm.c +6 −4
  735. sound/soc/sof/intel/cnl.c +2 −2
  736. sound/soc/sof/intel/hda-ipc.c +2 −2
  737. sound/soc/sunxi/sun4i-i2s.c +2 −2
  738. sound/soc/ti/davinci-mcasp.c +36 −10
  739. sound/sound_core.c +2 −1
  740. sound/usb/helper.c +1 −1
  741. sound/usb/hiface/pcm.c +8 −3
  742. sound/usb/stream.c +1 −0
  743. tools/arch/arm/include/uapi/asm/kvm.h +12 −0
  744. tools/arch/arm64/include/uapi/asm/kvm.h +10 −0
  745. tools/arch/powerpc/include/uapi/asm/mman.h +0 −4
  746. tools/arch/sparc/include/uapi/asm/mman.h +0 −4
  747. tools/arch/x86/include/uapi/asm/kvm.h +18 −4
  748. tools/arch/x86/include/uapi/asm/vmx.h +0 −1
  749. tools/include/uapi/asm-generic/mman-common.h +9 −6
  750. tools/include/uapi/asm-generic/mman.h +4 −6
  751. tools/include/uapi/asm-generic/unistd.h +7 −1
  752. tools/include/uapi/drm/drm.h +1 −0
  753. tools/include/uapi/drm/i915_drm.h +206 −3
  754. tools/include/uapi/linux/if_link.h +5 −0
  755. tools/include/uapi/linux/kvm.h +3 −0
  756. tools/include/uapi/linux/sched.h +29 −1
  757. tools/include/uapi/linux/usbdevice_fs.h +26 −0
  758. tools/lib/bpf/btf.c +3 −2
  759. tools/lib/bpf/hashmap.h +5 −0
  760. tools/lib/bpf/libbpf.c +23 −11
  761. tools/lib/bpf/xsk.c +5 −6
  762. tools/perf/Documentation/Makefile +1 −1
  763. tools/perf/Documentation/perf.data-file-format.txt +1 −1
  764. tools/perf/arch/s390/util/machine.c +30 −1
  765. tools/perf/arch/x86/entry/syscalls/syscall_64.tbl +2 −0
  766. tools/perf/bench/numa.c +4 −2
  767. tools/perf/builtin-ftrace.c +1 −1
  768. tools/perf/pmu-events/jevents.c +1 −0
  769. tools/perf/trace/beauty/usbdevfs_ioctl.sh +6 −3
  770. tools/perf/ui/browser.c +5 −4
  771. tools/perf/ui/tui/progress.c +1 −1
  772. tools/perf/util/annotate.c +1 −1
  773. tools/perf/util/cpumap.c +4 −1
  774. tools/perf/util/header.c +8 −1
  775. tools/perf/util/machine.c +2 −1
  776. tools/perf/util/machine.h +1 −1
  777. tools/perf/util/symbol.c +6 −1
  778. tools/perf/util/symbol.h +1 −0
  779. tools/perf/util/thread.c +11 −1
  780. tools/testing/selftests/bpf/Makefile +2 −1
  781. tools/testing/selftests/bpf/progs/sendmsg6_prog.c +1 −2
  782. tools/testing/selftests/bpf/test_xdp_vlan.sh +45 −12
  783. tools/testing/selftests/bpf/test_xdp_vlan_mode_generic.sh +9 −0
  784. tools/testing/selftests/bpf/test_xdp_vlan_mode_native.sh +9 −0
  785. tools/testing/selftests/bpf/verifier/ctx_skb.c +11 −0
  786. tools/testing/selftests/cgroup/cgroup_util.c +1 −2
  787. tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh +2 −2
  788. tools/testing/selftests/kmod/kmod.sh +3 −3
  789. tools/testing/selftests/kselftest.h +15 −0
  790. tools/testing/selftests/kvm/.gitignore +2 −1
  791. tools/testing/selftests/kvm/config +3 −0
  792. tools/testing/selftests/livepatch/functions.sh +40 −6
  793. tools/testing/selftests/net/.gitignore +2 −2
  794. tools/testing/selftests/net/forwarding/gre_multipath.sh +16 −12
  795. tools/testing/selftests/net/tls.c +223 −0
  796. tools/testing/selftests/pidfd/pidfd_test.c +1 −5
  797. tools/testing/selftests/tc-testing/tc-tests/actions/vlan.json +94 −0
  798. tools/testing/selftests/x86/test_vsyscall.c +1 −1
  799. virt/kvm/arm/arm.c +13 −5
  800. virt/kvm/arm/hyp/vgic-v3-sr.c +8 −0
  801. virt/kvm/arm/pmu.c +15 −3
  802. virt/kvm/arm/vgic/vgic-mmio.c +16 −0
  803. virt/kvm/arm/vgic/vgic-v2.c +8 −1
  804. virt/kvm/arm/vgic/vgic-v3.c +6 −1
  805. virt/kvm/arm/vgic/vgic.c +11 −0
  806. virt/kvm/arm/vgic/vgic.h +2 −0
  807. virt/kvm/kvm_main.c +36 −25
Documentation/admin-guide/hw-vuln/spectre.rst+80−8
@@ -41,10 +41,11 @@ Related CVEs · 40 unmodified lines
4141
4242 The following CVE entries describe Spectre variants:
4343
44− ============= ======================= =================
44+ ============= ======================= ==========================
4545 CVE-2017-5753 Bounds check bypass Spectre variant 1
4646 CVE-2017-5715 Branch target injection Spectre variant 2
47− ============= ======================= =================
47+ CVE-2019-1125 Spectre v1 swapgs Spectre variant 1 (swapgs)
48+ ============= ======================= ==========================
4849
4950 Problem
5051 -------
@@ -78,6 +79,13 @@ There are some extensions of Spectre variant 1 attacks for reading data · 27 unmodified lines
7879 over the network, see :ref:`[12] <spec_ref12>`. However such attacks
7980 are difficult, low bandwidth, fragile, and are considered low risk.
8081
82+Note that, despite "Bounds Check Bypass" name, Spectre variant 1 is not
83+only about user-controlled array bounds checks. It can affect any
84+conditional checks. The kernel entry code interrupt, exception, and NMI
85+handlers all have conditional swapgs checks. Those may be problematic
86+in the context of Spectre v1, as kernel code can speculatively run with
87+a user GS.
88+
8189 Spectre variant 2 (Branch Target Injection)
8290 -------------------------------------------
8391
@@ -132,6 +140,9 @@ not cover all possible attack vectors. · 48 unmodified lines
132140 1. A user process attacking the kernel
133141 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
134142
143+Spectre variant 1
144+~~~~~~~~~~~~~~~~~
145+
135146 The attacker passes a parameter to the kernel via a register or
136147 via a known address in memory during a syscall. Such parameter may
137148 be used later by the kernel as an index to an array or to derive
@@ -144,7 +155,40 @@ not cover all possible attack vectors. · 6 unmodified lines
144155 potentially be influenced for Spectre attacks, new "nospec" accessor
145156 macros are used to prevent speculative loading of data.
146157
147− Spectre variant 2 attacker can :ref:`poison <poison_btb>` the branch
158+Spectre variant 1 (swapgs)
159+~~~~~~~~~~~~~~~~~~~~~~~~~~
160+
161+ An attacker can train the branch predictor to speculatively skip the
162+ swapgs path for an interrupt or exception. If they initialize
163+ the GS register to a user-space value, if the swapgs is speculatively
164+ skipped, subsequent GS-related percpu accesses in the speculation
165+ window will be done with the attacker-controlled GS value. This
166+ could cause privileged memory to be accessed and leaked.
167+
168+ For example:
169+
170+ ::
171+
172+ if (coming from user space)
173+ swapgs
174+ mov %gs:<percpu_offset>, %reg
175+ mov (%reg), %reg1
176+
177+ When coming from user space, the CPU can speculatively skip the
178+ swapgs, and then do a speculative percpu load using the user GS
179+ value. So the user can speculatively force a read of any kernel
180+ value. If a gadget exists which uses the percpu value as an address
181+ in another load/store, then the contents of the kernel value may
182+ become visible via an L1 side channel attack.
183+
184+ A similar attack exists when coming from kernel space. The CPU can
185+ speculatively do the swapgs, causing the user GS to get used for the
186+ rest of the speculative window.
187+
188+Spectre variant 2
189+~~~~~~~~~~~~~~~~~
190+
191+ A spectre variant 2 attacker can :ref:`poison <poison_btb>` the branch
148192 target buffer (BTB) before issuing syscall to launch an attack.
149193 After entering the kernel, the kernel could use the poisoned branch
150194 target buffer on indirect jump and jump to gadget code in speculative
@@ -280,11 +324,18 @@ The sysfs file showing Spectre variant 1 mitigation status is: · 129 unmodified lines
280324
281325 The possible values in this file are:
282326
283− ======================================= =================================
284− 'Mitigation: __user pointer sanitation' Protection in kernel on a case by
285− case base with explicit pointer
286− sanitation.
287− ======================================= =================================
327+ .. list-table::
328+
329+ * - 'Not affected'
330+ - The processor is not vulnerable.
331+ * - 'Vulnerable: __user pointer sanitization and usercopy barriers only; no swapgs barriers'
332+ - The swapgs protections are disabled; otherwise it has
333+ protection in the kernel on a case by case base with explicit
334+ pointer sanitation and usercopy LFENCE barriers.
335+ * - 'Mitigation: usercopy/swapgs barriers and __user pointer sanitization'
336+ - Protection in the kernel on a case by case base with explicit
337+ pointer sanitation, usercopy LFENCE barriers, and swapgs LFENCE
338+ barriers.
288339
289340 However, the protections are put in place on a case by case basis,
290341 and there is no guarantee that all possible attack vectors for Spectre
@@ -366,12 +417,27 @@ Turning on mitigation for Spectre variant 1 and Spectre variant 2 · 75 unmodified lines
366417 1. Kernel mitigation
367418 ^^^^^^^^^^^^^^^^^^^^
368419
420+Spectre variant 1
421+~~~~~~~~~~~~~~~~~
422+
369423 For the Spectre variant 1, vulnerable kernel code (as determined
370424 by code audit or scanning tools) is annotated on a case by case
371425 basis to use nospec accessor macros for bounds clipping :ref:`[2]
372426 <spec_ref2>` to avoid any usable disclosure gadgets. However, it may
373427 not cover all attack vectors for Spectre variant 1.
374428
429+ Copy-from-user code has an LFENCE barrier to prevent the access_ok()
430+ check from being mis-speculated. The barrier is done by the
431+ barrier_nospec() macro.
432+
433+ For the swapgs variant of Spectre variant 1, LFENCE barriers are
434+ added to interrupt, exception and NMI entry where needed. These
435+ barriers are done by the FENCE_SWAPGS_KERNEL_ENTRY and
436+ FENCE_SWAPGS_USER_ENTRY macros.
437+
438+Spectre variant 2
439+~~~~~~~~~~~~~~~~~
440+
375441 For Spectre variant 2 mitigation, the compiler turns indirect calls or
376442 jumps in the kernel into equivalent return trampolines (retpolines)
377443 :ref:`[3] <spec_ref3>` :ref:`[9] <spec_ref9>` to go to the target
@@ -473,6 +539,12 @@ Mitigation control on the kernel command line · 95 unmodified lines
473539 Spectre variant 2 mitigation can be disabled or force enabled at the
474540 kernel command line.
475541
542+ nospectre_v1
543+
544+ [X86,PPC] Disable mitigations for Spectre Variant 1
545+ (bounds check bypass). With this option data leaks are
546+ possible in the system.
547+
476548 nospectre_v2
477549
478550 [X86] Disable all mitigations for the Spectre variant 2
Documentation/admin-guide/kernel-parameters.txt+4−4
@@ -2604,7 +2604,7 @@ · 2603 unmodified lines
26042604 expose users to several CPU vulnerabilities.
26052605 Equivalent to: nopti [X86,PPC]
26062606 kpti=0 [ARM64]
2607− nospectre_v1 [PPC]
2607+ nospectre_v1 [X86,PPC]
26082608 nobp=0 [S390]
26092609 nospectre_v2 [X86,PPC,S390,ARM64]
26102610 spectre_v2_user=off [X86]
@@ -2965,9 +2965,9 @@ · 354 unmodified lines
29652965 nosmt=force: Force disable SMT, cannot be undone
29662966 via the sysfs control file.
29672967
2968− nospectre_v1 [PPC] Disable mitigations for Spectre Variant 1 (bounds
2969− check bypass). With this option data leaks are possible
2970− in the system.
2968+ nospectre_v1 [X86,PPC] Disable mitigations for Spectre Variant 1
2969+ (bounds check bypass). With this option data leaks are
2970+ possible in the system.
29712971
29722972 nospectre_v2 [X86,PPC_FSL_BOOK3E,ARM64] Disable all mitigations for
29732973 the Spectre variant 2 (indirect branch prediction)
Documentation/devicetree/bindings/riscv/cpus.txt+0−162
@@ -1,162 +0,0 @@
1−===================
2−RISC-V CPU Bindings
3−===================
4−
5−The device tree allows to describe the layout of CPUs in a system through
6−the "cpus" node, which in turn contains a number of subnodes (ie "cpu")
7−defining properties for every cpu.
8−
9−Bindings for CPU nodes follow the Devicetree Specification, available from:
10−
11−https://www.devicetree.org/specifications/
12−
13−with updates for 32-bit and 64-bit RISC-V systems provided in this document.
14−
15−===========
16−Terminology
17−===========
18−
19−This document uses some terminology common to the RISC-V community that is not
20−widely used, the definitions of which are listed here:
21−
22−* hart: A hardware execution context, which contains all the state mandated by
23− the RISC-V ISA: a PC and some registers. This terminology is designed to
24− disambiguate software's view of execution contexts from any particular
25− microarchitectural implementation strategy. For example, my Intel laptop is
26− described as having one socket with two cores, each of which has two hyper
27− threads. Therefore this system has four harts.
28−
29−=====================================
30−cpus and cpu node bindings definition
31−=====================================
32−
33−The RISC-V architecture, in accordance with the Devicetree Specification,
34−requires the cpus and cpu nodes to be present and contain the properties
35−described below.
36−
37−- cpus node
38−
39− Description: Container of cpu nodes
40−
41− The node name must be "cpus".
42−
43− A cpus node must define the following properties:
44−
45− - #address-cells
46− Usage: required
47− Value type: <u32>
48− Definition: must be set to 1
49− - #size-cells
50− Usage: required
51− Value type: <u32>
52− Definition: must be set to 0
53−
54−- cpu node
55−
56− Description: Describes a hart context
57−
58− PROPERTIES
59−
60− - device_type
61− Usage: required
62− Value type: <string>
63− Definition: must be "cpu"
64− - reg
65− Usage: required
66− Value type: <u32>
67− Definition: The hart ID of this CPU node
68− - compatible:
69− Usage: required
70− Value type: <stringlist>
71− Definition: must contain "riscv", may contain one of
72− "sifive,rocket0"
73− - mmu-type:
74− Usage: optional
75− Value type: <string>
76− Definition: Specifies the CPU's MMU type. Possible values are
77− "riscv,sv32"
78− "riscv,sv39"
79− "riscv,sv48"
80− - riscv,isa:
81− Usage: required
82− Value type: <string>
83− Definition: Contains the RISC-V ISA string of this hart. These
84− ISA strings are defined by the RISC-V ISA manual.
85−
86−Example: SiFive Freedom U540G Development Kit
87−---------------------------------------------
88−
89−This system contains two harts: a hart marked as disabled that's used for
90−low-level system tasks and should be ignored by Linux, and a second hart that
91−Linux is allowed to run on.
92−
93− cpus {
94− #address-cells = <1>;
95− #size-cells = <0>;
96− timebase-frequency = <1000000>;
97− cpu@0 {
98− clock-frequency = <1600000000>;
99− compatible = "sifive,rocket0", "riscv";
100− device_type = "cpu";
101− i-cache-block-size = <64>;
102− i-cache-sets = <128>;
103− i-cache-size = <16384>;
104− next-level-cache = <&L15 &L0>;
105− reg = <0>;
106− riscv,isa = "rv64imac";
107− status = "disabled";
108− L10: interrupt-controller {
109− #interrupt-cells = <1>;
110− compatible = "riscv,cpu-intc";
111− interrupt-controller;
112− };
113− };
114− cpu@1 {
115− clock-frequency = <1600000000>;
116− compatible = "sifive,rocket0", "riscv";
117− d-cache-block-size = <64>;
118− d-cache-sets = <64>;
119− d-cache-size = <32768>;
120− d-tlb-sets = <1>;
121− d-tlb-size = <32>;
122− device_type = "cpu";
123− i-cache-block-size = <64>;
124− i-cache-sets = <64>;
125− i-cache-size = <32768>;
126− i-tlb-sets = <1>;
127− i-tlb-size = <32>;
128− mmu-type = "riscv,sv39";
129− next-level-cache = <&L15 &L0>;
130− reg = <1>;
131− riscv,isa = "rv64imafdc";
132− status = "okay";
133− tlb-split;
134− L13: interrupt-controller {
135− #interrupt-cells = <1>;
136− compatible = "riscv,cpu-intc";
137− interrupt-controller;
138− };
139− };
140− };
141−
142−Example: Spike ISA Simulator with 1 Hart
143−----------------------------------------
144−
145−This device tree matches the Spike ISA golden model as run with `spike -p1`.
146−
147− cpus {
148− cpu@0 {
149− device_type = "cpu";
150− reg = <0x00000000>;
151− status = "okay";
152− compatible = "riscv";
153− riscv,isa = "rv64imafdc";
154− mmu-type = "riscv,sv48";
155− clock-frequency = <0x3b9aca00>;
156− interrupt-controller {
157− #interrupt-cells = <0x00000001>;
158− interrupt-controller;
159− compatible = "riscv,cpu-intc";
160− }
161− }
162− }
Documentation/devicetree/bindings/riscv/cpus.yaml+16−0
@@ -10,6 +10,18 @@ maintainers: · 9 unmodified lines
1010 - Paul Walmsley <paul.walmsley@sifive.com>
1111 - Palmer Dabbelt <palmer@sifive.com>
1212
13+description: |
14+ This document uses some terminology common to the RISC-V community
15+ that is not widely used, the definitions of which are listed here:
16+
17+ hart: A hardware execution context, which contains all the state
18+ mandated by the RISC-V ISA: a PC and some registers. This
19+ terminology is designed to disambiguate software's view of execution
20+ contexts from any particular microarchitectural implementation
21+ strategy. For example, an Intel laptop containing one socket with
22+ two cores, each of which has two hyperthreads, could be described as
23+ having four harts.
24+
1325 properties:
1426 compatible:
1527 items:
@@ -50,6 +62,10 @@ properties: · 34 unmodified lines
5062 User-Level ISA document, available from
5163 https://riscv.org/specifications/
5264
65+ While the isa strings in ISA specification are case
66+ insensitive, letters in the riscv,isa string must be all
67+ lowercase to simplify parsing.
68+
5369 timebase-frequency:
5470 type: integer
5571 minimum: 1
Documentation/devicetree/bindings/riscv/sifive.yaml+1−1
@@ -19,7 +19,7 @@ properties: · 18 unmodified lines
1919 compatible:
2020 items:
2121 - enum:
22− - sifive,freedom-unleashed-a00
22+ - sifive,hifive-unleashed-a00
2323 - const: sifive,fu540-c000
2424 - const: sifive,fu540
2525 ...
Documentation/devicetree/bindings/spi/spi-controller.yaml+0−1
@@ -73,7 +73,6 @@ patternProperties: · 72 unmodified lines
7373 Compatible of the SPI device.
7474
7575 reg:
76− maxItems: 1
7776 minimum: 0
7877 maximum: 256
7978 description:
Documentation/filesystems/cifs/TODO+16−10
@@ -13,7 +13,8 @@ a) SMB3 (and SMB3.1.1) missing optional features: · 12 unmodified lines
1313 - T10 copy offload ie "ODX" (copy chunk, and "Duplicate Extents" ioctl
1414 currently the only two server side copy mechanisms supported)
1515
16−b) improved sparse file support
16+b) improved sparse file support (fiemap and SEEK_HOLE are implemented
17+but additional features would be supportable by the protocol).
1718
1819 c) Directory entry caching relies on a 1 second timer, rather than
1920 using Directory Leases, currently only the root file handle is cached longer
@@ -21,9 +22,13 @@ using Directory Leases, currently only the root file handle is cached longer · 1 unmodified line
2122 d) quota support (needs minor kernel change since quota calls
2223 to make it to network filesystems or deviceless filesystems)
2324
24−e) Additional use cases where we use "compoounding" (e.g. open/query/close
25−and open/setinfo/close) to reduce the number of roundtrips, and also
26−open to reduce redundant opens (using deferred close and reference counts more).
25+e) Additional use cases can be optimized to use "compounding"
26+(e.g. open/query/close and open/setinfo/close) to reduce the number
27+of roundtrips to the server and improve performance. Various cases
28+(stat, statfs, create, unlink, mkdir) already have been improved by
29+using compounding but more can be done. In addition we could significantly
30+reduce redundant opens by using deferred close (with handle caching leases)
31+and better using reference counters on file handles.
2732
2833 f) Finish inotify support so kde and gnome file list windows
2934 will autorefresh (partially complete by Asser). Needs minor kernel
@@ -43,18 +48,17 @@ mount or a per server basis to client UIDs or nobody if no mapping · 13 unmodified lines
4348 exists. Also better integration with winbind for resolving SID owners
4449
4550 k) Add tools to take advantage of more smb3 specific ioctls and features
46−(passthrough ioctl/fsctl for sending various SMB3 fsctls to the server
47−is in progress, and a passthrough query_info call is already implemented
48−in cifs.ko to allow smb3 info levels queries to be sent from userspace)
51+(passthrough ioctl/fsctl is now implemented in cifs.ko to allow sending
52+various SMB3 fsctls and query info and set info calls directly from user space)
53+Add tools to make setting various non-POSIX metadata attributes easier
54+from tools (e.g. extending what was done in smb-info tool).
4955
5056 l) encrypted file support
5157
5258 m) improved stats gathering tools (perhaps integration with nfsometer?)
5359 to extend and make easier to use what is currently in /proc/fs/cifs/Stats
5460
55−n) allow setting more NTFS/SMB3 file attributes remotely (currently limited to compressed
56−file attribute via chflags) and improve user space tools for managing and
57−viewing them.
61+n) Add support for claims based ACLs ("DAC")
5862
5963 o) mount helper GUI (to simplify the various configuration options on mount)
6064
@@ -82,6 +86,8 @@ so far). · 21 unmodified lines
8286 w) Add support for additional strong encryption types, and additional spnego
8387 authentication mechanisms (see MS-SMB2)
8488
89+x) Finish support for SMB3.1.1 compression
90+
8591 KNOWN BUGS
8692 ====================================
8793 See http://bugzilla.samba.org - search on product "CifsVFS" for
Documentation/networking/tls-offload.rst+17−6
@@ -424,13 +424,24 @@ Statistics · 423 unmodified lines
424424 Following minimum set of TLS-related statistics should be reported
425425 by the driver:
426426
427− * ``rx_tls_decrypted`` - number of successfully decrypted TLS segments
428− * ``tx_tls_encrypted`` - number of in-order TLS segments passed to device
429− for encryption
427+ * ``rx_tls_decrypted_packets`` - number of successfully decrypted RX packets
428+ which were part of a TLS stream.
429+ * ``rx_tls_decrypted_bytes`` - number of TLS payload bytes in RX packets
430+ which were successfully decrypted.
431+ * ``tx_tls_encrypted_packets`` - number of TX packets passed to the device
432+ for encryption of their TLS payload.
433+ * ``tx_tls_encrypted_bytes`` - number of TLS payload bytes in TX packets
434+ passed to the device for encryption.
435+ * ``tx_tls_ctx`` - number of TLS TX HW offload contexts added to device for
436+ encryption.
430437 * ``tx_tls_ooo`` - number of TX packets which were part of a TLS stream
431− but did not arrive in the expected order
432− * ``tx_tls_drop_no_sync_data`` - number of TX packets dropped because
433− they arrived out of order and associated record could not be found
438+ but did not arrive in the expected order.
439+ * ``tx_tls_drop_no_sync_data`` - number of TX packets which were part of
440+ a TLS stream dropped, because they arrived out of order and associated
441+ record could not be found.
442+ * ``tx_tls_drop_bypass_req`` - number of TX packets which were part of a TLS
443+ stream dropped, because they contain both data that has been encrypted by
444+ software and data that expects hardware crypto offload.
434445
435446 Notable corner cases, exceptions and additional requirements
436447 ============================================================
Documentation/vm/hmm.rst+1−1
@@ -237,7 +237,7 @@ The usage pattern is:: · 236 unmodified lines
237237 ret = hmm_range_snapshot(&range);
238238 if (ret) {
239239 up_read(&mm->mmap_sem);
240− if (ret == -EAGAIN) {
240+ if (ret == -EBUSY) {
241241 /*
242242 * No need to check hmm_range_wait_until_valid() return value
243243 * on retry we will get proper error with hmm_range_snapshot()
MAINTAINERS+18−12
@@ -2155,10 +2155,12 @@ F: Documentation/devicetree/bindings/arm/realtek.txt · 2154 unmodified lines
21552155
21562156 ARM/RENESAS ARM64 ARCHITECTURE
21572157 M: Simon Horman <horms@verge.net.au>
2158+M: Geert Uytterhoeven <geert+renesas@glider.be>
21582159 M: Magnus Damm <magnus.damm@gmail.com>
21592160 L: linux-renesas-soc@vger.kernel.org
21602161 Q: http://patchwork.kernel.org/project/linux-renesas-soc/list/
21612162 T: git git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git next
2163+T: git git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git next
21622164 S: Supported
21632165 F: arch/arm64/boot/dts/renesas/
21642166 F: Documentation/devicetree/bindings/arm/renesas.yaml
@@ -2269,10 +2271,12 @@ F: drivers/media/platform/s5p-mfc/ · 104 unmodified lines
22692271
22702272 ARM/SHMOBILE ARM ARCHITECTURE
22712273 M: Simon Horman <horms@verge.net.au>
2274+M: Geert Uytterhoeven <geert+renesas@glider.be>
22722275 M: Magnus Damm <magnus.damm@gmail.com>
22732276 L: linux-renesas-soc@vger.kernel.org
22742277 Q: http://patchwork.kernel.org/project/linux-renesas-soc/list/
22752278 T: git git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git next
2279+T: git git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git next
22762280 S: Supported
22772281 F: arch/arm/boot/dts/emev2*
22782282 F: arch/arm/boot/dts/gr-peach*
@@ -6322,7 +6326,8 @@ F: Documentation/devicetree/bindings/counter/ftm-quaddec.txt · 4043 unmodified lines
63226326 F: drivers/counter/ftm-quaddec.c
63236327
63246328 FLOPPY DRIVER
6325−S: Orphan
6329+M: Denis Efremov <efremov@linux.com>
6330+S: Odd Fixes
63266331 L: linux-block@vger.kernel.org
63276332 F: drivers/block/floppy.c
63286333
@@ -6339,7 +6344,7 @@ FPGA MANAGER FRAMEWORK · 10 unmodified lines
63396344 M: Moritz Fischer <mdf@kernel.org>
63406345 L: linux-fpga@vger.kernel.org
63416346 S: Maintained
6342−T: git git://git.kernel.org/pub/scm/linux/kernel/git/atull/linux-fpga.git
6347+T: git git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga.git
63436348 Q: http://patchwork.kernel.org/project/linux-fpga/list/
63446349 F: Documentation/fpga/
63456350 F: Documentation/driver-api/fpga/
@@ -6372,7 +6377,7 @@ FRAMEBUFFER LAYER · 26 unmodified lines
63726377 M: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
63736378 L: dri-devel@lists.freedesktop.org
63746379 L: linux-fbdev@vger.kernel.org
6375−T: git git://github.com/bzolnier/linux.git
6380+T: git git://anongit.freedesktop.org/drm/drm-misc
63766381 Q: http://patchwork.kernel.org/project/linux-fbdev/list/
63776382 S: Maintained
63786383 F: Documentation/fb/
@@ -6822,13 +6827,6 @@ F: Documentation/filesystems/gfs2*.txt · 443 unmodified lines
68226827 F: fs/gfs2/
68236828 F: include/uapi/linux/gfs2_ondisk.h
68246829
6825−GIGASET ISDN DRIVERS
6826−M: Paul Bolle <pebolle@tiscali.nl>
6827−L: gigaset307x-common@lists.sourceforge.net
6828−W: http://gigaset307x.sourceforge.net/
6829−S: Odd Fixes
6830−F: drivers/staging/isdn/gigaset/
6831−
68326830 GNSS SUBSYSTEM
68336831 M: Johan Hovold <johan@kernel.org>
68346832 T: git git://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss.git
@@ -8044,6 +8042,7 @@ S: Maintained · 1209 unmodified lines
80448042 F: drivers/video/fbdev/i810/
80458043
80468044 INTEL ASoC DRIVERS
8045+M: Cezary Rojewski <cezary.rojewski@intel.com>
80478046 M: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
80488047 M: Liam Girdwood <liam.r.girdwood@linux.intel.com>
80498048 M: Jie Yang <yang.jie@linux.intel.com>
@@ -11145,6 +11144,7 @@ L: netdev@vger.kernel.org · 3095 unmodified lines
1114511144 S: Maintained
1114611145 W: https://fedorahosted.org/dropwatch/
1114711146 F: net/core/drop_monitor.c
11147+F: include/uapi/linux/net_dropmon.h
1114811148
1114911149 NETWORKING DRIVERS
1115011150 M: "David S. Miller" <davem@davemloft.net>
@@ -11283,6 +11283,7 @@ M: Aviad Yehezkel <aviadye@mellanox.com> · 132 unmodified lines
1128311283 M: Dave Watson <davejwatson@fb.com>
1128411284 M: John Fastabend <john.fastabend@gmail.com>
1128511285 M: Daniel Borkmann <daniel@iogearbox.net>
11286+M: Jakub Kicinski <jakub.kicinski@netronome.com>
1128611287 L: netdev@vger.kernel.org
1128711288 S: Maintained
1128811289 F: net/tls/*
@@ -14017,6 +14018,12 @@ F: drivers/media/common/saa7146/ · 2728 unmodified lines
1401714018 F: drivers/media/pci/saa7146/
1401814019 F: include/media/drv-intf/saa7146*
1401914020
14021+SAFESETID SECURITY MODULE
14022+M: Micah Morton <mortonm@chromium.org>
14023+S: Supported
14024+F: security/safesetid/
14025+F: Documentation/admin-guide/LSM/SafeSetID.rst
14026+
1402014027 SAMSUNG AUDIO (ASoC) DRIVERS
1402114028 M: Krzysztof Kozlowski <krzk@kernel.org>
1402214029 M: Sangbeom Kim <sbkim73@samsung.com>
@@ -16079,7 +16086,7 @@ S: Maintained · 2056 unmodified lines
1607916086 F: drivers/net/ethernet/ti/netcp*
1608016087
1608116088 TI PCM3060 ASoC CODEC DRIVER
16082−M: Kirill Marinushkin <kmarinushkin@birdec.tech>
16089+M: Kirill Marinushkin <kmarinushkin@birdec.com>
1608316090 L: alsa-devel@alsa-project.org (moderated for non-subscribers)
1608416091 S: Maintained
1608516092 F: Documentation/devicetree/bindings/sound/pcm3060.txt
@@ -17555,7 +17562,6 @@ M: Jakub Kicinski <jakub.kicinski@netronome.com> · 1469 unmodified lines
1755517562 M: Jesper Dangaard Brouer <hawk@kernel.org>
1755617563 M: John Fastabend <john.fastabend@gmail.com>
1755717564 L: netdev@vger.kernel.org
17558−L: xdp-newbies@vger.kernel.org
1755917565 L: bpf@vger.kernel.org
1756017566 S: Supported
1756117567 F: net/core/xdp.c
Makefile+20−7
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 5
33 PATCHLEVEL = 3
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc2
5+EXTRAVERSION = -rc4
66 NAME = Bobtail Squid
77
88 # *DOCUMENTATION*
@@ -419,6 +419,7 @@ NM = $(CROSS_COMPILE)nm · 410 unmodified lines
419419 STRIP = $(CROSS_COMPILE)strip
420420 OBJCOPY = $(CROSS_COMPILE)objcopy
421421 OBJDUMP = $(CROSS_COMPILE)objdump
422+OBJSIZE = $(CROSS_COMPILE)size
422423 PAHOLE = pahole
423424 LEX = flex
424425 YACC = bison
@@ -472,11 +473,12 @@ KBUILD_CFLAGS_MODULE := -DMODULE · 47 unmodified lines
472473 KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
473474 KBUILD_LDFLAGS :=
474475 GCC_PLUGINS_CFLAGS :=
476+CLANG_FLAGS :=
475477
476478 export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC
477−export CPP AR NM STRIP OBJCOPY OBJDUMP PAHOLE KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS
478−export MAKE LEX YACC AWK INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE
479−export HOSTCXX KBUILD_HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
479+export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE PAHOLE LEX YACC AWK INSTALLKERNEL
480+export PERL PYTHON PYTHON2 PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
481+export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE
480482
481483 export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS
482484 export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
@@ -519,7 +521,7 @@ endif · 36 unmodified lines
519521
520522 ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
521523 ifneq ($(CROSS_COMPILE),)
522−CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE:%-=%))
524+CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
523525 GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
524526 CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)
525527 GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..)
@@ -844,7 +846,7 @@ NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) · 318 unmodified lines
844846 KBUILD_CFLAGS += -Wdeclaration-after-statement
845847
846848 # Warn about unmarked fall-throughs in switch statement.
847−KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough=3,)
849+KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough,)
848850
849851 # Variable Length Arrays (VLAs) should not be used anywhere in the kernel
850852 KBUILD_CFLAGS += -Wvla
@@ -1001,6 +1003,8 @@ endif · 150 unmodified lines
10011003
10021004 PHONY += prepare0
10031005
1006+export MODORDER := $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)modules.order
1007+
10041008 ifeq ($(KBUILD_EXTMOD),)
10051009 core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
10061010
@@ -1770,13 +1774,22 @@ build-dir = $(patsubst %/,%,$(dir $(build-target))) · 763 unmodified lines
17701774 $(Q)$(MAKE) $(build)=$(build-dir) $(build-target)
17711775 %.symtypes: prepare FORCE
17721776 $(Q)$(MAKE) $(build)=$(build-dir) $(build-target)
1777+ifeq ($(KBUILD_EXTMOD),)
1778+# For the single build of an in-tree module, use a temporary file to avoid
1779+# the situation of modules_install installing an invalid modules.order.
1780+%.ko: MODORDER := .modules.tmp
1781+endif
1782+%.ko: prepare FORCE
1783+ $(Q)$(MAKE) $(build)=$(build-dir) $(build-target:.ko=.mod)
1784+ $(Q)echo $(build-target) > $(MODORDER)
1785+ $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
17731786
17741787 # Modules
17751788 PHONY += /
17761789 /: ./
17771790
17781791 %/: prepare FORCE
1779− $(Q)$(MAKE) KBUILD_MODULES=1 $(build)=$(build-dir)
1792+ $(Q)$(MAKE) KBUILD_MODULES=1 $(build)=$(build-dir) need-modorder=1
17801793
17811794 # FIXME Should go into a make.lib or something
17821795 # ===========================================================================
arch/arm/include/asm/dma-mapping.h+3−1
@@ -18,7 +18,9 @@ extern const struct dma_map_ops arm_coherent_dma_ops; · 17 unmodified lines
1818
1919 static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
2020 {
21− return IS_ENABLED(CONFIG_MMU) ? &arm_dma_ops : NULL;
21+ if (IS_ENABLED(CONFIG_MMU) && !IS_ENABLED(CONFIG_ARM_LPAE))
22+ return &arm_dma_ops;
23+ return NULL;
2224 }
2325
2426 #ifdef __arch_page_to_dma
arch/arm/kernel/hw_breakpoint.c+5−0
@@ -544,6 +544,7 @@ static int arch_build_bp_info(struct perf_event *bp, · 543 unmodified lines
544544 if ((hw->ctrl.type != ARM_BREAKPOINT_EXECUTE)
545545 && max_watchpoint_len >= 8)
546546 break;
547+ /* Else, fall through */
547548 default:
548549 return -EINVAL;
549550 }
@@ -608,10 +609,12 @@ int hw_breakpoint_arch_parse(struct perf_event *bp, · 58 unmodified lines
608609 /* Allow halfword watchpoints and breakpoints. */
609610 if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2)
610611 break;
612+ /* Else, fall through */
611613 case 3:
612614 /* Allow single byte watchpoint. */
613615 if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1)
614616 break;
617+ /* Else, fall through */
615618 default:
616619 ret = -EINVAL;
617620 goto out;
@@ -861,6 +864,7 @@ static int hw_breakpoint_pending(unsigned long addr, unsigned int fsr, · 243 unmodified lines
861864 break;
862865 case ARM_ENTRY_ASYNC_WATCHPOINT:
863866 WARN(1, "Asynchronous watchpoint exception taken. Debugging results may be unreliable\n");
867+ /* Fall through */
864868 case ARM_ENTRY_SYNC_WATCHPOINT:
865869 watchpoint_handler(addr, fsr, regs);
866870 break;
@@ -909,6 +913,7 @@ static bool core_has_os_save_restore(void) · 42 unmodified lines
909913 ARM_DBG_READ(c1, c1, 4, oslsr);
910914 if (oslsr & ARM_OSLSR_OSLM0)
911915 return true;
916+ /* Else, fall through */
912917 default:
913918 return false;
914919 }
arch/arm/kernel/signal.c+1−0
@@ -596,6 +596,7 @@ static int do_signal(struct pt_regs *regs, int syscall) · 595 unmodified lines
596596 switch (retval) {
597597 case -ERESTART_RESTARTBLOCK:
598598 restart -= 2;
599+ /* Fall through */
599600 case -ERESTARTNOHAND:
600601 case -ERESTARTSYS:
601602 case -ERESTARTNOINTR:
arch/arm/kvm/coproc.c+15−8
@@ -651,13 +651,22 @@ int kvm_handle_cp14_64(struct kvm_vcpu *vcpu, struct kvm_run *run) · 650 unmodified lines
651651 }
652652
653653 static void reset_coproc_regs(struct kvm_vcpu *vcpu,
654− const struct coproc_reg *table, size_t num)
654+ const struct coproc_reg *table, size_t num,
655+ unsigned long *bmap)
655656 {
656657 unsigned long i;
657658
658659 for (i = 0; i < num; i++)
659− if (table[i].reset)
660+ if (table[i].reset) {
661+ int reg = table[i].reg;
662+
660663 table[i].reset(vcpu, &table[i]);
664+ if (reg > 0 && reg < NR_CP15_REGS) {
665+ set_bit(reg, bmap);
666+ if (table[i].is_64bit)
667+ set_bit(reg + 1, bmap);
668+ }
669+ }
661670 }
662671
663672 static struct coproc_params decode_32bit_hsr(struct kvm_vcpu *vcpu)
@@ -1432,17 +1441,15 @@ void kvm_reset_coprocs(struct kvm_vcpu *vcpu) · 768 unmodified lines
14321441 {
14331442 size_t num;
14341443 const struct coproc_reg *table;
1435−
1436− /* Catch someone adding a register without putting in reset entry. */
1437− memset(vcpu->arch.ctxt.cp15, 0x42, sizeof(vcpu->arch.ctxt.cp15));
1444+ DECLARE_BITMAP(bmap, NR_CP15_REGS) = { 0, };
14381445
14391446 /* Generic chip reset first (so target could override). */
1440− reset_coproc_regs(vcpu, cp15_regs, ARRAY_SIZE(cp15_regs));
1447+ reset_coproc_regs(vcpu, cp15_regs, ARRAY_SIZE(cp15_regs), bmap);
14411448
14421449 table = get_target_table(vcpu->arch.target, &num);
1443− reset_coproc_regs(vcpu, table, num);
1450+ reset_coproc_regs(vcpu, table, num, bmap);
14441451
14451452 for (num = 1; num < NR_CP15_REGS; num++)
1446− WARN(vcpu_cp15(vcpu, num) == 0x42424242,
1453+ WARN(!test_bit(num, bmap),
14471454 "Didn't reset vcpu_cp15(vcpu, %zi)", num);
14481455 }
arch/arm/mach-ep93xx/crunch.c+1−0
@@ -49,6 +49,7 @@ static int crunch_do(struct notifier_block *self, unsigned long cmd, void *t) · 48 unmodified lines
4949 * FALLTHROUGH: Ensure we don't try to overwrite our newly
5050 * initialised state information on the first fault.
5151 */
52+ /* Fall through */
5253
5354 case THREAD_NOTIFY_EXIT:
5455 crunch_task_release(thread);
arch/arm/mach-tegra/reset.c+1−1
@@ -70,7 +70,7 @@ static void __init tegra_cpu_reset_handler_enable(void) · 69 unmodified lines
7070 switch (err) {
7171 case -ENOSYS:
7272 tegra_cpu_reset_handler_set(reset_address);
73− /* pass-through */
73+ /* fall through */
7474 case 0:
7575 is_enabled = true;
7676 break;
arch/arm/mm/Kconfig+5−0
@@ -663,6 +663,11 @@ config ARM_LPAE · 662 unmodified lines
663663 depends on MMU && CPU_32v7 && !CPU_32v6 && !CPU_32v5 && \
664664 !CPU_32v4 && !CPU_32v3
665665 select PHYS_ADDR_T_64BIT
666+ select SWIOTLB
667+ select ARCH_HAS_DMA_COHERENT_TO_PFN
668+ select ARCH_HAS_DMA_MMAP_PGPROT
669+ select ARCH_HAS_SYNC_DMA_FOR_DEVICE
670+ select ARCH_HAS_SYNC_DMA_FOR_CPU
666671 help
667672 Say Y if you have an ARMv7 processor supporting the LPAE page
668673 table format and you would like to access memory beyond the
arch/arm/mm/alignment.c+3−1
@@ -695,7 +695,7 @@ thumb2arm(u16 tinstr) · 694 unmodified lines
695695 return subset[(L<<1) | ((tinstr & (1<<8)) >> 8)] |
696696 (tinstr & 255); /* register_list */
697697 }
698− /* Else fall through for illegal instruction case */
698+ /* Else, fall through - for illegal instruction case */
699699
700700 default:
701701 return BAD_INSTR;
@@ -751,6 +751,8 @@ do_alignment_t32_to_handler(unsigned long *pinstr, struct pt_regs *regs, · 49 unmodified lines
751751 case 0xe8e0:
752752 case 0xe9e0:
753753 poffset->un = (tinst2 & 0xff) << 2;
754+ /* Fall through */
755+
754756 case 0xe940:
755757 case 0xe9c0:
756758 return do_alignment_ldrdstrd;
arch/arm/mm/dma-mapping.c+61−0
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <linux/init.h>
1616 #include <linux/device.h>
1717 #include <linux/dma-mapping.h>
18+#include <linux/dma-noncoherent.h>
1819 #include <linux/dma-contiguous.h>
1920 #include <linux/highmem.h>
2021 #include <linux/memblock.h>
@@ -1125,6 +1126,19 @@ int arm_dma_supported(struct device *dev, u64 mask) · 1104 unmodified lines
11251126
11261127 static const struct dma_map_ops *arm_get_dma_map_ops(bool coherent)
11271128 {
1129+ /*
1130+ * When CONFIG_ARM_LPAE is set, physical address can extend above
1131+ * 32-bits, which then can't be addressed by devices that only support
1132+ * 32-bit DMA.
1133+ * Use the generic dma-direct / swiotlb ops code in that case, as that
1134+ * handles bounce buffering for us.
1135+ *
1136+ * Note: this checks CONFIG_ARM_LPAE instead of CONFIG_SWIOTLB as the
1137+ * latter is also selected by the Xen code, but that code for now relies
1138+ * on non-NULL dev_dma_ops. To be cleaned up later.
1139+ */
1140+ if (IS_ENABLED(CONFIG_ARM_LPAE))
1141+ return NULL;
11281142 return coherent ? &arm_coherent_dma_ops : &arm_dma_ops;
11291143 }
11301144
@@ -2329,6 +2343,9 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, · 1198 unmodified lines
23292343 const struct dma_map_ops *dma_ops;
23302344
23312345 dev->archdata.dma_coherent = coherent;
2346+#ifdef CONFIG_SWIOTLB
2347+ dev->dma_coherent = coherent;
2348+#endif
23322349
23332350 /*
23342351 * Don't override the dma_ops if they have already been set. Ideally
@@ -2363,3 +2380,47 @@ void arch_teardown_dma_ops(struct device *dev) · 28 unmodified lines
23632380 /* Let arch_setup_dma_ops() start again from scratch upon re-probe */
23642381 set_dma_ops(dev, NULL);
23652382 }
2383+
2384+#ifdef CONFIG_SWIOTLB
2385+void arch_sync_dma_for_device(struct device *dev, phys_addr_t paddr,
2386+ size_t size, enum dma_data_direction dir)
2387+{
2388+ __dma_page_cpu_to_dev(phys_to_page(paddr), paddr & (PAGE_SIZE - 1),
2389+ size, dir);
2390+}
2391+
2392+void arch_sync_dma_for_cpu(struct device *dev, phys_addr_t paddr,
2393+ size_t size, enum dma_data_direction dir)
2394+{
2395+ __dma_page_dev_to_cpu(phys_to_page(paddr), paddr & (PAGE_SIZE - 1),
2396+ size, dir);
2397+}
2398+
2399+long arch_dma_coherent_to_pfn(struct device *dev, void *cpu_addr,
2400+ dma_addr_t dma_addr)
2401+{
2402+ return dma_to_pfn(dev, dma_addr);
2403+}
2404+
2405+pgprot_t arch_dma_mmap_pgprot(struct device *dev, pgprot_t prot,
2406+ unsigned long attrs)
2407+{
2408+ if (!dev_is_dma_coherent(dev))
2409+ return __get_dma_pgprot(attrs, prot);
2410+ return prot;
2411+}
2412+
2413+void *arch_dma_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
2414+ gfp_t gfp, unsigned long attrs)
2415+{
2416+ return __dma_alloc(dev, size, dma_handle, gfp,
2417+ __get_dma_pgprot(attrs, PAGE_KERNEL), false,
2418+ attrs, __builtin_return_address(0));
2419+}
2420+
2421+void arch_dma_free(struct device *dev, size_t size, void *cpu_addr,
2422+ dma_addr_t dma_handle, unsigned long attrs)
2423+{
2424+ __arm_dma_free(dev, size, cpu_addr, dma_handle, attrs, false);
2425+}
2426+#endif /* CONFIG_SWIOTLB */
arch/arm/mm/init.c+5−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <linux/dma-contiguous.h>
2222 #include <linux/sizes.h>
2323 #include <linux/stop_machine.h>
24+#include <linux/swiotlb.h>
2425
2526 #include <asm/cp15.h>
2627 #include <asm/mach-types.h>
@@ -463,6 +464,10 @@ static void __init free_highpages(void) · 436 unmodified lines
463464 */
464465 void __init mem_init(void)
465466 {
467+#ifdef CONFIG_ARM_LPAE
468+ swiotlb_init(1);
469+#endif
470+
466471 set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
467472
468473 /* this will put all unused low memory onto the freelists */
arch/arm/plat-omap/dma.c+5−9
@@ -388,17 +388,15 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) · 387 unmodified lines
388388 /*
389389 * not supported by current hardware on OMAP1
390390 * w |= (0x03 << 7);
391− * fall through
392391 */
392+ /* fall through */
393393 case OMAP_DMA_DATA_BURST_16:
394394 if (dma_omap2plus()) {
395395 burst = 0x3;
396396 break;
397397 }
398− /*
399− * OMAP1 don't support burst 16
400− * fall through
401− */
398+ /* OMAP1 don't support burst 16 */
399+ /* fall through */
402400 default:
403401 BUG();
404402 }
@@ -474,10 +472,8 @@ void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) · 69 unmodified lines
474472 burst = 0x3;
475473 break;
476474 }
477− /*
478− * OMAP1 don't support burst 16
479− * fall through
480− */
475+ /* OMAP1 don't support burst 16 */
476+ /* fall through */
481477 default:
482478 printk(KERN_ERR "Invalid DMA burst mode\n");
483479 BUG();
arch/arm64/Makefile+1−1
@@ -52,7 +52,7 @@ ifeq ($(CONFIG_GENERIC_COMPAT_VDSO), y) · 51 unmodified lines
5252
5353 ifeq ($(CONFIG_CC_IS_CLANG), y)
5454 $(warning CROSS_COMPILE_COMPAT is clang, the compat vDSO will not be built)
55− else ifeq ($(CROSS_COMPILE_COMPAT),)
55+ else ifeq ($(strip $(CROSS_COMPILE_COMPAT)),)
5656 $(warning CROSS_COMPILE_COMPAT not defined or empty, the compat vDSO will not be built)
5757 else ifeq ($(shell which $(CROSS_COMPILE_COMPAT)gcc 2> /dev/null),)
5858 $(error $(CROSS_COMPILE_COMPAT)gcc not found, check CROSS_COMPILE_COMPAT)
arch/arm64/include/asm/arch_gicv3.h+6−0
@@ -155,6 +155,12 @@ static inline void gic_pmr_mask_irqs(void) · 154 unmodified lines
155155 BUILD_BUG_ON(GICD_INT_DEF_PRI < (GIC_PRIO_IRQOFF |
156156 GIC_PRIO_PSR_I_SET));
157157 BUILD_BUG_ON(GICD_INT_DEF_PRI >= GIC_PRIO_IRQON);
158+ /*
159+ * Need to make sure IRQON allows IRQs when SCR_EL3.FIQ is cleared
160+ * and non-secure PMR accesses are not subject to the shifts that
161+ * are applied to IRQ priorities
162+ */
163+ BUILD_BUG_ON((0x80 | (GICD_INT_DEF_PRI >> 1)) >= GIC_PRIO_IRQON);
158164 gic_write_pmr(GIC_PRIO_IRQOFF);
159165 }
160166
arch/arm64/include/asm/cpufeature.h+4−3
@@ -35,9 +35,10 @@ · 34 unmodified lines
3535 */
3636
3737 enum ftr_type {
38− FTR_EXACT, /* Use a predefined safe value */
39− FTR_LOWER_SAFE, /* Smaller value is safe */
40− FTR_HIGHER_SAFE,/* Bigger value is safe */
38+ FTR_EXACT, /* Use a predefined safe value */
39+ FTR_LOWER_SAFE, /* Smaller value is safe */
40+ FTR_HIGHER_SAFE, /* Bigger value is safe */
41+ FTR_HIGHER_OR_ZERO_SAFE, /* Bigger value is safe, but 0 is biggest */
4142 };
4243
4344 #define FTR_STRICT true /* SANITY check strict matching required */
arch/arm64/include/asm/daifflags.h+2−0
@@ -13,6 +13,8 @@ · 12 unmodified lines
1313 #define DAIF_PROCCTX 0
1414 #define DAIF_PROCCTX_NOIRQ PSR_I_BIT
1515 #define DAIF_ERRCTX (PSR_I_BIT | PSR_A_BIT)
16+#define DAIF_MASK (PSR_D_BIT | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT)
17+
1618
1719 /* mask/save/unmask/restore all exceptions, including interrupts. */
1820 static inline void local_daif_mask(void)
arch/arm64/include/asm/efi.h+5−1
@@ -105,7 +105,11 @@ static inline unsigned long efi_get_max_initrd_addr(unsigned long dram_base, · 104 unmodified lines
105105 ((protocol##_t *)instance)->f(instance, ##__VA_ARGS__)
106106
107107 #define alloc_screen_info(x...) &screen_info
108−#define free_screen_info(x...)
108+
109+static inline void free_screen_info(efi_system_table_t *sys_table_arg,
110+ struct screen_info *si)
111+{
112+}
109113
110114 /* redeclare as 'hidden' so the compiler will generate relative references */
111115 extern struct screen_info screen_info __attribute__((__visibility__("hidden")));
arch/arm64/include/asm/kvm_arm.h+4−3
@@ -316,9 +316,10 @@ · 315 unmodified lines
316316
317317 #define kvm_arm_exception_class \
318318 ECN(UNKNOWN), ECN(WFx), ECN(CP15_32), ECN(CP15_64), ECN(CP14_MR), \
319− ECN(CP14_LS), ECN(FP_ASIMD), ECN(CP10_ID), ECN(CP14_64), ECN(SVC64), \
320− ECN(HVC64), ECN(SMC64), ECN(SYS64), ECN(IMP_DEF), ECN(IABT_LOW), \
321− ECN(IABT_CUR), ECN(PC_ALIGN), ECN(DABT_LOW), ECN(DABT_CUR), \
319+ ECN(CP14_LS), ECN(FP_ASIMD), ECN(CP10_ID), ECN(PAC), ECN(CP14_64), \
320+ ECN(SVC64), ECN(HVC64), ECN(SMC64), ECN(SYS64), ECN(SVE), \
321+ ECN(IMP_DEF), ECN(IABT_LOW), ECN(IABT_CUR), \
322+ ECN(PC_ALIGN), ECN(DABT_LOW), ECN(DABT_CUR), \
322323 ECN(SP_ALIGN), ECN(FP_EXC32), ECN(FP_EXC64), ECN(SERROR), \
323324 ECN(BREAKPT_LOW), ECN(BREAKPT_CUR), ECN(SOFTSTP_LOW), \
324325 ECN(SOFTSTP_CUR), ECN(WATCHPT_LOW), ECN(WATCHPT_CUR), \
arch/arm64/include/asm/memory.h+7−3
@@ -210,7 +210,11 @@ extern u64 vabits_user; · 209 unmodified lines
210210 #define __tag_reset(addr) untagged_addr(addr)
211211 #define __tag_get(addr) (__u8)((u64)(addr) >> 56)
212212 #else
213−#define __tag_set(addr, tag) (addr)
213+static inline const void *__tag_set(const void *addr, u8 tag)
214+{
215+ return addr;
216+}
217+
214218 #define __tag_reset(addr) (addr)
215219 #define __tag_get(addr) 0
216220 #endif
@@ -301,8 +305,8 @@ static inline void *phys_to_virt(phys_addr_t x) · 84 unmodified lines
301305 #define page_to_virt(page) ({ \
302306 unsigned long __addr = \
303307 ((__page_to_voff(page)) | PAGE_OFFSET); \
304− unsigned long __addr_tag = \
305− __tag_set(__addr, page_kasan_tag(page)); \
308+ const void *__addr_tag = \
309+ __tag_set((void *)__addr, page_kasan_tag(page)); \
306310 ((void *)__addr_tag); \
307311 })
308312
arch/arm64/include/asm/pgtable.h+7−4
@@ -209,7 +209,7 @@ static inline pmd_t pmd_mkcont(pmd_t pmd) · 208 unmodified lines
209209
210210 static inline pte_t pte_mkdevmap(pte_t pte)
211211 {
212− return set_pte_bit(pte, __pgprot(PTE_DEVMAP));
212+ return set_pte_bit(pte, __pgprot(PTE_DEVMAP | PTE_SPECIAL));
213213 }
214214
215215 static inline void set_pte(pte_t *ptep, pte_t pte)
@@ -396,7 +396,10 @@ static inline int pmd_protnone(pmd_t pmd) · 180 unmodified lines
396396 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
397397 #define pmd_devmap(pmd) pte_devmap(pmd_pte(pmd))
398398 #endif
399−#define pmd_mkdevmap(pmd) pte_pmd(pte_mkdevmap(pmd_pte(pmd)))
399+static inline pmd_t pmd_mkdevmap(pmd_t pmd)
400+{
401+ return pte_pmd(set_pte_bit(pmd_pte(pmd), __pgprot(PTE_DEVMAP)));
402+}
400403
401404 #define __pmd_to_phys(pmd) __pte_to_phys(pmd_pte(pmd))
402405 #define __phys_to_pmd_val(phys) __phys_to_pte_val(phys)
@@ -447,8 +450,8 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, · 44 unmodified lines
447450 PMD_TYPE_SECT)
448451
449452 #if defined(CONFIG_ARM64_64K_PAGES) || CONFIG_PGTABLE_LEVELS < 3
450−#define pud_sect(pud) (0)
451−#define pud_table(pud) (1)
453+static inline bool pud_sect(pud_t pud) { return false; }
454+static inline bool pud_table(pud_t pud) { return true; }
452455 #else
453456 #define pud_sect(pud) ((pud_val(pud) & PUD_TYPE_MASK) == \
454457 PUD_TYPE_SECT)
arch/arm64/include/asm/ptrace.h+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 * in the the priority mask, it indicates that PSR.I should be set and
3131 * interrupt disabling temporarily does not rely on IRQ priorities.
3232 */
33−#define GIC_PRIO_IRQON 0xc0
33+#define GIC_PRIO_IRQON 0xe0
3434 #define GIC_PRIO_IRQOFF (GIC_PRIO_IRQON & ~0x80)
3535 #define GIC_PRIO_PSR_I_SET (1 << 4)
3636
arch/arm64/include/asm/vdso/compat_gettimeofday.h+40−0
@@ -16,6 +16,8 @@ · 15 unmodified lines
1616
1717 #define VDSO_HAS_CLOCK_GETRES 1
1818
19+#define VDSO_HAS_32BIT_FALLBACK 1
20+
1921 static __always_inline
2022 int gettimeofday_fallback(struct __kernel_old_timeval *_tv,
2123 struct timezone *_tz)
@@ -51,6 +53,23 @@ long clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts) · 29 unmodified lines
5153 return ret;
5254 }
5355
56+static __always_inline
57+long clock_gettime32_fallback(clockid_t _clkid, struct old_timespec32 *_ts)
58+{
59+ register struct old_timespec32 *ts asm("r1") = _ts;
60+ register clockid_t clkid asm("r0") = _clkid;
61+ register long ret asm ("r0");
62+ register long nr asm("r7") = __NR_compat_clock_gettime;
63+
64+ asm volatile(
65+ " swi #0\n"
66+ : "=r" (ret)
67+ : "r" (clkid), "r" (ts), "r" (nr)
68+ : "memory");
69+
70+ return ret;
71+}
72+
5473 static __always_inline
5574 int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
5675 {
@@ -72,6 +91,27 @@ int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts) · 15 unmodified lines
7291 return ret;
7392 }
7493
94+static __always_inline
95+int clock_getres32_fallback(clockid_t _clkid, struct old_timespec32 *_ts)
96+{
97+ register struct old_timespec32 *ts asm("r1") = _ts;
98+ register clockid_t clkid asm("r0") = _clkid;
99+ register long ret asm ("r0");
100+ register long nr asm("r7") = __NR_compat_clock_getres;
101+
102+ /* The checks below are required for ABI consistency with arm */
103+ if ((_clkid >= MAX_CLOCKS) && (_ts == NULL))
104+ return -EINVAL;
105+
106+ asm volatile(
107+ " swi #0\n"
108+ : "=r" (ret)
109+ : "r" (clkid), "r" (ts), "r" (nr)
110+ : "memory");
111+
112+ return ret;
113+}
114+
75115 static __always_inline u64 __arch_get_hw_counter(s32 clock_mode)
76116 {
77117 u64 res;
arch/arm64/kernel/cpufeature.c+6−2
@@ -225,8 +225,8 @@ static const struct arm64_ftr_bits ftr_ctr[] = { · 224 unmodified lines
225225 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_EXACT, 31, 1, 1), /* RES1 */
226226 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_DIC_SHIFT, 1, 1),
227227 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_IDC_SHIFT, 1, 1),
228− ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_SAFE, CTR_CWG_SHIFT, 4, 0),
229− ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_SAFE, CTR_ERG_SHIFT, 4, 0),
228+ ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_OR_ZERO_SAFE, CTR_CWG_SHIFT, 4, 0),
229+ ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_OR_ZERO_SAFE, CTR_ERG_SHIFT, 4, 0),
230230 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_DMINLINE_SHIFT, 4, 1),
231231 /*
232232 * Linux can handle differing I-cache policies. Userspace JITs will
@@ -468,6 +468,10 @@ static s64 arm64_ftr_safe_value(const struct arm64_ftr_bits *ftrp, s64 new, · 235 unmodified lines
468468 case FTR_LOWER_SAFE:
469469 ret = new < cur ? new : cur;
470470 break;
471+ case FTR_HIGHER_OR_ZERO_SAFE:
472+ if (!cur || !new)
473+ break;
474+ /* Fallthrough */
471475 case FTR_HIGHER_SAFE:
472476 ret = new > cur ? new : cur;
473477 break;
arch/arm64/kernel/debug-monitors.c+8−6
@@ -207,16 +207,16 @@ static int call_step_hook(struct pt_regs *regs, unsigned int esr) · 206 unmodified lines
207207
208208 list = user_mode(regs) ? &user_step_hook : &kernel_step_hook;
209209
210− rcu_read_lock();
211−
210+ /*
211+ * Since single-step exception disables interrupt, this function is
212+ * entirely not preemptible, and we can use rcu list safely here.
213+ */
212214 list_for_each_entry_rcu(hook, list, node) {
213215 retval = hook->fn(regs, esr);
214216 if (retval == DBG_HOOK_HANDLED)
215217 break;
216218 }
217219
218− rcu_read_unlock();
219−
220220 return retval;
221221 }
222222 NOKPROBE_SYMBOL(call_step_hook);
@@ -305,14 +305,16 @@ static int call_break_hook(struct pt_regs *regs, unsigned int esr) · 82 unmodified lines
305305
306306 list = user_mode(regs) ? &user_break_hook : &kernel_break_hook;
307307
308− rcu_read_lock();
308+ /*
309+ * Since brk exception disables interrupt, this function is
310+ * entirely not preemptible, and we can use rcu list safely here.
311+ */
309312 list_for_each_entry_rcu(hook, list, node) {
310313 unsigned int comment = esr & ESR_ELx_BRK64_ISS_COMMENT_MASK;
311314
312315 if ((comment & ~hook->mask) == hook->imm)
313316 fn = hook->fn;
314317 }
315− rcu_read_unlock();
316318
317319 return fn ? fn(regs, esr) : DBG_HOOK_ERROR;
318320 }
arch/arm64/kernel/hw_breakpoint.c+8−3
@@ -536,13 +536,18 @@ int hw_breakpoint_arch_parse(struct perf_event *bp, · 535 unmodified lines
536536 /* Aligned */
537537 break;
538538 case 1:
539− /* Allow single byte watchpoint. */
540− if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1)
541− break;
542539 case 2:
543540 /* Allow halfword watchpoints and breakpoints. */
544541 if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2)
545542 break;
543+
544+ /* Fallthrough */
545+ case 3:
546+ /* Allow single byte watchpoint. */
547+ if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1)
548+ break;
549+
550+ /* Fallthrough */
546551 default:
547552 return -EINVAL;
548553 }
arch/arm64/kernel/module.c+4−0
@@ -314,18 +314,21 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, · 313 unmodified lines
314314 /* MOVW instruction relocations. */
315315 case R_AARCH64_MOVW_UABS_G0_NC:
316316 overflow_check = false;
317+ /* Fall through */
317318 case R_AARCH64_MOVW_UABS_G0:
318319 ovf = reloc_insn_movw(RELOC_OP_ABS, loc, val, 0,
319320 AARCH64_INSN_IMM_MOVKZ);
320321 break;
321322 case R_AARCH64_MOVW_UABS_G1_NC:
322323 overflow_check = false;
324+ /* Fall through */
323325 case R_AARCH64_MOVW_UABS_G1:
324326 ovf = reloc_insn_movw(RELOC_OP_ABS, loc, val, 16,
325327 AARCH64_INSN_IMM_MOVKZ);
326328 break;
327329 case R_AARCH64_MOVW_UABS_G2_NC:
328330 overflow_check = false;
331+ /* Fall through */
329332 case R_AARCH64_MOVW_UABS_G2:
330333 ovf = reloc_insn_movw(RELOC_OP_ABS, loc, val, 32,
331334 AARCH64_INSN_IMM_MOVKZ);
@@ -393,6 +396,7 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, · 61 unmodified lines
393396 break;
394397 case R_AARCH64_ADR_PREL_PG_HI21_NC:
395398 overflow_check = false;
399+ /* Fall through */
396400 case R_AARCH64_ADR_PREL_PG_HI21:
397401 ovf = reloc_insn_adrp(me, sechdrs, loc, val);
398402 if (ovf && ovf != -ERANGE)
arch/arm64/kernel/probes/kprobes.c+6−34
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <asm/ptrace.h>
2222 #include <asm/cacheflush.h>
2323 #include <asm/debug-monitors.h>
24+#include <asm/daifflags.h>
2425 #include <asm/system_misc.h>
2526 #include <asm/insn.h>
2627 #include <linux/uaccess.h>
@@ -167,33 +168,6 @@ static void __kprobes set_current_kprobe(struct kprobe *p) · 140 unmodified lines
167168 __this_cpu_write(current_kprobe, p);
168169 }
169170
170−/*
171− * When PSTATE.D is set (masked), then software step exceptions can not be
172− * generated.
173− * SPSR's D bit shows the value of PSTATE.D immediately before the
174− * exception was taken. PSTATE.D is set while entering into any exception
175− * mode, however software clears it for any normal (none-debug-exception)
176− * mode in the exception entry. Therefore, when we are entering into kprobe
177− * breakpoint handler from any normal mode then SPSR.D bit is already
178− * cleared, however it is set when we are entering from any debug exception
179− * mode.
180− * Since we always need to generate single step exception after a kprobe
181− * breakpoint exception therefore we need to clear it unconditionally, when
182− * we become sure that the current breakpoint exception is for kprobe.
183− */
184−static void __kprobes
185−spsr_set_debug_flag(struct pt_regs *regs, int mask)
186−{
187− unsigned long spsr = regs->pstate;
188−
189− if (mask)
190− spsr |= PSR_D_BIT;
191− else
192− spsr &= ~PSR_D_BIT;
193−
194− regs->pstate = spsr;
195−}
196−
197171 /*
198172 * Interrupts need to be disabled before single-step mode is set, and not
199173 * reenabled until after single-step mode ends.
@@ -205,17 +179,17 @@ spsr_set_debug_flag(struct pt_regs *regs, int mask) · 5 unmodified lines
205179 static void __kprobes kprobes_save_local_irqflag(struct kprobe_ctlblk *kcb,
206180 struct pt_regs *regs)
207181 {
208− kcb->saved_irqflag = regs->pstate;
182+ kcb->saved_irqflag = regs->pstate & DAIF_MASK;
209183 regs->pstate |= PSR_I_BIT;
184+ /* Unmask PSTATE.D for enabling software step exceptions. */
185+ regs->pstate &= ~PSR_D_BIT;
210186 }
211187
212188 static void __kprobes kprobes_restore_local_irqflag(struct kprobe_ctlblk *kcb,
213189 struct pt_regs *regs)
214190 {
215− if (kcb->saved_irqflag & PSR_I_BIT)
216− regs->pstate |= PSR_I_BIT;
217− else
218− regs->pstate &= ~PSR_I_BIT;
191+ regs->pstate &= ~DAIF_MASK;
192+ regs->pstate |= kcb->saved_irqflag;
219193 }
220194
221195 static void __kprobes
@@ -252,8 +226,6 @@ static void __kprobes setup_singlestep(struct kprobe *p, · 30 unmodified lines
252226
253227 set_ss_context(kcb, slot); /* mark pending ss */
254228
255− spsr_set_debug_flag(regs, 0);
256−
257229 /* IRQs and single stepping do not mix well. */
258230 kprobes_save_local_irqflag(kcb, regs);
259231 kernel_enable_single_step(regs);
arch/arm64/kernel/return_address.c+3−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88
99 #include <linux/export.h>
1010 #include <linux/ftrace.h>
11+#include <linux/kprobes.h>
1112
1213 #include <asm/stack_pointer.h>
1314 #include <asm/stacktrace.h>
@@ -29,6 +30,7 @@ static int save_return_addr(struct stackframe *frame, void *d) · 15 unmodified lines
2930 return 0;
3031 }
3132 }
33+NOKPROBE_SYMBOL(save_return_addr);
3234
3335 void *return_address(unsigned int level)
3436 {
@@ -49,3 +51,4 @@ void *return_address(unsigned int level) · 14 unmodified lines
4951 return NULL;
5052 }
5153 EXPORT_SYMBOL_GPL(return_address);
54+NOKPROBE_SYMBOL(return_address);
arch/arm64/kernel/smp.c+1−1
@@ -152,8 +152,8 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) · 151 unmodified lines
152152 pr_crit("CPU%u: died during early boot\n", cpu);
153153 break;
154154 }
155− /* Fall through */
156155 pr_crit("CPU%u: may not have shut down cleanly\n", cpu);
156+ /* Fall through */
157157 case CPU_STUCK_IN_KERNEL:
158158 pr_crit("CPU%u: is stuck in kernel\n", cpu);
159159 if (status & CPU_STUCK_REASON_52_BIT_VA)
arch/arm64/kernel/stacktrace.c+3−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 #include <linux/kernel.h>
88 #include <linux/export.h>
99 #include <linux/ftrace.h>
10+#include <linux/kprobes.h>
1011 #include <linux/sched.h>
1112 #include <linux/sched/debug.h>
1213 #include <linux/sched/task_stack.h>
@@ -111,6 +112,7 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame) · 98 unmodified lines
111112
112113 return 0;
113114 }
115+NOKPROBE_SYMBOL(unwind_frame);
114116
115117 void notrace walk_stackframe(struct task_struct *tsk, struct stackframe *frame,
116118 int (*fn)(struct stackframe *, void *), void *data)
@@ -125,6 +127,7 @@ void notrace walk_stackframe(struct task_struct *tsk, struct stackframe *frame, · 8 unmodified lines
125127 break;
126128 }
127129 }
130+NOKPROBE_SYMBOL(walk_stackframe);
128131
129132 #ifdef CONFIG_STACKTRACE
130133 struct stack_trace_data {
arch/arm64/kernel/traps.c+1−0
@@ -733,6 +733,7 @@ static const char *esr_class_str[] = { · 732 unmodified lines
733733 [ESR_ELx_EC_CP14_LS] = "CP14 LDC/STC",
734734 [ESR_ELx_EC_FP_ASIMD] = "ASIMD",
735735 [ESR_ELx_EC_CP10_ID] = "CP10 MRC/VMRS",
736+ [ESR_ELx_EC_PAC] = "PAC",
736737 [ESR_ELx_EC_CP14_64] = "CP14 MCRR/MRRC",
737738 [ESR_ELx_EC_ILL] = "PSTATE.IL",
738739 [ESR_ELx_EC_SVC32] = "SVC (AArch32)",
arch/arm64/kvm/hyp/debug-sr.c+30−0
@@ -18,40 +18,70 @@ · 17 unmodified lines
1818 #define save_debug(ptr,reg,nr) \
1919 switch (nr) { \
2020 case 15: ptr[15] = read_debug(reg, 15); \
21+ /* Fall through */ \
2122 case 14: ptr[14] = read_debug(reg, 14); \
23+ /* Fall through */ \
2224 case 13: ptr[13] = read_debug(reg, 13); \
25+ /* Fall through */ \
2326 case 12: ptr[12] = read_debug(reg, 12); \
27+ /* Fall through */ \
2428 case 11: ptr[11] = read_debug(reg, 11); \
29+ /* Fall through */ \
2530 case 10: ptr[10] = read_debug(reg, 10); \
31+ /* Fall through */ \
2632 case 9: ptr[9] = read_debug(reg, 9); \
33+ /* Fall through */ \
2734 case 8: ptr[8] = read_debug(reg, 8); \
35+ /* Fall through */ \
2836 case 7: ptr[7] = read_debug(reg, 7); \
37+ /* Fall through */ \
2938 case 6: ptr[6] = read_debug(reg, 6); \
39+ /* Fall through */ \
3040 case 5: ptr[5] = read_debug(reg, 5); \
41+ /* Fall through */ \
3142 case 4: ptr[4] = read_debug(reg, 4); \
43+ /* Fall through */ \
3244 case 3: ptr[3] = read_debug(reg, 3); \
45+ /* Fall through */ \
3346 case 2: ptr[2] = read_debug(reg, 2); \
47+ /* Fall through */ \
3448 case 1: ptr[1] = read_debug(reg, 1); \
49+ /* Fall through */ \
3550 default: ptr[0] = read_debug(reg, 0); \
3651 }
3752
3853 #define restore_debug(ptr,reg,nr) \
3954 switch (nr) { \
4055 case 15: write_debug(ptr[15], reg, 15); \
56+ /* Fall through */ \
4157 case 14: write_debug(ptr[14], reg, 14); \
58+ /* Fall through */ \
4259 case 13: write_debug(ptr[13], reg, 13); \
60+ /* Fall through */ \
4361 case 12: write_debug(ptr[12], reg, 12); \
62+ /* Fall through */ \
4463 case 11: write_debug(ptr[11], reg, 11); \
64+ /* Fall through */ \
4565 case 10: write_debug(ptr[10], reg, 10); \
66+ /* Fall through */ \
4667 case 9: write_debug(ptr[9], reg, 9); \
68+ /* Fall through */ \
4769 case 8: write_debug(ptr[8], reg, 8); \
70+ /* Fall through */ \
4871 case 7: write_debug(ptr[7], reg, 7); \
72+ /* Fall through */ \
4973 case 6: write_debug(ptr[6], reg, 6); \
74+ /* Fall through */ \
5075 case 5: write_debug(ptr[5], reg, 5); \
76+ /* Fall through */ \
5177 case 4: write_debug(ptr[4], reg, 4); \
78+ /* Fall through */ \
5279 case 3: write_debug(ptr[3], reg, 3); \
80+ /* Fall through */ \
5381 case 2: write_debug(ptr[2], reg, 2); \
82+ /* Fall through */ \
5483 case 1: write_debug(ptr[1], reg, 1); \
84+ /* Fall through */ \
5585 default: write_debug(ptr[0], reg, 0); \
5686 }
5787
arch/arm64/kvm/regmap.c+5−0
@@ -178,13 +178,18 @@ void vcpu_write_spsr32(struct kvm_vcpu *vcpu, unsigned long v) · 177 unmodified lines
178178 switch (spsr_idx) {
179179 case KVM_SPSR_SVC:
180180 write_sysreg_el1(v, SYS_SPSR);
181+ break;
181182 case KVM_SPSR_ABT:
182183 write_sysreg(v, spsr_abt);
184+ break;
183185 case KVM_SPSR_UND:
184186 write_sysreg(v, spsr_und);
187+ break;
185188 case KVM_SPSR_IRQ:
186189 write_sysreg(v, spsr_irq);
190+ break;
187191 case KVM_SPSR_FIQ:
188192 write_sysreg(v, spsr_fiq);
193+ break;
189194 }
190195 }
arch/arm64/kvm/sys_regs.c+18−14
@@ -632,7 +632,7 @@ static void reset_pmcr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) · 631 unmodified lines
632632 */
633633 val = ((pmcr & ~ARMV8_PMU_PMCR_MASK)
634634 | (ARMV8_PMU_PMCR_MASK & 0xdecafbad)) & (~ARMV8_PMU_PMCR_E);
635− __vcpu_sys_reg(vcpu, PMCR_EL0) = val;
635+ __vcpu_sys_reg(vcpu, r->reg) = val;
636636 }
637637
638638 static bool check_pmu_access_disabled(struct kvm_vcpu *vcpu, u64 flags)
@@ -981,13 +981,13 @@ static bool access_pmuserenr(struct kvm_vcpu *vcpu, struct sys_reg_params *p, · 342 unmodified lines
981981 /* Silly macro to expand the DBG{BCR,BVR,WVR,WCR}n_EL1 registers in one go */
982982 #define DBG_BCR_BVR_WCR_WVR_EL1(n) \
983983 { SYS_DESC(SYS_DBGBVRn_EL1(n)), \
984− trap_bvr, reset_bvr, n, 0, get_bvr, set_bvr }, \
984+ trap_bvr, reset_bvr, 0, 0, get_bvr, set_bvr }, \
985985 { SYS_DESC(SYS_DBGBCRn_EL1(n)), \
986− trap_bcr, reset_bcr, n, 0, get_bcr, set_bcr }, \
986+ trap_bcr, reset_bcr, 0, 0, get_bcr, set_bcr }, \
987987 { SYS_DESC(SYS_DBGWVRn_EL1(n)), \
988− trap_wvr, reset_wvr, n, 0, get_wvr, set_wvr }, \
988+ trap_wvr, reset_wvr, 0, 0, get_wvr, set_wvr }, \
989989 { SYS_DESC(SYS_DBGWCRn_EL1(n)), \
990− trap_wcr, reset_wcr, n, 0, get_wcr, set_wcr }
990+ trap_wcr, reset_wcr, 0, 0, get_wcr, set_wcr }
991991
992992 /* Macro to expand the PMEVCNTRn_EL0 register */
993993 #define PMU_PMEVCNTR_EL0(n) \
@@ -1540,7 +1540,7 @@ static const struct sys_reg_desc sys_reg_descs[] = { · 546 unmodified lines
15401540 { SYS_DESC(SYS_CSSELR_EL1), access_csselr, reset_unknown, CSSELR_EL1 },
15411541 { SYS_DESC(SYS_CTR_EL0), access_ctr },
15421542
1543− { SYS_DESC(SYS_PMCR_EL0), access_pmcr, reset_pmcr, },
1543+ { SYS_DESC(SYS_PMCR_EL0), access_pmcr, reset_pmcr, PMCR_EL0 },
15441544 { SYS_DESC(SYS_PMCNTENSET_EL0), access_pmcnten, reset_unknown, PMCNTENSET_EL0 },
15451545 { SYS_DESC(SYS_PMCNTENCLR_EL0), access_pmcnten, NULL, PMCNTENSET_EL0 },
15461546 { SYS_DESC(SYS_PMOVSCLR_EL0), access_pmovs, NULL, PMOVSSET_EL0 },
@@ -2254,13 +2254,19 @@ static int emulate_sys_reg(struct kvm_vcpu *vcpu, · 707 unmodified lines
22542254 }
22552255
22562256 static void reset_sys_reg_descs(struct kvm_vcpu *vcpu,
2257− const struct sys_reg_desc *table, size_t num)
2257+ const struct sys_reg_desc *table, size_t num,
2258+ unsigned long *bmap)
22582259 {
22592260 unsigned long i;
22602261
22612262 for (i = 0; i < num; i++)
2262− if (table[i].reset)
2263+ if (table[i].reset) {
2264+ int reg = table[i].reg;
2265+
22632266 table[i].reset(vcpu, &table[i]);
2267+ if (reg > 0 && reg < NR_SYS_REGS)
2268+ set_bit(reg, bmap);
2269+ }
22642270 }
22652271
22662272 /**
@@ -2774,18 +2780,16 @@ void kvm_reset_sys_regs(struct kvm_vcpu *vcpu) · 507 unmodified lines
27742780 {
27752781 size_t num;
27762782 const struct sys_reg_desc *table;
2777−
2778− /* Catch someone adding a register without putting in reset entry. */
2779− memset(&vcpu->arch.ctxt.sys_regs, 0x42, sizeof(vcpu->arch.ctxt.sys_regs));
2783+ DECLARE_BITMAP(bmap, NR_SYS_REGS) = { 0, };
27802784
27812785 /* Generic chip reset first (so target could override). */
2782− reset_sys_reg_descs(vcpu, sys_reg_descs, ARRAY_SIZE(sys_reg_descs));
2786+ reset_sys_reg_descs(vcpu, sys_reg_descs, ARRAY_SIZE(sys_reg_descs), bmap);
27832787
27842788 table = get_target_table(vcpu->arch.target, true, &num);
2785− reset_sys_reg_descs(vcpu, table, num);
2789+ reset_sys_reg_descs(vcpu, table, num, bmap);
27862790
27872791 for (num = 1; num < NR_SYS_REGS; num++) {
2788− if (WARN(__vcpu_sys_reg(vcpu, num) == 0x4242424242424242,
2792+ if (WARN(!test_bit(num, bmap),
27892793 "Didn't reset __vcpu_sys_reg(%zi)\n", num))
27902794 break;
27912795 }
arch/arm64/mm/fault.c+49−8
@@ -777,6 +777,53 @@ void __init hook_debug_fault_code(int nr, · 776 unmodified lines
777777 debug_fault_info[nr].name = name;
778778 }
779779
780+/*
781+ * In debug exception context, we explicitly disable preemption despite
782+ * having interrupts disabled.
783+ * This serves two purposes: it makes it much less likely that we would
784+ * accidentally schedule in exception context and it will force a warning
785+ * if we somehow manage to schedule by accident.
786+ */
787+static void debug_exception_enter(struct pt_regs *regs)
788+{
789+ /*
790+ * Tell lockdep we disabled irqs in entry.S. Do nothing if they were
791+ * already disabled to preserve the last enabled/disabled addresses.
792+ */
793+ if (interrupts_enabled(regs))
794+ trace_hardirqs_off();
795+
796+ if (user_mode(regs)) {
797+ RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU");
798+ } else {
799+ /*
800+ * We might have interrupted pretty much anything. In
801+ * fact, if we're a debug exception, we can even interrupt
802+ * NMI processing. We don't want this code makes in_nmi()
803+ * to return true, but we need to notify RCU.
804+ */
805+ rcu_nmi_enter();
806+ }
807+
808+ preempt_disable();
809+
810+ /* This code is a bit fragile. Test it. */
811+ RCU_LOCKDEP_WARN(!rcu_is_watching(), "exception_enter didn't work");
812+}
813+NOKPROBE_SYMBOL(debug_exception_enter);
814+
815+static void debug_exception_exit(struct pt_regs *regs)
816+{
817+ preempt_enable_no_resched();
818+
819+ if (!user_mode(regs))
820+ rcu_nmi_exit();
821+
822+ if (interrupts_enabled(regs))
823+ trace_hardirqs_on();
824+}
825+NOKPROBE_SYMBOL(debug_exception_exit);
826+
780827 #ifdef CONFIG_ARM64_ERRATUM_1463225
781828 DECLARE_PER_CPU(int, __in_cortex_a76_erratum_1463225_wa);
782829
@@ -817,12 +864,7 @@ asmlinkage void __exception do_debug_exception(unsigned long addr_if_watchpoint, · 34 unmodified lines
817864 if (cortex_a76_erratum_1463225_debug_handler(regs))
818865 return;
819866
820− /*
821− * Tell lockdep we disabled irqs in entry.S. Do nothing if they were
822− * already disabled to preserve the last enabled/disabled addresses.
823− */
824− if (interrupts_enabled(regs))
825− trace_hardirqs_off();
867+ debug_exception_enter(regs);
826868
827869 if (user_mode(regs) && !is_ttbr0_addr(pc))
828870 arm64_apply_bp_hardening();
@@ -832,7 +874,6 @@ asmlinkage void __exception do_debug_exception(unsigned long addr_if_watchpoint, · 3 unmodified lines
832874 inf->sig, inf->code, (void __user *)pc, esr);
833875 }
834876
835− if (interrupts_enabled(regs))
836− trace_hardirqs_on();
877+ debug_exception_exit(regs);
837878 }
838879 NOKPROBE_SYMBOL(do_debug_exception);
arch/mips/cavium-octeon/octeon-usb.c+1−0
@@ -398,6 +398,7 @@ static int dwc3_octeon_clocks_start(struct device *dev, u64 base) · 397 unmodified lines
398398 default:
399399 dev_err(dev, "Invalid ref_clk %u, using 100000000 instead\n",
400400 clock_rate);
401+ /* fall through */
401402 case 100000000:
402403 mpll_mul = 0x19;
403404 if (ref_clk_sel < 2)
arch/mips/kernel/cacheinfo.c+2−0
@@ -69,6 +69,8 @@ static int __populate_cache_leaves(unsigned int cpu) · 68 unmodified lines
6969 if (c->tcache.waysize)
7070 populate_cache(tcache, this_leaf, 3, CACHE_TYPE_UNIFIED);
7171
72+ this_cpu_ci->cpu_map_populated = true;
73+
7274 return 0;
7375 }
7476
arch/mips/kernel/i8253.c+2−1
@@ -32,7 +32,8 @@ void __init setup_pit_timer(void) · 31 unmodified lines
3232
3333 static int __init init_pit_clocksource(void)
3434 {
35− if (num_possible_cpus() > 1) /* PIT does not scale! */
35+ if (num_possible_cpus() > 1 || /* PIT does not scale! */
36+ !clockevent_state_periodic(&i8253_clockevent))
3637 return 0;
3738
3839 return clocksource_i8253_init();
arch/mips/kvm/emulate.c+1−0
@@ -140,6 +140,7 @@ static int kvm_compute_return_epc(struct kvm_vcpu *vcpu, unsigned long instpc, · 139 unmodified lines
140140 /* These are unconditional and in j_format. */
141141 case jal_op:
142142 arch->gprs[31] = instpc + 8;
143+ /* fall through */
143144 case j_op:
144145 epc += 4;
145146 epc >>= 28;
arch/mips/kvm/mips.c+0−10
@@ -150,16 +150,6 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type) · 149 unmodified lines
150150 return 0;
151151 }
152152
153−bool kvm_arch_has_vcpu_debugfs(void)
154−{
155− return false;
156−}
157−
158−int kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu)
159−{
160− return 0;
161−}
162−
163153 void kvm_mips_free_vcpus(struct kvm *kvm)
164154 {
165155 unsigned int i;
arch/mips/oprofile/op_model_mipsxx.c+13−0
@@ -172,12 +172,15 @@ static void mipsxx_cpu_setup(void *args) · 171 unmodified lines
172172 case 4:
173173 w_c0_perfctrl3(0);
174174 w_c0_perfcntr3(reg.counter[3]);
175+ /* fall through */
175176 case 3:
176177 w_c0_perfctrl2(0);
177178 w_c0_perfcntr2(reg.counter[2]);
179+ /* fall through */
178180 case 2:
179181 w_c0_perfctrl1(0);
180182 w_c0_perfcntr1(reg.counter[1]);
183+ /* fall through */
181184 case 1:
182185 w_c0_perfctrl0(0);
183186 w_c0_perfcntr0(reg.counter[0]);
@@ -195,10 +198,13 @@ static void mipsxx_cpu_start(void *args) · 11 unmodified lines
195198 switch (counters) {
196199 case 4:
197200 w_c0_perfctrl3(WHAT | reg.control[3]);
201+ /* fall through */
198202 case 3:
199203 w_c0_perfctrl2(WHAT | reg.control[2]);
204+ /* fall through */
200205 case 2:
201206 w_c0_perfctrl1(WHAT | reg.control[1]);
207+ /* fall through */
202208 case 1:
203209 w_c0_perfctrl0(WHAT | reg.control[0]);
204210 }
@@ -215,10 +221,13 @@ static void mipsxx_cpu_stop(void *args) · 10 unmodified lines
215221 switch (counters) {
216222 case 4:
217223 w_c0_perfctrl3(0);
224+ /* fall through */
218225 case 3:
219226 w_c0_perfctrl2(0);
227+ /* fall through */
220228 case 2:
221229 w_c0_perfctrl1(0);
230+ /* fall through */
222231 case 1:
223232 w_c0_perfctrl0(0);
224233 }
@@ -236,6 +245,7 @@ static int mipsxx_perfcount_handler(void) · 11 unmodified lines
236245
237246 switch (counters) {
238247 #define HANDLE_COUNTER(n) \
248+ /* fall through */ \
239249 case n + 1: \
240250 control = r_c0_perfctrl ## n(); \
241251 counter = r_c0_perfcntr ## n(); \
@@ -297,12 +307,15 @@ static void reset_counters(void *arg) · 55 unmodified lines
297307 case 4:
298308 w_c0_perfctrl3(0);
299309 w_c0_perfcntr3(0);
310+ /* fall through */
300311 case 3:
301312 w_c0_perfctrl2(0);
302313 w_c0_perfcntr2(0);
314+ /* fall through */
303315 case 2:
304316 w_c0_perfctrl1(0);
305317 w_c0_perfcntr1(0);
318+ /* fall through */
306319 case 1:
307320 w_c0_perfctrl0(0);
308321 w_c0_perfcntr0(0);
arch/mips/pci/ops-bcm63xx.c+1−0
@@ -474,6 +474,7 @@ static int bcm63xx_pcie_can_access(struct pci_bus *bus, int devfn) · 473 unmodified lines
474474 if (PCI_SLOT(devfn) == 0)
475475 return bcm_pcie_readl(PCIE_DLSTATUS_REG)
476476 & DLSTATUS_PHYLINKUP;
477+ /* else, fall through */
477478 default:
478479 return false;
479480 }
arch/mips/vdso/vdso.h+1−0
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 #if _MIPS_SIM != _MIPS_SIM_ABI64 && defined(CONFIG_64BIT)
1010
1111 /* Building 32-bit VDSO for the 64-bit kernel. Fake a 32-bit Kconfig. */
12+#define BUILD_VDSO32_64
1213 #undef CONFIG_64BIT
1314 #define CONFIG_32BIT 1
1415 #ifndef __ASSEMBLY__
arch/parisc/Makefile+3−2
@@ -19,8 +19,6 @@ · 18 unmodified lines
1919
2020 KBUILD_IMAGE := vmlinuz
2121
22−KBUILD_DEFCONFIG := default_defconfig
23−
2422 NM = sh $(srctree)/arch/parisc/nm
2523 CHECKFLAGS += -D__hppa__=1
2624 LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
@@ -182,5 +180,8 @@ define archhelp · 155 unmodified lines
182180 @echo ' zinstall - Install compressed vmlinuz kernel'
183181 endef
184182
183+archclean:
184+ $(Q)$(MAKE) $(clean)=$(boot)
185+
185186 archheaders:
186187 $(Q)$(MAKE) $(build)=arch/parisc/kernel/syscalls all
arch/parisc/boot/compressed/Makefile+3−1
@@ -12,6 +12,7 @@ UBSAN_SANITIZE := n · 11 unmodified lines
1212 targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
1313 targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
1414 targets += misc.o piggy.o sizes.h head.o real2.o firmware.o
15+targets += real2.S firmware.c
1516
1617 KBUILD_CFLAGS := -D__KERNEL__ -O2 -DBOOTLOADER
1718 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
@@ -55,7 +56,8 @@ $(obj)/misc.o: $(obj)/sizes.h · 37 unmodified lines
5556 CPPFLAGS_vmlinux.lds += -I$(objtree)/$(obj) -DBOOTLOADER
5657 $(obj)/vmlinux.lds: $(obj)/sizes.h
5758
58−$(obj)/vmlinux.bin: vmlinux
59+OBJCOPYFLAGS_vmlinux.bin := -R .comment -R .note -S
60+$(obj)/vmlinux.bin: vmlinux FORCE
5961 $(call if_changed,objcopy)
6062
6163 vmlinux.bin.all-y := $(obj)/vmlinux.bin
arch/parisc/boot/compressed/vmlinux.lds.S+2−2
@@ -48,8 +48,8 @@ SECTIONS · 47 unmodified lines
4848 *(.rodata.compressed)
4949 }
5050
51− /* bootloader code and data starts behind area of extracted kernel */
52− . = (SZ_end - SZparisc_kernel_start + KERNEL_BINARY_TEXT_START);
51+ /* bootloader code and data starts at least behind area of extracted kernel */
52+ . = MAX(ABSOLUTE(.), (SZ_end - SZparisc_kernel_start + KERNEL_BINARY_TEXT_START));
5353
5454 /* align on next page boundary */
5555 . = ALIGN(4096);
arch/parisc/configs/defconfigrenamed from arch/parisc/configs/default_defconfig+0−0

File renamed without changes.

arch/parisc/kernel/ftrace.c+2−1
@@ -181,8 +181,9 @@ int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec, · 180 unmodified lines
181181 for (i = 0; i < ARRAY_SIZE(insn); i++)
182182 insn[i] = INSN_NOP;
183183
184+ __patch_text((void *)rec->ip, INSN_NOP);
184185 __patch_text_multiple((void *)rec->ip + 4 - sizeof(insn),
185− insn, sizeof(insn));
186+ insn, sizeof(insn)-4);
186187 return 0;
187188 }
188189 #endif
arch/parisc/math-emu/Makefile+1−0
@@ -18,3 +18,4 @@ obj-y := frnd.o driver.o decode_exc.o fpudispatch.o denormal.o \ · 17 unmodified lines
1818 # other very old or stripped-down PA-RISC CPUs -- not currently supported
1919
2020 obj-$(CONFIG_MATH_EMULATION) += unimplemented-math-emulation.o
21+CFLAGS_REMOVE_fpudispatch.o = -Wimplicit-fallthrough
arch/parisc/mm/fault.c+1−0
@@ -66,6 +66,7 @@ parisc_acctyp(unsigned long code, unsigned int inst) · 65 unmodified lines
6666 case 0x30000000: /* coproc2 */
6767 if (bit22set(inst))
6868 return VM_WRITE;
69+ /* fall through */
6970
7071 case 0x0: /* indexed/memory management */
7172 if (bit22set(inst)) {
arch/powerpc/include/asm/cache.h+4−4
@@ -107,22 +107,22 @@ extern void _set_L3CR(unsigned long); · 106 unmodified lines
107107
108108 static inline void dcbz(void *addr)
109109 {
110− __asm__ __volatile__ ("dcbz %y0" : : "Z"(*(u8 *)addr) : "memory");
110+ __asm__ __volatile__ ("dcbz 0, %0" : : "r"(addr) : "memory");
111111 }
112112
113113 static inline void dcbi(void *addr)
114114 {
115− __asm__ __volatile__ ("dcbi %y0" : : "Z"(*(u8 *)addr) : "memory");
115+ __asm__ __volatile__ ("dcbi 0, %0" : : "r"(addr) : "memory");
116116 }
117117
118118 static inline void dcbf(void *addr)
119119 {
120− __asm__ __volatile__ ("dcbf %y0" : : "Z"(*(u8 *)addr) : "memory");
120+ __asm__ __volatile__ ("dcbf 0, %0" : : "r"(addr) : "memory");
121121 }
122122
123123 static inline void dcbst(void *addr)
124124 {
125− __asm__ __volatile__ ("dcbst %y0" : : "Z"(*(u8 *)addr) : "memory");
125+ __asm__ __volatile__ ("dcbst 0, %0" : : "r"(addr) : "memory");
126126 }
127127 #endif /* !__ASSEMBLY__ */
128128 #endif /* __KERNEL__ */
arch/powerpc/include/asm/unistd.h+1−0
@@ -49,6 +49,7 @@ · 48 unmodified lines
4949 #define __ARCH_WANT_SYS_FORK
5050 #define __ARCH_WANT_SYS_VFORK
5151 #define __ARCH_WANT_SYS_CLONE
52+#define __ARCH_WANT_SYS_CLONE3
5253
5354 #endif /* __ASSEMBLY__ */
5455 #endif /* _ASM_POWERPC_UNISTD_H_ */
arch/powerpc/kernel/align.c+4−0
@@ -176,9 +176,11 @@ static int emulate_spe(struct pt_regs *regs, unsigned int reg, · 175 unmodified lines
176176 ret |= __get_user_inatomic(temp.v[1], p++);
177177 ret |= __get_user_inatomic(temp.v[2], p++);
178178 ret |= __get_user_inatomic(temp.v[3], p++);
179+ /* fall through */
179180 case 4:
180181 ret |= __get_user_inatomic(temp.v[4], p++);
181182 ret |= __get_user_inatomic(temp.v[5], p++);
183+ /* fall through */
182184 case 2:
183185 ret |= __get_user_inatomic(temp.v[6], p++);
184186 ret |= __get_user_inatomic(temp.v[7], p++);
@@ -259,9 +261,11 @@ static int emulate_spe(struct pt_regs *regs, unsigned int reg, · 74 unmodified lines
259261 ret |= __put_user_inatomic(data.v[1], p++);
260262 ret |= __put_user_inatomic(data.v[2], p++);
261263 ret |= __put_user_inatomic(data.v[3], p++);
264+ /* fall through */
262265 case 4:
263266 ret |= __put_user_inatomic(data.v[4], p++);
264267 ret |= __put_user_inatomic(data.v[5], p++);
268+ /* fall through */
265269 case 2:
266270 ret |= __put_user_inatomic(data.v[6], p++);
267271 ret |= __put_user_inatomic(data.v[7], p++);
arch/powerpc/kernel/entry_32.S+8−0
@@ -597,6 +597,14 @@ ppc_clone: · 596 unmodified lines
597597 stw r0,_TRAP(r1) /* register set saved */
598598 b sys_clone
599599
600+ .globl ppc_clone3
601+ppc_clone3:
602+ SAVE_NVGPRS(r1)
603+ lwz r0,_TRAP(r1)
604+ rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */
605+ stw r0,_TRAP(r1) /* register set saved */
606+ b sys_clone3
607+
600608 .globl ppc_swapcontext
601609 ppc_swapcontext:
602610 SAVE_NVGPRS(r1)
arch/powerpc/kernel/entry_64.S+5−0
@@ -487,6 +487,11 @@ _GLOBAL(ppc_clone) · 486 unmodified lines
487487 bl sys_clone
488488 b .Lsyscall_exit
489489
490+_GLOBAL(ppc_clone3)
491+ bl save_nvgprs
492+ bl sys_clone3
493+ b .Lsyscall_exit
494+
490495 _GLOBAL(ppc32_swapcontext)
491496 bl save_nvgprs
492497 bl compat_sys_swapcontext
arch/powerpc/kernel/syscalls/syscall.tbl+1−1
@@ -516,4 +516,4 @@ · 515 unmodified lines
516516 432 common fsmount sys_fsmount
517517 433 common fspick sys_fspick
518518 434 common pidfd_open sys_pidfd_open
519−# 435 reserved for clone3
519+435 nospu clone3 ppc_clone3
arch/powerpc/kvm/book3s_32_mmu.c+1−0
@@ -239,6 +239,7 @@ static int kvmppc_mmu_book3s_32_xlate_pte(struct kvm_vcpu *vcpu, gva_t eaddr, · 238 unmodified lines
239239 case 2:
240240 case 6:
241241 pte->may_write = true;
242+ /* fall through */
242243 case 3:
243244 case 5:
244245 case 7:
arch/powerpc/kvm/powerpc.c+5−10
@@ -50,6 +50,11 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *v) · 49 unmodified lines
5050 return !!(v->arch.pending_exceptions) || kvm_request_pending(v);
5151 }
5252
53+bool kvm_arch_dy_runnable(struct kvm_vcpu *vcpu)
54+{
55+ return kvm_arch_vcpu_runnable(vcpu);
56+}
57+
5358 bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu)
5459 {
5560 return false;
@@ -452,16 +457,6 @@ err_out: · 396 unmodified lines
452457 return -EINVAL;
453458 }
454459
455−bool kvm_arch_has_vcpu_debugfs(void)
456−{
457− return false;
458−}
459−
460−int kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu)
461−{
462− return 0;
463−}
464−
465460 void kvm_arch_destroy_vm(struct kvm *kvm)
466461 {
467462 unsigned int i;
arch/powerpc/mm/kasan/kasan_init_32.c+5−2
@@ -21,7 +21,7 @@ static void kasan_populate_pte(pte_t *ptep, pgprot_t prot) · 20 unmodified lines
2121 __set_pte_at(&init_mm, va, ptep, pfn_pte(PHYS_PFN(pa), prot), 0);
2222 }
2323
24−static int kasan_init_shadow_page_tables(unsigned long k_start, unsigned long k_end)
24+static int __ref kasan_init_shadow_page_tables(unsigned long k_start, unsigned long k_end)
2525 {
2626 pmd_t *pmd;
2727 unsigned long k_cur, k_next;
@@ -35,7 +35,10 @@ static int kasan_init_shadow_page_tables(unsigned long k_start, unsigned long k_ · 7 unmodified lines
3535 if ((void *)pmd_page_vaddr(*pmd) != kasan_early_shadow_pte)
3636 continue;
3737
38− new = pte_alloc_one_kernel(&init_mm);
38+ if (slab_is_available())
39+ new = pte_alloc_one_kernel(&init_mm);
40+ else
41+ new = memblock_alloc(PTE_FRAG_SIZE, PTE_FRAG_SIZE);
3942
4043 if (!new)
4144 return -ENOMEM;
arch/powerpc/platforms/pseries/papr_scm.c+27−2
@@ -275,12 +275,32 @@ static const struct attribute_group *papr_scm_dimm_groups[] = { · 274 unmodified lines
275275 NULL,
276276 };
277277
278+static inline int papr_scm_node(int node)
279+{
280+ int min_dist = INT_MAX, dist;
281+ int nid, min_node;
282+
283+ if ((node == NUMA_NO_NODE) || node_online(node))
284+ return node;
285+
286+ min_node = first_online_node;
287+ for_each_online_node(nid) {
288+ dist = node_distance(node, nid);
289+ if (dist < min_dist) {
290+ min_dist = dist;
291+ min_node = nid;
292+ }
293+ }
294+ return min_node;
295+}
296+
278297 static int papr_scm_nvdimm_init(struct papr_scm_priv *p)
279298 {
280299 struct device *dev = &p->pdev->dev;
281300 struct nd_mapping_desc mapping;
282301 struct nd_region_desc ndr_desc;
283302 unsigned long dimm_flags;
303+ int target_nid, online_nid;
284304
285305 p->bus_desc.ndctl = papr_scm_ndctl;
286306 p->bus_desc.module = THIS_MODULE;
@@ -319,8 +339,10 @@ static int papr_scm_nvdimm_init(struct papr_scm_priv *p) · 32 unmodified lines
319339
320340 memset(&ndr_desc, 0, sizeof(ndr_desc));
321341 ndr_desc.attr_groups = region_attr_groups;
322− ndr_desc.numa_node = dev_to_node(&p->pdev->dev);
323− ndr_desc.target_node = ndr_desc.numa_node;
342+ target_nid = dev_to_node(&p->pdev->dev);
343+ online_nid = papr_scm_node(target_nid);
344+ ndr_desc.numa_node = online_nid;
345+ ndr_desc.target_node = target_nid;
324346 ndr_desc.res = &p->res;
325347 ndr_desc.of_node = p->dn;
326348 ndr_desc.provider_data = p;
@@ -338,6 +360,9 @@ static int papr_scm_nvdimm_init(struct papr_scm_priv *p) · 11 unmodified lines
338360 ndr_desc.res, p->dn);
339361 goto err;
340362 }
363+ if (target_nid != online_nid)
364+ dev_info(dev, "Region registered with target node %d and online node %d",
365+ target_nid, online_nid);
341366
342367 return 0;
343368
arch/riscv/boot/dts/sifive/fu540-c000.dtsi+0−1
@@ -21,7 +21,6 @@ · 20 unmodified lines
2121 cpus {
2222 #address-cells = <1>;
2323 #size-cells = <0>;
24− timebase-frequency = <1000000>;
2524 cpu0: cpu@0 {
2625 compatible = "sifive,e51", "sifive,rocket0", "riscv";
2726 device_type = "cpu";
arch/riscv/configs/defconfig+5−5
@@ -34,6 +34,7 @@ CONFIG_PCIEPORTBUS=y · 33 unmodified lines
3434 CONFIG_PCI_HOST_GENERIC=y
3535 CONFIG_PCIE_XILINX=y
3636 CONFIG_DEVTMPFS=y
37+CONFIG_DEVTMPFS_MOUNT=y
3738 CONFIG_BLK_DEV_LOOP=y
3839 CONFIG_VIRTIO_BLK=y
3940 CONFIG_BLK_DEV_SD=y
@@ -53,6 +54,8 @@ CONFIG_SERIAL_8250_CONSOLE=y · 13 unmodified lines
5354 CONFIG_SERIAL_OF_PLATFORM=y
5455 CONFIG_SERIAL_EARLYCON_RISCV_SBI=y
5556 CONFIG_HVC_RISCV_SBI=y
57+CONFIG_SPI=y
58+CONFIG_SPI_SIFIVE=y
5659 # CONFIG_PTP_1588_CLOCK is not set
5760 CONFIG_DRM=y
5861 CONFIG_DRM_RADEON=y
@@ -66,8 +69,9 @@ CONFIG_USB_OHCI_HCD=y · 7 unmodified lines
6669 CONFIG_USB_OHCI_HCD_PLATFORM=y
6770 CONFIG_USB_STORAGE=y
6871 CONFIG_USB_UAS=y
72+CONFIG_MMC=y
73+CONFIG_MMC_SPI=y
6974 CONFIG_VIRTIO_MMIO=y
70−CONFIG_SPI_SIFIVE=y
7175 CONFIG_EXT4_FS=y
7276 CONFIG_EXT4_FS_POSIX_ACL=y
7377 CONFIG_AUTOFS4_FS=y
@@ -83,8 +87,4 @@ CONFIG_ROOT_NFS=y · 9 unmodified lines
8387 CONFIG_CRYPTO_USER_API_HASH=y
8488 CONFIG_CRYPTO_DEV_VIRTIO=y
8589 CONFIG_PRINTK_TIME=y
86−CONFIG_SPI=y
87−CONFIG_MMC_SPI=y
88−CONFIG_MMC=y
89−CONFIG_DEVTMPFS_MOUNT=y
9090 # CONFIG_RCU_TRACE is not set
arch/riscv/kernel/vdso/Makefile+1−1
@@ -37,7 +37,7 @@ $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE · 36 unmodified lines
3737 # these symbols in the kernel code rather than hand-coded addresses.
3838
3939 SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
40− -Wl,--hash-style=both
40+ -Wl,--build-id -Wl,--hash-style=both
4141 $(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/rt_sigreturn.o FORCE
4242 $(call if_changed,vdsold)
4343
arch/riscv/lib/Makefile+0−2
@@ -5,5 +5,3 @@ lib-y += memset.o · 4 unmodified lines
55 lib-y += uaccess.o
66
77 lib-$(CONFIG_64BIT) += tishift.o
8−
9−lib-$(CONFIG_32BIT) += udivdi3.o
arch/riscv/lib/delay.c+5−1
@@ -81,9 +81,13 @@ EXPORT_SYMBOL(__delay); · 80 unmodified lines
8181 void udelay(unsigned long usecs)
8282 {
8383 u64 ucycles = (u64)usecs * lpj_fine * UDELAY_MULT;
84+ u64 n;
8485
8586 if (unlikely(usecs > MAX_UDELAY_US)) {
86− __delay((u64)usecs * riscv_timebase / 1000000ULL);
87+ n = (u64)usecs * riscv_timebase;
88+ do_div(n, 1000000);
89+
90+ __delay(n);
8791 return;
8892 }
8993
arch/riscv/lib/udivdi3.S+0−32
@@ -1,32 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-only */
2−/*
3− * Copyright (C) 2016-2017 Free Software Foundation, Inc.
4− */
5−
6−#include <linux/linkage.h>
7−
8−ENTRY(__udivdi3)
9− mv a2, a1
10− mv a1, a0
11− li a0, -1
12− beqz a2, .L5
13− li a3, 1
14− bgeu a2, a1, .L2
15−.L1:
16− blez a2, .L2
17− slli a2, a2, 1
18− slli a3, a3, 1
19− bgtu a1, a2, .L1
20−.L2:
21− li a0, 0
22−.L3:
23− bltu a1, a2, .L4
24− sub a1, a1, a2
25− or a0, a0, a3
26−.L4:
27− srli a3, a3, 1
28− srli a2, a2, 1
29− bnez a3, .L3
30−.L5:
31− ret
32−ENDPROC(__udivdi3)
arch/s390/boot/boot.h+1−0
@@ -8,6 +8,7 @@ void store_ipl_parmblock(void); · 7 unmodified lines
88 void setup_boot_command_line(void);
99 void parse_boot_command_line(void);
1010 void setup_memory_end(void);
11+void verify_facilities(void);
1112 void print_missing_facilities(void);
1213 unsigned long get_random_base(unsigned long safe_addr);
1314
arch/s390/boot/ipl_parm.c+0−2
@@ -48,9 +48,7 @@ void store_ipl_parmblock(void) · 47 unmodified lines
4848 {
4949 int rc;
5050
51− uv_set_shared(__pa(&ipl_block));
5251 rc = __diag308(DIAG308_STORE, &ipl_block);
53− uv_remove_shared(__pa(&ipl_block));
5452 if (rc == DIAG308_RC_OK &&
5553 ipl_block.hdr.version <= IPL_MAX_SUPPORTED_VERSION)
5654 ipl_block_valid = 1;
arch/s390/boot/kaslr.c+1−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 #include <asm/timex.h>
88 #include <asm/sclp.h>
99 #include "compressed/decompressor.h"
10+#include "boot.h"
1011
1112 #define PRNG_MODE_TDES 1
1213 #define PRNG_MODE_SHA512 2
arch/s390/configs/debug_defconfig+199−131
@@ -3,6 +3,7 @@ CONFIG_POSIX_MQUEUE=y · 2 unmodified lines
33 CONFIG_AUDIT=y
44 CONFIG_NO_HZ_IDLE=y
55 CONFIG_HIGH_RES_TIMERS=y
6+CONFIG_PREEMPT=y
67 CONFIG_BSD_PROCESS_ACCT=y
78 CONFIG_BSD_PROCESS_ACCT_V3=y
89 CONFIG_TASKSTATS=y
@@ -18,55 +19,71 @@ CONFIG_BLK_CGROUP=y · 9 unmodified lines
1819 CONFIG_CFS_BANDWIDTH=y
1920 CONFIG_RT_GROUP_SCHED=y
2021 CONFIG_CGROUP_PIDS=y
22+CONFIG_CGROUP_RDMA=y
2123 CONFIG_CGROUP_FREEZER=y
2224 CONFIG_CGROUP_HUGETLB=y
2325 CONFIG_CPUSETS=y
2426 CONFIG_CGROUP_DEVICE=y
2527 CONFIG_CGROUP_CPUACCT=y
2628 CONFIG_CGROUP_PERF=y
29+CONFIG_CGROUP_BPF=y
2730 CONFIG_NAMESPACES=y
2831 CONFIG_USER_NS=y
32+CONFIG_CHECKPOINT_RESTORE=y
2933 CONFIG_SCHED_AUTOGROUP=y
3034 CONFIG_BLK_DEV_INITRD=y
3135 CONFIG_EXPERT=y
3236 # CONFIG_SYSFS_SYSCALL is not set
33−CONFIG_CHECKPOINT_RESTORE=y
3437 CONFIG_BPF_SYSCALL=y
3538 CONFIG_USERFAULTFD=y
3639 # CONFIG_COMPAT_BRK is not set
3740 CONFIG_PROFILING=y
41+CONFIG_LIVEPATCH=y
42+CONFIG_TUNE_ZEC12=y
43+CONFIG_NR_CPUS=512
44+CONFIG_NUMA=y
45+CONFIG_HZ_100=y
46+CONFIG_KEXEC_FILE=y
47+CONFIG_EXPOLINE=y
48+CONFIG_EXPOLINE_AUTO=y
49+CONFIG_CHSC_SCH=y
50+CONFIG_VFIO_CCW=m
51+CONFIG_VFIO_AP=m
52+CONFIG_CRASH_DUMP=y
53+CONFIG_HIBERNATION=y
54+CONFIG_PM_DEBUG=y
55+CONFIG_CMM=m
56+CONFIG_APPLDATA_BASE=y
57+CONFIG_KVM=m
58+CONFIG_VHOST_NET=m
59+CONFIG_VHOST_VSOCK=m
3860 CONFIG_OPROFILE=m
3961 CONFIG_KPROBES=y
4062 CONFIG_JUMP_LABEL=y
4163 CONFIG_STATIC_KEYS_SELFTEST=y
64+CONFIG_REFCOUNT_FULL=y
65+CONFIG_LOCK_EVENT_COUNTS=y
4266 CONFIG_MODULES=y
4367 CONFIG_MODULE_FORCE_LOAD=y
4468 CONFIG_MODULE_UNLOAD=y
4569 CONFIG_MODULE_FORCE_UNLOAD=y
4670 CONFIG_MODVERSIONS=y
4771 CONFIG_MODULE_SRCVERSION_ALL=y
72+CONFIG_MODULE_SIG=y
73+CONFIG_MODULE_SIG_SHA256=y
4874 CONFIG_BLK_DEV_INTEGRITY=y
4975 CONFIG_BLK_DEV_THROTTLING=y
5076 CONFIG_BLK_WBT=y
51−CONFIG_BLK_WBT_SQ=y
77+CONFIG_BLK_CGROUP_IOLATENCY=y
5278 CONFIG_PARTITION_ADVANCED=y
5379 CONFIG_IBM_PARTITION=y
5480 CONFIG_BSD_DISKLABEL=y
5581 CONFIG_MINIX_SUBPARTITION=y
5682 CONFIG_SOLARIS_X86_PARTITION=y
5783 CONFIG_UNIXWARE_DISKLABEL=y
58−CONFIG_CFQ_GROUP_IOSCHED=y
59−CONFIG_DEFAULT_DEADLINE=y
60−CONFIG_LIVEPATCH=y
61−CONFIG_TUNE_ZEC12=y
62−CONFIG_NR_CPUS=512
63−CONFIG_NUMA=y
64−CONFIG_PREEMPT=y
65−CONFIG_HZ_100=y
66−CONFIG_KEXEC_FILE=y
67−CONFIG_KEXEC_VERIFY_SIG=y
68−CONFIG_EXPOLINE=y
69−CONFIG_EXPOLINE_AUTO=y
84+CONFIG_IOSCHED_BFQ=y
85+CONFIG_BFQ_GROUP_IOSCHED=y
86+CONFIG_BINFMT_MISC=m
7087 CONFIG_MEMORY_HOTPLUG=y
7188 CONFIG_MEMORY_HOTREMOVE=y
7289 CONFIG_KSM=y
@@ -82,17 +99,8 @@ CONFIG_ZSMALLOC=m · 9 unmodified lines
8299 CONFIG_ZSMALLOC_STAT=y
83100 CONFIG_DEFERRED_STRUCT_PAGE_INIT=y
84101 CONFIG_IDLE_PAGE_TRACKING=y
85−CONFIG_PCI=y
86−CONFIG_PCI_DEBUG=y
87−CONFIG_HOTPLUG_PCI=y
88−CONFIG_HOTPLUG_PCI_S390=y
89−CONFIG_CHSC_SCH=y
90−CONFIG_VFIO_AP=m
91−CONFIG_VFIO_CCW=m
92−CONFIG_CRASH_DUMP=y
93−CONFIG_BINFMT_MISC=m
94−CONFIG_HIBERNATION=y
95−CONFIG_PM_DEBUG=y
102+CONFIG_PERCPU_STATS=y
103+CONFIG_GUP_BENCHMARK=y
96104 CONFIG_NET=y
97105 CONFIG_PACKET=y
98106 CONFIG_PACKET_DIAG=m
@@ -121,9 +129,6 @@ CONFIG_NET_IPVTI=m · 22 unmodified lines
121129 CONFIG_INET_AH=m
122130 CONFIG_INET_ESP=m
123131 CONFIG_INET_IPCOMP=m
124−CONFIG_INET_XFRM_MODE_TRANSPORT=m
125−CONFIG_INET_XFRM_MODE_TUNNEL=m
126−CONFIG_INET_XFRM_MODE_BEET=m
127132 CONFIG_INET_DIAG=m
128133 CONFIG_INET_UDP_DIAG=m
129134 CONFIG_TCP_CONG_ADVANCED=y
@@ -139,10 +144,6 @@ CONFIG_INET6_AH=m · 9 unmodified lines
139144 CONFIG_INET6_ESP=m
140145 CONFIG_INET6_IPCOMP=m
141146 CONFIG_IPV6_MIP6=m
142−CONFIG_INET6_XFRM_MODE_TRANSPORT=m
143−CONFIG_INET6_XFRM_MODE_TUNNEL=m
144−CONFIG_INET6_XFRM_MODE_BEET=m
145−CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
146147 CONFIG_IPV6_VTI=m
147148 CONFIG_IPV6_SIT=m
148149 CONFIG_IPV6_GRE=m
@@ -264,11 +265,8 @@ CONFIG_IP_VS_SED=m · 115 unmodified lines
264265 CONFIG_IP_VS_NQ=m
265266 CONFIG_IP_VS_FTP=m
266267 CONFIG_IP_VS_PE_SIP=m
267−CONFIG_NF_CONNTRACK_IPV4=m
268268 CONFIG_NF_TABLES_IPV4=y
269−CONFIG_NFT_CHAIN_ROUTE_IPV4=m
270269 CONFIG_NF_TABLES_ARP=y
271−CONFIG_NFT_CHAIN_NAT_IPV4=m
272270 CONFIG_IP_NF_IPTABLES=m
273271 CONFIG_IP_NF_MATCH_AH=m
274272 CONFIG_IP_NF_MATCH_ECN=m
@@ -287,10 +285,7 @@ CONFIG_IP_NF_SECURITY=m · 12 unmodified lines
287285 CONFIG_IP_NF_ARPTABLES=m
288286 CONFIG_IP_NF_ARPFILTER=m
289287 CONFIG_IP_NF_ARP_MANGLE=m
290−CONFIG_NF_CONNTRACK_IPV6=m
291288 CONFIG_NF_TABLES_IPV6=y
292−CONFIG_NFT_CHAIN_ROUTE_IPV6=m
293−CONFIG_NFT_CHAIN_NAT_IPV6=m
294289 CONFIG_IP6_NF_IPTABLES=m
295290 CONFIG_IP6_NF_MATCH_AH=m
296291 CONFIG_IP6_NF_MATCH_EUI64=m
@@ -309,7 +304,7 @@ CONFIG_IP6_NF_RAW=m · 12 unmodified lines
309304 CONFIG_IP6_NF_SECURITY=m
310305 CONFIG_IP6_NF_NAT=m
311306 CONFIG_IP6_NF_TARGET_MASQUERADE=m
312−CONFIG_NF_TABLES_BRIDGE=y
307+CONFIG_NF_TABLES_BRIDGE=m
313308 CONFIG_RDS=m
314309 CONFIG_RDS_RDMA=m
315310 CONFIG_RDS_TCP=m
@@ -375,9 +370,11 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
375370 CONFIG_CGROUP_NET_PRIO=y
376371 CONFIG_BPF_JIT=y
377372 CONFIG_NET_PKTGEN=m
373+CONFIG_PCI=y
374+CONFIG_PCI_DEBUG=y
375+CONFIG_HOTPLUG_PCI=y
376+CONFIG_HOTPLUG_PCI_S390=y
378377 CONFIG_DEVTMPFS=y
379−CONFIG_DMA_CMA=y
380−CONFIG_CMA_SIZE_MBYTES=0
381378 CONFIG_CONNECTOR=y
382379 CONFIG_ZRAM=m
383380 CONFIG_BLK_DEV_LOOP=m
@@ -395,7 +392,6 @@ CONFIG_RAID_ATTRS=m · 11 unmodified lines
395392 CONFIG_SCSI=y
396393 CONFIG_BLK_DEV_SD=y
397394 CONFIG_CHR_DEV_ST=m
398−CONFIG_CHR_DEV_OSST=m
399395 CONFIG_BLK_DEV_SR=m
400396 CONFIG_CHR_DEV_SG=y
401397 CONFIG_CHR_DEV_SCH=m
@@ -415,17 +411,19 @@ CONFIG_SCSI_DH_RDAC=m · 13 unmodified lines
415411 CONFIG_SCSI_DH_HP_SW=m
416412 CONFIG_SCSI_DH_EMC=m
417413 CONFIG_SCSI_DH_ALUA=m
418−CONFIG_SCSI_OSD_INITIATOR=m
419−CONFIG_SCSI_OSD_ULD=m
420414 CONFIG_MD=y
421415 CONFIG_BLK_DEV_MD=y
422416 CONFIG_MD_LINEAR=m
423417 CONFIG_MD_MULTIPATH=m
424418 CONFIG_MD_FAULTY=m
419+CONFIG_MD_CLUSTER=m
420+CONFIG_BCACHE=m
425421 CONFIG_BLK_DEV_DM=m
422+CONFIG_DM_UNSTRIPED=m
426423 CONFIG_DM_CRYPT=m
427424 CONFIG_DM_SNAPSHOT=m
428425 CONFIG_DM_THIN_PROVISIONING=m
426+CONFIG_DM_WRITECACHE=m
429427 CONFIG_DM_MIRROR=m
430428 CONFIG_DM_LOG_USERSPACE=m
431429 CONFIG_DM_RAID=m
@@ -445,23 +443,78 @@ CONFIG_EQUALIZER=m · 13 unmodified lines
445443 CONFIG_IFB=m
446444 CONFIG_MACVLAN=m
447445 CONFIG_MACVTAP=m
448−CONFIG_VXLAN=m
449446 CONFIG_TUN=m
450447 CONFIG_VETH=m
451448 CONFIG_VIRTIO_NET=m
452449 CONFIG_NLMON=m
450+# CONFIG_NET_VENDOR_3COM is not set
451+# CONFIG_NET_VENDOR_ADAPTEC is not set
452+# CONFIG_NET_VENDOR_AGERE is not set
453+# CONFIG_NET_VENDOR_ALACRITECH is not set
454+# CONFIG_NET_VENDOR_ALTEON is not set
455+# CONFIG_NET_VENDOR_AMAZON is not set
456+# CONFIG_NET_VENDOR_AMD is not set
457+# CONFIG_NET_VENDOR_AQUANTIA is not set
453458 # CONFIG_NET_VENDOR_ARC is not set
459+# CONFIG_NET_VENDOR_ATHEROS is not set
460+# CONFIG_NET_VENDOR_AURORA is not set
461+# CONFIG_NET_VENDOR_BROADCOM is not set
462+# CONFIG_NET_VENDOR_BROCADE is not set
463+# CONFIG_NET_VENDOR_CADENCE is not set
464+# CONFIG_NET_VENDOR_CAVIUM is not set
454465 # CONFIG_NET_VENDOR_CHELSIO is not set
466+# CONFIG_NET_VENDOR_CISCO is not set
467+# CONFIG_NET_VENDOR_CORTINA is not set
468+# CONFIG_NET_VENDOR_DEC is not set
469+# CONFIG_NET_VENDOR_DLINK is not set
470+# CONFIG_NET_VENDOR_EMULEX is not set
471+# CONFIG_NET_VENDOR_EZCHIP is not set
472+# CONFIG_NET_VENDOR_GOOGLE is not set
473+# CONFIG_NET_VENDOR_HP is not set
474+# CONFIG_NET_VENDOR_HUAWEI is not set
455475 # CONFIG_NET_VENDOR_INTEL is not set
456476 # CONFIG_NET_VENDOR_MARVELL is not set
457477 CONFIG_MLX4_EN=m
458478 CONFIG_MLX5_CORE=m
459479 CONFIG_MLX5_CORE_EN=y
480+# CONFIG_MLXFW is not set
481+# CONFIG_NET_VENDOR_MICREL is not set
482+# CONFIG_NET_VENDOR_MICROCHIP is not set
483+# CONFIG_NET_VENDOR_MICROSEMI is not set
484+# CONFIG_NET_VENDOR_MYRI is not set
460485 # CONFIG_NET_VENDOR_NATSEMI is not set
486+# CONFIG_NET_VENDOR_NETERION is not set
487+# CONFIG_NET_VENDOR_NETRONOME is not set
488+# CONFIG_NET_VENDOR_NI is not set
489+# CONFIG_NET_VENDOR_NVIDIA is not set
490+# CONFIG_NET_VENDOR_OKI is not set
491+# CONFIG_NET_VENDOR_PACKET_ENGINES is not set
492+# CONFIG_NET_VENDOR_QLOGIC is not set
493+# CONFIG_NET_VENDOR_QUALCOMM is not set
494+# CONFIG_NET_VENDOR_RDC is not set
495+# CONFIG_NET_VENDOR_REALTEK is not set
496+# CONFIG_NET_VENDOR_RENESAS is not set
497+# CONFIG_NET_VENDOR_ROCKER is not set
498+# CONFIG_NET_VENDOR_SAMSUNG is not set
499+# CONFIG_NET_VENDOR_SEEQ is not set
500+# CONFIG_NET_VENDOR_SOLARFLARE is not set
501+# CONFIG_NET_VENDOR_SILAN is not set
502+# CONFIG_NET_VENDOR_SIS is not set
503+# CONFIG_NET_VENDOR_SMSC is not set
504+# CONFIG_NET_VENDOR_SOCIONEXT is not set
505+# CONFIG_NET_VENDOR_STMICRO is not set
506+# CONFIG_NET_VENDOR_SUN is not set
507+# CONFIG_NET_VENDOR_SYNOPSYS is not set
508+# CONFIG_NET_VENDOR_TEHUTI is not set
509+# CONFIG_NET_VENDOR_TI is not set
510+# CONFIG_NET_VENDOR_VIA is not set
511+# CONFIG_NET_VENDOR_WIZNET is not set
461512 CONFIG_PPP=m
462513 CONFIG_PPP_BSDCOMP=m
463514 CONFIG_PPP_DEFLATE=m
515+CONFIG_PPP_FILTER=y
464516 CONFIG_PPP_MPPE=m
517+CONFIG_PPP_MULTILINK=y
465518 CONFIG_PPPOE=m
466519 CONFIG_PPTP=m
467520 CONFIG_PPPOL2TP=m
@@ -473,10 +526,13 @@ CONFIG_INPUT_EVDEV=y · 5 unmodified lines
473526 # CONFIG_INPUT_MOUSE is not set
474527 # CONFIG_SERIO is not set
475528 CONFIG_LEGACY_PTY_COUNT=0
529+CONFIG_NULL_TTY=m
476530 CONFIG_HW_RANDOM_VIRTIO=m
477531 CONFIG_RAW_DRIVER=m
478532 CONFIG_HANGCHECK_TIMER=m
479533 CONFIG_TN3270_FS=y
534+CONFIG_PPS=m
535+# CONFIG_PTP_1588_CLOCK is not set
480536 # CONFIG_HWMON is not set
481537 CONFIG_WATCHDOG=y
482538 CONFIG_WATCHDOG_NOWAYOUT=y
@@ -498,8 +554,8 @@ CONFIG_VFIO_MDEV_DEVICE=m · 15 unmodified lines
498554 CONFIG_VIRTIO_PCI=m
499555 CONFIG_VIRTIO_BALLOON=m
500556 CONFIG_VIRTIO_INPUT=y
501−CONFIG_S390_AP_IOMMU=y
502557 CONFIG_S390_CCW_IOMMU=y
558+CONFIG_S390_AP_IOMMU=y
503559 CONFIG_EXT4_FS=y
504560 CONFIG_EXT4_FS_POSIX_ACL=y
505561 CONFIG_EXT4_FS_SECURITY=y
@@ -519,6 +575,7 @@ CONFIG_OCFS2_FS=m · 13 unmodified lines
519575 CONFIG_BTRFS_FS=y
520576 CONFIG_BTRFS_FS_POSIX_ACL=y
521577 CONFIG_BTRFS_DEBUG=y
578+CONFIG_BTRFS_ASSERT=y
522579 CONFIG_NILFS2_FS=m
523580 CONFIG_FS_DAX=y
524581 CONFIG_EXPORTFS_BLOCK_OPS=y
@@ -552,8 +609,10 @@ CONFIG_ECRYPT_FS=m · 27 unmodified lines
552609 CONFIG_CRAMFS=m
553610 CONFIG_SQUASHFS=m
554611 CONFIG_SQUASHFS_XATTR=y
612+CONFIG_SQUASHFS_LZ4=y
555613 CONFIG_SQUASHFS_LZO=y
556614 CONFIG_SQUASHFS_XZ=y
615+CONFIG_SQUASHFS_ZSTD=y
557616 CONFIG_ROMFS_FS=m
558617 CONFIG_NFS_FS=m
559618 CONFIG_NFS_V3_ACL=y
@@ -564,7 +623,6 @@ CONFIG_NFSD_V3_ACL=y · 4 unmodified lines
564623 CONFIG_NFSD_V4=y
565624 CONFIG_NFSD_V4_SECURITY_LABEL=y
566625 CONFIG_CIFS=m
567−CONFIG_CIFS_STATS=y
568626 CONFIG_CIFS_STATS2=y
569627 CONFIG_CIFS_WEAK_PW_HASH=y
570628 CONFIG_CIFS_UPCALL=y
@@ -580,19 +638,112 @@ CONFIG_NLS_ISO8859_1=m · 9 unmodified lines
580638 CONFIG_NLS_ISO8859_15=m
581639 CONFIG_NLS_UTF8=m
582640 CONFIG_DLM=m
641+CONFIG_UNICODE=y
642+CONFIG_PERSISTENT_KEYRINGS=y
643+CONFIG_BIG_KEYS=y
644+CONFIG_ENCRYPTED_KEYS=m
645+CONFIG_SECURITY=y
646+CONFIG_SECURITY_NETWORK=y
647+CONFIG_FORTIFY_SOURCE=y
648+CONFIG_SECURITY_SELINUX=y
649+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
650+CONFIG_SECURITY_SELINUX_DISABLE=y
651+CONFIG_INTEGRITY_SIGNATURE=y
652+CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y
653+CONFIG_IMA=y
654+CONFIG_IMA_DEFAULT_HASH_SHA256=y
655+CONFIG_IMA_WRITE_POLICY=y
656+CONFIG_IMA_APPRAISE=y
657+CONFIG_CRYPTO_USER=m
658+# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
659+CONFIG_CRYPTO_PCRYPT=m
660+CONFIG_CRYPTO_CRYPTD=m
661+CONFIG_CRYPTO_TEST=m
662+CONFIG_CRYPTO_DH=m
663+CONFIG_CRYPTO_ECDH=m
664+CONFIG_CRYPTO_ECRDSA=m
665+CONFIG_CRYPTO_CHACHA20POLY1305=m
666+CONFIG_CRYPTO_AEGIS128=m
667+CONFIG_CRYPTO_AEGIS128L=m
668+CONFIG_CRYPTO_AEGIS256=m
669+CONFIG_CRYPTO_MORUS640=m
670+CONFIG_CRYPTO_MORUS1280=m
671+CONFIG_CRYPTO_CFB=m
672+CONFIG_CRYPTO_LRW=m
673+CONFIG_CRYPTO_PCBC=m
674+CONFIG_CRYPTO_KEYWRAP=m
675+CONFIG_CRYPTO_ADIANTUM=m
676+CONFIG_CRYPTO_XCBC=m
677+CONFIG_CRYPTO_VMAC=m
678+CONFIG_CRYPTO_CRC32=m
679+CONFIG_CRYPTO_XXHASH=m
680+CONFIG_CRYPTO_MICHAEL_MIC=m
681+CONFIG_CRYPTO_RMD128=m
682+CONFIG_CRYPTO_RMD160=m
683+CONFIG_CRYPTO_RMD256=m
684+CONFIG_CRYPTO_RMD320=m
685+CONFIG_CRYPTO_SHA3=m
686+CONFIG_CRYPTO_SM3=m
687+CONFIG_CRYPTO_TGR192=m
688+CONFIG_CRYPTO_WP512=m
689+CONFIG_CRYPTO_AES_TI=m
690+CONFIG_CRYPTO_ANUBIS=m
691+CONFIG_CRYPTO_ARC4=m
692+CONFIG_CRYPTO_BLOWFISH=m
693+CONFIG_CRYPTO_CAMELLIA=m
694+CONFIG_CRYPTO_CAST5=m
695+CONFIG_CRYPTO_CAST6=m
696+CONFIG_CRYPTO_FCRYPT=m
697+CONFIG_CRYPTO_KHAZAD=m
698+CONFIG_CRYPTO_SALSA20=m
699+CONFIG_CRYPTO_SEED=m
700+CONFIG_CRYPTO_SERPENT=m
701+CONFIG_CRYPTO_SM4=m
702+CONFIG_CRYPTO_TEA=m
703+CONFIG_CRYPTO_TWOFISH=m
704+CONFIG_CRYPTO_842=m
705+CONFIG_CRYPTO_LZ4=m
706+CONFIG_CRYPTO_LZ4HC=m
707+CONFIG_CRYPTO_ZSTD=m
708+CONFIG_CRYPTO_ANSI_CPRNG=m
709+CONFIG_CRYPTO_USER_API_HASH=m
710+CONFIG_CRYPTO_USER_API_SKCIPHER=m
711+CONFIG_CRYPTO_USER_API_RNG=m
712+CONFIG_CRYPTO_USER_API_AEAD=m
713+CONFIG_CRYPTO_STATS=y
714+CONFIG_ZCRYPT=m
715+CONFIG_PKEY=m
716+CONFIG_CRYPTO_PAES_S390=m
717+CONFIG_CRYPTO_SHA1_S390=m
718+CONFIG_CRYPTO_SHA256_S390=m
719+CONFIG_CRYPTO_SHA512_S390=m
720+CONFIG_CRYPTO_DES_S390=m
721+CONFIG_CRYPTO_AES_S390=m
722+CONFIG_CRYPTO_GHASH_S390=m
723+CONFIG_CRYPTO_CRC32_S390=y
724+CONFIG_CORDIC=m
725+CONFIG_CRC32_SELFTEST=y
726+CONFIG_CRC4=m
727+CONFIG_CRC7=m
728+CONFIG_CRC8=m
729+CONFIG_RANDOM32_SELFTEST=y
730+CONFIG_DMA_CMA=y
731+CONFIG_CMA_SIZE_MBYTES=0
732+CONFIG_DMA_API_DEBUG=y
733+CONFIG_STRING_SELFTEST=y
583734 CONFIG_PRINTK_TIME=y
584735 CONFIG_DYNAMIC_DEBUG=y
585736 CONFIG_DEBUG_INFO=y
586737 CONFIG_DEBUG_INFO_DWARF4=y
587738 CONFIG_GDB_SCRIPTS=y
588739 CONFIG_FRAME_WARN=1024
589−CONFIG_READABLE_ASM=y
590740 CONFIG_UNUSED_SYMBOLS=y
591741 CONFIG_HEADERS_INSTALL=y
592742 CONFIG_HEADERS_CHECK=y
593743 CONFIG_DEBUG_SECTION_MISMATCH=y
594744 CONFIG_MAGIC_SYSRQ=y
595745 CONFIG_DEBUG_PAGEALLOC=y
746+CONFIG_PAGE_OWNER=y
596747 CONFIG_DEBUG_RODATA_TEST=y
597748 CONFIG_DEBUG_OBJECTS=y
598749 CONFIG_DEBUG_OBJECTS_SELFTEST=y
@@ -645,7 +796,6 @@ CONFIG_STACK_TRACER=y · 46 unmodified lines
645796 CONFIG_BLK_DEV_IO_TRACE=y
646797 CONFIG_FUNCTION_PROFILER=y
647798 CONFIG_HIST_TRIGGERS=y
648−CONFIG_DMA_API_DEBUG=y
649799 CONFIG_LKDTM=m
650800 CONFIG_TEST_LIST_SORT=y
651801 CONFIG_TEST_SORT=y
@@ -657,85 +807,3 @@ CONFIG_ATOMIC64_SELFTEST=y · 5 unmodified lines
657807 CONFIG_TEST_BPF=m
658808 CONFIG_BUG_ON_DATA_CORRUPTION=y
659809 CONFIG_S390_PTDUMP=y
660−CONFIG_PERSISTENT_KEYRINGS=y
661−CONFIG_BIG_KEYS=y
662−CONFIG_ENCRYPTED_KEYS=m
663−CONFIG_SECURITY=y
664−CONFIG_SECURITY_NETWORK=y
665−CONFIG_FORTIFY_SOURCE=y
666−CONFIG_SECURITY_SELINUX=y
667−CONFIG_SECURITY_SELINUX_BOOTPARAM=y
668−CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
669−CONFIG_SECURITY_SELINUX_DISABLE=y
670−CONFIG_INTEGRITY_SIGNATURE=y
671−CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y
672−CONFIG_IMA=y
673−CONFIG_IMA_DEFAULT_HASH_SHA256=y
674−CONFIG_IMA_WRITE_POLICY=y
675−CONFIG_IMA_APPRAISE=y
676−CONFIG_CRYPTO_DH=m
677−CONFIG_CRYPTO_ECDH=m
678−CONFIG_CRYPTO_USER=m
679−# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
680−CONFIG_CRYPTO_PCRYPT=m
681−CONFIG_CRYPTO_CRYPTD=m
682−CONFIG_CRYPTO_TEST=m
683−CONFIG_CRYPTO_CHACHA20POLY1305=m
684−CONFIG_CRYPTO_LRW=m
685−CONFIG_CRYPTO_PCBC=m
686−CONFIG_CRYPTO_KEYWRAP=m
687−CONFIG_CRYPTO_XCBC=m
688−CONFIG_CRYPTO_VMAC=m
689−CONFIG_CRYPTO_CRC32=m
690−CONFIG_CRYPTO_MICHAEL_MIC=m
691−CONFIG_CRYPTO_RMD128=m
692−CONFIG_CRYPTO_RMD160=m
693−CONFIG_CRYPTO_RMD256=m
694−CONFIG_CRYPTO_RMD320=m
695−CONFIG_CRYPTO_SHA512=m
696−CONFIG_CRYPTO_SHA3=m
697−CONFIG_CRYPTO_TGR192=m
698−CONFIG_CRYPTO_WP512=m
699−CONFIG_CRYPTO_AES_TI=m
700−CONFIG_CRYPTO_ANUBIS=m
701−CONFIG_CRYPTO_BLOWFISH=m
702−CONFIG_CRYPTO_CAMELLIA=m
703−CONFIG_CRYPTO_CAST5=m
704−CONFIG_CRYPTO_CAST6=m
705−CONFIG_CRYPTO_FCRYPT=m
706−CONFIG_CRYPTO_KHAZAD=m
707−CONFIG_CRYPTO_SALSA20=m
708−CONFIG_CRYPTO_SEED=m
709−CONFIG_CRYPTO_SERPENT=m
710−CONFIG_CRYPTO_TEA=m
711−CONFIG_CRYPTO_TWOFISH=m
712−CONFIG_CRYPTO_842=m
713−CONFIG_CRYPTO_LZ4=m
714−CONFIG_CRYPTO_LZ4HC=m
715−CONFIG_CRYPTO_ANSI_CPRNG=m
716−CONFIG_CRYPTO_USER_API_HASH=m
717−CONFIG_CRYPTO_USER_API_SKCIPHER=m
718−CONFIG_CRYPTO_USER_API_RNG=m
719−CONFIG_CRYPTO_USER_API_AEAD=m
720−CONFIG_ZCRYPT=m
721−CONFIG_PKEY=m
722−CONFIG_CRYPTO_PAES_S390=m
723−CONFIG_CRYPTO_SHA1_S390=m
724−CONFIG_CRYPTO_SHA256_S390=m
725−CONFIG_CRYPTO_SHA512_S390=m
726−CONFIG_CRYPTO_DES_S390=m
727−CONFIG_CRYPTO_AES_S390=m
728−CONFIG_CRYPTO_GHASH_S390=m
729−CONFIG_CRYPTO_CRC32_S390=y
730−CONFIG_PKCS7_MESSAGE_PARSER=y
731−CONFIG_SYSTEM_TRUSTED_KEYRING=y
732−CONFIG_CRC7=m
733−CONFIG_CRC8=m
734−CONFIG_RANDOM32_SELFTEST=y
735−CONFIG_CORDIC=m
736−CONFIG_CMM=m
737−CONFIG_APPLDATA_BASE=y
738−CONFIG_KVM=m
739−CONFIG_KVM_S390_UCONTROL=y
740−CONFIG_VHOST_NET=m
741−CONFIG_VHOST_VSOCK=m
arch/s390/configs/defconfig+150−83
@@ -12,30 +12,51 @@ CONFIG_TASK_IO_ACCOUNTING=y · 11 unmodified lines
1212 CONFIG_IKCONFIG=y
1313 CONFIG_IKCONFIG_PROC=y
1414 CONFIG_NUMA_BALANCING=y
15−# CONFIG_NUMA_BALANCING_DEFAULT_ENABLED is not set
1615 CONFIG_MEMCG=y
1716 CONFIG_MEMCG_SWAP=y
1817 CONFIG_BLK_CGROUP=y
1918 CONFIG_CFS_BANDWIDTH=y
2019 CONFIG_RT_GROUP_SCHED=y
2120 CONFIG_CGROUP_PIDS=y
21+CONFIG_CGROUP_RDMA=y
2222 CONFIG_CGROUP_FREEZER=y
2323 CONFIG_CGROUP_HUGETLB=y
2424 CONFIG_CPUSETS=y
2525 CONFIG_CGROUP_DEVICE=y
2626 CONFIG_CGROUP_CPUACCT=y
2727 CONFIG_CGROUP_PERF=y
28+CONFIG_CGROUP_BPF=y
2829 CONFIG_NAMESPACES=y
2930 CONFIG_USER_NS=y
31+CONFIG_CHECKPOINT_RESTORE=y
3032 CONFIG_SCHED_AUTOGROUP=y
3133 CONFIG_BLK_DEV_INITRD=y
3234 CONFIG_EXPERT=y
3335 # CONFIG_SYSFS_SYSCALL is not set
34−CONFIG_CHECKPOINT_RESTORE=y
3536 CONFIG_BPF_SYSCALL=y
3637 CONFIG_USERFAULTFD=y
3738 # CONFIG_COMPAT_BRK is not set
3839 CONFIG_PROFILING=y
40+CONFIG_LIVEPATCH=y
41+CONFIG_TUNE_ZEC12=y
42+CONFIG_NR_CPUS=512
43+CONFIG_NUMA=y
44+# CONFIG_NUMA_EMU is not set
45+CONFIG_HZ_100=y
46+CONFIG_KEXEC_FILE=y
47+CONFIG_EXPOLINE=y
48+CONFIG_EXPOLINE_AUTO=y
49+CONFIG_CHSC_SCH=y
50+CONFIG_VFIO_CCW=m
51+CONFIG_VFIO_AP=m
52+CONFIG_CRASH_DUMP=y
53+CONFIG_HIBERNATION=y
54+CONFIG_PM_DEBUG=y
55+CONFIG_CMM=m
56+CONFIG_APPLDATA_BASE=y
57+CONFIG_KVM=m
58+CONFIG_VHOST_NET=m
59+CONFIG_VHOST_VSOCK=m
3960 CONFIG_OPROFILE=m
4061 CONFIG_KPROBES=y
4162 CONFIG_JUMP_LABEL=y
@@ -47,27 +68,18 @@ CONFIG_MODVERSIONS=y · 5 unmodified lines
4768 CONFIG_MODULE_SRCVERSION_ALL=y
4869 CONFIG_MODULE_SIG=y
4970 CONFIG_MODULE_SIG_SHA256=y
50−CONFIG_BLK_DEV_INTEGRITY=y
5171 CONFIG_BLK_DEV_THROTTLING=y
5272 CONFIG_BLK_WBT=y
53−CONFIG_BLK_WBT_SQ=y
73+CONFIG_BLK_CGROUP_IOLATENCY=y
5474 CONFIG_PARTITION_ADVANCED=y
5575 CONFIG_IBM_PARTITION=y
5676 CONFIG_BSD_DISKLABEL=y
5777 CONFIG_MINIX_SUBPARTITION=y
5878 CONFIG_SOLARIS_X86_PARTITION=y
5979 CONFIG_UNIXWARE_DISKLABEL=y
60−CONFIG_CFQ_GROUP_IOSCHED=y
61−CONFIG_DEFAULT_DEADLINE=y
62−CONFIG_LIVEPATCH=y
63−CONFIG_TUNE_ZEC12=y
64−CONFIG_NR_CPUS=512
65−CONFIG_NUMA=y
66−CONFIG_HZ_100=y
67−CONFIG_KEXEC_FILE=y
68−CONFIG_KEXEC_VERIFY_SIG=y
69−CONFIG_EXPOLINE=y
70−CONFIG_EXPOLINE_AUTO=y
80+CONFIG_IOSCHED_BFQ=y
81+CONFIG_BFQ_GROUP_IOSCHED=y
82+CONFIG_BINFMT_MISC=m
7183 CONFIG_MEMORY_HOTPLUG=y
7284 CONFIG_MEMORY_HOTREMOVE=y
7385 CONFIG_KSM=y
@@ -81,16 +93,8 @@ CONFIG_ZSMALLOC=m · 7 unmodified lines
8193 CONFIG_ZSMALLOC_STAT=y
8294 CONFIG_DEFERRED_STRUCT_PAGE_INIT=y
8395 CONFIG_IDLE_PAGE_TRACKING=y
84−CONFIG_PCI=y
85−CONFIG_HOTPLUG_PCI=y
86−CONFIG_HOTPLUG_PCI_S390=y
87−CONFIG_CHSC_SCH=y
88−CONFIG_VFIO_AP=m
89−CONFIG_VFIO_CCW=m
90−CONFIG_CRASH_DUMP=y
91−CONFIG_BINFMT_MISC=m
92−CONFIG_HIBERNATION=y
93−CONFIG_PM_DEBUG=y
96+CONFIG_PERCPU_STATS=y
97+CONFIG_GUP_BENCHMARK=y
9498 CONFIG_NET=y
9599 CONFIG_PACKET=y
96100 CONFIG_PACKET_DIAG=m
@@ -119,9 +123,6 @@ CONFIG_NET_IPVTI=m · 22 unmodified lines
119123 CONFIG_INET_AH=m
120124 CONFIG_INET_ESP=m
121125 CONFIG_INET_IPCOMP=m
122−CONFIG_INET_XFRM_MODE_TRANSPORT=m
123−CONFIG_INET_XFRM_MODE_TUNNEL=m
124−CONFIG_INET_XFRM_MODE_BEET=m
125126 CONFIG_INET_DIAG=m
126127 CONFIG_INET_UDP_DIAG=m
127128 CONFIG_TCP_CONG_ADVANCED=y
@@ -137,10 +138,6 @@ CONFIG_INET6_AH=m · 9 unmodified lines
137138 CONFIG_INET6_ESP=m
138139 CONFIG_INET6_IPCOMP=m
139140 CONFIG_IPV6_MIP6=m
140−CONFIG_INET6_XFRM_MODE_TRANSPORT=m
141−CONFIG_INET6_XFRM_MODE_TUNNEL=m
142−CONFIG_INET6_XFRM_MODE_BEET=m
143−CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
144141 CONFIG_IPV6_VTI=m
145142 CONFIG_IPV6_SIT=m
146143 CONFIG_IPV6_GRE=m
@@ -262,11 +259,8 @@ CONFIG_IP_VS_SED=m · 115 unmodified lines
262259 CONFIG_IP_VS_NQ=m
263260 CONFIG_IP_VS_FTP=m
264261 CONFIG_IP_VS_PE_SIP=m
265−CONFIG_NF_CONNTRACK_IPV4=m
266262 CONFIG_NF_TABLES_IPV4=y
267−CONFIG_NFT_CHAIN_ROUTE_IPV4=m
268263 CONFIG_NF_TABLES_ARP=y
269−CONFIG_NFT_CHAIN_NAT_IPV4=m
270264 CONFIG_IP_NF_IPTABLES=m
271265 CONFIG_IP_NF_MATCH_AH=m
272266 CONFIG_IP_NF_MATCH_ECN=m
@@ -285,10 +279,7 @@ CONFIG_IP_NF_SECURITY=m · 12 unmodified lines
285279 CONFIG_IP_NF_ARPTABLES=m
286280 CONFIG_IP_NF_ARPFILTER=m
287281 CONFIG_IP_NF_ARP_MANGLE=m
288−CONFIG_NF_CONNTRACK_IPV6=m
289282 CONFIG_NF_TABLES_IPV6=y
290−CONFIG_NFT_CHAIN_ROUTE_IPV6=m
291−CONFIG_NFT_CHAIN_NAT_IPV6=m
292283 CONFIG_IP6_NF_IPTABLES=m
293284 CONFIG_IP6_NF_MATCH_AH=m
294285 CONFIG_IP6_NF_MATCH_EUI64=m
@@ -307,7 +298,7 @@ CONFIG_IP6_NF_RAW=m · 12 unmodified lines
307298 CONFIG_IP6_NF_SECURITY=m
308299 CONFIG_IP6_NF_NAT=m
309300 CONFIG_IP6_NF_TARGET_MASQUERADE=m
310−CONFIG_NF_TABLES_BRIDGE=y
301+CONFIG_NF_TABLES_BRIDGE=m
311302 CONFIG_RDS=m
312303 CONFIG_RDS_RDMA=m
313304 CONFIG_RDS_TCP=m
@@ -372,9 +363,11 @@ CONFIG_NETLINK_DIAG=m · 58 unmodified lines
372363 CONFIG_CGROUP_NET_PRIO=y
373364 CONFIG_BPF_JIT=y
374365 CONFIG_NET_PKTGEN=m
366+CONFIG_PCI=y
367+CONFIG_HOTPLUG_PCI=y
368+CONFIG_HOTPLUG_PCI_S390=y
369+CONFIG_UEVENT_HELPER=y
375370 CONFIG_DEVTMPFS=y
376−CONFIG_DMA_CMA=y
377−CONFIG_CMA_SIZE_MBYTES=0
378371 CONFIG_CONNECTOR=y
379372 CONFIG_ZRAM=m
380373 CONFIG_BLK_DEV_LOOP=m
@@ -383,6 +376,7 @@ CONFIG_BLK_DEV_DRBD=m · 2 unmodified lines
383376 CONFIG_BLK_DEV_NBD=m
384377 CONFIG_BLK_DEV_RAM=y
385378 CONFIG_BLK_DEV_RAM_SIZE=32768
379+# CONFIG_BLK_DEV_XPRAM is not set
386380 CONFIG_VIRTIO_BLK=y
387381 CONFIG_BLK_DEV_RBD=m
388382 CONFIG_BLK_DEV_NVME=m
@@ -392,7 +386,6 @@ CONFIG_RAID_ATTRS=m · 3 unmodified lines
392386 CONFIG_SCSI=y
393387 CONFIG_BLK_DEV_SD=y
394388 CONFIG_CHR_DEV_ST=m
395−CONFIG_CHR_DEV_OSST=m
396389 CONFIG_BLK_DEV_SR=m
397390 CONFIG_CHR_DEV_SG=y
398391 CONFIG_CHR_DEV_SCH=m
@@ -412,17 +405,19 @@ CONFIG_SCSI_DH_RDAC=m · 13 unmodified lines
412405 CONFIG_SCSI_DH_HP_SW=m
413406 CONFIG_SCSI_DH_EMC=m
414407 CONFIG_SCSI_DH_ALUA=m
415−CONFIG_SCSI_OSD_INITIATOR=m
416−CONFIG_SCSI_OSD_ULD=m
417408 CONFIG_MD=y
418409 CONFIG_BLK_DEV_MD=y
419410 CONFIG_MD_LINEAR=m
420411 CONFIG_MD_MULTIPATH=m
421412 CONFIG_MD_FAULTY=m
413+CONFIG_MD_CLUSTER=m
414+CONFIG_BCACHE=m
422415 CONFIG_BLK_DEV_DM=m
416+CONFIG_DM_UNSTRIPED=m
423417 CONFIG_DM_CRYPT=m
424418 CONFIG_DM_SNAPSHOT=m
425419 CONFIG_DM_THIN_PROVISIONING=m
420+CONFIG_DM_WRITECACHE=m
426421 CONFIG_DM_MIRROR=m
427422 CONFIG_DM_LOG_USERSPACE=m
428423 CONFIG_DM_RAID=m
@@ -435,6 +430,7 @@ CONFIG_DM_UEVENT=y · 6 unmodified lines
435430 CONFIG_DM_FLAKEY=m
436431 CONFIG_DM_VERITY=m
437432 CONFIG_DM_SWITCH=m
433+CONFIG_DM_INTEGRITY=m
438434 CONFIG_NETDEVICES=y
439435 CONFIG_BONDING=m
440436 CONFIG_DUMMY=m
@@ -442,23 +438,78 @@ CONFIG_EQUALIZER=m · 1 unmodified line
442438 CONFIG_IFB=m
443439 CONFIG_MACVLAN=m
444440 CONFIG_MACVTAP=m
445−CONFIG_VXLAN=m
446441 CONFIG_TUN=m
447442 CONFIG_VETH=m
448443 CONFIG_VIRTIO_NET=m
449444 CONFIG_NLMON=m
445+# CONFIG_NET_VENDOR_3COM is not set
446+# CONFIG_NET_VENDOR_ADAPTEC is not set
447+# CONFIG_NET_VENDOR_AGERE is not set
448+# CONFIG_NET_VENDOR_ALACRITECH is not set
449+# CONFIG_NET_VENDOR_ALTEON is not set
450+# CONFIG_NET_VENDOR_AMAZON is not set
451+# CONFIG_NET_VENDOR_AMD is not set
452+# CONFIG_NET_VENDOR_AQUANTIA is not set
450453 # CONFIG_NET_VENDOR_ARC is not set
454+# CONFIG_NET_VENDOR_ATHEROS is not set
455+# CONFIG_NET_VENDOR_AURORA is not set
456+# CONFIG_NET_VENDOR_BROADCOM is not set
457+# CONFIG_NET_VENDOR_BROCADE is not set
458+# CONFIG_NET_VENDOR_CADENCE is not set
459+# CONFIG_NET_VENDOR_CAVIUM is not set
451460 # CONFIG_NET_VENDOR_CHELSIO is not set
461+# CONFIG_NET_VENDOR_CISCO is not set
462+# CONFIG_NET_VENDOR_CORTINA is not set
463+# CONFIG_NET_VENDOR_DEC is not set
464+# CONFIG_NET_VENDOR_DLINK is not set
465+# CONFIG_NET_VENDOR_EMULEX is not set
466+# CONFIG_NET_VENDOR_EZCHIP is not set
467+# CONFIG_NET_VENDOR_GOOGLE is not set
468+# CONFIG_NET_VENDOR_HP is not set
469+# CONFIG_NET_VENDOR_HUAWEI is not set
452470 # CONFIG_NET_VENDOR_INTEL is not set
453471 # CONFIG_NET_VENDOR_MARVELL is not set
454472 CONFIG_MLX4_EN=m
455473 CONFIG_MLX5_CORE=m
456474 CONFIG_MLX5_CORE_EN=y
475+# CONFIG_MLXFW is not set
476+# CONFIG_NET_VENDOR_MICREL is not set
477+# CONFIG_NET_VENDOR_MICROCHIP is not set
478+# CONFIG_NET_VENDOR_MICROSEMI is not set
479+# CONFIG_NET_VENDOR_MYRI is not set
457480 # CONFIG_NET_VENDOR_NATSEMI is not set
481+# CONFIG_NET_VENDOR_NETERION is not set
482+# CONFIG_NET_VENDOR_NETRONOME is not set
483+# CONFIG_NET_VENDOR_NI is not set
484+# CONFIG_NET_VENDOR_NVIDIA is not set
485+# CONFIG_NET_VENDOR_OKI is not set
486+# CONFIG_NET_VENDOR_PACKET_ENGINES is not set
487+# CONFIG_NET_VENDOR_QLOGIC is not set
488+# CONFIG_NET_VENDOR_QUALCOMM is not set
489+# CONFIG_NET_VENDOR_RDC is not set
490+# CONFIG_NET_VENDOR_REALTEK is not set
491+# CONFIG_NET_VENDOR_RENESAS is not set
492+# CONFIG_NET_VENDOR_ROCKER is not set
493+# CONFIG_NET_VENDOR_SAMSUNG is not set
494+# CONFIG_NET_VENDOR_SEEQ is not set
495+# CONFIG_NET_VENDOR_SOLARFLARE is not set
496+# CONFIG_NET_VENDOR_SILAN is not set
497+# CONFIG_NET_VENDOR_SIS is not set
498+# CONFIG_NET_VENDOR_SMSC is not set
499+# CONFIG_NET_VENDOR_SOCIONEXT is not set
500+# CONFIG_NET_VENDOR_STMICRO is not set
501+# CONFIG_NET_VENDOR_SUN is not set
502+# CONFIG_NET_VENDOR_SYNOPSYS is not set
503+# CONFIG_NET_VENDOR_TEHUTI is not set
504+# CONFIG_NET_VENDOR_TI is not set
505+# CONFIG_NET_VENDOR_VIA is not set
506+# CONFIG_NET_VENDOR_WIZNET is not set
458507 CONFIG_PPP=m
459508 CONFIG_PPP_BSDCOMP=m
460509 CONFIG_PPP_DEFLATE=m
510+CONFIG_PPP_FILTER=y
461511 CONFIG_PPP_MPPE=m
512+CONFIG_PPP_MULTILINK=y
462513 CONFIG_PPPOE=m
463514 CONFIG_PPTP=m
464515 CONFIG_PPPOL2TP=m
@@ -470,17 +521,21 @@ CONFIG_INPUT_EVDEV=y · 5 unmodified lines
470521 # CONFIG_INPUT_MOUSE is not set
471522 # CONFIG_SERIO is not set
472523 CONFIG_LEGACY_PTY_COUNT=0
524+CONFIG_NULL_TTY=m
473525 CONFIG_HW_RANDOM_VIRTIO=m
474526 CONFIG_RAW_DRIVER=m
475527 CONFIG_HANGCHECK_TIMER=m
476528 CONFIG_TN3270_FS=y
529+# CONFIG_PTP_1588_CLOCK is not set
477530 # CONFIG_HWMON is not set
478531 CONFIG_WATCHDOG=y
532+CONFIG_WATCHDOG_CORE=y
479533 CONFIG_WATCHDOG_NOWAYOUT=y
480534 CONFIG_SOFT_WATCHDOG=m
481535 CONFIG_DIAG288_WATCHDOG=m
482536 CONFIG_DRM=y
483537 CONFIG_DRM_VIRTIO_GPU=y
538+# CONFIG_BACKLIGHT_CLASS_DEVICE is not set
484539 CONFIG_FRAMEBUFFER_CONSOLE=y
485540 # CONFIG_HID is not set
486541 # CONFIG_USB_SUPPORT is not set
@@ -495,8 +550,8 @@ CONFIG_VFIO_MDEV_DEVICE=m · 8 unmodified lines
495550 CONFIG_VIRTIO_PCI=m
496551 CONFIG_VIRTIO_BALLOON=m
497552 CONFIG_VIRTIO_INPUT=y
498−CONFIG_S390_AP_IOMMU=y
499553 CONFIG_S390_CCW_IOMMU=y
554+CONFIG_S390_AP_IOMMU=y
500555 CONFIG_EXT4_FS=y
501556 CONFIG_EXT4_FS_POSIX_ACL=y
502557 CONFIG_EXT4_FS_SECURITY=y
@@ -546,8 +601,10 @@ CONFIG_ECRYPT_FS=m · 43 unmodified lines
546601 CONFIG_CRAMFS=m
547602 CONFIG_SQUASHFS=m
548603 CONFIG_SQUASHFS_XATTR=y
604+CONFIG_SQUASHFS_LZ4=y
549605 CONFIG_SQUASHFS_LZO=y
550606 CONFIG_SQUASHFS_XZ=y
607+CONFIG_SQUASHFS_ZSTD=y
551608 CONFIG_ROMFS_FS=m
552609 CONFIG_NFS_FS=m
553610 CONFIG_NFS_V3_ACL=y
@@ -558,7 +615,6 @@ CONFIG_NFSD_V3_ACL=y · 4 unmodified lines
558615 CONFIG_NFSD_V4=y
559616 CONFIG_NFSD_V4_SECURITY_LABEL=y
560617 CONFIG_CIFS=m
561−CONFIG_CIFS_STATS=y
562618 CONFIG_CIFS_STATS2=y
563619 CONFIG_CIFS_WEAK_PW_HASH=y
564620 CONFIG_CIFS_UPCALL=y
@@ -574,31 +630,7 @@ CONFIG_NLS_ISO8859_1=m · 9 unmodified lines
574630 CONFIG_NLS_ISO8859_15=m
575631 CONFIG_NLS_UTF8=m
576632 CONFIG_DLM=m
577−CONFIG_PRINTK_TIME=y
578−CONFIG_DEBUG_INFO=y
579−CONFIG_DEBUG_INFO_DWARF4=y
580−CONFIG_GDB_SCRIPTS=y
581−# CONFIG_ENABLE_MUST_CHECK is not set
582−CONFIG_FRAME_WARN=1024
583−CONFIG_UNUSED_SYMBOLS=y
584−CONFIG_MAGIC_SYSRQ=y
585−CONFIG_DEBUG_MEMORY_INIT=y
586−CONFIG_PANIC_ON_OOPS=y
587−CONFIG_RCU_TORTURE_TEST=m
588−CONFIG_RCU_CPU_STALL_TIMEOUT=60
589−CONFIG_LATENCYTOP=y
590−CONFIG_SCHED_TRACER=y
591−CONFIG_FTRACE_SYSCALLS=y
592−CONFIG_STACK_TRACER=y
593−CONFIG_BLK_DEV_IO_TRACE=y
594−CONFIG_FUNCTION_PROFILER=y
595−CONFIG_HIST_TRIGGERS=y
596−CONFIG_LKDTM=m
597−CONFIG_PERCPU_TEST=m
598−CONFIG_ATOMIC64_SELFTEST=y
599−CONFIG_TEST_BPF=m
600−CONFIG_BUG_ON_DATA_CORRUPTION=y
601−CONFIG_S390_PTDUMP=y
633+CONFIG_UNICODE=y
602634 CONFIG_PERSISTENT_KEYRINGS=y
603635 CONFIG_BIG_KEYS=y
604636 CONFIG_ENCRYPTED_KEYS=m
@@ -606,7 +638,6 @@ CONFIG_SECURITY=y · 1 unmodified line
606638 CONFIG_SECURITY_NETWORK=y
607639 CONFIG_SECURITY_SELINUX=y
608640 CONFIG_SECURITY_SELINUX_BOOTPARAM=y
609−CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
610641 CONFIG_SECURITY_SELINUX_DISABLE=y
611642 CONFIG_INTEGRITY_SIGNATURE=y
612643 CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y
@@ -615,31 +646,42 @@ CONFIG_IMA_DEFAULT_HASH_SHA256=y · 2 unmodified lines
615646 CONFIG_IMA_WRITE_POLICY=y
616647 CONFIG_IMA_APPRAISE=y
617648 CONFIG_CRYPTO_FIPS=y
618−CONFIG_CRYPTO_DH=m
619−CONFIG_CRYPTO_ECDH=m
620649 CONFIG_CRYPTO_USER=m
621650 # CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
622651 CONFIG_CRYPTO_PCRYPT=m
623652 CONFIG_CRYPTO_CRYPTD=m
624653 CONFIG_CRYPTO_TEST=m
654+CONFIG_CRYPTO_DH=m
655+CONFIG_CRYPTO_ECDH=m
656+CONFIG_CRYPTO_ECRDSA=m
625657 CONFIG_CRYPTO_CHACHA20POLY1305=m
658+CONFIG_CRYPTO_AEGIS128=m
659+CONFIG_CRYPTO_AEGIS128L=m
660+CONFIG_CRYPTO_AEGIS256=m
661+CONFIG_CRYPTO_MORUS640=m
662+CONFIG_CRYPTO_MORUS1280=m
663+CONFIG_CRYPTO_CFB=m
626664 CONFIG_CRYPTO_LRW=m
665+CONFIG_CRYPTO_OFB=m
627666 CONFIG_CRYPTO_PCBC=m
628667 CONFIG_CRYPTO_KEYWRAP=m
668+CONFIG_CRYPTO_ADIANTUM=m
629669 CONFIG_CRYPTO_XCBC=m
630670 CONFIG_CRYPTO_VMAC=m
631671 CONFIG_CRYPTO_CRC32=m
672+CONFIG_CRYPTO_XXHASH=m
632673 CONFIG_CRYPTO_MICHAEL_MIC=m
633674 CONFIG_CRYPTO_RMD128=m
634675 CONFIG_CRYPTO_RMD160=m
635676 CONFIG_CRYPTO_RMD256=m
636677 CONFIG_CRYPTO_RMD320=m
637−CONFIG_CRYPTO_SHA512=m
638678 CONFIG_CRYPTO_SHA3=m
679+CONFIG_CRYPTO_SM3=m
639680 CONFIG_CRYPTO_TGR192=m
640681 CONFIG_CRYPTO_WP512=m
641682 CONFIG_CRYPTO_AES_TI=m
642683 CONFIG_CRYPTO_ANUBIS=m
684+CONFIG_CRYPTO_ARC4=m
643685 CONFIG_CRYPTO_BLOWFISH=m
644686 CONFIG_CRYPTO_CAMELLIA=m
645687 CONFIG_CRYPTO_CAST5=m
@@ -649,16 +691,19 @@ CONFIG_CRYPTO_KHAZAD=m · 3 unmodified lines
649691 CONFIG_CRYPTO_SALSA20=m
650692 CONFIG_CRYPTO_SEED=m
651693 CONFIG_CRYPTO_SERPENT=m
694+CONFIG_CRYPTO_SM4=m
652695 CONFIG_CRYPTO_TEA=m
653696 CONFIG_CRYPTO_TWOFISH=m
654697 CONFIG_CRYPTO_842=m
655698 CONFIG_CRYPTO_LZ4=m
656699 CONFIG_CRYPTO_LZ4HC=m
700+CONFIG_CRYPTO_ZSTD=m
657701 CONFIG_CRYPTO_ANSI_CPRNG=m
658702 CONFIG_CRYPTO_USER_API_HASH=m
659703 CONFIG_CRYPTO_USER_API_SKCIPHER=m
660704 CONFIG_CRYPTO_USER_API_RNG=m
661705 CONFIG_CRYPTO_USER_API_AEAD=m
706+CONFIG_CRYPTO_STATS=y
662707 CONFIG_ZCRYPT=m
663708 CONFIG_PKEY=m
664709 CONFIG_CRYPTO_PAES_S390=m
@@ -669,12 +714,34 @@ CONFIG_CRYPTO_DES_S390=m · 4 unmodified lines
669714 CONFIG_CRYPTO_AES_S390=m
670715 CONFIG_CRYPTO_GHASH_S390=m
671716 CONFIG_CRYPTO_CRC32_S390=y
717+CONFIG_CORDIC=m
718+CONFIG_CRC4=m
672719 CONFIG_CRC7=m
673720 CONFIG_CRC8=m
674−CONFIG_CORDIC=m
675−CONFIG_CMM=m
676−CONFIG_APPLDATA_BASE=y
677−CONFIG_KVM=m
678−CONFIG_KVM_S390_UCONTROL=y
679−CONFIG_VHOST_NET=m
680−CONFIG_VHOST_VSOCK=m
721+CONFIG_DMA_CMA=y
722+CONFIG_CMA_SIZE_MBYTES=0
723+CONFIG_PRINTK_TIME=y
724+CONFIG_DEBUG_INFO=y
725+CONFIG_DEBUG_INFO_DWARF4=y
726+CONFIG_GDB_SCRIPTS=y
727+CONFIG_FRAME_WARN=1024
728+CONFIG_UNUSED_SYMBOLS=y
729+CONFIG_DEBUG_SECTION_MISMATCH=y
730+CONFIG_MAGIC_SYSRQ=y
731+CONFIG_DEBUG_MEMORY_INIT=y
732+CONFIG_PANIC_ON_OOPS=y
733+CONFIG_RCU_TORTURE_TEST=m
734+CONFIG_RCU_CPU_STALL_TIMEOUT=60
735+CONFIG_LATENCYTOP=y
736+CONFIG_SCHED_TRACER=y
737+CONFIG_FTRACE_SYSCALLS=y
738+CONFIG_STACK_TRACER=y
739+CONFIG_BLK_DEV_IO_TRACE=y
740+CONFIG_FUNCTION_PROFILER=y
741+CONFIG_HIST_TRIGGERS=y
742+CONFIG_LKDTM=m
743+CONFIG_PERCPU_TEST=m
744+CONFIG_ATOMIC64_SELFTEST=y
745+CONFIG_TEST_BPF=m
746+CONFIG_BUG_ON_DATA_CORRUPTION=y
747+CONFIG_S390_PTDUMP=y
arch/s390/configs/zfcpdump_defconfig+17−14
@@ -1,27 +1,33 @@
11 # CONFIG_SWAP is not set
22 CONFIG_NO_HZ_IDLE=y
33 CONFIG_HIGH_RES_TIMERS=y
4+# CONFIG_CPU_ISOLATION is not set
5+# CONFIG_UTS_NS is not set
6+# CONFIG_PID_NS is not set
7+# CONFIG_NET_NS is not set
48 CONFIG_BLK_DEV_INITRD=y
59 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
610 # CONFIG_COMPAT_BRK is not set
7−CONFIG_PARTITION_ADVANCED=y
8−CONFIG_IBM_PARTITION=y
9−CONFIG_DEFAULT_DEADLINE=y
1011 CONFIG_TUNE_ZEC12=y
1112 # CONFIG_COMPAT is not set
1213 CONFIG_NR_CPUS=2
13−# CONFIG_HOTPLUG_CPU is not set
1414 CONFIG_HZ_100=y
1515 # CONFIG_ARCH_RANDOM is not set
16−# CONFIG_COMPACTION is not set
17−# CONFIG_MIGRATION is not set
18−# CONFIG_BOUNCE is not set
19−# CONFIG_CHECK_STACK is not set
16+# CONFIG_RELOCATABLE is not set
2017 # CONFIG_CHSC_SCH is not set
2118 # CONFIG_SCM_BUS is not set
2219 CONFIG_CRASH_DUMP=y
23−# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
2420 # CONFIG_SECCOMP is not set
21+# CONFIG_PFAULT is not set
22+# CONFIG_S390_HYPFS_FS is not set
23+# CONFIG_VIRTUALIZATION is not set
24+# CONFIG_S390_GUEST is not set
25+CONFIG_PARTITION_ADVANCED=y
26+CONFIG_IBM_PARTITION=y
27+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
28+# CONFIG_COMPACTION is not set
29+# CONFIG_MIGRATION is not set
30+# CONFIG_BOUNCE is not set
2531 CONFIG_NET=y
2632 # CONFIG_IUCV is not set
2733 CONFIG_DEVTMPFS=y
@@ -43,7 +49,6 @@ CONFIG_ZFCP=y · 15 unmodified lines
4349 # CONFIG_HVC_IUCV is not set
4450 # CONFIG_HW_RANDOM_S390 is not set
4551 CONFIG_RAW_DRIVER=y
46−# CONFIG_SCLP_ASYNC is not set
4752 # CONFIG_HMC_DRV is not set
4853 # CONFIG_S390_TAPE is not set
4954 # CONFIG_VMCP is not set
@@ -56,6 +61,7 @@ CONFIG_RAW_DRIVER=y · 6 unmodified lines
5661 CONFIG_CONFIGFS_FS=y
5762 # CONFIG_MISC_FILESYSTEMS is not set
5863 # CONFIG_NETWORK_FILESYSTEMS is not set
64+# CONFIG_DIMLIB is not set
5965 CONFIG_PRINTK_TIME=y
6066 CONFIG_DEBUG_INFO=y
6167 CONFIG_DEBUG_FS=y
@@ -64,7 +70,4 @@ CONFIG_PANIC_ON_OOPS=y · 2 unmodified lines
6470 # CONFIG_SCHED_DEBUG is not set
6571 CONFIG_RCU_CPU_STALL_TIMEOUT=60
6672 # CONFIG_FTRACE is not set
67−# CONFIG_PFAULT is not set
68−# CONFIG_S390_HYPFS_FS is not set
69−# CONFIG_VIRTUALIZATION is not set
70−# CONFIG_S390_GUEST is not set
73+# CONFIG_RUNTIME_TESTING_MENU is not set
arch/s390/include/asm/qdio.h+5−5
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828 * @sliba: storage list information block address
2929 * @sla: storage list address
3030 * @slsba: storage list state block address
31− * @akey: access key for DLIB
31+ * @akey: access key for SLIB
3232 * @bkey: access key for SL
3333 * @ckey: access key for SBALs
3434 * @dkey: access key for SLSB
@@ -50,11 +50,10 @@ struct qdesfmt0 { · 15 unmodified lines
5050 /**
5151 * struct qdr - queue description record (QDR)
5252 * @qfmt: queue format
53− * @pfmt: implementation dependent parameter format
5453 * @ac: adapter characteristics
5554 * @iqdcnt: input queue descriptor count
5655 * @oqdcnt: output queue descriptor count
57− * @iqdsz: inpout queue descriptor size
56+ * @iqdsz: input queue descriptor size
5857 * @oqdsz: output queue descriptor size
5958 * @qiba: queue information block address
6059 * @qkey: queue information block key
@@ -62,8 +61,7 @@ struct qdesfmt0 { · 1 unmodified line
6261 */
6362 struct qdr {
6463 u32 qfmt : 8;
65− u32 pfmt : 8;
66− u32 : 8;
64+ u32 : 16;
6765 u32 ac : 8;
6866 u32 : 8;
6967 u32 iqdcnt : 8;
@@ -327,6 +325,7 @@ typedef void qdio_handler_t(struct ccw_device *, unsigned int, int, · 257 unmodified lines
327325 * struct qdio_initialize - qdio initialization data
328326 * @cdev: associated ccw device
329327 * @q_format: queue format
328+ * @qdr_ac: feature flags to set
330329 * @adapter_name: name for the adapter
331330 * @qib_param_field_format: format for qib_parm_field
332331 * @qib_param_field: pointer to 128 bytes or NULL, if no param field
@@ -338,6 +337,7 @@ typedef void qdio_handler_t(struct ccw_device *, unsigned int, int, · 5 unmodified lines
338337 * @input_handler: handler to be called for input queues
339338 * @output_handler: handler to be called for output queues
340339 * @queue_start_poll_array: polling handlers (one per input queue or NULL)
340+ * @scan_threshold: # of in-use buffers that triggers scan on output queue
341341 * @int_parm: interruption parameter
342342 * @input_sbal_addr_array: address of no_input_qs * 128 pointers
343343 * @output_sbal_addr_array: address of no_output_qs * 128 pointers
arch/s390/include/asm/setup.h+1−0
@@ -84,6 +84,7 @@ extern int noexec_disabled; · 83 unmodified lines
8484 extern int memory_end_set;
8585 extern unsigned long memory_end;
8686 extern unsigned long max_physmem_end;
87+extern unsigned long __swsusp_reset_dma;
8788
8889 #define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM)
8990 #define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
arch/s390/kernel/dumpstack.c+1−5
@@ -114,12 +114,8 @@ recursion_check: · 113 unmodified lines
114114 * If it comes up a second time then there's something wrong going on:
115115 * just break out and report an unknown stack type.
116116 */
117− if (*visit_mask & (1UL << info->type)) {
118− printk_deferred_once(KERN_WARNING
119− "WARNING: stack recursion on stack type %d\n",
120− info->type);
117+ if (*visit_mask & (1UL << info->type))
121118 goto unknown;
122− }
123119 *visit_mask |= 1UL << info->type;
124120 return 0;
125121 unknown:
arch/s390/kernel/head64.S+0−7
@@ -60,12 +60,5 @@ ENTRY(startup_continue) · 59 unmodified lines
6060
6161 .align 16
6262 .LPG1:
63−.Lpcmsk:.quad 0x0000000180000000
64−.L4malign:.quad 0xffffffffffc00000
65−.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8
66−.Lnop: .long 0x07000700
67−.Lparmaddr:
68− .quad PARMAREA
69− .align 64
7063 .Ldw: .quad 0x0002000180000000,0x0000000000000000
7164 .Laregs:.long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
arch/s390/kernel/ipl.c+0−9
@@ -31,7 +31,6 @@ · 30 unmodified lines
3131 #include <asm/os_info.h>
3232 #include <asm/sections.h>
3333 #include <asm/boot_data.h>
34−#include <asm/uv.h>
3534 #include "entry.h"
3635
3736 #define IPL_PARM_BLOCK_VERSION 0
@@ -892,21 +891,15 @@ static void __reipl_run(void *unused) · 854 unmodified lines
892891 {
893892 switch (reipl_type) {
894893 case IPL_TYPE_CCW:
895− uv_set_shared(__pa(reipl_block_ccw));
896894 diag308(DIAG308_SET, reipl_block_ccw);
897− uv_remove_shared(__pa(reipl_block_ccw));
898895 diag308(DIAG308_LOAD_CLEAR, NULL);
899896 break;
900897 case IPL_TYPE_FCP:
901− uv_set_shared(__pa(reipl_block_fcp));
902898 diag308(DIAG308_SET, reipl_block_fcp);
903− uv_remove_shared(__pa(reipl_block_fcp));
904899 diag308(DIAG308_LOAD_CLEAR, NULL);
905900 break;
906901 case IPL_TYPE_NSS:
907− uv_set_shared(__pa(reipl_block_nss));
908902 diag308(DIAG308_SET, reipl_block_nss);
909− uv_remove_shared(__pa(reipl_block_nss));
910903 diag308(DIAG308_LOAD_CLEAR, NULL);
911904 break;
912905 case IPL_TYPE_UNKNOWN:
@@ -1176,9 +1169,7 @@ static struct kset *dump_kset; · 263 unmodified lines
11761169
11771170 static void diag308_dump(void *dump_block)
11781171 {
1179− uv_set_shared(__pa(dump_block));
11801172 diag308(DIAG308_SET, dump_block);
1181− uv_remove_shared(__pa(dump_block));
11821173 while (1) {
11831174 if (diag308(DIAG308_LOAD_NORMAL_DUMP, NULL) != 0x302)
11841175 break;
arch/s390/kernel/machine_kexec_reloc.c+1−0
@@ -1,5 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0
22 #include <linux/elf.h>
3+#include <asm/kexec.h>
34
45 int arch_kexec_do_relocs(int r_type, void *loc, unsigned long val,
56 unsigned long addr)
arch/s390/kernel/perf_cpum_cf_diag.c+1−1
@@ -34,7 +34,7 @@ struct cf_diag_csd { /* Counter set data per CPU */ · 33 unmodified lines
3434 unsigned char start[PAGE_SIZE]; /* Counter set at event start */
3535 unsigned char data[PAGE_SIZE]; /* Counter set at event delete */
3636 };
37−DEFINE_PER_CPU(struct cf_diag_csd, cf_diag_csd);
37+static DEFINE_PER_CPU(struct cf_diag_csd, cf_diag_csd);
3838
3939 /* Counter sets are stored as data stream in a page sized memory buffer and
4040 * exported to user space via raw data attached to the event sample data.
arch/s390/kernel/setup.c+1−2
@@ -1114,8 +1114,7 @@ void __init setup_arch(char **cmdline_p) · 1113 unmodified lines
11141114
11151115 ROOT_DEV = Root_RAM0;
11161116
1117− /* Is init_mm really needed? */
1118− init_mm.start_code = PAGE_OFFSET;
1117+ init_mm.start_code = (unsigned long) _text;
11191118 init_mm.end_code = (unsigned long) _etext;
11201119 init_mm.end_data = (unsigned long) _edata;
11211120 init_mm.brk = (unsigned long) _end;
arch/s390/kernel/vdso.c+0−5
@@ -216,11 +216,6 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) · 215 unmodified lines
216216
217217 if (!vdso_enabled)
218218 return 0;
219− /*
220− * Only map the vdso for dynamically linked elf binaries.
221− */
222− if (!uses_interp)
223− return 0;
224219
225220 vdso_pages = vdso64_pages;
226221 #ifdef CONFIG_COMPAT_VDSO
arch/s390/kernel/vmlinux.lds.S+4−6
@@ -32,10 +32,9 @@ PHDRS { · 31 unmodified lines
3232 SECTIONS
3333 {
3434 . = 0x100000;
35− _stext = .; /* Start of text section */
3635 .text : {
37− /* Text and read-only data */
38− _text = .;
36+ _stext = .; /* Start of text section */
37+ _text = .; /* Text and read-only data */
3938 HEAD_TEXT
4039 TEXT_TEXT
4140 SCHED_TEXT
@@ -47,11 +46,10 @@ SECTIONS · 5 unmodified lines
4746 *(.text.*_indirect_*)
4847 *(.fixup)
4948 *(.gnu.warning)
49+ . = ALIGN(PAGE_SIZE);
50+ _etext = .; /* End of text section */
5051 } :text = 0x0700
5152
52− . = ALIGN(PAGE_SIZE);
53− _etext = .; /* End of text section */
54−
5553 NOTES :text :note
5654
5755 .dummy : { *(.dummy) } :data
arch/s390/kvm/kvm-s390.c+0−10
@@ -2516,16 +2516,6 @@ out_err: · 2515 unmodified lines
25162516 return rc;
25172517 }
25182518
2519−bool kvm_arch_has_vcpu_debugfs(void)
2520−{
2521− return false;
2522−}
2523−
2524−int kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu)
2525−{
2526− return 0;
2527−}
2528−
25292519 void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
25302520 {
25312521 VCPU_EVENT(vcpu, 3, "%s", "free cpu");
arch/s390/lib/xor.c+1−0
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 #include <linux/types.h>
1010 #include <linux/export.h>
1111 #include <linux/raid/xor.h>
12+#include <asm/xor.h>
1213
1314 static void xor_xc_2(unsigned long bytes, unsigned long *p1, unsigned long *p2)
1415 {
arch/s390/mm/dump_pagetables.c+6−6
@@ -161,9 +161,9 @@ static void walk_pmd_level(struct seq_file *m, struct pg_state *st, · 160 unmodified lines
161161 }
162162 #endif
163163
164− for (i = 0; i < PTRS_PER_PMD && addr < max_addr; i++) {
164+ pmd = pmd_offset(pud, addr);
165+ for (i = 0; i < PTRS_PER_PMD && addr < max_addr; i++, pmd++) {
165166 st->current_address = addr;
166− pmd = pmd_offset(pud, addr);
167167 if (!pmd_none(*pmd)) {
168168 if (pmd_large(*pmd)) {
169169 prot = pmd_val(*pmd) &
@@ -192,9 +192,9 @@ static void walk_pud_level(struct seq_file *m, struct pg_state *st, · 22 unmodified lines
192192 }
193193 #endif
194194
195− for (i = 0; i < PTRS_PER_PUD && addr < max_addr; i++) {
195+ pud = pud_offset(p4d, addr);
196+ for (i = 0; i < PTRS_PER_PUD && addr < max_addr; i++, pud++) {
196197 st->current_address = addr;
197− pud = pud_offset(p4d, addr);
198198 if (!pud_none(*pud))
199199 if (pud_large(*pud)) {
200200 prot = pud_val(*pud) &
@@ -222,9 +222,9 @@ static void walk_p4d_level(struct seq_file *m, struct pg_state *st, · 21 unmodified lines
222222 }
223223 #endif
224224
225− for (i = 0; i < PTRS_PER_P4D && addr < max_addr; i++) {
225+ p4d = p4d_offset(pgd, addr);
226+ for (i = 0; i < PTRS_PER_P4D && addr < max_addr; i++, p4d++) {
226227 st->current_address = addr;
227− p4d = p4d_offset(pgd, addr);
228228 if (!p4d_none(*p4d))
229229 walk_pud_level(m, st, p4d, addr);
230230 else
arch/s390/mm/fault.c+3−0
@@ -327,6 +327,7 @@ static noinline void do_fault_error(struct pt_regs *regs, int access, · 326 unmodified lines
327327 case VM_FAULT_BADACCESS:
328328 if (access == VM_EXEC && signal_return(regs) == 0)
329329 break;
330+ /* fallthrough */
330331 case VM_FAULT_BADMAP:
331332 /* Bad memory access. Check if it is kernel or user space. */
332333 if (user_mode(regs)) {
@@ -336,7 +337,9 @@ static noinline void do_fault_error(struct pt_regs *regs, int access, · 3 unmodified lines
336337 do_sigsegv(regs, si_code);
337338 break;
338339 }
340+ /* fallthrough */
339341 case VM_FAULT_BADCONTEXT:
342+ /* fallthrough */
340343 case VM_FAULT_PFAULT:
341344 do_no_context(regs);
342345 break;
arch/s390/mm/gmap.c+2−2
@@ -2424,8 +2424,8 @@ EXPORT_SYMBOL_GPL(gmap_pmdp_idte_global); · 2423 unmodified lines
24242424 * This function is assumed to be called with the guest_table_lock
24252425 * held.
24262426 */
2427−bool gmap_test_and_clear_dirty_pmd(struct gmap *gmap, pmd_t *pmdp,
2428− unsigned long gaddr)
2427+static bool gmap_test_and_clear_dirty_pmd(struct gmap *gmap, pmd_t *pmdp,
2428+ unsigned long gaddr)
24292429 {
24302430 if (pmd_val(*pmdp) & _SEGMENT_ENTRY_INVALID)
24312431 return false;
arch/s390/scripts/Makefile.chkbss+1−2
@@ -11,8 +11,7 @@ chkbss: $(addprefix $(obj)/, $(chkbss-files)) · 10 unmodified lines
1111
1212 quiet_cmd_chkbss = CHKBSS $<
1313 cmd_chkbss = \
14− if $(OBJDUMP) -h $< | grep -q "\.bss" && \
15− ! $(OBJDUMP) -j .bss -w -h $< | awk 'END { if ($$3) exit 1 }'; then \
14+ if ! $(OBJSIZE) --common $< | $(AWK) 'END { if ($$3) exit 1 }'; then \
1615 echo "error: $< .bss section is not empty" >&2; exit 1; \
1716 fi; \
1817 touch $@;
arch/x86/boot/string.c+8−0
@@ -37,6 +37,14 @@ int memcmp(const void *s1, const void *s2, size_t len) · 36 unmodified lines
3737 return diff;
3838 }
3939
40+/*
41+ * Clang may lower `memcmp == 0` to `bcmp == 0`.
42+ */
43+int bcmp(const void *s1, const void *s2, size_t len)
44+{
45+ return memcmp(s1, s2, len);
46+}
47+
4048 int strcmp(const char *str1, const char *str2)
4149 {
4250 const unsigned char *s1 = (const unsigned char *)str1;
arch/x86/entry/calling.h+17−0
@@ -314,6 +314,23 @@ For 32-bit we have the following conventions - kernel is built with · 313 unmodified lines
314314
315315 #endif
316316
317+/*
318+ * Mitigate Spectre v1 for conditional swapgs code paths.
319+ *
320+ * FENCE_SWAPGS_USER_ENTRY is used in the user entry swapgs code path, to
321+ * prevent a speculative swapgs when coming from kernel space.
322+ *
323+ * FENCE_SWAPGS_KERNEL_ENTRY is used in the kernel entry non-swapgs code path,
324+ * to prevent the swapgs from getting speculatively skipped when coming from
325+ * user space.
326+ */
327+.macro FENCE_SWAPGS_USER_ENTRY
328+ ALTERNATIVE "", "lfence", X86_FEATURE_FENCE_SWAPGS_USER
329+.endm
330+.macro FENCE_SWAPGS_KERNEL_ENTRY
331+ ALTERNATIVE "", "lfence", X86_FEATURE_FENCE_SWAPGS_KERNEL
332+.endm
333+
317334 .macro STACKLEAK_ERASE_NOCLOBBER
318335 #ifdef CONFIG_GCC_PLUGIN_STACKLEAK
319336 PUSH_AND_CLEAR_REGS
arch/x86/entry/entry_64.S+18−3
@@ -519,7 +519,7 @@ ENTRY(interrupt_entry) · 518 unmodified lines
519519 testb $3, CS-ORIG_RAX+8(%rsp)
520520 jz 1f
521521 SWAPGS
522−
522+ FENCE_SWAPGS_USER_ENTRY
523523 /*
524524 * Switch to the thread stack. The IRET frame and orig_ax are
525525 * on the stack, as well as the return address. RDI..R12 are
@@ -549,8 +549,10 @@ ENTRY(interrupt_entry) · 23 unmodified lines
549549 UNWIND_HINT_FUNC
550550
551551 movq (%rdi), %rdi
552+ jmp 2f
552553 1:
553−
554+ FENCE_SWAPGS_KERNEL_ENTRY
555+2:
554556 PUSH_AND_CLEAR_REGS save_ret=1
555557 ENCODE_FRAME_POINTER 8
556558
@@ -1238,6 +1240,13 @@ ENTRY(paranoid_entry) · 681 unmodified lines
12381240 */
12391241 SAVE_AND_SWITCH_TO_KERNEL_CR3 scratch_reg=%rax save_reg=%r14
12401242
1243+ /*
1244+ * The above SAVE_AND_SWITCH_TO_KERNEL_CR3 macro doesn't do an
1245+ * unconditional CR3 write, even in the PTI case. So do an lfence
1246+ * to prevent GS speculation, regardless of whether PTI is enabled.
1247+ */
1248+ FENCE_SWAPGS_KERNEL_ENTRY
1249+
12411250 ret
12421251 END(paranoid_entry)
12431252
@@ -1288,6 +1297,7 @@ ENTRY(error_entry) · 44 unmodified lines
12881297 * from user mode due to an IRET fault.
12891298 */
12901299 SWAPGS
1300+ FENCE_SWAPGS_USER_ENTRY
12911301 /* We have user CR3. Change to kernel CR3. */
12921302 SWITCH_TO_KERNEL_CR3 scratch_reg=%rax
12931303
@@ -1301,6 +1311,8 @@ ENTRY(error_entry) · 7 unmodified lines
13011311 pushq %r12
13021312 ret
13031313
1314+.Lerror_entry_done_lfence:
1315+ FENCE_SWAPGS_KERNEL_ENTRY
13041316 .Lerror_entry_done:
13051317 ret
13061318
@@ -1318,7 +1330,7 @@ ENTRY(error_entry) · 11 unmodified lines
13181330 cmpq %rax, RIP+8(%rsp)
13191331 je .Lbstep_iret
13201332 cmpq $.Lgs_change, RIP+8(%rsp)
1321− jne .Lerror_entry_done
1333+ jne .Lerror_entry_done_lfence
13221334
13231335 /*
13241336 * hack: .Lgs_change can fail with user gsbase. If this happens, fix up
@@ -1326,6 +1338,7 @@ ENTRY(error_entry) · 1 unmodified line
13261338 * .Lgs_change's error handler with kernel gsbase.
13271339 */
13281340 SWAPGS
1341+ FENCE_SWAPGS_USER_ENTRY
13291342 SWITCH_TO_KERNEL_CR3 scratch_reg=%rax
13301343 jmp .Lerror_entry_done
13311344
@@ -1340,6 +1353,7 @@ ENTRY(error_entry) · 8 unmodified lines
13401353 * gsbase and CR3. Switch to kernel gsbase and CR3:
13411354 */
13421355 SWAPGS
1356+ FENCE_SWAPGS_USER_ENTRY
13431357 SWITCH_TO_KERNEL_CR3 scratch_reg=%rax
13441358
13451359 /*
@@ -1431,6 +1445,7 @@ ENTRY(nmi) · 85 unmodified lines
14311445
14321446 swapgs
14331447 cld
1448+ FENCE_SWAPGS_USER_ENTRY
14341449 SWITCH_TO_KERNEL_CR3 scratch_reg=%rdx
14351450 movq %rsp, %rdx
14361451 movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp
arch/x86/include/asm/cpufeatures.h+3−0
@@ -281,6 +281,8 @@ · 280 unmodified lines
281281 #define X86_FEATURE_CQM_OCCUP_LLC (11*32+ 1) /* LLC occupancy monitoring */
282282 #define X86_FEATURE_CQM_MBM_TOTAL (11*32+ 2) /* LLC Total MBM monitoring */
283283 #define X86_FEATURE_CQM_MBM_LOCAL (11*32+ 3) /* LLC Local MBM monitoring */
284+#define X86_FEATURE_FENCE_SWAPGS_USER (11*32+ 4) /* "" LFENCE in user entry SWAPGS path */
285+#define X86_FEATURE_FENCE_SWAPGS_KERNEL (11*32+ 5) /* "" LFENCE in kernel entry SWAPGS path */
284286
285287 /* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */
286288 #define X86_FEATURE_AVX512_BF16 (12*32+ 5) /* AVX512 BFLOAT16 instructions */
@@ -394,5 +396,6 @@ · 107 unmodified lines
394396 #define X86_BUG_L1TF X86_BUG(18) /* CPU is affected by L1 Terminal Fault */
395397 #define X86_BUG_MDS X86_BUG(19) /* CPU is affected by Microarchitectural data sampling */
396398 #define X86_BUG_MSBDS_ONLY X86_BUG(20) /* CPU is only affected by the MSDBS variant of BUG_MDS */
399+#define X86_BUG_SWAPGS X86_BUG(21) /* CPU is affected by speculation through SWAPGS */
397400
398401 #endif /* _ASM_X86_CPUFEATURES_H */
arch/x86/include/asm/kvm_host.h+3−0
@@ -35,6 +35,8 @@ · 34 unmodified lines
3535 #include <asm/kvm_vcpu_regs.h>
3636 #include <asm/hyperv-tlfs.h>
3737
38+#define __KVM_HAVE_ARCH_VCPU_DEBUGFS
39+
3840 #define KVM_MAX_VCPUS 288
3941 #define KVM_SOFT_MAX_VCPUS 240
4042 #define KVM_MAX_VCPU_ID 1023
@@ -1175,6 +1177,7 @@ struct kvm_x86_ops { · 1134 unmodified lines
11751177 int (*update_pi_irte)(struct kvm *kvm, unsigned int host_irq,
11761178 uint32_t guest_irq, bool set);
11771179 void (*apicv_post_state_restore)(struct kvm_vcpu *vcpu);
1180+ bool (*dy_apicv_has_pending_interrupt)(struct kvm_vcpu *vcpu);
11781181
11791182 int (*set_hv_timer)(struct kvm_vcpu *vcpu, u64 guest_deadline_tsc,
11801183 bool *expired);
arch/x86/include/asm/vdso/gettimeofday.h+36−0
@@ -96,6 +96,8 @@ long clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts) · 95 unmodified lines
9696
9797 #else
9898
99+#define VDSO_HAS_32BIT_FALLBACK 1
100+
99101 static __always_inline
100102 long clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
101103 {
@@ -113,6 +115,23 @@ long clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts) · 11 unmodified lines
113115 return ret;
114116 }
115117
118+static __always_inline
119+long clock_gettime32_fallback(clockid_t _clkid, struct old_timespec32 *_ts)
120+{
121+ long ret;
122+
123+ asm (
124+ "mov %%ebx, %%edx \n"
125+ "mov %[clock], %%ebx \n"
126+ "call __kernel_vsyscall \n"
127+ "mov %%edx, %%ebx \n"
128+ : "=a" (ret), "=m" (*_ts)
129+ : "0" (__NR_clock_gettime), [clock] "g" (_clkid), "c" (_ts)
130+ : "edx");
131+
132+ return ret;
133+}
134+
116135 static __always_inline
117136 long gettimeofday_fallback(struct __kernel_old_timeval *_tv,
118137 struct timezone *_tz)
@@ -148,6 +167,23 @@ clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts) · 29 unmodified lines
148167 return ret;
149168 }
150169
170+static __always_inline
171+long clock_getres32_fallback(clockid_t _clkid, struct old_timespec32 *_ts)
172+{
173+ long ret;
174+
175+ asm (
176+ "mov %%ebx, %%edx \n"
177+ "mov %[clock], %%ebx \n"
178+ "call __kernel_vsyscall \n"
179+ "mov %%edx, %%ebx \n"
180+ : "=a" (ret), "=m" (*_ts)
181+ : "0" (__NR_clock_getres), [clock] "g" (_clkid), "c" (_ts)
182+ : "edx");
183+
184+ return ret;
185+}
186+
151187 #endif
152188
153189 #ifdef CONFIG_PARAVIRT_CLOCK
arch/x86/kernel/cpu/bugs.c+96−9
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434
3535 #include "cpu.h"
3636
37+static void __init spectre_v1_select_mitigation(void);
3738 static void __init spectre_v2_select_mitigation(void);
3839 static void __init ssb_select_mitigation(void);
3940 static void __init l1tf_select_mitigation(void);
@@ -98,17 +99,11 @@ void __init check_bugs(void) · 58 unmodified lines
9899 if (boot_cpu_has(X86_FEATURE_STIBP))
99100 x86_spec_ctrl_mask |= SPEC_CTRL_STIBP;
100101
101− /* Select the proper spectre mitigation before patching alternatives */
102+ /* Select the proper CPU mitigations before patching alternatives: */
103+ spectre_v1_select_mitigation();
102104 spectre_v2_select_mitigation();
103−
104− /*
105− * Select proper mitigation for any exposure to the Speculative Store
106− * Bypass vulnerability.
107− */
108105 ssb_select_mitigation();
109−
110106 l1tf_select_mitigation();
111−
112107 mds_select_mitigation();
113108
114109 arch_smt_update();
@@ -273,6 +268,98 @@ static int __init mds_cmdline(char *str) · 158 unmodified lines
273268 }
274269 early_param("mds", mds_cmdline);
275270
271+#undef pr_fmt
272+#define pr_fmt(fmt) "Spectre V1 : " fmt
273+
274+enum spectre_v1_mitigation {
275+ SPECTRE_V1_MITIGATION_NONE,
276+ SPECTRE_V1_MITIGATION_AUTO,
277+};
278+
279+static enum spectre_v1_mitigation spectre_v1_mitigation __ro_after_init =
280+ SPECTRE_V1_MITIGATION_AUTO;
281+
282+static const char * const spectre_v1_strings[] = {
283+ [SPECTRE_V1_MITIGATION_NONE] = "Vulnerable: __user pointer sanitization and usercopy barriers only; no swapgs barriers",
284+ [SPECTRE_V1_MITIGATION_AUTO] = "Mitigation: usercopy/swapgs barriers and __user pointer sanitization",
285+};
286+
287+/*
288+ * Does SMAP provide full mitigation against speculative kernel access to
289+ * userspace?
290+ */
291+static bool smap_works_speculatively(void)
292+{
293+ if (!boot_cpu_has(X86_FEATURE_SMAP))
294+ return false;
295+
296+ /*
297+ * On CPUs which are vulnerable to Meltdown, SMAP does not
298+ * prevent speculative access to user data in the L1 cache.
299+ * Consider SMAP to be non-functional as a mitigation on these
300+ * CPUs.
301+ */
302+ if (boot_cpu_has(X86_BUG_CPU_MELTDOWN))
303+ return false;
304+
305+ return true;
306+}
307+
308+static void __init spectre_v1_select_mitigation(void)
309+{
310+ if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V1) || cpu_mitigations_off()) {
311+ spectre_v1_mitigation = SPECTRE_V1_MITIGATION_NONE;
312+ return;
313+ }
314+
315+ if (spectre_v1_mitigation == SPECTRE_V1_MITIGATION_AUTO) {
316+ /*
317+ * With Spectre v1, a user can speculatively control either
318+ * path of a conditional swapgs with a user-controlled GS
319+ * value. The mitigation is to add lfences to both code paths.
320+ *
321+ * If FSGSBASE is enabled, the user can put a kernel address in
322+ * GS, in which case SMAP provides no protection.
323+ *
324+ * [ NOTE: Don't check for X86_FEATURE_FSGSBASE until the
325+ * FSGSBASE enablement patches have been merged. ]
326+ *
327+ * If FSGSBASE is disabled, the user can only put a user space
328+ * address in GS. That makes an attack harder, but still
329+ * possible if there's no SMAP protection.
330+ */
331+ if (!smap_works_speculatively()) {
332+ /*
333+ * Mitigation can be provided from SWAPGS itself or
334+ * PTI as the CR3 write in the Meltdown mitigation
335+ * is serializing.
336+ *
337+ * If neither is there, mitigate with an LFENCE to
338+ * stop speculation through swapgs.
339+ */
340+ if (boot_cpu_has_bug(X86_BUG_SWAPGS) &&
341+ !boot_cpu_has(X86_FEATURE_PTI))
342+ setup_force_cpu_cap(X86_FEATURE_FENCE_SWAPGS_USER);
343+
344+ /*
345+ * Enable lfences in the kernel entry (non-swapgs)
346+ * paths, to prevent user entry from speculatively
347+ * skipping swapgs.
348+ */
349+ setup_force_cpu_cap(X86_FEATURE_FENCE_SWAPGS_KERNEL);
350+ }
351+ }
352+
353+ pr_info("%s\n", spectre_v1_strings[spectre_v1_mitigation]);
354+}
355+
356+static int __init nospectre_v1_cmdline(char *str)
357+{
358+ spectre_v1_mitigation = SPECTRE_V1_MITIGATION_NONE;
359+ return 0;
360+}
361+early_param("nospectre_v1", nospectre_v1_cmdline);
362+
276363 #undef pr_fmt
277364 #define pr_fmt(fmt) "Spectre V2 : " fmt
278365
@@ -1290,7 +1377,7 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr · 1011 unmodified lines
12901377 break;
12911378
12921379 case X86_BUG_SPECTRE_V1:
1293− return sprintf(buf, "Mitigation: __user pointer sanitization\n");
1380+ return sprintf(buf, "%s\n", spectre_v1_strings[spectre_v1_mitigation]);
12941381
12951382 case X86_BUG_SPECTRE_V2:
12961383 return sprintf(buf, "%s%s%s%s%s%s\n", spectre_v2_strings[spectre_v2_enabled],
arch/x86/kernel/cpu/common.c+28−16
@@ -1022,6 +1022,7 @@ static void identify_cpu_without_cpuid(struct cpuinfo_x86 *c) · 1021 unmodified lines
10221022 #define NO_L1TF BIT(3)
10231023 #define NO_MDS BIT(4)
10241024 #define MSBDS_ONLY BIT(5)
1025+#define NO_SWAPGS BIT(6)
10251026
10261027 #define VULNWL(_vendor, _family, _model, _whitelist) \
10271028 { X86_VENDOR_##_vendor, _family, _model, X86_FEATURE_ANY, _whitelist }
@@ -1048,30 +1049,38 @@ static const __initconst struct x86_cpu_id cpu_vuln_whitelist[] = { · 20 unmodified lines
10481049 VULNWL_INTEL(ATOM_BONNELL, NO_SPECULATION),
10491050 VULNWL_INTEL(ATOM_BONNELL_MID, NO_SPECULATION),
10501051
1051− VULNWL_INTEL(ATOM_SILVERMONT, NO_SSB | NO_L1TF | MSBDS_ONLY),
1052− VULNWL_INTEL(ATOM_SILVERMONT_X, NO_SSB | NO_L1TF | MSBDS_ONLY),
1053− VULNWL_INTEL(ATOM_SILVERMONT_MID, NO_SSB | NO_L1TF | MSBDS_ONLY),
1054− VULNWL_INTEL(ATOM_AIRMONT, NO_SSB | NO_L1TF | MSBDS_ONLY),
1055− VULNWL_INTEL(XEON_PHI_KNL, NO_SSB | NO_L1TF | MSBDS_ONLY),
1056− VULNWL_INTEL(XEON_PHI_KNM, NO_SSB | NO_L1TF | MSBDS_ONLY),
1052+ VULNWL_INTEL(ATOM_SILVERMONT, NO_SSB | NO_L1TF | MSBDS_ONLY | NO_SWAPGS),
1053+ VULNWL_INTEL(ATOM_SILVERMONT_X, NO_SSB | NO_L1TF | MSBDS_ONLY | NO_SWAPGS),
1054+ VULNWL_INTEL(ATOM_SILVERMONT_MID, NO_SSB | NO_L1TF | MSBDS_ONLY | NO_SWAPGS),
1055+ VULNWL_INTEL(ATOM_AIRMONT, NO_SSB | NO_L1TF | MSBDS_ONLY | NO_SWAPGS),
1056+ VULNWL_INTEL(XEON_PHI_KNL, NO_SSB | NO_L1TF | MSBDS_ONLY | NO_SWAPGS),
1057+ VULNWL_INTEL(XEON_PHI_KNM, NO_SSB | NO_L1TF | MSBDS_ONLY | NO_SWAPGS),
10571058
10581059 VULNWL_INTEL(CORE_YONAH, NO_SSB),
10591060
1060− VULNWL_INTEL(ATOM_AIRMONT_MID, NO_L1TF | MSBDS_ONLY),
1061+ VULNWL_INTEL(ATOM_AIRMONT_MID, NO_L1TF | MSBDS_ONLY | NO_SWAPGS),
10611062
1062− VULNWL_INTEL(ATOM_GOLDMONT, NO_MDS | NO_L1TF),
1063− VULNWL_INTEL(ATOM_GOLDMONT_X, NO_MDS | NO_L1TF),
1064− VULNWL_INTEL(ATOM_GOLDMONT_PLUS, NO_MDS | NO_L1TF),
1063+ VULNWL_INTEL(ATOM_GOLDMONT, NO_MDS | NO_L1TF | NO_SWAPGS),
1064+ VULNWL_INTEL(ATOM_GOLDMONT_X, NO_MDS | NO_L1TF | NO_SWAPGS),
1065+ VULNWL_INTEL(ATOM_GOLDMONT_PLUS, NO_MDS | NO_L1TF | NO_SWAPGS),
1066+
1067+ /*
1068+ * Technically, swapgs isn't serializing on AMD (despite it previously
1069+ * being documented as such in the APM). But according to AMD, %gs is
1070+ * updated non-speculatively, and the issuing of %gs-relative memory
1071+ * operands will be blocked until the %gs update completes, which is
1072+ * good enough for our purposes.
1073+ */
10651074
10661075 /* AMD Family 0xf - 0x12 */
1067− VULNWL_AMD(0x0f, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS),
1068− VULNWL_AMD(0x10, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS),
1069− VULNWL_AMD(0x11, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS),
1070− VULNWL_AMD(0x12, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS),
1076+ VULNWL_AMD(0x0f, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS | NO_SWAPGS),
1077+ VULNWL_AMD(0x10, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS | NO_SWAPGS),
1078+ VULNWL_AMD(0x11, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS | NO_SWAPGS),
1079+ VULNWL_AMD(0x12, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS | NO_SWAPGS),
10711080
10721081 /* FAMILY_ANY must be last, otherwise 0x0f - 0x12 matches won't work */
1073− VULNWL_AMD(X86_FAMILY_ANY, NO_MELTDOWN | NO_L1TF | NO_MDS),
1074− VULNWL_HYGON(X86_FAMILY_ANY, NO_MELTDOWN | NO_L1TF | NO_MDS),
1082+ VULNWL_AMD(X86_FAMILY_ANY, NO_MELTDOWN | NO_L1TF | NO_MDS | NO_SWAPGS),
1083+ VULNWL_HYGON(X86_FAMILY_ANY, NO_MELTDOWN | NO_L1TF | NO_MDS | NO_SWAPGS),
10751084 {}
10761085 };
10771086
@@ -1108,6 +1117,9 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c) · 30 unmodified lines
11081117 setup_force_cpu_bug(X86_BUG_MSBDS_ONLY);
11091118 }
11101119
1120+ if (!cpu_matches(NO_SWAPGS))
1121+ setup_force_cpu_bug(X86_BUG_SWAPGS);
1122+
11111123 if (cpu_matches(NO_MELTDOWN))
11121124 return;
11131125
arch/x86/kernel/cpu/mtrr/cyrix.c+1−0
@@ -98,6 +98,7 @@ cyrix_get_free_region(unsigned long base, unsigned long size, int replace_reg) · 97 unmodified lines
9898 case 7:
9999 if (size < 0x40)
100100 break;
101+ /* Else, fall through */
101102 case 6:
102103 case 5:
103104 case 4:
arch/x86/kernel/kvm.c+0−8
@@ -308,9 +308,6 @@ static notrace void kvm_guest_apic_eoi_write(u32 reg, u32 val) · 307 unmodified lines
308308
309309 static void kvm_guest_cpu_init(void)
310310 {
311− if (!kvm_para_available())
312− return;
313−
314311 if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF) && kvmapf) {
315312 u64 pa = slow_virt_to_phys(this_cpu_ptr(&apf_reason));
316313
@@ -625,9 +622,6 @@ static void __init kvm_guest_init(void) · 308 unmodified lines
625622 {
626623 int i;
627624
628− if (!kvm_para_available())
629− return;
630−
631625 paravirt_ops_setup();
632626 register_reboot_notifier(&kvm_pv_reboot_nb);
633627 for (i = 0; i < KVM_TASK_SLEEP_HASHSIZE; i++)
@@ -848,8 +842,6 @@ asm( · 214 unmodified lines
848842 */
849843 void __init kvm_spinlock_init(void)
850844 {
851− if (!kvm_para_available())
852− return;
853845 /* Does host kernel support KVM_FEATURE_PV_UNHALT? */
854846 if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT))
855847 return;
arch/x86/kernel/ptrace.c+1−0
@@ -201,6 +201,7 @@ static int set_segment_reg(struct task_struct *task, · 200 unmodified lines
201201 case offsetof(struct user_regs_struct, ss):
202202 if (unlikely(value == 0))
203203 return -EIO;
204+ /* Else, fall through */
204205
205206 default:
206207 *pt_regs_access(task_pt_regs(task), offset) = value;
arch/x86/kvm/debugfs.c+13−33
@@ -8,11 +8,6 @@ · 7 unmodified lines
88 #include <linux/debugfs.h>
99 #include "lapic.h"
1010
11−bool kvm_arch_has_vcpu_debugfs(void)
12−{
13− return true;
14−}
15−
1611 static int vcpu_get_timer_advance_ns(void *data, u64 *val)
1712 {
1813 struct kvm_vcpu *vcpu = (struct kvm_vcpu *) data;
@@ -48,37 +43,22 @@ static int vcpu_get_tsc_scaling_frac_bits(void *data, u64 *val) · 29 unmodified lines
4843
4944 DEFINE_SIMPLE_ATTRIBUTE(vcpu_tsc_scaling_frac_fops, vcpu_get_tsc_scaling_frac_bits, NULL, "%llu\n");
5045
51−int kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu)
46+void kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu)
5247 {
53− struct dentry *ret;
54−
55− ret = debugfs_create_file("tsc-offset", 0444,
56− vcpu->debugfs_dentry,
57− vcpu, &vcpu_tsc_offset_fops);
58− if (!ret)
59− return -ENOMEM;
48+ debugfs_create_file("tsc-offset", 0444, vcpu->debugfs_dentry, vcpu,
49+ &vcpu_tsc_offset_fops);
6050
61− if (lapic_in_kernel(vcpu)) {
62− ret = debugfs_create_file("lapic_timer_advance_ns", 0444,
63− vcpu->debugfs_dentry,
64− vcpu, &vcpu_timer_advance_ns_fops);
65− if (!ret)
66− return -ENOMEM;
67− }
51+ if (lapic_in_kernel(vcpu))
52+ debugfs_create_file("lapic_timer_advance_ns", 0444,
53+ vcpu->debugfs_dentry, vcpu,
54+ &vcpu_timer_advance_ns_fops);
6855
6956 if (kvm_has_tsc_control) {
70− ret = debugfs_create_file("tsc-scaling-ratio", 0444,
71− vcpu->debugfs_dentry,
72− vcpu, &vcpu_tsc_scaling_fops);
73− if (!ret)
74− return -ENOMEM;
75− ret = debugfs_create_file("tsc-scaling-ratio-frac-bits", 0444,
76− vcpu->debugfs_dentry,
77− vcpu, &vcpu_tsc_scaling_frac_fops);
78− if (!ret)
79− return -ENOMEM;
80−
57+ debugfs_create_file("tsc-scaling-ratio", 0444,
58+ vcpu->debugfs_dentry, vcpu,
59+ &vcpu_tsc_scaling_fops);
60+ debugfs_create_file("tsc-scaling-ratio-frac-bits", 0444,
61+ vcpu->debugfs_dentry, vcpu,
62+ &vcpu_tsc_scaling_frac_fops);
8163 }
82−
83− return 0;
8464 }
arch/x86/kvm/lapic.c+0−8
@@ -1548,7 +1548,6 @@ static void kvm_apic_inject_pending_timer_irqs(struct kvm_lapic *apic) · 1547 unmodified lines
15481548 static void apic_timer_expired(struct kvm_lapic *apic)
15491549 {
15501550 struct kvm_vcpu *vcpu = apic->vcpu;
1551− struct swait_queue_head *q = &vcpu->wq;
15521551 struct kvm_timer *ktimer = &apic->lapic_timer;
15531552
15541553 if (atomic_read(&apic->lapic_timer.pending))
@@ -1566,13 +1565,6 @@ static void apic_timer_expired(struct kvm_lapic *apic) · 11 unmodified lines
15661565
15671566 atomic_inc(&apic->lapic_timer.pending);
15681567 kvm_set_pending_timer(vcpu);
1569−
1570− /*
1571− * For x86, the atomic_inc() is serialized, thus
1572− * using swait_active() is safe.
1573− */
1574− if (swait_active(q))
1575− swake_up_one(q);
15761568 }
15771569
15781570 static void start_sw_tscdeadline(struct kvm_lapic *apic)
arch/x86/kvm/svm.c+6−0
@@ -5190,6 +5190,11 @@ static void svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec) · 5189 unmodified lines
51905190 kvm_vcpu_wake_up(vcpu);
51915191 }
51925192
5193+static bool svm_dy_apicv_has_pending_interrupt(struct kvm_vcpu *vcpu)
5194+{
5195+ return false;
5196+}
5197+
51935198 static void svm_ir_list_del(struct vcpu_svm *svm, struct amd_iommu_pi_data *pi)
51945199 {
51955200 unsigned long flags;
@@ -7314,6 +7319,7 @@ static struct kvm_x86_ops svm_x86_ops __ro_after_init = { · 2118 unmodified lines
73147319
73157320 .pmu_ops = &amd_pmu_ops,
73167321 .deliver_posted_interrupt = svm_deliver_avic_intr,
7322+ .dy_apicv_has_pending_interrupt = svm_dy_apicv_has_pending_interrupt,
73177323 .update_pi_irte = svm_update_pi_irte,
73187324 .setup_mce = svm_setup_mce,
73197325
arch/x86/kvm/vmx/vmx.c+6−0
@@ -6117,6 +6117,11 @@ static int vmx_sync_pir_to_irr(struct kvm_vcpu *vcpu) · 6116 unmodified lines
61176117 return max_irr;
61186118 }
61196119
6120+static bool vmx_dy_apicv_has_pending_interrupt(struct kvm_vcpu *vcpu)
6121+{
6122+ return pi_test_on(vcpu_to_pi_desc(vcpu));
6123+}
6124+
61206125 static void vmx_load_eoi_exitmap(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap)
61216126 {
61226127 if (!kvm_vcpu_apicv_active(vcpu))
@@ -7726,6 +7731,7 @@ static struct kvm_x86_ops vmx_x86_ops __ro_after_init = { · 1603 unmodified lines
77267731 .guest_apic_has_interrupt = vmx_guest_apic_has_interrupt,
77277732 .sync_pir_to_irr = vmx_sync_pir_to_irr,
77287733 .deliver_posted_interrupt = vmx_deliver_posted_interrupt,
7734+ .dy_apicv_has_pending_interrupt = vmx_dy_apicv_has_pending_interrupt,
77297735
77307736 .set_tss_addr = vmx_set_tss_addr,
77317737 .set_identity_map_addr = vmx_set_identity_map_addr,
arch/x86/kvm/x86.c+16−0
@@ -9698,6 +9698,22 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) · 9697 unmodified lines
96989698 return kvm_vcpu_running(vcpu) || kvm_vcpu_has_events(vcpu);
96999699 }
97009700
9701+bool kvm_arch_dy_runnable(struct kvm_vcpu *vcpu)
9702+{
9703+ if (READ_ONCE(vcpu->arch.pv.pv_unhalted))
9704+ return true;
9705+
9706+ if (kvm_test_request(KVM_REQ_NMI, vcpu) ||
9707+ kvm_test_request(KVM_REQ_SMI, vcpu) ||
9708+ kvm_test_request(KVM_REQ_EVENT, vcpu))
9709+ return true;
9710+
9711+ if (vcpu->arch.apicv_active && kvm_x86_ops->dy_apicv_has_pending_interrupt(vcpu))
9712+ return true;
9713+
9714+ return false;
9715+}
9716+
97019717 bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu)
97029718 {
97039719 return vcpu->arch.preempted_in_kernel;
arch/x86/lib/cpu.c+1−0
@@ -1,6 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0-only
22 #include <linux/types.h>
33 #include <linux/export.h>
4+#include <asm/cpu.h>
45
56 unsigned int x86_family(unsigned int sig)
67 {
arch/x86/purgatory/Makefile+31−5
@@ -6,6 +6,9 @@ purgatory-y := purgatory.o stack.o setup-x86_$(BITS).o sha256.o entry64.o string · 5 unmodified lines
66 targets += $(purgatory-y)
77 PURGATORY_OBJS = $(addprefix $(obj)/,$(purgatory-y))
88
9+$(obj)/string.o: $(srctree)/arch/x86/boot/compressed/string.c FORCE
10+ $(call if_changed_rule,cc_o_c)
11+
912 $(obj)/sha256.o: $(srctree)/lib/sha256.c FORCE
1013 $(call if_changed_rule,cc_o_c)
1114
@@ -17,11 +20,34 @@ KCOV_INSTRUMENT := n · 5 unmodified lines
1720
1821 # Default KBUILD_CFLAGS can have -pg option set when FTRACE is enabled. That
1922 # in turn leaves some undefined symbols like __fentry__ in purgatory and not
20−# sure how to relocate those. Like kexec-tools, use custom flags.
21−
22−KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes -fno-zero-initialized-in-bss -fno-builtin -ffreestanding -c -Os -mcmodel=large
23−KBUILD_CFLAGS += -m$(BITS)
24−KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
23+# sure how to relocate those.
24+ifdef CONFIG_FUNCTION_TRACER
25+CFLAGS_REMOVE_sha256.o += $(CC_FLAGS_FTRACE)
26+CFLAGS_REMOVE_purgatory.o += $(CC_FLAGS_FTRACE)
27+CFLAGS_REMOVE_string.o += $(CC_FLAGS_FTRACE)
28+CFLAGS_REMOVE_kexec-purgatory.o += $(CC_FLAGS_FTRACE)
29+endif
30+
31+ifdef CONFIG_STACKPROTECTOR
32+CFLAGS_REMOVE_sha256.o += -fstack-protector
33+CFLAGS_REMOVE_purgatory.o += -fstack-protector
34+CFLAGS_REMOVE_string.o += -fstack-protector
35+CFLAGS_REMOVE_kexec-purgatory.o += -fstack-protector
36+endif
37+
38+ifdef CONFIG_STACKPROTECTOR_STRONG
39+CFLAGS_REMOVE_sha256.o += -fstack-protector-strong
40+CFLAGS_REMOVE_purgatory.o += -fstack-protector-strong
41+CFLAGS_REMOVE_string.o += -fstack-protector-strong
42+CFLAGS_REMOVE_kexec-purgatory.o += -fstack-protector-strong
43+endif
44+
45+ifdef CONFIG_RETPOLINE
46+CFLAGS_REMOVE_sha256.o += $(RETPOLINE_CFLAGS)
47+CFLAGS_REMOVE_purgatory.o += $(RETPOLINE_CFLAGS)
48+CFLAGS_REMOVE_string.o += $(RETPOLINE_CFLAGS)
49+CFLAGS_REMOVE_kexec-purgatory.o += $(RETPOLINE_CFLAGS)
50+endif
2551
2652 $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE
2753 $(call if_changed,ld)
arch/x86/purgatory/purgatory.c+6−0
@@ -68,3 +68,9 @@ void purgatory(void) · 67 unmodified lines
6868 }
6969 copy_backup_region();
7070 }
71+
72+/*
73+ * Defined in order to reuse memcpy() and memset() from
74+ * arch/x86/boot/compressed/string.c
75+ */
76+void warn(const char *msg) {}
arch/x86/purgatory/string.c+0−23
@@ -1,23 +0,0 @@
1−// SPDX-License-Identifier: GPL-2.0-only
2−/*
3− * Simple string functions.
4− *
5− * Copyright (C) 2014 Red Hat Inc.
6− *
7− * Author:
8− * Vivek Goyal <vgoyal@redhat.com>
9− */
10−
11−#include <linux/types.h>
12−
13−#include "../boot/string.c"
14−
15−void *memcpy(void *dst, const void *src, size_t len)
16−{
17− return __builtin_memcpy(dst, src, len);
18−}
19−
20−void *memset(void *dst, int c, size_t len)
21−{
22− return __builtin_memset(dst, c, len);
23−}
arch/xtensa/kernel/coprocessor.S+1−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414
1515 #include <linux/linkage.h>
1616 #include <asm/asm-offsets.h>
17+#include <asm/asmmacro.h>
1718 #include <asm/processor.h>
1819 #include <asm/coprocessor.h>
1920 #include <asm/thread_info.h>
block/bfq-iosched.c+47−21
@@ -1924,12 +1924,13 @@ static void bfq_add_request(struct request *rq) · 1923 unmodified lines
19241924 * confirmed no later than during the next
19251925 * I/O-plugging interval for bfqq.
19261926 */
1927− if (!bfq_bfqq_has_short_ttime(bfqq) &&
1927+ if (bfqd->last_completed_rq_bfqq &&
1928+ !bfq_bfqq_has_short_ttime(bfqq) &&
19281929 ktime_get_ns() - bfqd->last_completion <
19291930 200 * NSEC_PER_USEC) {
19301931 if (bfqd->last_completed_rq_bfqq != bfqq &&
1931− bfqd->last_completed_rq_bfqq !=
1932− bfqq->waker_bfqq) {
1932+ bfqd->last_completed_rq_bfqq !=
1933+ bfqq->waker_bfqq) {
19331934 /*
19341935 * First synchronization detected with
19351936 * a candidate waker queue, or with a
@@ -2250,9 +2251,14 @@ static void bfq_request_merged(struct request_queue *q, struct request *req, · 314 unmodified lines
22502251 blk_rq_pos(container_of(rb_prev(&req->rb_node),
22512252 struct request, rb_node))) {
22522253 struct bfq_queue *bfqq = bfq_init_rq(req);
2253− struct bfq_data *bfqd = bfqq->bfqd;
2254+ struct bfq_data *bfqd;
22542255 struct request *prev, *next_rq;
22552256
2257+ if (!bfqq)
2258+ return;
2259+
2260+ bfqd = bfqq->bfqd;
2261+
22562262 /* Reposition request in its sort_list */
22572263 elv_rb_del(&bfqq->sort_list, req);
22582264 elv_rb_add(&bfqq->sort_list, req);
@@ -2299,6 +2305,9 @@ static void bfq_requests_merged(struct request_queue *q, struct request *rq, · 40 unmodified lines
22992305 struct bfq_queue *bfqq = bfq_init_rq(rq),
23002306 *next_bfqq = bfq_init_rq(next);
23012307
2308+ if (!bfqq)
2309+ return;
2310+
23022311 /*
23032312 * If next and rq belong to the same bfq_queue and next is older
23042313 * than rq, then reposition rq in the fifo (by substituting next
@@ -4764,6 +4773,8 @@ static struct request *bfq_dispatch_request(struct blk_mq_hw_ctx *hctx) · 2459 unmodified lines
47644773 */
47654774 void bfq_put_queue(struct bfq_queue *bfqq)
47664775 {
4776+ struct bfq_queue *item;
4777+ struct hlist_node *n;
47674778 #ifdef CONFIG_BFQ_GROUP_IOSCHED
47684779 struct bfq_group *bfqg = bfqq_group(bfqq);
47694780 #endif
@@ -4808,6 +4819,36 @@ void bfq_put_queue(struct bfq_queue *bfqq) · 38 unmodified lines
48084819 bfqq->bfqd->burst_size--;
48094820 }
48104821
4822+ /*
4823+ * bfqq does not exist any longer, so it cannot be woken by
4824+ * any other queue, and cannot wake any other queue. Then bfqq
4825+ * must be removed from the woken list of its possible waker
4826+ * queue, and all queues in the woken list of bfqq must stop
4827+ * having a waker queue. Strictly speaking, these updates
4828+ * should be performed when bfqq remains with no I/O source
4829+ * attached to it, which happens before bfqq gets freed. In
4830+ * particular, this happens when the last process associated
4831+ * with bfqq exits or gets associated with a different
4832+ * queue. However, both events lead to bfqq being freed soon,
4833+ * and dangling references would come out only after bfqq gets
4834+ * freed. So these updates are done here, as a simple and safe
4835+ * way to handle all cases.
4836+ */
4837+ /* remove bfqq from woken list */
4838+ if (!hlist_unhashed(&bfqq->woken_list_node))
4839+ hlist_del_init(&bfqq->woken_list_node);
4840+
4841+ /* reset waker for all queues in woken list */
4842+ hlist_for_each_entry_safe(item, n, &bfqq->woken_list,
4843+ woken_list_node) {
4844+ item->waker_bfqq = NULL;
4845+ bfq_clear_bfqq_has_waker(item);
4846+ hlist_del_init(&item->woken_list_node);
4847+ }
4848+
4849+ if (bfqq->bfqd && bfqq->bfqd->last_completed_rq_bfqq == bfqq)
4850+ bfqq->bfqd->last_completed_rq_bfqq = NULL;
4851+
48114852 kmem_cache_free(bfq_pool, bfqq);
48124853 #ifdef CONFIG_BFQ_GROUP_IOSCHED
48134854 bfqg_and_blkg_put(bfqg);
@@ -4835,9 +4876,6 @@ static void bfq_put_cooperator(struct bfq_queue *bfqq) · 21 unmodified lines
48354876
48364877 static void bfq_exit_bfqq(struct bfq_data *bfqd, struct bfq_queue *bfqq)
48374878 {
4838− struct bfq_queue *item;
4839− struct hlist_node *n;
4840−
48414879 if (bfqq == bfqd->in_service_queue) {
48424880 __bfq_bfqq_expire(bfqd, bfqq, BFQQE_BUDGET_TIMEOUT);
48434881 bfq_schedule_dispatch(bfqd);
@@ -4847,18 +4885,6 @@ static void bfq_exit_bfqq(struct bfq_data *bfqd, struct bfq_queue *bfqq) · 3 unmodified lines
48474885
48484886 bfq_put_cooperator(bfqq);
48494887
4850− /* remove bfqq from woken list */
4851− if (!hlist_unhashed(&bfqq->woken_list_node))
4852− hlist_del_init(&bfqq->woken_list_node);
4853−
4854− /* reset waker for all queues in woken list */
4855− hlist_for_each_entry_safe(item, n, &bfqq->woken_list,
4856− woken_list_node) {
4857− item->waker_bfqq = NULL;
4858− bfq_clear_bfqq_has_waker(item);
4859− hlist_del_init(&item->woken_list_node);
4860− }
4861−
48624888 bfq_put_queue(bfqq); /* release process reference */
48634889 }
48644890
@@ -5436,12 +5462,12 @@ static void bfq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq, · 571 unmodified lines
54365462
54375463 spin_lock_irq(&bfqd->lock);
54385464 bfqq = bfq_init_rq(rq);
5439− if (at_head || blk_rq_is_passthrough(rq)) {
5465+ if (!bfqq || at_head || blk_rq_is_passthrough(rq)) {
54405466 if (at_head)
54415467 list_add(&rq->queuelist, &bfqd->dispatch);
54425468 else
54435469 list_add_tail(&rq->queuelist, &bfqd->dispatch);
5444− } else { /* bfqq is assumed to be non null here */
5470+ } else {
54455471 idle_timer_disabled = __bfq_insert_request(bfqd, rq);
54465472 /*
54475473 * Update bfqq, because, if a queue merge has occurred
drivers/acpi/device_pm.c+3−1
@@ -232,13 +232,15 @@ int acpi_device_set_power(struct acpi_device *device, int state) · 231 unmodified lines
232232 if (device->power.flags.power_resources)
233233 result = acpi_power_transition(device, target_state);
234234 } else {
235+ int cur_state = device->power.state;
236+
235237 if (device->power.flags.power_resources) {
236238 result = acpi_power_transition(device, ACPI_STATE_D0);
237239 if (result)
238240 goto end;
239241 }
240242
241− if (device->power.state == ACPI_STATE_D0) {
243+ if (cur_state == ACPI_STATE_D0) {
242244 int psc;
243245
244246 /* Nothing to do here if _PSC is not present. */
drivers/acpi/scan.c+6−0
@@ -2204,6 +2204,12 @@ int __init acpi_scan_init(void) · 2203 unmodified lines
22042204 acpi_gpe_apply_masked_gpes();
22052205 acpi_update_all_gpes();
22062206
2207+ /*
2208+ * Although we call __add_memory() that is documented to require the
2209+ * device_hotplug_lock, it is not necessary here because this is an
2210+ * early code when userspace or any other code path cannot trigger
2211+ * hotplug/hotunplug operations.
2212+ */
22072213 mutex_lock(&acpi_scan_lock);
22082214 /*
22092215 * Enumerate devices in the ACPI namespace.
drivers/ata/libahci_platform.c+3−0
@@ -338,6 +338,9 @@ static int ahci_platform_get_phy(struct ahci_host_priv *hpriv, u32 port, · 337 unmodified lines
338338 hpriv->phys[port] = NULL;
339339 rc = 0;
340340 break;
341+ case -EPROBE_DEFER:
342+ /* Do not complain yet */
343+ break;
341344
342345 default:
343346 dev_err(dev,
drivers/ata/libata-scsi.c+21−0
@@ -1786,6 +1786,21 @@ nothing_to_do: · 1785 unmodified lines
17861786 return 1;
17871787 }
17881788
1789+static bool ata_check_nblocks(struct scsi_cmnd *scmd, u32 n_blocks)
1790+{
1791+ struct request *rq = scmd->request;
1792+ u32 req_blocks;
1793+
1794+ if (!blk_rq_is_passthrough(rq))
1795+ return true;
1796+
1797+ req_blocks = blk_rq_bytes(rq) / scmd->device->sector_size;
1798+ if (n_blocks > req_blocks)
1799+ return false;
1800+
1801+ return true;
1802+}
1803+
17891804 /**
17901805 * ata_scsi_rw_xlat - Translate SCSI r/w command into an ATA one
17911806 * @qc: Storage for translated ATA taskfile
@@ -1830,6 +1845,8 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc) · 38 unmodified lines
18301845 scsi_10_lba_len(cdb, &block, &n_block);
18311846 if (cdb[1] & (1 << 3))
18321847 tf_flags |= ATA_TFLAG_FUA;
1848+ if (!ata_check_nblocks(scmd, n_block))
1849+ goto invalid_fld;
18331850 break;
18341851 case READ_6:
18351852 case WRITE_6:
@@ -1844,6 +1861,8 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc) · 8 unmodified lines
18441861 */
18451862 if (!n_block)
18461863 n_block = 256;
1864+ if (!ata_check_nblocks(scmd, n_block))
1865+ goto invalid_fld;
18471866 break;
18481867 case READ_16:
18491868 case WRITE_16:
@@ -1854,6 +1873,8 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc) · 4 unmodified lines
18541873 scsi_16_lba_len(cdb, &block, &n_block);
18551874 if (cdb[1] & (1 << 3))
18561875 tf_flags |= ATA_TFLAG_FUA;
1876+ if (!ata_check_nblocks(scmd, n_block))
1877+ goto invalid_fld;
18571878 break;
18581879 default:
18591880 DPRINTK("no-byte command\n");
drivers/ata/libata-sff.c+6−0
@@ -658,6 +658,10 @@ static void ata_pio_sector(struct ata_queued_cmd *qc) · 657 unmodified lines
658658 unsigned int offset;
659659 unsigned char *buf;
660660
661+ if (!qc->cursg) {
662+ qc->curbytes = qc->nbytes;
663+ return;
664+ }
661665 if (qc->curbytes == qc->nbytes - qc->sect_size)
662666 ap->hsm_task_state = HSM_ST_LAST;
663667
@@ -683,6 +687,8 @@ static void ata_pio_sector(struct ata_queued_cmd *qc) · 19 unmodified lines
683687
684688 if (qc->cursg_ofs == qc->cursg->length) {
685689 qc->cursg = sg_next(qc->cursg);
690+ if (!qc->cursg)
691+ ap->hsm_task_state = HSM_ST_LAST;
686692 qc->cursg_ofs = 0;
687693 }
688694 }
drivers/ata/libata-zpodd.c+1−1
@@ -56,7 +56,7 @@ static enum odd_mech_type zpodd_get_mech_type(struct ata_device *dev) · 55 unmodified lines
5656 unsigned int ret;
5757 struct rm_feature_desc *desc;
5858 struct ata_taskfile tf;
59− static const char cdb[] = { GPCMD_GET_CONFIGURATION,
59+ static const char cdb[ATAPI_CDB_LEN] = { GPCMD_GET_CONFIGURATION,
6060 2, /* only 1 feature descriptor requested */
6161 0, 3, /* 3, removable medium feature */
6262 0, 0, 0,/* reserved */
drivers/ata/pata_rb532_cf.c+0−1
@@ -158,7 +158,6 @@ static int rb532_pata_driver_probe(struct platform_device *pdev) · 157 unmodified lines
158158 static int rb532_pata_driver_remove(struct platform_device *pdev)
159159 {
160160 struct ata_host *ah = platform_get_drvdata(pdev);
161− struct rb532_cf_info *info = ah->private_data;
162161
163162 ata_host_detach(ah);
164163
drivers/atm/iphase.c+6−2
@@ -63,6 +63,7 @@ · 62 unmodified lines
6363 #include <asm/byteorder.h>
6464 #include <linux/vmalloc.h>
6565 #include <linux/jiffies.h>
66+#include <linux/nospec.h>
6667 #include "iphase.h"
6768 #include "suni.h"
6869 #define swap_byte_order(x) (((x & 0xff) << 8) | ((x & 0xff00) >> 8))
@@ -2760,8 +2761,11 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg) · 2691 unmodified lines
27602761 }
27612762 if (copy_from_user(&ia_cmds, arg, sizeof ia_cmds)) return -EFAULT;
27622763 board = ia_cmds.status;
2763− if ((board < 0) || (board > iadev_count))
2764− board = 0;
2764+
2765+ if ((board < 0) || (board > iadev_count))
2766+ board = 0;
2767+ board = array_index_nospec(board, iadev_count + 1);
2768+
27652769 iadev = ia_dev[board];
27662770 switch (ia_cmds.cmd) {
27672771 case MEMDUMP:
drivers/base/core.c+52−1
@@ -1823,12 +1823,63 @@ static inline struct kobject *get_glue_dir(struct device *dev) · 1822 unmodified lines
18231823 */
18241824 static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir)
18251825 {
1826+ unsigned int ref;
1827+
18261828 /* see if we live in a "glue" directory */
18271829 if (!live_in_glue_dir(glue_dir, dev))
18281830 return;
18291831
18301832 mutex_lock(&gdp_mutex);
1831− if (!kobject_has_children(glue_dir))
1833+ /**
1834+ * There is a race condition between removing glue directory
1835+ * and adding a new device under the glue directory.
1836+ *
1837+ * CPU1: CPU2:
1838+ *
1839+ * device_add()
1840+ * get_device_parent()
1841+ * class_dir_create_and_add()
1842+ * kobject_add_internal()
1843+ * create_dir() // create glue_dir
1844+ *
1845+ * device_add()
1846+ * get_device_parent()
1847+ * kobject_get() // get glue_dir
1848+ *
1849+ * device_del()
1850+ * cleanup_glue_dir()
1851+ * kobject_del(glue_dir)
1852+ *
1853+ * kobject_add()
1854+ * kobject_add_internal()
1855+ * create_dir() // in glue_dir
1856+ * sysfs_create_dir_ns()
1857+ * kernfs_create_dir_ns(sd)
1858+ *
1859+ * sysfs_remove_dir() // glue_dir->sd=NULL
1860+ * sysfs_put() // free glue_dir->sd
1861+ *
1862+ * // sd is freed
1863+ * kernfs_new_node(sd)
1864+ * kernfs_get(glue_dir)
1865+ * kernfs_add_one()
1866+ * kernfs_put()
1867+ *
1868+ * Before CPU1 remove last child device under glue dir, if CPU2 add
1869+ * a new device under glue dir, the glue_dir kobject reference count
1870+ * will be increase to 2 in kobject_get(k). And CPU2 has been called
1871+ * kernfs_create_dir_ns(). Meanwhile, CPU1 call sysfs_remove_dir()
1872+ * and sysfs_put(). This result in glue_dir->sd is freed.
1873+ *
1874+ * Then the CPU2 will see a stale "empty" but still potentially used
1875+ * glue dir around in kernfs_new_node().
1876+ *
1877+ * In order to avoid this happening, we also should make sure that
1878+ * kernfs_node for glue_dir is released in CPU1 only when refcount
1879+ * for glue_dir kobj is 1.
1880+ */
1881+ ref = kref_read(&glue_dir->kref);
1882+ if (!kobject_has_children(glue_dir) && !--ref)
18321883 kobject_del(glue_dir);
18331884 kobject_put(glue_dir);
18341885 mutex_unlock(&gdp_mutex);
drivers/base/platform.c+7−2
@@ -157,8 +157,13 @@ int platform_get_irq(struct platform_device *dev, unsigned int num) · 156 unmodified lines
157157 * the device will only expose one IRQ, and this fallback
158158 * allows a common code path across either kind of resource.
159159 */
160− if (num == 0 && has_acpi_companion(&dev->dev))
161− return acpi_dev_gpio_irq_get(ACPI_COMPANION(&dev->dev), num);
160+ if (num == 0 && has_acpi_companion(&dev->dev)) {
161+ int ret = acpi_dev_gpio_irq_get(ACPI_COMPANION(&dev->dev), num);
162+
163+ /* Our callers expect -ENXIO for missing IRQs. */
164+ if (ret >= 0 || ret == -EPROBE_DEFER)
165+ return ret;
166+ }
162167
163168 return -ENXIO;
164169 #endif
drivers/block/aoe/aoedev.c+10−3
@@ -323,10 +323,14 @@ flush(const char __user *str, size_t cnt, int exiting) · 322 unmodified lines
323323 }
324324
325325 flush_scheduled_work();
326− /* pass one: without sleeping, do aoedev_downdev */
326+ /* pass one: do aoedev_downdev, which might sleep */
327+restart1:
327328 spin_lock_irqsave(&devlist_lock, flags);
328329 for (d = devlist; d; d = d->next) {
329330 spin_lock(&d->lock);
331+ if (d->flags & DEVFL_TKILL)
332+ goto cont;
333+
330334 if (exiting) {
331335 /* unconditionally take each device down */
332336 } else if (specified) {
@@ -338,8 +342,11 @@ flush(const char __user *str, size_t cnt, int exiting) · 5 unmodified lines
338342 || d->ref)
339343 goto cont;
340344
345+ spin_unlock(&d->lock);
346+ spin_unlock_irqrestore(&devlist_lock, flags);
341347 aoedev_downdev(d);
342348 d->flags |= DEVFL_TKILL;
349+ goto restart1;
343350 cont:
344351 spin_unlock(&d->lock);
345352 }
@@ -348,7 +355,7 @@ cont: · 2 unmodified lines
348355 /* pass two: call freedev, which might sleep,
349356 * for aoedevs marked with DEVFL_TKILL
350357 */
351−restart:
358+restart2:
352359 spin_lock_irqsave(&devlist_lock, flags);
353360 for (d = devlist; d; d = d->next) {
354361 spin_lock(&d->lock);
@@ -357,7 +364,7 @@ restart: · 2 unmodified lines
357364 spin_unlock(&d->lock);
358365 spin_unlock_irqrestore(&devlist_lock, flags);
359366 freedev(d);
360− goto restart;
367+ goto restart2;
361368 }
362369 spin_unlock(&d->lock);
363370 }
drivers/block/ataflop.c+1−0
@@ -1726,6 +1726,7 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, · 1725 unmodified lines
17261726 /* MSch: invalidate default_params */
17271727 default_params[drive].blocks = 0;
17281728 set_capacity(floppy->disk, MAX_DISK_SIZE * 2);
1729+ /* Fall through */
17291730 case FDFMTEND:
17301731 case FDFLUSH:
17311732 /* invalidate the buffer track to force a reread */
drivers/block/loop.c+10−8
@@ -885,7 +885,7 @@ static void loop_unprepare_queue(struct loop_device *lo) · 884 unmodified lines
885885
886886 static int loop_kthread_worker_fn(void *worker_ptr)
887887 {
888− current->flags |= PF_LESS_THROTTLE;
888+ current->flags |= PF_LESS_THROTTLE | PF_MEMALLOC_NOIO;
889889 return kthread_worker_fn(worker_ptr);
890890 }
891891
@@ -924,6 +924,7 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode, · 32 unmodified lines
924924 struct file *file;
925925 struct inode *inode;
926926 struct address_space *mapping;
927+ struct block_device *claimed_bdev = NULL;
927928 int lo_flags = 0;
928929 int error;
929930 loff_t size;
@@ -942,10 +943,11 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode, · 12 unmodified lines
942943 * here to avoid changing device under exclusive owner.
943944 */
944945 if (!(mode & FMODE_EXCL)) {
945− bdgrab(bdev);
946− error = blkdev_get(bdev, mode | FMODE_EXCL, loop_set_fd);
947− if (error)
946+ claimed_bdev = bd_start_claiming(bdev, loop_set_fd);
947+ if (IS_ERR(claimed_bdev)) {
948+ error = PTR_ERR(claimed_bdev);
948949 goto out_putf;
950+ }
949951 }
950952
951953 error = mutex_lock_killable(&loop_ctl_mutex);
@@ -1015,15 +1017,15 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode, · 63 unmodified lines
10151017 mutex_unlock(&loop_ctl_mutex);
10161018 if (partscan)
10171019 loop_reread_partitions(lo, bdev);
1018− if (!(mode & FMODE_EXCL))
1019− blkdev_put(bdev, mode | FMODE_EXCL);
1020+ if (claimed_bdev)
1021+ bd_abort_claiming(bdev, claimed_bdev, loop_set_fd);
10201022 return 0;
10211023
10221024 out_unlock:
10231025 mutex_unlock(&loop_ctl_mutex);
10241026 out_bdev:
1025− if (!(mode & FMODE_EXCL))
1026− blkdev_put(bdev, mode | FMODE_EXCL);
1027+ if (claimed_bdev)
1028+ bd_abort_claiming(bdev, claimed_bdev, loop_set_fd);
10271029 out_putf:
10281030 fput(file);
10291031 out:
drivers/block/nbd.c+1−1
@@ -1231,7 +1231,7 @@ static void nbd_clear_sock_ioctl(struct nbd_device *nbd, · 1230 unmodified lines
12311231 struct block_device *bdev)
12321232 {
12331233 sock_shutdown(nbd);
1234− kill_bdev(bdev);
1234+ __invalidate_device(bdev, true);
12351235 nbd_bdev_reset(bdev);
12361236 if (test_and_clear_bit(NBD_HAS_CONFIG_REF,
12371237 &nbd->config->runtime_flags))
drivers/bluetooth/hci_ath.c+3−0
@@ -98,6 +98,9 @@ static int ath_open(struct hci_uart *hu) · 97 unmodified lines
9898
9999 BT_DBG("hu %p", hu);
100100
101+ if (!hci_uart_has_flow_control(hu))
102+ return -EOPNOTSUPP;
103+
101104 ath = kzalloc(sizeof(*ath), GFP_KERNEL);
102105 if (!ath)
103106 return -ENOMEM;
drivers/bluetooth/hci_bcm.c+3−0
@@ -406,6 +406,9 @@ static int bcm_open(struct hci_uart *hu) · 405 unmodified lines
406406
407407 bt_dev_dbg(hu->hdev, "hu %p", hu);
408408
409+ if (!hci_uart_has_flow_control(hu))
410+ return -EOPNOTSUPP;
411+
409412 bcm = kzalloc(sizeof(*bcm), GFP_KERNEL);
410413 if (!bcm)
411414 return -ENOMEM;
drivers/bluetooth/hci_intel.c+3−0
@@ -391,6 +391,9 @@ static int intel_open(struct hci_uart *hu) · 390 unmodified lines
391391
392392 BT_DBG("hu %p", hu);
393393
394+ if (!hci_uart_has_flow_control(hu))
395+ return -EOPNOTSUPP;
396+
394397 intel = kzalloc(sizeof(*intel), GFP_KERNEL);
395398 if (!intel)
396399 return -ENOMEM;
drivers/bluetooth/hci_ldisc.c+13−0
@@ -292,6 +292,19 @@ static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb) · 291 unmodified lines
292292 return 0;
293293 }
294294
295+/* Check the underlying device or tty has flow control support */
296+bool hci_uart_has_flow_control(struct hci_uart *hu)
297+{
298+ /* serdev nodes check if the needed operations are present */
299+ if (hu->serdev)
300+ return true;
301+
302+ if (hu->tty->driver->ops->tiocmget && hu->tty->driver->ops->tiocmset)
303+ return true;
304+
305+ return false;
306+}
307+
295308 /* Flow control or un-flow control the device */
296309 void hci_uart_set_flow_control(struct hci_uart *hu, bool enable)
297310 {
drivers/bluetooth/hci_mrvl.c+3−0
@@ -59,6 +59,9 @@ static int mrvl_open(struct hci_uart *hu) · 58 unmodified lines
5959
6060 BT_DBG("hu %p", hu);
6161
62+ if (!hci_uart_has_flow_control(hu))
63+ return -EOPNOTSUPP;
64+
6265 mrvl = kzalloc(sizeof(*mrvl), GFP_KERNEL);
6366 if (!mrvl)
6467 return -ENOMEM;
drivers/bluetooth/hci_qca.c+3−0
@@ -473,6 +473,9 @@ static int qca_open(struct hci_uart *hu) · 472 unmodified lines
473473
474474 BT_DBG("hu %p qca_open", hu);
475475
476+ if (!hci_uart_has_flow_control(hu))
477+ return -EOPNOTSUPP;
478+
476479 qca = kzalloc(sizeof(struct qca_data), GFP_KERNEL);
477480 if (!qca)
478481 return -ENOMEM;
drivers/bluetooth/hci_uart.h+1−0
@@ -104,6 +104,7 @@ int hci_uart_wait_until_sent(struct hci_uart *hu); · 103 unmodified lines
104104 int hci_uart_init_ready(struct hci_uart *hu);
105105 void hci_uart_init_work(struct work_struct *work);
106106 void hci_uart_set_baudrate(struct hci_uart *hu, unsigned int speed);
107+bool hci_uart_has_flow_control(struct hci_uart *hu);
107108 void hci_uart_set_flow_control(struct hci_uart *hu, bool enable);
108109 void hci_uart_set_speeds(struct hci_uart *hu, unsigned int init_speed,
109110 unsigned int oper_speed);
drivers/char/ipmi/ipmb_dev_int.c+1−1
@@ -76,7 +76,7 @@ static ssize_t ipmb_read(struct file *file, char __user *buf, size_t count, · 75 unmodified lines
7676 struct ipmb_dev *ipmb_dev = to_ipmb_dev(file);
7777 struct ipmb_request_elem *queue_elem;
7878 struct ipmb_msg msg;
79− ssize_t ret;
79+ ssize_t ret = 0;
8080
8181 memset(&msg, 0, sizeof(msg));
8282
drivers/char/tpm/tpm-chip.c+36−7
@@ -77,6 +77,18 @@ static int tpm_go_idle(struct tpm_chip *chip) · 76 unmodified lines
7777 return chip->ops->go_idle(chip);
7878 }
7979
80+static void tpm_clk_enable(struct tpm_chip *chip)
81+{
82+ if (chip->ops->clk_enable)
83+ chip->ops->clk_enable(chip, true);
84+}
85+
86+static void tpm_clk_disable(struct tpm_chip *chip)
87+{
88+ if (chip->ops->clk_enable)
89+ chip->ops->clk_enable(chip, false);
90+}
91+
8092 /**
8193 * tpm_chip_start() - power on the TPM
8294 * @chip: a TPM chip to use
@@ -89,13 +101,12 @@ int tpm_chip_start(struct tpm_chip *chip) · 6 unmodified lines
89101 {
90102 int ret;
91103
92− if (chip->ops->clk_enable)
93− chip->ops->clk_enable(chip, true);
104+ tpm_clk_enable(chip);
94105
95106 if (chip->locality == -1) {
96107 ret = tpm_request_locality(chip);
97108 if (ret) {
98− chip->ops->clk_enable(chip, false);
109+ tpm_clk_disable(chip);
99110 return ret;
100111 }
101112 }
@@ -103,8 +114,7 @@ int tpm_chip_start(struct tpm_chip *chip) · 1 unmodified line
103114 ret = tpm_cmd_ready(chip);
104115 if (ret) {
105116 tpm_relinquish_locality(chip);
106− if (chip->ops->clk_enable)
107− chip->ops->clk_enable(chip, false);
117+ tpm_clk_disable(chip);
108118 return ret;
109119 }
110120
@@ -124,8 +134,7 @@ void tpm_chip_stop(struct tpm_chip *chip) · 13 unmodified lines
124134 {
125135 tpm_go_idle(chip);
126136 tpm_relinquish_locality(chip);
127− if (chip->ops->clk_enable)
128− chip->ops->clk_enable(chip, false);
137+ tpm_clk_disable(chip);
129138 }
130139 EXPORT_SYMBOL_GPL(tpm_chip_stop);
131140
@@ -545,6 +554,20 @@ static int tpm_add_hwrng(struct tpm_chip *chip) · 413 unmodified lines
545554 return hwrng_register(&chip->hwrng);
546555 }
547556
557+static int tpm_get_pcr_allocation(struct tpm_chip *chip)
558+{
559+ int rc;
560+
561+ rc = (chip->flags & TPM_CHIP_FLAG_TPM2) ?
562+ tpm2_get_pcr_allocation(chip) :
563+ tpm1_get_pcr_allocation(chip);
564+
565+ if (rc > 0)
566+ return -ENODEV;
567+
568+ return rc;
569+}
570+
548571 /*
549572 * tpm_chip_register() - create a character device for the TPM chip
550573 * @chip: TPM chip to use.
@@ -564,6 +587,12 @@ int tpm_chip_register(struct tpm_chip *chip) · 13 unmodified lines
564587 if (rc)
565588 return rc;
566589 rc = tpm_auto_startup(chip);
590+ if (rc) {
591+ tpm_chip_stop(chip);
592+ return rc;
593+ }
594+
595+ rc = tpm_get_pcr_allocation(chip);
567596 tpm_chip_stop(chip);
568597 if (rc)
569598 return rc;
drivers/char/tpm/tpm.h+2−0
@@ -394,6 +394,7 @@ int tpm1_pcr_read(struct tpm_chip *chip, u32 pcr_idx, u8 *res_buf); · 393 unmodified lines
394394 ssize_t tpm1_getcap(struct tpm_chip *chip, u32 subcap_id, cap_t *cap,
395395 const char *desc, size_t min_cap_length);
396396 int tpm1_get_random(struct tpm_chip *chip, u8 *out, size_t max);
397+int tpm1_get_pcr_allocation(struct tpm_chip *chip);
397398 unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip, u32 ordinal);
398399 int tpm_pm_suspend(struct device *dev);
399400 int tpm_pm_resume(struct device *dev);
@@ -449,6 +450,7 @@ int tpm2_unseal_trusted(struct tpm_chip *chip, · 49 unmodified lines
449450 ssize_t tpm2_get_tpm_pt(struct tpm_chip *chip, u32 property_id,
450451 u32 *value, const char *desc);
451452
453+ssize_t tpm2_get_pcr_allocation(struct tpm_chip *chip);
452454 int tpm2_auto_startup(struct tpm_chip *chip);
453455 void tpm2_shutdown(struct tpm_chip *chip, u16 shutdown_type);
454456 unsigned long tpm2_calc_ordinal_duration(struct tpm_chip *chip, u32 ordinal);
drivers/char/tpm/tpm1-cmd.c+24−12
@@ -699,18 +699,6 @@ int tpm1_auto_startup(struct tpm_chip *chip) · 698 unmodified lines
699699 goto out;
700700 }
701701
702− chip->allocated_banks = kcalloc(1, sizeof(*chip->allocated_banks),
703− GFP_KERNEL);
704− if (!chip->allocated_banks) {
705− rc = -ENOMEM;
706− goto out;
707− }
708−
709− chip->allocated_banks[0].alg_id = TPM_ALG_SHA1;
710− chip->allocated_banks[0].digest_size = hash_digest_size[HASH_ALGO_SHA1];
711− chip->allocated_banks[0].crypto_id = HASH_ALGO_SHA1;
712− chip->nr_allocated_banks = 1;
713−
714702 return rc;
715703 out:
716704 if (rc > 0)
@@ -779,3 +767,27 @@ int tpm1_pm_suspend(struct tpm_chip *chip, u32 tpm_suspend_pcr) · 62 unmodified lines
779767 return rc;
780768 }
781769
770+/**
771+ * tpm1_get_pcr_allocation() - initialize the allocated bank
772+ * @chip: TPM chip to use.
773+ *
774+ * The function initializes the SHA1 allocated bank to extend PCR
775+ *
776+ * Return:
777+ * * 0 on success,
778+ * * < 0 on error.
779+ */
780+int tpm1_get_pcr_allocation(struct tpm_chip *chip)
781+{
782+ chip->allocated_banks = kcalloc(1, sizeof(*chip->allocated_banks),
783+ GFP_KERNEL);
784+ if (!chip->allocated_banks)
785+ return -ENOMEM;
786+
787+ chip->allocated_banks[0].alg_id = TPM_ALG_SHA1;
788+ chip->allocated_banks[0].digest_size = hash_digest_size[HASH_ALGO_SHA1];
789+ chip->allocated_banks[0].crypto_id = HASH_ALGO_SHA1;
790+ chip->nr_allocated_banks = 1;
791+
792+ return 0;
793+}
drivers/char/tpm/tpm2-cmd.c+1−5
@@ -840,7 +840,7 @@ struct tpm2_pcr_selection { · 839 unmodified lines
840840 u8 pcr_select[3];
841841 } __packed;
842842
843−static ssize_t tpm2_get_pcr_allocation(struct tpm_chip *chip)
843+ssize_t tpm2_get_pcr_allocation(struct tpm_chip *chip)
844844 {
845845 struct tpm2_pcr_selection pcr_selection;
846846 struct tpm_buf buf;
@@ -1040,10 +1040,6 @@ int tpm2_auto_startup(struct tpm_chip *chip) · 193 unmodified lines
10401040 goto out;
10411041 }
10421042
1043− rc = tpm2_get_pcr_allocation(chip);
1044− if (rc)
1045− goto out;
1046−
10471043 rc = tpm2_get_cc_attrs_tbl(chip);
10481044
10491045 out:
drivers/clk/at91/clk-generated.c+2−0
@@ -141,6 +141,8 @@ static int clk_generated_determine_rate(struct clk_hw *hw, · 140 unmodified lines
141141 continue;
142142
143143 div = DIV_ROUND_CLOSEST(parent_rate, req->rate);
144+ if (div > GENERATED_MAX_DIV + 1)
145+ div = GENERATED_MAX_DIV + 1;
144146
145147 clk_generated_best_diff(req, parent, parent_rate, div,
146148 &best_diff, &best_rate);
drivers/clk/mediatek/clk-mt8183.c+34−12
@@ -25,9 +25,11 @@ static const struct mtk_fixed_clk top_fixed_clks[] = { · 24 unmodified lines
2525 FIXED_CLK(CLK_TOP_UNIVP_192M, "univpll_192m", "univpll", 192000000),
2626 };
2727
28+static const struct mtk_fixed_factor top_early_divs[] = {
29+ FACTOR(CLK_TOP_CLK13M, "clk13m", "clk26m", 1, 2),
30+};
31+
2832 static const struct mtk_fixed_factor top_divs[] = {
29− FACTOR(CLK_TOP_CLK13M, "clk13m", "clk26m", 1,
30− 2),
3133 FACTOR(CLK_TOP_F26M_CK_D2, "csw_f26m_ck_d2", "clk26m", 1,
3234 2),
3335 FACTOR(CLK_TOP_SYSPLL_CK, "syspll_ck", "mainpll", 1,
@@ -1148,37 +1150,57 @@ static int clk_mt8183_apmixed_probe(struct platform_device *pdev) · 1114 unmodified lines
11481150 return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
11491151 }
11501152
1153+static struct clk_onecell_data *top_clk_data;
1154+
1155+static void clk_mt8183_top_init_early(struct device_node *node)
1156+{
1157+ int i;
1158+
1159+ top_clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK);
1160+
1161+ for (i = 0; i < CLK_TOP_NR_CLK; i++)
1162+ top_clk_data->clks[i] = ERR_PTR(-EPROBE_DEFER);
1163+
1164+ mtk_clk_register_factors(top_early_divs, ARRAY_SIZE(top_early_divs),
1165+ top_clk_data);
1166+
1167+ of_clk_add_provider(node, of_clk_src_onecell_get, top_clk_data);
1168+}
1169+
1170+CLK_OF_DECLARE_DRIVER(mt8183_topckgen, "mediatek,mt8183-topckgen",
1171+ clk_mt8183_top_init_early);
1172+
11511173 static int clk_mt8183_top_probe(struct platform_device *pdev)
11521174 {
11531175 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
11541176 void __iomem *base;
1155− struct clk_onecell_data *clk_data;
11561177 struct device_node *node = pdev->dev.of_node;
11571178
11581179 base = devm_ioremap_resource(&pdev->dev, res);
11591180 if (IS_ERR(base))
11601181 return PTR_ERR(base);
11611182
1162− clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK);
1163−
11641183 mtk_clk_register_fixed_clks(top_fixed_clks, ARRAY_SIZE(top_fixed_clks),
1165− clk_data);
1184+ top_clk_data);
1185+
1186+ mtk_clk_register_factors(top_early_divs, ARRAY_SIZE(top_early_divs),
1187+ top_clk_data);
11661188
1167− mtk_clk_register_factors(top_divs, ARRAY_SIZE(top_divs), clk_data);
1189+ mtk_clk_register_factors(top_divs, ARRAY_SIZE(top_divs), top_clk_data);
11681190
11691191 mtk_clk_register_muxes(top_muxes, ARRAY_SIZE(top_muxes),
1170− node, &mt8183_clk_lock, clk_data);
1192+ node, &mt8183_clk_lock, top_clk_data);
11711193
11721194 mtk_clk_register_composites(top_aud_muxes, ARRAY_SIZE(top_aud_muxes),
1173− base, &mt8183_clk_lock, clk_data);
1195+ base, &mt8183_clk_lock, top_clk_data);
11741196
11751197 mtk_clk_register_composites(top_aud_divs, ARRAY_SIZE(top_aud_divs),
1176− base, &mt8183_clk_lock, clk_data);
1198+ base, &mt8183_clk_lock, top_clk_data);
11771199
11781200 mtk_clk_register_gates(node, top_clks, ARRAY_SIZE(top_clks),
1179− clk_data);
1201+ top_clk_data);
11801202
1181− return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
1203+ return of_clk_add_provider(node, of_clk_src_onecell_get, top_clk_data);
11821204 }
11831205
11841206 static int clk_mt8183_infra_probe(struct platform_device *pdev)
drivers/clk/renesas/renesas-cpg-mssr.c+2−14
@@ -572,17 +572,11 @@ static int cpg_mssr_reset(struct reset_controller_dev *rcdev, · 571 unmodified lines
572572 unsigned int reg = id / 32;
573573 unsigned int bit = id % 32;
574574 u32 bitmask = BIT(bit);
575− unsigned long flags;
576− u32 value;
577575
578576 dev_dbg(priv->dev, "reset %u%02u\n", reg, bit);
579577
580578 /* Reset module */
581− spin_lock_irqsave(&priv->rmw_lock, flags);
582− value = readl(priv->base + SRCR(reg));
583− value |= bitmask;
584− writel(value, priv->base + SRCR(reg));
585− spin_unlock_irqrestore(&priv->rmw_lock, flags);
579+ writel(bitmask, priv->base + SRCR(reg));
586580
587581 /* Wait for at least one cycle of the RCLK clock (@ ca. 32 kHz) */
588582 udelay(35);
@@ -599,16 +593,10 @@ static int cpg_mssr_assert(struct reset_controller_dev *rcdev, unsigned long id) · 10 unmodified lines
599593 unsigned int reg = id / 32;
600594 unsigned int bit = id % 32;
601595 u32 bitmask = BIT(bit);
602− unsigned long flags;
603− u32 value;
604596
605597 dev_dbg(priv->dev, "assert %u%02u\n", reg, bit);
606598
607− spin_lock_irqsave(&priv->rmw_lock, flags);
608− value = readl(priv->base + SRCR(reg));
609− value |= bitmask;
610− writel(value, priv->base + SRCR(reg));
611− spin_unlock_irqrestore(&priv->rmw_lock, flags);
599+ writel(bitmask, priv->base + SRCR(reg));
612600 return 0;
613601 }
614602
drivers/clk/sprd/Kconfig+1−0
@@ -3,6 +3,7 @@ config SPRD_COMMON_CLK · 2 unmodified lines
33 tristate "Clock support for Spreadtrum SoCs"
44 depends on ARCH_SPRD || COMPILE_TEST
55 default ARCH_SPRD
6+ select REGMAP_MMIO
67
78 if SPRD_COMMON_CLK
89
drivers/clocksource/timer-riscv.c+2−4
@@ -55,7 +55,7 @@ static u64 riscv_sched_clock(void) · 54 unmodified lines
5555 return get_cycles64();
5656 }
5757
58−static DEFINE_PER_CPU(struct clocksource, riscv_clocksource) = {
58+static struct clocksource riscv_clocksource = {
5959 .name = "riscv_clocksource",
6060 .rating = 300,
6161 .mask = CLOCKSOURCE_MASK(64),
@@ -92,7 +92,6 @@ void riscv_timer_interrupt(void) · 30 unmodified lines
9292 static int __init riscv_timer_init_dt(struct device_node *n)
9393 {
9494 int cpuid, hartid, error;
95− struct clocksource *cs;
9695
9796 hartid = riscv_of_processor_hartid(n);
9897 if (hartid < 0) {
@@ -112,8 +111,7 @@ static int __init riscv_timer_init_dt(struct device_node *n) · 13 unmodified lines
112111
113112 pr_info("%s: Registering clocksource cpuid [%d] hartid [%d]\n",
114113 __func__, cpuid, hartid);
115− cs = per_cpu_ptr(&riscv_clocksource, cpuid);
116− error = clocksource_register_hz(cs, riscv_timebase);
114+ error = clocksource_register_hz(&riscv_clocksource, riscv_timebase);
117115 if (error) {
118116 pr_err("RISCV timer register failed [%d] for cpu = [%d]\n",
119117 error, cpuid);
drivers/crypto/ccp/ccp-crypto-aes-galois.c+14−0
@@ -58,6 +58,19 @@ static int ccp_aes_gcm_setkey(struct crypto_aead *tfm, const u8 *key, · 57 unmodified lines
5858 static int ccp_aes_gcm_setauthsize(struct crypto_aead *tfm,
5959 unsigned int authsize)
6060 {
61+ switch (authsize) {
62+ case 16:
63+ case 15:
64+ case 14:
65+ case 13:
66+ case 12:
67+ case 8:
68+ case 4:
69+ break;
70+ default:
71+ return -EINVAL;
72+ }
73+
6174 return 0;
6275 }
6376
@@ -104,6 +117,7 @@ static int ccp_aes_gcm_crypt(struct aead_request *req, bool encrypt) · 40 unmodified lines
104117 memset(&rctx->cmd, 0, sizeof(rctx->cmd));
105118 INIT_LIST_HEAD(&rctx->cmd.entry);
106119 rctx->cmd.engine = CCP_ENGINE_AES;
120+ rctx->cmd.u.aes.authsize = crypto_aead_authsize(tfm);
107121 rctx->cmd.u.aes.type = ctx->u.aes.type;
108122 rctx->cmd.u.aes.mode = ctx->u.aes.mode;
109123 rctx->cmd.u.aes.action = encrypt;
drivers/crypto/ccp/ccp-ops.c+24−9
@@ -622,6 +622,7 @@ static int ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q, · 621 unmodified lines
622622
623623 unsigned long long *final;
624624 unsigned int dm_offset;
625+ unsigned int authsize;
625626 unsigned int jobid;
626627 unsigned int ilen;
627628 bool in_place = true; /* Default value */
@@ -643,6 +644,21 @@ static int ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q, · 15 unmodified lines
643644 if (!aes->key) /* Gotta have a key SGL */
644645 return -EINVAL;
645646
647+ /* Zero defaults to 16 bytes, the maximum size */
648+ authsize = aes->authsize ? aes->authsize : AES_BLOCK_SIZE;
649+ switch (authsize) {
650+ case 16:
651+ case 15:
652+ case 14:
653+ case 13:
654+ case 12:
655+ case 8:
656+ case 4:
657+ break;
658+ default:
659+ return -EINVAL;
660+ }
661+
646662 /* First, decompose the source buffer into AAD & PT,
647663 * and the destination buffer into AAD, CT & tag, or
648664 * the input into CT & tag.
@@ -657,7 +673,7 @@ static int ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q, · 8 unmodified lines
657673 p_tag = scatterwalk_ffwd(sg_tag, p_outp, ilen);
658674 } else {
659675 /* Input length for decryption includes tag */
660− ilen = aes->src_len - AES_BLOCK_SIZE;
676+ ilen = aes->src_len - authsize;
661677 p_tag = scatterwalk_ffwd(sg_tag, p_inp, ilen);
662678 }
663679
@@ -766,8 +782,7 @@ static int ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q, · 102 unmodified lines
766782 while (src.sg_wa.bytes_left) {
767783 ccp_prepare_data(&src, &dst, &op, AES_BLOCK_SIZE, true);
768784 if (!src.sg_wa.bytes_left) {
769− unsigned int nbytes = aes->src_len
770− % AES_BLOCK_SIZE;
785+ unsigned int nbytes = ilen % AES_BLOCK_SIZE;
771786
772787 if (nbytes) {
773788 op.eom = 1;
@@ -839,19 +854,19 @@ static int ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q, · 65 unmodified lines
839854
840855 if (aes->action == CCP_AES_ACTION_ENCRYPT) {
841856 /* Put the ciphered tag after the ciphertext. */
842− ccp_get_dm_area(&final_wa, 0, p_tag, 0, AES_BLOCK_SIZE);
857+ ccp_get_dm_area(&final_wa, 0, p_tag, 0, authsize);
843858 } else {
844859 /* Does this ciphered tag match the input? */
845− ret = ccp_init_dm_workarea(&tag, cmd_q, AES_BLOCK_SIZE,
860+ ret = ccp_init_dm_workarea(&tag, cmd_q, authsize,
846861 DMA_BIDIRECTIONAL);
847862 if (ret)
848863 goto e_tag;
849− ret = ccp_set_dm_area(&tag, 0, p_tag, 0, AES_BLOCK_SIZE);
864+ ret = ccp_set_dm_area(&tag, 0, p_tag, 0, authsize);
850865 if (ret)
851866 goto e_tag;
852867
853868 ret = crypto_memneq(tag.address, final_wa.address,
854− AES_BLOCK_SIZE) ? -EBADMSG : 0;
869+ authsize) ? -EBADMSG : 0;
855870 ccp_dm_free(&tag);
856871 }
857872
@@ -859,11 +874,11 @@ e_tag: · 1 unmodified line
859874 ccp_dm_free(&final_wa);
860875
861876 e_dst:
862− if (aes->src_len && !in_place)
877+ if (ilen > 0 && !in_place)
863878 ccp_free_data(&dst, cmd_q);
864879
865880 e_src:
866− if (aes->src_len)
881+ if (ilen > 0)
867882 ccp_free_data(&src, cmd_q);
868883
869884 e_aad:
drivers/crypto/ux500/cryp/cryp.c+6−0
@@ -314,14 +314,17 @@ void cryp_save_device_context(struct cryp_device_data *device_data, · 313 unmodified lines
314314 case CRYP_KEY_SIZE_256:
315315 ctx->key_4_l = readl_relaxed(&src_reg->key_4_l);
316316 ctx->key_4_r = readl_relaxed(&src_reg->key_4_r);
317+ /* Fall through */
317318
318319 case CRYP_KEY_SIZE_192:
319320 ctx->key_3_l = readl_relaxed(&src_reg->key_3_l);
320321 ctx->key_3_r = readl_relaxed(&src_reg->key_3_r);
322+ /* Fall through */
321323
322324 case CRYP_KEY_SIZE_128:
323325 ctx->key_2_l = readl_relaxed(&src_reg->key_2_l);
324326 ctx->key_2_r = readl_relaxed(&src_reg->key_2_r);
327+ /* Fall through */
325328
326329 default:
327330 ctx->key_1_l = readl_relaxed(&src_reg->key_1_l);
@@ -361,14 +364,17 @@ void cryp_restore_device_context(struct cryp_device_data *device_data, · 33 unmodified lines
361364 case CRYP_KEY_SIZE_256:
362365 writel_relaxed(ctx->key_4_l, &reg->key_4_l);
363366 writel_relaxed(ctx->key_4_r, &reg->key_4_r);
367+ /* Fall through */
364368
365369 case CRYP_KEY_SIZE_192:
366370 writel_relaxed(ctx->key_3_l, &reg->key_3_l);
367371 writel_relaxed(ctx->key_3_r, &reg->key_3_r);
372+ /* Fall through */
368373
369374 case CRYP_KEY_SIZE_128:
370375 writel_relaxed(ctx->key_2_l, &reg->key_2_l);
371376 writel_relaxed(ctx->key_2_r, &reg->key_2_r);
377+ /* Fall through */
372378
373379 default:
374380 writel_relaxed(ctx->key_1_l, &reg->key_1_l);
drivers/gpio/gpiolib.c+15−8
@@ -956,9 +956,11 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip) · 955 unmodified lines
956956 }
957957
958958 if (eflags & GPIOEVENT_REQUEST_RISING_EDGE)
959− irqflags |= IRQF_TRIGGER_RISING;
959+ irqflags |= test_bit(FLAG_ACTIVE_LOW, &desc->flags) ?
960+ IRQF_TRIGGER_FALLING : IRQF_TRIGGER_RISING;
960961 if (eflags & GPIOEVENT_REQUEST_FALLING_EDGE)
961− irqflags |= IRQF_TRIGGER_FALLING;
962+ irqflags |= test_bit(FLAG_ACTIVE_LOW, &desc->flags) ?
963+ IRQF_TRIGGER_RISING : IRQF_TRIGGER_FALLING;
962964 irqflags |= IRQF_ONESHOT;
963965
964966 INIT_KFIFO(le->events);
@@ -1392,12 +1394,17 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, · 427 unmodified lines
13921394 for (i = 0; i < chip->ngpio; i++) {
13931395 struct gpio_desc *desc = &gdev->descs[i];
13941396
1395− if (chip->get_direction && gpiochip_line_is_valid(chip, i))
1396− desc->flags = !chip->get_direction(chip, i) ?
1397− (1 << FLAG_IS_OUT) : 0;
1398− else
1399− desc->flags = !chip->direction_input ?
1400− (1 << FLAG_IS_OUT) : 0;
1397+ if (chip->get_direction && gpiochip_line_is_valid(chip, i)) {
1398+ if (!chip->get_direction(chip, i))
1399+ set_bit(FLAG_IS_OUT, &desc->flags);
1400+ else
1401+ clear_bit(FLAG_IS_OUT, &desc->flags);
1402+ } else {
1403+ if (!chip->direction_input)
1404+ set_bit(FLAG_IS_OUT, &desc->flags);
1405+ else
1406+ clear_bit(FLAG_IS_OUT, &desc->flags);
1407+ }
14011408 }
14021409
14031410 acpi_gpiochip_add(chip);
drivers/gpu/drm/Kconfig+1−1
@@ -394,7 +394,7 @@ config DRM_R128 · 393 unmodified lines
394394 config DRM_I810
395395 tristate "Intel I810"
396396 # !PREEMPT because of missing ioctl locking
397− depends on DRM && AGP && AGP_INTEL && (!PREEMPT || BROKEN)
397+ depends on DRM && AGP && AGP_INTEL && (!PREEMPTION || BROKEN)
398398 help
399399 Choose this option if you have an Intel I810 graphics card. If M is
400400 selected, the module will be called i810. AGP support is required
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c+2−1
@@ -1140,7 +1140,8 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu( · 1139 unmodified lines
11401140 adev->asic_type != CHIP_FIJI &&
11411141 adev->asic_type != CHIP_POLARIS10 &&
11421142 adev->asic_type != CHIP_POLARIS11 &&
1143− adev->asic_type != CHIP_POLARIS12) ?
1143+ adev->asic_type != CHIP_POLARIS12 &&
1144+ adev->asic_type != CHIP_VEGAM) ?
11441145 VI_BO_SIZE_ALIGN : 1;
11451146
11461147 mapping_flags = AMDGPU_VM_PAGE_READABLE;
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c+12−14
@@ -1044,29 +1044,27 @@ static int amdgpu_cs_process_fence_dep(struct amdgpu_cs_parser *p, · 1043 unmodified lines
10441044 return r;
10451045 }
10461046
1047− fence = amdgpu_ctx_get_fence(ctx, entity,
1048− deps[i].handle);
1047+ fence = amdgpu_ctx_get_fence(ctx, entity, deps[i].handle);
1048+ amdgpu_ctx_put(ctx);
1049+
1050+ if (IS_ERR(fence))
1051+ return PTR_ERR(fence);
1052+ else if (!fence)
1053+ continue;
10491054
10501055 if (chunk->chunk_id == AMDGPU_CHUNK_ID_SCHEDULED_DEPENDENCIES) {
1051− struct drm_sched_fence *s_fence = to_drm_sched_fence(fence);
1056+ struct drm_sched_fence *s_fence;
10521057 struct dma_fence *old = fence;
10531058
1059+ s_fence = to_drm_sched_fence(fence);
10541060 fence = dma_fence_get(&s_fence->scheduled);
10551061 dma_fence_put(old);
10561062 }
10571063
1058− if (IS_ERR(fence)) {
1059− r = PTR_ERR(fence);
1060− amdgpu_ctx_put(ctx);
1064+ r = amdgpu_sync_fence(p->adev, &p->job->sync, fence, true);
1065+ dma_fence_put(fence);
1066+ if (r)
10611067 return r;
1062− } else if (fence) {
1063− r = amdgpu_sync_fence(p->adev, &p->job->sync, fence,
1064− true);
1065− dma_fence_put(fence);
1066− amdgpu_ctx_put(ctx);
1067− if (r)
1068− return r;
1069− }
10701068 }
10711069 return 0;
10721070 }
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c+1−1
@@ -707,7 +707,7 @@ static ssize_t amdgpu_debugfs_gpr_read(struct file *f, char __user *buf, · 706 unmodified lines
707707 thread = (*pos & GENMASK_ULL(59, 52)) >> 52;
708708 bank = (*pos & GENMASK_ULL(61, 60)) >> 60;
709709
710− data = kmalloc_array(1024, sizeof(*data), GFP_KERNEL);
710+ data = kcalloc(1024, sizeof(*data), GFP_KERNEL);
711711 if (!data)
712712 return -ENOMEM;
713713
drivers/gpu/drm/amd/amdgpu/amdgpu_gds.h+0−1
@@ -32,7 +32,6 @@ struct amdgpu_gds { · 31 unmodified lines
3232 uint32_t gws_size;
3333 uint32_t oa_size;
3434 uint32_t gds_compute_max_wave_id;
35− uint32_t vgt_gs_max_wave_id;
3635 };
3736
3837 struct amdgpu_gds_reg_offset {
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c+49−25
@@ -159,12 +159,16 @@ static ssize_t amdgpu_get_dpm_state(struct device *dev, · 158 unmodified lines
159159 struct amdgpu_device *adev = ddev->dev_private;
160160 enum amd_pm_state_type pm;
161161
162− if (is_support_sw_smu(adev) && adev->smu.ppt_funcs->get_current_power_state)
163− pm = amdgpu_smu_get_current_power_state(adev);
164− else if (adev->powerplay.pp_funcs->get_current_power_state)
162+ if (is_support_sw_smu(adev)) {
163+ if (adev->smu.ppt_funcs->get_current_power_state)
164+ pm = amdgpu_smu_get_current_power_state(adev);
165+ else
166+ pm = adev->pm.dpm.user_state;
167+ } else if (adev->powerplay.pp_funcs->get_current_power_state) {
165168 pm = amdgpu_dpm_get_current_power_state(adev);
166− else
169+ } else {
167170 pm = adev->pm.dpm.user_state;
171+ }
168172
169173 return snprintf(buf, PAGE_SIZE, "%s\n",
170174 (pm == POWER_STATE_TYPE_BATTERY) ? "battery" :
@@ -191,7 +195,11 @@ static ssize_t amdgpu_set_dpm_state(struct device *dev, · 20 unmodified lines
191195 goto fail;
192196 }
193197
194− if (adev->powerplay.pp_funcs->dispatch_tasks) {
198+ if (is_support_sw_smu(adev)) {
199+ mutex_lock(&adev->pm.mutex);
200+ adev->pm.dpm.user_state = state;
201+ mutex_unlock(&adev->pm.mutex);
202+ } else if (adev->powerplay.pp_funcs->dispatch_tasks) {
195203 amdgpu_dpm_dispatch_task(adev, AMD_PP_TASK_ENABLE_USER_STATE, &state);
196204 } else {
197205 mutex_lock(&adev->pm.mutex);
@@ -3067,28 +3075,44 @@ static int amdgpu_debugfs_pm_info_pp(struct seq_file *m, struct amdgpu_device *a · 2869 unmodified lines
30673075 if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK, (void *)&value64, &size))
30683076 seq_printf(m, "SMC Feature Mask: 0x%016llx\n", value64);
30693077
3070− /* UVD clocks */
3071− if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_UVD_POWER, (void *)&value, &size)) {
3072− if (!value) {
3073− seq_printf(m, "UVD: Disabled\n");
3074− } else {
3075− seq_printf(m, "UVD: Enabled\n");
3076− if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_UVD_DCLK, (void *)&value, &size))
3077− seq_printf(m, "\t%u MHz (DCLK)\n", value/100);
3078− if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_UVD_VCLK, (void *)&value, &size))
3079− seq_printf(m, "\t%u MHz (VCLK)\n", value/100);
3078+ if (adev->asic_type > CHIP_VEGA20) {
3079+ /* VCN clocks */
3080+ if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_VCN_POWER_STATE, (void *)&value, &size)) {
3081+ if (!value) {
3082+ seq_printf(m, "VCN: Disabled\n");
3083+ } else {
3084+ seq_printf(m, "VCN: Enabled\n");
3085+ if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_UVD_DCLK, (void *)&value, &size))
3086+ seq_printf(m, "\t%u MHz (DCLK)\n", value/100);
3087+ if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_UVD_VCLK, (void *)&value, &size))
3088+ seq_printf(m, "\t%u MHz (VCLK)\n", value/100);
3089+ }
30803090 }
3081− }
3082− seq_printf(m, "\n");
3091+ seq_printf(m, "\n");
3092+ } else {
3093+ /* UVD clocks */
3094+ if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_UVD_POWER, (void *)&value, &size)) {
3095+ if (!value) {
3096+ seq_printf(m, "UVD: Disabled\n");
3097+ } else {
3098+ seq_printf(m, "UVD: Enabled\n");
3099+ if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_UVD_DCLK, (void *)&value, &size))
3100+ seq_printf(m, "\t%u MHz (DCLK)\n", value/100);
3101+ if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_UVD_VCLK, (void *)&value, &size))
3102+ seq_printf(m, "\t%u MHz (VCLK)\n", value/100);
3103+ }
3104+ }
3105+ seq_printf(m, "\n");
30833106
3084− /* VCE clocks */
3085− if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_VCE_POWER, (void *)&value, &size)) {
3086− if (!value) {
3087− seq_printf(m, "VCE: Disabled\n");
3088− } else {
3089− seq_printf(m, "VCE: Enabled\n");
3090− if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_VCE_ECCLK, (void *)&value, &size))
3091− seq_printf(m, "\t%u MHz (ECCLK)\n", value/100);
3107+ /* VCE clocks */
3108+ if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_VCE_POWER, (void *)&value, &size)) {
3109+ if (!value) {
3110+ seq_printf(m, "VCE: Disabled\n");
3111+ } else {
3112+ seq_printf(m, "VCE: Enabled\n");
3113+ if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_VCE_ECCLK, (void *)&value, &size))
3114+ seq_printf(m, "\t%u MHz (ECCLK)\n", value/100);
3115+ }
30923116 }
30933117 }
30943118
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h+1−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 #define AMDGPU_VCN_FIRMWARE_OFFSET 256
3131 #define AMDGPU_VCN_MAX_ENC_RINGS 3
3232
33+#define VCN_DEC_KMD_CMD 0x80000000
3334 #define VCN_DEC_CMD_FENCE 0x00000000
3435 #define VCN_DEC_CMD_TRAP 0x00000001
3536 #define VCN_DEC_CMD_WRITE_REG 0x00000004
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c+1−11
@@ -4206,15 +4206,6 @@ static void gfx_v10_0_ring_emit_ib_gfx(struct amdgpu_ring *ring, · 4205 unmodified lines
42064206 unsigned vmid = AMDGPU_JOB_GET_VMID(job);
42074207 u32 header, control = 0;
42084208
4209− /* Prevent a hw deadlock due to a wave ID mismatch between ME and GDS.
4210− * This resets the wave ID counters. (needed by transform feedback)
4211− * TODO: This might only be needed on a VMID switch when we change
4212− * the GDS OA mapping, not sure.
4213− */
4214− amdgpu_ring_write(ring, PACKET3(PACKET3_SET_CONFIG_REG, 1));
4215− amdgpu_ring_write(ring, mmVGT_GS_MAX_WAVE_ID);
4216− amdgpu_ring_write(ring, ring->adev->gds.vgt_gs_max_wave_id);
4217−
42184209 if (ib->flags & AMDGPU_IB_FLAG_CE)
42194210 header = PACKET3(PACKET3_INDIRECT_BUFFER_CNST, 2);
42204211 else
@@ -4961,7 +4952,7 @@ static const struct amdgpu_ring_funcs gfx_v10_0_ring_funcs_gfx = { · 740 unmodified lines
49614952 5 + /* HDP_INVL */
49624953 8 + 8 + /* FENCE x2 */
49634954 2, /* SWITCH_BUFFER */
4964− .emit_ib_size = 7, /* gfx_v10_0_ring_emit_ib_gfx */
4955+ .emit_ib_size = 4, /* gfx_v10_0_ring_emit_ib_gfx */
49654956 .emit_ib = gfx_v10_0_ring_emit_ib_gfx,
49664957 .emit_fence = gfx_v10_0_ring_emit_fence,
49674958 .emit_pipeline_sync = gfx_v10_0_ring_emit_pipeline_sync,
@@ -5112,7 +5103,6 @@ static void gfx_v10_0_set_gds_init(struct amdgpu_device *adev) · 144 unmodified lines
51125103 default:
51135104 adev->gds.gds_size = 0x10000;
51145105 adev->gds.gds_compute_max_wave_id = 0x4ff;
5115− adev->gds.vgt_gs_max_wave_id = 0x3ff;
51165106 break;
51175107 }
51185108
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c+40−0
@@ -1321,6 +1321,39 @@ static int gfx_v8_0_rlc_init(struct amdgpu_device *adev) · 1320 unmodified lines
13211321 return 0;
13221322 }
13231323
1324+static int gfx_v8_0_csb_vram_pin(struct amdgpu_device *adev)
1325+{
1326+ int r;
1327+
1328+ r = amdgpu_bo_reserve(adev->gfx.rlc.clear_state_obj, false);
1329+ if (unlikely(r != 0))
1330+ return r;
1331+
1332+ r = amdgpu_bo_pin(adev->gfx.rlc.clear_state_obj,
1333+ AMDGPU_GEM_DOMAIN_VRAM);
1334+ if (!r)
1335+ adev->gfx.rlc.clear_state_gpu_addr =
1336+ amdgpu_bo_gpu_offset(adev->gfx.rlc.clear_state_obj);
1337+
1338+ amdgpu_bo_unreserve(adev->gfx.rlc.clear_state_obj);
1339+
1340+ return r;
1341+}
1342+
1343+static void gfx_v8_0_csb_vram_unpin(struct amdgpu_device *adev)
1344+{
1345+ int r;
1346+
1347+ if (!adev->gfx.rlc.clear_state_obj)
1348+ return;
1349+
1350+ r = amdgpu_bo_reserve(adev->gfx.rlc.clear_state_obj, true);
1351+ if (likely(r == 0)) {
1352+ amdgpu_bo_unpin(adev->gfx.rlc.clear_state_obj);
1353+ amdgpu_bo_unreserve(adev->gfx.rlc.clear_state_obj);
1354+ }
1355+}
1356+
13241357 static void gfx_v8_0_mec_fini(struct amdgpu_device *adev)
13251358 {
13261359 amdgpu_bo_free_kernel(&adev->gfx.mec.hpd_eop_obj, NULL, NULL);
@@ -4785,6 +4818,10 @@ static int gfx_v8_0_hw_init(void *handle) · 3458 unmodified lines
47854818 gfx_v8_0_init_golden_registers(adev);
47864819 gfx_v8_0_constants_init(adev);
47874820
4821+ r = gfx_v8_0_csb_vram_pin(adev);
4822+ if (r)
4823+ return r;
4824+
47884825 r = adev->gfx.rlc.funcs->resume(adev);
47894826 if (r)
47904827 return r;
@@ -4901,6 +4938,9 @@ static int gfx_v8_0_hw_fini(void *handle) · 110 unmodified lines
49014938 else
49024939 pr_err("rlc is busy, skip halt rlc\n");
49034940 amdgpu_gfx_rlc_exit_safe_mode(adev);
4941+
4942+ gfx_v8_0_csb_vram_unpin(adev);
4943+
49044944 return 0;
49054945 }
49064946
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c+37−7
@@ -1485,7 +1485,7 @@ static void vcn_v2_0_dec_ring_insert_start(struct amdgpu_ring *ring) · 1484 unmodified lines
14851485 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_DATA0_INTERNAL_OFFSET, 0));
14861486 amdgpu_ring_write(ring, 0);
14871487 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET, 0));
1488− amdgpu_ring_write(ring, VCN_DEC_CMD_PACKET_START << 1);
1488+ amdgpu_ring_write(ring, VCN_DEC_KMD_CMD | (VCN_DEC_CMD_PACKET_START << 1));
14891489 }
14901490
14911491 /**
@@ -1498,7 +1498,7 @@ static void vcn_v2_0_dec_ring_insert_start(struct amdgpu_ring *ring) · 6 unmodified lines
14981498 static void vcn_v2_0_dec_ring_insert_end(struct amdgpu_ring *ring)
14991499 {
15001500 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET, 0));
1501− amdgpu_ring_write(ring, VCN_DEC_CMD_PACKET_END << 1);
1501+ amdgpu_ring_write(ring, VCN_DEC_KMD_CMD | (VCN_DEC_CMD_PACKET_END << 1));
15021502 }
15031503
15041504 /**
@@ -1543,7 +1543,7 @@ static void vcn_v2_0_dec_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 · 38 unmodified lines
15431543 amdgpu_ring_write(ring, upper_32_bits(addr) & 0xff);
15441544
15451545 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET, 0));
1546− amdgpu_ring_write(ring, VCN_DEC_CMD_FENCE << 1);
1546+ amdgpu_ring_write(ring, VCN_DEC_KMD_CMD | (VCN_DEC_CMD_FENCE << 1));
15471547
15481548 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_DATA0_INTERNAL_OFFSET, 0));
15491549 amdgpu_ring_write(ring, 0);
@@ -1553,7 +1553,7 @@ static void vcn_v2_0_dec_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 · 3 unmodified lines
15531553
15541554 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET, 0));
15551555
1556− amdgpu_ring_write(ring, VCN_DEC_CMD_TRAP << 1);
1556+ amdgpu_ring_write(ring, VCN_DEC_KMD_CMD | (VCN_DEC_CMD_TRAP << 1));
15571557 }
15581558
15591559 /**
@@ -1597,7 +1597,7 @@ static void vcn_v2_0_dec_ring_emit_reg_wait(struct amdgpu_ring *ring, · 37 unmodified lines
15971597
15981598 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET, 0));
15991599
1600− amdgpu_ring_write(ring, VCN_DEC_CMD_REG_READ_COND_WAIT << 1);
1600+ amdgpu_ring_write(ring, VCN_DEC_KMD_CMD | (VCN_DEC_CMD_REG_READ_COND_WAIT << 1));
16011601 }
16021602
16031603 static void vcn_v2_0_dec_ring_emit_vm_flush(struct amdgpu_ring *ring,
@@ -1626,7 +1626,7 @@ static void vcn_v2_0_dec_ring_emit_wreg(struct amdgpu_ring *ring, · 22 unmodified lines
16261626
16271627 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET, 0));
16281628
1629− amdgpu_ring_write(ring, VCN_DEC_CMD_WRITE_REG << 1);
1629+ amdgpu_ring_write(ring, VCN_DEC_KMD_CMD | (VCN_DEC_CMD_WRITE_REG << 1));
16301630 }
16311631
16321632 /**
@@ -2079,6 +2079,36 @@ static int vcn_v2_0_process_interrupt(struct amdgpu_device *adev, · 446 unmodified lines
20792079 return 0;
20802080 }
20812081
2082+static int vcn_v2_0_dec_ring_test_ring(struct amdgpu_ring *ring)
2083+{
2084+ struct amdgpu_device *adev = ring->adev;
2085+ uint32_t tmp = 0;
2086+ unsigned i;
2087+ int r;
2088+
2089+ WREG32(adev->vcn.external.scratch9, 0xCAFEDEAD);
2090+ r = amdgpu_ring_alloc(ring, 4);
2091+ if (r)
2092+ return r;
2093+ amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET, 0));
2094+ amdgpu_ring_write(ring, VCN_DEC_KMD_CMD | (VCN_DEC_CMD_PACKET_START << 1));
2095+ amdgpu_ring_write(ring, PACKET0(adev->vcn.internal.scratch9, 0));
2096+ amdgpu_ring_write(ring, 0xDEADBEEF);
2097+ amdgpu_ring_commit(ring);
2098+ for (i = 0; i < adev->usec_timeout; i++) {
2099+ tmp = RREG32(adev->vcn.external.scratch9);
2100+ if (tmp == 0xDEADBEEF)
2101+ break;
2102+ DRM_UDELAY(1);
2103+ }
2104+
2105+ if (i >= adev->usec_timeout)
2106+ r = -ETIMEDOUT;
2107+
2108+ return r;
2109+}
2110+
2111+
20822112 static int vcn_v2_0_set_powergating_state(void *handle,
20832113 enum amd_powergating_state state)
20842114 {
@@ -2142,7 +2172,7 @@ static const struct amdgpu_ring_funcs vcn_v2_0_dec_ring_vm_funcs = { · 57 unmodified lines
21422172 .emit_ib = vcn_v2_0_dec_ring_emit_ib,
21432173 .emit_fence = vcn_v2_0_dec_ring_emit_fence,
21442174 .emit_vm_flush = vcn_v2_0_dec_ring_emit_vm_flush,
2145− .test_ring = amdgpu_vcn_dec_ring_test_ring,
2175+ .test_ring = vcn_v2_0_dec_ring_test_ring,
21462176 .test_ib = amdgpu_vcn_dec_ring_test_ib,
21472177 .insert_nop = vcn_v2_0_dec_ring_insert_nop,
21482178 .insert_start = vcn_v2_0_dec_ring_insert_start,
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c+0−28
@@ -1567,32 +1567,6 @@ copy_from_user_failed: · 1566 unmodified lines
15671567 return err;
15681568 }
15691569
1570−static int kfd_ioctl_alloc_queue_gws(struct file *filep,
1571− struct kfd_process *p, void *data)
1572−{
1573− int retval;
1574− struct kfd_ioctl_alloc_queue_gws_args *args = data;
1575− struct kfd_dev *dev;
1576−
1577− if (!hws_gws_support)
1578− return -ENODEV;
1579−
1580− dev = kfd_device_by_id(args->gpu_id);
1581− if (!dev) {
1582− pr_debug("Could not find gpu id 0x%x\n", args->gpu_id);
1583− return -ENODEV;
1584− }
1585− if (dev->dqm->sched_policy == KFD_SCHED_POLICY_NO_HWS)
1586− return -ENODEV;
1587−
1588− mutex_lock(&p->mutex);
1589− retval = pqm_set_gws(&p->pqm, args->queue_id, args->num_gws ? dev->gws : NULL);
1590− mutex_unlock(&p->mutex);
1591−
1592− args->first_gws = 0;
1593− return retval;
1594−}
1595−
15961570 static int kfd_ioctl_get_dmabuf_info(struct file *filep,
15971571 struct kfd_process *p, void *data)
15981572 {
@@ -1795,8 +1769,6 @@ static const struct amdkfd_ioctl_desc amdkfd_ioctls[] = { · 196 unmodified lines
17951769 AMDKFD_IOCTL_DEF(AMDKFD_IOC_IMPORT_DMABUF,
17961770 kfd_ioctl_import_dmabuf, 0),
17971771
1798− AMDKFD_IOCTL_DEF(AMDKFD_IOC_ALLOC_QUEUE_GWS,
1799− kfd_ioctl_alloc_queue_gws, 0),
18001772 };
18011773
18021774 #define AMDKFD_CORE_IOCTL_COUNT ARRAY_SIZE(amdkfd_ioctls)
drivers/gpu/drm/amd/include/kgd_pp_interface.h+1−0
@@ -123,6 +123,7 @@ enum amd_pp_sensors { · 122 unmodified lines
123123 AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK,
124124 AMDGPU_PP_SENSOR_MIN_FAN_RPM,
125125 AMDGPU_PP_SENSOR_MAX_FAN_RPM,
126+ AMDGPU_PP_SENSOR_VCN_POWER_STATE,
126127 };
127128
128129 enum amd_pp_task {
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c+17−8
@@ -306,7 +306,8 @@ int smu_get_power_num_states(struct smu_context *smu, · 305 unmodified lines
306306
307307 /* not support power state */
308308 memset(state_info, 0, sizeof(struct pp_states_info));
309− state_info->nums = 0;
309+ state_info->nums = 1;
310+ state_info->states[0] = POWER_STATE_TYPE_DEFAULT;
310311
311312 return 0;
312313 }
@@ -314,6 +315,8 @@ int smu_get_power_num_states(struct smu_context *smu, · 1 unmodified line
314315 int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor,
315316 void *data, uint32_t *size)
316317 {
318+ struct smu_power_context *smu_power = &smu->smu_power;
319+ struct smu_power_gate *power_gate = &smu_power->power_gate;
317320 int ret = 0;
318321
319322 switch (sensor) {
@@ -337,6 +340,10 @@ int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor, · 17 unmodified lines
337340 *(uint32_t *)data = smu_feature_is_enabled(smu, SMU_FEATURE_DPM_VCE_BIT) ? 1 : 0;
338341 *size = 4;
339342 break;
343+ case AMDGPU_PP_SENSOR_VCN_POWER_STATE:
344+ *(uint32_t *)data = power_gate->vcn_gated ? 0 : 1;
345+ *size = 4;
346+ break;
340347 default:
341348 ret = -EINVAL;
342349 break;
@@ -723,6 +730,12 @@ static int smu_sw_init(void *handle) · 380 unmodified lines
723730 return ret;
724731 }
725732
733+ ret = smu_register_irq_handler(smu);
734+ if (ret) {
735+ pr_err("Failed to register smc irq handler!\n");
736+ return ret;
737+ }
738+
726739 return 0;
727740 }
728741
@@ -732,6 +745,9 @@ static int smu_sw_fini(void *handle) · 3 unmodified lines
732745 struct smu_context *smu = &adev->smu;
733746 int ret;
734747
748+ kfree(smu->irq_source);
749+ smu->irq_source = NULL;
750+
735751 ret = smu_smc_table_sw_fini(smu);
736752 if (ret) {
737753 pr_err("Failed to sw fini smc table!\n");
@@ -1088,10 +1104,6 @@ static int smu_hw_init(void *handle) · 350 unmodified lines
10881104 if (ret)
10891105 goto failed;
10901106
1091− ret = smu_register_irq_handler(smu);
1092− if (ret)
1093− goto failed;
1094−
10951107 if (!smu->pm_enabled)
10961108 adev->pm.dpm_enabled = false;
10971109 else
@@ -1121,9 +1133,6 @@ static int smu_hw_fini(void *handle) · 23 unmodified lines
11211133 kfree(table_context->overdrive_table);
11221134 table_context->overdrive_table = NULL;
11231135
1124− kfree(smu->irq_source);
1125− smu->irq_source = NULL;
1126−
11271136 ret = smu_fini_fb_allocations(smu);
11281137 if (ret)
11291138 return ret;
drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c+9−0
@@ -1111,6 +1111,7 @@ static int smu10_thermal_get_temperature(struct pp_hwmgr *hwmgr) · 1110 unmodified lines
11111111 static int smu10_read_sensor(struct pp_hwmgr *hwmgr, int idx,
11121112 void *value, int *size)
11131113 {
1114+ struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend);
11141115 uint32_t sclk, mclk;
11151116 int ret = 0;
11161117
@@ -1132,6 +1133,10 @@ static int smu10_read_sensor(struct pp_hwmgr *hwmgr, int idx, · 15 unmodified lines
11321133 case AMDGPU_PP_SENSOR_GPU_TEMP:
11331134 *((uint32_t *)value) = smu10_thermal_get_temperature(hwmgr);
11341135 break;
1136+ case AMDGPU_PP_SENSOR_VCN_POWER_STATE:
1137+ *(uint32_t *)value = smu10_data->vcn_power_gated ? 0 : 1;
1138+ *size = 4;
1139+ break;
11351140 default:
11361141 ret = -EINVAL;
11371142 break;
@@ -1175,18 +1180,22 @@ static int smu10_powergate_sdma(struct pp_hwmgr *hwmgr, bool gate) · 37 unmodified lines
11751180
11761181 static void smu10_powergate_vcn(struct pp_hwmgr *hwmgr, bool bgate)
11771182 {
1183+ struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend);
1184+
11781185 if (bgate) {
11791186 amdgpu_device_ip_set_powergating_state(hwmgr->adev,
11801187 AMD_IP_BLOCK_TYPE_VCN,
11811188 AMD_PG_STATE_GATE);
11821189 smum_send_msg_to_smc_with_parameter(hwmgr,
11831190 PPSMC_MSG_PowerDownVcn, 0);
1191+ smu10_data->vcn_power_gated = true;
11841192 } else {
11851193 smum_send_msg_to_smc_with_parameter(hwmgr,
11861194 PPSMC_MSG_PowerUpVcn, 0);
11871195 amdgpu_device_ip_set_powergating_state(hwmgr->adev,
11881196 AMD_IP_BLOCK_TYPE_VCN,
11891197 AMD_PG_STATE_UNGATE);
1198+ smu10_data->vcn_power_gated = false;
11901199 }
11911200 }
11921201
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h+1−1
@@ -429,7 +429,6 @@ struct smu_table_context · 428 unmodified lines
429429 struct smu_table *tables;
430430 uint32_t table_count;
431431 struct smu_table memory_pool;
432− uint16_t software_shutdown_temp;
433432 uint8_t thermal_controller_type;
434433 uint16_t TDPODLimit;
435434
@@ -452,6 +451,7 @@ struct smu_dpm_context { · 16 unmodified lines
452451 struct smu_power_gate {
453452 bool uvd_gated;
454453 bool vce_gated;
454+ bool vcn_gated;
455455 };
456456
457457 struct smu_power_context {
drivers/gpu/drm/amd/powerplay/navi10_ppt.c+68−31
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323
2424 #include "pp_debug.h"
2525 #include <linux/firmware.h>
26+#include <linux/pci.h>
2627 #include "amdgpu.h"
2728 #include "amdgpu_smu.h"
2829 #include "atomfirmware.h"
@@ -501,6 +502,8 @@ static int navi10_store_powerplay_table(struct smu_context *smu) · 472 unmodified lines
501502
502503 static int navi10_tables_init(struct smu_context *smu, struct smu_table *tables)
503504 {
505+ struct smu_table_context *smu_table = &smu->smu_table;
506+
504507 SMU_TABLE_INIT(tables, SMU_TABLE_PPTABLE, sizeof(PPTable_t),
505508 PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM);
506509 SMU_TABLE_INIT(tables, SMU_TABLE_WATERMARKS, sizeof(Watermarks_t),
@@ -515,9 +518,35 @@ static int navi10_tables_init(struct smu_context *smu, struct smu_table *tables) · 8 unmodified lines
515518 sizeof(DpmActivityMonitorCoeffInt_t), PAGE_SIZE,
516519 AMDGPU_GEM_DOMAIN_VRAM);
517520
521+ smu_table->metrics_table = kzalloc(sizeof(SmuMetrics_t), GFP_KERNEL);
522+ if (!smu_table->metrics_table)
523+ return -ENOMEM;
524+ smu_table->metrics_time = 0;
525+
518526 return 0;
519527 }
520528
529+static int navi10_get_metrics_table(struct smu_context *smu,
530+ SmuMetrics_t *metrics_table)
531+{
532+ struct smu_table_context *smu_table= &smu->smu_table;
533+ int ret = 0;
534+
535+ if (!smu_table->metrics_time || time_after(jiffies, smu_table->metrics_time + HZ / 1000)) {
536+ ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0,
537+ (void *)smu_table->metrics_table, false);
538+ if (ret) {
539+ pr_info("Failed to export SMU metrics table!\n");
540+ return ret;
541+ }
542+ smu_table->metrics_time = jiffies;
543+ }
544+
545+ memcpy(metrics_table, smu_table->metrics_table, sizeof(SmuMetrics_t));
546+
547+ return ret;
548+}
549+
521550 static int navi10_allocate_dpm_context(struct smu_context *smu)
522551 {
523552 struct smu_dpm_context *smu_dpm = &smu->smu_dpm;
@@ -576,44 +605,38 @@ static int navi10_set_default_dpm_table(struct smu_context *smu) · 52 unmodified lines
576605
577606 static int navi10_dpm_set_uvd_enable(struct smu_context *smu, bool enable)
578607 {
579− int ret = 0;
580608 struct smu_power_context *smu_power = &smu->smu_power;
581609 struct smu_power_gate *power_gate = &smu_power->power_gate;
610+ int ret = 0;
582611
583− if (enable && power_gate->uvd_gated) {
584− if (smu_feature_is_enabled(smu, SMU_FEATURE_DPM_UVD_BIT)) {
612+ if (enable) {
613+ /* vcn dpm on is a prerequisite for vcn power gate messages */
614+ if (smu_feature_is_enabled(smu, SMU_FEATURE_VCN_PG_BIT)) {
585615 ret = smu_send_smc_msg_with_param(smu, SMU_MSG_PowerUpVcn, 1);
586616 if (ret)
587617 return ret;
588618 }
589− power_gate->uvd_gated = false;
619+ power_gate->vcn_gated = false;
590620 } else {
591− if (!enable && !power_gate->uvd_gated) {
592− if (smu_feature_is_enabled(smu, SMU_FEATURE_DPM_UVD_BIT)) {
593− ret = smu_send_smc_msg(smu, SMU_MSG_PowerDownVcn);
594− if (ret)
595− return ret;
596− }
597− power_gate->uvd_gated = true;
621+ if (smu_feature_is_enabled(smu, SMU_FEATURE_VCN_PG_BIT)) {
622+ ret = smu_send_smc_msg(smu, SMU_MSG_PowerDownVcn);
623+ if (ret)
624+ return ret;
598625 }
626+ power_gate->vcn_gated = true;
599627 }
600628
601− return 0;
629+ return ret;
602630 }
603631
604632 static int navi10_get_current_clk_freq_by_table(struct smu_context *smu,
605633 enum smu_clk_type clk_type,
606634 uint32_t *value)
607635 {
608− static SmuMetrics_t metrics;
609636 int ret = 0, clk_id = 0;
637+ SmuMetrics_t metrics;
610638
611− if (!value)
612− return -EINVAL;
613−
614− memset(&metrics, 0, sizeof(metrics));
615−
616− ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0, (void *)&metrics, false);
639+ ret = navi10_get_metrics_table(smu, &metrics);
617640 if (ret)
618641 return ret;
619642
@@ -901,8 +924,9 @@ static int navi10_get_gpu_power(struct smu_context *smu, uint32_t *value) · 281 unmodified lines
901924 if (!value)
902925 return -EINVAL;
903926
904− ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0, (void *)&metrics,
905− false);
927+ ret = navi10_get_metrics_table(smu, &metrics);
928+ if (ret)
929+ return ret;
906930 if (ret)
907931 return ret;
908932
@@ -921,10 +945,7 @@ static int navi10_get_current_activity_percent(struct smu_context *smu, · 12 unmodified lines
921945 if (!value)
922946 return -EINVAL;
923947
924− msleep(1);
925−
926− ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0,
927− (void *)&metrics, false);
948+ ret = navi10_get_metrics_table(smu, &metrics);
928949 if (ret)
929950 return ret;
930951
@@ -963,10 +984,9 @@ static int navi10_get_fan_speed_rpm(struct smu_context *smu, · 32 unmodified lines
963984 if (!speed)
964985 return -EINVAL;
965986
966− memset(&metrics, 0, sizeof(metrics));
967−
968− ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0,
969− (void *)&metrics, false);
987+ ret = navi10_get_metrics_table(smu, &metrics);
988+ if (ret)
989+ return ret;
970990 if (ret)
971991 return ret;
972992
@@ -1314,7 +1334,7 @@ static int navi10_thermal_get_temperature(struct smu_context *smu, · 341 unmodified lines
13141334 if (!value)
13151335 return -EINVAL;
13161336
1317− ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0, (void *)&metrics, false);
1337+ ret = navi10_get_metrics_table(smu, &metrics);
13181338 if (ret)
13191339 return ret;
13201340
@@ -1573,7 +1593,7 @@ static int navi10_set_peak_clock_by_device(struct smu_context *smu) · 252 unmodified lines
15731593 uint32_t sclk_freq = 0, uclk_freq = 0;
15741594 uint32_t uclk_level = 0;
15751595
1576− switch (adev->rev_id) {
1596+ switch (adev->pdev->revision) {
15771597 case 0xf0: /* XTX */
15781598 case 0xc0:
15791599 sclk_freq = NAVI10_PEAK_SCLK_XTX;
@@ -1620,6 +1640,22 @@ static int navi10_set_performance_level(struct smu_context *smu, enum amd_dpm_fo · 40 unmodified lines
16201640 return ret;
16211641 }
16221642
1643+static int navi10_get_thermal_temperature_range(struct smu_context *smu,
1644+ struct smu_temperature_range *range)
1645+{
1646+ struct smu_table_context *table_context = &smu->smu_table;
1647+ struct smu_11_0_powerplay_table *powerplay_table = table_context->power_play_table;
1648+
1649+ if (!range || !powerplay_table)
1650+ return -EINVAL;
1651+
1652+ /* The unit is temperature */
1653+ range->min = 0;
1654+ range->max = powerplay_table->software_shutdown_temp;
1655+
1656+ return 0;
1657+}
1658+
16231659 static const struct pptable_funcs navi10_ppt_funcs = {
16241660 .tables_init = navi10_tables_init,
16251661 .alloc_dpm_context = navi10_allocate_dpm_context,
@@ -1657,6 +1693,7 @@ static const struct pptable_funcs navi10_ppt_funcs = { · 31 unmodified lines
16571693 .get_ppfeature_status = navi10_get_ppfeature_status,
16581694 .set_ppfeature_status = navi10_set_ppfeature_status,
16591695 .set_performance_level = navi10_set_performance_level,
1696+ .get_thermal_temperature_range = navi10_get_thermal_temperature_range,
16601697 };
16611698
16621699 void navi10_set_ppt_funcs(struct smu_context *smu)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c+22−16
@@ -1124,10 +1124,8 @@ static int smu_v11_0_set_thermal_range(struct smu_context *smu, · 1123 unmodified lines
11241124 struct smu_temperature_range *range)
11251125 {
11261126 struct amdgpu_device *adev = smu->adev;
1127− int low = SMU_THERMAL_MINIMUM_ALERT_TEMP *
1128− SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1129− int high = SMU_THERMAL_MAXIMUM_ALERT_TEMP *
1130− SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1127+ int low = SMU_THERMAL_MINIMUM_ALERT_TEMP;
1128+ int high = SMU_THERMAL_MAXIMUM_ALERT_TEMP;
11311129 uint32_t val;
11321130
11331131 if (!range)
@@ -1138,6 +1136,9 @@ static int smu_v11_0_set_thermal_range(struct smu_context *smu, · 4 unmodified lines
11381136 if (high > range->max)
11391137 high = range->max;
11401138
1139+ low = max(SMU_THERMAL_MINIMUM_ALERT_TEMP, range->min);
1140+ high = min(SMU_THERMAL_MAXIMUM_ALERT_TEMP, range->max);
1141+
11411142 if (low > high)
11421143 return -EINVAL;
11431144
@@ -1146,8 +1147,8 @@ static int smu_v11_0_set_thermal_range(struct smu_context *smu, · 2 unmodified lines
11461147 val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, THERM_IH_HW_ENA, 1);
11471148 val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, THERM_INTH_MASK, 0);
11481149 val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, THERM_INTL_MASK, 0);
1149− val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, DIG_THERM_INTH, (high / SMU_TEMPERATURE_UNITS_PER_CENTIGRADES));
1150− val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, DIG_THERM_INTL, (low / SMU_TEMPERATURE_UNITS_PER_CENTIGRADES));
1150+ val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, DIG_THERM_INTH, (high & 0xff));
1151+ val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, DIG_THERM_INTL, (low & 0xff));
11511152 val = val & (~THM_THERMAL_INT_CTRL__THERM_TRIGGER_MASK_MASK);
11521153
11531154 WREG32_SOC15(THM, 0, mmTHM_THERMAL_INT_CTRL, val);
@@ -1186,7 +1187,10 @@ static int smu_v11_0_start_thermal_control(struct smu_context *smu) · 32 unmodified lines
11861187
11871188 if (!smu->pm_enabled)
11881189 return ret;
1190+
11891191 ret = smu_get_thermal_temperature_range(smu, &range);
1192+ if (ret)
1193+ return ret;
11901194
11911195 if (smu->smu_table.thermal_controller_type) {
11921196 ret = smu_v11_0_set_thermal_range(smu, &range);
@@ -1202,15 +1206,17 @@ static int smu_v11_0_start_thermal_control(struct smu_context *smu) · 9 unmodified lines
12021206 return ret;
12031207 }
12041208
1205− adev->pm.dpm.thermal.min_temp = range.min;
1206− adev->pm.dpm.thermal.max_temp = range.max;
1207− adev->pm.dpm.thermal.max_edge_emergency_temp = range.edge_emergency_max;
1208− adev->pm.dpm.thermal.min_hotspot_temp = range.hotspot_min;
1209− adev->pm.dpm.thermal.max_hotspot_crit_temp = range.hotspot_crit_max;
1210− adev->pm.dpm.thermal.max_hotspot_emergency_temp = range.hotspot_emergency_max;
1211− adev->pm.dpm.thermal.min_mem_temp = range.mem_min;
1212− adev->pm.dpm.thermal.max_mem_crit_temp = range.mem_crit_max;
1213− adev->pm.dpm.thermal.max_mem_emergency_temp = range.mem_emergency_max;
1209+ adev->pm.dpm.thermal.min_temp = range.min * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1210+ adev->pm.dpm.thermal.max_temp = range.max * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1211+ adev->pm.dpm.thermal.max_edge_emergency_temp = range.edge_emergency_max * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1212+ adev->pm.dpm.thermal.min_hotspot_temp = range.hotspot_min * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1213+ adev->pm.dpm.thermal.max_hotspot_crit_temp = range.hotspot_crit_max * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1214+ adev->pm.dpm.thermal.max_hotspot_emergency_temp = range.hotspot_emergency_max * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1215+ adev->pm.dpm.thermal.min_mem_temp = range.mem_min * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1216+ adev->pm.dpm.thermal.max_mem_crit_temp = range.mem_crit_max * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1217+ adev->pm.dpm.thermal.max_mem_emergency_temp = range.mem_emergency_max * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1218+ adev->pm.dpm.thermal.min_temp = range.min * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1219+ adev->pm.dpm.thermal.max_temp = range.max * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
12141220
12151221 return ret;
12161222 }
@@ -1385,7 +1391,7 @@ smu_v11_0_smc_fan_control(struct smu_context *smu, bool start) · 168 unmodified lines
13851391 {
13861392 int ret = 0;
13871393
1388− if (smu_feature_is_supported(smu, SMU_FEATURE_FAN_CONTROL_BIT))
1394+ if (!smu_feature_is_supported(smu, SMU_FEATURE_FAN_CONTROL_BIT))
13891395 return 0;
13901396
13911397 ret = smu_feature_set_enabled(smu, SMU_FEATURE_FAN_CONTROL_BIT, start);
drivers/gpu/drm/amd/powerplay/vega20_ppt.c+11−23
@@ -450,7 +450,6 @@ static int vega20_store_powerplay_table(struct smu_context *smu) · 449 unmodified lines
450450 memcpy(table_context->driver_pptable, &powerplay_table->smcPPTable,
451451 sizeof(PPTable_t));
452452
453− table_context->software_shutdown_temp = powerplay_table->usSoftwareShutdownTemp;
454453 table_context->thermal_controller_type = powerplay_table->ucThermalControllerType;
455454 table_context->TDPODLimit = le32_to_cpu(powerplay_table->OverDrive8Table.ODSettingsMax[ATOM_VEGA20_ODSETTING_POWERPERCENTAGE]);
456455
@@ -3234,35 +3233,24 @@ static int vega20_set_watermarks_table(struct smu_context *smu, · 2777 unmodified lines
32343233 return 0;
32353234 }
32363235
3237−static const struct smu_temperature_range vega20_thermal_policy[] =
3238−{
3239− {-273150, 99000, 99000, -273150, 99000, 99000, -273150, 99000, 99000},
3240− { 120000, 120000, 120000, 120000, 120000, 120000, 120000, 120000, 120000},
3241−};
3242−
32433236 static int vega20_get_thermal_temperature_range(struct smu_context *smu,
32443237 struct smu_temperature_range *range)
32453238 {
3246−
3239+ struct smu_table_context *table_context = &smu->smu_table;
3240+ ATOM_Vega20_POWERPLAYTABLE *powerplay_table = table_context->power_play_table;
32473241 PPTable_t *pptable = smu->smu_table.driver_pptable;
32483242
3249− if (!range)
3243+ if (!range || !powerplay_table)
32503244 return -EINVAL;
32513245
3252− memcpy(range, &vega20_thermal_policy[0], sizeof(struct smu_temperature_range));
3253−
3254− range->max = pptable->TedgeLimit *
3255− SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
3256− range->edge_emergency_max = (pptable->TedgeLimit + CTF_OFFSET_EDGE) *
3257− SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
3258− range->hotspot_crit_max = pptable->ThotspotLimit *
3259− SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
3260− range->hotspot_emergency_max = (pptable->ThotspotLimit + CTF_OFFSET_HOTSPOT) *
3261− SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
3262− range->mem_crit_max = pptable->ThbmLimit *
3263− SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
3264− range->mem_emergency_max = (pptable->ThbmLimit + CTF_OFFSET_HBM)*
3265− SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
3246+ /* The unit is temperature */
3247+ range->min = 0;
3248+ range->max = powerplay_table->usSoftwareShutdownTemp;
3249+ range->edge_emergency_max = (pptable->TedgeLimit + CTF_OFFSET_EDGE);
3250+ range->hotspot_crit_max = pptable->ThotspotLimit;
3251+ range->hotspot_emergency_max = (pptable->ThotspotLimit + CTF_OFFSET_HOTSPOT);
3252+ range->mem_crit_max = pptable->ThbmLimit;
3253+ range->mem_emergency_max = (pptable->ThbmLimit + CTF_OFFSET_HBM);
32663254
32673255
32683256 return 0;
drivers/gpu/drm/bochs/bochs_kms.c+1−0
@@ -191,6 +191,7 @@ int bochs_kms_init(struct bochs_device *bochs) · 190 unmodified lines
191191 bochs->dev->mode_config.fb_base = bochs->fb_base;
192192 bochs->dev->mode_config.preferred_depth = 24;
193193 bochs->dev->mode_config.prefer_shadow = 0;
194+ bochs->dev->mode_config.prefer_shadow_fbdev = 1;
194195 bochs->dev->mode_config.quirk_addfb_prefer_host_byte_order = true;
195196
196197 bochs->dev->mode_config.funcs = &bochs_mode_funcs;
drivers/gpu/drm/bridge/Kconfig+3−1
@@ -48,6 +48,7 @@ config DRM_DUMB_VGA_DAC · 47 unmodified lines
4848 config DRM_LVDS_ENCODER
4949 tristate "Transparent parallel to LVDS encoder support"
5050 depends on OF
51+ select DRM_KMS_HELPER
5152 select DRM_PANEL_BRIDGE
5253 help
5354 Support for transparent parallel to LVDS encoders that don't require
@@ -116,9 +117,10 @@ config DRM_THINE_THC63LVD1024 · 62 unmodified lines
116117
117118 config DRM_TOSHIBA_TC358764
118119 tristate "TC358764 DSI/LVDS bridge"
119− depends on DRM && DRM_PANEL
120120 depends on OF
121121 select DRM_MIPI_DSI
122+ select DRM_KMS_HELPER
123+ select DRM_PANEL
122124 help
123125 Toshiba TC358764 DSI/LVDS bridge driver.
124126
drivers/gpu/drm/drm_client.c+49−11
@@ -254,7 +254,6 @@ drm_client_buffer_create(struct drm_client_dev *client, u32 width, u32 height, u · 253 unmodified lines
254254 struct drm_device *dev = client->dev;
255255 struct drm_client_buffer *buffer;
256256 struct drm_gem_object *obj;
257− void *vaddr;
258257 int ret;
259258
260259 buffer = kzalloc(sizeof(*buffer), GFP_KERNEL);
@@ -281,6 +280,36 @@ drm_client_buffer_create(struct drm_client_dev *client, u32 width, u32 height, u · 20 unmodified lines
281280
282281 buffer->gem = obj;
283282
283+ return buffer;
284+
285+err_delete:
286+ drm_client_buffer_delete(buffer);
287+
288+ return ERR_PTR(ret);
289+}
290+
291+/**
292+ * drm_client_buffer_vmap - Map DRM client buffer into address space
293+ * @buffer: DRM client buffer
294+ *
295+ * This function maps a client buffer into kernel address space. If the
296+ * buffer is already mapped, it returns the mapping's address.
297+ *
298+ * Client buffer mappings are not ref'counted. Each call to
299+ * drm_client_buffer_vmap() should be followed by a call to
300+ * drm_client_buffer_vunmap(); or the client buffer should be mapped
301+ * throughout its lifetime.
302+ *
303+ * Returns:
304+ * The mapped memory's address
305+ */
306+void *drm_client_buffer_vmap(struct drm_client_buffer *buffer)
307+{
308+ void *vaddr;
309+
310+ if (buffer->vaddr)
311+ return buffer->vaddr;
312+
284313 /*
285314 * FIXME: The dependency on GEM here isn't required, we could
286315 * convert the driver handle to a dma-buf instead and use the
@@ -289,21 +318,30 @@ drm_client_buffer_create(struct drm_client_dev *client, u32 width, u32 height, u · 2 unmodified lines
289318 * fd_install step out of the driver backend hooks, to make that
290319 * final step optional for internal users.
291320 */
292− vaddr = drm_gem_vmap(obj);
293− if (IS_ERR(vaddr)) {
294− ret = PTR_ERR(vaddr);
295− goto err_delete;
296− }
321+ vaddr = drm_gem_vmap(buffer->gem);
322+ if (IS_ERR(vaddr))
323+ return vaddr;
297324
298325 buffer->vaddr = vaddr;
299326
300− return buffer;
301−
302−err_delete:
303− drm_client_buffer_delete(buffer);
327+ return vaddr;
328+}
329+EXPORT_SYMBOL(drm_client_buffer_vmap);
304330
305− return ERR_PTR(ret);
331+/**
332+ * drm_client_buffer_vunmap - Unmap DRM client buffer
333+ * @buffer: DRM client buffer
334+ *
335+ * This function removes a client buffer's memory mapping. Calling this
336+ * function is only required by clients that manage their buffer mappings
337+ * by themselves.
338+ */
339+void drm_client_buffer_vunmap(struct drm_client_buffer *buffer)
340+{
341+ drm_gem_vunmap(buffer->gem, buffer->vaddr);
342+ buffer->vaddr = NULL;
306343 }
344+EXPORT_SYMBOL(drm_client_buffer_vunmap);
307345
308346 static void drm_client_buffer_rmfb(struct drm_client_buffer *buffer)
309347 {
drivers/gpu/drm/drm_fb_helper.c+40−11
@@ -403,6 +403,7 @@ static void drm_fb_helper_dirty_work(struct work_struct *work) · 402 unmodified lines
403403 struct drm_clip_rect *clip = &helper->dirty_clip;
404404 struct drm_clip_rect clip_copy;
405405 unsigned long flags;
406+ void *vaddr;
406407
407408 spin_lock_irqsave(&helper->dirty_lock, flags);
408409 clip_copy = *clip;
@@ -412,10 +413,20 @@ static void drm_fb_helper_dirty_work(struct work_struct *work) · 3 unmodified lines
412413
413414 /* call dirty callback only when it has been really touched */
414415 if (clip_copy.x1 < clip_copy.x2 && clip_copy.y1 < clip_copy.y2) {
416+
415417 /* Generic fbdev uses a shadow buffer */
416− if (helper->buffer)
418+ if (helper->buffer) {
419+ vaddr = drm_client_buffer_vmap(helper->buffer);
420+ if (IS_ERR(vaddr))
421+ return;
417422 drm_fb_helper_dirty_blit_real(helper, &clip_copy);
418− helper->fb->funcs->dirty(helper->fb, NULL, 0, 0, &clip_copy, 1);
423+ }
424+ if (helper->fb->funcs->dirty)
425+ helper->fb->funcs->dirty(helper->fb, NULL, 0, 0,
426+ &clip_copy, 1);
427+
428+ if (helper->buffer)
429+ drm_client_buffer_vunmap(helper->buffer);
419430 }
420431 }
421432
@@ -604,6 +615,16 @@ void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper) · 182 unmodified lines
604615 }
605616 EXPORT_SYMBOL(drm_fb_helper_unlink_fbi);
606617
618+static bool drm_fbdev_use_shadow_fb(struct drm_fb_helper *fb_helper)
619+{
620+ struct drm_device *dev = fb_helper->dev;
621+ struct drm_framebuffer *fb = fb_helper->fb;
622+
623+ return dev->mode_config.prefer_shadow_fbdev ||
624+ dev->mode_config.prefer_shadow ||
625+ fb->funcs->dirty;
626+}
627+
607628 static void drm_fb_helper_dirty(struct fb_info *info, u32 x, u32 y,
608629 u32 width, u32 height)
609630 {
@@ -611,7 +632,7 @@ static void drm_fb_helper_dirty(struct fb_info *info, u32 x, u32 y, · 1 unmodified line
611632 struct drm_clip_rect *clip = &helper->dirty_clip;
612633 unsigned long flags;
613634
614− if (!helper->fb->funcs->dirty)
635+ if (!drm_fbdev_use_shadow_fb(helper))
615636 return;
616637
617638 spin_lock_irqsave(&helper->dirty_lock, flags);
@@ -2178,6 +2199,7 @@ int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper, · 1560 unmodified lines
21782199 struct drm_framebuffer *fb;
21792200 struct fb_info *fbi;
21802201 u32 format;
2202+ void *vaddr;
21812203
21822204 DRM_DEBUG_KMS("surface width(%d), height(%d) and bpp(%d)\n",
21832205 sizes->surface_width, sizes->surface_height,
@@ -2200,16 +2222,10 @@ int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper, · 16 unmodified lines
22002222 fbi->fbops = &drm_fbdev_fb_ops;
22012223 fbi->screen_size = fb->height * fb->pitches[0];
22022224 fbi->fix.smem_len = fbi->screen_size;
2203− fbi->screen_buffer = buffer->vaddr;
2204− /* Shamelessly leak the physical address to user-space */
2205−#if IS_ENABLED(CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM)
2206− if (drm_leak_fbdev_smem && fbi->fix.smem_start == 0)
2207− fbi->fix.smem_start =
2208− page_to_phys(virt_to_page(fbi->screen_buffer));
2209−#endif
2225+
22102226 drm_fb_helper_fill_info(fbi, fb_helper, sizes);
22112227
2212− if (fb->funcs->dirty) {
2228+ if (drm_fbdev_use_shadow_fb(fb_helper)) {
22132229 struct fb_ops *fbops;
22142230 void *shadow;
22152231
@@ -2231,6 +2247,19 @@ int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper, · 15 unmodified lines
22312247 fbi->fbdefio = &drm_fbdev_defio;
22322248
22332249 fb_deferred_io_init(fbi);
2250+ } else {
2251+ /* buffer is mapped for HW framebuffer */
2252+ vaddr = drm_client_buffer_vmap(fb_helper->buffer);
2253+ if (IS_ERR(vaddr))
2254+ return PTR_ERR(vaddr);
2255+
2256+ fbi->screen_buffer = vaddr;
2257+ /* Shamelessly leak the physical address to user-space */
2258+#if IS_ENABLED(CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM)
2259+ if (drm_leak_fbdev_smem && fbi->fix.smem_start == 0)
2260+ fbi->fix.smem_start =
2261+ page_to_phys(virt_to_page(fbi->screen_buffer));
2262+#endif
22342263 }
22352264
22362265 return 0;
drivers/gpu/drm/drm_modes.c+3−1
@@ -1770,7 +1770,9 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option, · 1769 unmodified lines
17701770 }
17711771
17721772 if (named_mode) {
1773− strncpy(mode->name, name, mode_end);
1773+ if (mode_end + 1 > DRM_DISPLAY_MODE_LEN)
1774+ return false;
1775+ strscpy(mode->name, name, mode_end + 1);
17741776 } else {
17751777 ret = drm_mode_parse_cmdline_res_mode(name, mode_end,
17761778 parse_extras,
drivers/gpu/drm/exynos/Kconfig+1−0
@@ -2,6 +2,7 @@ · 1 unmodified line
22 config DRM_EXYNOS
33 tristate "DRM Support for Samsung SoC EXYNOS Series"
44 depends on OF && DRM && (ARCH_S3C64XX || ARCH_S5PV210 || ARCH_EXYNOS || ARCH_MULTIPLATFORM || COMPILE_TEST)
5+ depends on MMU
56 select DRM_KMS_HELPER
67 select VIDEOMODE_HELPERS
78 select SND_SOC_HDMI_CODEC if SND_SOC
drivers/gpu/drm/exynos/exynos_drm_fimc.c+1−1
@@ -44,7 +44,7 @@ static unsigned int fimc_mask = 0xc; · 43 unmodified lines
4444 module_param_named(fimc_devs, fimc_mask, uint, 0644);
4545 MODULE_PARM_DESC(fimc_devs, "Alias mask for assigning FIMC devices to Exynos DRM");
4646
47−#define get_fimc_context(dev) platform_get_drvdata(to_platform_device(dev))
47+#define get_fimc_context(dev) dev_get_drvdata(dev)
4848
4949 enum {
5050 FIMC_CLK_LCLK,
drivers/gpu/drm/exynos/exynos_drm_g2d.c+1−1
@@ -267,7 +267,7 @@ static inline void g2d_hw_reset(struct g2d_data *g2d) · 266 unmodified lines
267267 static int g2d_init_cmdlist(struct g2d_data *g2d)
268268 {
269269 struct device *dev = g2d->dev;
270− struct g2d_cmdlist_node *node = g2d->cmdlist_node;
270+ struct g2d_cmdlist_node *node;
271271 int nr;
272272 int ret;
273273 struct g2d_buf_info *buf_info;
drivers/gpu/drm/exynos/exynos_drm_gsc.c+1−1
@@ -58,7 +58,7 @@ · 57 unmodified lines
5858 #define GSC_COEF_DEPTH 3
5959 #define GSC_AUTOSUSPEND_DELAY 2000
6060
61−#define get_gsc_context(dev) platform_get_drvdata(to_platform_device(dev))
61+#define get_gsc_context(dev) dev_get_drvdata(dev)
6262 #define gsc_read(offset) readl(ctx->regs + (offset))
6363 #define gsc_write(cfg, offset) writel(cfg, ctx->regs + (offset))
6464
drivers/gpu/drm/exynos/exynos_drm_scaler.c+2−2
@@ -94,12 +94,12 @@ static inline int scaler_reset(struct scaler_context *scaler) · 93 unmodified lines
9494 scaler_write(SCALER_CFG_SOFT_RESET, SCALER_CFG);
9595 do {
9696 cpu_relax();
97− } while (retry > 1 &&
97+ } while (--retry > 1 &&
9898 scaler_read(SCALER_CFG) & SCALER_CFG_SOFT_RESET);
9999 do {
100100 cpu_relax();
101101 scaler_write(1, SCALER_INT_EN);
102− } while (retry > 0 && scaler_read(SCALER_INT_EN) != 1);
102+ } while (--retry > 0 && scaler_read(SCALER_INT_EN) != 1);
103103
104104 return retry ? 0 : -EIO;
105105 }
drivers/gpu/drm/i915/display/intel_bios.c+1−1
@@ -765,7 +765,7 @@ parse_psr(struct drm_i915_private *dev_priv, const struct bdb_header *bdb) · 764 unmodified lines
765765 }
766766
767767 if (bdb->version >= 226) {
768− u32 wakeup_time = psr_table->psr2_tp2_tp3_wakeup_time;
768+ u32 wakeup_time = psr->psr2_tp2_tp3_wakeup_time;
769769
770770 wakeup_time = (wakeup_time >> (2 * panel_type)) & 0x3;
771771 switch (wakeup_time) {
drivers/gpu/drm/i915/display/intel_bw.c+10−5
@@ -178,6 +178,8 @@ static int icl_get_bw_info(struct drm_i915_private *dev_priv) · 177 unmodified lines
178178 clpchgroup = (sa->deburst * deinterleave / num_channels) << i;
179179 bi->num_planes = (ipqdepth - clpchgroup) / clpchgroup + 1;
180180
181+ bi->num_qgv_points = qi.num_points;
182+
181183 for (j = 0; j < qi.num_points; j++) {
182184 const struct intel_qgv_point *sp = &qi.points[j];
183185 int ct, bw;
@@ -195,7 +197,7 @@ static int icl_get_bw_info(struct drm_i915_private *dev_priv) · 11 unmodified lines
195197 bi->deratedbw[j] = min(maxdebw,
196198 bw * 9 / 10); /* 90% */
197199
198− DRM_DEBUG_KMS("BW%d / QGV %d: num_planes=%d deratedbw=%d\n",
200+ DRM_DEBUG_KMS("BW%d / QGV %d: num_planes=%d deratedbw=%u\n",
199201 i, j, bi->num_planes, bi->deratedbw[j]);
200202 }
201203
@@ -211,14 +213,17 @@ static unsigned int icl_max_bw(struct drm_i915_private *dev_priv, · 9 unmodified lines
211213 {
212214 int i;
213215
214− /* Did we initialize the bw limits successfully? */
215− if (dev_priv->max_bw[0].num_planes == 0)
216− return UINT_MAX;
217−
218216 for (i = 0; i < ARRAY_SIZE(dev_priv->max_bw); i++) {
219217 const struct intel_bw_info *bi =
220218 &dev_priv->max_bw[i];
221219
220+ /*
221+ * Pcode will not expose all QGV points when
222+ * SAGV is forced to off/min/med/max.
223+ */
224+ if (qgv_point >= bi->num_qgv_points)
225+ return UINT_MAX;
226+
222227 if (num_planes >= bi->num_planes)
223228 return bi->deratedbw[qgv_point];
224229 }
drivers/gpu/drm/i915/display/intel_cdclk.c+11−0
@@ -2239,6 +2239,17 @@ int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state) · 2238 unmodified lines
22392239 if (crtc_state->has_audio && INTEL_GEN(dev_priv) >= 9)
22402240 min_cdclk = max(2 * 96000, min_cdclk);
22412241
2242+ /*
2243+ * "For DP audio configuration, cdclk frequency shall be set to
2244+ * meet the following requirements:
2245+ * DP Link Frequency(MHz) | Cdclk frequency(MHz)
2246+ * 270 | 320 or higher
2247+ * 162 | 200 or higher"
2248+ */
2249+ if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
2250+ intel_crtc_has_dp_encoder(crtc_state) && crtc_state->has_audio)
2251+ min_cdclk = max(crtc_state->port_clock, min_cdclk);
2252+
22422253 /*
22432254 * On Valleyview some DSI panels lose (v|h)sync when the clock is lower
22442255 * than 320000KHz.
drivers/gpu/drm/i915/display/intel_display.c+2−2
@@ -1839,7 +1839,7 @@ static void intel_enable_pipe(const struct intel_crtc_state *new_crtc_state) · 1838 unmodified lines
18391839 /* FIXME: assert CPU port conditions for SNB+ */
18401840 }
18411841
1842− trace_intel_pipe_enable(dev_priv, pipe);
1842+ trace_intel_pipe_enable(crtc);
18431843
18441844 reg = PIPECONF(cpu_transcoder);
18451845 val = I915_READ(reg);
@@ -1880,7 +1880,7 @@ static void intel_disable_pipe(const struct intel_crtc_state *old_crtc_state) · 34 unmodified lines
18801880 */
18811881 assert_planes_disabled(crtc);
18821882
1883− trace_intel_pipe_disable(dev_priv, pipe);
1883+ trace_intel_pipe_disable(crtc);
18841884
18851885 reg = PIPECONF(cpu_transcoder);
18861886 val = I915_READ(reg);
drivers/gpu/drm/i915/display/intel_display_power.c+9−2
@@ -438,16 +438,23 @@ icl_combo_phy_aux_power_well_disable(struct drm_i915_private *dev_priv, · 437 unmodified lines
438438 #define ICL_AUX_PW_TO_CH(pw_idx) \
439439 ((pw_idx) - ICL_PW_CTL_IDX_AUX_A + AUX_CH_A)
440440
441+#define ICL_TBT_AUX_PW_TO_CH(pw_idx) \
442+ ((pw_idx) - ICL_PW_CTL_IDX_AUX_TBT1 + AUX_CH_C)
443+
441444 static void
442445 icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,
443446 struct i915_power_well *power_well)
444447 {
445− enum aux_ch aux_ch = ICL_AUX_PW_TO_CH(power_well->desc->hsw.idx);
448+ int pw_idx = power_well->desc->hsw.idx;
449+ bool is_tbt = power_well->desc->hsw.is_tc_tbt;
450+ enum aux_ch aux_ch;
446451 u32 val;
447452
453+ aux_ch = is_tbt ? ICL_TBT_AUX_PW_TO_CH(pw_idx) :
454+ ICL_AUX_PW_TO_CH(pw_idx);
448455 val = I915_READ(DP_AUX_CH_CTL(aux_ch));
449456 val &= ~DP_AUX_CH_CTL_TBT_IO;
450− if (power_well->desc->hsw.is_tc_tbt)
457+ if (is_tbt)
451458 val |= DP_AUX_CH_CTL_TBT_IO;
452459 I915_WRITE(DP_AUX_CH_CTL(aux_ch), val);
453460
drivers/gpu/drm/i915/display/intel_hdcp.c+2−1
@@ -536,7 +536,8 @@ int intel_hdcp_auth_downstream(struct intel_connector *connector) · 535 unmodified lines
536536
537537 if (drm_hdcp_check_ksvs_revoked(dev, ksv_fifo, num_downstream)) {
538538 DRM_ERROR("Revoked Ksv(s) in ksv_fifo\n");
539− return -EPERM;
539+ ret = -EPERM;
540+ goto err;
540541 }
541542
542543 /*
drivers/gpu/drm/i915/display/intel_vbt_defs.h+3−3
@@ -478,13 +478,13 @@ struct psr_table { · 477 unmodified lines
478478 /* TP wake up time in multiple of 100 */
479479 u16 tp1_wakeup_time;
480480 u16 tp2_tp3_wakeup_time;
481−
482− /* PSR2 TP2/TP3 wakeup time for 16 panels */
483− u32 psr2_tp2_tp3_wakeup_time;
484481 } __packed;
485482
486483 struct bdb_psr {
487484 struct psr_table psr_table[16];
485+
486+ /* PSR2 TP2/TP3 wakeup time for 16 panels */
487+ u32 psr2_tp2_tp3_wakeup_time;
488488 } __packed;
489489
490490 /*
drivers/gpu/drm/i915/display/vlv_dsi_pll.c+2−2
@@ -396,8 +396,8 @@ static void glk_dsi_program_esc_clock(struct drm_device *dev, · 395 unmodified lines
396396 else
397397 txesc2_div = 10;
398398
399− I915_WRITE(MIPIO_TXESC_CLK_DIV1, txesc1_div & GLK_TX_ESC_CLK_DIV1_MASK);
400− I915_WRITE(MIPIO_TXESC_CLK_DIV2, txesc2_div & GLK_TX_ESC_CLK_DIV2_MASK);
399+ I915_WRITE(MIPIO_TXESC_CLK_DIV1, (1 << (txesc1_div - 1)) & GLK_TX_ESC_CLK_DIV1_MASK);
400+ I915_WRITE(MIPIO_TXESC_CLK_DIV2, (1 << (txesc2_div - 1)) & GLK_TX_ESC_CLK_DIV2_MASK);
401401 }
402402
403403 /* Program BXT Mipi clocks and dividers */
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c+9−11
@@ -1628,6 +1628,7 @@ static int check_relocations(const struct drm_i915_gem_exec_object2 *entry) · 1627 unmodified lines
16281628
16291629 static int eb_copy_relocations(const struct i915_execbuffer *eb)
16301630 {
1631+ struct drm_i915_gem_relocation_entry *relocs;
16311632 const unsigned int count = eb->buffer_count;
16321633 unsigned int i;
16331634 int err;
@@ -1635,7 +1636,6 @@ static int eb_copy_relocations(const struct i915_execbuffer *eb) · 1 unmodified line
16351636 for (i = 0; i < count; i++) {
16361637 const unsigned int nreloc = eb->exec[i].relocation_count;
16371638 struct drm_i915_gem_relocation_entry __user *urelocs;
1638− struct drm_i915_gem_relocation_entry *relocs;
16391639 unsigned long size;
16401640 unsigned long copied;
16411641
@@ -1663,14 +1663,8 @@ static int eb_copy_relocations(const struct i915_execbuffer *eb) · 21 unmodified lines
16631663
16641664 if (__copy_from_user((char *)relocs + copied,
16651665 (char __user *)urelocs + copied,
1666− len)) {
1667−end_user:
1668− user_access_end();
1669−end:
1670− kvfree(relocs);
1671− err = -EFAULT;
1672− goto err;
1673− }
1666+ len))
1667+ goto end;
16741668
16751669 copied += len;
16761670 } while (copied < size);
@@ -1699,10 +1693,14 @@ end: · 22 unmodified lines
16991693
17001694 return 0;
17011695
1696+end_user:
1697+ user_access_end();
1698+end:
1699+ kvfree(relocs);
1700+ err = -EFAULT;
17021701 err:
17031702 while (i--) {
1704− struct drm_i915_gem_relocation_entry *relocs =
1705− u64_to_ptr(typeof(*relocs), eb->exec[i].relocs_ptr);
1703+ relocs = u64_to_ptr(typeof(*relocs), eb->exec[i].relocs_ptr);
17061704 if (eb->exec[i].relocation_count)
17071705 kvfree(relocs);
17081706 }
drivers/gpu/drm/i915/gem/i915_gem_pm.c+4−3
@@ -253,14 +253,15 @@ void i915_gem_resume(struct drm_i915_private *i915) · 252 unmodified lines
253253 i915_gem_restore_gtt_mappings(i915);
254254 i915_gem_restore_fences(i915);
255255
256+ if (i915_gem_init_hw(i915))
257+ goto err_wedged;
258+
256259 /*
257260 * As we didn't flush the kernel context before suspend, we cannot
258261 * guarantee that the context image is complete. So let's just reset
259262 * it and start again.
260263 */
261− intel_gt_resume(i915);
262−
263− if (i915_gem_init_hw(i915))
264+ if (intel_gt_resume(i915))
264265 goto err_wedged;
265266
266267 intel_uc_resume(i915);
drivers/gpu/drm/i915/gem/i915_gem_userptr.c+9−1
@@ -664,7 +664,15 @@ i915_gem_userptr_put_pages(struct drm_i915_gem_object *obj, · 663 unmodified lines
664664
665665 for_each_sgt_page(page, sgt_iter, pages) {
666666 if (obj->mm.dirty)
667− set_page_dirty(page);
667+ /*
668+ * As this may not be anonymous memory (e.g. shmem)
669+ * but exist on a real mapping, we have to lock
670+ * the page in order to dirty it -- holding
671+ * the page reference is not sufficient to
672+ * prevent the inode from being truncated.
673+ * Play safe and take the lock.
674+ */
675+ set_page_dirty_lock(page);
668676
669677 mark_page_accessed(page);
670678 put_page(page);
drivers/gpu/drm/i915/gt/intel_context.c+18−9
@@ -126,6 +126,7 @@ static void intel_context_retire(struct i915_active *active) · 125 unmodified lines
126126 if (ce->state)
127127 __context_unpin_state(ce->state);
128128
129+ intel_ring_unpin(ce->ring);
129130 intel_context_put(ce);
130131 }
131132
@@ -160,27 +161,35 @@ int intel_context_active_acquire(struct intel_context *ce, unsigned long flags) · 28 unmodified lines
160161
161162 intel_context_get(ce);
162163
164+ err = intel_ring_pin(ce->ring);
165+ if (err)
166+ goto err_put;
167+
163168 if (!ce->state)
164169 return 0;
165170
166171 err = __context_pin_state(ce->state, flags);
167− if (err) {
168− i915_active_cancel(&ce->active);
169− intel_context_put(ce);
170− return err;
171− }
172+ if (err)
173+ goto err_ring;
172174
173175 /* Preallocate tracking nodes */
174176 if (!i915_gem_context_is_kernel(ce->gem_context)) {
175177 err = i915_active_acquire_preallocate_barrier(&ce->active,
176178 ce->engine);
177− if (err) {
178− i915_active_release(&ce->active);
179− return err;
180− }
179+ if (err)
180+ goto err_state;
181181 }
182182
183183 return 0;
184+
185+err_state:
186+ __context_unpin_state(ce->state);
187+err_ring:
188+ intel_ring_unpin(ce->ring);
189+err_put:
190+ intel_context_put(ce);
191+ i915_active_cancel(&ce->active);
192+ return err;
184193 }
185194
186195 void intel_context_active_release(struct intel_context *ce)
drivers/gpu/drm/i915/gt/intel_engine_cs.c+11−9
@@ -969,9 +969,14 @@ const char *i915_cache_level_str(struct drm_i915_private *i915, int type) · 968 unmodified lines
969969 u32 intel_calculate_mcr_s_ss_select(struct drm_i915_private *dev_priv)
970970 {
971971 const struct sseu_dev_info *sseu = &RUNTIME_INFO(dev_priv)->sseu;
972+ unsigned int slice = fls(sseu->slice_mask) - 1;
973+ unsigned int subslice;
972974 u32 mcr_s_ss_select;
973− u32 slice = fls(sseu->slice_mask);
974− u32 subslice = fls(sseu->subslice_mask[slice]);
975+
976+ GEM_BUG_ON(slice >= ARRAY_SIZE(sseu->subslice_mask));
977+ subslice = fls(sseu->subslice_mask[slice]);
978+ GEM_BUG_ON(!subslice);
979+ subslice--;
975980
976981 if (IS_GEN(dev_priv, 10))
977982 mcr_s_ss_select = GEN8_MCR_SLICE(slice) |
@@ -1471,6 +1476,7 @@ void intel_engine_dump(struct intel_engine_cs *engine, · 493 unmodified lines
14711476 struct i915_gpu_error * const error = &engine->i915->gpu_error;
14721477 struct i915_request *rq;
14731478 intel_wakeref_t wakeref;
1479+ unsigned long flags;
14741480
14751481 if (header) {
14761482 va_list ap;
@@ -1490,10 +1496,9 @@ void intel_engine_dump(struct intel_engine_cs *engine, · 13 unmodified lines
14901496 i915_reset_engine_count(error, engine),
14911497 i915_reset_count(error));
14921498
1493− rcu_read_lock();
1494−
14951499 drm_printf(m, "\tRequests:\n");
14961500
1501+ spin_lock_irqsave(&engine->active.lock, flags);
14971502 rq = intel_engine_find_active_request(engine);
14981503 if (rq) {
14991504 print_request(m, rq, "\t\tactive ");
@@ -1513,8 +1518,7 @@ void intel_engine_dump(struct intel_engine_cs *engine, · 13 unmodified lines
15131518
15141519 print_request_ring(m, rq);
15151520 }
1516−
1517− rcu_read_unlock();
1521+ spin_unlock_irqrestore(&engine->active.lock, flags);
15181522
15191523 wakeref = intel_runtime_pm_get_if_in_use(&engine->i915->runtime_pm);
15201524 if (wakeref) {
@@ -1672,7 +1676,6 @@ struct i915_request * · 151 unmodified lines
16721676 intel_engine_find_active_request(struct intel_engine_cs *engine)
16731677 {
16741678 struct i915_request *request, *active = NULL;
1675− unsigned long flags;
16761679
16771680 /*
16781681 * We are called by the error capture, reset and to dump engine
@@ -1685,7 +1688,7 @@ intel_engine_find_active_request(struct intel_engine_cs *engine) · 6 unmodified lines
16851688 * At all other times, we must assume the GPU is still running, but
16861689 * we only care about the snapshot of this moment.
16871690 */
1688− spin_lock_irqsave(&engine->active.lock, flags);
1691+ lockdep_assert_held(&engine->active.lock);
16891692 list_for_each_entry(request, &engine->active.requests, sched.link) {
16901693 if (i915_request_completed(request))
16911694 continue;
@@ -1700,7 +1703,6 @@ intel_engine_find_active_request(struct intel_engine_cs *engine) · 8 unmodified lines
17001703 active = request;
17011704 break;
17021705 }
1703− spin_unlock_irqrestore(&engine->active.lock, flags);
17041706
17051707 return active;
17061708 }
drivers/gpu/drm/i915/gt/intel_engine_pm.c+0−24
@@ -142,27 +142,3 @@ void intel_engine_init__pm(struct intel_engine_cs *engine) · 141 unmodified lines
142142 {
143143 intel_wakeref_init(&engine->wakeref);
144144 }
145−
146−int intel_engines_resume(struct drm_i915_private *i915)
147−{
148− struct intel_engine_cs *engine;
149− enum intel_engine_id id;
150− int err = 0;
151−
152− intel_gt_pm_get(i915);
153− for_each_engine(engine, i915, id) {
154− intel_engine_pm_get(engine);
155− engine->serial++; /* kernel context lost */
156− err = engine->resume(engine);
157− intel_engine_pm_put(engine);
158− if (err) {
159− dev_err(i915->drm.dev,
160− "Failed to restart %s (%d)\n",
161− engine->name, err);
162− break;
163− }
164− }
165− intel_gt_pm_put(i915);
166−
167− return err;
168−}
drivers/gpu/drm/i915/gt/intel_engine_pm.h+9−3
@@ -7,16 +7,22 @@ · 6 unmodified lines
77 #ifndef INTEL_ENGINE_PM_H
88 #define INTEL_ENGINE_PM_H
99
10+#include "intel_engine_types.h"
11+#include "intel_wakeref.h"
12+
1013 struct drm_i915_private;
11−struct intel_engine_cs;
1214
1315 void intel_engine_pm_get(struct intel_engine_cs *engine);
1416 void intel_engine_pm_put(struct intel_engine_cs *engine);
1517
18+static inline bool
19+intel_engine_pm_get_if_awake(struct intel_engine_cs *engine)
20+{
21+ return intel_wakeref_get_if_active(&engine->wakeref);
22+}
23+
1624 void intel_engine_park(struct intel_engine_cs *engine);
1725
1826 void intel_engine_init__pm(struct intel_engine_cs *engine);
1927
20−int intel_engines_resume(struct drm_i915_private *i915);
21−
2228 #endif /* INTEL_ENGINE_PM_H */
drivers/gpu/drm/i915/gt/intel_engine_types.h+12−0
@@ -70,6 +70,18 @@ struct intel_ring { · 69 unmodified lines
7070 struct list_head request_list;
7171 struct list_head active_link;
7272
73+ /*
74+ * As we have two types of rings, one global to the engine used
75+ * by ringbuffer submission and those that are exclusive to a
76+ * context used by execlists, we have to play safe and allow
77+ * atomic updates to the pin_count. However, the actual pinning
78+ * of the context is either done during initialisation for
79+ * ringbuffer submission or serialised as part of the context
80+ * pinning for execlists, and so we do not need a mutex ourselves
81+ * to serialise intel_ring_pin/intel_ring_unpin.
82+ */
83+ atomic_t pin_count;
84+
7385 u32 head;
7486 u32 tail;
7587 u32 emit;
drivers/gpu/drm/i915/gt/intel_gt_pm.c+20−1
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 */
66
77 #include "i915_drv.h"
8+#include "intel_engine_pm.h"
89 #include "intel_gt_pm.h"
910 #include "intel_pm.h"
1011 #include "intel_wakeref.h"
@@ -118,10 +119,11 @@ void intel_gt_sanitize(struct drm_i915_private *i915, bool force) · 107 unmodified lines
118119 intel_engine_reset(engine, false);
119120 }
120121
121−void intel_gt_resume(struct drm_i915_private *i915)
122+int intel_gt_resume(struct drm_i915_private *i915)
122123 {
123124 struct intel_engine_cs *engine;
124125 enum intel_engine_id id;
126+ int err = 0;
125127
126128 /*
127129 * After resume, we may need to poke into the pinned kernel
@@ -129,9 +131,12 @@ void intel_gt_resume(struct drm_i915_private *i915) · 1 unmodified line
129131 * Only the kernel contexts should remain pinned over suspend,
130132 * allowing us to fixup the user contexts on their first pin.
131133 */
134+ intel_gt_pm_get(i915);
132135 for_each_engine(engine, i915, id) {
133136 struct intel_context *ce;
134137
138+ intel_engine_pm_get(engine);
139+
135140 ce = engine->kernel_context;
136141 if (ce)
137142 ce->ops->reset(ce);
@@ -139,5 +144,19 @@ void intel_gt_resume(struct drm_i915_private *i915) · 1 unmodified line
139144 ce = engine->preempt_context;
140145 if (ce)
141146 ce->ops->reset(ce);
147+
148+ engine->serial++; /* kernel context lost */
149+ err = engine->resume(engine);
150+
151+ intel_engine_pm_put(engine);
152+ if (err) {
153+ dev_err(i915->drm.dev,
154+ "Failed to restart %s (%d)\n",
155+ engine->name, err);
156+ break;
157+ }
142158 }
159+ intel_gt_pm_put(i915);
160+
161+ return err;
143162 }
drivers/gpu/drm/i915/gt/intel_gt_pm.h+1−1
@@ -22,6 +22,6 @@ void intel_gt_pm_put(struct drm_i915_private *i915); · 21 unmodified lines
2222 void intel_gt_pm_init(struct drm_i915_private *i915);
2323
2424 void intel_gt_sanitize(struct drm_i915_private *i915, bool force);
25−void intel_gt_resume(struct drm_i915_private *i915);
25+int intel_gt_resume(struct drm_i915_private *i915);
2626
2727 #endif /* INTEL_GT_PM_H */
drivers/gpu/drm/i915/gt/intel_lrc.c+2−8
@@ -1414,6 +1414,7 @@ static void execlists_context_destroy(struct kref *kref) · 1413 unmodified lines
14141414 {
14151415 struct intel_context *ce = container_of(kref, typeof(*ce), ref);
14161416
1417+ GEM_BUG_ON(!i915_active_is_idle(&ce->active));
14171418 GEM_BUG_ON(intel_context_is_pinned(ce));
14181419
14191420 if (ce->state)
@@ -1426,7 +1427,6 @@ static void execlists_context_unpin(struct intel_context *ce) · 6 unmodified lines
14261427 {
14271428 i915_gem_context_unpin_hw_id(ce->gem_context);
14281429 i915_gem_object_unpin_map(ce->state->obj);
1429− intel_ring_unpin(ce->ring);
14301430 }
14311431
14321432 static void
@@ -1478,13 +1478,9 @@ __execlists_context_pin(struct intel_context *ce, · 45 unmodified lines
14781478 goto unpin_active;
14791479 }
14801480
1481− ret = intel_ring_pin(ce->ring);
1482− if (ret)
1483− goto unpin_map;
1484−
14851481 ret = i915_gem_context_pin_hw_id(ce->gem_context);
14861482 if (ret)
1487− goto unpin_ring;
1483+ goto unpin_map;
14881484
14891485 ce->lrc_desc = lrc_descriptor(ce, engine);
14901486 ce->lrc_reg_state = vaddr + LRC_STATE_PN * PAGE_SIZE;
@@ -1492,8 +1488,6 @@ __execlists_context_pin(struct intel_context *ce, · 1 unmodified line
14921488
14931489 return 0;
14941490
1495−unpin_ring:
1496− intel_ring_unpin(ce->ring);
14971491 unpin_map:
14981492 i915_gem_object_unpin_map(ce->state->obj);
14991493 unpin_active:
drivers/gpu/drm/i915/gt/intel_reset.c+42−16
@@ -687,7 +687,6 @@ static void reset_prepare_engine(struct intel_engine_cs *engine) · 686 unmodified lines
687687 * written to the powercontext is undefined and so we may lose
688688 * GPU state upon resume, i.e. fail to restart after a reset.
689689 */
690− intel_engine_pm_get(engine);
691690 intel_uncore_forcewake_get(engine->uncore, FORCEWAKE_ALL);
692691 engine->reset.prepare(engine);
693692 }
@@ -718,16 +717,21 @@ static void revoke_mmaps(struct drm_i915_private *i915) · 24 unmodified lines
718717 }
719718 }
720719
721−static void reset_prepare(struct drm_i915_private *i915)
720+static intel_engine_mask_t reset_prepare(struct drm_i915_private *i915)
722721 {
723722 struct intel_engine_cs *engine;
723+ intel_engine_mask_t awake = 0;
724724 enum intel_engine_id id;
725725
726− intel_gt_pm_get(i915);
727− for_each_engine(engine, i915, id)
726+ for_each_engine(engine, i915, id) {
727+ if (intel_engine_pm_get_if_awake(engine))
728+ awake |= engine->mask;
728729 reset_prepare_engine(engine);
730+ }
729731
730732 intel_uc_reset_prepare(i915);
733+
734+ return awake;
731735 }
732736
733737 static void gt_revoke(struct drm_i915_private *i915)
@@ -761,20 +765,22 @@ static int gt_reset(struct drm_i915_private *i915, · 27 unmodified lines
761765 static void reset_finish_engine(struct intel_engine_cs *engine)
762766 {
763767 engine->reset.finish(engine);
764− intel_engine_pm_put(engine);
765768 intel_uncore_forcewake_put(engine->uncore, FORCEWAKE_ALL);
769+
770+ intel_engine_signal_breadcrumbs(engine);
766771 }
767772
768−static void reset_finish(struct drm_i915_private *i915)
773+static void reset_finish(struct drm_i915_private *i915,
774+ intel_engine_mask_t awake)
769775 {
770776 struct intel_engine_cs *engine;
771777 enum intel_engine_id id;
772778
773779 for_each_engine(engine, i915, id) {
774780 reset_finish_engine(engine);
775− intel_engine_signal_breadcrumbs(engine);
781+ if (awake & engine->mask)
782+ intel_engine_pm_put(engine);
776783 }
777− intel_gt_pm_put(i915);
778784 }
779785
780786 static void nop_submit_request(struct i915_request *request)
@@ -798,6 +804,7 @@ static void __i915_gem_set_wedged(struct drm_i915_private *i915) · 17 unmodified lines
798804 {
799805 struct i915_gpu_error *error = &i915->gpu_error;
800806 struct intel_engine_cs *engine;
807+ intel_engine_mask_t awake;
801808 enum intel_engine_id id;
802809
803810 if (test_bit(I915_WEDGED, &error->flags))
@@ -817,7 +824,7 @@ static void __i915_gem_set_wedged(struct drm_i915_private *i915) · 13 unmodified lines
817824 * rolling the global seqno forward (since this would complete requests
818825 * for which we haven't set the fence error to EIO yet).
819826 */
820− reset_prepare(i915);
827+ awake = reset_prepare(i915);
821828
822829 /* Even if the GPU reset fails, it should still stop the engines */
823830 if (!INTEL_INFO(i915)->gpu_reset_clobbers_display)
@@ -841,7 +848,7 @@ static void __i915_gem_set_wedged(struct drm_i915_private *i915) · 17 unmodified lines
841848 for_each_engine(engine, i915, id)
842849 engine->cancel_requests(engine);
843850
844− reset_finish(i915);
851+ reset_finish(i915, awake);
845852
846853 GEM_TRACE("end\n");
847854 }
@@ -951,6 +958,21 @@ static int do_reset(struct drm_i915_private *i915, · 103 unmodified lines
951958 return gt_reset(i915, stalled_mask);
952959 }
953960
961+static int resume(struct drm_i915_private *i915)
962+{
963+ struct intel_engine_cs *engine;
964+ enum intel_engine_id id;
965+ int ret;
966+
967+ for_each_engine(engine, i915, id) {
968+ ret = engine->resume(engine);
969+ if (ret)
970+ return ret;
971+ }
972+
973+ return 0;
974+}
975+
954976 /**
955977 * i915_reset - reset chip after a hang
956978 * @i915: #drm_i915_private to reset
@@ -973,6 +995,7 @@ void i915_reset(struct drm_i915_private *i915, · 16 unmodified lines
973995 const char *reason)
974996 {
975997 struct i915_gpu_error *error = &i915->gpu_error;
998+ intel_engine_mask_t awake;
976999 int ret;
9771000
9781001 GEM_TRACE("flags=%lx\n", error->flags);
@@ -989,7 +1012,7 @@ void i915_reset(struct drm_i915_private *i915, · 10 unmodified lines
9891012 dev_notice(i915->drm.dev, "Resetting chip for %s\n", reason);
9901013 error->reset_count++;
9911014
992− reset_prepare(i915);
1015+ awake = reset_prepare(i915);
9931016
9941017 if (!intel_has_gpu_reset(i915)) {
9951018 if (i915_modparams.reset)
@@ -1024,13 +1047,17 @@ void i915_reset(struct drm_i915_private *i915, · 28 unmodified lines
10241047 if (ret) {
10251048 DRM_ERROR("Failed to initialise HW following reset (%d)\n",
10261049 ret);
1027− goto error;
1050+ goto taint;
10281051 }
10291052
1053+ ret = resume(i915);
1054+ if (ret)
1055+ goto taint;
1056+
10301057 i915_queue_hangcheck(i915);
10311058
10321059 finish:
1033− reset_finish(i915);
1060+ reset_finish(i915, awake);
10341061 unlock:
10351062 mutex_unlock(&error->wedge_mutex);
10361063 return;
@@ -1081,7 +1108,7 @@ int i915_reset_engine(struct intel_engine_cs *engine, const char *msg) · 44 unmodified lines
10811108 GEM_TRACE("%s flags=%lx\n", engine->name, error->flags);
10821109 GEM_BUG_ON(!test_bit(I915_RESET_ENGINE + engine->id, &error->flags));
10831110
1084− if (!intel_wakeref_active(&engine->wakeref))
1111+ if (!intel_engine_pm_get_if_awake(engine))
10851112 return 0;
10861113
10871114 reset_prepare_engine(engine);
@@ -1116,12 +1143,11 @@ int i915_reset_engine(struct intel_engine_cs *engine, const char *msg) · 28 unmodified lines
11161143 * process to program RING_MODE, HWSP and re-enable submission.
11171144 */
11181145 ret = engine->resume(engine);
1119− if (ret)
1120− goto out;
11211146
11221147 out:
11231148 intel_engine_cancel_stop_cs(engine);
11241149 reset_finish_engine(engine);
1150+ intel_engine_pm_put(engine);
11251151 return ret;
11261152 }
11271153
drivers/gpu/drm/i915/gt/intel_ringbuffer.c+20−11
@@ -1149,16 +1149,16 @@ i915_emit_bb_start(struct i915_request *rq, · 1148 unmodified lines
11491149 int intel_ring_pin(struct intel_ring *ring)
11501150 {
11511151 struct i915_vma *vma = ring->vma;
1152− enum i915_map_type map = i915_coherent_map_type(vma->vm->i915);
11531152 unsigned int flags;
11541153 void *addr;
11551154 int ret;
11561155
1157− GEM_BUG_ON(ring->vaddr);
1156+ if (atomic_fetch_inc(&ring->pin_count))
1157+ return 0;
11581158
11591159 ret = i915_timeline_pin(ring->timeline);
11601160 if (ret)
1161− return ret;
1161+ goto err_unpin;
11621162
11631163 flags = PIN_GLOBAL;
11641164
@@ -1172,26 +1172,31 @@ int intel_ring_pin(struct intel_ring *ring) · 7 unmodified lines
11721172
11731173 ret = i915_vma_pin(vma, 0, 0, flags);
11741174 if (unlikely(ret))
1175− goto unpin_timeline;
1175+ goto err_timeline;
11761176
11771177 if (i915_vma_is_map_and_fenceable(vma))
11781178 addr = (void __force *)i915_vma_pin_iomap(vma);
11791179 else
1180− addr = i915_gem_object_pin_map(vma->obj, map);
1180+ addr = i915_gem_object_pin_map(vma->obj,
1181+ i915_coherent_map_type(vma->vm->i915));
11811182 if (IS_ERR(addr)) {
11821183 ret = PTR_ERR(addr);
1183− goto unpin_ring;
1184+ goto err_ring;
11841185 }
11851186
11861187 vma->obj->pin_global++;
11871188
1189+ GEM_BUG_ON(ring->vaddr);
11881190 ring->vaddr = addr;
1191+
11891192 return 0;
11901193
1191−unpin_ring:
1194+err_ring:
11921195 i915_vma_unpin(vma);
1193−unpin_timeline:
1196+err_timeline:
11941197 i915_timeline_unpin(ring->timeline);
1198+err_unpin:
1199+ atomic_dec(&ring->pin_count);
11951200 return ret;
11961201 }
11971202
@@ -1207,16 +1212,19 @@ void intel_ring_reset(struct intel_ring *ring, u32 tail) · 9 unmodified lines
12071212
12081213 void intel_ring_unpin(struct intel_ring *ring)
12091214 {
1210− GEM_BUG_ON(!ring->vma);
1211− GEM_BUG_ON(!ring->vaddr);
1215+ if (!atomic_dec_and_test(&ring->pin_count))
1216+ return;
12121217
12131218 /* Discard any unused bytes beyond that submitted to hw. */
12141219 intel_ring_reset(ring, ring->tail);
12151220
1221+ GEM_BUG_ON(!ring->vma);
12161222 if (i915_vma_is_map_and_fenceable(ring->vma))
12171223 i915_vma_unpin_iomap(ring->vma);
12181224 else
12191225 i915_gem_object_unpin_map(ring->vma->obj);
1226+
1227+ GEM_BUG_ON(!ring->vaddr);
12201228 ring->vaddr = NULL;
12211229
12221230 ring->vma->obj->pin_global--;
@@ -2081,10 +2089,11 @@ static void ring_destroy(struct intel_engine_cs *engine) · 858 unmodified lines
20812089 WARN_ON(INTEL_GEN(dev_priv) > 2 &&
20822090 (ENGINE_READ(engine, RING_MI_MODE) & MODE_IDLE) == 0);
20832091
2092+ intel_engine_cleanup_common(engine);
2093+
20842094 intel_ring_unpin(engine->buffer);
20852095 intel_ring_put(engine->buffer);
20862096
2087− intel_engine_cleanup_common(engine);
20882097 kfree(engine);
20892098 }
20902099
drivers/gpu/drm/i915/gt/intel_workarounds.c+35−3
@@ -1098,10 +1098,25 @@ static void glk_whitelist_build(struct intel_engine_cs *engine) · 1097 unmodified lines
10981098
10991099 static void cfl_whitelist_build(struct intel_engine_cs *engine)
11001100 {
1101+ struct i915_wa_list *w = &engine->whitelist;
1102+
11011103 if (engine->class != RENDER_CLASS)
11021104 return;
11031105
1104− gen9_whitelist_build(&engine->whitelist);
1106+ gen9_whitelist_build(w);
1107+
1108+ /*
1109+ * WaAllowPMDepthAndInvocationCountAccessFromUMD:cfl,whl,cml,aml
1110+ *
1111+ * This covers 4 register which are next to one another :
1112+ * - PS_INVOCATION_COUNT
1113+ * - PS_INVOCATION_COUNT_UDW
1114+ * - PS_DEPTH_COUNT
1115+ * - PS_DEPTH_COUNT_UDW
1116+ */
1117+ whitelist_reg_ext(w, PS_INVOCATION_COUNT,
1118+ RING_FORCE_TO_NONPRIV_RD |
1119+ RING_FORCE_TO_NONPRIV_RANGE_4);
11051120 }
11061121
11071122 static void cnl_whitelist_build(struct intel_engine_cs *engine)
@@ -1129,6 +1144,19 @@ static void icl_whitelist_build(struct intel_engine_cs *engine) · 21 unmodified lines
11291144
11301145 /* WaEnableStateCacheRedirectToCS:icl */
11311146 whitelist_reg(w, GEN9_SLICE_COMMON_ECO_CHICKEN1);
1147+
1148+ /*
1149+ * WaAllowPMDepthAndInvocationCountAccessFromUMD:icl
1150+ *
1151+ * This covers 4 register which are next to one another :
1152+ * - PS_INVOCATION_COUNT
1153+ * - PS_INVOCATION_COUNT_UDW
1154+ * - PS_DEPTH_COUNT
1155+ * - PS_DEPTH_COUNT_UDW
1156+ */
1157+ whitelist_reg_ext(w, PS_INVOCATION_COUNT,
1158+ RING_FORCE_TO_NONPRIV_RD |
1159+ RING_FORCE_TO_NONPRIV_RANGE_4);
11321160 break;
11331161
11341162 case VIDEO_DECODE_CLASS:
@@ -1258,8 +1286,12 @@ rcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal) · 123 unmodified lines
12581286 if (IS_ICL_REVID(i915, ICL_REVID_A0, ICL_REVID_B0))
12591287 wa_write_or(wal,
12601288 GEN7_SARCHKMD,
1261− GEN7_DISABLE_DEMAND_PREFETCH |
1262− GEN7_DISABLE_SAMPLER_PREFETCH);
1289+ GEN7_DISABLE_DEMAND_PREFETCH);
1290+
1291+ /* Wa_1606682166:icl */
1292+ wa_write_or(wal,
1293+ GEN7_SARCHKMD,
1294+ GEN7_DISABLE_SAMPLER_PREFETCH);
12631295 }
12641296
12651297 if (IS_GEN_RANGE(i915, 9, 11)) {
drivers/gpu/drm/i915/gt/mock_engine.c+1−0
@@ -66,6 +66,7 @@ static struct intel_ring *mock_ring(struct intel_engine_cs *engine) · 65 unmodified lines
6666 ring->base.effective_size = sz;
6767 ring->base.vaddr = (void *)(ring + 1);
6868 ring->base.timeline = &ring->timeline;
69+ atomic_set(&ring->base.pin_count, 1);
6970
7071 INIT_LIST_HEAD(&ring->base.request_list);
7172 intel_ring_update_space(&ring->base);
drivers/gpu/drm/i915/gt/selftest_reset.c+4−1
@@ -71,13 +71,16 @@ static int igt_atomic_reset(void *arg) · 70 unmodified lines
7171 goto unlock;
7272
7373 for (p = igt_atomic_phases; p->name; p++) {
74+ intel_engine_mask_t awake;
75+
7476 GEM_TRACE("intel_gpu_reset under %s\n", p->name);
7577
78+ awake = reset_prepare(i915);
7679 p->critical_section_begin();
7780 reset_prepare(i915);
7881 err = intel_gpu_reset(i915, ALL_ENGINES);
79− reset_finish(i915);
8082 p->critical_section_end();
83+ reset_finish(i915, awake);
8184
8285 if (err) {
8386 pr_err("intel_gpu_reset failed under %s\n", p->name);
drivers/gpu/drm/i915/gt/selftest_workarounds.c+6−1
@@ -925,7 +925,12 @@ check_whitelisted_registers(struct intel_engine_cs *engine, · 924 unmodified lines
925925
926926 err = 0;
927927 for (i = 0; i < engine->whitelist.count; i++) {
928− if (!fn(engine, a[i], b[i], engine->whitelist.list[i].reg))
928+ const struct i915_wa *wa = &engine->whitelist.list[i];
929+
930+ if (i915_mmio_reg_offset(wa->reg) & RING_FORCE_TO_NONPRIV_RD)
931+ continue;
932+
933+ if (!fn(engine, a[i], b[i], wa->reg))
929934 err = -EINVAL;
930935 }
931936
drivers/gpu/drm/i915/gvt/cmd_parser.c+0−10
@@ -2674,11 +2674,6 @@ static int scan_workload(struct intel_vgpu_workload *workload) · 2673 unmodified lines
26742674 gma_head == gma_tail)
26752675 return 0;
26762676
2677− if (!intel_gvt_ggtt_validate_range(s.vgpu, s.ring_start, s.ring_size)) {
2678− ret = -EINVAL;
2679− goto out;
2680− }
2681−
26822677 ret = ip_gma_set(&s, gma_head);
26832678 if (ret)
26842679 goto out;
@@ -2724,11 +2719,6 @@ static int scan_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx) · 39 unmodified lines
27242719 s.workload = workload;
27252720 s.is_ctx_wa = true;
27262721
2727− if (!intel_gvt_ggtt_validate_range(s.vgpu, s.ring_start, s.ring_size)) {
2728− ret = -EINVAL;
2729− goto out;
2730− }
2731−
27322722 ret = ip_gma_set(&s, gma_head);
27332723 if (ret)
27342724 goto out;
drivers/gpu/drm/i915/gvt/fb_decoder.c+3−3
@@ -245,7 +245,7 @@ int intel_vgpu_decode_primary_plane(struct intel_vgpu *vgpu, · 244 unmodified lines
245245 plane->hw_format = fmt;
246246
247247 plane->base = vgpu_vreg_t(vgpu, DSPSURF(pipe)) & I915_GTT_PAGE_MASK;
248− if (!intel_gvt_ggtt_validate_range(vgpu, plane->base, 0))
248+ if (!vgpu_gmadr_is_valid(vgpu, plane->base))
249249 return -EINVAL;
250250
251251 plane->base_gpa = intel_vgpu_gma_to_gpa(vgpu->gtt.ggtt_mm, plane->base);
@@ -368,7 +368,7 @@ int intel_vgpu_decode_cursor_plane(struct intel_vgpu *vgpu, · 116 unmodified lines
368368 alpha_plane, alpha_force);
369369
370370 plane->base = vgpu_vreg_t(vgpu, CURBASE(pipe)) & I915_GTT_PAGE_MASK;
371− if (!intel_gvt_ggtt_validate_range(vgpu, plane->base, 0))
371+ if (!vgpu_gmadr_is_valid(vgpu, plane->base))
372372 return -EINVAL;
373373
374374 plane->base_gpa = intel_vgpu_gma_to_gpa(vgpu->gtt.ggtt_mm, plane->base);
@@ -472,7 +472,7 @@ int intel_vgpu_decode_sprite_plane(struct intel_vgpu *vgpu, · 97 unmodified lines
472472 plane->drm_format = drm_format;
473473
474474 plane->base = vgpu_vreg_t(vgpu, SPRSURF(pipe)) & I915_GTT_PAGE_MASK;
475− if (!intel_gvt_ggtt_validate_range(vgpu, plane->base, 0))
475+ if (!vgpu_gmadr_is_valid(vgpu, plane->base))
476476 return -EINVAL;
477477
478478 plane->base_gpa = intel_vgpu_gma_to_gpa(vgpu->gtt.ggtt_mm, plane->base);
drivers/gpu/drm/i915/gvt/gtt.c+9−0
@@ -2141,11 +2141,20 @@ static int emulate_ggtt_mmio_read(struct intel_vgpu *vgpu, · 2140 unmodified lines
21412141 struct intel_vgpu_mm *ggtt_mm = vgpu->gtt.ggtt_mm;
21422142 const struct intel_gvt_device_info *info = &vgpu->gvt->device_info;
21432143 unsigned long index = off >> info->gtt_entry_size_shift;
2144+ unsigned long gma;
21442145 struct intel_gvt_gtt_entry e;
21452146
21462147 if (bytes != 4 && bytes != 8)
21472148 return -EINVAL;
21482149
2150+ gma = index << I915_GTT_PAGE_SHIFT;
2151+ if (!intel_gvt_ggtt_validate_range(vgpu,
2152+ gma, 1 << I915_GTT_PAGE_SHIFT)) {
2153+ gvt_dbg_mm("read invalid ggtt at 0x%lx\n", gma);
2154+ memset(p_data, 0, bytes);
2155+ return 0;
2156+ }
2157+
21492158 ggtt_get_guest_entry(ggtt_mm, &e, index);
21502159 memcpy(p_data, (void *)&e.val64 + (off & (info->gtt_entry_size - 1)),
21512160 bytes);
drivers/gpu/drm/i915/gvt/kvmgt.c+12−0
@@ -1904,6 +1904,18 @@ static int kvmgt_dma_map_guest_page(unsigned long handle, unsigned long gfn, · 1903 unmodified lines
19041904
19051905 entry = __gvt_cache_find_gfn(info->vgpu, gfn);
19061906 if (!entry) {
1907+ ret = gvt_dma_map_page(vgpu, gfn, dma_addr, size);
1908+ if (ret)
1909+ goto err_unlock;
1910+
1911+ ret = __gvt_cache_add(info->vgpu, gfn, *dma_addr, size);
1912+ if (ret)
1913+ goto err_unmap;
1914+ } else if (entry->size != size) {
1915+ /* the same gfn with different size: unmap and re-map */
1916+ gvt_dma_unmap_page(vgpu, gfn, entry->dma_addr, entry->size);
1917+ __gvt_cache_remove_entry(vgpu, entry);
1918+
19071919 ret = gvt_dma_map_page(vgpu, gfn, dma_addr, size);
19081920 if (ret)
19091921 goto err_unlock;
drivers/gpu/drm/i915/gvt/scheduler.c+44−15
@@ -364,16 +364,13 @@ static void release_shadow_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx) · 363 unmodified lines
364364 wa_ctx->indirect_ctx.shadow_va = NULL;
365365 }
366366
367−static int set_context_ppgtt_from_shadow(struct intel_vgpu_workload *workload,
368− struct i915_gem_context *ctx)
367+static void set_context_ppgtt_from_shadow(struct intel_vgpu_workload *workload,
368+ struct i915_gem_context *ctx)
369369 {
370370 struct intel_vgpu_mm *mm = workload->shadow_mm;
371371 struct i915_ppgtt *ppgtt = i915_vm_to_ppgtt(ctx->vm);
372372 int i = 0;
373373
374− if (mm->type != INTEL_GVT_MM_PPGTT || !mm->ppgtt_mm.shadowed)
375− return -EINVAL;
376−
377374 if (mm->ppgtt_mm.root_entry_type == GTT_TYPE_PPGTT_ROOT_L4_ENTRY) {
378375 px_dma(ppgtt->pd) = mm->ppgtt_mm.shadow_pdps[0];
379376 } else {
@@ -384,8 +381,6 @@ static int set_context_ppgtt_from_shadow(struct intel_vgpu_workload *workload, · 4 unmodified lines
384381 px_dma(pd) = mm->ppgtt_mm.shadow_pdps[i];
385382 }
386383 }
387−
388− return 0;
389384 }
390385
391386 static int
@@ -614,6 +609,8 @@ static void release_shadow_batch_buffer(struct intel_vgpu_workload *workload) · 222 unmodified lines
614609 static int prepare_workload(struct intel_vgpu_workload *workload)
615610 {
616611 struct intel_vgpu *vgpu = workload->vgpu;
612+ struct intel_vgpu_submission *s = &vgpu->submission;
613+ int ring = workload->ring_id;
617614 int ret = 0;
618615
619616 ret = intel_vgpu_pin_mm(workload->shadow_mm);
@@ -622,8 +619,16 @@ static int prepare_workload(struct intel_vgpu_workload *workload) · 2 unmodified lines
622619 return ret;
623620 }
624621
622+ if (workload->shadow_mm->type != INTEL_GVT_MM_PPGTT ||
623+ !workload->shadow_mm->ppgtt_mm.shadowed) {
624+ gvt_vgpu_err("workload shadow ppgtt isn't ready\n");
625+ return -EINVAL;
626+ }
627+
625628 update_shadow_pdps(workload);
626629
630+ set_context_ppgtt_from_shadow(workload, s->shadow[ring]->gem_context);
631+
627632 ret = intel_vgpu_sync_oos_pages(workload->vgpu);
628633 if (ret) {
629634 gvt_vgpu_err("fail to vgpu sync oos pages\n");
@@ -674,7 +679,6 @@ static int dispatch_workload(struct intel_vgpu_workload *workload) · 44 unmodified lines
674679 {
675680 struct intel_vgpu *vgpu = workload->vgpu;
676681 struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;
677− struct intel_vgpu_submission *s = &vgpu->submission;
678682 struct i915_request *rq;
679683 int ring_id = workload->ring_id;
680684 int ret;
@@ -685,13 +689,6 @@ static int dispatch_workload(struct intel_vgpu_workload *workload) · 4 unmodified lines
685689 mutex_lock(&vgpu->vgpu_lock);
686690 mutex_lock(&dev_priv->drm.struct_mutex);
687691
688− ret = set_context_ppgtt_from_shadow(workload,
689− s->shadow[ring_id]->gem_context);
690− if (ret < 0) {
691− gvt_vgpu_err("workload shadow ppgtt isn't ready\n");
692− goto err_req;
693− }
694−
695692 ret = intel_gvt_workload_req_alloc(workload);
696693 if (ret)
697694 goto err_req;
@@ -990,6 +987,7 @@ static int workload_thread(void *priv) · 292 unmodified lines
990987 int ret;
991988 bool need_force_wake = (INTEL_GEN(gvt->dev_priv) >= 9);
992989 DEFINE_WAIT_FUNC(wait, woken_wake_function);
990+ struct intel_runtime_pm *rpm = &gvt->dev_priv->runtime_pm;
993991
994992 kfree(p);
995993
@@ -1013,6 +1011,8 @@ static int workload_thread(void *priv) · 17 unmodified lines
10131011 workload->ring_id, workload,
10141012 workload->vgpu->id);
10151013
1014+ intel_runtime_pm_get(rpm);
1015+
10161016 gvt_dbg_sched("ring id %d will dispatch workload %p\n",
10171017 workload->ring_id, workload);
10181018
@@ -1042,6 +1042,7 @@ complete: · 23 unmodified lines
10421042 intel_uncore_forcewake_put(&gvt->dev_priv->uncore,
10431043 FORCEWAKE_ALL);
10441044
1045+ intel_runtime_pm_put_unchecked(rpm);
10451046 if (ret && (vgpu_is_vm_unhealthy(ret)))
10461047 enter_failsafe_mode(vgpu, GVT_FAILSAFE_GUEST_ERR);
10471048 }
@@ -1492,6 +1493,12 @@ intel_vgpu_create_workload(struct intel_vgpu *vgpu, int ring_id, · 444 unmodified lines
14921493 intel_gvt_hypervisor_read_gpa(vgpu, ring_context_gpa +
14931494 RING_CTX_OFF(ctx_ctrl.val), &ctx_ctl, 4);
14941495
1496+ if (!intel_gvt_ggtt_validate_range(vgpu, start,
1497+ _RING_CTL_BUF_SIZE(ctl))) {
1498+ gvt_vgpu_err("context contain invalid rb at: 0x%x\n", start);
1499+ return ERR_PTR(-EINVAL);
1500+ }
1501+
14951502 workload = alloc_workload(vgpu);
14961503 if (IS_ERR(workload))
14971504 return workload;
@@ -1516,9 +1523,31 @@ intel_vgpu_create_workload(struct intel_vgpu *vgpu, int ring_id, · 18 unmodified lines
15161523 workload->wa_ctx.indirect_ctx.size =
15171524 (indirect_ctx & INDIRECT_CTX_SIZE_MASK) *
15181525 CACHELINE_BYTES;
1526+
1527+ if (workload->wa_ctx.indirect_ctx.size != 0) {
1528+ if (!intel_gvt_ggtt_validate_range(vgpu,
1529+ workload->wa_ctx.indirect_ctx.guest_gma,
1530+ workload->wa_ctx.indirect_ctx.size)) {
1531+ kmem_cache_free(s->workloads, workload);
1532+ gvt_vgpu_err("invalid wa_ctx at: 0x%lx\n",
1533+ workload->wa_ctx.indirect_ctx.guest_gma);
1534+ return ERR_PTR(-EINVAL);
1535+ }
1536+ }
1537+
15191538 workload->wa_ctx.per_ctx.guest_gma =
15201539 per_ctx & PER_CTX_ADDR_MASK;
15211540 workload->wa_ctx.per_ctx.valid = per_ctx & 1;
1541+ if (workload->wa_ctx.per_ctx.valid) {
1542+ if (!intel_gvt_ggtt_validate_range(vgpu,
1543+ workload->wa_ctx.per_ctx.guest_gma,
1544+ CACHELINE_BYTES)) {
1545+ kmem_cache_free(s->workloads, workload);
1546+ gvt_vgpu_err("invalid per_ctx at: 0x%lx\n",
1547+ workload->wa_ctx.per_ctx.guest_gma);
1548+ return ERR_PTR(-EINVAL);
1549+ }
1550+ }
15221551 }
15231552
15241553 gvt_dbg_el("workload %p ring id %d head %x tail %x start %x ctl %x\n",
drivers/gpu/drm/i915/gvt/trace_points.c+0−2
@@ -28,8 +28,6 @@ · 27 unmodified lines
2828 *
2929 */
3030
31−#include "trace.h"
32−
3331 #ifndef __CHECKER__
3432 #define CREATE_TRACE_POINTS
3533 #include "trace.h"
drivers/gpu/drm/i915/i915_drv.h+3−2
@@ -1674,8 +1674,9 @@ struct drm_i915_private { · 1673 unmodified lines
16741674 } dram_info;
16751675
16761676 struct intel_bw_info {
1677− int num_planes;
1678− int deratedbw[3];
1677+ unsigned int deratedbw[3]; /* for each QGV point */
1678+ u8 num_qgv_points;
1679+ u8 num_planes;
16791680 } max_bw[6];
16801681
16811682 struct drm_private_obj bw_obj;
drivers/gpu/drm/i915/i915_gem.c+11−14
@@ -46,7 +46,6 @@ · 45 unmodified lines
4646 #include "gem/i915_gem_ioctls.h"
4747 #include "gem/i915_gem_pm.h"
4848 #include "gem/i915_gemfs.h"
49−#include "gt/intel_engine_pm.h"
5049 #include "gt/intel_gt_pm.h"
5150 #include "gt/intel_mocs.h"
5251 #include "gt/intel_reset.h"
@@ -1307,21 +1306,13 @@ int i915_gem_init_hw(struct drm_i915_private *dev_priv) · 1254 unmodified lines
13071306
13081307 intel_mocs_init_l3cc_table(dev_priv);
13091308
1310− /* Only when the HW is re-initialised, can we replay the requests */
1311− ret = intel_engines_resume(dev_priv);
1312− if (ret)
1313− goto cleanup_uc;
1314−
13151309 intel_uncore_forcewake_put(&dev_priv->uncore, FORCEWAKE_ALL);
13161310
13171311 intel_engines_set_scheduler_caps(dev_priv);
13181312 return 0;
13191313
1320−cleanup_uc:
1321− intel_uc_fini_hw(dev_priv);
13221314 out:
13231315 intel_uncore_forcewake_put(&dev_priv->uncore, FORCEWAKE_ALL);
1324−
13251316 return ret;
13261317 }
13271318
@@ -1580,6 +1571,11 @@ int i915_gem_init(struct drm_i915_private *dev_priv) · 252 unmodified lines
15801571 if (ret)
15811572 goto err_uc_init;
15821573
1574+ /* Only when the HW is re-initialised, can we replay the requests */
1575+ ret = intel_gt_resume(dev_priv);
1576+ if (ret)
1577+ goto err_init_hw;
1578+
15831579 /*
15841580 * Despite its name intel_init_clock_gating applies both display
15851581 * clock gating workarounds; GT mmio workarounds and the occasional
@@ -1593,20 +1589,20 @@ int i915_gem_init(struct drm_i915_private *dev_priv) · 7 unmodified lines
15931589
15941590 ret = intel_engines_verify_workarounds(dev_priv);
15951591 if (ret)
1596− goto err_init_hw;
1592+ goto err_gt;
15971593
15981594 ret = __intel_engines_record_defaults(dev_priv);
15991595 if (ret)
1600− goto err_init_hw;
1596+ goto err_gt;
16011597
16021598 if (i915_inject_load_failure()) {
16031599 ret = -ENODEV;
1604− goto err_init_hw;
1600+ goto err_gt;
16051601 }
16061602
16071603 if (i915_inject_load_failure()) {
16081604 ret = -EIO;
1609− goto err_init_hw;
1605+ goto err_gt;
16101606 }
16111607
16121608 intel_uncore_forcewake_put(&dev_priv->uncore, FORCEWAKE_ALL);
@@ -1620,7 +1616,7 @@ int i915_gem_init(struct drm_i915_private *dev_priv) · 7 unmodified lines
16201616 * HW as irrevisibly wedged, but keep enough state around that the
16211617 * driver doesn't explode during runtime.
16221618 */
1623−err_init_hw:
1619+err_gt:
16241620 mutex_unlock(&dev_priv->drm.struct_mutex);
16251621
16261622 i915_gem_set_wedged(dev_priv);
@@ -1630,6 +1626,7 @@ err_init_hw: · 3 unmodified lines
16301626 i915_gem_drain_workqueue(dev_priv);
16311627
16321628 mutex_lock(&dev_priv->drm.struct_mutex);
1629+err_init_hw:
16331630 intel_uc_fini_hw(dev_priv);
16341631 err_uc_init:
16351632 intel_uc_fini(dev_priv);
drivers/gpu/drm/i915/i915_gem_gtt.c+6−2
@@ -1444,9 +1444,11 @@ unwind_pd: · 1443 unmodified lines
14441444 spin_lock(&pdp->lock);
14451445 if (atomic_dec_and_test(&pd->used)) {
14461446 gen8_ppgtt_set_pdpe(pdp, vm->scratch_pd, pdpe);
1447+ pdp->entry[pdpe] = vm->scratch_pd;
14471448 GEM_BUG_ON(!atomic_read(&pdp->used));
14481449 atomic_dec(&pdp->used);
1449− free_pd(vm, pd);
1450+ GEM_BUG_ON(alloc);
1451+ alloc = pd; /* defer the free to after the lock */
14501452 }
14511453 spin_unlock(&pdp->lock);
14521454 unwind:
@@ -1515,7 +1517,9 @@ unwind_pdp: · 62 unmodified lines
15151517 spin_lock(&pml4->lock);
15161518 if (atomic_dec_and_test(&pdp->used)) {
15171519 gen8_ppgtt_set_pml4e(pml4, vm->scratch_pdp, pml4e);
1518− free_pd(vm, pdp);
1520+ pml4->entry[pml4e] = vm->scratch_pdp;
1521+ GEM_BUG_ON(alloc);
1522+ alloc = pdp; /* defer the free until after the lock */
15191523 }
15201524 spin_unlock(&pml4->lock);
15211525 unwind:
drivers/gpu/drm/i915/i915_gpu_error.c+4−2
@@ -1418,6 +1418,7 @@ static void gem_record_rings(struct i915_gpu_state *error) · 1417 unmodified lines
14181418 struct intel_engine_cs *engine = i915->engine[i];
14191419 struct drm_i915_error_engine *ee = &error->engine[i];
14201420 struct i915_request *request;
1421+ unsigned long flags;
14211422
14221423 ee->engine_id = -1;
14231424
@@ -1429,10 +1430,11 @@ static void gem_record_rings(struct i915_gpu_state *error) · 5 unmodified lines
14291430 error_record_engine_registers(error, engine, ee);
14301431 error_record_engine_execlists(engine, ee);
14311432
1433+ spin_lock_irqsave(&engine->active.lock, flags);
14321434 request = intel_engine_find_active_request(engine);
14331435 if (request) {
14341436 struct i915_gem_context *ctx = request->gem_context;
1435− struct intel_ring *ring;
1437+ struct intel_ring *ring = request->ring;
14361438
14371439 ee->vm = ctx->vm ?: &ggtt->vm;
14381440
@@ -1462,7 +1464,6 @@ static void gem_record_rings(struct i915_gpu_state *error) · 23 unmodified lines
14621464 ee->rq_post = request->postfix;
14631465 ee->rq_tail = request->tail;
14641466
1465− ring = request->ring;
14661467 ee->cpu_ring_head = ring->head;
14671468 ee->cpu_ring_tail = ring->tail;
14681469 ee->ringbuffer =
@@ -1470,6 +1471,7 @@ static void gem_record_rings(struct i915_gpu_state *error) · 1 unmodified line
14701471
14711472 engine_record_requests(engine, request, ee);
14721473 }
1474+ spin_unlock_irqrestore(&engine->active.lock, flags);
14731475
14741476 ee->hws_page =
14751477 i915_error_object_create(i915,
drivers/gpu/drm/i915/i915_perf.c+43−24
@@ -1567,28 +1567,10 @@ static void config_oa_regs(struct drm_i915_private *dev_priv, · 1566 unmodified lines
15671567 }
15681568 }
15691569
1570−static int hsw_enable_metric_set(struct i915_perf_stream *stream)
1570+static void delay_after_mux(void)
15711571 {
1572− struct drm_i915_private *dev_priv = stream->dev_priv;
1573− const struct i915_oa_config *oa_config = stream->oa_config;
1574−
1575− /* PRM:
1576− *
1577− * OA unit is using “crclk” for its functionality. When trunk
1578− * level clock gating takes place, OA clock would be gated,
1579− * unable to count the events from non-render clock domain.
1580− * Render clock gating must be disabled when OA is enabled to
1581− * count the events from non-render domain. Unit level clock
1582− * gating for RCS should also be disabled.
1583− */
1584− I915_WRITE(GEN7_MISCCPCTL, (I915_READ(GEN7_MISCCPCTL) &
1585− ~GEN7_DOP_CLOCK_GATE_ENABLE));
1586− I915_WRITE(GEN6_UCGCTL1, (I915_READ(GEN6_UCGCTL1) |
1587− GEN6_CSUNIT_CLOCK_GATE_DISABLE));
1588−
1589− config_oa_regs(dev_priv, oa_config->mux_regs, oa_config->mux_regs_len);
1590−
1591− /* It apparently takes a fairly long time for a new MUX
1572+ /*
1573+ * It apparently takes a fairly long time for a new MUX
15921574 * configuration to be be applied after these register writes.
15931575 * This delay duration was derived empirically based on the
15941576 * render_basic config but hopefully it covers the maximum
@@ -1610,6 +1592,30 @@ static int hsw_enable_metric_set(struct i915_perf_stream *stream) · 15 unmodified lines
16101592 * a delay at this location would mitigate any invalid reports.
16111593 */
16121594 usleep_range(15000, 20000);
1595+}
1596+
1597+static int hsw_enable_metric_set(struct i915_perf_stream *stream)
1598+{
1599+ struct drm_i915_private *dev_priv = stream->dev_priv;
1600+ const struct i915_oa_config *oa_config = stream->oa_config;
1601+
1602+ /*
1603+ * PRM:
1604+ *
1605+ * OA unit is using “crclk” for its functionality. When trunk
1606+ * level clock gating takes place, OA clock would be gated,
1607+ * unable to count the events from non-render clock domain.
1608+ * Render clock gating must be disabled when OA is enabled to
1609+ * count the events from non-render domain. Unit level clock
1610+ * gating for RCS should also be disabled.
1611+ */
1612+ I915_WRITE(GEN7_MISCCPCTL, (I915_READ(GEN7_MISCCPCTL) &
1613+ ~GEN7_DOP_CLOCK_GATE_ENABLE));
1614+ I915_WRITE(GEN6_UCGCTL1, (I915_READ(GEN6_UCGCTL1) |
1615+ GEN6_CSUNIT_CLOCK_GATE_DISABLE));
1616+
1617+ config_oa_regs(dev_priv, oa_config->mux_regs, oa_config->mux_regs_len);
1618+ delay_after_mux();
16131619
16141620 config_oa_regs(dev_priv, oa_config->b_counter_regs,
16151621 oa_config->b_counter_regs_len);
@@ -1835,6 +1841,7 @@ static int gen8_enable_metric_set(struct i915_perf_stream *stream) · 219 unmodified lines
18351841 return ret;
18361842
18371843 config_oa_regs(dev_priv, oa_config->mux_regs, oa_config->mux_regs_len);
1844+ delay_after_mux();
18381845
18391846 config_oa_regs(dev_priv, oa_config->b_counter_regs,
18401847 oa_config->b_counter_regs_len);
@@ -2515,6 +2522,9 @@ static int i915_perf_release(struct inode *inode, struct file *file) · 674 unmodified lines
25152522 i915_perf_destroy_locked(stream);
25162523 mutex_unlock(&dev_priv->perf.lock);
25172524
2525+ /* Release the reference the perf stream kept on the driver. */
2526+ drm_dev_put(&dev_priv->drm);
2527+
25182528 return 0;
25192529 }
25202530
@@ -2650,6 +2660,11 @@ i915_perf_open_ioctl_locked(struct drm_i915_private *dev_priv, · 129 unmodified lines
26502660 if (!(param->flags & I915_PERF_FLAG_DISABLED))
26512661 i915_perf_enable_locked(stream);
26522662
2663+ /* Take a reference on the driver that will be kept with stream_fd
2664+ * until its release.
2665+ */
2666+ drm_dev_get(&dev_priv->drm);
2667+
26532668 return stream_fd;
26542669
26552670 err_open:
@@ -3477,9 +3492,13 @@ void i915_perf_init(struct drm_i915_private *dev_priv) · 821 unmodified lines
34773492 dev_priv->perf.oa.ops.enable_metric_set = gen8_enable_metric_set;
34783493 dev_priv->perf.oa.ops.disable_metric_set = gen10_disable_metric_set;
34793494
3480− dev_priv->perf.oa.ctx_oactxctrl_offset = 0x128;
3481− dev_priv->perf.oa.ctx_flexeu0_offset = 0x3de;
3482−
3495+ if (IS_GEN(dev_priv, 10)) {
3496+ dev_priv->perf.oa.ctx_oactxctrl_offset = 0x128;
3497+ dev_priv->perf.oa.ctx_flexeu0_offset = 0x3de;
3498+ } else {
3499+ dev_priv->perf.oa.ctx_oactxctrl_offset = 0x124;
3500+ dev_priv->perf.oa.ctx_flexeu0_offset = 0x78e;
3501+ }
34833502 dev_priv->perf.oa.gen8_valid_ctx_bit = (1<<16);
34843503 }
34853504 }
drivers/gpu/drm/i915/i915_trace.h+33−43
@@ -21,24 +21,22 @@ · 20 unmodified lines
2121 /* watermark/fifo updates */
2222
2323 TRACE_EVENT(intel_pipe_enable,
24− TP_PROTO(struct drm_i915_private *dev_priv, enum pipe pipe),
25− TP_ARGS(dev_priv, pipe),
24+ TP_PROTO(struct intel_crtc *crtc),
25+ TP_ARGS(crtc),
2626
2727 TP_STRUCT__entry(
2828 __array(u32, frame, 3)
2929 __array(u32, scanline, 3)
3030 __field(enum pipe, pipe)
3131 ),
32−
3332 TP_fast_assign(
34− enum pipe _pipe;
35− for_each_pipe(dev_priv, _pipe) {
36− __entry->frame[_pipe] =
37− dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, _pipe);
38− __entry->scanline[_pipe] =
39− intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, _pipe));
33+ struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
34+ struct intel_crtc *it__;
35+ for_each_intel_crtc(&dev_priv->drm, it__) {
36+ __entry->frame[it__->pipe] = intel_crtc_get_vblank_counter(it__);
37+ __entry->scanline[it__->pipe] = intel_get_crtc_scanline(it__);
4038 }
41− __entry->pipe = pipe;
39+ __entry->pipe = crtc->pipe;
4240 ),
4341
4442 TP_printk("pipe %c enable, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u",
@@ -49,8 +47,8 @@ TRACE_EVENT(intel_pipe_enable, · 4 unmodified lines
4947 );
5048
5149 TRACE_EVENT(intel_pipe_disable,
52− TP_PROTO(struct drm_i915_private *dev_priv, enum pipe pipe),
53− TP_ARGS(dev_priv, pipe),
50+ TP_PROTO(struct intel_crtc *crtc),
51+ TP_ARGS(crtc),
5452
5553 TP_STRUCT__entry(
5654 __array(u32, frame, 3)
@@ -59,14 +57,13 @@ TRACE_EVENT(intel_pipe_disable, · 2 unmodified lines
5957 ),
6058
6159 TP_fast_assign(
62− enum pipe _pipe;
63− for_each_pipe(dev_priv, _pipe) {
64− __entry->frame[_pipe] =
65− dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, _pipe);
66− __entry->scanline[_pipe] =
67− intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, _pipe));
60+ struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
61+ struct intel_crtc *it__;
62+ for_each_intel_crtc(&dev_priv->drm, it__) {
63+ __entry->frame[it__->pipe] = intel_crtc_get_vblank_counter(it__);
64+ __entry->scanline[it__->pipe] = intel_get_crtc_scanline(it__);
6865 }
69− __entry->pipe = pipe;
66+ __entry->pipe = crtc->pipe;
7067 ),
7168
7269 TP_printk("pipe %c disable, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u",
@@ -89,8 +86,7 @@ TRACE_EVENT(intel_pipe_crc, · 16 unmodified lines
8986
9087 TP_fast_assign(
9188 __entry->pipe = crtc->pipe;
92− __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
93− crtc->pipe);
89+ __entry->frame = intel_crtc_get_vblank_counter(crtc);
9490 __entry->scanline = intel_get_crtc_scanline(crtc);
9591 memcpy(__entry->crcs, crcs, sizeof(__entry->crcs));
9692 ),
@@ -112,9 +108,10 @@ TRACE_EVENT(intel_cpu_fifo_underrun, · 15 unmodified lines
112108 ),
113109
114110 TP_fast_assign(
111+ struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
115112 __entry->pipe = pipe;
116− __entry->frame = dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, pipe);
117− __entry->scanline = intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, pipe));
113+ __entry->frame = intel_crtc_get_vblank_counter(crtc);
114+ __entry->scanline = intel_get_crtc_scanline(crtc);
118115 ),
119116
120117 TP_printk("pipe %c, frame=%u, scanline=%u",
@@ -134,9 +131,10 @@ TRACE_EVENT(intel_pch_fifo_underrun, · 13 unmodified lines
134131
135132 TP_fast_assign(
136133 enum pipe pipe = pch_transcoder;
134+ struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
137135 __entry->pipe = pipe;
138− __entry->frame = dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, pipe);
139− __entry->scanline = intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, pipe));
136+ __entry->frame = intel_crtc_get_vblank_counter(crtc);
137+ __entry->scanline = intel_get_crtc_scanline(crtc);
140138 ),
141139
142140 TP_printk("pch transcoder %c, frame=%u, scanline=%u",
@@ -156,12 +154,10 @@ TRACE_EVENT(intel_memory_cxsr, · 13 unmodified lines
156154 ),
157155
158156 TP_fast_assign(
159− enum pipe pipe;
160− for_each_pipe(dev_priv, pipe) {
161− __entry->frame[pipe] =
162− dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, pipe);
163− __entry->scanline[pipe] =
164− intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, pipe));
157+ struct intel_crtc *crtc;
158+ for_each_intel_crtc(&dev_priv->drm, crtc) {
159+ __entry->frame[crtc->pipe] = intel_crtc_get_vblank_counter(crtc);
160+ __entry->scanline[crtc->pipe] = intel_get_crtc_scanline(crtc);
165161 }
166162 __entry->old = old;
167163 __entry->new = new;
@@ -198,8 +194,7 @@ TRACE_EVENT(g4x_wm, · 30 unmodified lines
198194
199195 TP_fast_assign(
200196 __entry->pipe = crtc->pipe;
201− __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
202− crtc->pipe);
197+ __entry->frame = intel_crtc_get_vblank_counter(crtc);
203198 __entry->scanline = intel_get_crtc_scanline(crtc);
204199 __entry->primary = wm->pipe[crtc->pipe].plane[PLANE_PRIMARY];
205200 __entry->sprite = wm->pipe[crtc->pipe].plane[PLANE_SPRITE0];
@@ -243,8 +238,7 @@ TRACE_EVENT(vlv_wm, · 37 unmodified lines
243238
244239 TP_fast_assign(
245240 __entry->pipe = crtc->pipe;
246− __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
247− crtc->pipe);
241+ __entry->frame = intel_crtc_get_vblank_counter(crtc);
248242 __entry->scanline = intel_get_crtc_scanline(crtc);
249243 __entry->level = wm->level;
250244 __entry->cxsr = wm->cxsr;
@@ -278,8 +272,7 @@ TRACE_EVENT(vlv_fifo_size, · 27 unmodified lines
278272
279273 TP_fast_assign(
280274 __entry->pipe = crtc->pipe;
281− __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
282− crtc->pipe);
275+ __entry->frame = intel_crtc_get_vblank_counter(crtc);
283276 __entry->scanline = intel_get_crtc_scanline(crtc);
284277 __entry->sprite0_start = sprite0_start;
285278 __entry->sprite1_start = sprite1_start;
@@ -310,8 +303,7 @@ TRACE_EVENT(intel_update_plane, · 24 unmodified lines
310303 TP_fast_assign(
311304 __entry->pipe = crtc->pipe;
312305 __entry->name = plane->name;
313− __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
314− crtc->pipe);
306+ __entry->frame = intel_crtc_get_vblank_counter(crtc);
315307 __entry->scanline = intel_get_crtc_scanline(crtc);
316308 memcpy(__entry->src, &plane->state->src, sizeof(__entry->src));
317309 memcpy(__entry->dst, &plane->state->dst, sizeof(__entry->dst));
@@ -338,8 +330,7 @@ TRACE_EVENT(intel_disable_plane, · 20 unmodified lines
338330 TP_fast_assign(
339331 __entry->pipe = crtc->pipe;
340332 __entry->name = plane->name;
341− __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
342− crtc->pipe);
333+ __entry->frame = intel_crtc_get_vblank_counter(crtc);
343334 __entry->scanline = intel_get_crtc_scanline(crtc);
344335 ),
345336
@@ -364,8 +355,7 @@ TRACE_EVENT(i915_pipe_update_start, · 18 unmodified lines
364355
365356 TP_fast_assign(
366357 __entry->pipe = crtc->pipe;
367− __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,
368− crtc->pipe);
358+ __entry->frame = intel_crtc_get_vblank_counter(crtc);
369359 __entry->scanline = intel_get_crtc_scanline(crtc);
370360 __entry->min = crtc->debug.min_vbl;
371361 __entry->max = crtc->debug.max_vbl;
drivers/gpu/drm/i915/intel_runtime_pm.c+4−6
@@ -221,13 +221,11 @@ __untrack_all_wakerefs(struct intel_runtime_pm_debug *debug, · 220 unmodified lines
221221 static void
222222 dump_and_free_wakeref_tracking(struct intel_runtime_pm_debug *debug)
223223 {
224− struct drm_printer p;
224+ if (debug->count) {
225+ struct drm_printer p = drm_debug_printer("i915");
225226
226− if (!debug->count)
227− return;
228−
229− p = drm_debug_printer("i915");
230− __print_intel_runtime_pm_wakeref(&p, debug);
227+ __print_intel_runtime_pm_wakeref(&p, debug);
228+ }
231229
232230 kfree(debug->owners);
233231 }
drivers/gpu/drm/i915/intel_wakeref.h+15−0
@@ -65,6 +65,21 @@ intel_wakeref_get(struct intel_runtime_pm *rpm, · 64 unmodified lines
6565 return 0;
6666 }
6767
68+/**
69+ * intel_wakeref_get_if_in_use: Acquire the wakeref
70+ * @wf: the wakeref
71+ *
72+ * Acquire a hold on the wakeref, but only if the wakeref is already
73+ * active.
74+ *
75+ * Returns: true if the wakeref was acquired, false otherwise.
76+ */
77+static inline bool
78+intel_wakeref_get_if_active(struct intel_wakeref *wf)
79+{
80+ return atomic_inc_not_zero(&wf->count);
81+}
82+
6883 /**
6984 * intel_wakeref_put: Release the wakeref
7085 * @i915: the drm_i915_private device
drivers/gpu/drm/msm/adreno/a5xx_gpu.c+2−0
@@ -59,6 +59,7 @@ static void a5xx_submit_in_rb(struct msm_gpu *gpu, struct msm_gem_submit *submit · 58 unmodified lines
5959 case MSM_SUBMIT_CMD_CTX_RESTORE_BUF:
6060 if (priv->lastctx == ctx)
6161 break;
62+ /* fall-thru */
6263 case MSM_SUBMIT_CMD_BUF:
6364 /* copy commands into RB: */
6465 obj = submit->bos[submit->cmd[i].idx].obj;
@@ -149,6 +150,7 @@ static void a5xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, · 84 unmodified lines
149150 case MSM_SUBMIT_CMD_CTX_RESTORE_BUF:
150151 if (priv->lastctx == ctx)
151152 break;
153+ /* fall-thru */
152154 case MSM_SUBMIT_CMD_BUF:
153155 OUT_PKT7(ring, CP_INDIRECT_BUFFER_PFE, 3);
154156 OUT_RING(ring, lower_32_bits(submit->cmd[i].iova));
drivers/gpu/drm/msm/adreno/a6xx_gpu.c+1−0
@@ -115,6 +115,7 @@ static void a6xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, · 114 unmodified lines
115115 case MSM_SUBMIT_CMD_CTX_RESTORE_BUF:
116116 if (priv->lastctx == ctx)
117117 break;
118+ /* fall-thru */
118119 case MSM_SUBMIT_CMD_BUF:
119120 OUT_PKT7(ring, CP_INDIRECT_BUFFER_PFE, 3);
120121 OUT_RING(ring, lower_32_bits(submit->cmd[i].iova));
drivers/gpu/drm/msm/adreno/adreno_gpu.c+1−0
@@ -428,6 +428,7 @@ void adreno_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, · 427 unmodified lines
428428 /* ignore if there has not been a ctx switch: */
429429 if (priv->lastctx == ctx)
430430 break;
431+ /* fall-thru */
431432 case MSM_SUBMIT_CMD_BUF:
432433 OUT_PKT3(ring, adreno_is_a430(adreno_gpu) ?
433434 CP_INDIRECT_BUFFER_PFE : CP_INDIRECT_BUFFER_PFD, 2);
drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c+15−1
@@ -439,6 +439,18 @@ static void mdp5_crtc_atomic_disable(struct drm_crtc *crtc, · 438 unmodified lines
439439 mdp5_crtc->enabled = false;
440440 }
441441
442+static void mdp5_crtc_vblank_on(struct drm_crtc *crtc)
443+{
444+ struct mdp5_crtc_state *mdp5_cstate = to_mdp5_crtc_state(crtc->state);
445+ struct mdp5_interface *intf = mdp5_cstate->pipeline.intf;
446+ u32 count;
447+
448+ count = intf->mode == MDP5_INTF_DSI_MODE_COMMAND ? 0 : 0xffffffff;
449+ drm_crtc_set_max_vblank_count(crtc, count);
450+
451+ drm_crtc_vblank_on(crtc);
452+}
453+
442454 static void mdp5_crtc_atomic_enable(struct drm_crtc *crtc,
443455 struct drm_crtc_state *old_state)
444456 {
@@ -475,7 +487,7 @@ static void mdp5_crtc_atomic_enable(struct drm_crtc *crtc, · 30 unmodified lines
475487 }
476488
477489 /* Restore vblank irq handling after power is enabled */
478− drm_crtc_vblank_on(crtc);
490+ mdp5_crtc_vblank_on(crtc);
479491
480492 mdp5_crtc_mode_set_nofb(crtc);
481493
@@ -1028,6 +1040,8 @@ static void mdp5_crtc_reset(struct drm_crtc *crtc) · 546 unmodified lines
10281040 mdp5_crtc_destroy_state(crtc, crtc->state);
10291041
10301042 __drm_atomic_helper_crtc_reset(crtc, &mdp5_cstate->base);
1043+
1044+ drm_crtc_vblank_reset(crtc);
10311045 }
10321046
10331047 static const struct drm_crtc_funcs mdp5_crtc_funcs = {
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c+1−1
@@ -740,7 +740,7 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev) · 739 unmodified lines
740740 dev->driver->get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos;
741741 dev->driver->get_scanout_position = mdp5_get_scanoutpos;
742742 dev->driver->get_vblank_counter = mdp5_get_vblank_counter;
743− dev->max_vblank_count = 0xffffffff;
743+ dev->max_vblank_count = 0; /* max_vblank_count is set on each CRTC */
744744 dev->vblank_disable_immediate = true;
745745
746746 return kms;
drivers/gpu/drm/msm/msm_drv.c+2−1
@@ -1279,7 +1279,8 @@ static int add_gpu_components(struct device *dev, · 1278 unmodified lines
12791279 if (!np)
12801280 return 0;
12811281
1282− drm_of_component_match_add(dev, matchptr, compare_of, np);
1282+ if (of_device_is_available(np))
1283+ drm_of_component_match_add(dev, matchptr, compare_of, np);
12831284
12841285 of_node_put(np);
12851286
drivers/gpu/drm/msm/msm_gem.c+42−5
@@ -32,6 +32,46 @@ static bool use_pages(struct drm_gem_object *obj) · 31 unmodified lines
3232 return !msm_obj->vram_node;
3333 }
3434
35+/*
36+ * Cache sync.. this is a bit over-complicated, to fit dma-mapping
37+ * API. Really GPU cache is out of scope here (handled on cmdstream)
38+ * and all we need to do is invalidate newly allocated pages before
39+ * mapping to CPU as uncached/writecombine.
40+ *
41+ * On top of this, we have the added headache, that depending on
42+ * display generation, the display's iommu may be wired up to either
43+ * the toplevel drm device (mdss), or to the mdp sub-node, meaning
44+ * that here we either have dma-direct or iommu ops.
45+ *
46+ * Let this be a cautionary tail of abstraction gone wrong.
47+ */
48+
49+static void sync_for_device(struct msm_gem_object *msm_obj)
50+{
51+ struct device *dev = msm_obj->base.dev->dev;
52+
53+ if (get_dma_ops(dev)) {
54+ dma_sync_sg_for_device(dev, msm_obj->sgt->sgl,
55+ msm_obj->sgt->nents, DMA_BIDIRECTIONAL);
56+ } else {
57+ dma_map_sg(dev, msm_obj->sgt->sgl,
58+ msm_obj->sgt->nents, DMA_BIDIRECTIONAL);
59+ }
60+}
61+
62+static void sync_for_cpu(struct msm_gem_object *msm_obj)
63+{
64+ struct device *dev = msm_obj->base.dev->dev;
65+
66+ if (get_dma_ops(dev)) {
67+ dma_sync_sg_for_cpu(dev, msm_obj->sgt->sgl,
68+ msm_obj->sgt->nents, DMA_BIDIRECTIONAL);
69+ } else {
70+ dma_unmap_sg(dev, msm_obj->sgt->sgl,
71+ msm_obj->sgt->nents, DMA_BIDIRECTIONAL);
72+ }
73+}
74+
3575 /* allocate pages from VRAM carveout, used when no IOMMU: */
3676 static struct page **get_pages_vram(struct drm_gem_object *obj, int npages)
3777 {
@@ -97,8 +137,7 @@ static struct page **get_pages(struct drm_gem_object *obj) · 59 unmodified lines
97137 * because display controller, GPU, etc. are not coherent:
98138 */
99139 if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED))
100− dma_sync_sg_for_device(dev->dev, msm_obj->sgt->sgl,
101− msm_obj->sgt->nents, DMA_BIDIRECTIONAL);
140+ sync_for_device(msm_obj);
102141 }
103142
104143 return msm_obj->pages;
@@ -127,9 +166,7 @@ static void put_pages(struct drm_gem_object *obj) · 22 unmodified lines
127166 * GPU, etc. are not coherent:
128167 */
129168 if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED))
130− dma_sync_sg_for_cpu(obj->dev->dev, msm_obj->sgt->sgl,
131− msm_obj->sgt->nents,
132− DMA_BIDIRECTIONAL);
169+ sync_for_cpu(msm_obj);
133170
134171 sg_free_table(msm_obj->sgt);
135172 kfree(msm_obj->sgt);
drivers/gpu/drm/nouveau/dispnv50/disp.c+1−1
@@ -780,7 +780,7 @@ nv50_msto_atomic_check(struct drm_encoder *encoder, · 779 unmodified lines
780780 drm_dp_calc_pbn_mode(crtc_state->adjusted_mode.clock,
781781 connector->display_info.bpc * 3);
782782
783− if (drm_atomic_crtc_needs_modeset(crtc_state)) {
783+ if (crtc_state->mode_changed) {
784784 slots = drm_dp_atomic_find_vcpi_slots(state, &mstm->mgr,
785785 mstc->port,
786786 asyh->dp.pbn);
drivers/gpu/drm/nouveau/nouveau_svm.c+44−3
@@ -475,6 +475,47 @@ nouveau_svm_fault_cache(struct nouveau_svm *svm, · 474 unmodified lines
475475 fault->inst, fault->addr, fault->access);
476476 }
477477
478+static inline bool
479+nouveau_range_done(struct hmm_range *range)
480+{
481+ bool ret = hmm_range_valid(range);
482+
483+ hmm_range_unregister(range);
484+ return ret;
485+}
486+
487+static int
488+nouveau_range_fault(struct hmm_mirror *mirror, struct hmm_range *range)
489+{
490+ long ret;
491+
492+ range->default_flags = 0;
493+ range->pfn_flags_mask = -1UL;
494+
495+ ret = hmm_range_register(range, mirror,
496+ range->start, range->end,
497+ PAGE_SHIFT);
498+ if (ret) {
499+ up_read(&range->vma->vm_mm->mmap_sem);
500+ return (int)ret;
501+ }
502+
503+ if (!hmm_range_wait_until_valid(range, HMM_RANGE_DEFAULT_TIMEOUT)) {
504+ up_read(&range->vma->vm_mm->mmap_sem);
505+ return -EAGAIN;
506+ }
507+
508+ ret = hmm_range_fault(range, true);
509+ if (ret <= 0) {
510+ if (ret == 0)
511+ ret = -EBUSY;
512+ up_read(&range->vma->vm_mm->mmap_sem);
513+ hmm_range_unregister(range);
514+ return ret;
515+ }
516+ return 0;
517+}
518+
478519 static int
479520 nouveau_svm_fault(struct nvif_notify *notify)
480521 {
@@ -649,10 +690,10 @@ nouveau_svm_fault(struct nvif_notify *notify) · 168 unmodified lines
649690 range.values = nouveau_svm_pfn_values;
650691 range.pfn_shift = NVIF_VMM_PFNMAP_V0_ADDR_SHIFT;
651692 again:
652− ret = hmm_vma_fault(&svmm->mirror, &range, true);
693+ ret = nouveau_range_fault(&svmm->mirror, &range);
653694 if (ret == 0) {
654695 mutex_lock(&svmm->mutex);
655− if (!hmm_vma_range_done(&range)) {
696+ if (!nouveau_range_done(&range)) {
656697 mutex_unlock(&svmm->mutex);
657698 goto again;
658699 }
@@ -666,8 +707,8 @@ again: · 7 unmodified lines
666707 NULL);
667708 svmm->vmm->vmm.object.client->super = false;
668709 mutex_unlock(&svmm->mutex);
710+ up_read(&svmm->mm->mmap_sem);
669711 }
670− up_read(&svmm->mm->mmap_sem);
671712
672713 /* Cancel any faults in the window whose pages didn't manage
673714 * to keep their valid bit, or stay writeable when required.
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c+1−1
@@ -432,7 +432,7 @@ static int rockchip_dp_resume(struct device *dev) · 431 unmodified lines
432432
433433 static const struct dev_pm_ops rockchip_dp_pm_ops = {
434434 #ifdef CONFIG_PM_SLEEP
435− .suspend = rockchip_dp_suspend,
435+ .suspend_late = rockchip_dp_suspend,
436436 .resume_early = rockchip_dp_resume,
437437 #endif
438438 };
drivers/gpu/drm/tegra/output.c+6−2
@@ -126,8 +126,12 @@ int tegra_output_probe(struct tegra_output *output) · 125 unmodified lines
126126 "nvidia,hpd-gpio", 0,
127127 GPIOD_IN,
128128 "HDMI hotplug detect");
129− if (IS_ERR(output->hpd_gpio))
130− return PTR_ERR(output->hpd_gpio);
129+ if (IS_ERR(output->hpd_gpio)) {
130+ if (PTR_ERR(output->hpd_gpio) != -ENOENT)
131+ return PTR_ERR(output->hpd_gpio);
132+
133+ output->hpd_gpio = NULL;
134+ }
131135
132136 if (output->hpd_gpio) {
133137 err = gpiod_to_irq(output->hpd_gpio);
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c+3−1
@@ -389,8 +389,10 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg, · 388 unmodified lines
389389 break;
390390 }
391391
392− if (retries == RETRIES)
392+ if (retries == RETRIES) {
393+ kfree(reply);
393394 return -EINVAL;
395+ }
394396
395397 *msg_len = reply_len;
396398 *msg = reply;
drivers/hid/hid-a4tech.c+27−3
@@ -23,12 +23,36 @@ · 22 unmodified lines
2323 #define A4_2WHEEL_MOUSE_HACK_7 0x01
2424 #define A4_2WHEEL_MOUSE_HACK_B8 0x02
2525
26+#define A4_WHEEL_ORIENTATION (HID_UP_GENDESK | 0x000000b8)
27+
2628 struct a4tech_sc {
2729 unsigned long quirks;
2830 unsigned int hw_wheel;
2931 __s32 delayed_value;
3032 };
3133
34+static int a4_input_mapping(struct hid_device *hdev, struct hid_input *hi,
35+ struct hid_field *field, struct hid_usage *usage,
36+ unsigned long **bit, int *max)
37+{
38+ struct a4tech_sc *a4 = hid_get_drvdata(hdev);
39+
40+ if (a4->quirks & A4_2WHEEL_MOUSE_HACK_B8 &&
41+ usage->hid == A4_WHEEL_ORIENTATION) {
42+ /*
43+ * We do not want to have this usage mapped to anything as it's
44+ * nonstandard and doesn't really behave like an HID report.
45+ * It's only selecting the orientation (vertical/horizontal) of
46+ * the previous mouse wheel report. The input_events will be
47+ * generated once both reports are recorded in a4_event().
48+ */
49+ return -1;
50+ }
51+
52+ return 0;
53+
54+}
55+
3256 static int a4_input_mapped(struct hid_device *hdev, struct hid_input *hi,
3357 struct hid_field *field, struct hid_usage *usage,
3458 unsigned long **bit, int *max)
@@ -52,8 +76,7 @@ static int a4_event(struct hid_device *hdev, struct hid_field *field, · 17 unmodified lines
5276 struct a4tech_sc *a4 = hid_get_drvdata(hdev);
5377 struct input_dev *input;
5478
55− if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput ||
56− !usage->type)
79+ if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput)
5780 return 0;
5881
5982 input = field->hidinput->input;
@@ -64,7 +87,7 @@ static int a4_event(struct hid_device *hdev, struct hid_field *field, · 4 unmodified lines
6487 return 1;
6588 }
6689
67− if (usage->hid == 0x000100b8) {
90+ if (usage->hid == A4_WHEEL_ORIENTATION) {
6891 input_event(input, EV_REL, value ? REL_HWHEEL :
6992 REL_WHEEL, a4->delayed_value);
7093 input_event(input, EV_REL, value ? REL_HWHEEL_HI_RES :
@@ -131,6 +154,7 @@ MODULE_DEVICE_TABLE(hid, a4_devices); · 60 unmodified lines
131154 static struct hid_driver a4_driver = {
132155 .name = "a4tech",
133156 .id_table = a4_devices,
157+ .input_mapping = a4_input_mapping,
134158 .input_mapped = a4_input_mapped,
135159 .event = a4_event,
136160 .probe = a4_probe,
drivers/hid/hid-holtek-kbd.c+7−2
@@ -123,9 +123,14 @@ static int holtek_kbd_input_event(struct input_dev *dev, unsigned int type, · 122 unmodified lines
123123
124124 /* Locate the boot interface, to receive the LED change events */
125125 struct usb_interface *boot_interface = usb_ifnum_to_if(usb_dev, 0);
126+ struct hid_device *boot_hid;
127+ struct hid_input *boot_hid_input;
126128
127− struct hid_device *boot_hid = usb_get_intfdata(boot_interface);
128− struct hid_input *boot_hid_input = list_first_entry(&boot_hid->inputs,
129+ if (unlikely(boot_interface == NULL))
130+ return -ENODEV;
131+
132+ boot_hid = usb_get_intfdata(boot_interface);
133+ boot_hid_input = list_first_entry(&boot_hid->inputs,
129134 struct hid_input, list);
130135
131136 return boot_hid_input->input->event(boot_hid_input->input, type, code,
drivers/hid/hid-ids.h+4−1
@@ -568,6 +568,7 @@ · 567 unmodified lines
568568 #define USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0B4A 0x0b4a
569569 #define USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE 0x134a
570570 #define USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE_094A 0x094a
571+#define USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE_0641 0x0641
571572
572573 #define USB_VENDOR_ID_HUION 0x256c
573574 #define USB_DEVICE_ID_HUION_TABLET 0x006e
@@ -768,7 +769,8 @@ · 194 unmodified lines
768769 #define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER 0xc52f
769770 #define USB_DEVICE_ID_LOGITECH_UNIFYING_RECEIVER_2 0xc532
770771 #define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_2 0xc534
771−#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_GAMING 0xc539
772+#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_LIGHTSPEED 0xc539
773+#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_POWERPLAY 0xc53a
772774 #define USB_DEVICE_ID_SPACETRAVELLER 0xc623
773775 #define USB_DEVICE_ID_SPACENAVIGATOR 0xc626
774776 #define USB_DEVICE_ID_DINOVO_DESKTOP 0xc704
@@ -989,6 +991,7 @@ · 214 unmodified lines
989991 #define USB_DEVICE_ID_SAITEK_RAT7 0x0cd7
990992 #define USB_DEVICE_ID_SAITEK_RAT9 0x0cfa
991993 #define USB_DEVICE_ID_SAITEK_MMO7 0x0cd0
994+#define USB_DEVICE_ID_SAITEK_X52 0x075c
992995
993996 #define USB_VENDOR_ID_SAMSUNG 0x0419
994997 #define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001
drivers/hid/hid-logitech-dj.c+7−3
@@ -1125,7 +1125,7 @@ static int logi_dj_recv_query_hidpp_devices(struct dj_receiver_dev *djrcv_dev) · 1124 unmodified lines
11251125 HID_REQ_SET_REPORT);
11261126
11271127 kfree(hidpp_report);
1128− return retval;
1128+ return (retval < 0) ? retval : 0;
11291129 }
11301130
11311131 static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev)
@@ -1832,13 +1832,17 @@ static const struct hid_device_id logi_dj_receivers[] = { · 700 unmodified lines
18321832 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
18331833 USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_2),
18341834 .driver_data = recvr_type_hidpp},
1835− { /* Logitech gaming receiver (0xc539) */
1835+ { /* Logitech lightspeed receiver (0xc539) */
18361836 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
1837− USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_GAMING),
1837+ USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_LIGHTSPEED),
18381838 .driver_data = recvr_type_gaming_hidpp},
18391839 { /* Logitech 27 MHz HID++ 1.0 receiver (0xc513) */
18401840 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER),
18411841 .driver_data = recvr_type_27mhz},
1842+ { /* Logitech powerplay receiver (0xc53a) */
1843+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
1844+ USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_POWERPLAY),
1845+ .driver_data = recvr_type_gaming_hidpp},
18421846 { /* Logitech 27 MHz HID++ 1.0 receiver (0xc517) */
18431847 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
18441848 USB_DEVICE_ID_S510_RECEIVER_2),
drivers/hid/hid-logitech-hidpp.c+31−1
@@ -3749,15 +3749,45 @@ static const struct hid_device_id hidpp_devices[] = { · 3748 unmodified lines
37493749
37503750 { L27MHZ_DEVICE(HID_ANY_ID) },
37513751
3752− { /* Logitech G403 Gaming Mouse over USB */
3752+ { /* Logitech G203/Prodigy Gaming Mouse */
3753+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC084) },
3754+ { /* Logitech G302 Gaming Mouse */
3755+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC07F) },
3756+ { /* Logitech G303 Gaming Mouse */
3757+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC080) },
3758+ { /* Logitech G400 Gaming Mouse */
3759+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC07E) },
3760+ { /* Logitech G403 Wireless Gaming Mouse over USB */
37533761 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC082) },
3762+ { /* Logitech G403 Gaming Mouse */
3763+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC083) },
3764+ { /* Logitech G403 Hero Gaming Mouse over USB */
3765+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC08F) },
3766+ { /* Logitech G502 Proteus Core Gaming Mouse */
3767+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC07D) },
3768+ { /* Logitech G502 Proteus Spectrum Gaming Mouse over USB */
3769+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC332) },
3770+ { /* Logitech G502 Hero Gaming Mouse over USB */
3771+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC08B) },
37543772 { /* Logitech G700 Gaming Mouse over USB */
37553773 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC06B) },
3774+ { /* Logitech G700s Gaming Mouse over USB */
3775+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC07C) },
3776+ { /* Logitech G703 Gaming Mouse over USB */
3777+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC087) },
3778+ { /* Logitech G703 Hero Gaming Mouse over USB */
3779+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC090) },
37563780 { /* Logitech G900 Gaming Mouse over USB */
37573781 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC081) },
3782+ { /* Logitech G903 Gaming Mouse over USB */
3783+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC086) },
3784+ { /* Logitech G903 Hero Gaming Mouse over USB */
3785+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC091) },
37583786 { /* Logitech G920 Wheel over USB */
37593787 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G920_WHEEL),
37603788 .driver_data = HIDPP_QUIRK_CLASS_G920 | HIDPP_QUIRK_FORCE_OUTPUT_REPORTS},
3789+ { /* Logitech G Pro Gaming Mouse over USB */
3790+ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC088) },
37613791
37623792 { /* MX5000 keyboard over Bluetooth */
37633793 HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb305),
drivers/hid/hid-quirks.c+2−0
@@ -92,6 +92,7 @@ static const struct hid_device_id hid_quirks[] = { · 91 unmodified lines
9292 { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0B4A), HID_QUIRK_ALWAYS_POLL },
9393 { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },
9494 { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE_094A), HID_QUIRK_ALWAYS_POLL },
95+ { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE_0641), HID_QUIRK_ALWAYS_POLL },
9596 { HID_USB_DEVICE(USB_VENDOR_ID_IDEACOM, USB_DEVICE_ID_IDEACOM_IDC6680), HID_QUIRK_MULTI_INPUT },
9697 { HID_USB_DEVICE(USB_VENDOR_ID_INNOMEDIA, USB_DEVICE_ID_INNEX_GENESIS_ATARI), HID_QUIRK_MULTI_INPUT },
9798 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X), HID_QUIRK_MULTI_INPUT },
@@ -141,6 +142,7 @@ static const struct hid_device_id hid_quirks[] = { · 43 unmodified lines
141142 { HID_USB_DEVICE(USB_VENDOR_ID_RETROUSB, USB_DEVICE_ID_RETROUSB_SNES_RETROPAD), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE },
142143 { HID_USB_DEVICE(USB_VENDOR_ID_RETROUSB, USB_DEVICE_ID_RETROUSB_SNES_RETROPORT), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE },
143144 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD), HID_QUIRK_BADPAD },
145+ { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_X52), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE },
144146 { HID_USB_DEVICE(USB_VENDOR_ID_SEMICO, USB_DEVICE_ID_SEMICO_USB_KEYKOARD2), HID_QUIRK_NO_INIT_REPORTS },
145147 { HID_USB_DEVICE(USB_VENDOR_ID_SEMICO, USB_DEVICE_ID_SEMICO_USB_KEYKOARD), HID_QUIRK_NO_INIT_REPORTS },
146148 { HID_USB_DEVICE(USB_VENDOR_ID_SENNHEISER, USB_DEVICE_ID_SENNHEISER_BTD500USB), HID_QUIRK_NOGET },
drivers/hid/hid-sony.c+12−3
@@ -585,10 +585,14 @@ static void sony_set_leds(struct sony_sc *sc); · 584 unmodified lines
585585 static inline void sony_schedule_work(struct sony_sc *sc,
586586 enum sony_worker which)
587587 {
588+ unsigned long flags;
589+
588590 switch (which) {
589591 case SONY_WORKER_STATE:
590− if (!sc->defer_initialization)
592+ spin_lock_irqsave(&sc->lock, flags);
593+ if (!sc->defer_initialization && sc->state_worker_initialized)
591594 schedule_work(&sc->state_worker);
595+ spin_unlock_irqrestore(&sc->lock, flags);
592596 break;
593597 case SONY_WORKER_HOTPLUG:
594598 if (sc->hotplug_worker_initialized)
@@ -2558,13 +2562,18 @@ static inline void sony_init_output_report(struct sony_sc *sc, · 1963 unmodified lines
25582562
25592563 static inline void sony_cancel_work_sync(struct sony_sc *sc)
25602564 {
2565+ unsigned long flags;
2566+
25612567 if (sc->hotplug_worker_initialized)
25622568 cancel_work_sync(&sc->hotplug_worker);
2563− if (sc->state_worker_initialized)
2569+ if (sc->state_worker_initialized) {
2570+ spin_lock_irqsave(&sc->lock, flags);
2571+ sc->state_worker_initialized = 0;
2572+ spin_unlock_irqrestore(&sc->lock, flags);
25642573 cancel_work_sync(&sc->state_worker);
2574+ }
25652575 }
25662576
2567−
25682577 static int sony_input_configured(struct hid_device *hdev,
25692578 struct hid_input *hidinput)
25702579 {
drivers/hid/hid-tmff.c+12−0
@@ -22,6 +22,8 @@ · 21 unmodified lines
2222
2323 #include "hid-ids.h"
2424
25+#define THRUSTMASTER_DEVICE_ID_2_IN_1_DT 0xb320
26+
2527 static const signed short ff_rumble[] = {
2628 FF_RUMBLE,
2729 -1
@@ -76,6 +78,7 @@ static int tmff_play(struct input_dev *dev, void *data, · 48 unmodified lines
7678 struct hid_field *ff_field = tmff->ff_field;
7779 int x, y;
7880 int left, right; /* Rumbling */
81+ int motor_swap;
7982
8083 switch (effect->type) {
8184 case FF_CONSTANT:
@@ -100,6 +103,13 @@ static int tmff_play(struct input_dev *dev, void *data, · 18 unmodified lines
100103 ff_field->logical_minimum,
101104 ff_field->logical_maximum);
102105
106+ /* 2-in-1 strong motor is left */
107+ if (hid->product == THRUSTMASTER_DEVICE_ID_2_IN_1_DT) {
108+ motor_swap = left;
109+ left = right;
110+ right = motor_swap;
111+ }
112+
103113 dbg_hid("(left,right)=(%08x, %08x)\n", left, right);
104114 ff_field->value[0] = left;
105115 ff_field->value[1] = right;
@@ -226,6 +236,8 @@ static const struct hid_device_id tm_devices[] = { · 120 unmodified lines
226236 .driver_data = (unsigned long)ff_rumble },
227237 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304), /* FireStorm Dual Power 2 (and 3) */
228238 .driver_data = (unsigned long)ff_rumble },
239+ { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, THRUSTMASTER_DEVICE_ID_2_IN_1_DT), /* Dual Trigger 2-in-1 */
240+ .driver_data = (unsigned long)ff_rumble },
229241 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb323), /* Dual Trigger 3-in-1 (PC Mode) */
230242 .driver_data = (unsigned long)ff_rumble },
231243 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb324), /* Dual Trigger 3-in-1 (PS3 Mode) */
drivers/hid/usbhid/hiddev.c+12−0
@@ -284,6 +284,14 @@ static int hiddev_open(struct inode *inode, struct file *file) · 283 unmodified lines
284284 spin_unlock_irq(&list->hiddev->list_lock);
285285
286286 mutex_lock(&hiddev->existancelock);
287+ /*
288+ * recheck exist with existance lock held to
289+ * avoid opening a disconnected device
290+ */
291+ if (!list->hiddev->exist) {
292+ res = -ENODEV;
293+ goto bail_unlock;
294+ }
287295 if (!list->hiddev->open++)
288296 if (list->hiddev->exist) {
289297 struct hid_device *hid = hiddev->hid;
@@ -300,6 +308,10 @@ bail_normal_power: · 10 unmodified lines
300308 hid_hw_power(hid, PM_HINT_NORMAL);
301309 bail_unlock:
302310 mutex_unlock(&hiddev->existancelock);
311+
312+ spin_lock_irq(&list->hiddev->list_lock);
313+ list_del(&list->node);
314+ spin_unlock_irq(&list->hiddev->list_lock);
303315 bail:
304316 file->private_data = NULL;
305317 vfree(list);
drivers/hid/wacom_wac.c+6−6
@@ -533,14 +533,14 @@ static int wacom_intuos_pad(struct wacom_wac *wacom) · 532 unmodified lines
533533 */
534534 buttons = (data[4] << 1) | (data[3] & 0x01);
535535 } else if (features->type == CINTIQ_COMPANION_2) {
536− /* d-pad right -> data[4] & 0x10
537− * d-pad up -> data[4] & 0x20
538− * d-pad left -> data[4] & 0x40
539− * d-pad down -> data[4] & 0x80
540− * d-pad center -> data[3] & 0x01
536+ /* d-pad right -> data[2] & 0x10
537+ * d-pad up -> data[2] & 0x20
538+ * d-pad left -> data[2] & 0x40
539+ * d-pad down -> data[2] & 0x80
540+ * d-pad center -> data[1] & 0x01
541541 */
542542 buttons = ((data[2] >> 4) << 7) |
543− ((data[1] & 0x04) << 6) |
543+ ((data[1] & 0x04) << 4) |
544544 ((data[2] & 0x0F) << 2) |
545545 (data[1] & 0x03);
546546 } else if (features->type >= INTUOS5S && features->type <= INTUOSPL) {
drivers/hwmon/lm75.c+1−1
@@ -343,7 +343,7 @@ lm75_probe(struct i2c_client *client, const struct i2c_device_id *id) · 342 unmodified lines
343343 data->sample_time = MSEC_PER_SEC / 2;
344344 break;
345345 case tmp75b: /* not one-shot mode, Conversion rate 37Hz */
346− clr_mask |= 1 << 15 | 0x3 << 13;
346+ clr_mask |= 1 << 7 | 0x3 << 5;
347347 data->resolution = 12;
348348 data->sample_time = MSEC_PER_SEC / 37;
349349 break;
drivers/hwmon/nct7802.c+3−3
@@ -704,7 +704,7 @@ static struct attribute *nct7802_in_attrs[] = { · 703 unmodified lines
704704 &sensor_dev_attr_in3_alarm.dev_attr.attr,
705705 &sensor_dev_attr_in3_beep.dev_attr.attr,
706706
707− &sensor_dev_attr_in4_input.dev_attr.attr, /* 17 */
707+ &sensor_dev_attr_in4_input.dev_attr.attr, /* 16 */
708708 &sensor_dev_attr_in4_min.dev_attr.attr,
709709 &sensor_dev_attr_in4_max.dev_attr.attr,
710710 &sensor_dev_attr_in4_alarm.dev_attr.attr,
@@ -730,9 +730,9 @@ static umode_t nct7802_in_is_visible(struct kobject *kobj, · 19 unmodified lines
730730
731731 if (index >= 6 && index < 11 && (reg & 0x03) != 0x03) /* VSEN1 */
732732 return 0;
733− if (index >= 11 && index < 17 && (reg & 0x0c) != 0x0c) /* VSEN2 */
733+ if (index >= 11 && index < 16 && (reg & 0x0c) != 0x0c) /* VSEN2 */
734734 return 0;
735− if (index >= 17 && (reg & 0x30) != 0x30) /* VSEN3 */
735+ if (index >= 16 && (reg & 0x30) != 0x30) /* VSEN3 */
736736 return 0;
737737
738738 return attr->mode;
drivers/hwtracing/coresight/coresight-etm-perf.c+1−0
@@ -544,6 +544,7 @@ int etm_perf_add_symlink_sink(struct coresight_device *csdev) · 543 unmodified lines
544544 /* See function coresight_get_sink_by_id() to know where this is used */
545545 hash = hashlen_hash(hashlen_string(NULL, name));
546546
547+ sysfs_attr_init(&ea->attr.attr);
547548 ea->attr.attr.name = devm_kstrdup(dev, name, GFP_KERNEL);
548549 if (!ea->attr.attr.name)
549550 return -ENOMEM;
drivers/i2c/busses/i2c-at91-core.c+1−1
@@ -142,7 +142,7 @@ static struct at91_twi_pdata sama5d4_config = { · 141 unmodified lines
142142
143143 static struct at91_twi_pdata sama5d2_config = {
144144 .clk_max_div = 7,
145− .clk_offset = 4,
145+ .clk_offset = 3,
146146 .has_unre_flag = true,
147147 .has_alt_cmd = true,
148148 .has_hold_field = true,
drivers/i2c/busses/i2c-at91-master.c+5−4
@@ -122,9 +122,11 @@ static void at91_twi_write_next_byte(struct at91_twi_dev *dev) · 121 unmodified lines
122122 writeb_relaxed(*dev->buf, dev->base + AT91_TWI_THR);
123123
124124 /* send stop when last byte has been written */
125− if (--dev->buf_len == 0)
125+ if (--dev->buf_len == 0) {
126126 if (!dev->use_alt_cmd)
127127 at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_STOP);
128+ at91_twi_write(dev, AT91_TWI_IDR, AT91_TWI_TXRDY);
129+ }
128130
129131 dev_dbg(dev->dev, "wrote 0x%x, to go %zu\n", *dev->buf, dev->buf_len);
130132
@@ -542,9 +544,8 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev) · 411 unmodified lines
542544 } else {
543545 at91_twi_write_next_byte(dev);
544546 at91_twi_write(dev, AT91_TWI_IER,
545− AT91_TWI_TXCOMP |
546− AT91_TWI_NACK |
547− AT91_TWI_TXRDY);
547+ AT91_TWI_TXCOMP | AT91_TWI_NACK |
548+ (dev->buf_len ? AT91_TWI_TXRDY : 0));
548549 }
549550 }
550551
drivers/i2c/busses/i2c-bcm-iproc.c+6−4
@@ -392,16 +392,18 @@ static bool bcm_iproc_i2c_slave_isr(struct bcm_iproc_i2c_dev *iproc_i2c, · 391 unmodified lines
392392 static void bcm_iproc_i2c_read_valid_bytes(struct bcm_iproc_i2c_dev *iproc_i2c)
393393 {
394394 struct i2c_msg *msg = iproc_i2c->msg;
395+ uint32_t val;
395396
396397 /* Read valid data from RX FIFO */
397398 while (iproc_i2c->rx_bytes < msg->len) {
398− if (!((iproc_i2c_rd_reg(iproc_i2c, M_FIFO_CTRL_OFFSET) >> M_FIFO_RX_CNT_SHIFT)
399− & M_FIFO_RX_CNT_MASK))
399+ val = iproc_i2c_rd_reg(iproc_i2c, M_RX_OFFSET);
400+
401+ /* rx fifo empty */
402+ if (!((val >> M_RX_STATUS_SHIFT) & M_RX_STATUS_MASK))
400403 break;
401404
402405 msg->buf[iproc_i2c->rx_bytes] =
403− (iproc_i2c_rd_reg(iproc_i2c, M_RX_OFFSET) >>
404− M_RX_DATA_SHIFT) & M_RX_DATA_MASK;
406+ (val >> M_RX_DATA_SHIFT) & M_RX_DATA_MASK;
405407 iproc_i2c->rx_bytes++;
406408 }
407409 }
drivers/i2c/busses/i2c-s3c2410.c+1−0
@@ -435,6 +435,7 @@ static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat) · 434 unmodified lines
435435 * fall through to the write state, as we will need to
436436 * send a byte as well
437437 */
438+ /* Fall through */
438439
439440 case STATE_WRITE:
440441 /*
drivers/iio/accel/cros_ec_accel_legacy.c+0−1
@@ -319,7 +319,6 @@ static const struct iio_chan_spec_ext_info cros_ec_accel_legacy_ext_info[] = { · 318 unmodified lines
319319 .modified = 1, \
320320 .info_mask_separate = \
321321 BIT(IIO_CHAN_INFO_RAW) | \
322− BIT(IIO_CHAN_INFO_SCALE) | \
323322 BIT(IIO_CHAN_INFO_CALIBBIAS), \
324323 .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SCALE), \
325324 .ext_info = cros_ec_accel_legacy_ext_info, \
drivers/iio/adc/ingenic-adc.c+54−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/iio/iio.h>
1212 #include <linux/io.h>
1313 #include <linux/iopoll.h>
14+#include <linux/kernel.h>
1415 #include <linux/module.h>
1516 #include <linux/mutex.h>
1617 #include <linux/platform_device.h>
@@ -22,8 +23,11 @@ · 5 unmodified lines
2223 #define JZ_ADC_REG_ADTCH 0x18
2324 #define JZ_ADC_REG_ADBDAT 0x1c
2425 #define JZ_ADC_REG_ADSDAT 0x20
26+#define JZ_ADC_REG_ADCLK 0x28
2527
2628 #define JZ_ADC_REG_CFG_BAT_MD BIT(4)
29+#define JZ_ADC_REG_ADCLK_CLKDIV_LSB 0
30+#define JZ_ADC_REG_ADCLK_CLKDIV10US_LSB 16
2731
2832 #define JZ_ADC_AUX_VREF 3300
2933 #define JZ_ADC_AUX_VREF_BITS 12
@@ -34,6 +38,8 @@ · 4 unmodified lines
3438 #define JZ4740_ADC_BATTERY_HIGH_VREF (7500 * 0.986)
3539 #define JZ4740_ADC_BATTERY_HIGH_VREF_BITS 12
3640
41+struct ingenic_adc;
42+
3743 struct ingenic_adc_soc_data {
3844 unsigned int battery_high_vref;
3945 unsigned int battery_high_vref_bits;
@@ -41,6 +47,7 @@ struct ingenic_adc_soc_data { · 1 unmodified line
4147 size_t battery_raw_avail_size;
4248 const int *battery_scale_avail;
4349 size_t battery_scale_avail_size;
50+ int (*init_clk_div)(struct device *dev, struct ingenic_adc *adc);
4451 };
4552
4653 struct ingenic_adc {
@@ -151,6 +158,42 @@ static const int jz4740_adc_battery_scale_avail[] = { · 104 unmodified lines
151158 JZ_ADC_BATTERY_LOW_VREF, JZ_ADC_BATTERY_LOW_VREF_BITS,
152159 };
153160
161+static int jz4725b_adc_init_clk_div(struct device *dev, struct ingenic_adc *adc)
162+{
163+ struct clk *parent_clk;
164+ unsigned long parent_rate, rate;
165+ unsigned int div_main, div_10us;
166+
167+ parent_clk = clk_get_parent(adc->clk);
168+ if (!parent_clk) {
169+ dev_err(dev, "ADC clock has no parent\n");
170+ return -ENODEV;
171+ }
172+ parent_rate = clk_get_rate(parent_clk);
173+
174+ /*
175+ * The JZ4725B ADC works at 500 kHz to 8 MHz.
176+ * We pick the highest rate possible.
177+ * In practice we typically get 6 MHz, half of the 12 MHz EXT clock.
178+ */
179+ div_main = DIV_ROUND_UP(parent_rate, 8000000);
180+ div_main = clamp(div_main, 1u, 64u);
181+ rate = parent_rate / div_main;
182+ if (rate < 500000 || rate > 8000000) {
183+ dev_err(dev, "No valid divider for ADC main clock\n");
184+ return -EINVAL;
185+ }
186+
187+ /* We also need a divider that produces a 10us clock. */
188+ div_10us = DIV_ROUND_UP(rate, 100000);
189+
190+ writel(((div_10us - 1) << JZ_ADC_REG_ADCLK_CLKDIV10US_LSB) |
191+ (div_main - 1) << JZ_ADC_REG_ADCLK_CLKDIV_LSB,
192+ adc->base + JZ_ADC_REG_ADCLK);
193+
194+ return 0;
195+}
196+
154197 static const struct ingenic_adc_soc_data jz4725b_adc_soc_data = {
155198 .battery_high_vref = JZ4725B_ADC_BATTERY_HIGH_VREF,
156199 .battery_high_vref_bits = JZ4725B_ADC_BATTERY_HIGH_VREF_BITS,
@@ -158,6 +201,7 @@ static const struct ingenic_adc_soc_data jz4725b_adc_soc_data = { · 1 unmodified line
158201 .battery_raw_avail_size = ARRAY_SIZE(jz4725b_adc_battery_raw_avail),
159202 .battery_scale_avail = jz4725b_adc_battery_scale_avail,
160203 .battery_scale_avail_size = ARRAY_SIZE(jz4725b_adc_battery_scale_avail),
204+ .init_clk_div = jz4725b_adc_init_clk_div,
161205 };
162206
163207 static const struct ingenic_adc_soc_data jz4740_adc_soc_data = {
@@ -167,6 +211,7 @@ static const struct ingenic_adc_soc_data jz4740_adc_soc_data = { · 3 unmodified lines
167211 .battery_raw_avail_size = ARRAY_SIZE(jz4740_adc_battery_raw_avail),
168212 .battery_scale_avail = jz4740_adc_battery_scale_avail,
169213 .battery_scale_avail_size = ARRAY_SIZE(jz4740_adc_battery_scale_avail),
214+ .init_clk_div = NULL, /* no ADCLK register on JZ4740 */
170215 };
171216
172217 static int ingenic_adc_read_avail(struct iio_dev *iio_dev,
@@ -317,6 +362,15 @@ static int ingenic_adc_probe(struct platform_device *pdev) · 144 unmodified lines
317362 return ret;
318363 }
319364
365+ /* Set clock dividers. */
366+ if (soc_data->init_clk_div) {
367+ ret = soc_data->init_clk_div(dev, adc);
368+ if (ret) {
369+ clk_disable_unprepare(adc->clk);
370+ return ret;
371+ }
372+ }
373+
320374 /* Put hardware in a known passive state. */
321375 writeb(0x00, adc->base + JZ_ADC_REG_ENABLE);
322376 writeb(0xff, adc->base + JZ_ADC_REG_CTRL);
drivers/iio/adc/max9611.c+1−1
@@ -83,7 +83,7 @@ · 82 unmodified lines
8383 #define MAX9611_TEMP_MAX_POS 0x7f80
8484 #define MAX9611_TEMP_MAX_NEG 0xff80
8585 #define MAX9611_TEMP_MIN_NEG 0xd980
86−#define MAX9611_TEMP_MASK GENMASK(7, 15)
86+#define MAX9611_TEMP_MASK GENMASK(15, 7)
8787 #define MAX9611_TEMP_SHIFT 0x07
8888 #define MAX9611_TEMP_RAW(_r) ((_r) >> MAX9611_TEMP_SHIFT)
8989 #define MAX9611_TEMP_SCALE_NUM 1000000
drivers/iio/adc/rcar-gyroadc.c+2−2
@@ -382,7 +382,7 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev) · 381 unmodified lines
382382 dev_err(dev,
383383 "Only %i channels supported with %pOFn, but reg = <%i>.\n",
384384 num_channels, child, reg);
385− return ret;
385+ return -EINVAL;
386386 }
387387 }
388388
@@ -391,7 +391,7 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev) · 2 unmodified lines
391391 dev_err(dev,
392392 "Channel %i uses different ADC mode than the rest.\n",
393393 reg);
394− return ret;
394+ return -EINVAL;
395395 }
396396
397397 /* Channel is valid, grab the regulator. */
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c+43−0
@@ -845,6 +845,25 @@ static const struct iio_chan_spec inv_mpu_channels[] = { · 844 unmodified lines
845845 INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Z, INV_MPU6050_SCAN_ACCL_Z),
846846 };
847847
848+static const unsigned long inv_mpu_scan_masks[] = {
849+ /* 3-axis accel */
850+ BIT(INV_MPU6050_SCAN_ACCL_X)
851+ | BIT(INV_MPU6050_SCAN_ACCL_Y)
852+ | BIT(INV_MPU6050_SCAN_ACCL_Z),
853+ /* 3-axis gyro */
854+ BIT(INV_MPU6050_SCAN_GYRO_X)
855+ | BIT(INV_MPU6050_SCAN_GYRO_Y)
856+ | BIT(INV_MPU6050_SCAN_GYRO_Z),
857+ /* 6-axis accel + gyro */
858+ BIT(INV_MPU6050_SCAN_ACCL_X)
859+ | BIT(INV_MPU6050_SCAN_ACCL_Y)
860+ | BIT(INV_MPU6050_SCAN_ACCL_Z)
861+ | BIT(INV_MPU6050_SCAN_GYRO_X)
862+ | BIT(INV_MPU6050_SCAN_GYRO_Y)
863+ | BIT(INV_MPU6050_SCAN_GYRO_Z),
864+ 0,
865+};
866+
848867 static const struct iio_chan_spec inv_icm20602_channels[] = {
849868 IIO_CHAN_SOFT_TIMESTAMP(INV_ICM20602_SCAN_TIMESTAMP),
850869 {
@@ -871,6 +890,28 @@ static const struct iio_chan_spec inv_icm20602_channels[] = { · 20 unmodified lines
871890 INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Z, INV_ICM20602_SCAN_ACCL_Z),
872891 };
873892
893+static const unsigned long inv_icm20602_scan_masks[] = {
894+ /* 3-axis accel + temp (mandatory) */
895+ BIT(INV_ICM20602_SCAN_ACCL_X)
896+ | BIT(INV_ICM20602_SCAN_ACCL_Y)
897+ | BIT(INV_ICM20602_SCAN_ACCL_Z)
898+ | BIT(INV_ICM20602_SCAN_TEMP),
899+ /* 3-axis gyro + temp (mandatory) */
900+ BIT(INV_ICM20602_SCAN_GYRO_X)
901+ | BIT(INV_ICM20602_SCAN_GYRO_Y)
902+ | BIT(INV_ICM20602_SCAN_GYRO_Z)
903+ | BIT(INV_ICM20602_SCAN_TEMP),
904+ /* 6-axis accel + gyro + temp (mandatory) */
905+ BIT(INV_ICM20602_SCAN_ACCL_X)
906+ | BIT(INV_ICM20602_SCAN_ACCL_Y)
907+ | BIT(INV_ICM20602_SCAN_ACCL_Z)
908+ | BIT(INV_ICM20602_SCAN_GYRO_X)
909+ | BIT(INV_ICM20602_SCAN_GYRO_Y)
910+ | BIT(INV_ICM20602_SCAN_GYRO_Z)
911+ | BIT(INV_ICM20602_SCAN_TEMP),
912+ 0,
913+};
914+
874915 /*
875916 * The user can choose any frequency between INV_MPU6050_MIN_FIFO_RATE and
876917 * INV_MPU6050_MAX_FIFO_RATE, but only these frequencies are matched by the
@@ -1130,9 +1171,11 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name, · 253 unmodified lines
11301171 if (chip_type == INV_ICM20602) {
11311172 indio_dev->channels = inv_icm20602_channels;
11321173 indio_dev->num_channels = ARRAY_SIZE(inv_icm20602_channels);
1174+ indio_dev->available_scan_masks = inv_icm20602_scan_masks;
11331175 } else {
11341176 indio_dev->channels = inv_mpu_channels;
11351177 indio_dev->num_channels = ARRAY_SIZE(inv_mpu_channels);
1178+ indio_dev->available_scan_masks = inv_mpu_scan_masks;
11361179 }
11371180
11381181 indio_dev->info = &mpu_info;
drivers/infiniband/core/core_priv.h+4−1
@@ -302,7 +302,9 @@ static inline struct ib_qp *_ib_create_qp(struct ib_device *dev, · 301 unmodified lines
302302 struct ib_udata *udata,
303303 struct ib_uobject *uobj)
304304 {
305+ enum ib_qp_type qp_type = attr->qp_type;
305306 struct ib_qp *qp;
307+ bool is_xrc;
306308
307309 if (!dev->ops.create_qp)
308310 return ERR_PTR(-EOPNOTSUPP);
@@ -320,7 +322,8 @@ static inline struct ib_qp *_ib_create_qp(struct ib_device *dev, · 11 unmodified lines
320322 * and more importantly they are created internaly by driver,
321323 * see mlx5 create_dev_resources() as an example.
322324 */
323− if (attr->qp_type < IB_QPT_XRC_INI) {
325+ is_xrc = qp_type == IB_QPT_XRC_INI || qp_type == IB_QPT_XRC_TGT;
326+ if ((qp_type < IB_QPT_MAX && !is_xrc) || qp_type == IB_QPT_DRIVER) {
324327 qp->res.type = RDMA_RESTRACK_QP;
325328 if (uobj)
326329 rdma_restrack_uadd(&qp->res);
drivers/infiniband/core/counters.c+7−4
@@ -393,6 +393,9 @@ u64 rdma_counter_get_hwstat_value(struct ib_device *dev, u8 port, u32 index) · 392 unmodified lines
393393 u64 sum;
394394
395395 port_counter = &dev->port_data[port].port_counter;
396+ if (!port_counter->hstats)
397+ return 0;
398+
396399 sum = get_running_counters_hwstat_sum(dev, port, index);
397400 sum += port_counter->hstats->value[index];
398401
@@ -594,7 +597,7 @@ void rdma_counter_init(struct ib_device *dev) · 195 unmodified lines
594597 struct rdma_port_counter *port_counter;
595598 u32 port;
596599
597− if (!dev->ops.alloc_hw_stats || !dev->port_data)
600+ if (!dev->port_data)
598601 return;
599602
600603 rdma_for_each_port(dev, port) {
@@ -602,6 +605,9 @@ void rdma_counter_init(struct ib_device *dev) · 1 unmodified line
602605 port_counter->mode.mode = RDMA_COUNTER_MODE_NONE;
603606 mutex_init(&port_counter->lock);
604607
608+ if (!dev->ops.alloc_hw_stats)
609+ continue;
610+
605611 port_counter->hstats = dev->ops.alloc_hw_stats(dev, port);
606612 if (!port_counter->hstats)
607613 goto fail;
@@ -624,9 +630,6 @@ void rdma_counter_release(struct ib_device *dev) · 16 unmodified lines
624630 struct rdma_port_counter *port_counter;
625631 u32 port;
626632
627− if (!dev->ops.alloc_hw_stats)
628− return;
629−
630633 rdma_for_each_port(dev, port) {
631634 port_counter = &dev->port_data[port].port_counter;
632635 kfree(port_counter->hstats);
drivers/infiniband/core/device.c+68−34
@@ -94,11 +94,17 @@ static DEFINE_XARRAY_FLAGS(devices, XA_FLAGS_ALLOC); · 93 unmodified lines
9494 static DECLARE_RWSEM(devices_rwsem);
9595 #define DEVICE_REGISTERED XA_MARK_1
9696
97−static LIST_HEAD(client_list);
97+static u32 highest_client_id;
9898 #define CLIENT_REGISTERED XA_MARK_1
9999 static DEFINE_XARRAY_FLAGS(clients, XA_FLAGS_ALLOC);
100100 static DECLARE_RWSEM(clients_rwsem);
101101
102+static void ib_client_put(struct ib_client *client)
103+{
104+ if (refcount_dec_and_test(&client->uses))
105+ complete(&client->uses_zero);
106+}
107+
102108 /*
103109 * If client_data is registered then the corresponding client must also still
104110 * be registered.
@@ -660,6 +666,14 @@ static int add_client_context(struct ib_device *device, · 555 unmodified lines
660666 return 0;
661667
662668 down_write(&device->client_data_rwsem);
669+ /*
670+ * So long as the client is registered hold both the client and device
671+ * unregistration locks.
672+ */
673+ if (!refcount_inc_not_zero(&client->uses))
674+ goto out_unlock;
675+ refcount_inc(&device->refcount);
676+
663677 /*
664678 * Another caller to add_client_context got here first and has already
665679 * completely initialized context.
@@ -683,6 +697,9 @@ static int add_client_context(struct ib_device *device, · 17 unmodified lines
683697 return 0;
684698
685699 out:
700+ ib_device_put(device);
701+ ib_client_put(client);
702+out_unlock:
686703 up_write(&device->client_data_rwsem);
687704 return ret;
688705 }
@@ -702,7 +719,7 @@ static void remove_client_context(struct ib_device *device, · 13 unmodified lines
702719 client_data = xa_load(&device->client_data, client_id);
703720 xa_clear_mark(&device->client_data, client_id, CLIENT_DATA_REGISTERED);
704721 client = xa_load(&clients, client_id);
705− downgrade_write(&device->client_data_rwsem);
722+ up_write(&device->client_data_rwsem);
706723
707724 /*
708725 * Notice we cannot be holding any exclusive locks when calling the
@@ -712,17 +729,13 @@ static void remove_client_context(struct ib_device *device, · 3 unmodified lines
712729 *
713730 * For this reason clients and drivers should not call the
714731 * unregistration functions will holdling any locks.
715− *
716− * It tempting to drop the client_data_rwsem too, but this is required
717− * to ensure that unregister_client does not return until all clients
718− * are completely unregistered, which is required to avoid module
719− * unloading races.
720732 */
721733 if (client->remove)
722734 client->remove(device, client_data);
723735
724736 xa_erase(&device->client_data, client_id);
725− up_read(&device->client_data_rwsem);
737+ ib_device_put(device);
738+ ib_client_put(client);
726739 }
727740
728741 static int alloc_port_data(struct ib_device *device)
@@ -1224,7 +1237,7 @@ static int setup_device(struct ib_device *device) · 495 unmodified lines
12241237
12251238 static void disable_device(struct ib_device *device)
12261239 {
1227− struct ib_client *client;
1240+ u32 cid;
12281241
12291242 WARN_ON(!refcount_read(&device->refcount));
12301243
@@ -1232,10 +1245,19 @@ static void disable_device(struct ib_device *device) · 1 unmodified line
12321245 xa_clear_mark(&devices, device->index, DEVICE_REGISTERED);
12331246 up_write(&devices_rwsem);
12341247
1248+ /*
1249+ * Remove clients in LIFO order, see assign_client_id. This could be
1250+ * more efficient if xarray learns to reverse iterate. Since no new
1251+ * clients can be added to this ib_device past this point we only need
1252+ * the maximum possible client_id value here.
1253+ */
12351254 down_read(&clients_rwsem);
1236− list_for_each_entry_reverse(client, &client_list, list)
1237− remove_client_context(device, client->client_id);
1255+ cid = highest_client_id;
12381256 up_read(&clients_rwsem);
1257+ while (cid) {
1258+ cid--;
1259+ remove_client_context(device, cid);
1260+ }
12391261
12401262 /* Pairs with refcount_set in enable_device */
12411263 ib_device_put(device);
@@ -1662,30 +1684,31 @@ static int assign_client_id(struct ib_client *client) · 420 unmodified lines
16621684 /*
16631685 * The add/remove callbacks must be called in FIFO/LIFO order. To
16641686 * achieve this we assign client_ids so they are sorted in
1665− * registration order, and retain a linked list we can reverse iterate
1666− * to get the LIFO order. The extra linked list can go away if xarray
1667− * learns to reverse iterate.
1687+ * registration order.
16681688 */
1669− if (list_empty(&client_list)) {
1670− client->client_id = 0;
1671− } else {
1672− struct ib_client *last;
1673−
1674− last = list_last_entry(&client_list, struct ib_client, list);
1675− client->client_id = last->client_id + 1;
1676− }
1689+ client->client_id = highest_client_id;
16771690 ret = xa_insert(&clients, client->client_id, client, GFP_KERNEL);
16781691 if (ret)
16791692 goto out;
16801693
1694+ highest_client_id++;
16811695 xa_set_mark(&clients, client->client_id, CLIENT_REGISTERED);
1682− list_add_tail(&client->list, &client_list);
16831696
16841697 out:
16851698 up_write(&clients_rwsem);
16861699 return ret;
16871700 }
16881701
1702+static void remove_client_id(struct ib_client *client)
1703+{
1704+ down_write(&clients_rwsem);
1705+ xa_erase(&clients, client->client_id);
1706+ for (; highest_client_id; highest_client_id--)
1707+ if (xa_load(&clients, highest_client_id - 1))
1708+ break;
1709+ up_write(&clients_rwsem);
1710+}
1711+
16891712 /**
16901713 * ib_register_client - Register an IB client
16911714 * @client:Client to register
@@ -1705,6 +1728,8 @@ int ib_register_client(struct ib_client *client) · 13 unmodified lines
17051728 unsigned long index;
17061729 int ret;
17071730
1731+ refcount_set(&client->uses, 1);
1732+ init_completion(&client->uses_zero);
17081733 ret = assign_client_id(client);
17091734 if (ret)
17101735 return ret;
@@ -1740,21 +1765,30 @@ void ib_unregister_client(struct ib_client *client) · 29 unmodified lines
17401765 unsigned long index;
17411766
17421767 down_write(&clients_rwsem);
1768+ ib_client_put(client);
17431769 xa_clear_mark(&clients, client->client_id, CLIENT_REGISTERED);
17441770 up_write(&clients_rwsem);
1745− /*
1746− * Every device still known must be serialized to make sure we are
1747− * done with the client callbacks before we return.
1748− */
1749− down_read(&devices_rwsem);
1750− xa_for_each (&devices, index, device)
1771+
1772+ /* We do not want to have locks while calling client->remove() */
1773+ rcu_read_lock();
1774+ xa_for_each (&devices, index, device) {
1775+ if (!ib_device_try_get(device))
1776+ continue;
1777+ rcu_read_unlock();
1778+
17511779 remove_client_context(device, client->client_id);
1752− up_read(&devices_rwsem);
17531780
1754− down_write(&clients_rwsem);
1755− list_del(&client->list);
1756− xa_erase(&clients, client->client_id);
1757− up_write(&clients_rwsem);
1781+ ib_device_put(device);
1782+ rcu_read_lock();
1783+ }
1784+ rcu_read_unlock();
1785+
1786+ /*
1787+ * remove_client_context() is not a fence, it can return even though a
1788+ * removal is ongoing. Wait until all removals are completed.
1789+ */
1790+ wait_for_completion(&client->uses_zero);
1791+ remove_client_id(client);
17581792 }
17591793 EXPORT_SYMBOL(ib_unregister_client);
17601794
drivers/infiniband/core/mad.c+10−10
@@ -3224,18 +3224,18 @@ static int ib_mad_port_open(struct ib_device *device, · 3223 unmodified lines
32243224 if (has_smi)
32253225 cq_size *= 2;
32263226
3227+ port_priv->pd = ib_alloc_pd(device, 0);
3228+ if (IS_ERR(port_priv->pd)) {
3229+ dev_err(&device->dev, "Couldn't create ib_mad PD\n");
3230+ ret = PTR_ERR(port_priv->pd);
3231+ goto error3;
3232+ }
3233+
32273234 port_priv->cq = ib_alloc_cq(port_priv->device, port_priv, cq_size, 0,
32283235 IB_POLL_UNBOUND_WORKQUEUE);
32293236 if (IS_ERR(port_priv->cq)) {
32303237 dev_err(&device->dev, "Couldn't create ib_mad CQ\n");
32313238 ret = PTR_ERR(port_priv->cq);
3232− goto error3;
3233− }
3234−
3235− port_priv->pd = ib_alloc_pd(device, 0);
3236− if (IS_ERR(port_priv->pd)) {
3237− dev_err(&device->dev, "Couldn't create ib_mad PD\n");
3238− ret = PTR_ERR(port_priv->pd);
32393239 goto error4;
32403240 }
32413241
@@ -3278,11 +3278,11 @@ error8: · 36 unmodified lines
32783278 error7:
32793279 destroy_mad_qp(&port_priv->qp_info[0]);
32803280 error6:
3281− ib_dealloc_pd(port_priv->pd);
3282−error4:
32833281 ib_free_cq(port_priv->cq);
32843282 cleanup_recv_queue(&port_priv->qp_info[1]);
32853283 cleanup_recv_queue(&port_priv->qp_info[0]);
3284+error4:
3285+ ib_dealloc_pd(port_priv->pd);
32863286 error3:
32873287 kfree(port_priv);
32883288
@@ -3312,8 +3312,8 @@ static int ib_mad_port_close(struct ib_device *device, int port_num) · 23 unmodified lines
33123312 destroy_workqueue(port_priv->wq);
33133313 destroy_mad_qp(&port_priv->qp_info[1]);
33143314 destroy_mad_qp(&port_priv->qp_info[0]);
3315− ib_dealloc_pd(port_priv->pd);
33163315 ib_free_cq(port_priv->cq);
3316+ ib_dealloc_pd(port_priv->pd);
33173317 cleanup_recv_queue(&port_priv->qp_info[1]);
33183318 cleanup_recv_queue(&port_priv->qp_info[0]);
33193319 /* XXX: Handle deallocation of MAD registration tables */
drivers/infiniband/core/user_mad.c+5−1
@@ -49,6 +49,7 @@ · 48 unmodified lines
4949 #include <linux/sched.h>
5050 #include <linux/semaphore.h>
5151 #include <linux/slab.h>
52+#include <linux/nospec.h>
5253
5354 #include <linux/uaccess.h>
5455
@@ -884,11 +885,14 @@ static int ib_umad_unreg_agent(struct ib_umad_file *file, u32 __user *arg) · 829 unmodified lines
884885
885886 if (get_user(id, arg))
886887 return -EFAULT;
888+ if (id >= IB_UMAD_MAX_AGENTS)
889+ return -EINVAL;
887890
888891 mutex_lock(&file->port->file_mutex);
889892 mutex_lock(&file->mutex);
890893
891− if (id >= IB_UMAD_MAX_AGENTS || !__get_agent(file, id)) {
894+ id = array_index_nospec(id, IB_UMAD_MAX_AGENTS);
895+ if (!__get_agent(file, id)) {
892896 ret = -EINVAL;
893897 goto out;
894898 }
drivers/infiniband/hw/bnxt_re/ib_verbs.c+5−2
@@ -308,6 +308,7 @@ int bnxt_re_del_gid(const struct ib_gid_attr *attr, void **context) · 307 unmodified lines
308308 struct bnxt_re_dev *rdev = to_bnxt_re_dev(attr->device, ibdev);
309309 struct bnxt_qplib_sgid_tbl *sgid_tbl = &rdev->qplib_res.sgid_tbl;
310310 struct bnxt_qplib_gid *gid_to_del;
311+ u16 vlan_id = 0xFFFF;
311312
312313 /* Delete the entry from the hardware */
313314 ctx = *context;
@@ -317,7 +318,8 @@ int bnxt_re_del_gid(const struct ib_gid_attr *attr, void **context) · 3 unmodified lines
317318 if (sgid_tbl && sgid_tbl->active) {
318319 if (ctx->idx >= sgid_tbl->max)
319320 return -EINVAL;
320− gid_to_del = &sgid_tbl->tbl[ctx->idx];
321+ gid_to_del = &sgid_tbl->tbl[ctx->idx].gid;
322+ vlan_id = sgid_tbl->tbl[ctx->idx].vlan_id;
321323 /* DEL_GID is called in WQ context(netdevice_event_work_handler)
322324 * or via the ib_unregister_device path. In the former case QP1
323325 * may not be destroyed yet, in which case just return as FW
@@ -335,7 +337,8 @@ int bnxt_re_del_gid(const struct ib_gid_attr *attr, void **context) · 11 unmodified lines
335337 }
336338 ctx->refcnt--;
337339 if (!ctx->refcnt) {
338− rc = bnxt_qplib_del_sgid(sgid_tbl, gid_to_del, true);
340+ rc = bnxt_qplib_del_sgid(sgid_tbl, gid_to_del,
341+ vlan_id, true);
339342 if (rc) {
340343 dev_err(rdev_to_dev(rdev),
341344 "Failed to remove GID: %#x", rc);
drivers/infiniband/hw/bnxt_re/qplib_res.c+9−4
@@ -488,7 +488,7 @@ static int bnxt_qplib_alloc_sgid_tbl(struct bnxt_qplib_res *res, · 487 unmodified lines
488488 struct bnxt_qplib_sgid_tbl *sgid_tbl,
489489 u16 max)
490490 {
491− sgid_tbl->tbl = kcalloc(max, sizeof(struct bnxt_qplib_gid), GFP_KERNEL);
491+ sgid_tbl->tbl = kcalloc(max, sizeof(*sgid_tbl->tbl), GFP_KERNEL);
492492 if (!sgid_tbl->tbl)
493493 return -ENOMEM;
494494
@@ -526,9 +526,10 @@ static void bnxt_qplib_cleanup_sgid_tbl(struct bnxt_qplib_res *res, · 31 unmodified lines
526526 for (i = 0; i < sgid_tbl->max; i++) {
527527 if (memcmp(&sgid_tbl->tbl[i], &bnxt_qplib_gid_zero,
528528 sizeof(bnxt_qplib_gid_zero)))
529− bnxt_qplib_del_sgid(sgid_tbl, &sgid_tbl->tbl[i], true);
529+ bnxt_qplib_del_sgid(sgid_tbl, &sgid_tbl->tbl[i].gid,
530+ sgid_tbl->tbl[i].vlan_id, true);
530531 }
531− memset(sgid_tbl->tbl, 0, sizeof(struct bnxt_qplib_gid) * sgid_tbl->max);
532+ memset(sgid_tbl->tbl, 0, sizeof(*sgid_tbl->tbl) * sgid_tbl->max);
532533 memset(sgid_tbl->hw_id, -1, sizeof(u16) * sgid_tbl->max);
533534 memset(sgid_tbl->vlan, 0, sizeof(u8) * sgid_tbl->max);
534535 sgid_tbl->active = 0;
@@ -537,7 +538,11 @@ static void bnxt_qplib_cleanup_sgid_tbl(struct bnxt_qplib_res *res, · 2 unmodified lines
537538 static void bnxt_qplib_init_sgid_tbl(struct bnxt_qplib_sgid_tbl *sgid_tbl,
538539 struct net_device *netdev)
539540 {
540− memset(sgid_tbl->tbl, 0, sizeof(struct bnxt_qplib_gid) * sgid_tbl->max);
541+ u32 i;
542+
543+ for (i = 0; i < sgid_tbl->max; i++)
544+ sgid_tbl->tbl[i].vlan_id = 0xffff;
545+
541546 memset(sgid_tbl->hw_id, -1, sizeof(u16) * sgid_tbl->max);
542547 }
543548
drivers/infiniband/hw/bnxt_re/qplib_res.h+1−1
@@ -111,7 +111,7 @@ struct bnxt_qplib_pd_tbl { · 110 unmodified lines
111111 };
112112
113113 struct bnxt_qplib_sgid_tbl {
114− struct bnxt_qplib_gid *tbl;
114+ struct bnxt_qplib_gid_info *tbl;
115115 u16 *hw_id;
116116 u16 max;
117117 u16 active;
drivers/infiniband/hw/bnxt_re/qplib_sp.c+9−5
@@ -213,12 +213,12 @@ int bnxt_qplib_get_sgid(struct bnxt_qplib_res *res, · 212 unmodified lines
213213 index, sgid_tbl->max);
214214 return -EINVAL;
215215 }
216− memcpy(gid, &sgid_tbl->tbl[index], sizeof(*gid));
216+ memcpy(gid, &sgid_tbl->tbl[index].gid, sizeof(*gid));
217217 return 0;
218218 }
219219
220220 int bnxt_qplib_del_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl,
221− struct bnxt_qplib_gid *gid, bool update)
221+ struct bnxt_qplib_gid *gid, u16 vlan_id, bool update)
222222 {
223223 struct bnxt_qplib_res *res = to_bnxt_qplib(sgid_tbl,
224224 struct bnxt_qplib_res,
@@ -236,7 +236,8 @@ int bnxt_qplib_del_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, · 11 unmodified lines
236236 return -ENOMEM;
237237 }
238238 for (index = 0; index < sgid_tbl->max; index++) {
239− if (!memcmp(&sgid_tbl->tbl[index], gid, sizeof(*gid)))
239+ if (!memcmp(&sgid_tbl->tbl[index].gid, gid, sizeof(*gid)) &&
240+ vlan_id == sgid_tbl->tbl[index].vlan_id)
240241 break;
241242 }
242243 if (index == sgid_tbl->max) {
@@ -262,8 +263,9 @@ int bnxt_qplib_del_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, · 19 unmodified lines
262263 if (rc)
263264 return rc;
264265 }
265− memcpy(&sgid_tbl->tbl[index], &bnxt_qplib_gid_zero,
266+ memcpy(&sgid_tbl->tbl[index].gid, &bnxt_qplib_gid_zero,
266267 sizeof(bnxt_qplib_gid_zero));
268+ sgid_tbl->tbl[index].vlan_id = 0xFFFF;
267269 sgid_tbl->vlan[index] = 0;
268270 sgid_tbl->active--;
269271 dev_dbg(&res->pdev->dev,
@@ -296,7 +298,8 @@ int bnxt_qplib_add_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, · 26 unmodified lines
296298 }
297299 free_idx = sgid_tbl->max;
298300 for (i = 0; i < sgid_tbl->max; i++) {
299− if (!memcmp(&sgid_tbl->tbl[i], gid, sizeof(*gid))) {
301+ if (!memcmp(&sgid_tbl->tbl[i], gid, sizeof(*gid)) &&
302+ sgid_tbl->tbl[i].vlan_id == vlan_id) {
300303 dev_dbg(&res->pdev->dev,
301304 "SGID entry already exist in entry %d!\n", i);
302305 *index = i;
@@ -351,6 +354,7 @@ int bnxt_qplib_add_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, · 48 unmodified lines
351354 }
352355 /* Add GID to the sgid_tbl */
353356 memcpy(&sgid_tbl->tbl[free_idx], gid, sizeof(*gid));
357+ sgid_tbl->tbl[free_idx].vlan_id = vlan_id;
354358 sgid_tbl->active++;
355359 if (vlan_id != 0xFFFF)
356360 sgid_tbl->vlan[free_idx] = 1;
drivers/infiniband/hw/bnxt_re/qplib_sp.h+6−1
@@ -84,6 +84,11 @@ struct bnxt_qplib_gid { · 83 unmodified lines
8484 u8 data[16];
8585 };
8686
87+struct bnxt_qplib_gid_info {
88+ struct bnxt_qplib_gid gid;
89+ u16 vlan_id;
90+};
91+
8792 struct bnxt_qplib_ah {
8893 struct bnxt_qplib_gid dgid;
8994 struct bnxt_qplib_pd *pd;
@@ -221,7 +226,7 @@ int bnxt_qplib_get_sgid(struct bnxt_qplib_res *res, · 131 unmodified lines
221226 struct bnxt_qplib_sgid_tbl *sgid_tbl, int index,
222227 struct bnxt_qplib_gid *gid);
223228 int bnxt_qplib_del_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl,
224− struct bnxt_qplib_gid *gid, bool update);
229+ struct bnxt_qplib_gid *gid, u16 vlan_id, bool update);
225230 int bnxt_qplib_add_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl,
226231 struct bnxt_qplib_gid *gid, u8 *mac, u16 vlan_id,
227232 bool update, u32 *index);
drivers/infiniband/hw/hfi1/chip.c+9−2
@@ -14452,7 +14452,7 @@ void hfi1_deinit_vnic_rsm(struct hfi1_devdata *dd) · 14451 unmodified lines
1445214452 clear_rcvctrl(dd, RCV_CTRL_RCV_RSM_ENABLE_SMASK);
1445314453 }
1445414454
14455−static void init_rxe(struct hfi1_devdata *dd)
14455+static int init_rxe(struct hfi1_devdata *dd)
1445614456 {
1445714457 struct rsm_map_table *rmt;
1445814458 u64 val;
@@ -14461,6 +14461,9 @@ static void init_rxe(struct hfi1_devdata *dd) · 2 unmodified lines
1446114461 write_csr(dd, RCV_ERR_MASK, ~0ull);
1446214462
1446314463 rmt = alloc_rsm_map_table(dd);
14464+ if (!rmt)
14465+ return -ENOMEM;
14466+
1446414467 /* set up QOS, including the QPN map table */
1446514468 init_qos(dd, rmt);
1446614469 init_fecn_handling(dd, rmt);
@@ -14487,6 +14490,7 @@ static void init_rxe(struct hfi1_devdata *dd) · 20 unmodified lines
1448714490 val |= ((4ull & RCV_BYPASS_HDR_SIZE_MASK) <<
1448814491 RCV_BYPASS_HDR_SIZE_SHIFT);
1448914492 write_csr(dd, RCV_BYPASS, val);
14493+ return 0;
1449014494 }
1449114495
1449214496 static void init_other(struct hfi1_devdata *dd)
@@ -15024,7 +15028,10 @@ int hfi1_init_dd(struct hfi1_devdata *dd) · 531 unmodified lines
1502415028 goto bail_cleanup;
1502515029
1502615030 /* set initial RXE CSRs */
15027− init_rxe(dd);
15031+ ret = init_rxe(dd);
15032+ if (ret)
15033+ goto bail_cleanup;
15034+
1502815035 /* set initial TXE CSRs */
1502915036 init_txe(dd);
1503015037 /* set initial non-RXE, non-TXE CSRs */
drivers/infiniband/hw/hfi1/rc.c+0−2
@@ -1835,7 +1835,6 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct hfi1_opa_header *opah) · 1834 unmodified lines
18351835 cmp_psn(qp->s_sending_psn, qp->s_sending_hpsn) <= 0)
18361836 break;
18371837 trdma_clean_swqe(qp, wqe);
1838− rvt_qp_wqe_unreserve(qp, wqe);
18391838 trace_hfi1_qp_send_completion(qp, wqe, qp->s_last);
18401839 rvt_qp_complete_swqe(qp,
18411840 wqe,
@@ -1882,7 +1881,6 @@ struct rvt_swqe *do_rc_completion(struct rvt_qp *qp, · 40 unmodified lines
18821881 if (cmp_psn(wqe->lpsn, qp->s_sending_psn) < 0 ||
18831882 cmp_psn(qp->s_sending_psn, qp->s_sending_hpsn) > 0) {
18841883 trdma_clean_swqe(qp, wqe);
1885− rvt_qp_wqe_unreserve(qp, wqe);
18861884 trace_hfi1_qp_send_completion(qp, wqe, qp->s_last);
18871885 rvt_qp_complete_swqe(qp,
18881886 wqe,
drivers/infiniband/hw/hfi1/tid_rdma.c+2−41
@@ -1620,6 +1620,7 @@ static int hfi1_kern_exp_rcv_alloc_flows(struct tid_rdma_request *req, · 1619 unmodified lines
16201620 flows[i].req = req;
16211621 flows[i].npagesets = 0;
16221622 flows[i].pagesets[0].mapped = 0;
1623+ flows[i].resync_npkts = 0;
16231624 }
16241625 req->flows = flows;
16251626 return 0;
@@ -1673,34 +1674,6 @@ static struct tid_rdma_flow *find_flow_ib(struct tid_rdma_request *req, · 47 unmodified lines
16731674 return NULL;
16741675 }
16751676
1676−static struct tid_rdma_flow *
1677−__find_flow_ranged(struct tid_rdma_request *req, u16 head, u16 tail,
1678− u32 psn, u16 *fidx)
1679−{
1680− for ( ; CIRC_CNT(head, tail, MAX_FLOWS);
1681− tail = CIRC_NEXT(tail, MAX_FLOWS)) {
1682− struct tid_rdma_flow *flow = &req->flows[tail];
1683− u32 spsn, lpsn;
1684−
1685− spsn = full_flow_psn(flow, flow->flow_state.spsn);
1686− lpsn = full_flow_psn(flow, flow->flow_state.lpsn);
1687−
1688− if (cmp_psn(psn, spsn) >= 0 && cmp_psn(psn, lpsn) <= 0) {
1689− if (fidx)
1690− *fidx = tail;
1691− return flow;
1692− }
1693− }
1694− return NULL;
1695−}
1696−
1697−static struct tid_rdma_flow *find_flow(struct tid_rdma_request *req,
1698− u32 psn, u16 *fidx)
1699−{
1700− return __find_flow_ranged(req, req->setup_head, req->clear_tail, psn,
1701− fidx);
1702−}
1703−
17041677 /* TID RDMA READ functions */
17051678 u32 hfi1_build_tid_rdma_read_packet(struct rvt_swqe *wqe,
17061679 struct ib_other_headers *ohdr, u32 *bth1,
@@ -2788,19 +2761,7 @@ static bool handle_read_kdeth_eflags(struct hfi1_ctxtdata *rcd, · 1081 unmodified lines
27882761 * to prevent continuous Flow Sequence errors for any
27892762 * packets that could be still in the fabric.
27902763 */
2791− flow = find_flow(req, psn, NULL);
2792− if (!flow) {
2793− /*
2794− * We can't find the IB PSN matching the
2795− * received KDETH PSN. The only thing we can
2796− * do at this point is report the error to
2797− * the QP.
2798− */
2799− hfi1_kern_read_tid_flow_free(qp);
2800− spin_unlock(&qp->s_lock);
2801− rvt_rc_error(qp, IB_WC_LOC_QP_OP_ERR);
2802− return ret;
2803− }
2764+ flow = &req->flows[req->clear_tail];
28042765 if (priv->s_flags & HFI1_R_TID_SW_PSN) {
28052766 diff = cmp_psn(psn,
28062767 flow->flow_state.r_next_psn);
drivers/infiniband/hw/hfi1/verbs.c+2−0
@@ -54,6 +54,7 @@ · 53 unmodified lines
5454 #include <linux/mm.h>
5555 #include <linux/vmalloc.h>
5656 #include <rdma/opa_addr.h>
57+#include <linux/nospec.h>
5758
5859 #include "hfi.h"
5960 #include "common.h"
@@ -1536,6 +1537,7 @@ static int hfi1_check_ah(struct ib_device *ibdev, struct rdma_ah_attr *ah_attr) · 1476 unmodified lines
15361537 sl = rdma_ah_get_sl(ah_attr);
15371538 if (sl >= ARRAY_SIZE(ibp->sl_to_sc))
15381539 return -EINVAL;
1540+ sl = array_index_nospec(sl, ARRAY_SIZE(ibp->sl_to_sc));
15391541
15401542 sc5 = ibp->sl_to_sc[sl];
15411543 if (sc_to_vlt(dd, sc5) > num_vls && sc_to_vlt(dd, sc5) != 0xf)
drivers/infiniband/hw/hns/Kconfig+3−3
@@ -1,6 +1,6 @@
11 # SPDX-License-Identifier: GPL-2.0-only
22 config INFINIBAND_HNS
3− tristate "HNS RoCE Driver"
3+ bool "HNS RoCE Driver"
44 depends on NET_VENDOR_HISILICON
55 depends on ARM64 || (COMPILE_TEST && 64BIT)
66 ---help---
@@ -11,7 +11,7 @@ config INFINIBAND_HNS · 4 unmodified lines
1111 To compile HIP06 or HIP08 driver as module, choose M here.
1212
1313 config INFINIBAND_HNS_HIP06
14− bool "Hisilicon Hip06 Family RoCE support"
14+ tristate "Hisilicon Hip06 Family RoCE support"
1515 depends on INFINIBAND_HNS && HNS && HNS_DSAF && HNS_ENET
1616 ---help---
1717 RoCE driver support for Hisilicon RoCE engine in Hisilicon Hip06 and
@@ -21,7 +21,7 @@ config INFINIBAND_HNS_HIP06 · 3 unmodified lines
2121 module will be called hns-roce-hw-v1
2222
2323 config INFINIBAND_HNS_HIP08
24− bool "Hisilicon Hip08 Family RoCE support"
24+ tristate "Hisilicon Hip08 Family RoCE support"
2525 depends on INFINIBAND_HNS && PCI && HNS3
2626 ---help---
2727 RoCE driver support for Hisilicon RoCE engine in Hisilicon Hip08 SoC.
drivers/infiniband/hw/hns/Makefile+2−6
@@ -9,12 +9,8 @@ hns-roce-objs := hns_roce_main.o hns_roce_cmd.o hns_roce_pd.o \ · 8 unmodified lines
99 hns_roce_ah.o hns_roce_hem.o hns_roce_mr.o hns_roce_qp.o \
1010 hns_roce_cq.o hns_roce_alloc.o hns_roce_db.o hns_roce_srq.o hns_roce_restrack.o
1111
12−ifdef CONFIG_INFINIBAND_HNS_HIP06
1312 hns-roce-hw-v1-objs := hns_roce_hw_v1.o $(hns-roce-objs)
14−obj-$(CONFIG_INFINIBAND_HNS) += hns-roce-hw-v1.o
15−endif
13+obj-$(CONFIG_INFINIBAND_HNS_HIP06) += hns-roce-hw-v1.o
1614
17−ifdef CONFIG_INFINIBAND_HNS_HIP08
1815 hns-roce-hw-v2-objs := hns_roce_hw_v2.o hns_roce_hw_v2_dfx.o $(hns-roce-objs)
19−obj-$(CONFIG_INFINIBAND_HNS) += hns-roce-hw-v2.o
20−endif
16+obj-$(CONFIG_INFINIBAND_HNS_HIP08) += hns-roce-hw-v2.o
drivers/infiniband/hw/hns/hns_roce_db.c+8−7
@@ -12,13 +12,15 @@ int hns_roce_db_map_user(struct hns_roce_ucontext *context, · 11 unmodified lines
1212 struct ib_udata *udata, unsigned long virt,
1313 struct hns_roce_db *db)
1414 {
15+ unsigned long page_addr = virt & PAGE_MASK;
1516 struct hns_roce_user_db_page *page;
17+ unsigned int offset;
1618 int ret = 0;
1719
1820 mutex_lock(&context->page_mutex);
1921
2022 list_for_each_entry(page, &context->page_list, list)
21− if (page->user_virt == (virt & PAGE_MASK))
23+ if (page->user_virt == page_addr)
2224 goto found;
2325
2426 page = kmalloc(sizeof(*page), GFP_KERNEL);
@@ -28,8 +30,8 @@ int hns_roce_db_map_user(struct hns_roce_ucontext *context, · 3 unmodified lines
2830 }
2931
3032 refcount_set(&page->refcount, 1);
31− page->user_virt = (virt & PAGE_MASK);
32− page->umem = ib_umem_get(udata, virt & PAGE_MASK, PAGE_SIZE, 0, 0);
33+ page->user_virt = page_addr;
34+ page->umem = ib_umem_get(udata, page_addr, PAGE_SIZE, 0, 0);
3335 if (IS_ERR(page->umem)) {
3436 ret = PTR_ERR(page->umem);
3537 kfree(page);
@@ -39,10 +41,9 @@ int hns_roce_db_map_user(struct hns_roce_ucontext *context, · 3 unmodified lines
3941 list_add(&page->list, &context->page_list);
4042
4143 found:
42− db->dma = sg_dma_address(page->umem->sg_head.sgl) +
43− (virt & ~PAGE_MASK);
44− page->umem->sg_head.sgl->offset = virt & ~PAGE_MASK;
45− db->virt_addr = sg_virt(page->umem->sg_head.sgl);
44+ offset = virt - page_addr;
45+ db->dma = sg_dma_address(page->umem->sg_head.sgl) + offset;
46+ db->virt_addr = sg_virt(page->umem->sg_head.sgl) + offset;
4647 db->u.user_page = page;
4748 refcount_inc(&page->refcount);
4849
drivers/infiniband/hw/hns/hns_roce_hw_v1.c+3−1
@@ -750,8 +750,10 @@ static int hns_roce_v1_rsv_lp_qp(struct hns_roce_dev *hr_dev) · 749 unmodified lines
750750 atomic_set(&free_mr->mr_free_cq->ib_cq.usecnt, 0);
751751
752752 pd = rdma_zalloc_drv_obj(ibdev, ib_pd);
753− if (!pd)
753+ if (!pd) {
754+ ret = -ENOMEM;
754755 goto alloc_mem_failed;
756+ }
755757
756758 pd->device = ibdev;
757759 ret = hns_roce_alloc_pd(pd, NULL);
drivers/infiniband/hw/mlx5/main.c+3−4
@@ -5802,13 +5802,12 @@ static void mlx5_ib_unbind_slave_port(struct mlx5_ib_dev *ibdev, · 5801 unmodified lines
58025802 return;
58035803 }
58045804
5805− if (mpi->mdev_events.notifier_call)
5806− mlx5_notifier_unregister(mpi->mdev, &mpi->mdev_events);
5807− mpi->mdev_events.notifier_call = NULL;
5808−
58095805 mpi->ibdev = NULL;
58105806
58115807 spin_unlock(&port->mp.mpi_lock);
5808+ if (mpi->mdev_events.notifier_call)
5809+ mlx5_notifier_unregister(mpi->mdev, &mpi->mdev_events);
5810+ mpi->mdev_events.notifier_call = NULL;
58125811 mlx5_remove_netdev_notifier(ibdev, port_num);
58135812 spin_lock(&port->mp.mpi_lock);
58145813
drivers/infiniband/hw/mlx5/mlx5_ib.h+1−0
@@ -481,6 +481,7 @@ struct mlx5_umr_wr { · 480 unmodified lines
481481 u64 length;
482482 int access_flags;
483483 u32 mkey;
484+ u8 ignore_free_state:1;
484485 };
485486
486487 static inline const struct mlx5_umr_wr *umr_wr(const struct ib_send_wr *wr)
drivers/infiniband/hw/mlx5/mr.c+23−27
@@ -51,22 +51,12 @@ static void clean_mr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr); · 50 unmodified lines
5151 static void dereg_mr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr);
5252 static int mr_cache_max_order(struct mlx5_ib_dev *dev);
5353 static int unreg_umr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr);
54−static bool umr_can_modify_entity_size(struct mlx5_ib_dev *dev)
55−{
56− return !MLX5_CAP_GEN(dev->mdev, umr_modify_entity_size_disabled);
57−}
5854
5955 static bool umr_can_use_indirect_mkey(struct mlx5_ib_dev *dev)
6056 {
6157 return !MLX5_CAP_GEN(dev->mdev, umr_indirect_mkey_disabled);
6258 }
6359
64−static bool use_umr(struct mlx5_ib_dev *dev, int order)
65−{
66− return order <= mr_cache_max_order(dev) &&
67− umr_can_modify_entity_size(dev);
68−}
69−
7060 static int destroy_mkey(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr)
7161 {
7262 int err = mlx5_core_destroy_mkey(dev->mdev, &mr->mmkey);
@@ -545,13 +535,16 @@ void mlx5_mr_cache_free(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr) · 472 unmodified lines
545535 return;
546536
547537 c = order2idx(dev, mr->order);
548− if (c < 0 || c >= MAX_MR_CACHE_ENTRIES) {
549− mlx5_ib_warn(dev, "order %d, cache index %d\n", mr->order, c);
550− return;
551− }
538+ WARN_ON(c < 0 || c >= MAX_MR_CACHE_ENTRIES);
552539
553− if (unreg_umr(dev, mr))
540+ if (unreg_umr(dev, mr)) {
541+ mr->allocated_from_cache = false;
542+ destroy_mkey(dev, mr);
543+ ent = &cache->ent[c];
544+ if (ent->cur < ent->limit)
545+ queue_work(cache->wq, &ent->work);
554546 return;
547+ }
555548
556549 ent = &cache->ent[c];
557550 spin_lock_irq(&ent->lock);
@@ -1268,7 +1261,7 @@ struct ib_mr *mlx5_ib_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, · 710 unmodified lines
12681261 {
12691262 struct mlx5_ib_dev *dev = to_mdev(pd->device);
12701263 struct mlx5_ib_mr *mr = NULL;
1271− bool populate_mtts = false;
1264+ bool use_umr;
12721265 struct ib_umem *umem;
12731266 int page_shift;
12741267 int npages;
@@ -1300,29 +1293,30 @@ struct ib_mr *mlx5_ib_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, · 25 unmodified lines
13001293 if (err < 0)
13011294 return ERR_PTR(err);
13021295
1303− if (use_umr(dev, order)) {
1296+ use_umr = !MLX5_CAP_GEN(dev->mdev, umr_modify_entity_size_disabled) &&
1297+ (!MLX5_CAP_GEN(dev->mdev, umr_modify_atomic_disabled) ||
1298+ !MLX5_CAP_GEN(dev->mdev, atomic));
1299+
1300+ if (order <= mr_cache_max_order(dev) && use_umr) {
13041301 mr = alloc_mr_from_cache(pd, umem, virt_addr, length, ncont,
13051302 page_shift, order, access_flags);
13061303 if (PTR_ERR(mr) == -EAGAIN) {
13071304 mlx5_ib_dbg(dev, "cache empty for order %d\n", order);
13081305 mr = NULL;
13091306 }
1310− populate_mtts = false;
13111307 } else if (!MLX5_CAP_GEN(dev->mdev, umr_extended_translation_offset)) {
13121308 if (access_flags & IB_ACCESS_ON_DEMAND) {
13131309 err = -EINVAL;
13141310 pr_err("Got MR registration for ODP MR > 512MB, not supported for Connect-IB\n");
13151311 goto error;
13161312 }
1317− populate_mtts = true;
1313+ use_umr = false;
13181314 }
13191315
13201316 if (!mr) {
1321− if (!umr_can_modify_entity_size(dev))
1322− populate_mtts = true;
13231317 mutex_lock(&dev->slow_path_mutex);
13241318 mr = reg_create(NULL, pd, virt_addr, length, umem, ncont,
1325− page_shift, access_flags, populate_mtts);
1319+ page_shift, access_flags, !use_umr);
13261320 mutex_unlock(&dev->slow_path_mutex);
13271321 }
13281322
@@ -1338,7 +1332,7 @@ struct ib_mr *mlx5_ib_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, · 9 unmodified lines
13381332
13391333 update_odp_mr(mr);
13401334
1341− if (!populate_mtts) {
1335+ if (use_umr) {
13421336 int update_xlt_flags = MLX5_IB_UPD_XLT_ENABLE;
13431337
13441338 if (access_flags & IB_ACCESS_ON_DEMAND)
@@ -1373,9 +1367,11 @@ static int unreg_umr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr) · 28 unmodified lines
13731367 return 0;
13741368
13751369 umrwr.wr.send_flags = MLX5_IB_SEND_UMR_DISABLE_MR |
1376− MLX5_IB_SEND_UMR_FAIL_IF_FREE;
1370+ MLX5_IB_SEND_UMR_UPDATE_PD_ACCESS;
13771371 umrwr.wr.opcode = MLX5_IB_WR_UMR;
1372+ umrwr.pd = dev->umrc.pd;
13781373 umrwr.mkey = mr->mmkey.key;
1374+ umrwr.ignore_free_state = 1;
13791375
13801376 return mlx5_ib_post_send_wait(dev, &umrwr);
13811377 }
@@ -1577,10 +1573,10 @@ static void clean_mr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr) · 195 unmodified lines
15771573 mr->sig = NULL;
15781574 }
15791575
1580− mlx5_free_priv_descs(mr);
1581−
1582− if (!allocated_from_cache)
1576+ if (!allocated_from_cache) {
15831577 destroy_mkey(dev, mr);
1578+ mlx5_free_priv_descs(mr);
1579+ }
15841580 }
15851581
15861582 static void dereg_mr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr)
drivers/infiniband/hw/mlx5/odp.c+4−3
@@ -246,7 +246,7 @@ void mlx5_ib_invalidate_range(struct ib_umem_odp *umem_odp, unsigned long start, · 245 unmodified lines
246246 * overwrite the same MTTs. Concurent invalidations might race us,
247247 * but they will write 0s as well, so no difference in the end result.
248248 */
249−
249+ mutex_lock(&umem_odp->umem_mutex);
250250 for (addr = start; addr < end; addr += BIT(umem_odp->page_shift)) {
251251 idx = (addr - ib_umem_start(umem_odp)) >> umem_odp->page_shift;
252252 /*
@@ -278,6 +278,7 @@ void mlx5_ib_invalidate_range(struct ib_umem_odp *umem_odp, unsigned long start, · 25 unmodified lines
278278 idx - blk_start_idx + 1, 0,
279279 MLX5_IB_UPD_XLT_ZAP |
280280 MLX5_IB_UPD_XLT_ATOMIC);
281+ mutex_unlock(&umem_odp->umem_mutex);
281282 /*
282283 * We are now sure that the device will not access the
283284 * memory. We can safely unmap it, and mark it as dirty if
@@ -1771,7 +1772,7 @@ static void mlx5_ib_prefetch_mr_work(struct work_struct *work) · 1487 unmodified lines
17711772
17721773 num_pending_prefetch_dec(to_mdev(w->pd->device), w->sg_list,
17731774 w->num_sge, 0);
1774− kfree(w);
1775+ kvfree(w);
17751776 }
17761777
17771778 int mlx5_ib_advise_mr_prefetch(struct ib_pd *pd,
@@ -1813,7 +1814,7 @@ int mlx5_ib_advise_mr_prefetch(struct ib_pd *pd, · 35 unmodified lines
18131814 if (valid_req)
18141815 queue_work(system_unbound_wq, &work->work);
18151816 else
1816− kfree(work);
1817+ kvfree(work);
18171818
18181819 srcu_read_unlock(&dev->mr_srcu, srcu_key);
18191820
drivers/infiniband/hw/mlx5/qp.c+8−5
@@ -1713,7 +1713,6 @@ static int create_rss_raw_qp_tir(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp, · 1712 unmodified lines
17131713 }
17141714
17151715 MLX5_SET(tirc, tirc, rx_hash_fn, MLX5_RX_HASH_FN_TOEPLITZ);
1716− MLX5_SET(tirc, tirc, rx_hash_symmetric, 1);
17171716 memcpy(rss_key, ucmd.rx_hash_key, len);
17181717 break;
17191718 }
@@ -4295,10 +4294,14 @@ static int set_reg_umr_segment(struct mlx5_ib_dev *dev, · 2575 unmodified lines
42954294
42964295 memset(umr, 0, sizeof(*umr));
42974296
4298− if (wr->send_flags & MLX5_IB_SEND_UMR_FAIL_IF_FREE)
4299− umr->flags = MLX5_UMR_CHECK_FREE; /* fail if free */
4300− else
4301− umr->flags = MLX5_UMR_CHECK_NOT_FREE; /* fail if not free */
4297+ if (!umrwr->ignore_free_state) {
4298+ if (wr->send_flags & MLX5_IB_SEND_UMR_FAIL_IF_FREE)
4299+ /* fail if free */
4300+ umr->flags = MLX5_UMR_CHECK_FREE;
4301+ else
4302+ /* fail if not free */
4303+ umr->flags = MLX5_UMR_CHECK_NOT_FREE;
4304+ }
43024305
43034306 umr->xlt_octowords = cpu_to_be16(get_xlt_octo(umrwr->xlt_size));
43044307 if (wr->send_flags & MLX5_IB_SEND_UMR_UPDATE_XLT) {
drivers/infiniband/hw/qedr/main.c+8−2
@@ -125,14 +125,20 @@ static ssize_t hw_rev_show(struct device *device, struct device_attribute *attr, · 124 unmodified lines
125125 struct qedr_dev *dev =
126126 rdma_device_to_drv_device(device, struct qedr_dev, ibdev);
127127
128− return scnprintf(buf, PAGE_SIZE, "0x%x\n", dev->pdev->vendor);
128+ return scnprintf(buf, PAGE_SIZE, "0x%x\n", dev->attr.hw_ver);
129129 }
130130 static DEVICE_ATTR_RO(hw_rev);
131131
132132 static ssize_t hca_type_show(struct device *device,
133133 struct device_attribute *attr, char *buf)
134134 {
135− return scnprintf(buf, PAGE_SIZE, "%s\n", "HCA_TYPE_TO_SET");
135+ struct qedr_dev *dev =
136+ rdma_device_to_drv_device(device, struct qedr_dev, ibdev);
137+
138+ return scnprintf(buf, PAGE_SIZE, "FastLinQ QL%x %s\n",
139+ dev->pdev->device,
140+ rdma_protocol_iwarp(&dev->ibdev, 1) ?
141+ "iWARP" : "RoCE");
136142 }
137143 static DEVICE_ATTR_RO(hca_type);
138144
drivers/infiniband/sw/siw/siw_cm.c+1−2
@@ -220,13 +220,12 @@ static void siw_put_work(struct siw_cm_work *work) · 219 unmodified lines
220220 static void siw_cep_set_inuse(struct siw_cep *cep)
221221 {
222222 unsigned long flags;
223− int rv;
224223 retry:
225224 spin_lock_irqsave(&cep->lock, flags);
226225
227226 if (cep->in_use) {
228227 spin_unlock_irqrestore(&cep->lock, flags);
229− rv = wait_event_interruptible(cep->waitq, !cep->in_use);
228+ wait_event_interruptible(cep->waitq, !cep->in_use);
230229 if (signal_pending(current))
231230 flush_signals(current);
232231 goto retry;
drivers/infiniband/sw/siw/siw_main.c+1−0
@@ -612,6 +612,7 @@ static __init int siw_init_module(void) · 611 unmodified lines
612612
613613 if (!siw_create_tx_threads()) {
614614 pr_info("siw: Could not start any TX thread\n");
615+ rv = -ENOMEM;
615616 goto out_error;
616617 }
617618 /*
drivers/infiniband/sw/siw/siw_qp.c+4−2
@@ -220,12 +220,14 @@ static int siw_qp_enable_crc(struct siw_qp *qp) · 219 unmodified lines
220220 {
221221 struct siw_rx_stream *c_rx = &qp->rx_stream;
222222 struct siw_iwarp_tx *c_tx = &qp->tx_ctx;
223− int size = crypto_shash_descsize(siw_crypto_shash) +
224− sizeof(struct shash_desc);
223+ int size;
225224
226225 if (siw_crypto_shash == NULL)
227226 return -ENOENT;
228227
228+ size = crypto_shash_descsize(siw_crypto_shash) +
229+ sizeof(struct shash_desc);
230+
229231 c_tx->mpa_crc_hd = kzalloc(size, GFP_KERNEL);
230232 c_rx->mpa_crc_hd = kzalloc(size, GFP_KERNEL);
231233 if (!c_tx->mpa_crc_hd || !c_rx->mpa_crc_hd) {
drivers/input/joystick/iforce/iforce-usb.c+5−0
@@ -201,7 +201,12 @@ static int iforce_usb_probe(struct usb_interface *intf, · 200 unmodified lines
201201 return -ENODEV;
202202
203203 epirq = &interface->endpoint[0].desc;
204+ if (!usb_endpoint_is_int_in(epirq))
205+ return -ENODEV;
206+
204207 epout = &interface->endpoint[1].desc;
208+ if (!usb_endpoint_is_int_out(epout))
209+ return -ENODEV;
205210
206211 iforce_usb = kzalloc(sizeof(*iforce_usb), GFP_KERNEL);
207212 if (!iforce_usb)
drivers/input/keyboard/Kconfig+2−0
@@ -76,6 +76,8 @@ config KEYBOARD_APPLESPI · 75 unmodified lines
7676 depends on ACPI && EFI
7777 depends on SPI
7878 depends on X86 || COMPILE_TEST
79+ depends on LEDS_CLASS
80+ select CRC16
7981 help
8082 Say Y here if you are running Linux on any Apple MacBook8,1 or later,
8183 or any MacBookPro13,* or MacBookPro14,*.
drivers/input/keyboard/applespi.c+16−13
@@ -134,10 +134,10 @@ struct keyboard_protocol { · 133 unmodified lines
134134 * struct tp_finger - single trackpad finger structure, le16-aligned
135135 *
136136 * @origin: zero when switching track finger
137− * @abs_x: absolute x coodinate
138− * @abs_y: absolute y coodinate
139− * @rel_x: relative x coodinate
140− * @rel_y: relative y coodinate
137+ * @abs_x: absolute x coordinate
138+ * @abs_y: absolute y coordinate
139+ * @rel_x: relative x coordinate
140+ * @rel_y: relative y coordinate
141141 * @tool_major: tool area, major axis
142142 * @tool_minor: tool area, minor axis
143143 * @orientation: 16384 when point, else 15 bit angle
@@ -944,10 +944,14 @@ static inline int le16_to_int(__le16 x) · 800 unmodified lines
944944 static void applespi_debug_update_dimensions(struct applespi_data *applespi,
945945 const struct tp_finger *f)
946946 {
947− applespi->tp_dim_min_x = min_t(int, applespi->tp_dim_min_x, f->abs_x);
948− applespi->tp_dim_max_x = max_t(int, applespi->tp_dim_max_x, f->abs_x);
949− applespi->tp_dim_min_y = min_t(int, applespi->tp_dim_min_y, f->abs_y);
950− applespi->tp_dim_max_y = max_t(int, applespi->tp_dim_max_y, f->abs_y);
947+ applespi->tp_dim_min_x = min(applespi->tp_dim_min_x,
948+ le16_to_int(f->abs_x));
949+ applespi->tp_dim_max_x = max(applespi->tp_dim_max_x,
950+ le16_to_int(f->abs_x));
951+ applespi->tp_dim_min_y = min(applespi->tp_dim_min_y,
952+ le16_to_int(f->abs_y));
953+ applespi->tp_dim_max_y = max(applespi->tp_dim_max_y,
954+ le16_to_int(f->abs_y));
951955 }
952956
953957 static int applespi_tp_dim_open(struct inode *inode, struct file *file)
@@ -1490,8 +1494,7 @@ static void applespi_got_data(struct applespi_data *applespi) · 536 unmodified lines
14901494 size_t tp_len;
14911495
14921496 tp = &message->touchpad;
1493− tp_len = sizeof(*tp) +
1494− tp->number_of_fingers * sizeof(tp->fingers[0]);
1497+ tp_len = struct_size(tp, fingers, tp->number_of_fingers);
14951498
14961499 if (le16_to_cpu(message->length) + 2 != tp_len) {
14971500 dev_warn_ratelimited(&applespi->spi->dev,
@@ -1611,8 +1614,8 @@ static void applespi_save_bl_level(struct applespi_data *applespi, · 113 unmodified lines
16111614 efi_attr = EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS |
16121615 EFI_VARIABLE_RUNTIME_ACCESS;
16131616
1614− sts = efivar_entry_set_safe(EFI_BL_LEVEL_NAME, efi_guid, efi_attr, true,
1615− efi_data_len, &efi_data);
1617+ sts = efivar_entry_set_safe((efi_char16_t *)EFI_BL_LEVEL_NAME, efi_guid,
1618+ efi_attr, true, efi_data_len, &efi_data);
16161619 if (sts)
16171620 dev_warn(&applespi->spi->dev,
16181621 "Error saving backlight level to EFI vars: %d\n", sts);
@@ -1953,7 +1956,7 @@ static const struct acpi_device_id applespi_acpi_match[] = { · 334 unmodified lines
19531956 };
19541957 MODULE_DEVICE_TABLE(acpi, applespi_acpi_match);
19551958
1956−const struct dev_pm_ops applespi_pm_ops = {
1959+static const struct dev_pm_ops applespi_pm_ops = {
19571960 SET_SYSTEM_SLEEP_PM_OPS(applespi_suspend, applespi_resume)
19581961 .poweroff_late = applespi_poweroff_late,
19591962 };
drivers/input/mouse/elantech.c+26−29
@@ -1827,6 +1827,31 @@ static int elantech_create_smbus(struct psmouse *psmouse, · 1826 unmodified lines
18271827 leave_breadcrumbs);
18281828 }
18291829
1830+static bool elantech_use_host_notify(struct psmouse *psmouse,
1831+ struct elantech_device_info *info)
1832+{
1833+ if (ETP_NEW_IC_SMBUS_HOST_NOTIFY(info->fw_version))
1834+ return true;
1835+
1836+ switch (info->bus) {
1837+ case ETP_BUS_PS2_ONLY:
1838+ /* expected case */
1839+ break;
1840+ case ETP_BUS_SMB_HST_NTFY_ONLY:
1841+ case ETP_BUS_PS2_SMB_HST_NTFY:
1842+ /* SMbus implementation is stable since 2018 */
1843+ if (dmi_get_bios_year() >= 2018)
1844+ return true;
1845+ /* fall through */
1846+ default:
1847+ psmouse_dbg(psmouse,
1848+ "Ignoring SMBus bus provider %d\n", info->bus);
1849+ break;
1850+ }
1851+
1852+ return false;
1853+}
1854+
18301855 /**
18311856 * elantech_setup_smbus - called once the PS/2 devices are enumerated
18321857 * and decides to instantiate a SMBus InterTouch device.
@@ -1846,7 +1871,7 @@ static int elantech_setup_smbus(struct psmouse *psmouse, · 13 unmodified lines
18461871 * i2c_blacklist_pnp_ids.
18471872 * Old ICs are up to the user to decide.
18481873 */
1849− if (!ETP_NEW_IC_SMBUS_HOST_NOTIFY(info->fw_version) ||
1874+ if (!elantech_use_host_notify(psmouse, info) ||
18501875 psmouse_matches_pnp_id(psmouse, i2c_blacklist_pnp_ids))
18511876 return -ENXIO;
18521877 }
@@ -1866,34 +1891,6 @@ static int elantech_setup_smbus(struct psmouse *psmouse, · 13 unmodified lines
18661891 return 0;
18671892 }
18681893
1869−static bool elantech_use_host_notify(struct psmouse *psmouse,
1870− struct elantech_device_info *info)
1871−{
1872− if (ETP_NEW_IC_SMBUS_HOST_NOTIFY(info->fw_version))
1873− return true;
1874−
1875− switch (info->bus) {
1876− case ETP_BUS_PS2_ONLY:
1877− /* expected case */
1878− break;
1879− case ETP_BUS_SMB_ALERT_ONLY:
1880− /* fall-through */
1881− case ETP_BUS_PS2_SMB_ALERT:
1882− psmouse_dbg(psmouse, "Ignoring SMBus provider through alert protocol.\n");
1883− break;
1884− case ETP_BUS_SMB_HST_NTFY_ONLY:
1885− /* fall-through */
1886− case ETP_BUS_PS2_SMB_HST_NTFY:
1887− return true;
1888− default:
1889− psmouse_dbg(psmouse,
1890− "Ignoring SMBus bus provider %d.\n",
1891− info->bus);
1892− }
1893−
1894− return false;
1895−}
1896−
18971894 int elantech_init_smbus(struct psmouse *psmouse)
18981895 {
18991896 struct elantech_device_info info;
drivers/input/mouse/synaptics.c+1−0
@@ -182,6 +182,7 @@ static const char * const smbus_pnp_ids[] = { · 181 unmodified lines
182182 "LEN2055", /* E580 */
183183 "SYN3052", /* HP EliteBook 840 G4 */
184184 "SYN3221", /* HP 15-ay000 */
185+ "SYN323d", /* HP Spectre X360 13-w013dx */
185186 NULL
186187 };
187188
drivers/input/tablet/kbtab.c+4−2
@@ -117,6 +117,10 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i · 116 unmodified lines
117117 if (intf->cur_altsetting->desc.bNumEndpoints < 1)
118118 return -ENODEV;
119119
120+ endpoint = &intf->cur_altsetting->endpoint[0].desc;
121+ if (!usb_endpoint_is_int_in(endpoint))
122+ return -ENODEV;
123+
120124 kbtab = kzalloc(sizeof(struct kbtab), GFP_KERNEL);
121125 input_dev = input_allocate_device();
122126 if (!kbtab || !input_dev)
@@ -155,8 +159,6 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i · 32 unmodified lines
155159 input_set_abs_params(input_dev, ABS_Y, 0, 0x1750, 4, 0);
156160 input_set_abs_params(input_dev, ABS_PRESSURE, 0, 0xff, 0, 0);
157161
158− endpoint = &intf->cur_altsetting->endpoint[0].desc;
159−
160162 usb_fill_int_urb(kbtab->irq, dev,
161163 usb_rcvintpipe(dev, endpoint->bEndpointAddress),
162164 kbtab->data, 8,
drivers/input/touchscreen/usbtouchscreen.c+2−0
@@ -1659,6 +1659,8 @@ static int usbtouch_probe(struct usb_interface *intf, · 1658 unmodified lines
16591659 if (!usbtouch || !input_dev)
16601660 goto out_free;
16611661
1662+ mutex_init(&usbtouch->pm_mutex);
1663+
16621664 type = &usbtouch_dev_info[id->driver_info];
16631665 usbtouch->type = type;
16641666 if (!type->process_pkt)
drivers/iommu/virtio-iommu.c+29−11
@@ -2,7 +2,7 @@ · 1 unmodified line
22 /*
33 * Virtio driver for the paravirtualized IOMMU
44 *
5− * Copyright (C) 2018 Arm Limited
5+ * Copyright (C) 2019 Arm Limited
66 */
77
88 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -47,7 +47,10 @@ struct viommu_dev { · 38 unmodified lines
4747 /* Device configuration */
4848 struct iommu_domain_geometry geometry;
4949 u64 pgsize_bitmap;
50− u8 domain_bits;
50+ u32 first_domain;
51+ u32 last_domain;
52+ /* Supported MAP flags */
53+ u32 map_flags;
5154 u32 probe_size;
5255 };
5356
@@ -62,6 +65,7 @@ struct viommu_domain { · 8 unmodified lines
6265 struct viommu_dev *viommu;
6366 struct mutex mutex; /* protects viommu pointer */
6467 unsigned int id;
68+ u32 map_flags;
6569
6670 spinlock_t mappings_lock;
6771 struct rb_root_cached mappings;
@@ -113,6 +117,8 @@ static int viommu_get_req_errno(void *buf, size_t len) · 45 unmodified lines
113117 return -ENOENT;
114118 case VIRTIO_IOMMU_S_FAULT:
115119 return -EFAULT;
120+ case VIRTIO_IOMMU_S_NOMEM:
121+ return -ENOMEM;
116122 case VIRTIO_IOMMU_S_IOERR:
117123 case VIRTIO_IOMMU_S_DEVERR:
118124 default:
@@ -607,15 +613,15 @@ static int viommu_domain_finalise(struct viommu_dev *viommu, · 488 unmodified lines
607613 {
608614 int ret;
609615 struct viommu_domain *vdomain = to_viommu_domain(domain);
610− unsigned int max_domain = viommu->domain_bits > 31 ? ~0 :
611− (1U << viommu->domain_bits) - 1;
612616
613617 vdomain->viommu = viommu;
618+ vdomain->map_flags = viommu->map_flags;
614619
615620 domain->pgsize_bitmap = viommu->pgsize_bitmap;
616621 domain->geometry = viommu->geometry;
617622
618− ret = ida_alloc_max(&viommu->domain_ids, max_domain, GFP_KERNEL);
623+ ret = ida_alloc_range(&viommu->domain_ids, viommu->first_domain,
624+ viommu->last_domain, GFP_KERNEL);
619625 if (ret >= 0)
620626 vdomain->id = (unsigned int)ret;
621627
@@ -710,7 +716,7 @@ static int viommu_map(struct iommu_domain *domain, unsigned long iova, · 88 unmodified lines
710716 phys_addr_t paddr, size_t size, int prot)
711717 {
712718 int ret;
713− int flags;
719+ u32 flags;
714720 struct virtio_iommu_req_map map;
715721 struct viommu_domain *vdomain = to_viommu_domain(domain);
716722
@@ -718,6 +724,9 @@ static int viommu_map(struct iommu_domain *domain, unsigned long iova, · 1 unmodified line
718724 (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) |
719725 (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0);
720726
727+ if (flags & ~vdomain->map_flags)
728+ return -EINVAL;
729+
721730 ret = viommu_add_mapping(vdomain, iova, paddr, size, flags);
722731 if (ret)
723732 return ret;
@@ -1027,7 +1036,8 @@ static int viommu_probe(struct virtio_device *vdev) · 303 unmodified lines
10271036 goto err_free_vqs;
10281037 }
10291038
1030− viommu->domain_bits = 32;
1039+ viommu->map_flags = VIRTIO_IOMMU_MAP_F_READ | VIRTIO_IOMMU_MAP_F_WRITE;
1040+ viommu->last_domain = ~0U;
10311041
10321042 /* Optional features */
10331043 virtio_cread_feature(vdev, VIRTIO_IOMMU_F_INPUT_RANGE,
@@ -1038,9 +1048,13 @@ static int viommu_probe(struct virtio_device *vdev) · 4 unmodified lines
10381048 struct virtio_iommu_config, input_range.end,
10391049 &input_end);
10401050
1041− virtio_cread_feature(vdev, VIRTIO_IOMMU_F_DOMAIN_BITS,
1042− struct virtio_iommu_config, domain_bits,
1043− &viommu->domain_bits);
1051+ virtio_cread_feature(vdev, VIRTIO_IOMMU_F_DOMAIN_RANGE,
1052+ struct virtio_iommu_config, domain_range.start,
1053+ &viommu->first_domain);
1054+
1055+ virtio_cread_feature(vdev, VIRTIO_IOMMU_F_DOMAIN_RANGE,
1056+ struct virtio_iommu_config, domain_range.end,
1057+ &viommu->last_domain);
10441058
10451059 virtio_cread_feature(vdev, VIRTIO_IOMMU_F_PROBE,
10461060 struct virtio_iommu_config, probe_size,
@@ -1052,6 +1066,9 @@ static int viommu_probe(struct virtio_device *vdev) · 5 unmodified lines
10521066 .force_aperture = true,
10531067 };
10541068
1069+ if (virtio_has_feature(vdev, VIRTIO_IOMMU_F_MMIO))
1070+ viommu->map_flags |= VIRTIO_IOMMU_MAP_F_MMIO;
1071+
10551072 viommu_ops.pgsize_bitmap = viommu->pgsize_bitmap;
10561073
10571074 virtio_device_ready(vdev);
@@ -1130,9 +1147,10 @@ static void viommu_config_changed(struct virtio_device *vdev) · 72 unmodified lines
11301147
11311148 static unsigned int features[] = {
11321149 VIRTIO_IOMMU_F_MAP_UNMAP,
1133− VIRTIO_IOMMU_F_DOMAIN_BITS,
11341150 VIRTIO_IOMMU_F_INPUT_RANGE,
1151+ VIRTIO_IOMMU_F_DOMAIN_RANGE,
11351152 VIRTIO_IOMMU_F_PROBE,
1153+ VIRTIO_IOMMU_F_MMIO,
11361154 };
11371155
11381156 static struct virtio_device_id id_table[] = {
drivers/irqchip/irq-gic-v3-its.c+1−1
@@ -3010,7 +3010,7 @@ static int its_vpe_init(struct its_vpe *vpe) · 3009 unmodified lines
30103010
30113011 if (!its_alloc_vpe_table(vpe_id)) {
30123012 its_vpe_id_free(vpe_id);
3013− its_free_pending_table(vpe->vpt_page);
3013+ its_free_pending_table(vpt_page);
30143014 return -ENOMEM;
30153015 }
30163016
drivers/irqchip/irq-gic-v3.c+4−0
@@ -771,8 +771,10 @@ static void gic_cpu_sys_reg_init(void) · 770 unmodified lines
771771 case 7:
772772 write_gicreg(0, ICC_AP0R3_EL1);
773773 write_gicreg(0, ICC_AP0R2_EL1);
774+ /* Fall through */
774775 case 6:
775776 write_gicreg(0, ICC_AP0R1_EL1);
777+ /* Fall through */
776778 case 5:
777779 case 4:
778780 write_gicreg(0, ICC_AP0R0_EL1);
@@ -786,8 +788,10 @@ static void gic_cpu_sys_reg_init(void) · 7 unmodified lines
786788 case 7:
787789 write_gicreg(0, ICC_AP1R3_EL1);
788790 write_gicreg(0, ICC_AP1R2_EL1);
791+ /* Fall through */
789792 case 6:
790793 write_gicreg(0, ICC_AP1R1_EL1);
794+ /* Fall through */
791795 case 5:
792796 case 4:
793797 write_gicreg(0, ICC_AP1R0_EL1);
drivers/irqchip/irq-imx-gpcv2.c+1−0
@@ -131,6 +131,7 @@ static struct irq_chip gpcv2_irqchip_data_chip = { · 130 unmodified lines
131131 .irq_unmask = imx_gpcv2_irq_unmask,
132132 .irq_set_wake = imx_gpcv2_irq_set_wake,
133133 .irq_retrigger = irq_chip_retrigger_hierarchy,
134+ .irq_set_type = irq_chip_set_type_parent,
134135 #ifdef CONFIG_SMP
135136 .irq_set_affinity = irq_chip_set_affinity_parent,
136137 #endif
drivers/irqchip/irq-mbigen.c+7−2
@@ -241,12 +241,15 @@ static int mbigen_of_create_domain(struct platform_device *pdev, · 240 unmodified lines
241241
242242 parent = platform_bus_type.dev_root;
243243 child = of_platform_device_create(np, NULL, parent);
244− if (!child)
244+ if (!child) {
245+ of_node_put(np);
245246 return -ENOMEM;
247+ }
246248
247249 if (of_property_read_u32(child->dev.of_node, "num-pins",
248250 &num_pins) < 0) {
249251 dev_err(&pdev->dev, "No num-pins property\n");
252+ of_node_put(np);
250253 return -EINVAL;
251254 }
252255
@@ -254,8 +257,10 @@ static int mbigen_of_create_domain(struct platform_device *pdev, · 1 unmodified line
254257 mbigen_write_msg,
255258 &mbigen_domain_ops,
256259 mgn_chip);
257− if (!domain)
260+ if (!domain) {
261+ of_node_put(np);
258262 return -ENOMEM;
263+ }
259264 }
260265
261266 return 0;
drivers/isdn/hardware/mISDN/hfcsusb.c+12−1
@@ -1394,6 +1394,7 @@ start_isoc_chain(struct usb_fifo *fifo, int num_packets_per_urb, · 1393 unmodified lines
13941394 printk(KERN_DEBUG
13951395 "%s: %s: alloc urb for fifo %i failed",
13961396 hw->name, __func__, fifo->fifonum);
1397+ continue;
13971398 }
13981399 fifo->iso[i].owner_fifo = (struct usb_fifo *) fifo;
13991400 fifo->iso[i].indx = i;
@@ -1692,13 +1693,23 @@ hfcsusb_stop_endpoint(struct hfcsusb *hw, int channel) · 292 unmodified lines
16921693 static int
16931694 setup_hfcsusb(struct hfcsusb *hw)
16941695 {
1696+ void *dmabuf = kmalloc(sizeof(u_char), GFP_KERNEL);
16951697 u_char b;
1698+ int ret;
16961699
16971700 if (debug & DBG_HFC_CALL_TRACE)
16981701 printk(KERN_DEBUG "%s: %s\n", hw->name, __func__);
16991702
1703+ if (!dmabuf)
1704+ return -ENOMEM;
1705+
1706+ ret = read_reg_atomic(hw, HFCUSB_CHIP_ID, dmabuf);
1707+
1708+ memcpy(&b, dmabuf, sizeof(u_char));
1709+ kfree(dmabuf);
1710+
17001711 /* check the chip id */
1701− if (read_reg_atomic(hw, HFCUSB_CHIP_ID, &b) != 1) {
1712+ if (ret != 1) {
17021713 printk(KERN_DEBUG "%s: %s: cannot read chip id\n",
17031714 hw->name, __func__);
17041715 return 1;
drivers/macintosh/smu.c+1−0
@@ -852,6 +852,7 @@ int smu_queue_i2c(struct smu_i2c_cmd *cmd) · 851 unmodified lines
852852 break;
853853 case SMU_I2C_TRANSFER_COMBINED:
854854 cmd->info.devaddr &= 0xfe;
855+ /* fall through */
855856 case SMU_I2C_TRANSFER_STDSUB:
856857 if (cmd->info.sublen > 3)
857858 return -EINVAL;
drivers/md/bcache/sysfs.c+12−8
@@ -23,24 +23,28 @@ static const char * const bch_cache_modes[] = { · 22 unmodified lines
2323 "writethrough",
2424 "writeback",
2525 "writearound",
26− "none"
26+ "none",
27+ NULL
2728 };
2829
2930 /* Default is 0 ("auto") */
3031 static const char * const bch_stop_on_failure_modes[] = {
3132 "auto",
32− "always"
33+ "always",
34+ NULL
3335 };
3436
3537 static const char * const cache_replacement_policies[] = {
3638 "lru",
3739 "fifo",
38− "random"
40+ "random",
41+ NULL
3942 };
4043
4144 static const char * const error_actions[] = {
4245 "unregister",
43− "panic"
46+ "panic",
47+ NULL
4448 };
4549
4650 write_attribute(attach);
@@ -338,7 +342,7 @@ STORE(__cached_dev) · 291 unmodified lines
338342 }
339343
340344 if (attr == &sysfs_cache_mode) {
341− v = sysfs_match_string(bch_cache_modes, buf);
345+ v = __sysfs_match_string(bch_cache_modes, -1, buf);
342346 if (v < 0)
343347 return v;
344348
@@ -349,7 +353,7 @@ STORE(__cached_dev) · 4 unmodified lines
349353 }
350354
351355 if (attr == &sysfs_stop_when_cache_set_failed) {
352− v = sysfs_match_string(bch_stop_on_failure_modes, buf);
356+ v = __sysfs_match_string(bch_stop_on_failure_modes, -1, buf);
353357 if (v < 0)
354358 return v;
355359
@@ -816,7 +820,7 @@ STORE(__bch_cache_set) · 460 unmodified lines
816820 0, UINT_MAX);
817821
818822 if (attr == &sysfs_errors) {
819− v = sysfs_match_string(error_actions, buf);
823+ v = __sysfs_match_string(error_actions, -1, buf);
820824 if (v < 0)
821825 return v;
822826
@@ -1088,7 +1092,7 @@ STORE(__bch_cache) · 265 unmodified lines
10881092 }
10891093
10901094 if (attr == &sysfs_cache_replacement_policy) {
1091− v = sysfs_match_string(cache_replacement_policies, buf);
1095+ v = __sysfs_match_string(cache_replacement_policies, -1, buf);
10921096 if (v < 0)
10931097 return v;
10941098
drivers/md/dm-table.c+8−8
@@ -882,23 +882,23 @@ EXPORT_SYMBOL_GPL(dm_table_set_type); · 881 unmodified lines
882882
883883 /* validate the dax capability of the target device span */
884884 int device_supports_dax(struct dm_target *ti, struct dm_dev *dev,
885− sector_t start, sector_t len, void *data)
885+ sector_t start, sector_t len, void *data)
886886 {
887887 int blocksize = *(int *) data;
888888
889889 return generic_fsdax_supported(dev->dax_dev, dev->bdev, blocksize,
890− start, len);
890+ start, len);
891891 }
892892
893893 /* Check devices support synchronous DAX */
894−static int device_synchronous(struct dm_target *ti, struct dm_dev *dev,
895− sector_t start, sector_t len, void *data)
894+static int device_dax_synchronous(struct dm_target *ti, struct dm_dev *dev,
895+ sector_t start, sector_t len, void *data)
896896 {
897− return dax_synchronous(dev->dax_dev);
897+ return dev->dax_dev && dax_synchronous(dev->dax_dev);
898898 }
899899
900900 bool dm_table_supports_dax(struct dm_table *t,
901− iterate_devices_callout_fn iterate_fn, int *blocksize)
901+ iterate_devices_callout_fn iterate_fn, int *blocksize)
902902 {
903903 struct dm_target *ti;
904904 unsigned i;
@@ -911,7 +911,7 @@ bool dm_table_supports_dax(struct dm_table *t, · 6 unmodified lines
911911 return false;
912912
913913 if (!ti->type->iterate_devices ||
914− !ti->type->iterate_devices(ti, iterate_fn, blocksize))
914+ !ti->type->iterate_devices(ti, iterate_fn, blocksize))
915915 return false;
916916 }
917917
@@ -1921,7 +1921,7 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, · 1003 unmodified lines
19211921
19221922 if (dm_table_supports_dax(t, device_supports_dax, &page_size)) {
19231923 blk_queue_flag_set(QUEUE_FLAG_DAX, q);
1924− if (dm_table_supports_dax(t, device_synchronous, NULL))
1924+ if (dm_table_supports_dax(t, device_dax_synchronous, NULL))
19251925 set_dax_synchronous(t->md->dax_dev);
19261926 }
19271927 else
drivers/media/platform/vivid/vivid-core.c+4−4
@@ -1099,6 +1099,8 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) · 1098 unmodified lines
10991099
11001100 /* start creating the vb2 queues */
11011101 if (dev->has_vid_cap) {
1102+ snprintf(dev->vid_cap_dev.name, sizeof(dev->vid_cap_dev.name),
1103+ "vivid-%03d-vid-cap", inst);
11021104 /* initialize vid_cap queue */
11031105 q = &dev->vb_vid_cap_q;
11041106 q->type = dev->multiplanar ? V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE :
@@ -1122,6 +1124,8 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) · 17 unmodified lines
11221124 }
11231125
11241126 if (dev->has_vid_out) {
1127+ snprintf(dev->vid_out_dev.name, sizeof(dev->vid_out_dev.name),
1128+ "vivid-%03d-vid-out", inst);
11251129 /* initialize vid_out queue */
11261130 q = &dev->vb_vid_out_q;
11271131 q->type = dev->multiplanar ? V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE :
@@ -1265,8 +1269,6 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) · 137 unmodified lines
12651269 /* finally start creating the device nodes */
12661270 if (dev->has_vid_cap) {
12671271 vfd = &dev->vid_cap_dev;
1268− snprintf(vfd->name, sizeof(vfd->name),
1269− "vivid-%03d-vid-cap", inst);
12701272 vfd->fops = &vivid_fops;
12711273 vfd->ioctl_ops = &vivid_ioctl_ops;
12721274 vfd->device_caps = dev->vid_cap_caps;
@@ -1312,8 +1314,6 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) · 39 unmodified lines
13121314
13131315 if (dev->has_vid_out) {
13141316 vfd = &dev->vid_out_dev;
1315− snprintf(vfd->name, sizeof(vfd->name),
1316− "vivid-%03d-vid-out", inst);
13171317 vfd->vfl_dir = VFL_DIR_TX;
13181318 vfd->fops = &vivid_fops;
13191319 vfd->ioctl_ops = &vivid_ioctl_ops;
drivers/mfd/db8500-prcmu.c+2−0
@@ -1590,8 +1590,10 @@ static unsigned long dsiclk_rate(u8 n) · 1589 unmodified lines
15901590 switch (divsel) {
15911591 case PRCM_DSI_PLLOUT_SEL_PHI_4:
15921592 div *= 2;
1593+ /* Fall through */
15931594 case PRCM_DSI_PLLOUT_SEL_PHI_2:
15941595 div *= 2;
1596+ /* Fall through */
15951597 case PRCM_DSI_PLLOUT_SEL_PHI:
15961598 return pll_rate(PRCM_PLLDSI_FREQ, clock_rate(PRCMU_HDMICLK),
15971599 PLL_RAW) / div;
drivers/mfd/omap-usb-host.c+2−2
@@ -308,7 +308,7 @@ static int usbhs_runtime_resume(struct device *dev) · 307 unmodified lines
308308 i, r);
309309 }
310310 }
311− /* Fall through as HSIC mode needs utmi_clk */
311+ /* Fall through - as HSIC mode needs utmi_clk */
312312
313313 case OMAP_EHCI_PORT_MODE_TLL:
314314 if (!IS_ERR(omap->utmi_clk[i])) {
@@ -344,7 +344,7 @@ static int usbhs_runtime_suspend(struct device *dev) · 29 unmodified lines
344344
345345 if (!IS_ERR(omap->hsic480m_clk[i]))
346346 clk_disable_unprepare(omap->hsic480m_clk[i]);
347− /* Fall through as utmi_clks were used in HSIC mode */
347+ /* Fall through - as utmi_clks were used in HSIC mode */
348348
349349 case OMAP_EHCI_PORT_MODE_TLL:
350350 if (!IS_ERR(omap->utmi_clk[i]))
drivers/misc/eeprom/at24.c+1−1
@@ -685,7 +685,7 @@ static int at24_probe(struct i2c_client *client) · 684 unmodified lines
685685 nvmem_config.name = dev_name(dev);
686686 nvmem_config.dev = dev;
687687 nvmem_config.read_only = !writable;
688− nvmem_config.root_only = true;
688+ nvmem_config.root_only = !(flags & AT24_FLAG_IRUGO);
689689 nvmem_config.owner = THIS_MODULE;
690690 nvmem_config.compat = true;
691691 nvmem_config.base_dev = dev;
drivers/misc/habanalabs/command_submission.c+1−1
@@ -683,7 +683,7 @@ int hl_cs_ioctl(struct hl_fpriv *hpriv, void *data) · 682 unmodified lines
683683
684684 rc = hl_poll_timeout_memory(hdev,
685685 &ctx->thread_ctx_switch_wait_token, tmp, (tmp == 1),
686− 100, jiffies_to_usecs(hdev->timeout_jiffies));
686+ 100, jiffies_to_usecs(hdev->timeout_jiffies), false);
687687
688688 if (rc == -ETIMEDOUT) {
689689 dev_err(hdev->dev,
drivers/misc/habanalabs/firmware_if.c+4−18
@@ -24,7 +24,7 @@ int hl_fw_push_fw_to_device(struct hl_device *hdev, const char *fw_name, · 23 unmodified lines
2424 {
2525 const struct firmware *fw;
2626 const u64 *fw_data;
27− size_t fw_size, i;
27+ size_t fw_size;
2828 int rc;
2929
3030 rc = request_firmware(&fw, fw_name, hdev->dev);
@@ -45,22 +45,7 @@ int hl_fw_push_fw_to_device(struct hl_device *hdev, const char *fw_name, · 14 unmodified lines
4545
4646 fw_data = (const u64 *) fw->data;
4747
48− if ((fw->size % 8) != 0)
49− fw_size -= 8;
50−
51− for (i = 0 ; i < fw_size ; i += 8, fw_data++, dst += 8) {
52− if (!(i & (0x80000 - 1))) {
53− dev_dbg(hdev->dev,
54− "copied so far %zu out of %zu for %s firmware",
55− i, fw_size, fw_name);
56− usleep_range(20, 100);
57− }
58−
59− writeq(*fw_data, dst);
60− }
61−
62− if ((fw->size % 8) != 0)
63− writel(*(const u32 *) fw_data, dst);
48+ memcpy_toio(dst, fw_data, fw_size);
6449
6550 out:
6651 release_firmware(fw);
@@ -112,7 +97,8 @@ int hl_fw_send_cpu_message(struct hl_device *hdev, u32 hw_queue_id, u32 *msg, · 45 unmodified lines
11297 }
11398
11499 rc = hl_poll_timeout_memory(hdev, &pkt->fence, tmp,
115− (tmp == ARMCP_PACKET_FENCE_VAL), 1000, timeout);
100+ (tmp == ARMCP_PACKET_FENCE_VAL), 1000,
101+ timeout, true);
116102
117103 hl_hw_queue_inc_ci_kernel(hdev, hw_queue_id);
118104
drivers/misc/habanalabs/goya/goya.c+3−2
@@ -2864,7 +2864,8 @@ static int goya_send_job_on_qman0(struct hl_device *hdev, struct hl_cs_job *job) · 2863 unmodified lines
28642864 }
28652865
28662866 rc = hl_poll_timeout_memory(hdev, fence_ptr, tmp,
2867− (tmp == GOYA_QMAN0_FENCE_VAL), 1000, timeout);
2867+ (tmp == GOYA_QMAN0_FENCE_VAL), 1000,
2868+ timeout, true);
28682869
28692870 hl_hw_queue_inc_ci_kernel(hdev, GOYA_QUEUE_ID_DMA_0);
28702871
@@ -2945,7 +2946,7 @@ int goya_test_queue(struct hl_device *hdev, u32 hw_queue_id) · 74 unmodified lines
29452946 }
29462947
29472948 rc = hl_poll_timeout_memory(hdev, fence_ptr, tmp, (tmp == fence_val),
2948− 1000, GOYA_TEST_QUEUE_WAIT_USEC);
2949+ 1000, GOYA_TEST_QUEUE_WAIT_USEC, true);
29492950
29502951 hl_hw_queue_inc_ci_kernel(hdev, hw_queue_id);
29512952
drivers/misc/habanalabs/habanalabs.h+14−2
@@ -1062,9 +1062,17 @@ void hl_wreg(struct hl_device *hdev, u32 reg, u32 val); · 1061 unmodified lines
10621062 /*
10631063 * address in this macro points always to a memory location in the
10641064 * host's (server's) memory. That location is updated asynchronously
1065− * either by the direct access of the device or by another core
1065+ * either by the direct access of the device or by another core.
1066+ *
1067+ * To work both in LE and BE architectures, we need to distinguish between the
1068+ * two states (device or another core updates the memory location). Therefore,
1069+ * if mem_written_by_device is true, the host memory being polled will be
1070+ * updated directly by the device. If false, the host memory being polled will
1071+ * be updated by host CPU. Required so host knows whether or not the memory
1072+ * might need to be byte-swapped before returning value to caller.
10661073 */
1067−#define hl_poll_timeout_memory(hdev, addr, val, cond, sleep_us, timeout_us) \
1074+#define hl_poll_timeout_memory(hdev, addr, val, cond, sleep_us, timeout_us, \
1075+ mem_written_by_device) \
10681076 ({ \
10691077 ktime_t __timeout; \
10701078 /* timeout should be longer when working with simulator */ \
@@ -1077,10 +1085,14 @@ void hl_wreg(struct hl_device *hdev, u32 reg, u32 val); · 6 unmodified lines
10771085 /* Verify we read updates done by other cores or by device */ \
10781086 mb(); \
10791087 (val) = *((u32 *) (uintptr_t) (addr)); \
1088+ if (mem_written_by_device) \
1089+ (val) = le32_to_cpu(val); \
10801090 if (cond) \
10811091 break; \
10821092 if (timeout_us && ktime_compare(ktime_get(), __timeout) > 0) { \
10831093 (val) = *((u32 *) (uintptr_t) (addr)); \
1094+ if (mem_written_by_device) \
1095+ (val) = le32_to_cpu(val); \
10841096 break; \
10851097 } \
10861098 if (sleep_us) \
drivers/mmc/core/queue.c+5−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/kthread.h>
1111 #include <linux/scatterlist.h>
1212 #include <linux/dma-mapping.h>
13+#include <linux/backing-dev.h>
1314
1415 #include <linux/mmc/card.h>
1516 #include <linux/mmc/host.h>
@@ -427,6 +428,10 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card) · 411 unmodified lines
427428 goto free_tag_set;
428429 }
429430
431+ if (mmc_host_is_spi(host) && host->use_spi_crc)
432+ mq->queue->backing_dev_info->capabilities |=
433+ BDI_CAP_STABLE_WRITES;
434+
430435 mq->queue->queuedata = mq;
431436 blk_queue_rq_timeout(mq->queue, 60 * HZ);
432437
drivers/mmc/host/cavium.c+3−1
@@ -374,6 +374,7 @@ static int finish_dma_single(struct cvm_mmc_host *host, struct mmc_data *data) · 373 unmodified lines
374374 {
375375 data->bytes_xfered = data->blocks * data->blksz;
376376 data->error = 0;
377+ dma_unmap_sg(host->dev, data->sg, data->sg_len, get_dma_dir(data));
377378 return 1;
378379 }
379380
@@ -1046,7 +1047,8 @@ int cvm_mmc_of_slot_probe(struct device *dev, struct cvm_mmc_host *host) · 666 unmodified lines
10461047 mmc->max_segs = 1;
10471048
10481049 /* DMA size field can address up to 8 MB */
1049− mmc->max_seg_size = 8 * 1024 * 1024;
1050+ mmc->max_seg_size = min_t(unsigned int, 8 * 1024 * 1024,
1051+ dma_get_max_seg_size(host->dev));
10501052 mmc->max_req_size = mmc->max_seg_size;
10511053 /* External DMA is in 512 byte blocks */
10521054 mmc->max_blk_size = 512;
drivers/mmc/host/dw_mmc.c+1−2
@@ -2012,8 +2012,7 @@ static void dw_mci_tasklet_func(unsigned long priv) · 2011 unmodified lines
20122012 * delayed. Allowing the transfer to take place
20132013 * avoids races and keeps things simple.
20142014 */
2015− if ((err != -ETIMEDOUT) &&
2016− (cmd->opcode == MMC_SEND_TUNING_BLOCK)) {
2015+ if (err != -ETIMEDOUT) {
20172016 state = STATE_SENDING_DATA;
20182017 continue;
20192018 }
drivers/mmc/host/meson-mx-sdio.c+1−1
@@ -73,7 +73,7 @@ · 72 unmodified lines
7373 #define MESON_MX_SDIO_IRQC_IF_CONFIG_MASK GENMASK(7, 6)
7474 #define MESON_MX_SDIO_IRQC_FORCE_DATA_CLK BIT(8)
7575 #define MESON_MX_SDIO_IRQC_FORCE_DATA_CMD BIT(9)
76− #define MESON_MX_SDIO_IRQC_FORCE_DATA_DAT_MASK GENMASK(10, 13)
76+ #define MESON_MX_SDIO_IRQC_FORCE_DATA_DAT_MASK GENMASK(13, 10)
7777 #define MESON_MX_SDIO_IRQC_SOFT_RESET BIT(15)
7878 #define MESON_MX_SDIO_IRQC_FORCE_HALT BIT(30)
7979 #define MESON_MX_SDIO_IRQC_HALT_HOLE BIT(31)
drivers/mmc/host/sdhci-acpi.c+1−1
@@ -883,7 +883,7 @@ static int sdhci_acpi_runtime_resume(struct device *dev) · 882 unmodified lines
883883
884884 sdhci_acpi_byt_setting(&c->pdev->dev);
885885
886− return sdhci_runtime_resume_host(c->host);
886+ return sdhci_runtime_resume_host(c->host, 0);
887887 }
888888
889889 #endif
drivers/mmc/host/sdhci-esdhc-imx.c+1−1
@@ -1705,7 +1705,7 @@ static int sdhci_esdhc_runtime_resume(struct device *dev) · 1704 unmodified lines
17051705 esdhc_pltfm_set_clock(host, imx_data->actual_clock);
17061706 }
17071707
1708− err = sdhci_runtime_resume_host(host);
1708+ err = sdhci_runtime_resume_host(host, 0);
17091709 if (err)
17101710 goto disable_ipg_clk;
17111711
drivers/mmc/host/sdhci-of-at91.c+1−1
@@ -289,7 +289,7 @@ static int sdhci_at91_runtime_resume(struct device *dev) · 288 unmodified lines
289289 }
290290
291291 out:
292− return sdhci_runtime_resume_host(host);
292+ return sdhci_runtime_resume_host(host, 0);
293293 }
294294 #endif /* CONFIG_PM */
295295
drivers/mmc/host/sdhci-pci-core.c+2−2
@@ -167,7 +167,7 @@ static int sdhci_pci_runtime_suspend_host(struct sdhci_pci_chip *chip) · 166 unmodified lines
167167
168168 err_pci_runtime_suspend:
169169 while (--i >= 0)
170− sdhci_runtime_resume_host(chip->slots[i]->host);
170+ sdhci_runtime_resume_host(chip->slots[i]->host, 0);
171171 return ret;
172172 }
173173
@@ -181,7 +181,7 @@ static int sdhci_pci_runtime_resume_host(struct sdhci_pci_chip *chip) · 7 unmodified lines
181181 if (!slot)
182182 continue;
183183
184− ret = sdhci_runtime_resume_host(slot->host);
184+ ret = sdhci_runtime_resume_host(slot->host, 0);
185185 if (ret)
186186 return ret;
187187 }
drivers/mmc/host/sdhci-pxav3.c+1−1
@@ -554,7 +554,7 @@ static int sdhci_pxav3_runtime_resume(struct device *dev) · 553 unmodified lines
554554 if (!IS_ERR(pxa->clk_core))
555555 clk_prepare_enable(pxa->clk_core);
556556
557− return sdhci_runtime_resume_host(host);
557+ return sdhci_runtime_resume_host(host, 0);
558558 }
559559 #endif
560560
drivers/mmc/host/sdhci-s3c.c+1−1
@@ -745,7 +745,7 @@ static int sdhci_s3c_runtime_resume(struct device *dev) · 744 unmodified lines
745745 clk_prepare_enable(busclk);
746746 if (ourhost->cur_clk >= 0)
747747 clk_prepare_enable(ourhost->clk_bus[ourhost->cur_clk]);
748− ret = sdhci_runtime_resume_host(host);
748+ ret = sdhci_runtime_resume_host(host, 0);
749749 return ret;
750750 }
751751 #endif
drivers/mmc/host/sdhci-sprd.c+2−1
@@ -624,6 +624,7 @@ err_cleanup_host: · 623 unmodified lines
624624 sdhci_cleanup_host(host);
625625
626626 pm_runtime_disable:
627+ pm_runtime_put_noidle(&pdev->dev);
627628 pm_runtime_disable(&pdev->dev);
628629 pm_runtime_set_suspended(&pdev->dev);
629630
@@ -695,7 +696,7 @@ static int sdhci_sprd_runtime_resume(struct device *dev) · 65 unmodified lines
695696 if (ret)
696697 goto clk_disable;
697698
698− sdhci_runtime_resume_host(host);
699+ sdhci_runtime_resume_host(host, 1);
699700 return 0;
700701
701702 clk_disable:
drivers/mmc/host/sdhci-xenon.c+1−1
@@ -638,7 +638,7 @@ static int xenon_runtime_resume(struct device *dev) · 637 unmodified lines
638638 priv->restore_needed = false;
639639 }
640640
641− ret = sdhci_runtime_resume_host(host);
641+ ret = sdhci_runtime_resume_host(host, 0);
642642 if (ret)
643643 goto out;
644644 return 0;
drivers/mmc/host/sdhci.c+2−2
@@ -3320,7 +3320,7 @@ int sdhci_runtime_suspend_host(struct sdhci_host *host) · 3319 unmodified lines
33203320 }
33213321 EXPORT_SYMBOL_GPL(sdhci_runtime_suspend_host);
33223322
3323−int sdhci_runtime_resume_host(struct sdhci_host *host)
3323+int sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset)
33243324 {
33253325 struct mmc_host *mmc = host->mmc;
33263326 unsigned long flags;
@@ -3331,7 +3331,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host) · 4 unmodified lines
33313331 host->ops->enable_dma(host);
33323332 }
33333333
3334− sdhci_init(host, 0);
3334+ sdhci_init(host, soft_reset);
33353335
33363336 if (mmc->ios.power_mode != MMC_POWER_UNDEFINED &&
33373337 mmc->ios.power_mode != MMC_POWER_OFF) {
drivers/mmc/host/sdhci.h+1−1
@@ -781,7 +781,7 @@ void sdhci_adma_write_desc(struct sdhci_host *host, void **desc, · 780 unmodified lines
781781 int sdhci_suspend_host(struct sdhci_host *host);
782782 int sdhci_resume_host(struct sdhci_host *host);
783783 int sdhci_runtime_suspend_host(struct sdhci_host *host);
784−int sdhci_runtime_resume_host(struct sdhci_host *host);
784+int sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset);
785785 #endif
786786
787787 void sdhci_cqe_enable(struct mmc_host *mmc);
drivers/mtd/hyperbus/Kconfig+2−1
@@ -14,8 +14,9 @@ if MTD_HYPERBUS · 13 unmodified lines
1414
1515 config HBMC_AM654
1616 tristate "HyperBus controller driver for AM65x SoC"
17+ depends on ARM64 || COMPILE_TEST
1718 select MULTIPLEXER
18− select MUX_MMIO
19+ imply MUX_MMIO
1920 help
2021 This is the driver for HyperBus controller on TI's AM65x and
2122 other SoCs
drivers/mtd/nand/raw/nand_micron.c+11−3
@@ -390,6 +390,14 @@ static int micron_supports_on_die_ecc(struct nand_chip *chip) · 389 unmodified lines
390390 (chip->id.data[4] & MICRON_ID_INTERNAL_ECC_MASK) != 0x2)
391391 return MICRON_ON_DIE_UNSUPPORTED;
392392
393+ /*
394+ * It seems that there are devices which do not support ECC officially.
395+ * At least the MT29F2G08ABAGA / MT29F2G08ABBGA devices supports
396+ * enabling the ECC feature but don't reflect that to the READ_ID table.
397+ * So we have to guarantee that we disable the ECC feature directly
398+ * after we did the READ_ID table command. Later we can evaluate the
399+ * ECC_ENABLE support.
400+ */
393401 ret = micron_nand_on_die_ecc_setup(chip, true);
394402 if (ret)
395403 return MICRON_ON_DIE_UNSUPPORTED;
@@ -398,13 +406,13 @@ static int micron_supports_on_die_ecc(struct nand_chip *chip) · 2 unmodified lines
398406 if (ret)
399407 return MICRON_ON_DIE_UNSUPPORTED;
400408
401− if (!(id[4] & MICRON_ID_ECC_ENABLED))
402− return MICRON_ON_DIE_UNSUPPORTED;
403−
404409 ret = micron_nand_on_die_ecc_setup(chip, false);
405410 if (ret)
406411 return MICRON_ON_DIE_UNSUPPORTED;
407412
413+ if (!(id[4] & MICRON_ID_ECC_ENABLED))
414+ return MICRON_ON_DIE_UNSUPPORTED;
415+
408416 ret = nand_readid_op(chip, 0, id, sizeof(id));
409417 if (ret)
410418 return MICRON_ON_DIE_UNSUPPORTED;
drivers/net/arcnet/arc-rimi.c+3−0
@@ -363,10 +363,13 @@ static int __init arcrimi_setup(char *s) · 362 unmodified lines
363363 switch (ints[0]) {
364364 default: /* ERROR */
365365 pr_err("Too many arguments\n");
366+ /* Fall through */
366367 case 3: /* Node ID */
367368 node = ints[3];
369+ /* Fall through */
368370 case 2: /* IRQ */
369371 irq = ints[2];
372+ /* Fall through */
370373 case 1: /* IO address */
371374 io = ints[1];
372375 }
drivers/net/arcnet/com20020-isa.c+6−0
@@ -197,16 +197,22 @@ static int __init com20020isa_setup(char *s) · 196 unmodified lines
197197 switch (ints[0]) {
198198 default: /* ERROR */
199199 pr_info("Too many arguments\n");
200+ /* Fall through */
200201 case 6: /* Timeout */
201202 timeout = ints[6];
203+ /* Fall through */
202204 case 5: /* CKP value */
203205 clockp = ints[5];
206+ /* Fall through */
204207 case 4: /* Backplane flag */
205208 backplane = ints[4];
209+ /* Fall through */
206210 case 3: /* Node ID */
207211 node = ints[3];
212+ /* Fall through */
208213 case 2: /* IRQ */
209214 irq = ints[2];
215+ /* Fall through */
210216 case 1: /* IO address */
211217 io = ints[1];
212218 }
drivers/net/arcnet/com90io.c+2−0
@@ -363,8 +363,10 @@ static int __init com90io_setup(char *s) · 362 unmodified lines
363363 switch (ints[0]) {
364364 default: /* ERROR */
365365 pr_err("Too many arguments\n");
366+ /* Fall through */
366367 case 2: /* IRQ */
367368 irq = ints[2];
369+ /* Fall through */
368370 case 1: /* IO address */
369371 io = ints[1];
370372 }
drivers/net/arcnet/com90xx.c+3−0
@@ -693,10 +693,13 @@ static int __init com90xx_setup(char *s) · 692 unmodified lines
693693 switch (ints[0]) {
694694 default: /* ERROR */
695695 pr_err("Too many arguments\n");
696+ /* Fall through */
696697 case 3: /* Mem address */
697698 shmem = ints[3];
699+ /* Fall through */
698700 case 2: /* IRQ */
699701 irq = ints[2];
702+ /* Fall through */
700703 case 1: /* IO address */
701704 io = ints[1];
702705 }
drivers/net/bonding/bond_main.c+9−0
@@ -2196,6 +2196,15 @@ static void bond_miimon_commit(struct bonding *bond) · 2195 unmodified lines
21962196 bond_for_each_slave(bond, slave, iter) {
21972197 switch (slave->new_link) {
21982198 case BOND_LINK_NOCHANGE:
2199+ /* For 802.3ad mode, check current slave speed and
2200+ * duplex again in case its port was disabled after
2201+ * invalid speed/duplex reporting but recovered before
2202+ * link monitoring could make a decision on the actual
2203+ * link status
2204+ */
2205+ if (BOND_MODE(bond) == BOND_MODE_8023AD &&
2206+ slave->link == BOND_LINK_UP)
2207+ bond_3ad_adapter_speed_duplex_changed(slave);
21992208 continue;
22002209
22012210 case BOND_LINK_UP:
drivers/net/can/dev.c+2−0
@@ -1249,6 +1249,8 @@ int register_candev(struct net_device *dev) · 1248 unmodified lines
12491249 return -EINVAL;
12501250
12511251 dev->rtnl_link_ops = &can_link_ops;
1252+ netif_carrier_off(dev);
1253+
12521254 return register_netdev(dev);
12531255 }
12541256 EXPORT_SYMBOL_GPL(register_candev);
drivers/net/can/flexcan.c+32−7
@@ -400,9 +400,10 @@ static void flexcan_enable_wakeup_irq(struct flexcan_priv *priv, bool enable) · 399 unmodified lines
400400 priv->write(reg_mcr, &regs->mcr);
401401 }
402402
403−static inline void flexcan_enter_stop_mode(struct flexcan_priv *priv)
403+static inline int flexcan_enter_stop_mode(struct flexcan_priv *priv)
404404 {
405405 struct flexcan_regs __iomem *regs = priv->regs;
406+ unsigned int ackval;
406407 u32 reg_mcr;
407408
408409 reg_mcr = priv->read(&regs->mcr);
@@ -412,20 +413,37 @@ static inline void flexcan_enter_stop_mode(struct flexcan_priv *priv) · 3 unmodified lines
412413 /* enable stop request */
413414 regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
414415 1 << priv->stm.req_bit, 1 << priv->stm.req_bit);
416+
417+ /* get stop acknowledgment */
418+ if (regmap_read_poll_timeout(priv->stm.gpr, priv->stm.ack_gpr,
419+ ackval, ackval & (1 << priv->stm.ack_bit),
420+ 0, FLEXCAN_TIMEOUT_US))
421+ return -ETIMEDOUT;
422+
423+ return 0;
415424 }
416425
417−static inline void flexcan_exit_stop_mode(struct flexcan_priv *priv)
426+static inline int flexcan_exit_stop_mode(struct flexcan_priv *priv)
418427 {
419428 struct flexcan_regs __iomem *regs = priv->regs;
429+ unsigned int ackval;
420430 u32 reg_mcr;
421431
422432 /* remove stop request */
423433 regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
424434 1 << priv->stm.req_bit, 0);
425435
436+ /* get stop acknowledgment */
437+ if (regmap_read_poll_timeout(priv->stm.gpr, priv->stm.ack_gpr,
438+ ackval, !(ackval & (1 << priv->stm.ack_bit)),
439+ 0, FLEXCAN_TIMEOUT_US))
440+ return -ETIMEDOUT;
441+
426442 reg_mcr = priv->read(&regs->mcr);
427443 reg_mcr &= ~FLEXCAN_MCR_SLF_WAK;
428444 priv->write(reg_mcr, &regs->mcr);
445+
446+ return 0;
429447 }
430448
431449 static inline void flexcan_error_irq_enable(const struct flexcan_priv *priv)
@@ -1437,10 +1455,10 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev) · 1005 unmodified lines
14371455
14381456 priv = netdev_priv(dev);
14391457 priv->stm.gpr = syscon_node_to_regmap(gpr_np);
1440− of_node_put(gpr_np);
14411458 if (IS_ERR(priv->stm.gpr)) {
14421459 dev_dbg(&pdev->dev, "could not find gpr regmap\n");
1443− return PTR_ERR(priv->stm.gpr);
1460+ ret = PTR_ERR(priv->stm.gpr);
1461+ goto out_put_node;
14441462 }
14451463
14461464 priv->stm.req_gpr = out_val[1];
@@ -1455,7 +1473,9 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev) · 8 unmodified lines
14551473
14561474 device_set_wakeup_capable(&pdev->dev, true);
14571475
1458− return 0;
1476+out_put_node:
1477+ of_node_put(gpr_np);
1478+ return ret;
14591479 }
14601480
14611481 static const struct of_device_id flexcan_of_match[] = {
@@ -1612,7 +1632,9 @@ static int __maybe_unused flexcan_suspend(struct device *device) · 150 unmodified lines
16121632 */
16131633 if (device_may_wakeup(device)) {
16141634 enable_irq_wake(dev->irq);
1615− flexcan_enter_stop_mode(priv);
1635+ err = flexcan_enter_stop_mode(priv);
1636+ if (err)
1637+ return err;
16161638 } else {
16171639 err = flexcan_chip_disable(priv);
16181640 if (err)
@@ -1662,10 +1684,13 @@ static int __maybe_unused flexcan_noirq_resume(struct device *device) · 43 unmodified lines
16621684 {
16631685 struct net_device *dev = dev_get_drvdata(device);
16641686 struct flexcan_priv *priv = netdev_priv(dev);
1687+ int err;
16651688
16661689 if (netif_running(dev) && device_may_wakeup(device)) {
16671690 flexcan_enable_wakeup_irq(priv, false);
1668− flexcan_exit_stop_mode(priv);
1691+ err = flexcan_exit_stop_mode(priv);
1692+ if (err)
1693+ return err;
16691694 }
16701695
16711696 return 0;
drivers/net/can/rcar/rcar_canfd.c+5−4
@@ -1508,10 +1508,11 @@ static int rcar_canfd_rx_poll(struct napi_struct *napi, int quota) · 1507 unmodified lines
15081508
15091509 /* All packets processed */
15101510 if (num_pkts < quota) {
1511− napi_complete_done(napi, num_pkts);
1512− /* Enable Rx FIFO interrupts */
1513− rcar_canfd_set_bit(priv->base, RCANFD_RFCC(ridx),
1514− RCANFD_RFCC_RFIE);
1511+ if (napi_complete_done(napi, num_pkts)) {
1512+ /* Enable Rx FIFO interrupts */
1513+ rcar_canfd_set_bit(priv->base, RCANFD_RFCC(ridx),
1514+ RCANFD_RFCC_RFIE);
1515+ }
15151516 }
15161517 return num_pkts;
15171518 }
drivers/net/can/sja1000/peak_pcmcia.c+1−1
@@ -479,7 +479,7 @@ static void pcan_free_channels(struct pcan_pccard *card) · 478 unmodified lines
479479 if (!netdev)
480480 continue;
481481
482− strncpy(name, netdev->name, IFNAMSIZ);
482+ strlcpy(name, netdev->name, IFNAMSIZ);
483483
484484 unregister_sja1000dev(netdev);
485485
drivers/net/can/spi/mcp251x.c+22−27
@@ -664,17 +664,6 @@ static int mcp251x_power_enable(struct regulator *reg, int enable) · 663 unmodified lines
664664 return regulator_disable(reg);
665665 }
666666
667−static void mcp251x_open_clean(struct net_device *net)
668−{
669− struct mcp251x_priv *priv = netdev_priv(net);
670− struct spi_device *spi = priv->spi;
671−
672− free_irq(spi->irq, priv);
673− mcp251x_hw_sleep(spi);
674− mcp251x_power_enable(priv->transceiver, 0);
675− close_candev(net);
676−}
677−
678667 static int mcp251x_stop(struct net_device *net)
679668 {
680669 struct mcp251x_priv *priv = netdev_priv(net);
@@ -941,37 +930,43 @@ static int mcp251x_open(struct net_device *net) · 260 unmodified lines
941930 flags | IRQF_ONESHOT, DEVICE_NAME, priv);
942931 if (ret) {
943932 dev_err(&spi->dev, "failed to acquire irq %d\n", spi->irq);
944− mcp251x_power_enable(priv->transceiver, 0);
945− close_candev(net);
946− goto open_unlock;
933+ goto out_close;
947934 }
948935
949936 priv->wq = alloc_workqueue("mcp251x_wq", WQ_FREEZABLE | WQ_MEM_RECLAIM,
950937 0);
938+ if (!priv->wq) {
939+ ret = -ENOMEM;
940+ goto out_clean;
941+ }
951942 INIT_WORK(&priv->tx_work, mcp251x_tx_work_handler);
952943 INIT_WORK(&priv->restart_work, mcp251x_restart_work_handler);
953944
954945 ret = mcp251x_hw_reset(spi);
955− if (ret) {
956− mcp251x_open_clean(net);
957− goto open_unlock;
958− }
946+ if (ret)
947+ goto out_free_wq;
959948 ret = mcp251x_setup(net, spi);
960− if (ret) {
961− mcp251x_open_clean(net);
962− goto open_unlock;
963− }
949+ if (ret)
950+ goto out_free_wq;
964951 ret = mcp251x_set_normal_mode(spi);
965− if (ret) {
966− mcp251x_open_clean(net);
967− goto open_unlock;
968− }
952+ if (ret)
953+ goto out_free_wq;
969954
970955 can_led_event(net, CAN_LED_EVENT_OPEN);
971956
972957 netif_wake_queue(net);
958+ mutex_unlock(&priv->mcp_lock);
973959
974−open_unlock:
960+ return 0;
961+
962+out_free_wq:
963+ destroy_workqueue(priv->wq);
964+out_clean:
965+ free_irq(spi->irq, priv);
966+ mcp251x_hw_sleep(spi);
967+out_close:
968+ mcp251x_power_enable(priv->transceiver, 0);
969+ close_candev(net);
975970 mutex_unlock(&priv->mcp_lock);
976971 return ret;
977972 }
drivers/net/can/usb/peak_usb/pcan_usb_core.c+5−5
@@ -568,16 +568,16 @@ static int peak_usb_ndo_stop(struct net_device *netdev) · 567 unmodified lines
568568 dev->state &= ~PCAN_USB_STATE_STARTED;
569569 netif_stop_queue(netdev);
570570
571+ close_candev(netdev);
572+
573+ dev->can.state = CAN_STATE_STOPPED;
574+
571575 /* unlink all pending urbs and free used memory */
572576 peak_usb_unlink_all_urbs(dev);
573577
574578 if (dev->adapter->dev_stop)
575579 dev->adapter->dev_stop(dev);
576580
577− close_candev(netdev);
578−
579− dev->can.state = CAN_STATE_STOPPED;
580−
581581 /* can set bus off now */
582582 if (dev->adapter->dev_set_bus) {
583583 int err = dev->adapter->dev_set_bus(dev, 0);
@@ -855,7 +855,7 @@ static void peak_usb_disconnect(struct usb_interface *intf) · 271 unmodified lines
855855
856856 dev_prev_siblings = dev->prev_siblings;
857857 dev->state &= ~PCAN_USB_STATE_CONNECTED;
858− strncpy(name, netdev->name, IFNAMSIZ);
858+ strlcpy(name, netdev->name, IFNAMSIZ);
859859
860860 unregister_netdev(netdev);
861861
drivers/net/can/usb/peak_usb/pcan_usb_fd.c+1−1
@@ -841,7 +841,7 @@ static int pcan_usb_fd_init(struct peak_usb_device *dev) · 840 unmodified lines
841841 goto err_out;
842842
843843 /* allocate command buffer once for all for the interface */
844− pdev->cmd_buffer_addr = kmalloc(PCAN_UFD_CMD_BUFFER_SIZE,
844+ pdev->cmd_buffer_addr = kzalloc(PCAN_UFD_CMD_BUFFER_SIZE,
845845 GFP_KERNEL);
846846 if (!pdev->cmd_buffer_addr)
847847 goto err_out_1;
drivers/net/can/usb/peak_usb/pcan_usb_pro.c+1−1
@@ -494,7 +494,7 @@ static int pcan_usb_pro_drv_loaded(struct peak_usb_device *dev, int loaded) · 493 unmodified lines
494494 u8 *buffer;
495495 int err;
496496
497− buffer = kmalloc(PCAN_USBPRO_FCT_DRVLD_REQ_LEN, GFP_KERNEL);
497+ buffer = kzalloc(PCAN_USBPRO_FCT_DRVLD_REQ_LEN, GFP_KERNEL);
498498 if (!buffer)
499499 return -ENOMEM;
500500
drivers/net/dsa/mv88e6xxx/chip.c+2−27
@@ -27,7 +27,6 @@ · 26 unmodified lines
2727 #include <linux/platform_data/mv88e6xxx.h>
2828 #include <linux/netdevice.h>
2929 #include <linux/gpio/consumer.h>
30−#include <linux/phy.h>
3130 #include <linux/phylink.h>
3231 #include <net/dsa.h>
3332
@@ -430,7 +429,7 @@ int mv88e6xxx_port_setup_mac(struct mv88e6xxx_chip *chip, int port, int link, · 396 unmodified lines
430429 return 0;
431430
432431 /* Port's MAC control must not be changed unless the link is down */
433− err = chip->info->ops->port_set_link(chip, port, 0);
432+ err = chip->info->ops->port_set_link(chip, port, LINK_FORCED_DOWN);
434433 if (err)
435434 return err;
436435
@@ -482,30 +481,6 @@ static int mv88e6xxx_phy_is_internal(struct dsa_switch *ds, int port) · 45 unmodified lines
482481 return port < chip->info->num_internal_phys;
483482 }
484483
485−/* We expect the switch to perform auto negotiation if there is a real
486− * phy. However, in the case of a fixed link phy, we force the port
487− * settings from the fixed link settings.
488− */
489−static void mv88e6xxx_adjust_link(struct dsa_switch *ds, int port,
490− struct phy_device *phydev)
491−{
492− struct mv88e6xxx_chip *chip = ds->priv;
493− int err;
494−
495− if (!phy_is_pseudo_fixed_link(phydev) &&
496− mv88e6xxx_phy_is_internal(ds, port))
497− return;
498−
499− mv88e6xxx_reg_lock(chip);
500− err = mv88e6xxx_port_setup_mac(chip, port, phydev->link, phydev->speed,
501− phydev->duplex, phydev->pause,
502− phydev->interface);
503− mv88e6xxx_reg_unlock(chip);
504−
505− if (err && err != -EOPNOTSUPP)
506− dev_err(ds->dev, "p%d: failed to configure MAC\n", port);
507−}
508−
509484 static void mv88e6065_phylink_validate(struct mv88e6xxx_chip *chip, int port,
510485 unsigned long *mask,
511486 struct phylink_link_state *state)
@@ -2721,6 +2696,7 @@ static int mv88e6xxx_mdios_register(struct mv88e6xxx_chip *chip, · 2209 unmodified lines
27212696 err = mv88e6xxx_mdio_register(chip, child, true);
27222697 if (err) {
27232698 mv88e6xxx_mdios_unregister(chip);
2699+ of_node_put(child);
27242700 return err;
27252701 }
27262702 }
@@ -4638,7 +4614,6 @@ static int mv88e6xxx_port_egress_floods(struct dsa_switch *ds, int port, · 1911 unmodified lines
46384614 static const struct dsa_switch_ops mv88e6xxx_switch_ops = {
46394615 .get_tag_protocol = mv88e6xxx_get_tag_protocol,
46404616 .setup = mv88e6xxx_setup,
4641− .adjust_link = mv88e6xxx_adjust_link,
46424617 .phylink_validate = mv88e6xxx_validate,
46434618 .phylink_mac_link_state = mv88e6xxx_link_state,
46444619 .phylink_mac_config = mv88e6xxx_mac_config,
drivers/net/dsa/qca8k.c+8−2
@@ -2,7 +2,7 @@ · 1 unmodified line
22 /*
33 * Copyright (C) 2009 Felix Fietkau <nbd@nbd.name>
44 * Copyright (C) 2011-2012 Gabor Juhos <juhosg@openwrt.org>
5− * Copyright (c) 2015, The Linux Foundation. All rights reserved.
5+ * Copyright (c) 2015, 2019, The Linux Foundation. All rights reserved.
66 * Copyright (c) 2016 John Crispin <john@phrozen.org>
77 */
88
@@ -583,8 +583,11 @@ qca8k_setup_mdio_bus(struct qca8k_priv *priv) · 574 unmodified lines
583583
584584 for_each_available_child_of_node(ports, port) {
585585 err = of_property_read_u32(port, "reg", &reg);
586− if (err)
586+ if (err) {
587+ of_node_put(port);
588+ of_node_put(ports);
587589 return err;
590+ }
588591
589592 if (!dsa_is_user_port(priv->ds, reg))
590593 continue;
@@ -595,6 +598,7 @@ qca8k_setup_mdio_bus(struct qca8k_priv *priv) · 4 unmodified lines
595598 internal_mdio_mask |= BIT(reg);
596599 }
597600
601+ of_node_put(ports);
598602 if (!external_mdio_mask && !internal_mdio_mask) {
599603 dev_err(priv->dev, "no PHYs are defined.\n");
600604 return -EINVAL;
@@ -935,6 +939,8 @@ qca8k_port_enable(struct dsa_switch *ds, int port, · 334 unmodified lines
935939 qca8k_port_set_status(priv, port, 1);
936940 priv->port_sts[port].enabled = 1;
937941
942+ phy_support_asym_pause(phy);
943+
938944 return 0;
939945 }
940946
drivers/net/dsa/sja1105/sja1105_dynamic_config.c+13−1
@@ -277,6 +277,18 @@ sja1105et_l2_lookup_cmd_packing(void *buf, struct sja1105_dyn_cmd *cmd, · 276 unmodified lines
277277 SJA1105ET_SIZE_L2_LOOKUP_ENTRY, op);
278278 }
279279
280+static size_t sja1105et_dyn_l2_lookup_entry_packing(void *buf, void *entry_ptr,
281+ enum packing_op op)
282+{
283+ struct sja1105_l2_lookup_entry *entry = entry_ptr;
284+ u8 *cmd = buf + SJA1105ET_SIZE_L2_LOOKUP_ENTRY;
285+ const int size = SJA1105_SIZE_DYN_CMD;
286+
287+ sja1105_packing(cmd, &entry->lockeds, 28, 28, size, op);
288+
289+ return sja1105et_l2_lookup_entry_packing(buf, entry_ptr, op);
290+}
291+
280292 static void
281293 sja1105et_mgmt_route_cmd_packing(void *buf, struct sja1105_dyn_cmd *cmd,
282294 enum packing_op op)
@@ -477,7 +489,7 @@ sja1105et_general_params_entry_packing(void *buf, void *entry_ptr, · 194 unmodified lines
477489 /* SJA1105E/T: First generation */
478490 struct sja1105_dynamic_table_ops sja1105et_dyn_ops[BLK_IDX_MAX_DYN] = {
479491 [BLK_IDX_L2_LOOKUP] = {
480− .entry_packing = sja1105et_l2_lookup_entry_packing,
492+ .entry_packing = sja1105et_dyn_l2_lookup_entry_packing,
481493 .cmd_packing = sja1105et_l2_lookup_cmd_packing,
482494 .access = (OP_READ | OP_WRITE | OP_DEL),
483495 .max_entry_count = SJA1105_MAX_L2_LOOKUP_COUNT,
drivers/net/dsa/sja1105/sja1105_main.c+60−83
@@ -218,7 +218,7 @@ static int sja1105_init_l2_lookup_params(struct sja1105_private *priv) · 217 unmodified lines
218218 /* This selects between Independent VLAN Learning (IVL) and
219219 * Shared VLAN Learning (SVL)
220220 */
221− .shared_learn = false,
221+ .shared_learn = true,
222222 /* Don't discard management traffic based on ENFPORT -
223223 * we don't perform SMAC port enforcement anyway, so
224224 * what we are setting here doesn't matter.
@@ -625,6 +625,7 @@ static int sja1105_parse_ports_node(struct sja1105_private *priv, · 400 unmodified lines
625625 if (of_property_read_u32(child, "reg", &index) < 0) {
626626 dev_err(dev, "Port number not defined in device tree "
627627 "(property \"reg\")\n");
628+ of_node_put(child);
628629 return -ENODEV;
629630 }
630631
@@ -634,6 +635,7 @@ static int sja1105_parse_ports_node(struct sja1105_private *priv, · 3 unmodified lines
634635 dev_err(dev, "Failed to read phy-mode or "
635636 "phy-interface-type property for port %d\n",
636637 index);
638+ of_node_put(child);
637639 return -ENODEV;
638640 }
639641 ports[index].phy_mode = phy_mode;
@@ -643,6 +645,7 @@ static int sja1105_parse_ports_node(struct sja1105_private *priv, · 3 unmodified lines
643645 if (!of_phy_is_fixed_link(child)) {
644646 dev_err(dev, "phy-handle or fixed-link "
645647 "properties missing!\n");
648+ of_node_put(child);
646649 return -ENODEV;
647650 }
648651 /* phy-handle is missing, but fixed-link isn't.
@@ -1089,8 +1092,13 @@ int sja1105pqrs_fdb_add(struct dsa_switch *ds, int port, · 440 unmodified lines
10891092 l2_lookup.vlanid = vid;
10901093 l2_lookup.iotag = SJA1105_S_TAG;
10911094 l2_lookup.mask_macaddr = GENMASK_ULL(ETH_ALEN * 8 - 1, 0);
1092− l2_lookup.mask_vlanid = VLAN_VID_MASK;
1093− l2_lookup.mask_iotag = BIT(0);
1095+ if (dsa_port_is_vlan_filtering(&ds->ports[port])) {
1096+ l2_lookup.mask_vlanid = VLAN_VID_MASK;
1097+ l2_lookup.mask_iotag = BIT(0);
1098+ } else {
1099+ l2_lookup.mask_vlanid = 0;
1100+ l2_lookup.mask_iotag = 0;
1101+ }
10941102 l2_lookup.destports = BIT(port);
10951103
10961104 rc = sja1105_dynamic_config_read(priv, BLK_IDX_L2_LOOKUP,
@@ -1147,8 +1155,13 @@ int sja1105pqrs_fdb_del(struct dsa_switch *ds, int port, · 50 unmodified lines
11471155 l2_lookup.vlanid = vid;
11481156 l2_lookup.iotag = SJA1105_S_TAG;
11491157 l2_lookup.mask_macaddr = GENMASK_ULL(ETH_ALEN * 8 - 1, 0);
1150− l2_lookup.mask_vlanid = VLAN_VID_MASK;
1151− l2_lookup.mask_iotag = BIT(0);
1158+ if (dsa_port_is_vlan_filtering(&ds->ports[port])) {
1159+ l2_lookup.mask_vlanid = VLAN_VID_MASK;
1160+ l2_lookup.mask_iotag = BIT(0);
1161+ } else {
1162+ l2_lookup.mask_vlanid = 0;
1163+ l2_lookup.mask_iotag = 0;
1164+ }
11521165 l2_lookup.destports = BIT(port);
11531166
11541167 rc = sja1105_dynamic_config_read(priv, BLK_IDX_L2_LOOKUP,
@@ -1178,60 +1191,31 @@ static int sja1105_fdb_add(struct dsa_switch *ds, int port, · 23 unmodified lines
11781191 const unsigned char *addr, u16 vid)
11791192 {
11801193 struct sja1105_private *priv = ds->priv;
1181− u16 rx_vid, tx_vid;
1182− int rc, i;
11831194
1184− if (dsa_port_is_vlan_filtering(&ds->ports[port]))
1185− return priv->info->fdb_add_cmd(ds, port, addr, vid);
1186−
1187− /* Since we make use of VLANs even when the bridge core doesn't tell us
1188− * to, translate these FDB entries into the correct dsa_8021q ones.
1189− * The basic idea (also repeats for removal below) is:
1190− * - Each of the other front-panel ports needs to be able to forward a
1191− * pvid-tagged (aka tagged with their rx_vid) frame that matches this
1192− * DMAC.
1193− * - The CPU port (aka the tx_vid of this port) needs to be able to
1194− * send a frame matching this DMAC to the specified port.
1195− * For a better picture see net/dsa/tag_8021q.c.
1195+ /* dsa_8021q is in effect when the bridge's vlan_filtering isn't,
1196+ * so the switch still does some VLAN processing internally.
1197+ * But Shared VLAN Learning (SVL) is also active, and it will take
1198+ * care of autonomous forwarding between the unique pvid's of each
1199+ * port. Here we just make sure that users can't add duplicate FDB
1200+ * entries when in this mode - the actual VID doesn't matter except
1201+ * for what gets printed in 'bridge fdb show'. In the case of zero,
1202+ * no VID gets printed at all.
11961203 */
1197− for (i = 0; i < SJA1105_NUM_PORTS; i++) {
1198− if (i == port)
1199− continue;
1200− if (i == dsa_upstream_port(priv->ds, port))
1201− continue;
1204+ if (!dsa_port_is_vlan_filtering(&ds->ports[port]))
1205+ vid = 0;
12021206
1203− rx_vid = dsa_8021q_rx_vid(ds, i);
1204− rc = priv->info->fdb_add_cmd(ds, port, addr, rx_vid);
1205− if (rc < 0)
1206− return rc;
1207− }
1208− tx_vid = dsa_8021q_tx_vid(ds, port);
1209− return priv->info->fdb_add_cmd(ds, port, addr, tx_vid);
1207+ return priv->info->fdb_add_cmd(ds, port, addr, vid);
12101208 }
12111209
12121210 static int sja1105_fdb_del(struct dsa_switch *ds, int port,
12131211 const unsigned char *addr, u16 vid)
12141212 {
12151213 struct sja1105_private *priv = ds->priv;
1216− u16 rx_vid, tx_vid;
1217− int rc, i;
1218−
1219− if (dsa_port_is_vlan_filtering(&ds->ports[port]))
1220− return priv->info->fdb_del_cmd(ds, port, addr, vid);
12211214
1222− for (i = 0; i < SJA1105_NUM_PORTS; i++) {
1223− if (i == port)
1224− continue;
1225− if (i == dsa_upstream_port(priv->ds, port))
1226− continue;
1215+ if (!dsa_port_is_vlan_filtering(&ds->ports[port]))
1216+ vid = 0;
12271217
1228− rx_vid = dsa_8021q_rx_vid(ds, i);
1229− rc = priv->info->fdb_del_cmd(ds, port, addr, rx_vid);
1230− if (rc < 0)
1231− return rc;
1232− }
1233− tx_vid = dsa_8021q_tx_vid(ds, port);
1234− return priv->info->fdb_del_cmd(ds, port, addr, tx_vid);
1218+ return priv->info->fdb_del_cmd(ds, port, addr, vid);
12351219 }
12361220
12371221 static int sja1105_fdb_dump(struct dsa_switch *ds, int port,
@@ -1270,39 +1254,9 @@ static int sja1105_fdb_dump(struct dsa_switch *ds, int port, · 32 unmodified lines
12701254 continue;
12711255 u64_to_ether_addr(l2_lookup.macaddr, macaddr);
12721256
1273− /* On SJA1105 E/T, the switch doesn't implement the LOCKEDS
1274− * bit, so it doesn't tell us whether a FDB entry is static
1275− * or not.
1276− * But, of course, we can find out - we're the ones who added
1277− * it in the first place.
1278− */
1279− if (priv->info->device_id == SJA1105E_DEVICE_ID ||
1280− priv->info->device_id == SJA1105T_DEVICE_ID) {
1281− int match;
1282−
1283− match = sja1105_find_static_fdb_entry(priv, port,
1284− &l2_lookup);
1285− l2_lookup.lockeds = (match >= 0);
1286− }
1287−
1288− /* We need to hide the dsa_8021q VLANs from the user. This
1289− * basically means hiding the duplicates and only showing
1290− * the pvid that is supposed to be active in standalone and
1291− * non-vlan_filtering modes (aka 1).
1292− * - For statically added FDB entries (bridge fdb add), we
1293− * can convert the TX VID (coming from the CPU port) into the
1294− * pvid and ignore the RX VIDs of the other ports.
1295− * - For dynamically learned FDB entries, a single entry with
1296− * no duplicates is learned - that which has the real port's
1297− * pvid, aka RX VID.
1298− */
1299− if (!dsa_port_is_vlan_filtering(&ds->ports[port])) {
1300− if (l2_lookup.vlanid == tx_vid ||
1301− l2_lookup.vlanid == rx_vid)
1302− l2_lookup.vlanid = 1;
1303− else
1304− continue;
1305− }
1257+ /* We need to hide the dsa_8021q VLANs from the user. */
1258+ if (!dsa_port_is_vlan_filtering(&ds->ports[port]))
1259+ l2_lookup.vlanid = 0;
13061260 cb(macaddr, l2_lookup.vlanid, l2_lookup.lockeds, data);
13071261 }
13081262 return 0;
@@ -1594,6 +1548,7 @@ static int sja1105_vlan_prepare(struct dsa_switch *ds, int port, · 285 unmodified lines
15941548 */
15951549 static int sja1105_vlan_filtering(struct dsa_switch *ds, int port, bool enabled)
15961550 {
1551+ struct sja1105_l2_lookup_params_entry *l2_lookup_params;
15971552 struct sja1105_general_params_entry *general_params;
15981553 struct sja1105_private *priv = ds->priv;
15991554 struct sja1105_table *table;
@@ -1622,6 +1577,28 @@ static int sja1105_vlan_filtering(struct dsa_switch *ds, int port, bool enabled) · 22 unmodified lines
16221577 general_params->incl_srcpt1 = enabled;
16231578 general_params->incl_srcpt0 = enabled;
16241579
1580+ /* VLAN filtering => independent VLAN learning.
1581+ * No VLAN filtering => shared VLAN learning.
1582+ *
1583+ * In shared VLAN learning mode, untagged traffic still gets
1584+ * pvid-tagged, and the FDB table gets populated with entries
1585+ * containing the "real" (pvid or from VLAN tag) VLAN ID.
1586+ * However the switch performs a masked L2 lookup in the FDB,
1587+ * effectively only looking up a frame's DMAC (and not VID) for the
1588+ * forwarding decision.
1589+ *
1590+ * This is extremely convenient for us, because in modes with
1591+ * vlan_filtering=0, dsa_8021q actually installs unique pvid's into
1592+ * each front panel port. This is good for identification but breaks
1593+ * learning badly - the VID of the learnt FDB entry is unique, aka
1594+ * no frames coming from any other port are going to have it. So
1595+ * for forwarding purposes, this is as though learning was broken
1596+ * (all frames get flooded).
1597+ */
1598+ table = &priv->static_config.tables[BLK_IDX_L2_LOOKUP_PARAMS];
1599+ l2_lookup_params = table->entries;
1600+ l2_lookup_params->shared_learn = !enabled;
1601+
16251602 rc = sja1105_static_config_reload(priv);
16261603 if (rc)
16271604 dev_err(ds->dev, "Failed to change VLAN Ethertype\n");
@@ -1751,6 +1728,8 @@ static void sja1105_teardown(struct dsa_switch *ds) · 123 unmodified lines
17511728
17521729 cancel_work_sync(&priv->tagger_data.rxtstamp_work);
17531730 skb_queue_purge(&priv->tagger_data.skb_rxtstamp_queue);
1731+ sja1105_ptp_clock_unregister(priv);
1732+ sja1105_static_config_free(&priv->static_config);
17541733 }
17551734
17561735 static int sja1105_mgmt_xmit(struct dsa_switch *ds, int port, int slot,
@@ -2208,9 +2187,7 @@ static int sja1105_remove(struct spi_device *spi) · 451 unmodified lines
22082187 {
22092188 struct sja1105_private *priv = spi_get_drvdata(spi);
22102189
2211− sja1105_ptp_clock_unregister(priv);
22122190 dsa_unregister_switch(priv->ds);
2213− sja1105_static_config_free(&priv->static_config);
22142191 return 0;
22152192 }
22162193
drivers/net/dsa/sja1105/sja1105_ptp.c+3−4
@@ -369,16 +369,15 @@ int sja1105_ptp_clock_register(struct sja1105_private *priv) · 368 unmodified lines
369369 .mult = SJA1105_CC_MULT,
370370 };
371371 mutex_init(&priv->ptp_lock);
372− INIT_DELAYED_WORK(&priv->refresh_work, sja1105_ptp_overflow_check);
373−
374− schedule_delayed_work(&priv->refresh_work, SJA1105_REFRESH_INTERVAL);
375−
376372 priv->ptp_caps = sja1105_ptp_caps;
377373
378374 priv->clock = ptp_clock_register(&priv->ptp_caps, ds->dev);
379375 if (IS_ERR_OR_NULL(priv->clock))
380376 return PTR_ERR(priv->clock);
381377
378+ INIT_DELAYED_WORK(&priv->refresh_work, sja1105_ptp_overflow_check);
379+ schedule_delayed_work(&priv->refresh_work, SJA1105_REFRESH_INTERVAL);
380+
382381 return sja1105_ptp_reset(priv);
383382 }
384383
drivers/net/ethernet/8390/Kconfig+2−2
@@ -12,8 +12,8 @@ config NET_VENDOR_8390 · 11 unmodified lines
1212
1313 Note that the answer to this question doesn't directly affect the
1414 kernel: saying N will just cause the configurator to skip all
15− the questions about Western Digital cards. If you say Y, you will be
16− asked for your specific card in the following questions.
15+ the questions about National Semiconductor 8390 cards. If you say Y,
16+ you will be asked for your specific card in the following questions.
1717
1818 if NET_VENDOR_8390
1919
drivers/net/ethernet/agere/et131x.c+1−1
@@ -2362,7 +2362,7 @@ static int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter) · 2361 unmodified lines
23622362
23632363 /* Allocate memory for the TCB's (Transmit Control Block) */
23642364 tx_ring->tcb_ring = kcalloc(NUM_TCB, sizeof(struct tcb),
2365− GFP_ATOMIC | GFP_DMA);
2365+ GFP_KERNEL | GFP_DMA);
23662366 if (!tx_ring->tcb_ring)
23672367 return -ENOMEM;
23682368
drivers/net/ethernet/allwinner/sun4i-emac.c+3−1
@@ -860,7 +860,9 @@ static int emac_probe(struct platform_device *pdev) · 859 unmodified lines
860860 goto out_clk_disable_unprepare;
861861 }
862862
863− db->phy_node = of_parse_phandle(np, "phy", 0);
863+ db->phy_node = of_parse_phandle(np, "phy-handle", 0);
864+ if (!db->phy_node)
865+ db->phy_node = of_parse_phandle(np, "phy", 0);
864866 if (!db->phy_node) {
865867 dev_err(&pdev->dev, "no associated PHY\n");
866868 ret = -ENODEV;
drivers/net/ethernet/amd/Kconfig+1−1
@@ -14,7 +14,7 @@ config NET_VENDOR_AMD · 13 unmodified lines
1414 say Y.
1515
1616 Note that the answer to this question does not directly affect
17− the kernel: saying N will just case the configurator to skip all
17+ the kernel: saying N will just cause the configurator to skip all
1818 the questions regarding AMD chipsets. If you say Y, you will be asked
1919 for your specific chipset/driver in the following questions.
2020
drivers/net/ethernet/apple/Kconfig+2−2
@@ -11,8 +11,8 @@ config NET_VENDOR_APPLE · 10 unmodified lines
1111 If you have a network (Ethernet) card belonging to this class, say Y.
1212
1313 Note that the answer to this question doesn't directly affect the
14− kernel: saying N will just cause the configurator to skip all
15− the questions about IBM devices. If you say Y, you will be asked for
14+ kernel: saying N will just cause the configurator to skip all the
15+ questions about Apple devices. If you say Y, you will be asked for
1616 your specific card in the following questions.
1717
1818 if NET_VENDOR_APPLE
drivers/net/ethernet/atheros/ag71xx.c+1−1
@@ -1141,7 +1141,7 @@ static int ag71xx_rings_init(struct ag71xx *ag) · 1140 unmodified lines
11411141
11421142 tx->descs_cpu = dma_alloc_coherent(&ag->pdev->dev,
11431143 ring_size * AG71XX_DESC_SIZE,
1144− &tx->descs_dma, GFP_ATOMIC);
1144+ &tx->descs_dma, GFP_KERNEL);
11451145 if (!tx->descs_cpu) {
11461146 kfree(tx->buf);
11471147 tx->buf = NULL;
drivers/net/ethernet/broadcom/Kconfig+3−3
@@ -14,9 +14,9 @@ config NET_VENDOR_BROADCOM · 13 unmodified lines
1414 say Y.
1515
1616 Note that the answer to this question does not directly affect
17− the kernel: saying N will just case the configurator to skip all
18− the questions regarding AMD chipsets. If you say Y, you will be asked
19− for your specific chipset/driver in the following questions.
17+ the kernel: saying N will just cause the configurator to skip all
18+ the questions regarding Broadcom chipsets. If you say Y, you will
19+ be asked for your specific chipset/driver in the following questions.
2020
2121 if NET_VENDOR_BROADCOM
2222
drivers/net/ethernet/broadcom/bcmsysport.c+1−1
@@ -992,7 +992,7 @@ static int bcm_sysport_poll(struct napi_struct *napi, int budget) · 991 unmodified lines
992992 {
993993 struct bcm_sysport_priv *priv =
994994 container_of(napi, struct bcm_sysport_priv, napi);
995− struct dim_sample dim_sample;
995+ struct dim_sample dim_sample = {};
996996 unsigned int work_done = 0;
997997
998998 work_done = bcm_sysport_desc_rx(priv, budget);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c+1−2
@@ -1934,8 +1934,7 @@ u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb, · 1933 unmodified lines
19341934 }
19351935
19361936 /* select a non-FCoE queue */
1937− return netdev_pick_tx(dev, skb, NULL) %
1938− (BNX2X_NUM_ETH_QUEUES(bp) * bp->max_cos);
1937+ return netdev_pick_tx(dev, skb, NULL) % (BNX2X_NUM_ETH_QUEUES(bp));
19391938 }
19401939
19411940 void bnx2x_set_num_queues(struct bnx2x *bp)
drivers/net/ethernet/broadcom/bnxt/bnxt.c+1−1
@@ -2136,7 +2136,7 @@ static int bnxt_poll(struct napi_struct *napi, int budget) · 2135 unmodified lines
21362136 }
21372137 }
21382138 if (bp->flags & BNXT_FLAG_DIM) {
2139− struct dim_sample dim_sample;
2139+ struct dim_sample dim_sample = {};
21402140
21412141 dim_update_sample(cpr->event_ctr,
21422142 cpr->rx_packets,
drivers/net/ethernet/broadcom/genet/bcmgenet.c+1−1
@@ -1895,7 +1895,7 @@ static int bcmgenet_rx_poll(struct napi_struct *napi, int budget) · 1894 unmodified lines
18951895 {
18961896 struct bcmgenet_rx_ring *ring = container_of(napi,
18971897 struct bcmgenet_rx_ring, napi);
1898− struct dim_sample dim_sample;
1898+ struct dim_sample dim_sample = {};
18991899 unsigned int work_done;
19001900
19011901 work_done = bcmgenet_desc_rx(ring, budget);
drivers/net/ethernet/cavium/thunder/thunder_bgx.c+6−12
@@ -1381,24 +1381,18 @@ static int acpi_get_mac_address(struct device *dev, struct acpi_device *adev, · 1380 unmodified lines
13811381 u8 *dst)
13821382 {
13831383 u8 mac[ETH_ALEN];
1384− int ret;
1384+ u8 *addr;
13851385
1386− ret = fwnode_property_read_u8_array(acpi_fwnode_handle(adev),
1387− "mac-address", mac, ETH_ALEN);
1388− if (ret)
1389− goto out;
1390−
1391− if (!is_valid_ether_addr(mac)) {
1386+ addr = fwnode_get_mac_address(acpi_fwnode_handle(adev), mac, ETH_ALEN);
1387+ if (!addr) {
13921388 dev_err(dev, "MAC address invalid: %pM\n", mac);
1393− ret = -EINVAL;
1394− goto out;
1389+ return -EINVAL;
13951390 }
13961391
13971392 dev_info(dev, "MAC address set to: %pM\n", mac);
13981393
1399− memcpy(dst, mac, ETH_ALEN);
1400−out:
1401− return ret;
1394+ ether_addr_copy(dst, mac);
1395+ return 0;
14021396 }
14031397
14041398 /* Currently only sets the MAC address. */
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c+4−1
@@ -3269,7 +3269,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 3268 unmodified lines
32693269 if (!adapter->regs) {
32703270 dev_err(&pdev->dev, "cannot map device registers\n");
32713271 err = -ENOMEM;
3272− goto out_free_adapter;
3272+ goto out_free_adapter_nofail;
32733273 }
32743274
32753275 adapter->pdev = pdev;
@@ -3397,6 +3397,9 @@ out_free_dev: · 121 unmodified lines
33973397 if (adapter->port[i])
33983398 free_netdev(adapter->port[i]);
33993399
3400+out_free_adapter_nofail:
3401+ kfree_skb(adapter->nofail_skb);
3402+
34003403 out_free_adapter:
34013404 kfree(adapter);
34023405
drivers/net/ethernet/emulex/benet/be_cmds.c+2−4
@@ -550,7 +550,7 @@ int be_process_mcc(struct be_adapter *adapter) · 549 unmodified lines
550550 int num = 0, status = 0;
551551 struct be_mcc_obj *mcc_obj = &adapter->mcc_obj;
552552
553− spin_lock(&adapter->mcc_cq_lock);
553+ spin_lock_bh(&adapter->mcc_cq_lock);
554554
555555 while ((compl = be_mcc_compl_get(adapter))) {
556556 if (compl->flags & CQE_FLAGS_ASYNC_MASK) {
@@ -566,7 +566,7 @@ int be_process_mcc(struct be_adapter *adapter) · 9 unmodified lines
566566 if (num)
567567 be_cq_notify(adapter, mcc_obj->cq.id, mcc_obj->rearm_cq, num);
568568
569− spin_unlock(&adapter->mcc_cq_lock);
569+ spin_unlock_bh(&adapter->mcc_cq_lock);
570570 return status;
571571 }
572572
@@ -581,9 +581,7 @@ static int be_mcc_wait_compl(struct be_adapter *adapter) · 8 unmodified lines
581581 if (be_check_error(adapter, BE_ERROR_ANY))
582582 return -EIO;
583583
584− local_bh_disable();
585584 status = be_process_mcc(adapter);
586− local_bh_enable();
587585
588586 if (atomic_read(&mcc_obj->q.used) == 0)
589587 break;
drivers/net/ethernet/emulex/benet/be_main.c+0−2
@@ -5630,9 +5630,7 @@ static void be_worker(struct work_struct *work) · 5629 unmodified lines
56305630 * mcc completions
56315631 */
56325632 if (!netif_running(adapter->netdev)) {
5633− local_bh_disable();
56345633 be_process_mcc(adapter);
5635− local_bh_enable();
56365634 goto reschedule;
56375635 }
56385636
drivers/net/ethernet/freescale/enetc/Kconfig+2−0
@@ -2,6 +2,7 @@ · 1 unmodified line
22 config FSL_ENETC
33 tristate "ENETC PF driver"
44 depends on PCI && PCI_MSI && (ARCH_LAYERSCAPE || COMPILE_TEST)
5+ select PHYLIB
56 help
67 This driver supports NXP ENETC gigabit ethernet controller PCIe
78 physical function (PF) devices, managing ENETC Ports at a privileged
@@ -12,6 +13,7 @@ config FSL_ENETC · 4 unmodified lines
1213 config FSL_ENETC_VF
1314 tristate "ENETC VF driver"
1415 depends on PCI && PCI_MSI && (ARCH_LAYERSCAPE || COMPILE_TEST)
16+ select PHYLIB
1517 help
1618 This driver supports NXP ENETC gigabit ethernet controller PCIe
1719 virtual function (VF) devices enabled by the ENETC PF driver.
drivers/net/ethernet/freescale/fman/fman.c+0−3
@@ -2439,9 +2439,6 @@ MODULE_PARM_DESC(fsl_fm_rx_extra_headroom, "Extra headroom for Rx buffers"); · 2438 unmodified lines
24392439 * buffers when not using jumbo frames.
24402440 * Must be large enough to accommodate the network MTU, but small enough
24412441 * to avoid wasting skb memory.
2442− *
2443− * Could be overridden once, at boot-time, via the
2444− * fm_set_max_frm() callback.
24452442 */
24462443 static int fsl_fm_max_frm = FSL_FM_MAX_FRAME_SIZE;
24472444 module_param(fsl_fm_max_frm, int, 0);
drivers/net/ethernet/google/gve/gve.h+3−5
@@ -31,9 +31,6 @@ · 30 unmodified lines
3131 struct gve_rx_desc_queue {
3232 struct gve_rx_desc *desc_ring; /* the descriptor ring */
3333 dma_addr_t bus; /* the bus for the desc_ring */
34− u32 cnt; /* free-running total number of completed packets */
35− u32 fill_cnt; /* free-running total number of descriptors posted */
36− u32 mask; /* masks the cnt to the size of the ring */
3734 u8 seqno; /* the next expected seqno for this desc*/
3835 };
3936
@@ -60,8 +57,6 @@ struct gve_rx_data_queue { · 20 unmodified lines
6057 dma_addr_t data_bus; /* dma mapping of the slots */
6158 struct gve_rx_slot_page_info *page_info; /* page info of the buffers */
6259 struct gve_queue_page_list *qpl; /* qpl assigned to this queue */
63− u32 mask; /* masks the cnt to the size of the ring */
64− u32 cnt; /* free-running total number of completed packets */
6560 };
6661
6762 struct gve_priv;
@@ -73,6 +68,9 @@ struct gve_rx_ring { · 5 unmodified lines
7368 struct gve_rx_data_queue data;
7469 u64 rbytes; /* free-running bytes received */
7570 u64 rpackets; /* free-running packets received */
71+ u32 cnt; /* free-running total number of completed packets */
72+ u32 fill_cnt; /* free-running total number of descs and buffs posted */
73+ u32 mask; /* masks the cnt and fill_cnt to the size of the ring */
7674 u32 q_num; /* queue index */
7775 u32 ntfy_id; /* notification block index */
7876 struct gve_queue_resources *q_resources; /* head and tail pointer idx */
drivers/net/ethernet/google/gve/gve_ethtool.c+2−2
@@ -138,8 +138,8 @@ gve_get_ethtool_stats(struct net_device *netdev, · 137 unmodified lines
138138 for (ring = 0; ring < priv->rx_cfg.num_queues; ring++) {
139139 struct gve_rx_ring *rx = &priv->rx[ring];
140140
141− data[i++] = rx->desc.cnt;
142− data[i++] = rx->desc.fill_cnt;
141+ data[i++] = rx->cnt;
142+ data[i++] = rx->fill_cnt;
143143 }
144144 } else {
145145 i += priv->rx_cfg.num_queues * NUM_GVE_RX_CNTS;
drivers/net/ethernet/google/gve/gve_rx.c+15−19
@@ -37,7 +37,7 @@ static void gve_rx_free_ring(struct gve_priv *priv, int idx) · 36 unmodified lines
3737 rx->data.qpl = NULL;
3838 kvfree(rx->data.page_info);
3939
40− slots = rx->data.mask + 1;
40+ slots = rx->mask + 1;
4141 bytes = sizeof(*rx->data.data_ring) * slots;
4242 dma_free_coherent(dev, bytes, rx->data.data_ring,
4343 rx->data.data_bus);
@@ -64,7 +64,7 @@ static int gve_prefill_rx_pages(struct gve_rx_ring *rx) · 20 unmodified lines
6464 /* Allocate one page per Rx queue slot. Each page is split into two
6565 * packet buffers, when possible we "page flip" between the two.
6666 */
67− slots = rx->data.mask + 1;
67+ slots = rx->mask + 1;
6868
6969 rx->data.page_info = kvzalloc(slots *
7070 sizeof(*rx->data.page_info), GFP_KERNEL);
@@ -111,7 +111,7 @@ static int gve_rx_alloc_ring(struct gve_priv *priv, int idx) · 40 unmodified lines
111111 rx->q_num = idx;
112112
113113 slots = priv->rx_pages_per_qpl;
114− rx->data.mask = slots - 1;
114+ rx->mask = slots - 1;
115115
116116 /* alloc rx data ring */
117117 bytes = sizeof(*rx->data.data_ring) * slots;
@@ -125,7 +125,7 @@ static int gve_rx_alloc_ring(struct gve_priv *priv, int idx) · 7 unmodified lines
125125 err = -ENOMEM;
126126 goto abort_with_slots;
127127 }
128− rx->desc.fill_cnt = filled_pages;
128+ rx->fill_cnt = filled_pages;
129129 /* Ensure data ring slots (packet buffers) are visible. */
130130 dma_wmb();
131131
@@ -156,8 +156,8 @@ static int gve_rx_alloc_ring(struct gve_priv *priv, int idx) · 24 unmodified lines
156156 err = -ENOMEM;
157157 goto abort_with_q_resources;
158158 }
159− rx->desc.mask = slots - 1;
160− rx->desc.cnt = 0;
159+ rx->mask = slots - 1;
160+ rx->cnt = 0;
161161 rx->desc.seqno = 1;
162162 gve_rx_add_to_block(priv, idx);
163163
@@ -213,7 +213,7 @@ void gve_rx_write_doorbell(struct gve_priv *priv, struct gve_rx_ring *rx) · 49 unmodified lines
213213 {
214214 u32 db_idx = be32_to_cpu(rx->q_resources->db_index);
215215
216− iowrite32be(rx->desc.fill_cnt, &priv->db_bar2[db_idx]);
216+ iowrite32be(rx->fill_cnt, &priv->db_bar2[db_idx]);
217217 }
218218
219219 static enum pkt_hash_types gve_rss_type(__be16 pkt_flags)
@@ -273,7 +273,7 @@ static void gve_rx_flip_buff(struct gve_rx_slot_page_info *page_info, · 53 unmodified lines
273273 }
274274
275275 static bool gve_rx(struct gve_rx_ring *rx, struct gve_rx_desc *rx_desc,
276− netdev_features_t feat)
276+ netdev_features_t feat, u32 idx)
277277 {
278278 struct gve_rx_slot_page_info *page_info;
279279 struct gve_priv *priv = rx->gve;
@@ -282,14 +282,12 @@ static bool gve_rx(struct gve_rx_ring *rx, struct gve_rx_desc *rx_desc, · 2 unmodified lines
282282 struct sk_buff *skb;
283283 int pagecount;
284284 u16 len;
285− u32 idx;
286285
287286 /* drop this packet */
288287 if (unlikely(rx_desc->flags_seq & GVE_RXF_ERR))
289288 return true;
290289
291290 len = be16_to_cpu(rx_desc->len) - GVE_RX_PAD;
292− idx = rx->data.cnt & rx->data.mask;
293291 page_info = &rx->data.page_info[idx];
294292
295293 /* gvnic can only receive into registered segments. If the buffer
@@ -340,8 +338,6 @@ have_skb: · 44 unmodified lines
340338 if (!skb)
341339 return true;
342340
343− rx->data.cnt++;
344−
345341 if (likely(feat & NETIF_F_RXCSUM)) {
346342 /* NIC passes up the partial sum */
347343 if (rx_desc->csum)
@@ -370,7 +366,7 @@ static bool gve_rx_work_pending(struct gve_rx_ring *rx) · 22 unmodified lines
370366 __be16 flags_seq;
371367 u32 next_idx;
372368
373− next_idx = rx->desc.cnt & rx->desc.mask;
369+ next_idx = rx->cnt & rx->mask;
374370 desc = rx->desc.desc_ring + next_idx;
375371
376372 flags_seq = desc->flags_seq;
@@ -385,8 +381,8 @@ bool gve_clean_rx_done(struct gve_rx_ring *rx, int budget, · 8 unmodified lines
385381 {
386382 struct gve_priv *priv = rx->gve;
387383 struct gve_rx_desc *desc;
388− u32 cnt = rx->desc.cnt;
389− u32 idx = cnt & rx->desc.mask;
384+ u32 cnt = rx->cnt;
385+ u32 idx = cnt & rx->mask;
390386 u32 work_done = 0;
391387 u64 bytes = 0;
392388
@@ -401,10 +397,10 @@ bool gve_clean_rx_done(struct gve_rx_ring *rx, int budget, · 8 unmodified lines
401397 rx->q_num, GVE_SEQNO(desc->flags_seq),
402398 rx->desc.seqno);
403399 bytes += be16_to_cpu(desc->len) - GVE_RX_PAD;
404− if (!gve_rx(rx, desc, feat))
400+ if (!gve_rx(rx, desc, feat, idx))
405401 gve_schedule_reset(priv);
406402 cnt++;
407− idx = cnt & rx->desc.mask;
403+ idx = cnt & rx->mask;
408404 desc = rx->desc.desc_ring + idx;
409405 rx->desc.seqno = gve_next_seqno(rx->desc.seqno);
410406 work_done++;
@@ -417,8 +413,8 @@ bool gve_clean_rx_done(struct gve_rx_ring *rx, int budget, · 6 unmodified lines
417413 rx->rpackets += work_done;
418414 rx->rbytes += bytes;
419415 u64_stats_update_end(&rx->statss);
420− rx->desc.cnt = cnt;
421− rx->desc.fill_cnt += work_done;
416+ rx->cnt = cnt;
417+ rx->fill_cnt += work_done;
422418
423419 /* restock desc ring slots */
424420 dma_wmb(); /* Ensure descs are visible before ringing doorbell */
drivers/net/ethernet/hisilicon/hip04_eth.c+16−12
@@ -220,6 +220,7 @@ struct hip04_priv { · 219 unmodified lines
220220 unsigned int reg_inten;
221221
222222 struct napi_struct napi;
223+ struct device *dev;
223224 struct net_device *ndev;
224225
225226 struct tx_desc *tx_desc;
@@ -248,7 +249,7 @@ struct hip04_priv { · 22 unmodified lines
248249
249250 static inline unsigned int tx_count(unsigned int head, unsigned int tail)
250251 {
251− return (head - tail) % (TX_DESC_NUM - 1);
252+ return (head - tail) % TX_DESC_NUM;
252253 }
253254
254255 static void hip04_config_port(struct net_device *ndev, u32 speed, u32 duplex)
@@ -465,7 +466,7 @@ static int hip04_tx_reclaim(struct net_device *ndev, bool force) · 210 unmodified lines
465466 }
466467
467468 if (priv->tx_phys[tx_tail]) {
468− dma_unmap_single(&ndev->dev, priv->tx_phys[tx_tail],
469+ dma_unmap_single(priv->dev, priv->tx_phys[tx_tail],
469470 priv->tx_skb[tx_tail]->len,
470471 DMA_TO_DEVICE);
471472 priv->tx_phys[tx_tail] = 0;
@@ -516,8 +517,8 @@ hip04_mac_start_xmit(struct sk_buff *skb, struct net_device *ndev) · 44 unmodified lines
516517 return NETDEV_TX_BUSY;
517518 }
518519
519− phys = dma_map_single(&ndev->dev, skb->data, skb->len, DMA_TO_DEVICE);
520− if (dma_mapping_error(&ndev->dev, phys)) {
520+ phys = dma_map_single(priv->dev, skb->data, skb->len, DMA_TO_DEVICE);
521+ if (dma_mapping_error(priv->dev, phys)) {
521522 dev_kfree_skb(skb);
522523 return NETDEV_TX_OK;
523524 }
@@ -585,6 +586,9 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget) · 61 unmodified lines
585586 u16 len;
586587 u32 err;
587588
589+ /* clean up tx descriptors */
590+ tx_remaining = hip04_tx_reclaim(ndev, false);
591+
588592 while (cnt && !last) {
589593 buf = priv->rx_buf[priv->rx_head];
590594 skb = build_skb(buf, priv->rx_buf_size);
@@ -593,7 +597,7 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget) · 2 unmodified lines
593597 goto refill;
594598 }
595599
596− dma_unmap_single(&ndev->dev, priv->rx_phys[priv->rx_head],
600+ dma_unmap_single(priv->dev, priv->rx_phys[priv->rx_head],
597601 RX_BUF_SIZE, DMA_FROM_DEVICE);
598602 priv->rx_phys[priv->rx_head] = 0;
599603
@@ -622,9 +626,9 @@ refill: · 22 unmodified lines
622626 buf = netdev_alloc_frag(priv->rx_buf_size);
623627 if (!buf)
624628 goto done;
625− phys = dma_map_single(&ndev->dev, buf,
629+ phys = dma_map_single(priv->dev, buf,
626630 RX_BUF_SIZE, DMA_FROM_DEVICE);
627− if (dma_mapping_error(&ndev->dev, phys))
631+ if (dma_mapping_error(priv->dev, phys))
628632 goto done;
629633 priv->rx_buf[priv->rx_head] = buf;
630634 priv->rx_phys[priv->rx_head] = phys;
@@ -645,8 +649,7 @@ refill: · 14 unmodified lines
645649 }
646650 napi_complete_done(napi, rx);
647651 done:
648− /* clean up tx descriptors and start a new timer if necessary */
649− tx_remaining = hip04_tx_reclaim(ndev, false);
652+ /* start a new timer if necessary */
650653 if (rx < budget && tx_remaining)
651654 hip04_start_tx_timer(priv);
652655
@@ -728,9 +731,9 @@ static int hip04_mac_open(struct net_device *ndev) · 75 unmodified lines
728731 for (i = 0; i < RX_DESC_NUM; i++) {
729732 dma_addr_t phys;
730733
731− phys = dma_map_single(&ndev->dev, priv->rx_buf[i],
734+ phys = dma_map_single(priv->dev, priv->rx_buf[i],
732735 RX_BUF_SIZE, DMA_FROM_DEVICE);
733− if (dma_mapping_error(&ndev->dev, phys))
736+ if (dma_mapping_error(priv->dev, phys))
734737 return -EIO;
735738
736739 priv->rx_phys[i] = phys;
@@ -764,7 +767,7 @@ static int hip04_mac_stop(struct net_device *ndev) · 27 unmodified lines
764767
765768 for (i = 0; i < RX_DESC_NUM; i++) {
766769 if (priv->rx_phys[i]) {
767− dma_unmap_single(&ndev->dev, priv->rx_phys[i],
770+ dma_unmap_single(priv->dev, priv->rx_phys[i],
768771 RX_BUF_SIZE, DMA_FROM_DEVICE);
769772 priv->rx_phys[i] = 0;
770773 }
@@ -907,6 +910,7 @@ static int hip04_mac_probe(struct platform_device *pdev) · 136 unmodified lines
907910 return -ENOMEM;
908911
909912 priv = netdev_priv(ndev);
913+ priv->dev = d;
910914 priv->ndev = ndev;
911915 platform_set_drvdata(pdev, ndev);
912916 SET_NETDEV_DEV(ndev, &pdev->dev);
drivers/net/ethernet/ibm/ehea/ehea_main.c+1−1
@@ -3251,7 +3251,7 @@ static int ehea_mem_notifier(struct notifier_block *nb, · 3250 unmodified lines
32513251 switch (action) {
32523252 case MEM_CANCEL_OFFLINE:
32533253 pr_info("memory offlining canceled");
3254− /* Fall through: re-add canceled memory block */
3254+ /* Fall through - re-add canceled memory block */
32553255
32563256 case MEM_ONLINE:
32573257 pr_info("memory is going online");
drivers/net/ethernet/marvell/mvmdio.c+22−9
@@ -319,20 +319,33 @@ static int orion_mdio_probe(struct platform_device *pdev) · 318 unmodified lines
319319
320320 init_waitqueue_head(&dev->smi_busy_wait);
321321
322− for (i = 0; i < ARRAY_SIZE(dev->clk); i++) {
323− dev->clk[i] = of_clk_get(pdev->dev.of_node, i);
324− if (PTR_ERR(dev->clk[i]) == -EPROBE_DEFER) {
322+ if (pdev->dev.of_node) {
323+ for (i = 0; i < ARRAY_SIZE(dev->clk); i++) {
324+ dev->clk[i] = of_clk_get(pdev->dev.of_node, i);
325+ if (PTR_ERR(dev->clk[i]) == -EPROBE_DEFER) {
326+ ret = -EPROBE_DEFER;
327+ goto out_clk;
328+ }
329+ if (IS_ERR(dev->clk[i]))
330+ break;
331+ clk_prepare_enable(dev->clk[i]);
332+ }
333+
334+ if (!IS_ERR(of_clk_get(pdev->dev.of_node,
335+ ARRAY_SIZE(dev->clk))))
336+ dev_warn(&pdev->dev,
337+ "unsupported number of clocks, limiting to the first "
338+ __stringify(ARRAY_SIZE(dev->clk)) "\n");
339+ } else {
340+ dev->clk[0] = clk_get(&pdev->dev, NULL);
341+ if (PTR_ERR(dev->clk[0]) == -EPROBE_DEFER) {
325342 ret = -EPROBE_DEFER;
326343 goto out_clk;
327344 }
328− if (IS_ERR(dev->clk[i]))
329− break;
330− clk_prepare_enable(dev->clk[i]);
345+ if (!IS_ERR(dev->clk[0]))
346+ clk_prepare_enable(dev->clk[0]);
331347 }
332348
333− if (!IS_ERR(of_clk_get(pdev->dev.of_node, ARRAY_SIZE(dev->clk))))
334− dev_warn(&pdev->dev, "unsupported number of clocks, limiting to the first "
335− __stringify(ARRAY_SIZE(dev->clk)) "\n");
336349
337350 dev->err_interrupt = platform_get_irq(pdev, 0);
338351 if (dev->err_interrupt > 0 &&
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c+40−47
@@ -811,6 +811,26 @@ static int mvpp2_swf_bm_pool_init(struct mvpp2_port *port) · 810 unmodified lines
811811 return 0;
812812 }
813813
814+static void mvpp2_set_hw_csum(struct mvpp2_port *port,
815+ enum mvpp2_bm_pool_log_num new_long_pool)
816+{
817+ const netdev_features_t csums = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
818+
819+ /* Update L4 checksum when jumbo enable/disable on port.
820+ * Only port 0 supports hardware checksum offload due to
821+ * the Tx FIFO size limitation.
822+ * Also, don't set NETIF_F_HW_CSUM because L3_offset in TX descriptor
823+ * has 7 bits, so the maximum L3 offset is 128.
824+ */
825+ if (new_long_pool == MVPP2_BM_JUMBO && port->id != 0) {
826+ port->dev->features &= ~csums;
827+ port->dev->hw_features &= ~csums;
828+ } else {
829+ port->dev->features |= csums;
830+ port->dev->hw_features |= csums;
831+ }
832+}
833+
814834 static int mvpp2_bm_update_mtu(struct net_device *dev, int mtu)
815835 {
816836 struct mvpp2_port *port = netdev_priv(dev);
@@ -843,15 +863,7 @@ static int mvpp2_bm_update_mtu(struct net_device *dev, int mtu) · 26 unmodified lines
843863 /* Add port to new short & long pool */
844864 mvpp2_swf_bm_pool_init(port);
845865
846− /* Update L4 checksum when jumbo enable/disable on port */
847− if (new_long_pool == MVPP2_BM_JUMBO && port->id != 0) {
848− dev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
849− dev->hw_features &= ~(NETIF_F_IP_CSUM |
850− NETIF_F_IPV6_CSUM);
851− } else {
852− dev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
853− dev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
854− }
866+ mvpp2_set_hw_csum(port, new_long_pool);
855867 }
856868
857869 dev->mtu = mtu;
@@ -3700,6 +3712,7 @@ static int mvpp2_set_mac_address(struct net_device *dev, void *p) · 2842 unmodified lines
37003712 static int mvpp2_change_mtu(struct net_device *dev, int mtu)
37013713 {
37023714 struct mvpp2_port *port = netdev_priv(dev);
3715+ bool running = netif_running(dev);
37033716 int err;
37043717
37053718 if (!IS_ALIGNED(MVPP2_RX_PKT_SIZE(mtu), 8)) {
@@ -3708,40 +3721,24 @@ static int mvpp2_change_mtu(struct net_device *dev, int mtu) · 2 unmodified lines
37083721 mtu = ALIGN(MVPP2_RX_PKT_SIZE(mtu), 8);
37093722 }
37103723
3711− if (!netif_running(dev)) {
3712− err = mvpp2_bm_update_mtu(dev, mtu);
3713− if (!err) {
3714− port->pkt_size = MVPP2_RX_PKT_SIZE(mtu);
3715− return 0;
3716− }
3717−
3718− /* Reconfigure BM to the original MTU */
3719− err = mvpp2_bm_update_mtu(dev, dev->mtu);
3720− if (err)
3721− goto log_error;
3722− }
3723−
3724− mvpp2_stop_dev(port);
3724+ if (running)
3725+ mvpp2_stop_dev(port);
37253726
37263727 err = mvpp2_bm_update_mtu(dev, mtu);
3727− if (!err) {
3728+ if (err) {
3729+ netdev_err(dev, "failed to change MTU\n");
3730+ /* Reconfigure BM to the original MTU */
3731+ mvpp2_bm_update_mtu(dev, dev->mtu);
3732+ } else {
37283733 port->pkt_size = MVPP2_RX_PKT_SIZE(mtu);
3729− goto out_start;
37303734 }
37313735
3732− /* Reconfigure BM to the original MTU */
3733− err = mvpp2_bm_update_mtu(dev, dev->mtu);
3734− if (err)
3735− goto log_error;
3736−
3737−out_start:
3738− mvpp2_start_dev(port);
3739− mvpp2_egress_enable(port);
3740− mvpp2_ingress_enable(port);
3736+ if (running) {
3737+ mvpp2_start_dev(port);
3738+ mvpp2_egress_enable(port);
3739+ mvpp2_ingress_enable(port);
3740+ }
37413741
3742− return 0;
3743−log_error:
3744− netdev_err(dev, "failed to change MTU\n");
37453742 return err;
37463743 }
37473744
@@ -4739,9 +4736,9 @@ static void mvpp2_xlg_config(struct mvpp2_port *port, unsigned int mode, · 991 unmodified lines
47394736 else
47404737 ctrl0 &= ~MVPP22_XLG_CTRL0_RX_FLOW_CTRL_EN;
47414738
4742− ctrl4 &= ~MVPP22_XLG_CTRL4_MACMODSELECT_GMAC;
4743− ctrl4 |= MVPP22_XLG_CTRL4_FWD_FC | MVPP22_XLG_CTRL4_FWD_PFC |
4744− MVPP22_XLG_CTRL4_EN_IDLE_CHECK;
4739+ ctrl4 &= ~(MVPP22_XLG_CTRL4_MACMODSELECT_GMAC |
4740+ MVPP22_XLG_CTRL4_EN_IDLE_CHECK);
4741+ ctrl4 |= MVPP22_XLG_CTRL4_FWD_FC | MVPP22_XLG_CTRL4_FWD_PFC;
47454742
47464743 if (old_ctrl0 != ctrl0)
47474744 writel(ctrl0, port->base + MVPP22_XLG_CTRL0_REG);
@@ -5208,10 +5205,7 @@ static int mvpp2_port_probe(struct platform_device *pdev, · 460 unmodified lines
52085205 dev->features |= NETIF_F_NTUPLE;
52095206 }
52105207
5211− if (port->pool_long->id == MVPP2_BM_JUMBO && port->id != 0) {
5212− dev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
5213− dev->hw_features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
5214− }
5208+ mvpp2_set_hw_csum(port, port->pool_long->id);
52155209
52165210 dev->vlan_features |= features;
52175211 dev->gso_max_segs = MVPP2_MAX_TSO_SEGS;
@@ -5759,9 +5753,6 @@ static int mvpp2_remove(struct platform_device *pdev) · 541 unmodified lines
57595753
57605754 mvpp2_dbgfs_cleanup(priv);
57615755
5762− flush_workqueue(priv->stats_queue);
5763− destroy_workqueue(priv->stats_queue);
5764−
57655756 fwnode_for_each_available_child_node(fwnode, port_fwnode) {
57665757 if (priv->port_list[i]) {
57675758 mutex_destroy(&priv->port_list[i]->gather_stats_lock);
@@ -5770,6 +5761,8 @@ static int mvpp2_remove(struct platform_device *pdev) · 2 unmodified lines
57705761 i++;
57715762 }
57725763
5764+ destroy_workqueue(priv->stats_queue);
5765+
57735766 for (i = 0; i < MVPP2_BM_POOLS_NUM; i++) {
57745767 struct mvpp2_bm_pool *bm_pool = &priv->bm_pools[i];
57755768
drivers/net/ethernet/marvell/sky2.c+7−0
@@ -4924,6 +4924,13 @@ static const struct dmi_system_id msi_blacklist[] = { · 4923 unmodified lines
49244924 DMI_MATCH(DMI_PRODUCT_NAME, "P5W DH Deluxe"),
49254925 },
49264926 },
4927+ {
4928+ .ident = "ASUS P6T",
4929+ .matches = {
4930+ DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
4931+ DMI_MATCH(DMI_BOARD_NAME, "P6T"),
4932+ },
4933+ },
49274934 {}
49284935 };
49294936
drivers/net/ethernet/mediatek/Kconfig+0−1
@@ -9,7 +9,6 @@ if NET_VENDOR_MEDIATEK · 8 unmodified lines
99
1010 config NET_MEDIATEK_SOC
1111 tristate "MediaTek SoC Gigabit Ethernet support"
12− depends on NET_VENDOR_MEDIATEK
1312 select PHYLIB
1413 ---help---
1514 This driver supports the gigabit ethernet MACs in the
drivers/net/ethernet/mellanox/mlx5/core/dev.c+1−1
@@ -213,7 +213,7 @@ void mlx5_unregister_device(struct mlx5_core_dev *dev) · 212 unmodified lines
213213 struct mlx5_interface *intf;
214214
215215 mutex_lock(&mlx5_intf_mutex);
216− list_for_each_entry(intf, &intf_list, list)
216+ list_for_each_entry_reverse(intf, &intf_list, list)
217217 mlx5_remove_device(intf, priv);
218218 list_del(&priv->dev_list);
219219 mutex_unlock(&mlx5_intf_mutex);
drivers/net/ethernet/mellanox/mlx5/core/en.h+3−9
@@ -159,7 +159,7 @@ do { \ · 158 unmodified lines
159159 enum mlx5e_rq_group {
160160 MLX5E_RQ_GROUP_REGULAR,
161161 MLX5E_RQ_GROUP_XSK,
162− MLX5E_NUM_RQ_GROUPS /* Keep last. */
162+#define MLX5E_NUM_RQ_GROUPS(g) (1 + MLX5E_RQ_GROUP_##g)
163163 };
164164
165165 static inline u16 mlx5_min_rx_wqes(int wq_type, u32 wq_size)
@@ -182,14 +182,6 @@ static inline int mlx5e_get_max_num_channels(struct mlx5_core_dev *mdev) · 16 unmodified lines
182182 min_t(int, mlx5_comp_vectors_count(mdev), MLX5E_MAX_NUM_CHANNELS);
183183 }
184184
185−/* Use this function to get max num channels after netdev was created */
186−static inline int mlx5e_get_netdev_max_channels(struct net_device *netdev)
187−{
188− return min_t(unsigned int,
189− netdev->num_rx_queues / MLX5E_NUM_RQ_GROUPS,
190− netdev->num_tx_queues);
191−}
192−
193185 struct mlx5e_tx_wqe {
194186 struct mlx5_wqe_ctrl_seg ctrl;
195187 struct mlx5_wqe_eth_seg eth;
@@ -830,6 +822,7 @@ struct mlx5e_priv { · 634 unmodified lines
830822 struct net_device *netdev;
831823 struct mlx5e_stats stats;
832824 struct mlx5e_channel_stats channel_stats[MLX5E_MAX_NUM_CHANNELS];
825+ u16 max_nch;
833826 u8 max_opened_tc;
834827 struct hwtstamp_config tstamp;
835828 u16 q_counter;
@@ -871,6 +864,7 @@ struct mlx5e_profile { · 35 unmodified lines
871864 mlx5e_fp_handle_rx_cqe handle_rx_cqe_mpwqe;
872865 } rx_handlers;
873866 int max_tc;
867+ u8 rq_groups;
874868 };
875869
876870 void mlx5e_build_ptys2ethtool_map(void);
drivers/net/ethernet/mellanox/mlx5/core/en/params.h+3−2
@@ -66,9 +66,10 @@ static inline void mlx5e_qid_get_ch_and_group(struct mlx5e_params *params, · 65 unmodified lines
6666 *group = qid / nch;
6767 }
6868
69−static inline bool mlx5e_qid_validate(struct mlx5e_params *params, u64 qid)
69+static inline bool mlx5e_qid_validate(const struct mlx5e_profile *profile,
70+ struct mlx5e_params *params, u64 qid)
7071 {
71− return qid < params->num_channels * MLX5E_NUM_RQ_GROUPS;
72+ return qid < params->num_channels * profile->rq_groups;
7273 }
7374
7475 /* Parameter calculations */
drivers/net/ethernet/mellanox/mlx5/core/en/port.c+18−9
@@ -78,9 +78,10 @@ static const u32 mlx5e_ext_link_speed[MLX5E_EXT_LINK_MODES_NUMBER] = { · 77 unmodified lines
7878 };
7979
8080 static void mlx5e_port_get_speed_arr(struct mlx5_core_dev *mdev,
81− const u32 **arr, u32 *size)
81+ const u32 **arr, u32 *size,
82+ bool force_legacy)
8283 {
83− bool ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
84+ bool ext = force_legacy ? false : MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
8485
8586 *size = ext ? ARRAY_SIZE(mlx5e_ext_link_speed) :
8687 ARRAY_SIZE(mlx5e_link_speed);
@@ -152,7 +153,8 @@ int mlx5_port_set_eth_ptys(struct mlx5_core_dev *dev, bool an_disable, · 65 unmodified lines
152153 sizeof(out), MLX5_REG_PTYS, 0, 1);
153154 }
154155
155−u32 mlx5e_port_ptys2speed(struct mlx5_core_dev *mdev, u32 eth_proto_oper)
156+u32 mlx5e_port_ptys2speed(struct mlx5_core_dev *mdev, u32 eth_proto_oper,
157+ bool force_legacy)
156158 {
157159 unsigned long temp = eth_proto_oper;
158160 const u32 *table;
@@ -160,7 +162,7 @@ u32 mlx5e_port_ptys2speed(struct mlx5_core_dev *mdev, u32 eth_proto_oper) · 1 unmodified line
160162 u32 max_size;
161163 int i;
162164
163− mlx5e_port_get_speed_arr(mdev, &table, &max_size);
165+ mlx5e_port_get_speed_arr(mdev, &table, &max_size, force_legacy);
164166 i = find_first_bit(&temp, max_size);
165167 if (i < max_size)
166168 speed = table[i];
@@ -170,6 +172,7 @@ u32 mlx5e_port_ptys2speed(struct mlx5_core_dev *mdev, u32 eth_proto_oper) · 3 unmodified lines
170172 int mlx5e_port_linkspeed(struct mlx5_core_dev *mdev, u32 *speed)
171173 {
172174 struct mlx5e_port_eth_proto eproto;
175+ bool force_legacy = false;
173176 bool ext;
174177 int err;
175178
@@ -177,8 +180,13 @@ int mlx5e_port_linkspeed(struct mlx5_core_dev *mdev, u32 *speed) · 1 unmodified line
177180 err = mlx5_port_query_eth_proto(mdev, 1, ext, &eproto);
178181 if (err)
179182 goto out;
180−
181− *speed = mlx5e_port_ptys2speed(mdev, eproto.oper);
183+ if (ext && !eproto.admin) {
184+ force_legacy = true;
185+ err = mlx5_port_query_eth_proto(mdev, 1, false, &eproto);
186+ if (err)
187+ goto out;
188+ }
189+ *speed = mlx5e_port_ptys2speed(mdev, eproto.oper, force_legacy);
182190 if (!(*speed))
183191 err = -EINVAL;
184192
@@ -201,7 +209,7 @@ int mlx5e_port_max_linkspeed(struct mlx5_core_dev *mdev, u32 *speed) · 16 unmodified lines
201209 if (err)
202210 return err;
203211
204− mlx5e_port_get_speed_arr(mdev, &table, &max_size);
212+ mlx5e_port_get_speed_arr(mdev, &table, &max_size, false);
205213 for (i = 0; i < max_size; ++i)
206214 if (eproto.cap & MLX5E_PROT_MASK(i))
207215 max_speed = max(max_speed, table[i]);
@@ -210,14 +218,15 @@ int mlx5e_port_max_linkspeed(struct mlx5_core_dev *mdev, u32 *speed) · 2 unmodified lines
210218 return 0;
211219 }
212220
213−u32 mlx5e_port_speed2linkmodes(struct mlx5_core_dev *mdev, u32 speed)
221+u32 mlx5e_port_speed2linkmodes(struct mlx5_core_dev *mdev, u32 speed,
222+ bool force_legacy)
214223 {
215224 u32 link_modes = 0;
216225 const u32 *table;
217226 u32 max_size;
218227 int i;
219228
220− mlx5e_port_get_speed_arr(mdev, &table, &max_size);
229+ mlx5e_port_get_speed_arr(mdev, &table, &max_size, force_legacy);
221230 for (i = 0; i < max_size; ++i) {
222231 if (table[i] == speed)
223232 link_modes |= MLX5E_PROT_MASK(i);
drivers/net/ethernet/mellanox/mlx5/core/en/port.h+4−2
@@ -48,10 +48,12 @@ void mlx5_port_query_eth_autoneg(struct mlx5_core_dev *dev, u8 *an_status, · 47 unmodified lines
4848 u8 *an_disable_cap, u8 *an_disable_admin);
4949 int mlx5_port_set_eth_ptys(struct mlx5_core_dev *dev, bool an_disable,
5050 u32 proto_admin, bool ext);
51−u32 mlx5e_port_ptys2speed(struct mlx5_core_dev *mdev, u32 eth_proto_oper);
51+u32 mlx5e_port_ptys2speed(struct mlx5_core_dev *mdev, u32 eth_proto_oper,
52+ bool force_legacy);
5253 int mlx5e_port_linkspeed(struct mlx5_core_dev *mdev, u32 *speed);
5354 int mlx5e_port_max_linkspeed(struct mlx5_core_dev *mdev, u32 *speed);
54−u32 mlx5e_port_speed2linkmodes(struct mlx5_core_dev *mdev, u32 speed);
55+u32 mlx5e_port_speed2linkmodes(struct mlx5_core_dev *mdev, u32 speed,
56+ bool force_legacy);
5557
5658 int mlx5e_port_query_pbmc(struct mlx5_core_dev *mdev, void *out);
5759 int mlx5e_port_set_pbmc(struct mlx5_core_dev *mdev, void *in);
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c+1−1
@@ -412,7 +412,7 @@ struct sk_buff *mlx5e_ktls_handle_tx_skb(struct net_device *netdev, · 411 unmodified lines
412412 goto out;
413413
414414 tls_ctx = tls_get_ctx(skb->sk);
415− if (unlikely(tls_ctx->netdev != netdev))
415+ if (unlikely(WARN_ON_ONCE(tls_ctx->netdev != netdev)))
416416 goto err_out;
417417
418418 priv_tx = mlx5e_get_ktls_tx_priv_ctx(tls_ctx);
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c+47−22
@@ -391,7 +391,7 @@ void mlx5e_ethtool_get_channels(struct mlx5e_priv *priv, · 390 unmodified lines
391391 {
392392 mutex_lock(&priv->state_lock);
393393
394− ch->max_combined = mlx5e_get_netdev_max_channels(priv->netdev);
394+ ch->max_combined = priv->max_nch;
395395 ch->combined_count = priv->channels.params.num_channels;
396396 if (priv->xsk.refcnt) {
397397 /* The upper half are XSK queues. */
@@ -785,7 +785,7 @@ static void ptys2ethtool_supported_advertised_port(struct ethtool_link_ksettings · 387 unmodified lines
785785 }
786786
787787 static void get_speed_duplex(struct net_device *netdev,
788− u32 eth_proto_oper,
788+ u32 eth_proto_oper, bool force_legacy,
789789 struct ethtool_link_ksettings *link_ksettings)
790790 {
791791 struct mlx5e_priv *priv = netdev_priv(netdev);
@@ -795,7 +795,7 @@ static void get_speed_duplex(struct net_device *netdev, · 3 unmodified lines
795795 if (!netif_carrier_ok(netdev))
796796 goto out;
797797
798− speed = mlx5e_port_ptys2speed(priv->mdev, eth_proto_oper);
798+ speed = mlx5e_port_ptys2speed(priv->mdev, eth_proto_oper, force_legacy);
799799 if (!speed) {
800800 speed = SPEED_UNKNOWN;
801801 goto out;
@@ -914,8 +914,8 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, · 112 unmodified lines
914914 /* Fields: eth_proto_admin and ext_eth_proto_admin are
915915 * mutually exclusive. Hence try reading legacy advertising
916916 * when extended advertising is zero.
917− * admin_ext indicates how eth_proto_admin should be
918− * interpreted
917+ * admin_ext indicates which proto_admin (ext vs. legacy)
918+ * should be read and interpreted
919919 */
920920 admin_ext = ext;
921921 if (ext && !eth_proto_admin) {
@@ -924,7 +924,7 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, · 2 unmodified lines
924924 admin_ext = false;
925925 }
926926
927− eth_proto_oper = MLX5_GET_ETH_PROTO(ptys_reg, out, ext,
927+ eth_proto_oper = MLX5_GET_ETH_PROTO(ptys_reg, out, admin_ext,
928928 eth_proto_oper);
929929 eth_proto_lp = MLX5_GET(ptys_reg, out, eth_proto_lp_advertise);
930930 an_disable_admin = MLX5_GET(ptys_reg, out, an_disable_admin);
@@ -939,7 +939,8 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, · 8 unmodified lines
939939 get_supported(mdev, eth_proto_cap, link_ksettings);
940940 get_advertising(eth_proto_admin, tx_pause, rx_pause, link_ksettings,
941941 admin_ext);
942− get_speed_duplex(priv->netdev, eth_proto_oper, link_ksettings);
942+ get_speed_duplex(priv->netdev, eth_proto_oper, !admin_ext,
943+ link_ksettings);
943944
944945 eth_proto_oper = eth_proto_oper ? eth_proto_oper : eth_proto_cap;
945946
@@ -1016,45 +1017,69 @@ static u32 mlx5e_ethtool2ptys_ext_adver_link(const unsigned long *link_modes) · 70 unmodified lines
10161017 return ptys_modes;
10171018 }
10181019
1020+static bool ext_link_mode_requested(const unsigned long *adver)
1021+{
1022+#define MLX5E_MIN_PTYS_EXT_LINK_MODE_BIT ETHTOOL_LINK_MODE_50000baseKR_Full_BIT
1023+ int size = __ETHTOOL_LINK_MODE_MASK_NBITS - MLX5E_MIN_PTYS_EXT_LINK_MODE_BIT;
1024+ __ETHTOOL_DECLARE_LINK_MODE_MASK(modes);
1025+
1026+ bitmap_set(modes, MLX5E_MIN_PTYS_EXT_LINK_MODE_BIT, size);
1027+ return bitmap_intersects(modes, adver, __ETHTOOL_LINK_MODE_MASK_NBITS);
1028+}
1029+
1030+static bool ext_speed_requested(u32 speed)
1031+{
1032+#define MLX5E_MAX_PTYS_LEGACY_SPEED 100000
1033+ return !!(speed > MLX5E_MAX_PTYS_LEGACY_SPEED);
1034+}
1035+
1036+static bool ext_requested(u8 autoneg, const unsigned long *adver, u32 speed)
1037+{
1038+ bool ext_link_mode = ext_link_mode_requested(adver);
1039+ bool ext_speed = ext_speed_requested(speed);
1040+
1041+ return autoneg == AUTONEG_ENABLE ? ext_link_mode : ext_speed;
1042+}
1043+
10191044 int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,
10201045 const struct ethtool_link_ksettings *link_ksettings)
10211046 {
10221047 struct mlx5_core_dev *mdev = priv->mdev;
10231048 struct mlx5e_port_eth_proto eproto;
1049+ const unsigned long *adver;
10241050 bool an_changes = false;
10251051 u8 an_disable_admin;
10261052 bool ext_supported;
1027− bool ext_requested;
10281053 u8 an_disable_cap;
10291054 bool an_disable;
10301055 u32 link_modes;
10311056 u8 an_status;
1057+ u8 autoneg;
10321058 u32 speed;
1059+ bool ext;
10331060 int err;
10341061
10351062 u32 (*ethtool2ptys_adver_func)(const unsigned long *adver);
10361063
1037−#define MLX5E_PTYS_EXT ((1ULL << ETHTOOL_LINK_MODE_50000baseKR_Full_BIT) - 1)
1064+ adver = link_ksettings->link_modes.advertising;
1065+ autoneg = link_ksettings->base.autoneg;
1066+ speed = link_ksettings->base.speed;
10381067
1039− ext_requested = !!(link_ksettings->link_modes.advertising[0] >
1040− MLX5E_PTYS_EXT ||
1041− link_ksettings->link_modes.advertising[1]);
1068+ ext = ext_requested(autoneg, adver, speed),
10421069 ext_supported = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
1043− ext_requested &= ext_supported;
1070+ if (!ext_supported && ext)
1071+ return -EOPNOTSUPP;
10441072
1045− speed = link_ksettings->base.speed;
1046− ethtool2ptys_adver_func = ext_requested ?
1047− mlx5e_ethtool2ptys_ext_adver_link :
1073+ ethtool2ptys_adver_func = ext ? mlx5e_ethtool2ptys_ext_adver_link :
10481074 mlx5e_ethtool2ptys_adver_link;
1049− err = mlx5_port_query_eth_proto(mdev, 1, ext_requested, &eproto);
1075+ err = mlx5_port_query_eth_proto(mdev, 1, ext, &eproto);
10501076 if (err) {
10511077 netdev_err(priv->netdev, "%s: query port eth proto failed: %d\n",
10521078 __func__, err);
10531079 goto out;
10541080 }
1055− link_modes = link_ksettings->base.autoneg == AUTONEG_ENABLE ?
1056− ethtool2ptys_adver_func(link_ksettings->link_modes.advertising) :
1057− mlx5e_port_speed2linkmodes(mdev, speed);
1081+ link_modes = autoneg == AUTONEG_ENABLE ? ethtool2ptys_adver_func(adver) :
1082+ mlx5e_port_speed2linkmodes(mdev, speed, !ext);
10581083
10591084 link_modes = link_modes & eproto.cap;
10601085 if (!link_modes) {
@@ -1067,14 +1092,14 @@ int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv, · 6 unmodified lines
10671092 mlx5_port_query_eth_autoneg(mdev, &an_status, &an_disable_cap,
10681093 &an_disable_admin);
10691094
1070− an_disable = link_ksettings->base.autoneg == AUTONEG_DISABLE;
1095+ an_disable = autoneg == AUTONEG_DISABLE;
10711096 an_changes = ((!an_disable && an_disable_admin) ||
10721097 (an_disable && !an_disable_admin));
10731098
10741099 if (!an_changes && link_modes == eproto.admin)
10751100 goto out;
10761101
1077− mlx5_port_set_eth_ptys(mdev, an_disable, link_modes, ext_requested);
1102+ mlx5_port_set_eth_ptys(mdev, an_disable, link_modes, ext);
10781103 mlx5_toggle_port_link(mdev);
10791104
10801105 out:
drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c+2−1
@@ -611,7 +611,8 @@ static int validate_flow(struct mlx5e_priv *priv, · 610 unmodified lines
611611 return -ENOSPC;
612612
613613 if (fs->ring_cookie != RX_CLS_FLOW_DISC)
614− if (!mlx5e_qid_validate(&priv->channels.params, fs->ring_cookie))
614+ if (!mlx5e_qid_validate(priv->profile, &priv->channels.params,
615+ fs->ring_cookie))
615616 return -EINVAL;
616617
617618 switch (fs->flow_type & ~(FLOW_EXT | FLOW_MAC_EXT)) {
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+18−23
@@ -331,12 +331,11 @@ static inline u64 mlx5e_get_mpwqe_offset(struct mlx5e_rq *rq, u16 wqe_ix) · 330 unmodified lines
331331
332332 static void mlx5e_init_frags_partition(struct mlx5e_rq *rq)
333333 {
334− struct mlx5e_wqe_frag_info next_frag, *prev;
334+ struct mlx5e_wqe_frag_info next_frag = {};
335+ struct mlx5e_wqe_frag_info *prev = NULL;
335336 int i;
336337
337338 next_frag.di = &rq->wqe.di[0];
338− next_frag.offset = 0;
339− prev = NULL;
340339
341340 for (i = 0; i < mlx5_wq_cyc_get_size(&rq->wqe.wq); i++) {
342341 struct mlx5e_rq_frag_info *frag_info = &rq->wqe.info.arr[0];
@@ -1677,10 +1676,10 @@ static int mlx5e_open_sqs(struct mlx5e_channel *c, · 1334 unmodified lines
16771676 struct mlx5e_channel_param *cparam)
16781677 {
16791678 struct mlx5e_priv *priv = c->priv;
1680− int err, tc, max_nch = mlx5e_get_netdev_max_channels(priv->netdev);
1679+ int err, tc;
16811680
16821681 for (tc = 0; tc < params->num_tc; tc++) {
1683− int txq_ix = c->ix + tc * max_nch;
1682+ int txq_ix = c->ix + tc * priv->max_nch;
16841683
16851684 err = mlx5e_open_txqsq(c, c->priv->tisn[tc], txq_ix,
16861685 params, &cparam->sq, &c->sq[tc], tc);
@@ -2438,11 +2437,10 @@ int mlx5e_create_indirect_rqt(struct mlx5e_priv *priv) · 751 unmodified lines
24382437
24392438 int mlx5e_create_direct_rqts(struct mlx5e_priv *priv, struct mlx5e_tir *tirs)
24402439 {
2441− const int max_nch = mlx5e_get_netdev_max_channels(priv->netdev);
24422440 int err;
24432441 int ix;
24442442
2445− for (ix = 0; ix < max_nch; ix++) {
2443+ for (ix = 0; ix < priv->max_nch; ix++) {
24462444 err = mlx5e_create_rqt(priv, 1 /*size */, &tirs[ix].rqt);
24472445 if (unlikely(err))
24482446 goto err_destroy_rqts;
@@ -2460,10 +2458,9 @@ err_destroy_rqts: · 11 unmodified lines
24602458
24612459 void mlx5e_destroy_direct_rqts(struct mlx5e_priv *priv, struct mlx5e_tir *tirs)
24622460 {
2463− const int max_nch = mlx5e_get_netdev_max_channels(priv->netdev);
24642461 int i;
24652462
2466− for (i = 0; i < max_nch; i++)
2463+ for (i = 0; i < priv->max_nch; i++)
24672464 mlx5e_destroy_rqt(priv, &tirs[i].rqt);
24682465 }
24692466
@@ -2557,7 +2554,7 @@ static void mlx5e_redirect_rqts(struct mlx5e_priv *priv, · 87 unmodified lines
25572554 mlx5e_redirect_rqt(priv, rqtn, MLX5E_INDIR_RQT_SIZE, rrp);
25582555 }
25592556
2560− for (ix = 0; ix < mlx5e_get_netdev_max_channels(priv->netdev); ix++) {
2557+ for (ix = 0; ix < priv->max_nch; ix++) {
25612558 struct mlx5e_redirect_rqt_param direct_rrp = {
25622559 .is_rss = false,
25632560 {
@@ -2758,7 +2755,7 @@ static int mlx5e_modify_tirs_lro(struct mlx5e_priv *priv) · 194 unmodified lines
27582755 goto free_in;
27592756 }
27602757
2761− for (ix = 0; ix < mlx5e_get_netdev_max_channels(priv->netdev); ix++) {
2758+ for (ix = 0; ix < priv->max_nch; ix++) {
27622759 err = mlx5_core_modify_tir(mdev, priv->direct_tir[ix].tirn,
27632760 in, inlen);
27642761 if (err)
@@ -2858,12 +2855,11 @@ static void mlx5e_netdev_set_tcs(struct net_device *netdev) · 93 unmodified lines
28582855
28592856 static void mlx5e_build_tc2txq_maps(struct mlx5e_priv *priv)
28602857 {
2861− int max_nch = mlx5e_get_netdev_max_channels(priv->netdev);
28622858 int i, tc;
28632859
2864− for (i = 0; i < max_nch; i++)
2860+ for (i = 0; i < priv->max_nch; i++)
28652861 for (tc = 0; tc < priv->profile->max_tc; tc++)
2866− priv->channel_tc2txq[i][tc] = i + tc * max_nch;
2862+ priv->channel_tc2txq[i][tc] = i + tc * priv->max_nch;
28672863 }
28682864
28692865 static void mlx5e_build_tx2sq_maps(struct mlx5e_priv *priv)
@@ -2884,7 +2880,7 @@ static void mlx5e_build_tx2sq_maps(struct mlx5e_priv *priv) · 14 unmodified lines
28842880 void mlx5e_activate_priv_channels(struct mlx5e_priv *priv)
28852881 {
28862882 int num_txqs = priv->channels.num * priv->channels.params.num_tc;
2887− int num_rxqs = priv->channels.num * MLX5E_NUM_RQ_GROUPS;
2883+ int num_rxqs = priv->channels.num * priv->profile->rq_groups;
28882884 struct net_device *netdev = priv->netdev;
28892885
28902886 mlx5e_netdev_set_tcs(netdev);
@@ -3306,7 +3302,6 @@ err_destroy_inner_tirs: · 415 unmodified lines
33063302
33073303 int mlx5e_create_direct_tirs(struct mlx5e_priv *priv, struct mlx5e_tir *tirs)
33083304 {
3309− const int max_nch = mlx5e_get_netdev_max_channels(priv->netdev);
33103305 struct mlx5e_tir *tir;
33113306 void *tirc;
33123307 int inlen;
@@ -3319,7 +3314,7 @@ int mlx5e_create_direct_tirs(struct mlx5e_priv *priv, struct mlx5e_tir *tirs) · 6 unmodified lines
33193314 if (!in)
33203315 return -ENOMEM;
33213316
3322− for (ix = 0; ix < max_nch; ix++) {
3317+ for (ix = 0; ix < priv->max_nch; ix++) {
33233318 memset(in, 0, inlen);
33243319 tir = &tirs[ix];
33253320 tirc = MLX5_ADDR_OF(create_tir_in, in, ctx);
@@ -3358,10 +3353,9 @@ void mlx5e_destroy_indirect_tirs(struct mlx5e_priv *priv, bool inner_ttc) · 32 unmodified lines
33583353
33593354 void mlx5e_destroy_direct_tirs(struct mlx5e_priv *priv, struct mlx5e_tir *tirs)
33603355 {
3361− const int max_nch = mlx5e_get_netdev_max_channels(priv->netdev);
33623356 int i;
33633357
3364− for (i = 0; i < max_nch; i++)
3358+ for (i = 0; i < priv->max_nch; i++)
33653359 mlx5e_destroy_tir(priv->mdev, &tirs[i]);
33663360 }
33673361
@@ -3487,7 +3481,7 @@ void mlx5e_fold_sw_stats64(struct mlx5e_priv *priv, struct rtnl_link_stats64 *s) · 119 unmodified lines
34873481 {
34883482 int i;
34893483
3490− for (i = 0; i < mlx5e_get_netdev_max_channels(priv->netdev); i++) {
3484+ for (i = 0; i < priv->max_nch; i++) {
34913485 struct mlx5e_channel_stats *channel_stats = &priv->channel_stats[i];
34923486 struct mlx5e_rq_stats *xskrq_stats = &channel_stats->xskrq;
34933487 struct mlx5e_rq_stats *rq_stats = &channel_stats->rq;
@@ -4960,8 +4954,7 @@ static int mlx5e_nic_init(struct mlx5_core_dev *mdev, · 1466 unmodified lines
49604954 return err;
49614955
49624956 mlx5e_build_nic_params(mdev, &priv->xsk, rss, &priv->channels.params,
4963− mlx5e_get_netdev_max_channels(netdev),
4964− netdev->mtu);
4957+ priv->max_nch, netdev->mtu);
49654958
49664959 mlx5e_timestamp_init(priv);
49674960
@@ -5164,6 +5157,7 @@ static const struct mlx5e_profile mlx5e_nic_profile = { · 196 unmodified lines
51645157 .rx_handlers.handle_rx_cqe = mlx5e_handle_rx_cqe,
51655158 .rx_handlers.handle_rx_cqe_mpwqe = mlx5e_handle_rx_cqe_mpwrq,
51665159 .max_tc = MLX5E_MAX_NUM_TC,
5160+ .rq_groups = MLX5E_NUM_RQ_GROUPS(XSK),
51675161 };
51685162
51695163 /* mlx5e generic netdev management API (move to en_common.c) */
@@ -5181,6 +5175,7 @@ int mlx5e_netdev_init(struct net_device *netdev, · 11 unmodified lines
51815175 priv->profile = profile;
51825176 priv->ppriv = ppriv;
51835177 priv->msglevel = MLX5E_MSG_LEVEL;
5178+ priv->max_nch = netdev->num_rx_queues / max_t(u8, profile->rq_groups, 1);
51845179 priv->max_opened_tc = 1;
51855180
51865181 mutex_init(&priv->state_lock);
@@ -5218,7 +5213,7 @@ struct net_device *mlx5e_create_netdev(struct mlx5_core_dev *mdev, · 31 unmodified lines
52185213
52195214 netdev = alloc_etherdev_mqs(sizeof(struct mlx5e_priv),
52205215 nch * profile->max_tc,
5221− nch * MLX5E_NUM_RQ_GROUPS);
5216+ nch * profile->rq_groups);
52225217 if (!netdev) {
52235218 mlx5_core_err(mdev, "alloc_etherdev_mqs() failed\n");
52245219 return NULL;
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+2−0
@@ -1701,6 +1701,7 @@ static const struct mlx5e_profile mlx5e_rep_profile = { · 1700 unmodified lines
17011701 .rx_handlers.handle_rx_cqe = mlx5e_handle_rx_cqe_rep,
17021702 .rx_handlers.handle_rx_cqe_mpwqe = mlx5e_handle_rx_cqe_mpwrq,
17031703 .max_tc = 1,
1704+ .rq_groups = MLX5E_NUM_RQ_GROUPS(REGULAR),
17041705 };
17051706
17061707 static const struct mlx5e_profile mlx5e_uplink_rep_profile = {
@@ -1718,6 +1719,7 @@ static const struct mlx5e_profile mlx5e_uplink_rep_profile = { · 11 unmodified lines
17181719 .rx_handlers.handle_rx_cqe = mlx5e_handle_rx_cqe_rep,
17191720 .rx_handlers.handle_rx_cqe_mpwqe = mlx5e_handle_rx_cqe_mpwrq,
17201721 .max_tc = MLX5E_MAX_NUM_TC,
1722+ .rq_groups = MLX5E_NUM_RQ_GROUPS(REGULAR),
17211723 };
17221724
17231725 static bool
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c+4−4
@@ -172,7 +172,7 @@ static void mlx5e_grp_sw_update_stats(struct mlx5e_priv *priv) · 171 unmodified lines
172172
173173 memset(s, 0, sizeof(*s));
174174
175− for (i = 0; i < mlx5e_get_netdev_max_channels(priv->netdev); i++) {
175+ for (i = 0; i < priv->max_nch; i++) {
176176 struct mlx5e_channel_stats *channel_stats =
177177 &priv->channel_stats[i];
178178 struct mlx5e_xdpsq_stats *xdpsq_red_stats = &channel_stats->xdpsq;
@@ -1395,7 +1395,7 @@ static const struct counter_desc ch_stats_desc[] = { · 1216 unmodified lines
13951395
13961396 static int mlx5e_grp_channels_get_num_stats(struct mlx5e_priv *priv)
13971397 {
1398− int max_nch = mlx5e_get_netdev_max_channels(priv->netdev);
1398+ int max_nch = priv->max_nch;
13991399
14001400 return (NUM_RQ_STATS * max_nch) +
14011401 (NUM_CH_STATS * max_nch) +
@@ -1409,8 +1409,8 @@ static int mlx5e_grp_channels_get_num_stats(struct mlx5e_priv *priv) · 7 unmodified lines
14091409 static int mlx5e_grp_channels_fill_strings(struct mlx5e_priv *priv, u8 *data,
14101410 int idx)
14111411 {
1412− int max_nch = mlx5e_get_netdev_max_channels(priv->netdev);
14131412 bool is_xsk = priv->xsk.ever_used;
1413+ int max_nch = priv->max_nch;
14141414 int i, j, tc;
14151415
14161416 for (i = 0; i < max_nch; i++)
@@ -1452,8 +1452,8 @@ static int mlx5e_grp_channels_fill_strings(struct mlx5e_priv *priv, u8 *data, · 35 unmodified lines
14521452 static int mlx5e_grp_channels_fill_stats(struct mlx5e_priv *priv, u64 *data,
14531453 int idx)
14541454 {
1455− int max_nch = mlx5e_get_netdev_max_channels(priv->netdev);
14561455 bool is_xsk = priv->xsk.ever_used;
1456+ int max_nch = priv->max_nch;
14571457 int i, j, tc;
14581458
14591459 for (i = 0; i < max_nch; i++)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+2−2
@@ -1230,13 +1230,13 @@ static struct mlx5_fc *mlx5e_tc_get_counter(struct mlx5e_tc_flow *flow) · 1229 unmodified lines
12301230 void mlx5e_tc_update_neigh_used_value(struct mlx5e_neigh_hash_entry *nhe)
12311231 {
12321232 struct mlx5e_neigh *m_neigh = &nhe->m_neigh;
1233− u64 bytes, packets, lastuse = 0;
12341233 struct mlx5e_tc_flow *flow;
12351234 struct mlx5e_encap_entry *e;
12361235 struct mlx5_fc *counter;
12371236 struct neigh_table *tbl;
12381237 bool neigh_used = false;
12391238 struct neighbour *n;
1239+ u64 lastuse;
12401240
12411241 if (m_neigh->family == AF_INET)
12421242 tbl = &arp_tbl;
@@ -1256,7 +1256,7 @@ void mlx5e_tc_update_neigh_used_value(struct mlx5e_neigh_hash_entry *nhe) · 13 unmodified lines
12561256 encaps[efi->index]);
12571257 if (flow->flags & MLX5E_TC_FLOW_OFFLOADED) {
12581258 counter = mlx5e_tc_get_counter(flow);
1259− mlx5_fc_query_cached(counter, &bytes, &packets, &lastuse);
1259+ lastuse = mlx5_fc_query_lastuse(counter);
12601260 if (time_after((unsigned long)lastuse, nhe->reported_lastuse)) {
12611261 neigh_used = true;
12621262 break;
drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c+2−2
@@ -49,7 +49,7 @@ static inline bool mlx5e_channel_no_affinity_change(struct mlx5e_channel *c) · 48 unmodified lines
4949 static void mlx5e_handle_tx_dim(struct mlx5e_txqsq *sq)
5050 {
5151 struct mlx5e_sq_stats *stats = sq->stats;
52− struct dim_sample dim_sample;
52+ struct dim_sample dim_sample = {};
5353
5454 if (unlikely(!test_bit(MLX5E_SQ_STATE_AM, &sq->state)))
5555 return;
@@ -61,7 +61,7 @@ static void mlx5e_handle_tx_dim(struct mlx5e_txqsq *sq) · 5 unmodified lines
6161 static void mlx5e_handle_rx_dim(struct mlx5e_rq *rq)
6262 {
6363 struct mlx5e_rq_stats *stats = rq->stats;
64− struct dim_sample dim_sample;
64+ struct dim_sample dim_sample = {};
6565
6666 if (unlikely(!test_bit(MLX5E_RQ_STATE_AM, &rq->state)))
6767 return;
drivers/net/ethernet/mellanox/mlx5/core/fs_core.h+3−2
@@ -68,7 +68,7 @@ enum fs_flow_table_type { · 67 unmodified lines
6868 FS_FT_SNIFFER_RX = 0X5,
6969 FS_FT_SNIFFER_TX = 0X6,
7070 FS_FT_RDMA_RX = 0X7,
71− FS_FT_MAX_TYPE = FS_FT_SNIFFER_TX,
71+ FS_FT_MAX_TYPE = FS_FT_RDMA_RX,
7272 };
7373
7474 enum fs_flow_table_op_mod {
@@ -275,7 +275,8 @@ void mlx5_cleanup_fs(struct mlx5_core_dev *dev); · 200 unmodified lines
275275 (type == FS_FT_FDB) ? MLX5_CAP_ESW_FLOWTABLE_FDB(mdev, cap) : \
276276 (type == FS_FT_SNIFFER_RX) ? MLX5_CAP_FLOWTABLE_SNIFFER_RX(mdev, cap) : \
277277 (type == FS_FT_SNIFFER_TX) ? MLX5_CAP_FLOWTABLE_SNIFFER_TX(mdev, cap) : \
278− (BUILD_BUG_ON_ZERO(FS_FT_SNIFFER_TX != FS_FT_MAX_TYPE))\
278+ (type == FS_FT_RDMA_RX) ? MLX5_CAP_FLOWTABLE_RDMA_RX(mdev, cap) : \
279+ (BUILD_BUG_ON_ZERO(FS_FT_RDMA_RX != FS_FT_MAX_TYPE))\
279280 )
280281
281282 #endif
drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c+5−0
@@ -369,6 +369,11 @@ int mlx5_fc_query(struct mlx5_core_dev *dev, struct mlx5_fc *counter, · 368 unmodified lines
369369 }
370370 EXPORT_SYMBOL(mlx5_fc_query);
371371
372+u64 mlx5_fc_query_lastuse(struct mlx5_fc *counter)
373+{
374+ return counter->cache.lastuse;
375+}
376+
372377 void mlx5_fc_query_cached(struct mlx5_fc *counter,
373378 u64 *bytes, u64 *packets, u64 *lastuse)
374379 {
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c+3−4
@@ -88,8 +88,7 @@ int mlx5i_init(struct mlx5_core_dev *mdev, · 87 unmodified lines
8888 netdev->mtu = netdev->max_mtu;
8989
9090 mlx5e_build_nic_params(mdev, NULL, &priv->rss_params, &priv->channels.params,
91− mlx5e_get_netdev_max_channels(netdev),
92− netdev->mtu);
91+ priv->max_nch, netdev->mtu);
9392 mlx5i_build_nic_params(mdev, &priv->channels.params);
9493
9594 mlx5e_timestamp_init(priv);
@@ -118,11 +117,10 @@ void mlx5i_cleanup(struct mlx5e_priv *priv) · 22 unmodified lines
118117
119118 static void mlx5i_grp_sw_update_stats(struct mlx5e_priv *priv)
120119 {
121− int max_nch = mlx5e_get_netdev_max_channels(priv->netdev);
122120 struct mlx5e_sw_stats s = { 0 };
123121 int i, j;
124122
125− for (i = 0; i < max_nch; i++) {
123+ for (i = 0; i < priv->max_nch; i++) {
126124 struct mlx5e_channel_stats *channel_stats;
127125 struct mlx5e_rq_stats *rq_stats;
128126
@@ -436,6 +434,7 @@ static const struct mlx5e_profile mlx5i_nic_profile = { · 307 unmodified lines
436434 .rx_handlers.handle_rx_cqe = mlx5i_handle_rx_cqe,
437435 .rx_handlers.handle_rx_cqe_mpwqe = NULL, /* Not supported */
438436 .max_tc = MLX5I_MAX_NUM_TC,
437+ .rq_groups = MLX5E_NUM_RQ_GROUPS(REGULAR),
439438 };
440439
441440 /* mlx5i netdev NDos */
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c+1−0
@@ -355,6 +355,7 @@ static const struct mlx5e_profile mlx5i_pkey_nic_profile = { · 354 unmodified lines
355355 .rx_handlers.handle_rx_cqe = mlx5i_handle_rx_cqe,
356356 .rx_handlers.handle_rx_cqe_mpwqe = NULL, /* Not supported */
357357 .max_tc = MLX5I_MAX_NUM_TC,
358+ .rq_groups = MLX5E_NUM_RQ_GROUPS(REGULAR),
358359 };
359360
360361 const struct mlx5e_profile *mlx5i_pkey_get_profile(void)
drivers/net/ethernet/mellanox/mlxsw/spectrum.c+1−1
@@ -6330,7 +6330,7 @@ static int __init mlxsw_sp_module_init(void) · 6329 unmodified lines
63306330 return 0;
63316331
63326332 err_sp2_pci_driver_register:
6333− mlxsw_pci_driver_unregister(&mlxsw_sp2_pci_driver);
6333+ mlxsw_pci_driver_unregister(&mlxsw_sp1_pci_driver);
63346334 err_sp1_pci_driver_register:
63356335 mlxsw_core_driver_unregister(&mlxsw_sp2_driver);
63366336 err_sp2_core_driver_register:
drivers/net/ethernet/mellanox/mlxsw/spectrum.h+4−0
@@ -951,4 +951,8 @@ void mlxsw_sp_port_nve_fini(struct mlxsw_sp_port *mlxsw_sp_port); · 950 unmodified lines
951951 int mlxsw_sp_nve_init(struct mlxsw_sp *mlxsw_sp);
952952 void mlxsw_sp_nve_fini(struct mlxsw_sp *mlxsw_sp);
953953
954+/* spectrum_nve_vxlan.c */
955+int mlxsw_sp_nve_inc_parsing_depth_get(struct mlxsw_sp *mlxsw_sp);
956+void mlxsw_sp_nve_inc_parsing_depth_put(struct mlxsw_sp *mlxsw_sp);
957+
954958 #endif
drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c+2−2
@@ -437,8 +437,8 @@ static const struct mlxsw_sp_sb_pr mlxsw_sp1_sb_prs[] = { · 436 unmodified lines
437437 MLXSW_SP1_SB_PR_CPU_SIZE, true, false),
438438 };
439439
440−#define MLXSW_SP2_SB_PR_INGRESS_SIZE 38128752
441−#define MLXSW_SP2_SB_PR_EGRESS_SIZE 38128752
440+#define MLXSW_SP2_SB_PR_INGRESS_SIZE 35297568
441+#define MLXSW_SP2_SB_PR_EGRESS_SIZE 35297568
442442 #define MLXSW_SP2_SB_PR_CPU_SIZE (256 * 1000)
443443
444444 /* Order according to mlxsw_sp2_sb_pool_dess */
drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c+1−0
@@ -775,6 +775,7 @@ static void mlxsw_sp_nve_tunnel_fini(struct mlxsw_sp *mlxsw_sp) · 774 unmodified lines
775775 ops->fini(nve);
776776 mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ADJ, 1,
777777 nve->tunnel_index);
778+ memset(&nve->config, 0, sizeof(nve->config));
778779 }
779780 nve->num_nve_tunnels--;
780781 }
drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.h+1−0
@@ -29,6 +29,7 @@ struct mlxsw_sp_nve { · 28 unmodified lines
2929 unsigned int num_max_mc_entries[MLXSW_SP_L3_PROTO_MAX];
3030 u32 tunnel_index;
3131 u16 ul_rif_index; /* Reserved for Spectrum */
32+ unsigned int inc_parsing_depth_refs;
3233 };
3334
3435 struct mlxsw_sp_nve_ops {
drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c+59−17
@@ -103,9 +103,9 @@ static void mlxsw_sp_nve_vxlan_config(const struct mlxsw_sp_nve *nve, · 102 unmodified lines
103103 config->udp_dport = cfg->dst_port;
104104 }
105105
106−static int mlxsw_sp_nve_parsing_set(struct mlxsw_sp *mlxsw_sp,
107− unsigned int parsing_depth,
108− __be16 udp_dport)
106+static int __mlxsw_sp_nve_parsing_set(struct mlxsw_sp *mlxsw_sp,
107+ unsigned int parsing_depth,
108+ __be16 udp_dport)
109109 {
110110 char mprs_pl[MLXSW_REG_MPRS_LEN];
111111
@@ -113,6 +113,56 @@ static int mlxsw_sp_nve_parsing_set(struct mlxsw_sp *mlxsw_sp, · 1 unmodified line
113113 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mprs), mprs_pl);
114114 }
115115
116+static int mlxsw_sp_nve_parsing_set(struct mlxsw_sp *mlxsw_sp,
117+ __be16 udp_dport)
118+{
119+ int parsing_depth = mlxsw_sp->nve->inc_parsing_depth_refs ?
120+ MLXSW_SP_NVE_VXLAN_PARSING_DEPTH :
121+ MLXSW_SP_NVE_DEFAULT_PARSING_DEPTH;
122+
123+ return __mlxsw_sp_nve_parsing_set(mlxsw_sp, parsing_depth, udp_dport);
124+}
125+
126+static int
127+__mlxsw_sp_nve_inc_parsing_depth_get(struct mlxsw_sp *mlxsw_sp,
128+ __be16 udp_dport)
129+{
130+ int err;
131+
132+ mlxsw_sp->nve->inc_parsing_depth_refs++;
133+
134+ err = mlxsw_sp_nve_parsing_set(mlxsw_sp, udp_dport);
135+ if (err)
136+ goto err_nve_parsing_set;
137+ return 0;
138+
139+err_nve_parsing_set:
140+ mlxsw_sp->nve->inc_parsing_depth_refs--;
141+ return err;
142+}
143+
144+static void
145+__mlxsw_sp_nve_inc_parsing_depth_put(struct mlxsw_sp *mlxsw_sp,
146+ __be16 udp_dport)
147+{
148+ mlxsw_sp->nve->inc_parsing_depth_refs--;
149+ mlxsw_sp_nve_parsing_set(mlxsw_sp, udp_dport);
150+}
151+
152+int mlxsw_sp_nve_inc_parsing_depth_get(struct mlxsw_sp *mlxsw_sp)
153+{
154+ __be16 udp_dport = mlxsw_sp->nve->config.udp_dport;
155+
156+ return __mlxsw_sp_nve_inc_parsing_depth_get(mlxsw_sp, udp_dport);
157+}
158+
159+void mlxsw_sp_nve_inc_parsing_depth_put(struct mlxsw_sp *mlxsw_sp)
160+{
161+ __be16 udp_dport = mlxsw_sp->nve->config.udp_dport;
162+
163+ __mlxsw_sp_nve_inc_parsing_depth_put(mlxsw_sp, udp_dport);
164+}
165+
116166 static void
117167 mlxsw_sp_nve_vxlan_config_prepare(char *tngcr_pl,
118168 const struct mlxsw_sp_nve_config *config)
@@ -176,9 +226,7 @@ static int mlxsw_sp1_nve_vxlan_init(struct mlxsw_sp_nve *nve, · 57 unmodified lines
176226 struct mlxsw_sp *mlxsw_sp = nve->mlxsw_sp;
177227 int err;
178228
179− err = mlxsw_sp_nve_parsing_set(mlxsw_sp,
180− MLXSW_SP_NVE_VXLAN_PARSING_DEPTH,
181− config->udp_dport);
229+ err = __mlxsw_sp_nve_inc_parsing_depth_get(mlxsw_sp, config->udp_dport);
182230 if (err)
183231 return err;
184232
@@ -203,8 +251,7 @@ err_promote_decap: · 18 unmodified lines
203251 err_rtdp_set:
204252 mlxsw_sp1_nve_vxlan_config_clear(mlxsw_sp);
205253 err_config_set:
206− mlxsw_sp_nve_parsing_set(mlxsw_sp, MLXSW_SP_NVE_DEFAULT_PARSING_DEPTH,
207− config->udp_dport);
254+ __mlxsw_sp_nve_inc_parsing_depth_put(mlxsw_sp, 0);
208255 return err;
209256 }
210257
@@ -216,8 +263,7 @@ static void mlxsw_sp1_nve_vxlan_fini(struct mlxsw_sp_nve *nve) · 5 unmodified lines
216263 mlxsw_sp_router_nve_demote_decap(mlxsw_sp, config->ul_tb_id,
217264 config->ul_proto, &config->ul_sip);
218265 mlxsw_sp1_nve_vxlan_config_clear(mlxsw_sp);
219− mlxsw_sp_nve_parsing_set(mlxsw_sp, MLXSW_SP_NVE_DEFAULT_PARSING_DEPTH,
220− config->udp_dport);
266+ __mlxsw_sp_nve_inc_parsing_depth_put(mlxsw_sp, 0);
221267 }
222268
223269 static int
@@ -320,9 +366,7 @@ static int mlxsw_sp2_nve_vxlan_init(struct mlxsw_sp_nve *nve, · 96 unmodified lines
320366 struct mlxsw_sp *mlxsw_sp = nve->mlxsw_sp;
321367 int err;
322368
323− err = mlxsw_sp_nve_parsing_set(mlxsw_sp,
324− MLXSW_SP_NVE_VXLAN_PARSING_DEPTH,
325− config->udp_dport);
369+ err = __mlxsw_sp_nve_inc_parsing_depth_get(mlxsw_sp, config->udp_dport);
326370 if (err)
327371 return err;
328372
@@ -348,8 +392,7 @@ err_promote_decap: · 19 unmodified lines
348392 err_rtdp_set:
349393 mlxsw_sp2_nve_vxlan_config_clear(mlxsw_sp);
350394 err_config_set:
351− mlxsw_sp_nve_parsing_set(mlxsw_sp, MLXSW_SP_NVE_DEFAULT_PARSING_DEPTH,
352− config->udp_dport);
395+ __mlxsw_sp_nve_inc_parsing_depth_put(mlxsw_sp, 0);
353396 return err;
354397 }
355398
@@ -361,8 +404,7 @@ static void mlxsw_sp2_nve_vxlan_fini(struct mlxsw_sp_nve *nve) · 5 unmodified lines
361404 mlxsw_sp_router_nve_demote_decap(mlxsw_sp, config->ul_tb_id,
362405 config->ul_proto, &config->ul_sip);
363406 mlxsw_sp2_nve_vxlan_config_clear(mlxsw_sp);
364− mlxsw_sp_nve_parsing_set(mlxsw_sp, MLXSW_SP_NVE_DEFAULT_PARSING_DEPTH,
365− config->udp_dport);
407+ __mlxsw_sp_nve_inc_parsing_depth_put(mlxsw_sp, 0);
366408 }
367409
368410 const struct mlxsw_sp_nve_ops mlxsw_sp2_nve_vxlan_ops = {
drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c+17−0
@@ -979,6 +979,9 @@ static int mlxsw_sp1_ptp_mtpppc_update(struct mlxsw_sp_port *mlxsw_sp_port, · 978 unmodified lines
979979 {
980980 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
981981 struct mlxsw_sp_port *tmp;
982+ u16 orig_ing_types = 0;
983+ u16 orig_egr_types = 0;
984+ int err;
982985 int i;
983986
984987 /* MTPPPC configures timestamping globally, not per port. Find the
@@ -986,12 +989,26 @@ static int mlxsw_sp1_ptp_mtpppc_update(struct mlxsw_sp_port *mlxsw_sp_port, · 1 unmodified line
986989 */
987990 for (i = 1; i < mlxsw_core_max_ports(mlxsw_sp->core); i++) {
988991 tmp = mlxsw_sp->ports[i];
992+ if (tmp) {
993+ orig_ing_types |= tmp->ptp.ing_types;
994+ orig_egr_types |= tmp->ptp.egr_types;
995+ }
989996 if (tmp && tmp != mlxsw_sp_port) {
990997 ing_types |= tmp->ptp.ing_types;
991998 egr_types |= tmp->ptp.egr_types;
992999 }
9931000 }
9941001
1002+ if ((ing_types || egr_types) && !(orig_ing_types || orig_egr_types)) {
1003+ err = mlxsw_sp_nve_inc_parsing_depth_get(mlxsw_sp);
1004+ if (err) {
1005+ netdev_err(mlxsw_sp_port->dev, "Failed to increase parsing depth");
1006+ return err;
1007+ }
1008+ }
1009+ if (!(ing_types || egr_types) && (orig_ing_types || orig_egr_types))
1010+ mlxsw_sp_nve_inc_parsing_depth_put(mlxsw_sp);
1011+
9951012 return mlxsw_sp1_ptp_mtpppc_set(mlxsw_sp_port->mlxsw_sp,
9961013 ing_types, egr_types);
9971014 }
drivers/net/ethernet/mscc/ocelot.c+1−0
@@ -1818,6 +1818,7 @@ EXPORT_SYMBOL(ocelot_init); · 1817 unmodified lines
18181818
18191819 void ocelot_deinit(struct ocelot *ocelot)
18201820 {
1821+ cancel_delayed_work(&ocelot->stats_work);
18211822 destroy_workqueue(ocelot->stats_queue);
18221823 mutex_destroy(&ocelot->stats_lock);
18231824 ocelot_ace_deinit();
drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c+2−2
@@ -444,12 +444,12 @@ static u8 *nfp_vnic_get_sw_stats_strings(struct net_device *netdev, u8 *data) · 443 unmodified lines
444444 data = nfp_pr_et(data, "hw_rx_csum_complete");
445445 data = nfp_pr_et(data, "hw_rx_csum_err");
446446 data = nfp_pr_et(data, "rx_replace_buf_alloc_fail");
447− data = nfp_pr_et(data, "rx_tls_decrypted");
447+ data = nfp_pr_et(data, "rx_tls_decrypted_packets");
448448 data = nfp_pr_et(data, "hw_tx_csum");
449449 data = nfp_pr_et(data, "hw_tx_inner_csum");
450450 data = nfp_pr_et(data, "tx_gather");
451451 data = nfp_pr_et(data, "tx_lso");
452− data = nfp_pr_et(data, "tx_tls_encrypted");
452+ data = nfp_pr_et(data, "tx_tls_encrypted_packets");
453453 data = nfp_pr_et(data, "tx_tls_ooo");
454454 data = nfp_pr_et(data, "tx_tls_drop_no_sync_data");
455455
drivers/net/ethernet/ni/Kconfig+1−1
@@ -11,7 +11,7 @@ config NET_VENDOR_NI · 10 unmodified lines
1111
1212 Note that the answer to this question doesn't directly affect the
1313 kernel: saying N will just cause the configurator to skip all
14− the questions about National Instrument devices.
14+ the questions about National Instruments devices.
1515 If you say Y, you will be asked for your specific device in the
1616 following questions.
1717
drivers/net/ethernet/packetengines/Kconfig+3−3
@@ -1,10 +1,10 @@
11 # SPDX-License-Identifier: GPL-2.0-only
22 #
3−# Packet engine device configuration
3+# Packet Engines device configuration
44 #
55
66 config NET_VENDOR_PACKET_ENGINES
7− bool "Packet Engine devices"
7+ bool "Packet Engines devices"
88 default y
99 depends on PCI
1010 ---help---
@@ -12,7 +12,7 @@ config NET_VENDOR_PACKET_ENGINES · 1 unmodified line
1212
1313 Note that the answer to this question doesn't directly affect the
1414 kernel: saying N will just cause the configurator to skip all
15− the questions about packet engine devices. If you say Y, you will
15+ the questions about Packet Engines devices. If you say Y, you will
1616 be asked for your specific card in the following questions.
1717
1818 if NET_VENDOR_PACKET_ENGINES
drivers/net/ethernet/packetengines/Makefile+1−1
@@ -1,6 +1,6 @@
11 # SPDX-License-Identifier: GPL-2.0-only
22 #
3−# Makefile for the Packet Engine network device drivers.
3+# Makefile for the Packet Engines network device drivers.
44 #
55
66 obj-$(CONFIG_HAMACHI) += hamachi.o
drivers/net/ethernet/qlogic/qed/qed_int.c+1−1
@@ -1093,7 +1093,7 @@ static int qed_int_deassertion(struct qed_hwfn *p_hwfn, · 1092 unmodified lines
10931093 snprintf(bit_name, 30,
10941094 p_aeu->bit_name, num);
10951095 else
1096− strncpy(bit_name,
1096+ strlcpy(bit_name,
10971097 p_aeu->bit_name, 30);
10981098
10991099 /* We now need to pass bitmask in its
drivers/net/ethernet/qlogic/qed/qed_rdma.c+1−1
@@ -442,7 +442,7 @@ static void qed_rdma_init_devinfo(struct qed_hwfn *p_hwfn, · 441 unmodified lines
442442 /* Vendor specific information */
443443 dev->vendor_id = cdev->vendor_id;
444444 dev->vendor_part_id = cdev->device_id;
445− dev->hw_ver = 0;
445+ dev->hw_ver = cdev->chip_rev;
446446 dev->fw_ver = (FW_MAJOR_VERSION << 24) | (FW_MINOR_VERSION << 16) |
447447 (FW_REVISION_VERSION << 8) | (FW_ENGINEERING_VERSION);
448448
drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c+9−4
@@ -206,9 +206,9 @@ rmnet_map_ipv4_ul_csum_header(void *iphdr, · 205 unmodified lines
206206 ul_header->csum_insert_offset = skb->csum_offset;
207207 ul_header->csum_enabled = 1;
208208 if (ip4h->protocol == IPPROTO_UDP)
209− ul_header->udp_ip4_ind = 1;
209+ ul_header->udp_ind = 1;
210210 else
211− ul_header->udp_ip4_ind = 0;
211+ ul_header->udp_ind = 0;
212212
213213 /* Changing remaining fields to network order */
214214 hdr++;
@@ -239,6 +239,7 @@ rmnet_map_ipv6_ul_csum_header(void *ip6hdr, · 24 unmodified lines
239239 struct rmnet_map_ul_csum_header *ul_header,
240240 struct sk_buff *skb)
241241 {
242+ struct ipv6hdr *ip6h = (struct ipv6hdr *)ip6hdr;
242243 __be16 *hdr = (__be16 *)ul_header, offset;
243244
244245 offset = htons((__force u16)(skb_transport_header(skb) -
@@ -246,7 +247,11 @@ rmnet_map_ipv6_ul_csum_header(void *ip6hdr, · 1 unmodified line
246247 ul_header->csum_start_offset = offset;
247248 ul_header->csum_insert_offset = skb->csum_offset;
248249 ul_header->csum_enabled = 1;
249− ul_header->udp_ip4_ind = 0;
250+
251+ if (ip6h->nexthdr == IPPROTO_UDP)
252+ ul_header->udp_ind = 1;
253+ else
254+ ul_header->udp_ind = 0;
250255
251256 /* Changing remaining fields to network order */
252257 hdr++;
@@ -419,7 +424,7 @@ sw_csum: · 166 unmodified lines
419424 ul_header->csum_start_offset = 0;
420425 ul_header->csum_insert_offset = 0;
421426 ul_header->csum_enabled = 0;
422− ul_header->udp_ip4_ind = 0;
427+ ul_header->udp_ind = 0;
423428
424429 priv->stats.csum_sw++;
425430 }
drivers/net/ethernet/realtek/r8169_main.c+8−6
@@ -6136,10 +6136,7 @@ static int r8169_phy_connect(struct rtl8169_private *tp) · 6135 unmodified lines
61366136 if (ret)
61376137 return ret;
61386138
6139− if (tp->supports_gmii)
6140− phy_remove_link_mode(phydev,
6141− ETHTOOL_LINK_MODE_1000baseT_Half_BIT);
6142− else
6139+ if (!tp->supports_gmii)
61436140 phy_set_max_speed(phydev, SPEED_100);
61446141
61456142 phy_support_asym_pause(phydev);
@@ -6589,13 +6586,18 @@ static int rtl_alloc_irq(struct rtl8169_private *tp) · 443 unmodified lines
65896586 {
65906587 unsigned int flags;
65916588
6592− if (tp->mac_version <= RTL_GIGA_MAC_VER_06) {
6589+ switch (tp->mac_version) {
6590+ case RTL_GIGA_MAC_VER_02 ... RTL_GIGA_MAC_VER_06:
65936591 rtl_unlock_config_regs(tp);
65946592 RTL_W8(tp, Config2, RTL_R8(tp, Config2) & ~MSIEnable);
65956593 rtl_lock_config_regs(tp);
6594+ /* fall through */
6595+ case RTL_GIGA_MAC_VER_07 ... RTL_GIGA_MAC_VER_24:
65966596 flags = PCI_IRQ_LEGACY;
6597− } else {
6597+ break;
6598+ default:
65986599 flags = PCI_IRQ_ALL_TYPES;
6600+ break;
65996601 }
66006602
66016603 return pci_alloc_irq_vectors(tp->pci_dev, 1, 1, flags);
drivers/net/ethernet/rocker/rocker_main.c+2−0
@@ -2208,10 +2208,12 @@ static int rocker_router_fib_event(struct notifier_block *nb, · 2207 unmodified lines
22082208
22092209 if (fen_info->fi->fib_nh_is_v6) {
22102210 NL_SET_ERR_MSG_MOD(info->extack, "IPv6 gateway with IPv4 route is not supported");
2211+ kfree(fib_work);
22112212 return notifier_from_errno(-EINVAL);
22122213 }
22132214 if (fen_info->fi->nh) {
22142215 NL_SET_ERR_MSG_MOD(info->extack, "IPv4 route with nexthop objects is not supported");
2216+ kfree(fib_work);
22152217 return notifier_from_errno(-EINVAL);
22162218 }
22172219 }
drivers/net/ethernet/samsung/Kconfig+1−1
@@ -11,7 +11,7 @@ config NET_VENDOR_SAMSUNG · 10 unmodified lines
1111 say Y.
1212
1313 Note that the answer to this question does not directly affect
14− the kernel: saying N will just case the configurator to skip all
14+ the kernel: saying N will just cause the configurator to skip all
1515 the questions about Samsung chipsets. If you say Y, you will be asked
1616 for your specific chipset/driver in the following questions.
1717
drivers/net/ethernet/smsc/smc911x.c+1−0
@@ -712,6 +712,7 @@ static void smc911x_phy_detect(struct net_device *dev) · 711 unmodified lines
712712 /* Found an external PHY */
713713 break;
714714 }
715+ /* Else, fall through */
715716 default:
716717 /* Internal media only */
717718 SMC_GET_PHY_ID1(lp, 1, id1);
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c+4−0
@@ -85,6 +85,8 @@ static void dwmac4_rx_queue_priority(struct mac_device_info *hw, · 84 unmodified lines
8585 u32 value;
8686
8787 base_register = (queue < 4) ? GMAC_RXQ_CTRL2 : GMAC_RXQ_CTRL3;
88+ if (queue >= 4)
89+ queue -= 4;
8890
8991 value = readl(ioaddr + base_register);
9092
@@ -102,6 +104,8 @@ static void dwmac4_tx_queue_priority(struct mac_device_info *hw, · 11 unmodified lines
102104 u32 value;
103105
104106 base_register = (queue < 4) ? GMAC_TXQ_PRTY_MAP0 : GMAC_TXQ_PRTY_MAP1;
107+ if (queue >= 4)
108+ queue -= 4;
105109
106110 value = readl(ioaddr + base_register);
107111
drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h+5−2
@@ -44,11 +44,13 @@ · 43 unmodified lines
4444 #define XGMAC_CORE_INIT_RX 0
4545 #define XGMAC_PACKET_FILTER 0x00000008
4646 #define XGMAC_FILTER_RA BIT(31)
47+#define XGMAC_FILTER_HPF BIT(10)
4748 #define XGMAC_FILTER_PCF BIT(7)
4849 #define XGMAC_FILTER_PM BIT(4)
4950 #define XGMAC_FILTER_HMC BIT(2)
5051 #define XGMAC_FILTER_PR BIT(0)
5152 #define XGMAC_HASH_TABLE(x) (0x00000010 + (x) * 4)
53+#define XGMAC_MAX_HASH_TABLE 8
5254 #define XGMAC_RXQ_CTRL0 0x000000a0
5355 #define XGMAC_RXQEN(x) GENMASK((x) * 2 + 1, (x) * 2)
5456 #define XGMAC_RXQEN_SHIFT(x) ((x) * 2)
@@ -99,11 +101,12 @@ · 44 unmodified lines
99101 #define XGMAC_MDIO_ADDR 0x00000200
100102 #define XGMAC_MDIO_DATA 0x00000204
101103 #define XGMAC_MDIO_C22P 0x00000220
102−#define XGMAC_ADDR0_HIGH 0x00000300
104+#define XGMAC_ADDRx_HIGH(x) (0x00000300 + (x) * 0x8)
105+#define XGMAC_ADDR_MAX 32
103106 #define XGMAC_AE BIT(31)
104107 #define XGMAC_DCS GENMASK(19, 16)
105108 #define XGMAC_DCS_SHIFT 16
106−#define XGMAC_ADDR0_LOW 0x00000304
109+#define XGMAC_ADDRx_LOW(x) (0x00000304 + (x) * 0x8)
107110 #define XGMAC_ARP_ADDR 0x00000c10
108111 #define XGMAC_TIMESTAMP_STATUS 0x00000d20
109112 #define XGMAC_TXTSC BIT(15)
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c+78−9
@@ -4,6 +4,8 @@ · 3 unmodified lines
44 * stmmac XGMAC support.
55 */
66
7+#include <linux/bitrev.h>
8+#include <linux/crc32.h>
79 #include "stmmac.h"
810 #include "dwxgmac2.h"
911
@@ -106,6 +108,8 @@ static void dwxgmac2_rx_queue_prio(struct mac_device_info *hw, u32 prio, · 96 unmodified lines
106108 u32 value, reg;
107109
108110 reg = (queue < 4) ? XGMAC_RXQ_CTRL2 : XGMAC_RXQ_CTRL3;
111+ if (queue >= 4)
112+ queue -= 4;
109113
110114 value = readl(ioaddr + reg);
111115 value &= ~XGMAC_PSRQ(queue);
@@ -169,6 +173,8 @@ static void dwxgmac2_map_mtl_to_dma(struct mac_device_info *hw, u32 queue, · 57 unmodified lines
169173 u32 value, reg;
170174
171175 reg = (queue < 4) ? XGMAC_MTL_RXQ_DMA_MAP0 : XGMAC_MTL_RXQ_DMA_MAP1;
176+ if (queue >= 4)
177+ queue -= 4;
172178
173179 value = readl(ioaddr + reg);
174180 value &= ~XGMAC_QxMDMACH(queue);
@@ -278,10 +284,10 @@ static void dwxgmac2_set_umac_addr(struct mac_device_info *hw, · 103 unmodified lines
278284 u32 value;
279285
280286 value = (addr[5] << 8) | addr[4];
281− writel(value | XGMAC_AE, ioaddr + XGMAC_ADDR0_HIGH);
287+ writel(value | XGMAC_AE, ioaddr + XGMAC_ADDRx_HIGH(reg_n));
282288
283289 value = (addr[3] << 24) | (addr[2] << 16) | (addr[1] << 8) | addr[0];
284− writel(value, ioaddr + XGMAC_ADDR0_LOW);
290+ writel(value, ioaddr + XGMAC_ADDRx_LOW(reg_n));
285291 }
286292
287293 static void dwxgmac2_get_umac_addr(struct mac_device_info *hw,
@@ -291,8 +297,8 @@ static void dwxgmac2_get_umac_addr(struct mac_device_info *hw, · 3 unmodified lines
291297 u32 hi_addr, lo_addr;
292298
293299 /* Read the MAC address from the hardware */
294− hi_addr = readl(ioaddr + XGMAC_ADDR0_HIGH);
295− lo_addr = readl(ioaddr + XGMAC_ADDR0_LOW);
300+ hi_addr = readl(ioaddr + XGMAC_ADDRx_HIGH(reg_n));
301+ lo_addr = readl(ioaddr + XGMAC_ADDRx_LOW(reg_n));
296302
297303 /* Extract the MAC address from the high and low words */
298304 addr[0] = lo_addr & 0xff;
@@ -303,19 +309,82 @@ static void dwxgmac2_get_umac_addr(struct mac_device_info *hw, · 4 unmodified lines
303309 addr[5] = (hi_addr >> 8) & 0xff;
304310 }
305311
312+static void dwxgmac2_set_mchash(void __iomem *ioaddr, u32 *mcfilterbits,
313+ int mcbitslog2)
314+{
315+ int numhashregs, regs;
316+
317+ switch (mcbitslog2) {
318+ case 6:
319+ numhashregs = 2;
320+ break;
321+ case 7:
322+ numhashregs = 4;
323+ break;
324+ case 8:
325+ numhashregs = 8;
326+ break;
327+ default:
328+ return;
329+ }
330+
331+ for (regs = 0; regs < numhashregs; regs++)
332+ writel(mcfilterbits[regs], ioaddr + XGMAC_HASH_TABLE(regs));
333+}
334+
306335 static void dwxgmac2_set_filter(struct mac_device_info *hw,
307336 struct net_device *dev)
308337 {
309338 void __iomem *ioaddr = (void __iomem *)dev->base_addr;
310− u32 value = XGMAC_FILTER_RA;
339+ u32 value = readl(ioaddr + XGMAC_PACKET_FILTER);
340+ int mcbitslog2 = hw->mcast_bits_log2;
341+ u32 mc_filter[8];
342+ int i;
343+
344+ value &= ~(XGMAC_FILTER_PR | XGMAC_FILTER_HMC | XGMAC_FILTER_PM);
345+ value |= XGMAC_FILTER_HPF;
346+
347+ memset(mc_filter, 0, sizeof(mc_filter));
311348
312349 if (dev->flags & IFF_PROMISC) {
313− value |= XGMAC_FILTER_PR | XGMAC_FILTER_PCF;
350+ value |= XGMAC_FILTER_PR;
351+ value |= XGMAC_FILTER_PCF;
314352 } else if ((dev->flags & IFF_ALLMULTI) ||
315− (netdev_mc_count(dev) > HASH_TABLE_SIZE)) {
353+ (netdev_mc_count(dev) > hw->multicast_filter_bins)) {
316354 value |= XGMAC_FILTER_PM;
317− writel(~0x0, ioaddr + XGMAC_HASH_TABLE(0));
318− writel(~0x0, ioaddr + XGMAC_HASH_TABLE(1));
355+
356+ for (i = 0; i < XGMAC_MAX_HASH_TABLE; i++)
357+ writel(~0x0, ioaddr + XGMAC_HASH_TABLE(i));
358+ } else if (!netdev_mc_empty(dev)) {
359+ struct netdev_hw_addr *ha;
360+
361+ value |= XGMAC_FILTER_HMC;
362+
363+ netdev_for_each_mc_addr(ha, dev) {
364+ int nr = (bitrev32(~crc32_le(~0, ha->addr, 6)) >>
365+ (32 - mcbitslog2));
366+ mc_filter[nr >> 5] |= (1 << (nr & 0x1F));
367+ }
368+ }
369+
370+ dwxgmac2_set_mchash(ioaddr, mc_filter, mcbitslog2);
371+
372+ /* Handle multiple unicast addresses */
373+ if (netdev_uc_count(dev) > XGMAC_ADDR_MAX) {
374+ value |= XGMAC_FILTER_PR;
375+ } else {
376+ struct netdev_hw_addr *ha;
377+ int reg = 1;
378+
379+ netdev_for_each_uc_addr(ha, dev) {
380+ dwxgmac2_set_umac_addr(hw, ha->addr, reg);
381+ reg++;
382+ }
383+
384+ for ( ; reg < XGMAC_ADDR_MAX; reg++) {
385+ writel(0, ioaddr + XGMAC_ADDRx_HIGH(reg));
386+ writel(0, ioaddr + XGMAC_ADDRx_LOW(reg));
387+ }
319388 }
320389
321390 writel(value, ioaddr + XGMAC_PACKET_FILTER);
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+26−24
@@ -814,20 +814,15 @@ static void stmmac_validate(struct phylink_config *config, · 813 unmodified lines
814814 phylink_set(mac_supported, 10baseT_Full);
815815 phylink_set(mac_supported, 100baseT_Half);
816816 phylink_set(mac_supported, 100baseT_Full);
817+ phylink_set(mac_supported, 1000baseT_Half);
818+ phylink_set(mac_supported, 1000baseT_Full);
819+ phylink_set(mac_supported, 1000baseKX_Full);
817820
818821 phylink_set(mac_supported, Autoneg);
819822 phylink_set(mac_supported, Pause);
820823 phylink_set(mac_supported, Asym_Pause);
821824 phylink_set_port_modes(mac_supported);
822825
823− if (priv->plat->has_gmac ||
824− priv->plat->has_gmac4 ||
825− priv->plat->has_xgmac) {
826− phylink_set(mac_supported, 1000baseT_Half);
827− phylink_set(mac_supported, 1000baseT_Full);
828− phylink_set(mac_supported, 1000baseKX_Full);
829− }
830−
831826 /* Cut down 1G if asked to */
832827 if ((max_speed > 0) && (max_speed < 1000)) {
833828 phylink_set(mask, 1000baseT_Full);
@@ -1295,6 +1290,8 @@ static int init_dma_rx_desc_rings(struct net_device *dev, gfp_t flags) · 461 unmodified lines
12951290 "(%s) dma_rx_phy=0x%08x\n", __func__,
12961291 (u32)rx_q->dma_rx_phy);
12971292
1293+ stmmac_clear_rx_descriptors(priv, queue);
1294+
12981295 for (i = 0; i < DMA_RX_SIZE; i++) {
12991296 struct dma_desc *p;
13001297
@@ -1312,8 +1309,6 @@ static int init_dma_rx_desc_rings(struct net_device *dev, gfp_t flags) · 11 unmodified lines
13121309 rx_q->cur_rx = 0;
13131310 rx_q->dirty_rx = (unsigned int)(i - DMA_RX_SIZE);
13141311
1315− stmmac_clear_rx_descriptors(priv, queue);
1316−
13171312 /* Setup the chained descriptor addresses */
13181313 if (priv->mode == STMMAC_CHAIN_MODE) {
13191314 if (priv->extend_desc)
@@ -1555,9 +1550,8 @@ static int alloc_dma_rx_desc_resources(struct stmmac_priv *priv) · 235 unmodified lines
15551550 goto err_dma;
15561551 }
15571552
1558− rx_q->buf_pool = kmalloc_array(DMA_RX_SIZE,
1559− sizeof(*rx_q->buf_pool),
1560− GFP_KERNEL);
1553+ rx_q->buf_pool = kcalloc(DMA_RX_SIZE, sizeof(*rx_q->buf_pool),
1554+ GFP_KERNEL);
15611555 if (!rx_q->buf_pool)
15621556 goto err_dma;
15631557
@@ -1608,15 +1602,15 @@ static int alloc_dma_tx_desc_resources(struct stmmac_priv *priv) · 44 unmodified lines
16081602 tx_q->queue_index = queue;
16091603 tx_q->priv_data = priv;
16101604
1611− tx_q->tx_skbuff_dma = kmalloc_array(DMA_TX_SIZE,
1612− sizeof(*tx_q->tx_skbuff_dma),
1613− GFP_KERNEL);
1605+ tx_q->tx_skbuff_dma = kcalloc(DMA_TX_SIZE,
1606+ sizeof(*tx_q->tx_skbuff_dma),
1607+ GFP_KERNEL);
16141608 if (!tx_q->tx_skbuff_dma)
16151609 goto err_dma;
16161610
1617− tx_q->tx_skbuff = kmalloc_array(DMA_TX_SIZE,
1618− sizeof(struct sk_buff *),
1619− GFP_KERNEL);
1611+ tx_q->tx_skbuff = kcalloc(DMA_TX_SIZE,
1612+ sizeof(struct sk_buff *),
1613+ GFP_KERNEL);
16201614 if (!tx_q->tx_skbuff)
16211615 goto err_dma;
16221616
@@ -3277,9 +3271,11 @@ static inline int stmmac_rx_threshold_count(struct stmmac_rx_queue *rx_q) · 1654 unmodified lines
32773271 static inline void stmmac_rx_refill(struct stmmac_priv *priv, u32 queue)
32783272 {
32793273 struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue];
3280− int dirty = stmmac_rx_dirty(priv, queue);
3274+ int len, dirty = stmmac_rx_dirty(priv, queue);
32813275 unsigned int entry = rx_q->dirty_rx;
32823276
3277+ len = DIV_ROUND_UP(priv->dma_buf_sz, PAGE_SIZE) * PAGE_SIZE;
3278+
32833279 while (dirty-- > 0) {
32843280 struct stmmac_rx_buffer *buf = &rx_q->buf_pool[entry];
32853281 struct dma_desc *p;
@@ -3297,6 +3293,13 @@ static inline void stmmac_rx_refill(struct stmmac_priv *priv, u32 queue) · 11 unmodified lines
32973293 }
32983294
32993295 buf->addr = page_pool_get_dma_addr(buf->page);
3296+
3297+ /* Sync whole allocation to device. This will invalidate old
3298+ * data.
3299+ */
3300+ dma_sync_single_for_device(priv->device, buf->addr, len,
3301+ DMA_FROM_DEVICE);
3302+
33003303 stmmac_set_desc_addr(priv, p, buf->addr);
33013304 stmmac_refill_desc3(priv, rx_q, p);
33023305
@@ -3431,8 +3434,6 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue) · 128 unmodified lines
34313434 skb_copy_to_linear_data(skb, page_address(buf->page),
34323435 frame_len);
34333436 skb_put(skb, frame_len);
3434− dma_sync_single_for_device(priv->device, buf->addr,
3435− frame_len, DMA_FROM_DEVICE);
34363437
34373438 if (netif_msg_pktdata(priv)) {
34383439 netdev_dbg(priv->dev, "frame received (%dbytes)",
@@ -4319,8 +4320,9 @@ int stmmac_dvr_probe(struct device *device, · 880 unmodified lines
43194320 NAPI_POLL_WEIGHT);
43204321 }
43214322 if (queue < priv->plat->tx_queues_to_use) {
4322− netif_napi_add(ndev, &ch->tx_napi, stmmac_napi_poll_tx,
4323− NAPI_POLL_WEIGHT);
4323+ netif_tx_napi_add(ndev, &ch->tx_napi,
4324+ stmmac_napi_poll_tx,
4325+ NAPI_POLL_WEIGHT);
43244326 }
43254327 }
43264328
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c+7−0
@@ -370,6 +370,13 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac) · 369 unmodified lines
370370 return ERR_PTR(-ENOMEM);
371371
372372 *mac = of_get_mac_address(np);
373+ if (IS_ERR(*mac)) {
374+ if (PTR_ERR(*mac) == -EPROBE_DEFER)
375+ return ERR_CAST(*mac);
376+
377+ *mac = NULL;
378+ }
379+
373380 plat->interface = of_get_phy_mode(np);
374381
375382 /* Some wrapper drivers still rely on phy_node. Let's save it while
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c+1−1
@@ -37,7 +37,7 @@ static struct stmmac_tc_entry *tc_find_entry(struct stmmac_priv *priv, · 36 unmodified lines
3737 entry = &priv->tc_entries[i];
3838 if (!entry->in_use && !first && free)
3939 first = entry;
40− if (entry->handle == loc && !free)
40+ if ((entry->handle == loc) && !free && !entry->is_frag)
4141 dup = entry;
4242 }
4343
drivers/net/ethernet/toshiba/spider_net.c+1−0
@@ -788,6 +788,7 @@ spider_net_release_tx_chain(struct spider_net_card *card, int brutal) · 787 unmodified lines
788788 /* fallthrough, if we release the descriptors
789789 * brutally (then we don't care about
790790 * SPIDER_NET_DESCR_CARDOWNED) */
791+ /* Fall through */
791792
792793 case SPIDER_NET_DESCR_RESPONSE_ERROR:
793794 case SPIDER_NET_DESCR_PROTECTION_ERROR:
drivers/net/ethernet/xscale/Kconfig+1−1
@@ -13,7 +13,7 @@ config NET_VENDOR_XSCALE · 12 unmodified lines
1313
1414 Note that the answer to this question does not directly affect the
1515 kernel: saying N will just cause the configurator to skip all
16− the questions about XSacle IXP devices. If you say Y, you will be
16+ the questions about XScale IXP devices. If you say Y, you will be
1717 asked for your specific card in the following questions.
1818
1919 if NET_VENDOR_XSCALE
drivers/net/hamradio/baycom_epp.c+2−1
@@ -500,8 +500,9 @@ static int transmit(struct baycom_state *bc, int cnt, unsigned char stat) · 499 unmodified lines
500500 }
501501 break;
502502 }
503+ /* fall through */
503504
504− default: /* fall through */
505+ default:
505506 if (bc->hdlctx.calibrate <= 0)
506507 return 0;
507508 i = min_t(int, cnt, bc->hdlctx.calibrate);
drivers/net/phy/fixed_phy.c+4−2
@@ -216,8 +216,10 @@ static struct gpio_desc *fixed_phy_get_gpiod(struct device_node *np) · 215 unmodified lines
216216 if (IS_ERR(gpiod)) {
217217 if (PTR_ERR(gpiod) == -EPROBE_DEFER)
218218 return gpiod;
219− pr_err("error getting GPIO for fixed link %pOF, proceed without\n",
220− fixed_link_node);
219+
220+ if (PTR_ERR(gpiod) != -ENOENT)
221+ pr_err("error getting GPIO for fixed link %pOF, proceed without\n",
222+ fixed_link_node);
221223 gpiod = NULL;
222224 }
223225
drivers/net/phy/mscc.c+8−8
@@ -2226,8 +2226,8 @@ static int vsc8514_probe(struct phy_device *phydev) · 2225 unmodified lines
22262226 vsc8531->supp_led_modes = VSC85XX_SUPP_LED_MODES;
22272227 vsc8531->hw_stats = vsc85xx_hw_stats;
22282228 vsc8531->nstats = ARRAY_SIZE(vsc85xx_hw_stats);
2229− vsc8531->stats = devm_kmalloc_array(&phydev->mdio.dev, vsc8531->nstats,
2230− sizeof(u64), GFP_KERNEL);
2229+ vsc8531->stats = devm_kcalloc(&phydev->mdio.dev, vsc8531->nstats,
2230+ sizeof(u64), GFP_KERNEL);
22312231 if (!vsc8531->stats)
22322232 return -ENOMEM;
22332233
@@ -2251,8 +2251,8 @@ static int vsc8574_probe(struct phy_device *phydev) · 17 unmodified lines
22512251 vsc8531->supp_led_modes = VSC8584_SUPP_LED_MODES;
22522252 vsc8531->hw_stats = vsc8584_hw_stats;
22532253 vsc8531->nstats = ARRAY_SIZE(vsc8584_hw_stats);
2254− vsc8531->stats = devm_kmalloc_array(&phydev->mdio.dev, vsc8531->nstats,
2255− sizeof(u64), GFP_KERNEL);
2254+ vsc8531->stats = devm_kcalloc(&phydev->mdio.dev, vsc8531->nstats,
2255+ sizeof(u64), GFP_KERNEL);
22562256 if (!vsc8531->stats)
22572257 return -ENOMEM;
22582258
@@ -2281,8 +2281,8 @@ static int vsc8584_probe(struct phy_device *phydev) · 22 unmodified lines
22812281 vsc8531->supp_led_modes = VSC8584_SUPP_LED_MODES;
22822282 vsc8531->hw_stats = vsc8584_hw_stats;
22832283 vsc8531->nstats = ARRAY_SIZE(vsc8584_hw_stats);
2284− vsc8531->stats = devm_kmalloc_array(&phydev->mdio.dev, vsc8531->nstats,
2285− sizeof(u64), GFP_KERNEL);
2284+ vsc8531->stats = devm_kcalloc(&phydev->mdio.dev, vsc8531->nstats,
2285+ sizeof(u64), GFP_KERNEL);
22862286 if (!vsc8531->stats)
22872287 return -ENOMEM;
22882288
@@ -2311,8 +2311,8 @@ static int vsc85xx_probe(struct phy_device *phydev) · 22 unmodified lines
23112311 vsc8531->supp_led_modes = VSC85XX_SUPP_LED_MODES;
23122312 vsc8531->hw_stats = vsc85xx_hw_stats;
23132313 vsc8531->nstats = ARRAY_SIZE(vsc85xx_hw_stats);
2314− vsc8531->stats = devm_kmalloc_array(&phydev->mdio.dev, vsc8531->nstats,
2315− sizeof(u64), GFP_KERNEL);
2314+ vsc8531->stats = devm_kcalloc(&phydev->mdio.dev, vsc8531->nstats,
2315+ sizeof(u64), GFP_KERNEL);
23162316 if (!vsc8531->stats)
23172317 return -ENOMEM;
23182318
drivers/net/phy/phy_device.c+6−0
@@ -1774,6 +1774,12 @@ done: · 1773 unmodified lines
17741774 phydev->link = status & BMSR_LSTATUS ? 1 : 0;
17751775 phydev->autoneg_complete = status & BMSR_ANEGCOMPLETE ? 1 : 0;
17761776
1777+ /* Consider the case that autoneg was started and "aneg complete"
1778+ * bit has been reset, but "link up" bit not yet.
1779+ */
1780+ if (phydev->autoneg == AUTONEG_ENABLE && !phydev->autoneg_complete)
1781+ phydev->link = 0;
1782+
17771783 return 0;
17781784 }
17791785 EXPORT_SYMBOL(genphy_update_link);
drivers/net/phy/phy_led_triggers.c+2−1
@@ -48,8 +48,9 @@ void phy_led_trigger_change_speed(struct phy_device *phy) · 47 unmodified lines
4848 if (!phy->last_triggered)
4949 led_trigger_event(&phy->led_link_trigger->trigger,
5050 LED_FULL);
51+ else
52+ led_trigger_event(&phy->last_triggered->trigger, LED_OFF);
5153
52− led_trigger_event(&phy->last_triggered->trigger, LED_OFF);
5354 led_trigger_event(&plt->trigger, LED_FULL);
5455 phy->last_triggered = plt;
5556 }
drivers/net/phy/phylink.c+6−4
@@ -216,6 +216,8 @@ static int phylink_parse_fixedlink(struct phylink *pl, · 215 unmodified lines
216216 pl->supported, true);
217217 linkmode_zero(pl->supported);
218218 phylink_set(pl->supported, MII);
219+ phylink_set(pl->supported, Pause);
220+ phylink_set(pl->supported, Asym_Pause);
219221 if (s) {
220222 __set_bit(s->bit, pl->supported);
221223 } else {
@@ -990,10 +992,10 @@ void phylink_start(struct phylink *pl) · 768 unmodified lines
990992 }
991993 if (pl->link_an_mode == MLO_AN_FIXED && pl->get_fixed_state)
992994 mod_timer(&pl->link_poll, jiffies + HZ);
993− if (pl->sfp_bus)
994− sfp_upstream_start(pl->sfp_bus);
995995 if (pl->phydev)
996996 phy_start(pl->phydev);
997+ if (pl->sfp_bus)
998+ sfp_upstream_start(pl->sfp_bus);
997999 }
9981000 EXPORT_SYMBOL_GPL(phylink_start);
9991001
@@ -1010,10 +1012,10 @@ void phylink_stop(struct phylink *pl) · 10 unmodified lines
10101012 {
10111013 ASSERT_RTNL();
10121014
1013− if (pl->phydev)
1014− phy_stop(pl->phydev);
10151015 if (pl->sfp_bus)
10161016 sfp_upstream_stop(pl->sfp_bus);
1017+ if (pl->phydev)
1018+ phy_stop(pl->phydev);
10171019 del_timer_sync(&pl->link_poll);
10181020 if (pl->link_irq) {
10191021 free_irq(pl->link_irq, pl);
drivers/net/ppp/pppoe.c+3−0
@@ -1115,6 +1115,9 @@ static const struct proto_ops pppoe_ops = { · 1114 unmodified lines
11151115 .recvmsg = pppoe_recvmsg,
11161116 .mmap = sock_no_mmap,
11171117 .ioctl = pppox_ioctl,
1118+#ifdef CONFIG_COMPAT
1119+ .compat_ioctl = pppox_compat_ioctl,
1120+#endif
11181121 };
11191122
11201123 static const struct pppox_proto pppoe_proto = {
drivers/net/ppp/pppox.c+13−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <linux/string.h>
1818 #include <linux/module.h>
1919 #include <linux/kernel.h>
20+#include <linux/compat.h>
2021 #include <linux/errno.h>
2122 #include <linux/netdevice.h>
2223 #include <linux/net.h>
@@ -98,6 +99,18 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) · 75 unmodified lines
9899
99100 EXPORT_SYMBOL(pppox_ioctl);
100101
102+#ifdef CONFIG_COMPAT
103+int pppox_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
104+{
105+ if (cmd == PPPOEIOCSFWD32)
106+ cmd = PPPOEIOCSFWD;
107+
108+ return pppox_ioctl(sock, cmd, (unsigned long)compat_ptr(arg));
109+}
110+
111+EXPORT_SYMBOL(pppox_compat_ioctl);
112+#endif
113+
101114 static int pppox_create(struct net *net, struct socket *sock, int protocol,
102115 int kern)
103116 {
drivers/net/ppp/pptp.c+3−0
@@ -623,6 +623,9 @@ static const struct proto_ops pptp_ops = { · 622 unmodified lines
623623 .recvmsg = sock_no_recvmsg,
624624 .mmap = sock_no_mmap,
625625 .ioctl = pppox_ioctl,
626+#ifdef CONFIG_COMPAT
627+ .compat_ioctl = pppox_compat_ioctl,
628+#endif
626629 };
627630
628631 static const struct pppox_proto pppox_pptp_proto = {
drivers/net/tun.c+6−3
@@ -1599,7 +1599,8 @@ static bool tun_can_build_skb(struct tun_struct *tun, struct tun_file *tfile, · 1598 unmodified lines
15991599 return true;
16001600 }
16011601
1602−static struct sk_buff *__tun_build_skb(struct page_frag *alloc_frag, char *buf,
1602+static struct sk_buff *__tun_build_skb(struct tun_file *tfile,
1603+ struct page_frag *alloc_frag, char *buf,
16031604 int buflen, int len, int pad)
16041605 {
16051606 struct sk_buff *skb = build_skb(buf, buflen);
@@ -1609,6 +1610,7 @@ static struct sk_buff *__tun_build_skb(struct page_frag *alloc_frag, char *buf, · 3 unmodified lines
16091610
16101611 skb_reserve(skb, pad);
16111612 skb_put(skb, len);
1613+ skb_set_owner_w(skb, tfile->socket.sk);
16121614
16131615 get_page(alloc_frag->page);
16141616 alloc_frag->offset += buflen;
@@ -1686,7 +1688,8 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun, · 71 unmodified lines
16861688 */
16871689 if (hdr->gso_type || !xdp_prog) {
16881690 *skb_xdp = 1;
1689− return __tun_build_skb(alloc_frag, buf, buflen, len, pad);
1691+ return __tun_build_skb(tfile, alloc_frag, buf, buflen, len,
1692+ pad);
16901693 }
16911694
16921695 *skb_xdp = 0;
@@ -1723,7 +1726,7 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun, · 30 unmodified lines
17231726 rcu_read_unlock();
17241727 local_bh_enable();
17251728
1726− return __tun_build_skb(alloc_frag, buf, buflen, len, pad);
1729+ return __tun_build_skb(tfile, alloc_frag, buf, buflen, len, pad);
17271730
17281731 err_xdp:
17291732 put_page(alloc_frag->page);
drivers/net/usb/pegasus.c+1−1
@@ -282,7 +282,7 @@ static void mdio_write(struct net_device *dev, int phy_id, int loc, int val) · 281 unmodified lines
282282 static int read_eprom_word(pegasus_t *pegasus, __u8 index, __u16 *retdata)
283283 {
284284 int i;
285− __u8 tmp;
285+ __u8 tmp = 0;
286286 __le16 retdatai;
287287 int ret;
288288
drivers/net/usb/qmi_wwan.c+1−0
@@ -1295,6 +1295,7 @@ static const struct usb_device_id products[] = { · 1294 unmodified lines
12951295 {QMI_FIXED_INTF(0x2001, 0x7e3d, 4)}, /* D-Link DWM-222 A2 */
12961296 {QMI_FIXED_INTF(0x2020, 0x2031, 4)}, /* Olicard 600 */
12971297 {QMI_FIXED_INTF(0x2020, 0x2033, 4)}, /* BroadMobi BM806U */
1298+ {QMI_FIXED_INTF(0x2020, 0x2060, 4)}, /* BroadMobi BM818 */
12981299 {QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */
12991300 {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */
13001301 {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */
drivers/net/usb/r8152.c+6−6
@@ -50,7 +50,7 @@ · 49 unmodified lines
5050 #define PLA_TEREDO_WAKE_BASE 0xc0c4
5151 #define PLA_MAR 0xcd00
5252 #define PLA_BACKUP 0xd000
53−#define PAL_BDC_CR 0xd1a0
53+#define PLA_BDC_CR 0xd1a0
5454 #define PLA_TEREDO_TIMER 0xd2cc
5555 #define PLA_REALWOW_TIMER 0xd2e8
5656 #define PLA_SUSPEND_FLAG 0xd38a
@@ -274,7 +274,7 @@ · 217 unmodified lines
274274 #define TEREDO_RS_EVENT_MASK 0x00fe
275275 #define OOB_TEREDO_EN 0x0001
276276
277−/* PAL_BDC_CR */
277+/* PLA_BDC_CR */
278278 #define ALDPS_PROXY_MODE 0x0001
279279
280280 /* PLA_EFUSE_CMD */
@@ -3191,9 +3191,9 @@ static void r8152b_enter_oob(struct r8152 *tp) · 2910 unmodified lines
31913191
31923192 rtl_rx_vlan_en(tp, true);
31933193
3194− ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PAL_BDC_CR);
3194+ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_BDC_CR);
31953195 ocp_data |= ALDPS_PROXY_MODE;
3196− ocp_write_word(tp, MCU_TYPE_PLA, PAL_BDC_CR, ocp_data);
3196+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_BDC_CR, ocp_data);
31973197
31983198 ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
31993199 ocp_data |= NOW_IS_OOB | DIS_MCU_CLROOB;
@@ -3577,9 +3577,9 @@ static void r8153_enter_oob(struct r8152 *tp) · 377 unmodified lines
35773577
35783578 rtl_rx_vlan_en(tp, true);
35793579
3580− ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PAL_BDC_CR);
3580+ ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_BDC_CR);
35813581 ocp_data |= ALDPS_PROXY_MODE;
3582− ocp_write_word(tp, MCU_TYPE_PLA, PAL_BDC_CR, ocp_data);
3582+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_BDC_CR, ocp_data);
35833583
35843584 ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
35853585 ocp_data |= NOW_IS_OOB | DIS_MCU_CLROOB;
drivers/net/wan/sdla.c+1−0
@@ -413,6 +413,7 @@ static void sdla_errors(struct net_device *dev, int cmd, int dlci, int ret, int · 412 unmodified lines
413413 case SDLA_RET_NO_BUFS:
414414 if (cmd == SDLA_INFORMATION_WRITE)
415415 break;
416+ /* Else, fall through */
416417
417418 default:
418419 netdev_dbg(dev, "Cmd 0x%02X generated return code 0x%02X\n",
drivers/net/wireless/intel/iwlwifi/fw/api/rx.h+2−1
@@ -776,7 +776,6 @@ struct iwl_rss_config_cmd { · 775 unmodified lines
776776 u8 indirection_table[IWL_RSS_INDIRECTION_TABLE_SIZE];
777777 } __packed; /* RSS_CONFIG_CMD_API_S_VER_1 */
778778
779−#define IWL_MULTI_QUEUE_SYNC_MSG_MAX_SIZE 128
780779 #define IWL_MULTI_QUEUE_SYNC_SENDER_POS 0
781780 #define IWL_MULTI_QUEUE_SYNC_SENDER_MSK 0xf
782781
@@ -812,10 +811,12 @@ struct iwl_rxq_sync_notification { · 29 unmodified lines
812811 *
813812 * @IWL_MVM_RXQ_EMPTY: empty sync notification
814813 * @IWL_MVM_RXQ_NOTIF_DEL_BA: notify RSS queues of delBA
814+ * @IWL_MVM_RXQ_NSSN_SYNC: notify all the RSS queues with the new NSSN
815815 */
816816 enum iwl_mvm_rxq_notif_type {
817817 IWL_MVM_RXQ_EMPTY,
818818 IWL_MVM_RXQ_NOTIF_DEL_BA,
819+ IWL_MVM_RXQ_NSSN_SYNC,
819820 };
820821
821822 /**
drivers/net/wireless/intel/iwlwifi/fw/dbg.c+12−10
@@ -2438,17 +2438,19 @@ static void iwl_fw_dbg_info_apply(struct iwl_fw_runtime *fwrt, · 2437 unmodified lines
24382438 {
24392439 u32 img_name_len = le32_to_cpu(dbg_info->img_name_len);
24402440 u32 dbg_cfg_name_len = le32_to_cpu(dbg_info->dbg_cfg_name_len);
2441− const char err_str[] =
2442− "WRT: ext=%d. Invalid %s name length %d, expected %d\n";
24432441
24442442 if (img_name_len != IWL_FW_INI_MAX_IMG_NAME_LEN) {
2445− IWL_WARN(fwrt, err_str, ext, "image", img_name_len,
2443+ IWL_WARN(fwrt,
2444+ "WRT: ext=%d. Invalid image name length %d, expected %d\n",
2445+ ext, img_name_len,
24462446 IWL_FW_INI_MAX_IMG_NAME_LEN);
24472447 return;
24482448 }
24492449
24502450 if (dbg_cfg_name_len != IWL_FW_INI_MAX_DBG_CFG_NAME_LEN) {
2451− IWL_WARN(fwrt, err_str, ext, "debug cfg", dbg_cfg_name_len,
2451+ IWL_WARN(fwrt,
2452+ "WRT: ext=%d. Invalid debug cfg name length %d, expected %d\n",
2453+ ext, dbg_cfg_name_len,
24522454 IWL_FW_INI_MAX_DBG_CFG_NAME_LEN);
24532455 return;
24542456 }
@@ -2775,8 +2777,6 @@ static void _iwl_fw_dbg_apply_point(struct iwl_fw_runtime *fwrt, · 320 unmodified lines
27752777 struct iwl_ucode_tlv *tlv = iter;
27762778 void *ini_tlv = (void *)tlv->data;
27772779 u32 type = le32_to_cpu(tlv->type);
2778− const char invalid_ap_str[] =
2779− "WRT: ext=%d. Invalid apply point %d for %s\n";
27802780
27812781 switch (type) {
27822782 case IWL_UCODE_TLV_TYPE_DEBUG_INFO:
@@ -2786,8 +2786,9 @@ static void _iwl_fw_dbg_apply_point(struct iwl_fw_runtime *fwrt, · 3 unmodified lines
27862786 struct iwl_fw_ini_allocation_data *buf_alloc = ini_tlv;
27872787
27882788 if (pnt != IWL_FW_INI_APPLY_EARLY) {
2789− IWL_ERR(fwrt, invalid_ap_str, ext, pnt,
2790− "buffer allocation");
2789+ IWL_ERR(fwrt,
2790+ "WRT: ext=%d. Invalid apply point %d for buffer allocation\n",
2791+ ext, pnt);
27912792 goto next;
27922793 }
27932794
@@ -2797,8 +2798,9 @@ static void _iwl_fw_dbg_apply_point(struct iwl_fw_runtime *fwrt, · 3 unmodified lines
27972798 }
27982799 case IWL_UCODE_TLV_TYPE_HCMD:
27992800 if (pnt < IWL_FW_INI_APPLY_AFTER_ALIVE) {
2800− IWL_ERR(fwrt, invalid_ap_str, ext, pnt,
2801− "host command");
2801+ IWL_ERR(fwrt,
2802+ "WRT: ext=%d. Invalid apply point %d for host command\n",
2803+ ext, pnt);
28022804 goto next;
28032805 }
28042806 iwl_fw_dbg_send_hcmd(fwrt, tlv, ext);
drivers/net/wireless/intel/iwlwifi/iwl-drv.c+3−1
@@ -1640,6 +1640,8 @@ struct iwl_drv *iwl_drv_start(struct iwl_trans *trans) · 1639 unmodified lines
16401640 init_completion(&drv->request_firmware_complete);
16411641 INIT_LIST_HEAD(&drv->list);
16421642
1643+ iwl_load_fw_dbg_tlv(drv->trans->dev, drv->trans);
1644+
16431645 #ifdef CONFIG_IWLWIFI_DEBUGFS
16441646 /* Create the device debugfs entries. */
16451647 drv->dbgfs_drv = debugfs_create_dir(dev_name(trans->dev),
@@ -1660,8 +1662,8 @@ struct iwl_drv *iwl_drv_start(struct iwl_trans *trans) · 14 unmodified lines
16601662 err_fw:
16611663 #ifdef CONFIG_IWLWIFI_DEBUGFS
16621664 debugfs_remove_recursive(drv->dbgfs_drv);
1663− iwl_fw_dbg_free(drv->trans);
16641665 #endif
1666+ iwl_fw_dbg_free(drv->trans);
16651667 kfree(drv);
16661668 err:
16671669 return ERR_PTR(ret);
drivers/net/wireless/intel/iwlwifi/mvm/fw.c+21−8
@@ -755,7 +755,7 @@ static int iwl_mvm_sar_get_ewrd_table(struct iwl_mvm *mvm) · 754 unmodified lines
755755
756756 for (i = 0; i < n_profiles; i++) {
757757 /* the tables start at element 3 */
758− static int pos = 3;
758+ int pos = 3;
759759
760760 /* The EWRD profiles officially go from 2 to 4, but we
761761 * save them in sar_profiles[1-3] (because we don't
@@ -880,6 +880,22 @@ int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm, int prof_a, int prof_b) · 118 unmodified lines
880880 return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, len, &cmd);
881881 }
882882
883+static bool iwl_mvm_sar_geo_support(struct iwl_mvm *mvm)
884+{
885+ /*
886+ * The GEO_TX_POWER_LIMIT command is not supported on earlier
887+ * firmware versions. Unfortunately, we don't have a TLV API
888+ * flag to rely on, so rely on the major version which is in
889+ * the first byte of ucode_ver. This was implemented
890+ * initially on version 38 and then backported to 36, 29 and
891+ * 17.
892+ */
893+ return IWL_UCODE_SERIAL(mvm->fw->ucode_ver) >= 38 ||
894+ IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 36 ||
895+ IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 29 ||
896+ IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 17;
897+}
898+
883899 int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm)
884900 {
885901 struct iwl_geo_tx_power_profiles_resp *resp;
@@ -909,6 +925,9 @@ int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm) · 23 unmodified lines
909925 .data = { data },
910926 };
911927
928+ if (!iwl_mvm_sar_geo_support(mvm))
929+ return -EOPNOTSUPP;
930+
912931 ret = iwl_mvm_send_cmd(mvm, &cmd);
913932 if (ret) {
914933 IWL_ERR(mvm, "Failed to get geographic profile info %d\n", ret);
@@ -934,13 +953,7 @@ static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm) · 19 unmodified lines
934953 int ret, i, j;
935954 u16 cmd_wide_id = WIDE_ID(PHY_OPS_GROUP, GEO_TX_POWER_LIMIT);
936955
937− /*
938− * This command is not supported on earlier firmware versions.
939− * Unfortunately, we don't have a TLV API flag to rely on, so
940− * rely on the major version which is in the first byte of
941− * ucode_ver.
942− */
943− if (IWL_UCODE_SERIAL(mvm->fw->ucode_ver) < 41)
956+ if (!iwl_mvm_sar_geo_support(mvm))
944957 return 0;
945958
946959 ret = iwl_mvm_sar_get_wgds_table(mvm);
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c+42−16
@@ -207,11 +207,11 @@ static const struct cfg80211_pmsr_capabilities iwl_mvm_pmsr_capa = { · 206 unmodified lines
207207 },
208208 };
209209
210−static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
211− enum set_key_cmd cmd,
212− struct ieee80211_vif *vif,
213− struct ieee80211_sta *sta,
214− struct ieee80211_key_conf *key);
210+static int __iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
211+ enum set_key_cmd cmd,
212+ struct ieee80211_vif *vif,
213+ struct ieee80211_sta *sta,
214+ struct ieee80211_key_conf *key);
215215
216216 void iwl_mvm_ref(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type)
217217 {
@@ -474,7 +474,19 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) · 256 unmodified lines
474474 ieee80211_hw_set(hw, SUPPORTS_VHT_EXT_NSS_BW);
475475 ieee80211_hw_set(hw, BUFF_MMPDU_TXQ);
476476 ieee80211_hw_set(hw, STA_MMPDU_TXQ);
477− ieee80211_hw_set(hw, TX_AMSDU);
477+ /*
478+ * On older devices, enabling TX A-MSDU occasionally leads to
479+ * something getting messed up, the command read from the FIFO
480+ * gets out of sync and isn't a TX command, so that we have an
481+ * assert EDC.
482+ *
483+ * It's not clear where the bug is, but since we didn't used to
484+ * support A-MSDU until moving the mac80211 iTXQs, just leave it
485+ * for older devices. We also don't see this issue on any newer
486+ * devices.
487+ */
488+ if (mvm->cfg->device_family >= IWL_DEVICE_FAMILY_9000)
489+ ieee80211_hw_set(hw, TX_AMSDU);
478490 ieee80211_hw_set(hw, TX_FRAG_LIST);
479491
480492 if (iwl_mvm_has_tlc_offload(mvm)) {
@@ -2726,7 +2738,7 @@ static int iwl_mvm_start_ap_ibss(struct ieee80211_hw *hw, · 2245 unmodified lines
27262738
27272739 mvmvif->ap_early_keys[i] = NULL;
27282740
2729− ret = iwl_mvm_mac_set_key(hw, SET_KEY, vif, NULL, key);
2741+ ret = __iwl_mvm_mac_set_key(hw, SET_KEY, vif, NULL, key);
27302742 if (ret)
27312743 goto out_quota_failed;
27322744 }
@@ -3494,11 +3506,11 @@ static int iwl_mvm_mac_sched_scan_stop(struct ieee80211_hw *hw, · 761 unmodified lines
34943506 return ret;
34953507 }
34963508
3497−static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
3498− enum set_key_cmd cmd,
3499− struct ieee80211_vif *vif,
3500− struct ieee80211_sta *sta,
3501− struct ieee80211_key_conf *key)
3509+static int __iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
3510+ enum set_key_cmd cmd,
3511+ struct ieee80211_vif *vif,
3512+ struct ieee80211_sta *sta,
3513+ struct ieee80211_key_conf *key)
35023514 {
35033515 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
35043516 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
@@ -3553,8 +3565,6 @@ static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw, · 48 unmodified lines
35533565 return -EOPNOTSUPP;
35543566 }
35553567
3556− mutex_lock(&mvm->mutex);
3557−
35583568 switch (cmd) {
35593569 case SET_KEY:
35603570 if ((vif->type == NL80211_IFTYPE_ADHOC ||
@@ -3700,7 +3710,22 @@ static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw, · 139 unmodified lines
37003710 ret = -EINVAL;
37013711 }
37023712
3713+ return ret;
3714+}
3715+
3716+static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
3717+ enum set_key_cmd cmd,
3718+ struct ieee80211_vif *vif,
3719+ struct ieee80211_sta *sta,
3720+ struct ieee80211_key_conf *key)
3721+{
3722+ struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
3723+ int ret;
3724+
3725+ mutex_lock(&mvm->mutex);
3726+ ret = __iwl_mvm_mac_set_key(hw, cmd, vif, sta, key);
37033727 mutex_unlock(&mvm->mutex);
3728+
37043729 return ret;
37053730 }
37063731
@@ -5041,7 +5066,6 @@ void iwl_mvm_sync_rx_queues_internal(struct iwl_mvm *mvm, · 1334 unmodified lines
50415066 u32 qmask = BIT(mvm->trans->num_rx_queues) - 1;
50425067 int ret;
50435068
5044− lockdep_assert_held(&mvm->mutex);
50455069
50465070 if (!iwl_mvm_has_new_rx_api(mvm))
50475071 return;
@@ -5052,13 +5076,15 @@ void iwl_mvm_sync_rx_queues_internal(struct iwl_mvm *mvm, · 4 unmodified lines
50525076 atomic_set(&mvm->queue_sync_counter,
50535077 mvm->trans->num_rx_queues);
50545078
5055− ret = iwl_mvm_notify_rx_queue(mvm, qmask, (u8 *)notif, size);
5079+ ret = iwl_mvm_notify_rx_queue(mvm, qmask, (u8 *)notif,
5080+ size, !notif->sync);
50565081 if (ret) {
50575082 IWL_ERR(mvm, "Failed to trigger RX queues sync (%d)\n", ret);
50585083 goto out;
50595084 }
50605085
50615086 if (notif->sync) {
5087+ lockdep_assert_held(&mvm->mutex);
50625088 ret = wait_event_timeout(mvm->rx_sync_waitq,
50635089 atomic_read(&mvm->queue_sync_counter) == 0 ||
50645090 iwl_mvm_is_radio_killed(mvm),
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h+4−4
@@ -1664,9 +1664,9 @@ void iwl_mvm_rx_monitor_no_data(struct iwl_mvm *mvm, struct napi_struct *napi, · 1663 unmodified lines
16641664 void iwl_mvm_rx_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi,
16651665 struct iwl_rx_cmd_buffer *rxb, int queue);
16661666 int iwl_mvm_notify_rx_queue(struct iwl_mvm *mvm, u32 rxq_mask,
1667− const u8 *data, u32 count);
1668−void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
1669− int queue);
1667+ const u8 *data, u32 count, bool async);
1668+void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct napi_struct *napi,
1669+ struct iwl_rx_cmd_buffer *rxb, int queue);
16701670 void iwl_mvm_rx_tx_cmd(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb);
16711671 void iwl_mvm_mfu_assert_dump_notif(struct iwl_mvm *mvm,
16721672 struct iwl_rx_cmd_buffer *rxb);
@@ -1813,7 +1813,7 @@ iwl_mvm_vif_dbgfs_clean(struct iwl_mvm *mvm, struct ieee80211_vif *vif) · 140 unmodified lines
18131813 #endif /* CONFIG_IWLWIFI_DEBUGFS */
18141814
18151815 /* rate scaling */
1816−int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, bool sync);
1816+int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq);
18171817 void iwl_mvm_update_frame_stats(struct iwl_mvm *mvm, u32 rate, bool agg);
18181818 int rs_pretty_print_rate(char *buf, int bufsz, const u32 rate);
18191819 void rs_update_last_rssi(struct iwl_mvm *mvm,
drivers/net/wireless/intel/iwlwifi/mvm/nvm.c+1−1
@@ -620,7 +620,7 @@ void iwl_mvm_rx_chub_update_mcc(struct iwl_mvm *mvm, · 619 unmodified lines
620620 enum iwl_mcc_source src;
621621 char mcc[3];
622622 struct ieee80211_regdomain *regd;
623− u32 wgds_tbl_idx;
623+ int wgds_tbl_idx;
624624
625625 lockdep_assert_held(&mvm->mutex);
626626
drivers/net/wireless/intel/iwlwifi/mvm/ops.c+2−2
@@ -1088,7 +1088,7 @@ static void iwl_mvm_rx_mq(struct iwl_op_mode *op_mode, · 1087 unmodified lines
10881088 iwl_mvm_rx_mpdu_mq(mvm, napi, rxb, 0);
10891089 else if (unlikely(cmd == WIDE_ID(DATA_PATH_GROUP,
10901090 RX_QUEUES_NOTIFICATION)))
1091− iwl_mvm_rx_queue_notif(mvm, rxb, 0);
1091+ iwl_mvm_rx_queue_notif(mvm, napi, rxb, 0);
10921092 else if (cmd == WIDE_ID(LEGACY_GROUP, FRAME_RELEASE))
10931093 iwl_mvm_rx_frame_release(mvm, napi, rxb, 0);
10941094 else if (cmd == WIDE_ID(DATA_PATH_GROUP, RX_NO_DATA_NOTIF))
@@ -1812,7 +1812,7 @@ static void iwl_mvm_rx_mq_rss(struct iwl_op_mode *op_mode, · 717 unmodified lines
18121812 iwl_mvm_rx_frame_release(mvm, napi, rxb, queue);
18131813 else if (unlikely(cmd == WIDE_ID(DATA_PATH_GROUP,
18141814 RX_QUEUES_NOTIFICATION)))
1815− iwl_mvm_rx_queue_notif(mvm, rxb, queue);
1815+ iwl_mvm_rx_queue_notif(mvm, napi, rxb, queue);
18161816 else if (likely(cmd == WIDE_ID(LEGACY_GROUP, REPLY_RX_MPDU_CMD)))
18171817 iwl_mvm_rx_mpdu_mq(mvm, napi, rxb, queue);
18181818 }
drivers/net/wireless/intel/iwlwifi/mvm/rs.c+289−250
@@ -1197,239 +1197,6 @@ static u8 rs_get_tid(struct ieee80211_hdr *hdr) · 1196 unmodified lines
11971197 return tid;
11981198 }
11991199
1200−void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
1201− int tid, struct ieee80211_tx_info *info, bool ndp)
1202−{
1203− int legacy_success;
1204− int retries;
1205− int i;
1206− struct iwl_lq_cmd *table;
1207− u32 lq_hwrate;
1208− struct rs_rate lq_rate, tx_resp_rate;
1209− struct iwl_scale_tbl_info *curr_tbl, *other_tbl, *tmp_tbl;
1210− u32 tlc_info = (uintptr_t)info->status.status_driver_data[0];
1211− u8 reduced_txp = tlc_info & RS_DRV_DATA_TXP_MSK;
1212− u8 lq_color = RS_DRV_DATA_LQ_COLOR_GET(tlc_info);
1213− u32 tx_resp_hwrate = (uintptr_t)info->status.status_driver_data[1];
1214− struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
1215− struct iwl_lq_sta *lq_sta = &mvmsta->lq_sta.rs_drv;
1216−
1217− /* Treat uninitialized rate scaling data same as non-existing. */
1218− if (!lq_sta) {
1219− IWL_DEBUG_RATE(mvm, "Station rate scaling not created yet.\n");
1220− return;
1221− } else if (!lq_sta->pers.drv) {
1222− IWL_DEBUG_RATE(mvm, "Rate scaling not initialized yet.\n");
1223− return;
1224− }
1225−
1226− /* This packet was aggregated but doesn't carry status info */
1227− if ((info->flags & IEEE80211_TX_CTL_AMPDU) &&
1228− !(info->flags & IEEE80211_TX_STAT_AMPDU))
1229− return;
1230−
1231− if (rs_rate_from_ucode_rate(tx_resp_hwrate, info->band,
1232− &tx_resp_rate)) {
1233− WARN_ON_ONCE(1);
1234− return;
1235− }
1236−
1237−#ifdef CONFIG_MAC80211_DEBUGFS
1238− /* Disable last tx check if we are debugging with fixed rate but
1239− * update tx stats */
1240− if (lq_sta->pers.dbg_fixed_rate) {
1241− int index = tx_resp_rate.index;
1242− enum rs_column column;
1243− int attempts, success;
1244−
1245− column = rs_get_column_from_rate(&tx_resp_rate);
1246− if (WARN_ONCE(column == RS_COLUMN_INVALID,
1247− "Can't map rate 0x%x to column",
1248− tx_resp_hwrate))
1249− return;
1250−
1251− if (info->flags & IEEE80211_TX_STAT_AMPDU) {
1252− attempts = info->status.ampdu_len;
1253− success = info->status.ampdu_ack_len;
1254− } else {
1255− attempts = info->status.rates[0].count;
1256− success = !!(info->flags & IEEE80211_TX_STAT_ACK);
1257− }
1258−
1259− lq_sta->pers.tx_stats[column][index].total += attempts;
1260− lq_sta->pers.tx_stats[column][index].success += success;
1261−
1262− IWL_DEBUG_RATE(mvm, "Fixed rate 0x%x success %d attempts %d\n",
1263− tx_resp_hwrate, success, attempts);
1264− return;
1265− }
1266−#endif
1267−
1268− if (time_after(jiffies,
1269− (unsigned long)(lq_sta->last_tx +
1270− (IWL_MVM_RS_IDLE_TIMEOUT * HZ)))) {
1271− IWL_DEBUG_RATE(mvm, "Tx idle for too long. reinit rs\n");
1272− iwl_mvm_rs_rate_init(mvm, sta, info->band, true);
1273− return;
1274− }
1275− lq_sta->last_tx = jiffies;
1276−
1277− /* Ignore this Tx frame response if its initial rate doesn't match
1278− * that of latest Link Quality command. There may be stragglers
1279− * from a previous Link Quality command, but we're no longer interested
1280− * in those; they're either from the "active" mode while we're trying
1281− * to check "search" mode, or a prior "search" mode after we've moved
1282− * to a new "search" mode (which might become the new "active" mode).
1283− */
1284− table = &lq_sta->lq;
1285− lq_hwrate = le32_to_cpu(table->rs_table[0]);
1286− if (rs_rate_from_ucode_rate(lq_hwrate, info->band, &lq_rate)) {
1287− WARN_ON_ONCE(1);
1288− return;
1289− }
1290−
1291− /* Here we actually compare this rate to the latest LQ command */
1292− if (lq_color != LQ_FLAG_COLOR_GET(table->flags)) {
1293− IWL_DEBUG_RATE(mvm,
1294− "tx resp color 0x%x does not match 0x%x\n",
1295− lq_color, LQ_FLAG_COLOR_GET(table->flags));
1296−
1297− /*
1298− * Since rates mis-match, the last LQ command may have failed.
1299− * After IWL_MISSED_RATE_MAX mis-matches, resync the uCode with
1300− * ... driver.
1301− */
1302− lq_sta->missed_rate_counter++;
1303− if (lq_sta->missed_rate_counter > IWL_MVM_RS_MISSED_RATE_MAX) {
1304− lq_sta->missed_rate_counter = 0;
1305− IWL_DEBUG_RATE(mvm,
1306− "Too many rates mismatch. Send sync LQ. rs_state %d\n",
1307− lq_sta->rs_state);
1308− iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, false);
1309− }
1310− /* Regardless, ignore this status info for outdated rate */
1311− return;
1312− } else
1313− /* Rate did match, so reset the missed_rate_counter */
1314− lq_sta->missed_rate_counter = 0;
1315−
1316− if (!lq_sta->search_better_tbl) {
1317− curr_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1318− other_tbl = &(lq_sta->lq_info[1 - lq_sta->active_tbl]);
1319− } else {
1320− curr_tbl = &(lq_sta->lq_info[1 - lq_sta->active_tbl]);
1321− other_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1322− }
1323−
1324− if (WARN_ON_ONCE(!rs_rate_column_match(&lq_rate, &curr_tbl->rate))) {
1325− IWL_DEBUG_RATE(mvm,
1326− "Neither active nor search matches tx rate\n");
1327− tmp_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1328− rs_dump_rate(mvm, &tmp_tbl->rate, "ACTIVE");
1329− tmp_tbl = &(lq_sta->lq_info[1 - lq_sta->active_tbl]);
1330− rs_dump_rate(mvm, &tmp_tbl->rate, "SEARCH");
1331− rs_dump_rate(mvm, &lq_rate, "ACTUAL");
1332−
1333− /*
1334− * no matching table found, let's by-pass the data collection
1335− * and continue to perform rate scale to find the rate table
1336− */
1337− rs_stay_in_table(lq_sta, true);
1338− goto done;
1339− }
1340−
1341− /*
1342− * Updating the frame history depends on whether packets were
1343− * aggregated.
1344− *
1345− * For aggregation, all packets were transmitted at the same rate, the
1346− * first index into rate scale table.
1347− */
1348− if (info->flags & IEEE80211_TX_STAT_AMPDU) {
1349− rs_collect_tpc_data(mvm, lq_sta, curr_tbl, tx_resp_rate.index,
1350− info->status.ampdu_len,
1351− info->status.ampdu_ack_len,
1352− reduced_txp);
1353−
1354− /* ampdu_ack_len = 0 marks no BA was received. For TLC, treat
1355− * it as a single frame loss as we don't want the success ratio
1356− * to dip too quickly because a BA wasn't received.
1357− * For TPC, there's no need for this optimisation since we want
1358− * to recover very quickly from a bad power reduction and,
1359− * therefore we'd like the success ratio to get an immediate hit
1360− * when failing to get a BA, so we'd switch back to a lower or
1361− * zero power reduction. When FW transmits agg with a rate
1362− * different from the initial rate, it will not use reduced txp
1363− * and will send BA notification twice (one empty with reduced
1364− * txp equal to the value from LQ and one with reduced txp 0).
1365− * We need to update counters for each txp level accordingly.
1366− */
1367− if (info->status.ampdu_ack_len == 0)
1368− info->status.ampdu_len = 1;
1369−
1370− rs_collect_tlc_data(mvm, mvmsta, tid, curr_tbl, tx_resp_rate.index,
1371− info->status.ampdu_len,
1372− info->status.ampdu_ack_len);
1373−
1374− /* Update success/fail counts if not searching for new mode */
1375− if (lq_sta->rs_state == RS_STATE_STAY_IN_COLUMN) {
1376− lq_sta->total_success += info->status.ampdu_ack_len;
1377− lq_sta->total_failed += (info->status.ampdu_len -
1378− info->status.ampdu_ack_len);
1379− }
1380− } else {
1381− /* For legacy, update frame history with for each Tx retry. */
1382− retries = info->status.rates[0].count - 1;
1383− /* HW doesn't send more than 15 retries */
1384− retries = min(retries, 15);
1385−
1386− /* The last transmission may have been successful */
1387− legacy_success = !!(info->flags & IEEE80211_TX_STAT_ACK);
1388− /* Collect data for each rate used during failed TX attempts */
1389− for (i = 0; i <= retries; ++i) {
1390− lq_hwrate = le32_to_cpu(table->rs_table[i]);
1391− if (rs_rate_from_ucode_rate(lq_hwrate, info->band,
1392− &lq_rate)) {
1393− WARN_ON_ONCE(1);
1394− return;
1395− }
1396−
1397− /*
1398− * Only collect stats if retried rate is in the same RS
1399− * table as active/search.
1400− */
1401− if (rs_rate_column_match(&lq_rate, &curr_tbl->rate))
1402− tmp_tbl = curr_tbl;
1403− else if (rs_rate_column_match(&lq_rate,
1404− &other_tbl->rate))
1405− tmp_tbl = other_tbl;
1406− else
1407− continue;
1408−
1409− rs_collect_tpc_data(mvm, lq_sta, tmp_tbl,
1410− tx_resp_rate.index, 1,
1411− i < retries ? 0 : legacy_success,
1412− reduced_txp);
1413− rs_collect_tlc_data(mvm, mvmsta, tid, tmp_tbl,
1414− tx_resp_rate.index, 1,
1415− i < retries ? 0 : legacy_success);
1416− }
1417−
1418− /* Update success/fail counts if not searching for new mode */
1419− if (lq_sta->rs_state == RS_STATE_STAY_IN_COLUMN) {
1420− lq_sta->total_success += legacy_success;
1421− lq_sta->total_failed += retries + (1 - legacy_success);
1422− }
1423− }
1424− /* The last TX rate is cached in lq_sta; it's set in if/else above */
1425− lq_sta->last_rate_n_flags = lq_hwrate;
1426− IWL_DEBUG_RATE(mvm, "reduced txpower: %d\n", reduced_txp);
1427−done:
1428− /* See if there's a better rate or modulation mode to try. */
1429− if (sta->supp_rates[info->band])
1430− rs_rate_scale_perform(mvm, sta, lq_sta, tid, ndp);
1431−}
1432−
14331200 /*
14341201 * mac80211 sends us Tx status
14351202 */
@@ -1442,8 +1209,9 @@ static void rs_drv_mac80211_tx_status(void *mvm_r, · 6 unmodified lines
14421209 struct iwl_op_mode *op_mode = mvm_r;
14431210 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);
14441211 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1212+ struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
14451213
1446− if (!iwl_mvm_sta_from_mac80211(sta)->vif)
1214+ if (!mvmsta->vif)
14471215 return;
14481216
14491217 if (!ieee80211_is_data(hdr->frame_control) ||
@@ -1584,6 +1352,18 @@ static void rs_set_expected_tpt_table(struct iwl_lq_sta *lq_sta, · 134 unmodified lines
15841352 tbl->expected_tpt = rs_get_expected_tpt_table(lq_sta, column, rate->bw);
15851353 }
15861354
1355+/* rs uses two tables, one is active and the second is for searching better
1356+ * configuration. This function, according to the index of the currently
1357+ * active table returns the search table, which is located at the
1358+ * index complementary to 1 according to the active table (active = 1,
1359+ * search = 0 or active = 0, search = 1).
1360+ * Since lq_info is an arary of size 2, make sure index cannot be out of bounds.
1361+ */
1362+static inline u8 rs_search_tbl(u8 active_tbl)
1363+{
1364+ return (active_tbl ^ 1) & 1;
1365+}
1366+
15871367 static s32 rs_get_best_rate(struct iwl_mvm *mvm,
15881368 struct iwl_lq_sta *lq_sta,
15891369 struct iwl_scale_tbl_info *tbl, /* "search" */
@@ -1794,7 +1574,7 @@ static void rs_update_rate_tbl(struct iwl_mvm *mvm, · 204 unmodified lines
17941574 struct iwl_scale_tbl_info *tbl)
17951575 {
17961576 rs_fill_lq_cmd(mvm, sta, lq_sta, &tbl->rate);
1797− iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, false);
1577+ iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq);
17981578 }
17991579
18001580 static bool rs_tweak_rate_tbl(struct iwl_mvm *mvm,
@@ -1931,9 +1711,9 @@ static int rs_switch_to_column(struct iwl_mvm *mvm, · 130 unmodified lines
19311711 struct ieee80211_sta *sta,
19321712 enum rs_column col_id)
19331713 {
1934− struct iwl_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1714+ struct iwl_scale_tbl_info *tbl = &lq_sta->lq_info[lq_sta->active_tbl];
19351715 struct iwl_scale_tbl_info *search_tbl =
1936− &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]);
1716+ &lq_sta->lq_info[rs_search_tbl(lq_sta->active_tbl)];
19371717 struct rs_rate *rate = &search_tbl->rate;
19381718 const struct rs_tx_column *column = &rs_tx_columns[col_id];
19391719 const struct rs_tx_column *curr_column = &rs_tx_columns[tbl->column];
@@ -2341,7 +2121,7 @@ static void rs_rate_scale_perform(struct iwl_mvm *mvm, · 401 unmodified lines
23412121 if (!lq_sta->search_better_tbl)
23422122 active_tbl = lq_sta->active_tbl;
23432123 else
2344− active_tbl = 1 - lq_sta->active_tbl;
2124+ active_tbl = rs_search_tbl(lq_sta->active_tbl);
23452125
23462126 tbl = &(lq_sta->lq_info[active_tbl]);
23472127 rate = &tbl->rate;
@@ -2565,7 +2345,7 @@ lq_update: · 217 unmodified lines
25652345 /* If new "search" mode was selected, set up in uCode table */
25662346 if (lq_sta->search_better_tbl) {
25672347 /* Access the "search" table, clear its history. */
2568− tbl = &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]);
2348+ tbl = &lq_sta->lq_info[rs_search_tbl(lq_sta->active_tbl)];
25692349 rs_rate_scale_clear_tbl_windows(mvm, tbl);
25702350
25712351 /* Use new "search" start rate */
@@ -2896,7 +2676,7 @@ void rs_update_last_rssi(struct iwl_mvm *mvm, · 324 unmodified lines
28962676 static void rs_initialize_lq(struct iwl_mvm *mvm,
28972677 struct ieee80211_sta *sta,
28982678 struct iwl_lq_sta *lq_sta,
2899− enum nl80211_band band, bool update)
2679+ enum nl80211_band band)
29002680 {
29012681 struct iwl_scale_tbl_info *tbl;
29022682 struct rs_rate *rate;
@@ -2908,7 +2688,7 @@ static void rs_initialize_lq(struct iwl_mvm *mvm, · 5 unmodified lines
29082688 if (!lq_sta->search_better_tbl)
29092689 active_tbl = lq_sta->active_tbl;
29102690 else
2911− active_tbl = 1 - lq_sta->active_tbl;
2691+ active_tbl = rs_search_tbl(lq_sta->active_tbl);
29122692
29132693 tbl = &(lq_sta->lq_info[active_tbl]);
29142694 rate = &tbl->rate;
@@ -2926,7 +2706,7 @@ static void rs_initialize_lq(struct iwl_mvm *mvm, · 11 unmodified lines
29262706 rs_set_expected_tpt_table(lq_sta, tbl);
29272707 rs_fill_lq_cmd(mvm, sta, lq_sta, rate);
29282708 /* TODO restore station should remember the lq cmd */
2929− iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, !update);
2709+ iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq);
29302710 }
29312711
29322712 static void rs_drv_get_rate(void *mvm_r, struct ieee80211_sta *sta,
@@ -3175,7 +2955,7 @@ void iwl_mvm_update_frame_stats(struct iwl_mvm *mvm, u32 rate, bool agg) · 242 unmodified lines
31752955 * Called after adding a new station to initialize rate scaling
31762956 */
31772957 static void rs_drv_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
3178− enum nl80211_band band, bool update)
2958+ enum nl80211_band band)
31792959 {
31802960 int i, j;
31812961 struct ieee80211_hw *hw = mvm->hw;
@@ -3186,6 +2966,8 @@ static void rs_drv_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta, · 4 unmodified lines
31862966 struct ieee80211_supported_band *sband;
31872967 unsigned long supp; /* must be unsigned long for for_each_set_bit */
31882968
2969+ lockdep_assert_held(&mvmsta->lq_sta.rs_drv.pers.lock);
2970+
31892971 /* clear all non-persistent lq data */
31902972 memset(lq_sta, 0, offsetof(typeof(*lq_sta), pers));
31912973
@@ -3255,7 +3037,7 @@ static void rs_drv_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta, · 63 unmodified lines
32553037 #ifdef CONFIG_IWLWIFI_DEBUGFS
32563038 iwl_mvm_reset_frame_stats(mvm);
32573039 #endif
3258− rs_initialize_lq(mvm, sta, lq_sta, band, update);
3040+ rs_initialize_lq(mvm, sta, lq_sta, band);
32593041 }
32603042
32613043 static void rs_drv_rate_update(void *mvm_r,
@@ -3278,6 +3060,258 @@ static void rs_drv_rate_update(void *mvm_r, · 16 unmodified lines
32783060 iwl_mvm_rs_rate_init(mvm, sta, sband->band, true);
32793061 }
32803062
3063+static void __iwl_mvm_rs_tx_status(struct iwl_mvm *mvm,
3064+ struct ieee80211_sta *sta,
3065+ int tid, struct ieee80211_tx_info *info,
3066+ bool ndp)
3067+{
3068+ int legacy_success;
3069+ int retries;
3070+ int i;
3071+ struct iwl_lq_cmd *table;
3072+ u32 lq_hwrate;
3073+ struct rs_rate lq_rate, tx_resp_rate;
3074+ struct iwl_scale_tbl_info *curr_tbl, *other_tbl, *tmp_tbl;
3075+ u32 tlc_info = (uintptr_t)info->status.status_driver_data[0];
3076+ u8 reduced_txp = tlc_info & RS_DRV_DATA_TXP_MSK;
3077+ u8 lq_color = RS_DRV_DATA_LQ_COLOR_GET(tlc_info);
3078+ u32 tx_resp_hwrate = (uintptr_t)info->status.status_driver_data[1];
3079+ struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
3080+ struct iwl_lq_sta *lq_sta = &mvmsta->lq_sta.rs_drv;
3081+
3082+ /* Treat uninitialized rate scaling data same as non-existing. */
3083+ if (!lq_sta) {
3084+ IWL_DEBUG_RATE(mvm, "Station rate scaling not created yet.\n");
3085+ return;
3086+ } else if (!lq_sta->pers.drv) {
3087+ IWL_DEBUG_RATE(mvm, "Rate scaling not initialized yet.\n");
3088+ return;
3089+ }
3090+
3091+ /* This packet was aggregated but doesn't carry status info */
3092+ if ((info->flags & IEEE80211_TX_CTL_AMPDU) &&
3093+ !(info->flags & IEEE80211_TX_STAT_AMPDU))
3094+ return;
3095+
3096+ if (rs_rate_from_ucode_rate(tx_resp_hwrate, info->band,
3097+ &tx_resp_rate)) {
3098+ WARN_ON_ONCE(1);
3099+ return;
3100+ }
3101+
3102+#ifdef CONFIG_MAC80211_DEBUGFS
3103+ /* Disable last tx check if we are debugging with fixed rate but
3104+ * update tx stats
3105+ */
3106+ if (lq_sta->pers.dbg_fixed_rate) {
3107+ int index = tx_resp_rate.index;
3108+ enum rs_column column;
3109+ int attempts, success;
3110+
3111+ column = rs_get_column_from_rate(&tx_resp_rate);
3112+ if (WARN_ONCE(column == RS_COLUMN_INVALID,
3113+ "Can't map rate 0x%x to column",
3114+ tx_resp_hwrate))
3115+ return;
3116+
3117+ if (info->flags & IEEE80211_TX_STAT_AMPDU) {
3118+ attempts = info->status.ampdu_len;
3119+ success = info->status.ampdu_ack_len;
3120+ } else {
3121+ attempts = info->status.rates[0].count;
3122+ success = !!(info->flags & IEEE80211_TX_STAT_ACK);
3123+ }
3124+
3125+ lq_sta->pers.tx_stats[column][index].total += attempts;
3126+ lq_sta->pers.tx_stats[column][index].success += success;
3127+
3128+ IWL_DEBUG_RATE(mvm, "Fixed rate 0x%x success %d attempts %d\n",
3129+ tx_resp_hwrate, success, attempts);
3130+ return;
3131+ }
3132+#endif
3133+
3134+ if (time_after(jiffies,
3135+ (unsigned long)(lq_sta->last_tx +
3136+ (IWL_MVM_RS_IDLE_TIMEOUT * HZ)))) {
3137+ IWL_DEBUG_RATE(mvm, "Tx idle for too long. reinit rs\n");
3138+ /* reach here only in case of driver RS, call directly
3139+ * the unlocked version
3140+ */
3141+ rs_drv_rate_init(mvm, sta, info->band);
3142+ return;
3143+ }
3144+ lq_sta->last_tx = jiffies;
3145+
3146+ /* Ignore this Tx frame response if its initial rate doesn't match
3147+ * that of latest Link Quality command. There may be stragglers
3148+ * from a previous Link Quality command, but we're no longer interested
3149+ * in those; they're either from the "active" mode while we're trying
3150+ * to check "search" mode, or a prior "search" mode after we've moved
3151+ * to a new "search" mode (which might become the new "active" mode).
3152+ */
3153+ table = &lq_sta->lq;
3154+ lq_hwrate = le32_to_cpu(table->rs_table[0]);
3155+ if (rs_rate_from_ucode_rate(lq_hwrate, info->band, &lq_rate)) {
3156+ WARN_ON_ONCE(1);
3157+ return;
3158+ }
3159+
3160+ /* Here we actually compare this rate to the latest LQ command */
3161+ if (lq_color != LQ_FLAG_COLOR_GET(table->flags)) {
3162+ IWL_DEBUG_RATE(mvm,
3163+ "tx resp color 0x%x does not match 0x%x\n",
3164+ lq_color, LQ_FLAG_COLOR_GET(table->flags));
3165+
3166+ /* Since rates mis-match, the last LQ command may have failed.
3167+ * After IWL_MISSED_RATE_MAX mis-matches, resync the uCode with
3168+ * ... driver.
3169+ */
3170+ lq_sta->missed_rate_counter++;
3171+ if (lq_sta->missed_rate_counter > IWL_MVM_RS_MISSED_RATE_MAX) {
3172+ lq_sta->missed_rate_counter = 0;
3173+ IWL_DEBUG_RATE(mvm,
3174+ "Too many rates mismatch. Send sync LQ. rs_state %d\n",
3175+ lq_sta->rs_state);
3176+ iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq);
3177+ }
3178+ /* Regardless, ignore this status info for outdated rate */
3179+ return;
3180+ }
3181+
3182+ /* Rate did match, so reset the missed_rate_counter */
3183+ lq_sta->missed_rate_counter = 0;
3184+
3185+ if (!lq_sta->search_better_tbl) {
3186+ curr_tbl = &lq_sta->lq_info[lq_sta->active_tbl];
3187+ other_tbl = &lq_sta->lq_info[rs_search_tbl(lq_sta->active_tbl)];
3188+ } else {
3189+ curr_tbl = &lq_sta->lq_info[rs_search_tbl(lq_sta->active_tbl)];
3190+ other_tbl = &lq_sta->lq_info[lq_sta->active_tbl];
3191+ }
3192+
3193+ if (WARN_ON_ONCE(!rs_rate_column_match(&lq_rate, &curr_tbl->rate))) {
3194+ IWL_DEBUG_RATE(mvm,
3195+ "Neither active nor search matches tx rate\n");
3196+ tmp_tbl = &lq_sta->lq_info[lq_sta->active_tbl];
3197+ rs_dump_rate(mvm, &tmp_tbl->rate, "ACTIVE");
3198+ tmp_tbl = &lq_sta->lq_info[rs_search_tbl(lq_sta->active_tbl)];
3199+ rs_dump_rate(mvm, &tmp_tbl->rate, "SEARCH");
3200+ rs_dump_rate(mvm, &lq_rate, "ACTUAL");
3201+
3202+ /* no matching table found, let's by-pass the data collection
3203+ * and continue to perform rate scale to find the rate table
3204+ */
3205+ rs_stay_in_table(lq_sta, true);
3206+ goto done;
3207+ }
3208+
3209+ /* Updating the frame history depends on whether packets were
3210+ * aggregated.
3211+ *
3212+ * For aggregation, all packets were transmitted at the same rate, the
3213+ * first index into rate scale table.
3214+ */
3215+ if (info->flags & IEEE80211_TX_STAT_AMPDU) {
3216+ rs_collect_tpc_data(mvm, lq_sta, curr_tbl, tx_resp_rate.index,
3217+ info->status.ampdu_len,
3218+ info->status.ampdu_ack_len,
3219+ reduced_txp);
3220+
3221+ /* ampdu_ack_len = 0 marks no BA was received. For TLC, treat
3222+ * it as a single frame loss as we don't want the success ratio
3223+ * to dip too quickly because a BA wasn't received.
3224+ * For TPC, there's no need for this optimisation since we want
3225+ * to recover very quickly from a bad power reduction and,
3226+ * therefore we'd like the success ratio to get an immediate hit
3227+ * when failing to get a BA, so we'd switch back to a lower or
3228+ * zero power reduction. When FW transmits agg with a rate
3229+ * different from the initial rate, it will not use reduced txp
3230+ * and will send BA notification twice (one empty with reduced
3231+ * txp equal to the value from LQ and one with reduced txp 0).
3232+ * We need to update counters for each txp level accordingly.
3233+ */
3234+ if (info->status.ampdu_ack_len == 0)
3235+ info->status.ampdu_len = 1;
3236+
3237+ rs_collect_tlc_data(mvm, mvmsta, tid, curr_tbl,
3238+ tx_resp_rate.index,
3239+ info->status.ampdu_len,
3240+ info->status.ampdu_ack_len);
3241+
3242+ /* Update success/fail counts if not searching for new mode */
3243+ if (lq_sta->rs_state == RS_STATE_STAY_IN_COLUMN) {
3244+ lq_sta->total_success += info->status.ampdu_ack_len;
3245+ lq_sta->total_failed += (info->status.ampdu_len -
3246+ info->status.ampdu_ack_len);
3247+ }
3248+ } else {
3249+ /* For legacy, update frame history with for each Tx retry. */
3250+ retries = info->status.rates[0].count - 1;
3251+ /* HW doesn't send more than 15 retries */
3252+ retries = min(retries, 15);
3253+
3254+ /* The last transmission may have been successful */
3255+ legacy_success = !!(info->flags & IEEE80211_TX_STAT_ACK);
3256+ /* Collect data for each rate used during failed TX attempts */
3257+ for (i = 0; i <= retries; ++i) {
3258+ lq_hwrate = le32_to_cpu(table->rs_table[i]);
3259+ if (rs_rate_from_ucode_rate(lq_hwrate, info->band,
3260+ &lq_rate)) {
3261+ WARN_ON_ONCE(1);
3262+ return;
3263+ }
3264+
3265+ /* Only collect stats if retried rate is in the same RS
3266+ * table as active/search.
3267+ */
3268+ if (rs_rate_column_match(&lq_rate, &curr_tbl->rate))
3269+ tmp_tbl = curr_tbl;
3270+ else if (rs_rate_column_match(&lq_rate,
3271+ &other_tbl->rate))
3272+ tmp_tbl = other_tbl;
3273+ else
3274+ continue;
3275+
3276+ rs_collect_tpc_data(mvm, lq_sta, tmp_tbl,
3277+ tx_resp_rate.index, 1,
3278+ i < retries ? 0 : legacy_success,
3279+ reduced_txp);
3280+ rs_collect_tlc_data(mvm, mvmsta, tid, tmp_tbl,
3281+ tx_resp_rate.index, 1,
3282+ i < retries ? 0 : legacy_success);
3283+ }
3284+
3285+ /* Update success/fail counts if not searching for new mode */
3286+ if (lq_sta->rs_state == RS_STATE_STAY_IN_COLUMN) {
3287+ lq_sta->total_success += legacy_success;
3288+ lq_sta->total_failed += retries + (1 - legacy_success);
3289+ }
3290+ }
3291+ /* The last TX rate is cached in lq_sta; it's set in if/else above */
3292+ lq_sta->last_rate_n_flags = lq_hwrate;
3293+ IWL_DEBUG_RATE(mvm, "reduced txpower: %d\n", reduced_txp);
3294+done:
3295+ /* See if there's a better rate or modulation mode to try. */
3296+ if (sta->supp_rates[info->band])
3297+ rs_rate_scale_perform(mvm, sta, lq_sta, tid, ndp);
3298+}
3299+
3300+void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
3301+ int tid, struct ieee80211_tx_info *info, bool ndp)
3302+{
3303+ struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
3304+
3305+ /* If it's locked we are in middle of init flow
3306+ * just wait for next tx status to update the lq_sta data
3307+ */
3308+ if (!spin_trylock(&mvmsta->lq_sta.rs_drv.pers.lock))
3309+ return;
3310+
3311+ __iwl_mvm_rs_tx_status(mvm, sta, tid, info, ndp);
3312+ spin_unlock(&mvmsta->lq_sta.rs_drv.pers.lock);
3313+}
3314+
32813315 #ifdef CONFIG_MAC80211_DEBUGFS
32823316 static void rs_build_rates_table_from_fixed(struct iwl_mvm *mvm,
32833317 struct iwl_lq_cmd *lq_cmd,
@@ -3569,7 +3603,7 @@ static void rs_set_lq_ss_params(struct iwl_mvm *mvm, · 285 unmodified lines
35693603
35703604 bfersta_ss_params &= ~LQ_SS_BFER_ALLOWED;
35713605 bfersta_lq_cmd->ss_params = cpu_to_le32(bfersta_ss_params);
3572− iwl_mvm_send_lq_cmd(mvm, bfersta_lq_cmd, false);
3606+ iwl_mvm_send_lq_cmd(mvm, bfersta_lq_cmd);
35733607
35743608 ss_params |= LQ_SS_BFER_ALLOWED;
35753609 IWL_DEBUG_RATE(mvm,
@@ -3735,7 +3769,7 @@ static void rs_program_fix_rate(struct iwl_mvm *mvm, · 159 unmodified lines
37353769
37363770 if (lq_sta->pers.dbg_fixed_rate) {
37373771 rs_fill_lq_cmd(mvm, NULL, lq_sta, NULL);
3738− iwl_mvm_send_lq_cmd(lq_sta->pers.drv, &lq_sta->lq, false);
3772+ iwl_mvm_send_lq_cmd(lq_sta->pers.drv, &lq_sta->lq);
37393773 }
37403774 }
37413775
@@ -4132,10 +4166,15 @@ static const struct rate_control_ops rs_mvm_ops_drv = { · 390 unmodified lines
41324166 void iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
41334167 enum nl80211_band band, bool update)
41344168 {
4135− if (iwl_mvm_has_tlc_offload(mvm))
4169+ if (iwl_mvm_has_tlc_offload(mvm)) {
41364170 rs_fw_rate_init(mvm, sta, band, update);
4137− else
4138− rs_drv_rate_init(mvm, sta, band, update);
4171+ } else {
4172+ struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
4173+
4174+ spin_lock(&mvmsta->lq_sta.rs_drv.pers.lock);
4175+ rs_drv_rate_init(mvm, sta, band);
4176+ spin_unlock(&mvmsta->lq_sta.rs_drv.pers.lock);
4177+ }
41394178 }
41404179
41414180 int iwl_mvm_rate_control_register(void)
@@ -4165,7 +4204,7 @@ static int rs_drv_tx_protection(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, · 23 unmodified lines
41654204 lq->flags &= ~LQ_FLAG_USE_RTS_MSK;
41664205 }
41674206
4168− return iwl_mvm_send_lq_cmd(mvm, lq, false);
4207+ return iwl_mvm_send_lq_cmd(mvm, lq);
41694208 }
41704209
41714210 /**
drivers/net/wireless/intel/iwlwifi/mvm/rs.h+2−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
55 * Copyright(c) 2015 Intel Mobile Communications GmbH
66 * Copyright(c) 2017 Intel Deutschland GmbH
7− * Copyright(c) 2018 Intel Corporation
7+ * Copyright(c) 2018 - 2019 Intel Corporation
88 *
99 * Contact Information:
1010 * Intel Linux Wireless <linuxwifi@intel.com>
@@ -390,6 +390,7 @@ struct iwl_lq_sta { · 379 unmodified lines
390390 s8 last_rssi;
391391 struct rs_rate_stats tx_stats[RS_COLUMN_COUNT][IWL_RATE_COUNT];
392392 struct iwl_mvm *drv;
393+ spinlock_t lock; /* for races in reinit/update table */
393394 } pers;
394395 };
395396
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c+134−51
@@ -463,20 +463,22 @@ static bool iwl_mvm_is_dup(struct ieee80211_sta *sta, int queue, · 462 unmodified lines
463463 }
464464
465465 int iwl_mvm_notify_rx_queue(struct iwl_mvm *mvm, u32 rxq_mask,
466− const u8 *data, u32 count)
466+ const u8 *data, u32 count, bool async)
467467 {
468− struct iwl_rxq_sync_cmd *cmd;
468+ u8 buf[sizeof(struct iwl_rxq_sync_cmd) +
469+ sizeof(struct iwl_mvm_rss_sync_notif)];
470+ struct iwl_rxq_sync_cmd *cmd = (void *)buf;
469471 u32 data_size = sizeof(*cmd) + count;
470472 int ret;
471473
472− /* should be DWORD aligned */
473− if (WARN_ON(count & 3 || count > IWL_MULTI_QUEUE_SYNC_MSG_MAX_SIZE))
474+ /*
475+ * size must be a multiple of DWORD
476+ * Ensure we don't overflow buf
477+ */
478+ if (WARN_ON(count & 3 ||
479+ count > sizeof(struct iwl_mvm_rss_sync_notif)))
474480 return -EINVAL;
475481
476− cmd = kzalloc(data_size, GFP_KERNEL);
477− if (!cmd)
478− return -ENOMEM;
479−
480482 cmd->rxq_mask = cpu_to_le32(rxq_mask);
481483 cmd->count = cpu_to_le32(count);
482484 cmd->flags = 0;
@@ -485,9 +487,8 @@ int iwl_mvm_notify_rx_queue(struct iwl_mvm *mvm, u32 rxq_mask, · 2 unmodified lines
485487 ret = iwl_mvm_send_cmd_pdu(mvm,
486488 WIDE_ID(DATA_PATH_GROUP,
487489 TRIGGER_RX_QUEUES_NOTIF_CMD),
488− 0, data_size, cmd);
490+ async ? CMD_ASYNC : 0, data_size, cmd);
489491
490− kfree(cmd);
491492 return ret;
492493 }
493494
@@ -503,14 +504,31 @@ static bool iwl_mvm_is_sn_less(u16 sn1, u16 sn2, u16 buffer_size) · 9 unmodified lines
503504 !ieee80211_sn_less(sn1, sn2 - buffer_size);
504505 }
505506
507+static void iwl_mvm_sync_nssn(struct iwl_mvm *mvm, u8 baid, u16 nssn)
508+{
509+ struct iwl_mvm_rss_sync_notif notif = {
510+ .metadata.type = IWL_MVM_RXQ_NSSN_SYNC,
511+ .metadata.sync = 0,
512+ .nssn_sync.baid = baid,
513+ .nssn_sync.nssn = nssn,
514+ };
515+
516+ iwl_mvm_sync_rx_queues_internal(mvm, (void *)&notif, sizeof(notif));
517+}
518+
506519 #define RX_REORDER_BUF_TIMEOUT_MQ (HZ / 10)
507520
521+enum iwl_mvm_release_flags {
522+ IWL_MVM_RELEASE_SEND_RSS_SYNC = BIT(0),
523+ IWL_MVM_RELEASE_FROM_RSS_SYNC = BIT(1),
524+};
525+
508526 static void iwl_mvm_release_frames(struct iwl_mvm *mvm,
509527 struct ieee80211_sta *sta,
510528 struct napi_struct *napi,
511529 struct iwl_mvm_baid_data *baid_data,
512530 struct iwl_mvm_reorder_buffer *reorder_buf,
513− u16 nssn)
531+ u16 nssn, u32 flags)
514532 {
515533 struct iwl_mvm_reorder_buf_entry *entries =
516534 &baid_data->entries[reorder_buf->queue *
@@ -519,6 +537,18 @@ static void iwl_mvm_release_frames(struct iwl_mvm *mvm, · 2 unmodified lines
519537
520538 lockdep_assert_held(&reorder_buf->lock);
521539
540+ /*
541+ * We keep the NSSN not too far behind, if we are sync'ing it and it
542+ * is more than 2048 ahead of us, it must be behind us. Discard it.
543+ * This can happen if the queue that hit the 0 / 2048 seqno was lagging
544+ * behind and this queue already processed packets. The next if
545+ * would have caught cases where this queue would have processed less
546+ * than 64 packets, but it may have processed more than 64 packets.
547+ */
548+ if ((flags & IWL_MVM_RELEASE_FROM_RSS_SYNC) &&
549+ ieee80211_sn_less(nssn, ssn))
550+ goto set_timer;
551+
522552 /* ignore nssn smaller than head sn - this can happen due to timeout */
523553 if (iwl_mvm_is_sn_less(nssn, ssn, reorder_buf->buf_size))
524554 goto set_timer;
@@ -529,6 +559,9 @@ static void iwl_mvm_release_frames(struct iwl_mvm *mvm, · 4 unmodified lines
529559 struct sk_buff *skb;
530560
531561 ssn = ieee80211_sn_inc(ssn);
562+ if ((flags & IWL_MVM_RELEASE_SEND_RSS_SYNC) &&
563+ (ssn == 2048 || ssn == 0))
564+ iwl_mvm_sync_nssn(mvm, baid_data->baid, ssn);
532565
533566 /*
534567 * Empty the list. Will have more than one frame for A-MSDU.
@@ -615,7 +648,8 @@ void iwl_mvm_reorder_timer_expired(struct timer_list *t) · 80 unmodified lines
615648 sta_id, sn);
616649 iwl_mvm_event_frame_timeout_callback(buf->mvm, mvmsta->vif,
617650 sta, baid_data->tid);
618− iwl_mvm_release_frames(buf->mvm, sta, NULL, baid_data, buf, sn);
651+ iwl_mvm_release_frames(buf->mvm, sta, NULL, baid_data,
652+ buf, sn, IWL_MVM_RELEASE_SEND_RSS_SYNC);
619653 rcu_read_unlock();
620654 } else {
621655 /*
@@ -657,7 +691,8 @@ static void iwl_mvm_del_ba(struct iwl_mvm *mvm, int queue, · 35 unmodified lines
657691 spin_lock_bh(&reorder_buf->lock);
658692 iwl_mvm_release_frames(mvm, sta, NULL, ba_data, reorder_buf,
659693 ieee80211_sn_add(reorder_buf->head_sn,
660− reorder_buf->buf_size));
694+ reorder_buf->buf_size),
695+ 0);
661696 spin_unlock_bh(&reorder_buf->lock);
662697 del_timer_sync(&reorder_buf->reorder_timer);
663698
@@ -665,8 +700,54 @@ out: · 1 unmodified line
665700 rcu_read_unlock();
666701 }
667702
668−void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
669− int queue)
703+static void iwl_mvm_release_frames_from_notif(struct iwl_mvm *mvm,
704+ struct napi_struct *napi,
705+ u8 baid, u16 nssn, int queue,
706+ u32 flags)
707+{
708+ struct ieee80211_sta *sta;
709+ struct iwl_mvm_reorder_buffer *reorder_buf;
710+ struct iwl_mvm_baid_data *ba_data;
711+
712+ IWL_DEBUG_HT(mvm, "Frame release notification for BAID %u, NSSN %d\n",
713+ baid, nssn);
714+
715+ if (WARN_ON_ONCE(baid == IWL_RX_REORDER_DATA_INVALID_BAID ||
716+ baid >= ARRAY_SIZE(mvm->baid_map)))
717+ return;
718+
719+ rcu_read_lock();
720+
721+ ba_data = rcu_dereference(mvm->baid_map[baid]);
722+ if (WARN_ON_ONCE(!ba_data))
723+ goto out;
724+
725+ sta = rcu_dereference(mvm->fw_id_to_mac_id[ba_data->sta_id]);
726+ if (WARN_ON_ONCE(IS_ERR_OR_NULL(sta)))
727+ goto out;
728+
729+ reorder_buf = &ba_data->reorder_buf[queue];
730+
731+ spin_lock_bh(&reorder_buf->lock);
732+ iwl_mvm_release_frames(mvm, sta, napi, ba_data,
733+ reorder_buf, nssn, flags);
734+ spin_unlock_bh(&reorder_buf->lock);
735+
736+out:
737+ rcu_read_unlock();
738+}
739+
740+static void iwl_mvm_nssn_sync(struct iwl_mvm *mvm,
741+ struct napi_struct *napi, int queue,
742+ const struct iwl_mvm_nssn_sync_data *data)
743+{
744+ iwl_mvm_release_frames_from_notif(mvm, napi, data->baid,
745+ data->nssn, queue,
746+ IWL_MVM_RELEASE_FROM_RSS_SYNC);
747+}
748+
749+void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct napi_struct *napi,
750+ struct iwl_rx_cmd_buffer *rxb, int queue)
670751 {
671752 struct iwl_rx_packet *pkt = rxb_addr(rxb);
672753 struct iwl_rxq_sync_notification *notif;
@@ -687,6 +768,10 @@ void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb, · 14 unmodified lines
687768 case IWL_MVM_RXQ_NOTIF_DEL_BA:
688769 iwl_mvm_del_ba(mvm, queue, (void *)internal_notif->data);
689770 break;
771+ case IWL_MVM_RXQ_NSSN_SYNC:
772+ iwl_mvm_nssn_sync(mvm, napi, queue,
773+ (void *)internal_notif->data);
774+ break;
690775 default:
691776 WARN_ONCE(1, "Invalid identifier %d", internal_notif->type);
692777 }
@@ -785,7 +870,8 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm, · 92 unmodified lines
785870 }
786871
787872 if (ieee80211_is_back_req(hdr->frame_control)) {
788− iwl_mvm_release_frames(mvm, sta, napi, baid_data, buffer, nssn);
873+ iwl_mvm_release_frames(mvm, sta, napi, baid_data,
874+ buffer, nssn, 0);
789875 goto drop;
790876 }
791877
@@ -794,7 +880,10 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm, · 2 unmodified lines
794880 * If the SN is smaller than the NSSN it might need to first go into
795881 * the reorder buffer, in which case we just release up to it and the
796882 * rest of the function will take care of storing it and releasing up to
797− * the nssn
883+ * the nssn.
884+ * This should not happen. This queue has been lagging and it should
885+ * have been updated by a IWL_MVM_RXQ_NSSN_SYNC notification. Be nice
886+ * and update the other queues.
798887 */
799888 if (!iwl_mvm_is_sn_less(nssn, buffer->head_sn + buffer->buf_size,
800889 buffer->buf_size) ||
@@ -802,7 +891,7 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm, · 1 unmodified line
802891 u16 min_sn = ieee80211_sn_less(sn, nssn) ? sn : nssn;
803892
804893 iwl_mvm_release_frames(mvm, sta, napi, baid_data, buffer,
805− min_sn);
894+ min_sn, IWL_MVM_RELEASE_SEND_RSS_SYNC);
806895 }
807896
808897 /* drop any oudated packets */
@@ -813,8 +902,23 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm, · 4 unmodified lines
813902 if (!buffer->num_stored && ieee80211_sn_less(sn, nssn)) {
814903 if (iwl_mvm_is_sn_less(buffer->head_sn, nssn,
815904 buffer->buf_size) &&
816− (!amsdu || last_subframe))
905+ (!amsdu || last_subframe)) {
906+ /*
907+ * If we crossed the 2048 or 0 SN, notify all the
908+ * queues. This is done in order to avoid having a
909+ * head_sn that lags behind for too long. When that
910+ * happens, we can get to a situation where the head_sn
911+ * is within the interval [nssn - buf_size : nssn]
912+ * which will make us think that the nssn is a packet
913+ * that we already freed because of the reordering
914+ * buffer and we will ignore it. So maintain the
915+ * head_sn somewhat updated across all the queues:
916+ * when it crosses 0 and 2048.
917+ */
918+ if (sn == 2048 || sn == 0)
919+ iwl_mvm_sync_nssn(mvm, baid, sn);
817920 buffer->head_sn = nssn;
921+ }
818922 /* No need to update AMSDU last SN - we are moving the head */
819923 spin_unlock_bh(&buffer->lock);
820924 return false;
@@ -829,8 +933,11 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm, · 8 unmodified lines
829933 * while technically there is no hole and we can move forward.
830934 */
831935 if (!buffer->num_stored && sn == buffer->head_sn) {
832− if (!amsdu || last_subframe)
936+ if (!amsdu || last_subframe) {
937+ if (sn == 2048 || sn == 0)
938+ iwl_mvm_sync_nssn(mvm, baid, sn);
833939 buffer->head_sn = ieee80211_sn_inc(buffer->head_sn);
940+ }
834941 /* No need to update AMSDU last SN - we are moving the head */
835942 spin_unlock_bh(&buffer->lock);
836943 return false;
@@ -875,7 +982,9 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm, · 38 unmodified lines
875982 * release notification with up to date NSSN.
876983 */
877984 if (!amsdu || last_subframe)
878− iwl_mvm_release_frames(mvm, sta, napi, baid_data, buffer, nssn);
985+ iwl_mvm_release_frames(mvm, sta, napi, baid_data,
986+ buffer, nssn,
987+ IWL_MVM_RELEASE_SEND_RSS_SYNC);
879988
880989 spin_unlock_bh(&buffer->lock);
881990 return true;
@@ -1840,40 +1949,14 @@ void iwl_mvm_rx_monitor_no_data(struct iwl_mvm *mvm, struct napi_struct *napi, · 958 unmodified lines
18401949 out:
18411950 rcu_read_unlock();
18421951 }
1952+
18431953 void iwl_mvm_rx_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi,
18441954 struct iwl_rx_cmd_buffer *rxb, int queue)
18451955 {
18461956 struct iwl_rx_packet *pkt = rxb_addr(rxb);
18471957 struct iwl_frame_release *release = (void *)pkt->data;
1848− struct ieee80211_sta *sta;
1849− struct iwl_mvm_reorder_buffer *reorder_buf;
1850− struct iwl_mvm_baid_data *ba_data;
1851−
1852− int baid = release->baid;
1853−
1854− IWL_DEBUG_HT(mvm, "Frame release notification for BAID %u, NSSN %d\n",
1855− release->baid, le16_to_cpu(release->nssn));
18561958
1857− if (WARN_ON_ONCE(baid == IWL_RX_REORDER_DATA_INVALID_BAID))
1858− return;
1859−
1860− rcu_read_lock();
1861−
1862− ba_data = rcu_dereference(mvm->baid_map[baid]);
1863− if (WARN_ON_ONCE(!ba_data))
1864− goto out;
1865−
1866− sta = rcu_dereference(mvm->fw_id_to_mac_id[ba_data->sta_id]);
1867− if (WARN_ON_ONCE(IS_ERR_OR_NULL(sta)))
1868− goto out;
1869−
1870− reorder_buf = &ba_data->reorder_buf[queue];
1871−
1872− spin_lock_bh(&reorder_buf->lock);
1873− iwl_mvm_release_frames(mvm, sta, napi, ba_data, reorder_buf,
1874− le16_to_cpu(release->nssn));
1875− spin_unlock_bh(&reorder_buf->lock);
1876−
1877−out:
1878− rcu_read_unlock();
1959+ iwl_mvm_release_frames_from_notif(mvm, napi, release->baid,
1960+ le16_to_cpu(release->nssn),
1961+ queue, 0);
18791962 }
drivers/net/wireless/intel/iwlwifi/mvm/sta.c+4−2
@@ -1684,6 +1684,8 @@ int iwl_mvm_add_sta(struct iwl_mvm *mvm, · 1683 unmodified lines
16841684 */
16851685 if (iwl_mvm_has_tlc_offload(mvm))
16861686 iwl_mvm_rs_add_sta(mvm, mvm_sta);
1687+ else
1688+ spin_lock_init(&mvm_sta->lq_sta.rs_drv.pers.lock);
16871689
16881690 iwl_mvm_toggle_tx_ant(mvm, &mvm_sta->tx_ant);
16891691
@@ -2421,7 +2423,7 @@ int iwl_mvm_rm_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) · 731 unmodified lines
24212423
24222424 static void iwl_mvm_sync_rxq_del_ba(struct iwl_mvm *mvm, u8 baid)
24232425 {
2424− struct iwl_mvm_delba_notif notif = {
2426+ struct iwl_mvm_rss_sync_notif notif = {
24252427 .metadata.type = IWL_MVM_RXQ_NOTIF_DEL_BA,
24262428 .metadata.sync = 1,
24272429 .delba.baid = baid,
@@ -2972,7 +2974,7 @@ out: · 544 unmodified lines
29722974 IWL_DEBUG_HT(mvm, "Tx aggregation enabled on ra = %pM tid = %d\n",
29732975 sta->addr, tid);
29742976
2975− return iwl_mvm_send_lq_cmd(mvm, &mvmsta->lq_sta.rs_drv.lq, false);
2977+ return iwl_mvm_send_lq_cmd(mvm, &mvmsta->lq_sta.rs_drv.lq);
29762978 }
29772979
29782980 static void iwl_mvm_unreserve_agg_queue(struct iwl_mvm *mvm,
drivers/net/wireless/intel/iwlwifi/mvm/sta.h+10−2
@@ -343,9 +343,17 @@ struct iwl_mvm_delba_data { · 342 unmodified lines
343343 u32 baid;
344344 } __packed;
345345
346−struct iwl_mvm_delba_notif {
346+struct iwl_mvm_nssn_sync_data {
347+ u32 baid;
348+ u32 nssn;
349+} __packed;
350+
351+struct iwl_mvm_rss_sync_notif {
347352 struct iwl_mvm_internal_rxq_notif metadata;
348− struct iwl_mvm_delba_data delba;
353+ union {
354+ struct iwl_mvm_delba_data delba;
355+ struct iwl_mvm_nssn_sync_data nssn_sync;
356+ };
349357 } __packed;
350358
351359 /**
drivers/net/wireless/intel/iwlwifi/mvm/tx.c+2−1
@@ -831,6 +831,7 @@ iwl_mvm_tx_tso_segment(struct sk_buff *skb, unsigned int num_subframes, · 830 unmodified lines
831831 unsigned int tcp_payload_len;
832832 unsigned int mss = skb_shinfo(skb)->gso_size;
833833 bool ipv4 = (skb->protocol == htons(ETH_P_IP));
834+ bool qos = ieee80211_is_data_qos(hdr->frame_control);
834835 u16 ip_base_id = ipv4 ? ntohs(ip_hdr(skb)->id) : 0;
835836
836837 skb_shinfo(skb)->gso_size = num_subframes * mss;
@@ -864,7 +865,7 @@ iwl_mvm_tx_tso_segment(struct sk_buff *skb, unsigned int num_subframes, · 27 unmodified lines
864865 if (tcp_payload_len > mss) {
865866 skb_shinfo(tmp)->gso_size = mss;
866867 } else {
867− if (ieee80211_is_data_qos(hdr->frame_control)) {
868+ if (qos) {
868869 u8 *qc;
869870
870871 if (ipv4)
drivers/net/wireless/intel/iwlwifi/mvm/utils.c+2−2
@@ -653,12 +653,12 @@ int iwl_mvm_reconfig_scd(struct iwl_mvm *mvm, int queue, int fifo, int sta_id, · 652 unmodified lines
653653 * this case to clear the state indicating that station creation is in
654654 * progress.
655655 */
656−int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, bool sync)
656+int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq)
657657 {
658658 struct iwl_host_cmd cmd = {
659659 .id = LQ_CMD,
660660 .len = { sizeof(struct iwl_lq_cmd), },
661− .flags = sync ? 0 : CMD_ASYNC,
661+ .flags = CMD_ASYNC,
662662 .data = { lq, },
663663 };
664664
drivers/net/wireless/intel/iwlwifi/pcie/drv.c+3−0
@@ -604,10 +604,13 @@ static const struct pci_device_id iwl_hw_card_ids[] = { · 603 unmodified lines
604604 {IWL_PCI_DEVICE(0x2526, 0x40A4, iwl9460_2ac_cfg)},
605605 {IWL_PCI_DEVICE(0x2526, 0x4234, iwl9560_2ac_cfg_soc)},
606606 {IWL_PCI_DEVICE(0x2526, 0x42A4, iwl9462_2ac_cfg_soc)},
607+ {IWL_PCI_DEVICE(0x2526, 0x6010, iwl9260_2ac_160_cfg)},
607608 {IWL_PCI_DEVICE(0x2526, 0x6014, iwl9260_2ac_160_cfg)},
608609 {IWL_PCI_DEVICE(0x2526, 0x8014, iwl9260_2ac_160_cfg)},
609610 {IWL_PCI_DEVICE(0x2526, 0x8010, iwl9260_2ac_160_cfg)},
610611 {IWL_PCI_DEVICE(0x2526, 0xA014, iwl9260_2ac_160_cfg)},
612+ {IWL_PCI_DEVICE(0x2526, 0xE010, iwl9260_2ac_160_cfg)},
613+ {IWL_PCI_DEVICE(0x2526, 0xE014, iwl9260_2ac_160_cfg)},
611614 {IWL_PCI_DEVICE(0x271B, 0x0010, iwl9160_2ac_cfg)},
612615 {IWL_PCI_DEVICE(0x271B, 0x0014, iwl9160_2ac_cfg)},
613616 {IWL_PCI_DEVICE(0x271B, 0x0210, iwl9160_2ac_cfg)},
drivers/net/wireless/intel/iwlwifi/pcie/tx.c+2−0
@@ -435,6 +435,8 @@ static void iwl_pcie_tfd_unmap(struct iwl_trans *trans, · 434 unmodified lines
435435 DMA_TO_DEVICE);
436436 }
437437
438+ meta->tbs = 0;
439+
438440 if (trans->cfg->use_tfh) {
439441 struct iwl_tfh_tfd *tfd_fh = (void *)tfd;
440442
drivers/net/wireless/mac80211_hwsim.c+5−3
@@ -3617,10 +3617,12 @@ static int hwsim_dump_radio_nl(struct sk_buff *skb, · 3616 unmodified lines
36173617 hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).portid,
36183618 cb->nlh->nlmsg_seq, &hwsim_genl_family,
36193619 NLM_F_MULTI, HWSIM_CMD_GET_RADIO);
3620− if (!hdr)
3620+ if (hdr) {
3621+ genl_dump_check_consistent(cb, hdr);
3622+ genlmsg_end(skb, hdr);
3623+ } else {
36213624 res = -EMSGSIZE;
3622− genl_dump_check_consistent(cb, hdr);
3623− genlmsg_end(skb, hdr);
3625+ }
36243626 }
36253627
36263628 done:
drivers/net/wireless/marvell/mwifiex/main.h+1−0
@@ -124,6 +124,7 @@ enum { · 123 unmodified lines
124124
125125 #define MWIFIEX_MAX_TOTAL_SCAN_TIME (MWIFIEX_TIMER_10S - MWIFIEX_TIMER_1S)
126126
127+#define WPA_GTK_OUI_OFFSET 2
127128 #define RSN_GTK_OUI_OFFSET 2
128129
129130 #define MWIFIEX_OUI_NOT_PRESENT 0
drivers/net/wireless/marvell/mwifiex/scan.c+2−1
@@ -181,7 +181,8 @@ mwifiex_is_wpa_oui_present(struct mwifiex_bssdescriptor *bss_desc, u32 cipher) · 180 unmodified lines
181181 u8 ret = MWIFIEX_OUI_NOT_PRESENT;
182182
183183 if (has_vendor_hdr(bss_desc->bcn_wpa_ie, WLAN_EID_VENDOR_SPECIFIC)) {
184− iebody = (struct ie_body *) bss_desc->bcn_wpa_ie->data;
184+ iebody = (struct ie_body *)((u8 *)bss_desc->bcn_wpa_ie->data +
185+ WPA_GTK_OUI_OFFSET);
185186 oui = &mwifiex_wpa_oui[cipher][0];
186187 ret = mwifiex_search_oui_in_ie(iebody, oui);
187188 if (ret)
drivers/nfc/nfcmrvl/main.c+2−2
@@ -244,7 +244,7 @@ void nfcmrvl_chip_reset(struct nfcmrvl_private *priv) · 243 unmodified lines
244244 /* Reset possible fault of previous session */
245245 clear_bit(NFCMRVL_PHY_ERROR, &priv->flags);
246246
247− if (priv->config.reset_n_io) {
247+ if (gpio_is_valid(priv->config.reset_n_io)) {
248248 nfc_info(priv->dev, "reset the chip\n");
249249 gpio_set_value(priv->config.reset_n_io, 0);
250250 usleep_range(5000, 10000);
@@ -255,7 +255,7 @@ void nfcmrvl_chip_reset(struct nfcmrvl_private *priv) · 4 unmodified lines
255255
256256 void nfcmrvl_chip_halt(struct nfcmrvl_private *priv)
257257 {
258− if (priv->config.reset_n_io)
258+ if (gpio_is_valid(priv->config.reset_n_io))
259259 gpio_set_value(priv->config.reset_n_io, 0);
260260 }
261261
drivers/nfc/nfcmrvl/uart.c+2−2
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 static unsigned int hci_muxed;
2727 static unsigned int flow_control;
2828 static unsigned int break_control;
29−static unsigned int reset_n_io;
29+static int reset_n_io = -EINVAL;
3030
3131 /*
3232 ** NFCMRVL NCI OPS
@@ -231,5 +231,5 @@ MODULE_PARM_DESC(break_control, "Tell if UART driver must drive break signal."); · 198 unmodified lines
231231 module_param(hci_muxed, uint, 0);
232232 MODULE_PARM_DESC(hci_muxed, "Tell if transport is muxed in HCI one.");
233233
234−module_param(reset_n_io, uint, 0);
234+module_param(reset_n_io, int, 0);
235235 MODULE_PARM_DESC(reset_n_io, "GPIO that is wired to RESET_N signal.");
drivers/nfc/nfcmrvl/usb.c+1−0
@@ -305,6 +305,7 @@ static int nfcmrvl_probe(struct usb_interface *intf, · 304 unmodified lines
305305
306306 /* No configuration for USB */
307307 memset(&config, 0, sizeof(config));
308+ config.reset_n_io = -EINVAL;
308309
309310 nfc_info(&udev->dev, "intf %p id %p\n", intf, id);
310311
drivers/nfc/st-nci/se.c+2−0
@@ -333,6 +333,8 @@ static int st_nci_hci_connectivity_event_received(struct nci_dev *ndev, · 332 unmodified lines
333333
334334 transaction = (struct nfc_evt_transaction *)devm_kzalloc(dev,
335335 skb->len - 2, GFP_KERNEL);
336+ if (!transaction)
337+ return -ENOMEM;
336338
337339 transaction->aid_len = skb->data[1];
338340 memcpy(transaction->aid, &skb->data[2], transaction->aid_len);
drivers/nfc/st21nfca/se.c+2−0
@@ -317,6 +317,8 @@ int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host, · 316 unmodified lines
317317
318318 transaction = (struct nfc_evt_transaction *)devm_kzalloc(dev,
319319 skb->len - 2, GFP_KERNEL);
320+ if (!transaction)
321+ return -ENOMEM;
320322
321323 transaction->aid_len = skb->data[1];
322324 memcpy(transaction->aid, &skb->data[2],
drivers/ntb/msi.c+0−5
@@ -6,11 +6,6 @@ · 5 unmodified lines
66 #include <linux/msi.h>
77 #include <linux/pci.h>
88
9−MODULE_LICENSE("Dual BSD/GPL");
10−MODULE_VERSION("0.1");
11−MODULE_AUTHOR("Logan Gunthorpe <logang@deltatee.com>");
12−MODULE_DESCRIPTION("NTB MSI Interrupt Library");
13−
149 struct ntb_msi {
1510 u64 base_addr;
1611 u64 end_addr;
drivers/nvmem/nvmem-sysfs.c+11−4
@@ -224,10 +224,17 @@ int nvmem_sysfs_setup_compat(struct nvmem_device *nvmem, · 223 unmodified lines
224224 if (!config->base_dev)
225225 return -EINVAL;
226226
227− if (nvmem->read_only)
228− nvmem->eeprom = bin_attr_ro_root_nvmem;
229− else
230− nvmem->eeprom = bin_attr_rw_root_nvmem;
227+ if (nvmem->read_only) {
228+ if (config->root_only)
229+ nvmem->eeprom = bin_attr_ro_root_nvmem;
230+ else
231+ nvmem->eeprom = bin_attr_ro_nvmem;
232+ } else {
233+ if (config->root_only)
234+ nvmem->eeprom = bin_attr_rw_root_nvmem;
235+ else
236+ nvmem->eeprom = bin_attr_rw_nvmem;
237+ }
231238 nvmem->eeprom.attr.name = "eeprom";
232239 nvmem->eeprom.size = nvmem->size;
233240 #ifdef CONFIG_DEBUG_LOCK_ALLOC
drivers/pci/pci.c+10−19
@@ -1025,10 +1025,15 @@ static void __pci_start_power_transition(struct pci_dev *dev, pci_power_t state) · 1024 unmodified lines
10251025 if (state == PCI_D0) {
10261026 pci_platform_power_transition(dev, PCI_D0);
10271027 /*
1028− * Mandatory power management transition delays are
1029− * handled in the PCIe portdrv resume hooks.
1028+ * Mandatory power management transition delays, see
1029+ * PCI Express Base Specification Revision 2.0 Section
1030+ * 6.6.1: Conventional Reset. Do not delay for
1031+ * devices powered on/off by corresponding bridge,
1032+ * because have already delayed for the bridge.
10301033 */
10311034 if (dev->runtime_d3cold) {
1035+ if (dev->d3cold_delay && !dev->imm_ready)
1036+ msleep(dev->d3cold_delay);
10321037 /*
10331038 * When powering on a bridge from D3cold, the
10341039 * whole hierarchy may be powered on into
@@ -4602,16 +4607,14 @@ static int pci_pm_reset(struct pci_dev *dev, int probe) · 3567 unmodified lines
46024607
46034608 return pci_dev_wait(dev, "PM D3->D0", PCIE_RESET_READY_POLL_MS);
46044609 }
4605−
46064610 /**
4607− * pcie_wait_for_link_delay - Wait until link is active or inactive
4611+ * pcie_wait_for_link - Wait until link is active or inactive
46084612 * @pdev: Bridge device
46094613 * @active: waiting for active or inactive?
4610− * @delay: Delay to wait after link has become active (in ms)
46114614 *
46124615 * Use this to wait till link becomes active or inactive.
46134616 */
4614−bool pcie_wait_for_link_delay(struct pci_dev *pdev, bool active, int delay)
4617+bool pcie_wait_for_link(struct pci_dev *pdev, bool active)
46154618 {
46164619 int timeout = 1000;
46174620 bool ret;
@@ -4648,25 +4651,13 @@ bool pcie_wait_for_link_delay(struct pci_dev *pdev, bool active, int delay) · 30 unmodified lines
46484651 timeout -= 10;
46494652 }
46504653 if (active && ret)
4651− msleep(delay);
4654+ msleep(100);
46524655 else if (ret != active)
46534656 pci_info(pdev, "Data Link Layer Link Active not %s in 1000 msec\n",
46544657 active ? "set" : "cleared");
46554658 return ret == active;
46564659 }
46574660
4658−/**
4659− * pcie_wait_for_link - Wait until link is active or inactive
4660− * @pdev: Bridge device
4661− * @active: waiting for active or inactive?
4662− *
4663− * Use this to wait till link becomes active or inactive.
4664− */
4665−bool pcie_wait_for_link(struct pci_dev *pdev, bool active)
4666−{
4667− return pcie_wait_for_link_delay(pdev, active, 100);
4668−}
4669−
46704661 void pci_reset_secondary_bus(struct pci_dev *dev)
46714662 {
46724663 u16 ctrl;
drivers/pci/pci.h+0−1
@@ -497,7 +497,6 @@ static inline int pci_dev_specific_disable_acs_redir(struct pci_dev *dev) · 496 unmodified lines
497497 void pcie_do_recovery(struct pci_dev *dev, enum pci_channel_state state,
498498 u32 service);
499499
500−bool pcie_wait_for_link_delay(struct pci_dev *pdev, bool active, int delay);
501500 bool pcie_wait_for_link(struct pci_dev *pdev, bool active);
502501 #ifdef CONFIG_PCIEASPM
503502 void pcie_aspm_init_link_state(struct pci_dev *pdev);
drivers/pci/pcie/portdrv_core.c+0−66
@@ -9,7 +9,6 @@ · 8 unmodified lines
99 #include <linux/module.h>
1010 #include <linux/pci.h>
1111 #include <linux/kernel.h>
12−#include <linux/delay.h>
1312 #include <linux/errno.h>
1413 #include <linux/pm.h>
1514 #include <linux/pm_runtime.h>
@@ -379,67 +378,6 @@ static int pm_iter(struct device *dev, void *data) · 363 unmodified lines
379378 return 0;
380379 }
381380
382−static int get_downstream_delay(struct pci_bus *bus)
383−{
384− struct pci_dev *pdev;
385− int min_delay = 100;
386− int max_delay = 0;
387−
388− list_for_each_entry(pdev, &bus->devices, bus_list) {
389− if (!pdev->imm_ready)
390− min_delay = 0;
391− else if (pdev->d3cold_delay < min_delay)
392− min_delay = pdev->d3cold_delay;
393− if (pdev->d3cold_delay > max_delay)
394− max_delay = pdev->d3cold_delay;
395− }
396−
397− return max(min_delay, max_delay);
398−}
399−
400−/*
401− * wait_for_downstream_link - Wait for downstream link to establish
402− * @pdev: PCIe port whose downstream link is waited
403− *
404− * Handle delays according to PCIe 4.0 section 6.6.1 before configuration
405− * access to the downstream component is permitted.
406− *
407− * This blocks PCI core resume of the hierarchy below this port until the
408− * link is trained. Should be called before resuming port services to
409− * prevent pciehp from starting to tear-down the hierarchy too soon.
410− */
411−static void wait_for_downstream_link(struct pci_dev *pdev)
412−{
413− int delay;
414−
415− if (pci_pcie_type(pdev) != PCI_EXP_TYPE_ROOT_PORT &&
416− pci_pcie_type(pdev) != PCI_EXP_TYPE_DOWNSTREAM)
417− return;
418−
419− if (pci_dev_is_disconnected(pdev))
420− return;
421−
422− if (!pdev->subordinate || list_empty(&pdev->subordinate->devices) ||
423− !pdev->bridge_d3)
424− return;
425−
426− delay = get_downstream_delay(pdev->subordinate);
427− if (!delay)
428− return;
429−
430− dev_dbg(&pdev->dev, "waiting downstream link for %d ms\n", delay);
431−
432− /*
433− * If downstream port does not support speeds greater than 5 GT/s
434− * need to wait 100ms. For higher speeds (gen3) we need to wait
435− * first for the data link layer to become active.
436− */
437− if (pcie_get_speed_cap(pdev) <= PCIE_SPEED_5_0GT)
438− msleep(delay);
439− else
440− pcie_wait_for_link_delay(pdev, true, delay);
441−}
442−
443381 /**
444382 * pcie_port_device_suspend - suspend port services associated with a PCIe port
445383 * @dev: PCI Express port to handle
@@ -453,8 +391,6 @@ int pcie_port_device_suspend(struct device *dev) · 7 unmodified lines
453391 int pcie_port_device_resume_noirq(struct device *dev)
454392 {
455393 size_t off = offsetof(struct pcie_port_service_driver, resume_noirq);
456−
457− wait_for_downstream_link(to_pci_dev(dev));
458394 return device_for_each_child(dev, &off, pm_iter);
459395 }
460396
@@ -485,8 +421,6 @@ int pcie_port_device_runtime_suspend(struct device *dev) · 24 unmodified lines
485421 int pcie_port_device_runtime_resume(struct device *dev)
486422 {
487423 size_t off = offsetof(struct pcie_port_service_driver, runtime_resume);
488−
489− wait_for_downstream_link(to_pci_dev(dev));
490424 return device_for_each_child(dev, &off, pm_iter);
491425 }
492426 #endif /* PM */
drivers/pcmcia/db1xxx_ss.c+4−0
@@ -255,8 +255,10 @@ static int db1x_pcmcia_configure(struct pcmcia_socket *skt, · 254 unmodified lines
255255 switch (state->Vcc) {
256256 case 50:
257257 ++v;
258+ /* fall through */
258259 case 33:
259260 ++v;
261+ /* fall through */
260262 case 0:
261263 break;
262264 default:
@@ -267,9 +269,11 @@ static int db1x_pcmcia_configure(struct pcmcia_socket *skt, · 4 unmodified lines
267269 switch (state->Vpp) {
268270 case 12:
269271 ++p;
272+ /* fall through */
270273 case 33:
271274 case 50:
272275 ++p;
276+ /* fall through */
273277 case 0:
274278 break;
275279 default:
drivers/perf/arm_pmu.c+1−1
@@ -723,8 +723,8 @@ static int cpu_pm_pmu_notify(struct notifier_block *b, unsigned long cmd, · 722 unmodified lines
723723 cpu_pm_pmu_setup(armpmu, cmd);
724724 break;
725725 case CPU_PM_EXIT:
726− cpu_pm_pmu_setup(armpmu, cmd);
727726 case CPU_PM_ENTER_FAILED:
727+ cpu_pm_pmu_setup(armpmu, cmd);
728728 armpmu->start(armpmu);
729729 break;
730730 default:
drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c+1−1
@@ -2412,7 +2412,7 @@ static const struct aspeed_pin_config aspeed_g4_configs[] = { · 2411 unmodified lines
24122412 { PIN_CONFIG_INPUT_DEBOUNCE, { C14, B14 }, SCUA8, 27 },
24132413 };
24142414
2415−static int aspeed_g4_sig_expr_set(const struct aspeed_pinmux_data *ctx,
2415+static int aspeed_g4_sig_expr_set(struct aspeed_pinmux_data *ctx,
24162416 const struct aspeed_sig_expr *expr,
24172417 bool enable)
24182418 {
drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c+65−27
@@ -2507,6 +2507,61 @@ static struct aspeed_pin_config aspeed_g5_configs[] = { · 2506 unmodified lines
25072507 { PIN_CONFIG_INPUT_DEBOUNCE, { A20, B19 }, SCUA8, 27 },
25082508 };
25092509
2510+static struct regmap *aspeed_g5_acquire_regmap(struct aspeed_pinmux_data *ctx,
2511+ int ip)
2512+{
2513+ if (ip == ASPEED_IP_SCU) {
2514+ WARN(!ctx->maps[ip], "Missing SCU syscon!");
2515+ return ctx->maps[ip];
2516+ }
2517+
2518+ if (ip >= ASPEED_NR_PINMUX_IPS)
2519+ return ERR_PTR(-EINVAL);
2520+
2521+ if (likely(ctx->maps[ip]))
2522+ return ctx->maps[ip];
2523+
2524+ if (ip == ASPEED_IP_GFX) {
2525+ struct device_node *node;
2526+ struct regmap *map;
2527+
2528+ node = of_parse_phandle(ctx->dev->of_node,
2529+ "aspeed,external-nodes", 0);
2530+ if (node) {
2531+ map = syscon_node_to_regmap(node);
2532+ of_node_put(node);
2533+ if (IS_ERR(map))
2534+ return map;
2535+ } else
2536+ return ERR_PTR(-ENODEV);
2537+
2538+ ctx->maps[ASPEED_IP_GFX] = map;
2539+ dev_dbg(ctx->dev, "Acquired GFX regmap");
2540+ return map;
2541+ }
2542+
2543+ if (ip == ASPEED_IP_LPC) {
2544+ struct device_node *node;
2545+ struct regmap *map;
2546+
2547+ node = of_parse_phandle(ctx->dev->of_node,
2548+ "aspeed,external-nodes", 1);
2549+ if (node) {
2550+ map = syscon_node_to_regmap(node->parent);
2551+ of_node_put(node);
2552+ if (IS_ERR(map))
2553+ return map;
2554+ } else
2555+ map = ERR_PTR(-ENODEV);
2556+
2557+ ctx->maps[ASPEED_IP_LPC] = map;
2558+ dev_dbg(ctx->dev, "Acquired LPC regmap");
2559+ return map;
2560+ }
2561+
2562+ return ERR_PTR(-EINVAL);
2563+}
2564+
25102565 /**
25112566 * Configure a pin's signal by applying an expression's descriptor state for
25122567 * all descriptors in the expression.
@@ -2520,7 +2575,7 @@ static struct aspeed_pin_config aspeed_g5_configs[] = { · 7 unmodified lines
25202575 * Return: 0 if the expression is configured as requested and a negative error
25212576 * code otherwise
25222577 */
2523−static int aspeed_g5_sig_expr_set(const struct aspeed_pinmux_data *ctx,
2578+static int aspeed_g5_sig_expr_set(struct aspeed_pinmux_data *ctx,
25242579 const struct aspeed_sig_expr *expr,
25252580 bool enable)
25262581 {
@@ -2531,9 +2586,15 @@ static int aspeed_g5_sig_expr_set(const struct aspeed_pinmux_data *ctx, · 4 unmodified lines
25312586 const struct aspeed_sig_desc *desc = &expr->descs[i];
25322587 u32 pattern = enable ? desc->enable : desc->disable;
25332588 u32 val = (pattern << __ffs(desc->mask));
2589+ struct regmap *map;
25342590
2535− if (!ctx->maps[desc->ip])
2536− return -ENODEV;
2591+ map = aspeed_g5_acquire_regmap(ctx, desc->ip);
2592+ if (IS_ERR(map)) {
2593+ dev_err(ctx->dev,
2594+ "Failed to acquire regmap for IP block %d\n",
2595+ desc->ip);
2596+ return PTR_ERR(map);
2597+ }
25372598
25382599 /*
25392600 * Strap registers are configured in hardware or by early-boot
@@ -2641,34 +2702,11 @@ static struct pinctrl_desc aspeed_g5_pinctrl_desc = { · 101 unmodified lines
26412702 static int aspeed_g5_pinctrl_probe(struct platform_device *pdev)
26422703 {
26432704 int i;
2644− struct regmap *map;
2645− struct device_node *node;
26462705
26472706 for (i = 0; i < ARRAY_SIZE(aspeed_g5_pins); i++)
26482707 aspeed_g5_pins[i].number = i;
26492708
2650− node = of_parse_phandle(pdev->dev.of_node, "aspeed,external-nodes", 0);
2651− map = syscon_node_to_regmap(node);
2652− of_node_put(node);
2653− if (IS_ERR(map)) {
2654− dev_warn(&pdev->dev, "No GFX phandle found, some mux configurations may fail\n");
2655− map = NULL;
2656− }
2657− aspeed_g5_pinctrl_data.pinmux.maps[ASPEED_IP_GFX] = map;
2658−
2659− node = of_parse_phandle(pdev->dev.of_node, "aspeed,external-nodes", 1);
2660− if (node) {
2661− map = syscon_node_to_regmap(node->parent);
2662− if (IS_ERR(map)) {
2663− dev_warn(&pdev->dev, "LHC parent is not a syscon, some mux configurations may fail\n");
2664− map = NULL;
2665− }
2666− } else {
2667− dev_warn(&pdev->dev, "No LHC phandle found, some mux configurations may fail\n");
2668− map = NULL;
2669− }
2670− of_node_put(node);
2671− aspeed_g5_pinctrl_data.pinmux.maps[ASPEED_IP_LPC] = map;
2709+ aspeed_g5_pinctrl_data.pinmux.dev = &pdev->dev;
26722710
26732711 return aspeed_pinctrl_probe(pdev, &aspeed_g5_pinctrl_desc,
26742712 &aspeed_g5_pinctrl_data);
drivers/pinctrl/aspeed/pinctrl-aspeed.c+5−7
@@ -71,7 +71,7 @@ int aspeed_pinmux_get_fn_groups(struct pinctrl_dev *pctldev, · 70 unmodified lines
7171 return 0;
7272 }
7373
74−static int aspeed_sig_expr_enable(const struct aspeed_pinmux_data *ctx,
74+static int aspeed_sig_expr_enable(struct aspeed_pinmux_data *ctx,
7575 const struct aspeed_sig_expr *expr)
7676 {
7777 int ret;
@@ -86,7 +86,7 @@ static int aspeed_sig_expr_enable(const struct aspeed_pinmux_data *ctx, · 8 unmodified lines
8686 return 0;
8787 }
8888
89−static int aspeed_sig_expr_disable(const struct aspeed_pinmux_data *ctx,
89+static int aspeed_sig_expr_disable(struct aspeed_pinmux_data *ctx,
9090 const struct aspeed_sig_expr *expr)
9191 {
9292 int ret;
@@ -109,7 +109,7 @@ static int aspeed_sig_expr_disable(const struct aspeed_pinmux_data *ctx, · 16 unmodified lines
109109 *
110110 * Return: 0 if all expressions are disabled, otherwise a negative error code
111111 */
112−static int aspeed_disable_sig(const struct aspeed_pinmux_data *ctx,
112+static int aspeed_disable_sig(struct aspeed_pinmux_data *ctx,
113113 const struct aspeed_sig_expr **exprs)
114114 {
115115 int ret = 0;
@@ -217,8 +217,7 @@ int aspeed_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int function, · 101 unmodified lines
217217 {
218218 int i;
219219 int ret;
220− const struct aspeed_pinctrl_data *pdata =
221− pinctrl_dev_get_drvdata(pctldev);
220+ struct aspeed_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
222221 const struct aspeed_pin_group *pgroup = &pdata->pinmux.groups[group];
223222 const struct aspeed_pin_function *pfunc =
224223 &pdata->pinmux.functions[function];
@@ -306,8 +305,7 @@ int aspeed_gpio_request_enable(struct pinctrl_dev *pctldev, · 81 unmodified lines
306305 unsigned int offset)
307306 {
308307 int ret;
309− const struct aspeed_pinctrl_data *pdata =
310− pinctrl_dev_get_drvdata(pctldev);
308+ struct aspeed_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
311309 const struct aspeed_pin_desc *pdesc = pdata->pins[offset].drv_data;
312310 const struct aspeed_sig_expr ***prios, **funcs, *expr;
313311
drivers/pinctrl/aspeed/pinmux-aspeed.c+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55
66 #include "pinmux-aspeed.h"
77
8−const char *const aspeed_pinmux_ips[] = {
8+static const char *const aspeed_pinmux_ips[] = {
99 [ASPEED_IP_SCU] = "SCU",
1010 [ASPEED_IP_GFX] = "GFX",
1111 [ASPEED_IP_LPC] = "LPC",
drivers/pinctrl/aspeed/pinmux-aspeed.h+3−2
@@ -702,11 +702,12 @@ struct aspeed_pin_function { · 701 unmodified lines
702702 struct aspeed_pinmux_data;
703703
704704 struct aspeed_pinmux_ops {
705− int (*set)(const struct aspeed_pinmux_data *ctx,
705+ int (*set)(struct aspeed_pinmux_data *ctx,
706706 const struct aspeed_sig_expr *expr, bool enabled);
707707 };
708708
709709 struct aspeed_pinmux_data {
710+ struct device *dev;
710711 struct regmap *maps[ASPEED_NR_PINMUX_IPS];
711712
712713 const struct aspeed_pinmux_ops *ops;
@@ -725,7 +726,7 @@ int aspeed_sig_expr_eval(const struct aspeed_pinmux_data *ctx, · 12 unmodified lines
725726 const struct aspeed_sig_expr *expr,
726727 bool enabled);
727728
728−static inline int aspeed_sig_expr_set(const struct aspeed_pinmux_data *ctx,
729+static inline int aspeed_sig_expr_set(struct aspeed_pinmux_data *ctx,
729730 const struct aspeed_sig_expr *expr,
730731 bool enabled)
731732 {
drivers/platform/olpc/olpc-xo175-ec.c+6−0
@@ -736,6 +736,12 @@ static const struct of_device_id olpc_xo175_ec_of_match[] = { · 735 unmodified lines
736736 };
737737 MODULE_DEVICE_TABLE(of, olpc_xo175_ec_of_match);
738738
739+static const struct spi_device_id olpc_xo175_ec_id_table[] = {
740+ { "xo1.75-ec", 0 },
741+ {}
742+};
743+MODULE_DEVICE_TABLE(spi, olpc_xo175_ec_id_table);
744+
739745 static struct spi_driver olpc_xo175_ec_spi_driver = {
740746 .driver = {
741747 .name = "olpc-xo175-ec",
drivers/platform/x86/intel_pmc_core.c+1−0
@@ -812,6 +812,7 @@ static const struct x86_cpu_id intel_pmc_core_ids[] = { · 811 unmodified lines
812812 INTEL_CPU_FAM6(KABYLAKE_DESKTOP, spt_reg_map),
813813 INTEL_CPU_FAM6(CANNONLAKE_MOBILE, cnp_reg_map),
814814 INTEL_CPU_FAM6(ICELAKE_MOBILE, icl_reg_map),
815+ INTEL_CPU_FAM6(ICELAKE_NNPI, icl_reg_map),
815816 {}
816817 };
817818
drivers/platform/x86/pcengines-apuv2.c+2−4
@@ -93,7 +93,7 @@ static struct gpiod_lookup_table gpios_led_table = { · 92 unmodified lines
9393
9494 static struct gpio_keys_button apu2_keys_buttons[] = {
9595 {
96− .code = KEY_SETUP,
96+ .code = KEY_RESTART,
9797 .active_low = 1,
9898 .desc = "front button",
9999 .type = EV_KEY,
@@ -255,6 +255,4 @@ MODULE_DESCRIPTION("PC Engines APUv2/APUv3 board GPIO/LED/keys driver"); · 155 unmodified lines
255255 MODULE_LICENSE("GPL");
256256 MODULE_DEVICE_TABLE(dmi, apu_gpio_dmi_table);
257257 MODULE_ALIAS("platform:pcengines-apuv2");
258−MODULE_SOFTDEP("pre: platform:" AMD_FCH_GPIO_DRIVER_NAME);
259−MODULE_SOFTDEP("pre: platform:leds-gpio");
260−MODULE_SOFTDEP("pre: platform:gpio_keys_polled");
258+MODULE_SOFTDEP("pre: platform:" AMD_FCH_GPIO_DRIVER_NAME " platform:leds-gpio platform:gpio_keys_polled");
drivers/pwm/core.c+5−2
@@ -882,8 +882,11 @@ struct pwm_device *pwm_get(struct device *dev, const char *con_id) · 881 unmodified lines
882882 return of_pwm_get(dev, dev->of_node, con_id);
883883
884884 /* then lookup via ACPI */
885− if (dev && is_acpi_node(dev->fwnode))
886− return acpi_pwm_get(dev->fwnode);
885+ if (dev && is_acpi_node(dev->fwnode)) {
886+ pwm = acpi_pwm_get(dev->fwnode);
887+ if (!IS_ERR(pwm) || PTR_ERR(pwm) != -ENOENT)
888+ return pwm;
889+ }
887890
888891 /*
889892 * We look up the provider in the static table typically provided by
drivers/regulator/axp20x-regulator.c+5−5
@@ -174,14 +174,14 @@ · 173 unmodified lines
174174 #define AXP803_DCDC5_1140mV_STEPS 35
175175 #define AXP803_DCDC5_1140mV_END \
176176 (AXP803_DCDC5_1140mV_START + AXP803_DCDC5_1140mV_STEPS)
177−#define AXP803_DCDC5_NUM_VOLTAGES 68
177+#define AXP803_DCDC5_NUM_VOLTAGES 69
178178
179179 #define AXP803_DCDC6_600mV_START 0x00
180180 #define AXP803_DCDC6_600mV_STEPS 50
181181 #define AXP803_DCDC6_600mV_END \
182182 (AXP803_DCDC6_600mV_START + AXP803_DCDC6_600mV_STEPS)
183183 #define AXP803_DCDC6_1120mV_START 0x33
184−#define AXP803_DCDC6_1120mV_STEPS 14
184+#define AXP803_DCDC6_1120mV_STEPS 20
185185 #define AXP803_DCDC6_1120mV_END \
186186 (AXP803_DCDC6_1120mV_START + AXP803_DCDC6_1120mV_STEPS)
187187 #define AXP803_DCDC6_NUM_VOLTAGES 72
@@ -240,7 +240,7 @@ · 52 unmodified lines
240240 #define AXP806_DCDCA_600mV_END \
241241 (AXP806_DCDCA_600mV_START + AXP806_DCDCA_600mV_STEPS)
242242 #define AXP806_DCDCA_1120mV_START 0x33
243−#define AXP806_DCDCA_1120mV_STEPS 14
243+#define AXP806_DCDCA_1120mV_STEPS 20
244244 #define AXP806_DCDCA_1120mV_END \
245245 (AXP806_DCDCA_1120mV_START + AXP806_DCDCA_1120mV_STEPS)
246246 #define AXP806_DCDCA_NUM_VOLTAGES 72
@@ -774,8 +774,8 @@ static const struct regulator_linear_range axp806_dcdcd_ranges[] = { · 527 unmodified lines
774774 AXP806_DCDCD_600mV_END,
775775 20000),
776776 REGULATOR_LINEAR_RANGE(1600000,
777− AXP806_DCDCD_600mV_START,
778− AXP806_DCDCD_600mV_END,
777+ AXP806_DCDCD_1600mV_START,
778+ AXP806_DCDCD_1600mV_END,
779779 100000),
780780 };
781781
drivers/regulator/lp87565-regulator.c+4−4
@@ -163,7 +163,7 @@ static int lp87565_regulator_probe(struct platform_device *pdev) · 162 unmodified lines
163163 struct lp87565 *lp87565 = dev_get_drvdata(pdev->dev.parent);
164164 struct regulator_config config = { };
165165 struct regulator_dev *rdev;
166− int i, min_idx = LP87565_BUCK_0, max_idx = LP87565_BUCK_3;
166+ int i, min_idx, max_idx;
167167
168168 platform_set_drvdata(pdev, lp87565);
169169
@@ -182,9 +182,9 @@ static int lp87565_regulator_probe(struct platform_device *pdev) · 12 unmodified lines
182182 max_idx = LP87565_BUCK_3210;
183183 break;
184184 default:
185− dev_err(lp87565->dev, "Invalid lp config %d\n",
186− lp87565->dev_type);
187− return -EINVAL;
185+ min_idx = LP87565_BUCK_0;
186+ max_idx = LP87565_BUCK_3;
187+ break;
188188 }
189189
190190 for (i = min_idx; i <= max_idx; i++) {
drivers/regulator/of_regulator.c+3−1
@@ -416,8 +416,10 @@ device_node *regulator_of_get_init_node(struct device *dev, · 415 unmodified lines
416416 if (!name)
417417 name = child->name;
418418
419− if (!strcmp(desc->of_match, name))
419+ if (!strcmp(desc->of_match, name)) {
420+ of_node_put(search);
420421 return of_node_get(child);
422+ }
421423 }
422424
423425 of_node_put(search);
drivers/s390/block/dasd_alias.c+16−6
@@ -383,6 +383,20 @@ suborder_not_supported(struct dasd_ccw_req *cqr) · 382 unmodified lines
383383 char msg_format;
384384 char msg_no;
385385
386+ /*
387+ * intrc values ENODEV, ENOLINK and EPERM
388+ * will be optained from sleep_on to indicate that no
389+ * IO operation can be started
390+ */
391+ if (cqr->intrc == -ENODEV)
392+ return 1;
393+
394+ if (cqr->intrc == -ENOLINK)
395+ return 1;
396+
397+ if (cqr->intrc == -EPERM)
398+ return 1;
399+
386400 sense = dasd_get_sense(&cqr->irb);
387401 if (!sense)
388402 return 0;
@@ -447,12 +461,8 @@ static int read_unit_address_configuration(struct dasd_device *device, · 58 unmodified lines
447461 lcu->flags &= ~NEED_UAC_UPDATE;
448462 spin_unlock_irqrestore(&lcu->lock, flags);
449463
450− do {
451− rc = dasd_sleep_on(cqr);
452− if (rc && suborder_not_supported(cqr))
453− return -EOPNOTSUPP;
454− } while (rc && (cqr->retries > 0));
455− if (rc) {
464+ rc = dasd_sleep_on(cqr);
465+ if (rc && !suborder_not_supported(cqr)) {
456466 spin_lock_irqsave(&lcu->lock, flags);
457467 lcu->flags |= NEED_UAC_UPDATE;
458468 spin_unlock_irqrestore(&lcu->lock, flags);
drivers/s390/char/con3215.c+1−0
@@ -398,6 +398,7 @@ static void raw3215_irq(struct ccw_device *cdev, unsigned long intparm, · 397 unmodified lines
398398 }
399399 if (dstat == 0x08)
400400 break;
401+ /* else, fall through */
401402 case 0x04:
402403 /* Device end interrupt. */
403404 if ((raw = req->info) == NULL)
drivers/s390/char/tape_core.c+3−0
@@ -677,6 +677,7 @@ tape_generic_remove(struct ccw_device *cdev) · 676 unmodified lines
677677 switch (device->tape_state) {
678678 case TS_INIT:
679679 tape_state_set(device, TS_NOT_OPER);
680+ /* fallthrough */
680681 case TS_NOT_OPER:
681682 /*
682683 * Nothing to do.
@@ -949,6 +950,7 @@ __tape_start_request(struct tape_device *device, struct tape_request *request) · 266 unmodified lines
949950 break;
950951 if (device->tape_state == TS_UNUSED)
951952 break;
953+ /* fallthrough */
952954 default:
953955 if (device->tape_state == TS_BLKUSE)
954956 break;
@@ -1116,6 +1118,7 @@ __tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb) · 161 unmodified lines
11161118 case -ETIMEDOUT:
11171119 DBF_LH(1, "(%08x): Request timed out\n",
11181120 device->cdev_id);
1121+ /* fallthrough */
11191122 case -EIO:
11201123 __tape_end_request(device, request, -EIO);
11211124 break;
drivers/s390/cio/vfio_ccw_async.c+1−1
@@ -70,7 +70,7 @@ static void vfio_ccw_async_region_release(struct vfio_ccw_private *private, · 69 unmodified lines
7070
7171 }
7272
73−const struct vfio_ccw_regops vfio_ccw_async_region_ops = {
73+static const struct vfio_ccw_regops vfio_ccw_async_region_ops = {
7474 .read = vfio_ccw_async_region_read,
7575 .write = vfio_ccw_async_region_write,
7676 .release = vfio_ccw_async_region_release,
drivers/s390/crypto/ap_queue.c+1−0
@@ -152,6 +152,7 @@ static struct ap_queue_status ap_sm_recv(struct ap_queue *aq) · 151 unmodified lines
152152 ap_msg->receive(aq, ap_msg, aq->reply);
153153 break;
154154 }
155+ /* fall through */
155156 case AP_RESPONSE_NO_PENDING_REPLY:
156157 if (!status.queue_empty || aq->queue_count <= 0)
157158 break;
drivers/s390/crypto/zcrypt_msgtype6.c+4−13
@@ -801,10 +801,7 @@ static int convert_response_ica(struct zcrypt_queue *zq, · 800 unmodified lines
801801 if (msg->cprbx.cprb_ver_id == 0x02)
802802 return convert_type86_ica(zq, reply,
803803 outputdata, outputdatalength);
804− /*
805− * Fall through, no break, incorrect cprb version is an unknown
806− * response
807− */
804+ /* fall through - wrong cprb version is an unknown response */
808805 default: /* Unknown response type, this should NEVER EVER happen */
809806 zq->online = 0;
810807 pr_err("Cryptographic device %02x.%04x failed and was set offline\n",
@@ -837,10 +834,7 @@ static int convert_response_xcrb(struct zcrypt_queue *zq, · 26 unmodified lines
837834 }
838835 if (msg->cprbx.cprb_ver_id == 0x02)
839836 return convert_type86_xcrb(zq, reply, xcRB);
840− /*
841− * Fall through, no break, incorrect cprb version is an unknown
842− * response
843− */
837+ /* fall through - wrong cprb version is an unknown response */
844838 default: /* Unknown response type, this should NEVER EVER happen */
845839 xcRB->status = 0x0008044DL; /* HDD_InvalidParm */
846840 zq->online = 0;
@@ -870,7 +864,7 @@ static int convert_response_ep11_xcrb(struct zcrypt_queue *zq, · 23 unmodified lines
870864 return convert_error(zq, reply);
871865 if (msg->cprbx.cprb_ver_id == 0x04)
872866 return convert_type86_ep11_xcrb(zq, reply, xcRB);
873− /* Fall through, no break, incorrect cprb version is an unknown resp.*/
867+ /* fall through - wrong cprb version is an unknown resp */
874868 default: /* Unknown response type, this should NEVER EVER happen */
875869 zq->online = 0;
876870 pr_err("Cryptographic device %02x.%04x failed and was set offline\n",
@@ -900,10 +894,7 @@ static int convert_response_rng(struct zcrypt_queue *zq, · 23 unmodified lines
900894 return -EINVAL;
901895 if (msg->cprbx.cprb_ver_id == 0x02)
902896 return convert_type86_rng(zq, reply, data);
903− /*
904− * Fall through, no break, incorrect cprb version is an unknown
905− * response
906− */
897+ /* fall through - wrong cprb version is an unknown response */
907898 default: /* Unknown response type, this should NEVER EVER happen */
908899 zq->online = 0;
909900 pr_err("Cryptographic device %02x.%04x failed and was set offline\n",
drivers/s390/net/ctcm_fsms.c+1−0
@@ -1704,6 +1704,7 @@ static void ctcmpc_chx_attnbusy(fsm_instance *fsm, int event, void *arg) · 1703 unmodified lines
17041704 grp->changed_side = 2;
17051705 break;
17061706 }
1707+ /* Else, fall through */
17071708 case MPCG_STATE_XID0IOWAIX:
17081709 case MPCG_STATE_XID7INITW:
17091710 case MPCG_STATE_XID7INITX:
drivers/s390/net/ctcm_mpc.c+3−0
@@ -357,6 +357,7 @@ int ctc_mpc_alloc_channel(int port_num, void (*callback)(int, int)) · 356 unmodified lines
357357 /*fsm_newstate(grp->fsm, MPCG_STATE_XID2INITW);*/
358358 if (callback)
359359 grp->send_qllc_disc = 1;
360+ /* Else, fall through */
360361 case MPCG_STATE_XID0IOWAIT:
361362 fsm_deltimer(&grp->timer);
362363 grp->outstanding_xid2 = 0;
@@ -1469,6 +1470,7 @@ static void mpc_action_timeout(fsm_instance *fi, int event, void *arg) · 1106 unmodified lines
14691470 if ((fsm_getstate(rch->fsm) == CH_XID0_PENDING) &&
14701471 (fsm_getstate(wch->fsm) == CH_XID0_PENDING))
14711472 break;
1473+ /* Else, fall through */
14721474 default:
14731475 fsm_event(grp->fsm, MPCG_EVENT_INOP, dev);
14741476 }
@@ -2089,6 +2091,7 @@ static int mpc_send_qllc_discontact(struct net_device *dev) · 614 unmodified lines
20892091 grp->estconnfunc = NULL;
20902092 break;
20912093 }
2094+ /* Else, fall through */
20922095 case MPCG_STATE_FLOWC:
20932096 case MPCG_STATE_READY:
20942097 grp->send_qllc_disc = 2;
drivers/s390/net/qeth_l2_main.c+1−1
@@ -333,7 +333,7 @@ static int qeth_l2_process_inbound_buffer(struct qeth_card *card, · 332 unmodified lines
333333 card->osn_info.data_cb(skb);
334334 break;
335335 }
336− /* else unknown */
336+ /* Else, fall through */
337337 default:
338338 dev_kfree_skb_any(skb);
339339 QETH_CARD_TEXT(card, 3, "inbunkno");
drivers/scsi/arm/fas216.c+8−0
@@ -603,6 +603,7 @@ static void fas216_handlesync(FAS216_Info *info, char *msg) · 602 unmodified lines
603603 msgqueue_flush(&info->scsi.msgs);
604604 msgqueue_addmsg(&info->scsi.msgs, 1, MESSAGE_REJECT);
605605 info->scsi.phase = PHASE_MSGOUT_EXPECT;
606+ /* fall through */
606607
607608 case async:
608609 dev->period = info->ifcfg.asyncperiod / 4;
@@ -915,6 +916,7 @@ static void fas216_disconnect_intr(FAS216_Info *info) · 306 unmodified lines
915916 fas216_done(info, DID_ABORT);
916917 break;
917918 }
919+ /* else, fall through */
918920
919921 default: /* huh? */
920922 printk(KERN_ERR "scsi%d.%c: unexpected disconnect in phase %s\n",
@@ -1411,6 +1413,8 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne · 490 unmodified lines
14111413 case STATE(STAT_STATUS, PHASE_DATAOUT): /* Data Out -> Status */
14121414 case STATE(STAT_STATUS, PHASE_DATAIN): /* Data In -> Status */
14131415 fas216_stoptransfer(info);
1416+ /* fall through */
1417+
14141418 case STATE(STAT_STATUS, PHASE_SELSTEPS):/* Sel w/ steps -> Status */
14151419 case STATE(STAT_STATUS, PHASE_MSGOUT): /* Message Out -> Status */
14161420 case STATE(STAT_STATUS, PHASE_COMMAND): /* Command -> Status */
@@ -1422,6 +1426,8 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne · 5 unmodified lines
14221426 case STATE(STAT_MESGIN, PHASE_DATAOUT): /* Data Out -> Message In */
14231427 case STATE(STAT_MESGIN, PHASE_DATAIN): /* Data In -> Message In */
14241428 fas216_stoptransfer(info);
1429+ /* fall through */
1430+
14251431 case STATE(STAT_MESGIN, PHASE_COMMAND): /* Command -> Message In */
14261432 case STATE(STAT_MESGIN, PHASE_SELSTEPS):/* Sel w/ steps -> Message In */
14271433 case STATE(STAT_MESGIN, PHASE_MSGOUT): /* Message Out -> Message In */
@@ -1575,6 +1581,7 @@ static void fas216_funcdone_intr(FAS216_Info *info, unsigned int stat, unsigned · 147 unmodified lines
15751581 fas216_message(info);
15761582 break;
15771583 }
1584+ /* else, fall through */
15781585
15791586 default:
15801587 fas216_log(info, 0, "internal phase %s for function done?"
@@ -1957,6 +1964,7 @@ static void fas216_kick(FAS216_Info *info) · 376 unmodified lines
19571964 switch (where_from) {
19581965 case TYPE_QUEUE:
19591966 fas216_allocate_tag(info, SCpnt);
1967+ /* fall through */
19601968 case TYPE_OTHER:
19611969 fas216_start_command(info, SCpnt);
19621970 break;
drivers/scsi/fcoe/fcoe_ctlr.c+65−73
@@ -2005,7 +2005,7 @@ EXPORT_SYMBOL_GPL(fcoe_wwn_from_mac); · 2004 unmodified lines
20052005 */
20062006 static inline struct fcoe_rport *fcoe_ctlr_rport(struct fc_rport_priv *rdata)
20072007 {
2008− return (struct fcoe_rport *)(rdata + 1);
2008+ return container_of(rdata, struct fcoe_rport, rdata);
20092009 }
20102010
20112011 /**
@@ -2269,7 +2269,7 @@ static void fcoe_ctlr_vn_start(struct fcoe_ctlr *fip) · 257 unmodified lines
22692269 */
22702270 static int fcoe_ctlr_vn_parse(struct fcoe_ctlr *fip,
22712271 struct sk_buff *skb,
2272− struct fc_rport_priv *rdata)
2272+ struct fcoe_rport *frport)
22732273 {
22742274 struct fip_header *fiph;
22752275 struct fip_desc *desc = NULL;
@@ -2277,16 +2277,12 @@ static int fcoe_ctlr_vn_parse(struct fcoe_ctlr *fip, · 1 unmodified line
22772277 struct fip_wwn_desc *wwn = NULL;
22782278 struct fip_vn_desc *vn = NULL;
22792279 struct fip_size_desc *size = NULL;
2280− struct fcoe_rport *frport;
22812280 size_t rlen;
22822281 size_t dlen;
22832282 u32 desc_mask = 0;
22842283 u32 dtype;
22852284 u8 sub;
22862285
2287− memset(rdata, 0, sizeof(*rdata) + sizeof(*frport));
2288− frport = fcoe_ctlr_rport(rdata);
2289−
22902286 fiph = (struct fip_header *)skb->data;
22912287 frport->flags = ntohs(fiph->fip_flags);
22922288
@@ -2349,15 +2345,17 @@ static int fcoe_ctlr_vn_parse(struct fcoe_ctlr *fip, · 56 unmodified lines
23492345 if (dlen != sizeof(struct fip_wwn_desc))
23502346 goto len_err;
23512347 wwn = (struct fip_wwn_desc *)desc;
2352− rdata->ids.node_name = get_unaligned_be64(&wwn->fd_wwn);
2348+ frport->rdata.ids.node_name =
2349+ get_unaligned_be64(&wwn->fd_wwn);
23532350 break;
23542351 case FIP_DT_VN_ID:
23552352 if (dlen != sizeof(struct fip_vn_desc))
23562353 goto len_err;
23572354 vn = (struct fip_vn_desc *)desc;
23582355 memcpy(frport->vn_mac, vn->fd_mac, ETH_ALEN);
2359− rdata->ids.port_id = ntoh24(vn->fd_fc_id);
2360− rdata->ids.port_name = get_unaligned_be64(&vn->fd_wwpn);
2356+ frport->rdata.ids.port_id = ntoh24(vn->fd_fc_id);
2357+ frport->rdata.ids.port_name =
2358+ get_unaligned_be64(&vn->fd_wwpn);
23612359 break;
23622360 case FIP_DT_FC4F:
23632361 if (dlen != sizeof(struct fip_fc4_feat))
@@ -2403,16 +2401,14 @@ static void fcoe_ctlr_vn_send_claim(struct fcoe_ctlr *fip) · 39 unmodified lines
24032401 /**
24042402 * fcoe_ctlr_vn_probe_req() - handle incoming VN2VN probe request.
24052403 * @fip: The FCoE controller
2406− * @rdata: parsed remote port with frport from the probe request
2404+ * @frport: parsed FCoE rport from the probe request
24072405 *
24082406 * Called with ctlr_mutex held.
24092407 */
24102408 static void fcoe_ctlr_vn_probe_req(struct fcoe_ctlr *fip,
2411− struct fc_rport_priv *rdata)
2409+ struct fcoe_rport *frport)
24122410 {
2413− struct fcoe_rport *frport = fcoe_ctlr_rport(rdata);
2414−
2415− if (rdata->ids.port_id != fip->port_id)
2411+ if (frport->rdata.ids.port_id != fip->port_id)
24162412 return;
24172413
24182414 switch (fip->state) {
@@ -2432,7 +2428,7 @@ static void fcoe_ctlr_vn_probe_req(struct fcoe_ctlr *fip, · 13 unmodified lines
24322428 * Probe's REC bit is not set.
24332429 * If we don't reply, we will change our address.
24342430 */
2435− if (fip->lp->wwpn > rdata->ids.port_name &&
2431+ if (fip->lp->wwpn > frport->rdata.ids.port_name &&
24362432 !(frport->flags & FIP_FL_REC_OR_P2P)) {
24372433 LIBFCOE_FIP_DBG(fip, "vn_probe_req: "
24382434 "port_id collision\n");
@@ -2456,14 +2452,14 @@ static void fcoe_ctlr_vn_probe_req(struct fcoe_ctlr *fip, · 17 unmodified lines
24562452 /**
24572453 * fcoe_ctlr_vn_probe_reply() - handle incoming VN2VN probe reply.
24582454 * @fip: The FCoE controller
2459− * @rdata: parsed remote port with frport from the probe request
2455+ * @frport: parsed FCoE rport from the probe request
24602456 *
24612457 * Called with ctlr_mutex held.
24622458 */
24632459 static void fcoe_ctlr_vn_probe_reply(struct fcoe_ctlr *fip,
2464− struct fc_rport_priv *rdata)
2460+ struct fcoe_rport *frport)
24652461 {
2466− if (rdata->ids.port_id != fip->port_id)
2462+ if (frport->rdata.ids.port_id != fip->port_id)
24672463 return;
24682464 switch (fip->state) {
24692465 case FIP_ST_VNMP_START:
@@ -2486,11 +2482,11 @@ static void fcoe_ctlr_vn_probe_reply(struct fcoe_ctlr *fip, · 16 unmodified lines
24862482 /**
24872483 * fcoe_ctlr_vn_add() - Add a VN2VN entry to the list, based on a claim reply.
24882484 * @fip: The FCoE controller
2489− * @new: newly-parsed remote port with frport as a template for new rdata
2485+ * @new: newly-parsed FCoE rport as a template for new rdata
24902486 *
24912487 * Called with ctlr_mutex held.
24922488 */
2493−static void fcoe_ctlr_vn_add(struct fcoe_ctlr *fip, struct fc_rport_priv *new)
2489+static void fcoe_ctlr_vn_add(struct fcoe_ctlr *fip, struct fcoe_rport *new)
24942490 {
24952491 struct fc_lport *lport = fip->lp;
24962492 struct fc_rport_priv *rdata;
@@ -2498,7 +2494,7 @@ static void fcoe_ctlr_vn_add(struct fcoe_ctlr *fip, struct fc_rport_priv *new) · 1 unmodified line
24982494 struct fcoe_rport *frport;
24992495 u32 port_id;
25002496
2501− port_id = new->ids.port_id;
2497+ port_id = new->rdata.ids.port_id;
25022498 if (port_id == fip->port_id)
25032499 return;
25042500
@@ -2515,22 +2511,28 @@ static void fcoe_ctlr_vn_add(struct fcoe_ctlr *fip, struct fc_rport_priv *new) · 10 unmodified lines
25152511 rdata->disc_id = lport->disc.disc_id;
25162512
25172513 ids = &rdata->ids;
2518− if ((ids->port_name != -1 && ids->port_name != new->ids.port_name) ||
2519− (ids->node_name != -1 && ids->node_name != new->ids.node_name)) {
2514+ if ((ids->port_name != -1 &&
2515+ ids->port_name != new->rdata.ids.port_name) ||
2516+ (ids->node_name != -1 &&
2517+ ids->node_name != new->rdata.ids.node_name)) {
25202518 mutex_unlock(&rdata->rp_mutex);
25212519 LIBFCOE_FIP_DBG(fip, "vn_add rport logoff %6.6x\n", port_id);
25222520 fc_rport_logoff(rdata);
25232521 mutex_lock(&rdata->rp_mutex);
25242522 }
2525− ids->port_name = new->ids.port_name;
2526− ids->node_name = new->ids.node_name;
2523+ ids->port_name = new->rdata.ids.port_name;
2524+ ids->node_name = new->rdata.ids.node_name;
25272525 mutex_unlock(&rdata->rp_mutex);
25282526
25292527 frport = fcoe_ctlr_rport(rdata);
25302528 LIBFCOE_FIP_DBG(fip, "vn_add rport %6.6x %s state %d\n",
25312529 port_id, frport->fcoe_len ? "old" : "new",
25322530 rdata->rp_state);
2533− *frport = *fcoe_ctlr_rport(new);
2531+ frport->fcoe_len = new->fcoe_len;
2532+ frport->flags = new->flags;
2533+ frport->login_count = new->login_count;
2534+ memcpy(frport->enode_mac, new->enode_mac, ETH_ALEN);
2535+ memcpy(frport->vn_mac, new->vn_mac, ETH_ALEN);
25342536 frport->time = 0;
25352537 }
25362538
@@ -2562,16 +2564,14 @@ static int fcoe_ctlr_vn_lookup(struct fcoe_ctlr *fip, u32 port_id, u8 *mac) · 25 unmodified lines
25622564 /**
25632565 * fcoe_ctlr_vn_claim_notify() - handle received FIP VN2VN Claim Notification
25642566 * @fip: The FCoE controller
2565− * @new: newly-parsed remote port with frport as a template for new rdata
2567+ * @new: newly-parsed FCoE rport as a template for new rdata
25662568 *
25672569 * Called with ctlr_mutex held.
25682570 */
25692571 static void fcoe_ctlr_vn_claim_notify(struct fcoe_ctlr *fip,
2570− struct fc_rport_priv *new)
2572+ struct fcoe_rport *new)
25712573 {
2572− struct fcoe_rport *frport = fcoe_ctlr_rport(new);
2573−
2574− if (frport->flags & FIP_FL_REC_OR_P2P) {
2574+ if (new->flags & FIP_FL_REC_OR_P2P) {
25752575 LIBFCOE_FIP_DBG(fip, "send probe req for P2P/REC\n");
25762576 fcoe_ctlr_vn_send(fip, FIP_SC_VN_PROBE_REQ, fcoe_all_vn2vn, 0);
25772577 return;
@@ -2580,7 +2580,7 @@ static void fcoe_ctlr_vn_claim_notify(struct fcoe_ctlr *fip, · 2 unmodified lines
25802580 case FIP_ST_VNMP_START:
25812581 case FIP_ST_VNMP_PROBE1:
25822582 case FIP_ST_VNMP_PROBE2:
2583− if (new->ids.port_id == fip->port_id) {
2583+ if (new->rdata.ids.port_id == fip->port_id) {
25842584 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: "
25852585 "restart, state %d\n",
25862586 fip->state);
@@ -2589,8 +2589,8 @@ static void fcoe_ctlr_vn_claim_notify(struct fcoe_ctlr *fip, · 2 unmodified lines
25892589 break;
25902590 case FIP_ST_VNMP_CLAIM:
25912591 case FIP_ST_VNMP_UP:
2592− if (new->ids.port_id == fip->port_id) {
2593− if (new->ids.port_name > fip->lp->wwpn) {
2592+ if (new->rdata.ids.port_id == fip->port_id) {
2593+ if (new->rdata.ids.port_name > fip->lp->wwpn) {
25942594 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: "
25952595 "restart, port_id collision\n");
25962596 fcoe_ctlr_vn_restart(fip);
@@ -2602,15 +2602,16 @@ static void fcoe_ctlr_vn_claim_notify(struct fcoe_ctlr *fip, · 5 unmodified lines
26022602 break;
26032603 }
26042604 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: send reply to %x\n",
2605− new->ids.port_id);
2606− fcoe_ctlr_vn_send(fip, FIP_SC_VN_CLAIM_REP, frport->enode_mac,
2607− min((u32)frport->fcoe_len,
2605+ new->rdata.ids.port_id);
2606+ fcoe_ctlr_vn_send(fip, FIP_SC_VN_CLAIM_REP, new->enode_mac,
2607+ min((u32)new->fcoe_len,
26082608 fcoe_ctlr_fcoe_size(fip)));
26092609 fcoe_ctlr_vn_add(fip, new);
26102610 break;
26112611 default:
26122612 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: "
2613− "ignoring claim from %x\n", new->ids.port_id);
2613+ "ignoring claim from %x\n",
2614+ new->rdata.ids.port_id);
26142615 break;
26152616 }
26162617 }
@@ -2618,15 +2619,15 @@ static void fcoe_ctlr_vn_claim_notify(struct fcoe_ctlr *fip, · 1 unmodified line
26182619 /**
26192620 * fcoe_ctlr_vn_claim_resp() - handle received Claim Response
26202621 * @fip: The FCoE controller that received the frame
2621− * @new: newly-parsed remote port with frport from the Claim Response
2622+ * @new: newly-parsed FCoE rport from the Claim Response
26222623 *
26232624 * Called with ctlr_mutex held.
26242625 */
26252626 static void fcoe_ctlr_vn_claim_resp(struct fcoe_ctlr *fip,
2626− struct fc_rport_priv *new)
2627+ struct fcoe_rport *new)
26272628 {
26282629 LIBFCOE_FIP_DBG(fip, "claim resp from from rport %x - state %s\n",
2629− new->ids.port_id, fcoe_ctlr_state(fip->state));
2630+ new->rdata.ids.port_id, fcoe_ctlr_state(fip->state));
26302631 if (fip->state == FIP_ST_VNMP_UP || fip->state == FIP_ST_VNMP_CLAIM)
26312632 fcoe_ctlr_vn_add(fip, new);
26322633 }
@@ -2634,28 +2635,28 @@ static void fcoe_ctlr_vn_claim_resp(struct fcoe_ctlr *fip, · 1 unmodified line
26342635 /**
26352636 * fcoe_ctlr_vn_beacon() - handle received beacon.
26362637 * @fip: The FCoE controller that received the frame
2637− * @new: newly-parsed remote port with frport from the Beacon
2638+ * @new: newly-parsed FCoE rport from the Beacon
26382639 *
26392640 * Called with ctlr_mutex held.
26402641 */
26412642 static void fcoe_ctlr_vn_beacon(struct fcoe_ctlr *fip,
2642− struct fc_rport_priv *new)
2643+ struct fcoe_rport *new)
26432644 {
26442645 struct fc_lport *lport = fip->lp;
26452646 struct fc_rport_priv *rdata;
26462647 struct fcoe_rport *frport;
26472648
2648− frport = fcoe_ctlr_rport(new);
2649− if (frport->flags & FIP_FL_REC_OR_P2P) {
2649+ if (new->flags & FIP_FL_REC_OR_P2P) {
26502650 LIBFCOE_FIP_DBG(fip, "p2p beacon while in vn2vn mode\n");
26512651 fcoe_ctlr_vn_send(fip, FIP_SC_VN_PROBE_REQ, fcoe_all_vn2vn, 0);
26522652 return;
26532653 }
2654− rdata = fc_rport_lookup(lport, new->ids.port_id);
2654+ rdata = fc_rport_lookup(lport, new->rdata.ids.port_id);
26552655 if (rdata) {
2656− if (rdata->ids.node_name == new->ids.node_name &&
2657− rdata->ids.port_name == new->ids.port_name) {
2656+ if (rdata->ids.node_name == new->rdata.ids.node_name &&
2657+ rdata->ids.port_name == new->rdata.ids.port_name) {
26582658 frport = fcoe_ctlr_rport(rdata);
2659+
26592660 LIBFCOE_FIP_DBG(fip, "beacon from rport %x\n",
26602661 rdata->ids.port_id);
26612662 if (!frport->time && fip->state == FIP_ST_VNMP_UP) {
@@ -2678,7 +2679,7 @@ static void fcoe_ctlr_vn_beacon(struct fcoe_ctlr *fip, · 16 unmodified lines
26782679 * Don't add the neighbor yet.
26792680 */
26802681 LIBFCOE_FIP_DBG(fip, "beacon from new rport %x. sending claim notify\n",
2681− new->ids.port_id);
2682+ new->rdata.ids.port_id);
26822683 if (time_after(jiffies,
26832684 fip->sol_time + msecs_to_jiffies(FIP_VN_ANN_WAIT)))
26842685 fcoe_ctlr_vn_send_claim(fip);
@@ -2738,10 +2739,7 @@ static int fcoe_ctlr_vn_recv(struct fcoe_ctlr *fip, struct sk_buff *skb) · 53 unmodified lines
27382739 {
27392740 struct fip_header *fiph;
27402741 enum fip_vn2vn_subcode sub;
2741− struct {
2742− struct fc_rport_priv rdata;
2743− struct fcoe_rport frport;
2744− } buf;
2742+ struct fcoe_rport frport = { };
27452743 int rc, vlan_id = 0;
27462744
27472745 fiph = (struct fip_header *)skb->data;
@@ -2757,7 +2755,7 @@ static int fcoe_ctlr_vn_recv(struct fcoe_ctlr *fip, struct sk_buff *skb) · 9 unmodified lines
27572755 goto drop;
27582756 }
27592757
2760− rc = fcoe_ctlr_vn_parse(fip, skb, &buf.rdata);
2758+ rc = fcoe_ctlr_vn_parse(fip, skb, &frport);
27612759 if (rc) {
27622760 LIBFCOE_FIP_DBG(fip, "vn_recv vn_parse error %d\n", rc);
27632761 goto drop;
@@ -2766,19 +2764,19 @@ static int fcoe_ctlr_vn_recv(struct fcoe_ctlr *fip, struct sk_buff *skb) · 2 unmodified lines
27662764 mutex_lock(&fip->ctlr_mutex);
27672765 switch (sub) {
27682766 case FIP_SC_VN_PROBE_REQ:
2769− fcoe_ctlr_vn_probe_req(fip, &buf.rdata);
2767+ fcoe_ctlr_vn_probe_req(fip, &frport);
27702768 break;
27712769 case FIP_SC_VN_PROBE_REP:
2772− fcoe_ctlr_vn_probe_reply(fip, &buf.rdata);
2770+ fcoe_ctlr_vn_probe_reply(fip, &frport);
27732771 break;
27742772 case FIP_SC_VN_CLAIM_NOTIFY:
2775− fcoe_ctlr_vn_claim_notify(fip, &buf.rdata);
2773+ fcoe_ctlr_vn_claim_notify(fip, &frport);
27762774 break;
27772775 case FIP_SC_VN_CLAIM_REP:
2778− fcoe_ctlr_vn_claim_resp(fip, &buf.rdata);
2776+ fcoe_ctlr_vn_claim_resp(fip, &frport);
27792777 break;
27802778 case FIP_SC_VN_BEACON:
2781− fcoe_ctlr_vn_beacon(fip, &buf.rdata);
2779+ fcoe_ctlr_vn_beacon(fip, &frport);
27822780 break;
27832781 default:
27842782 LIBFCOE_FIP_DBG(fip, "vn_recv unknown subcode %d\n", sub);
@@ -2802,22 +2800,18 @@ drop: · 17 unmodified lines
28022800 */
28032801 static int fcoe_ctlr_vlan_parse(struct fcoe_ctlr *fip,
28042802 struct sk_buff *skb,
2805− struct fc_rport_priv *rdata)
2803+ struct fcoe_rport *frport)
28062804 {
28072805 struct fip_header *fiph;
28082806 struct fip_desc *desc = NULL;
28092807 struct fip_mac_desc *macd = NULL;
28102808 struct fip_wwn_desc *wwn = NULL;
2811− struct fcoe_rport *frport;
28122809 size_t rlen;
28132810 size_t dlen;
28142811 u32 desc_mask = 0;
28152812 u32 dtype;
28162813 u8 sub;
28172814
2818− memset(rdata, 0, sizeof(*rdata) + sizeof(*frport));
2819− frport = fcoe_ctlr_rport(rdata);
2820−
28212815 fiph = (struct fip_header *)skb->data;
28222816 frport->flags = ntohs(fiph->fip_flags);
28232817
@@ -2871,7 +2865,8 @@ static int fcoe_ctlr_vlan_parse(struct fcoe_ctlr *fip, · 47 unmodified lines
28712865 if (dlen != sizeof(struct fip_wwn_desc))
28722866 goto len_err;
28732867 wwn = (struct fip_wwn_desc *)desc;
2874− rdata->ids.node_name = get_unaligned_be64(&wwn->fd_wwn);
2868+ frport->rdata.ids.node_name =
2869+ get_unaligned_be64(&wwn->fd_wwn);
28752870 break;
28762871 default:
28772872 LIBFCOE_FIP_DBG(fip, "unexpected descriptor type %x "
@@ -2957,13 +2952,13 @@ static void fcoe_ctlr_vlan_send(struct fcoe_ctlr *fip, · 79 unmodified lines
29572952 /**
29582953 * fcoe_ctlr_vlan_disk_reply() - send FIP VLAN Discovery Notification.
29592954 * @fip: The FCoE controller
2955+ * @frport: The newly-parsed FCoE rport from the Discovery Request
29602956 *
29612957 * Called with ctlr_mutex held.
29622958 */
29632959 static void fcoe_ctlr_vlan_disc_reply(struct fcoe_ctlr *fip,
2964− struct fc_rport_priv *rdata)
2960+ struct fcoe_rport *frport)
29652961 {
2966− struct fcoe_rport *frport = fcoe_ctlr_rport(rdata);
29672962 enum fip_vlan_subcode sub = FIP_SC_VL_NOTE;
29682963
29692964 if (fip->mode == FIP_MODE_VN2VN)
@@ -2982,22 +2977,19 @@ static int fcoe_ctlr_vlan_recv(struct fcoe_ctlr *fip, struct sk_buff *skb) · 12 unmodified lines
29822977 {
29832978 struct fip_header *fiph;
29842979 enum fip_vlan_subcode sub;
2985− struct {
2986− struct fc_rport_priv rdata;
2987− struct fcoe_rport frport;
2988− } buf;
2980+ struct fcoe_rport frport = { };
29892981 int rc;
29902982
29912983 fiph = (struct fip_header *)skb->data;
29922984 sub = fiph->fip_subcode;
2993− rc = fcoe_ctlr_vlan_parse(fip, skb, &buf.rdata);
2985+ rc = fcoe_ctlr_vlan_parse(fip, skb, &frport);
29942986 if (rc) {
29952987 LIBFCOE_FIP_DBG(fip, "vlan_recv vlan_parse error %d\n", rc);
29962988 goto drop;
29972989 }
29982990 mutex_lock(&fip->ctlr_mutex);
29992991 if (sub == FIP_SC_VL_REQ)
3000− fcoe_ctlr_vlan_disc_reply(fip, &buf.rdata);
2992+ fcoe_ctlr_vlan_disc_reply(fip, &frport);
30012993 mutex_unlock(&fip->ctlr_mutex);
30022994
30032995 drop:
drivers/scsi/hpsa.c+11−3
@@ -2334,6 +2334,8 @@ static int handle_ioaccel_mode2_error(struct ctlr_info *h, · 2333 unmodified lines
23342334 case IOACCEL2_SERV_RESPONSE_COMPLETE:
23352335 switch (c2->error_data.status) {
23362336 case IOACCEL2_STATUS_SR_TASK_COMP_GOOD:
2337+ if (cmd)
2338+ cmd->result = 0;
23372339 break;
23382340 case IOACCEL2_STATUS_SR_TASK_COMP_CHK_COND:
23392341 cmd->result |= SAM_STAT_CHECK_CONDITION;
@@ -2483,8 +2485,10 @@ static void process_ioaccel2_completion(struct ctlr_info *h, · 143 unmodified lines
24832485
24842486 /* check for good status */
24852487 if (likely(c2->error_data.serv_response == 0 &&
2486− c2->error_data.status == 0))
2488+ c2->error_data.status == 0)) {
2489+ cmd->result = 0;
24872490 return hpsa_cmd_free_and_done(h, c, cmd);
2491+ }
24882492
24892493 /*
24902494 * Any RAID offload error results in retry which will use
@@ -5653,6 +5657,12 @@ static int hpsa_scsi_queue_command(struct Scsi_Host *sh, struct scsi_cmnd *cmd) · 3162 unmodified lines
56535657 if (c == NULL)
56545658 return SCSI_MLQUEUE_DEVICE_BUSY;
56555659
5660+ /*
5661+ * This is necessary because the SML doesn't zero out this field during
5662+ * error recovery.
5663+ */
5664+ cmd->result = 0;
5665+
56565666 /*
56575667 * Call alternate submit routine for I/O accelerated commands.
56585668 * Retries always go down the normal I/O path.
@@ -6081,8 +6091,6 @@ static struct CommandList *cmd_tagged_alloc(struct ctlr_info *h, · 422 unmodified lines
60816091 if (idx != h->last_collision_tag) { /* Print once per tag */
60826092 dev_warn(&h->pdev->dev,
60836093 "%s: tag collision (tag=%d)\n", __func__, idx);
6084− if (c->scsi_cmd != NULL)
6085− scsi_print_command(c->scsi_cmd);
60866094 if (scmd)
60876095 scsi_print_command(scmd);
60886096 h->last_collision_tag = idx;
drivers/scsi/libfc/fc_rport.c+4−1
@@ -128,6 +128,7 @@ EXPORT_SYMBOL(fc_rport_lookup); · 127 unmodified lines
128128 struct fc_rport_priv *fc_rport_create(struct fc_lport *lport, u32 port_id)
129129 {
130130 struct fc_rport_priv *rdata;
131+ size_t rport_priv_size = sizeof(*rdata);
131132
132133 lockdep_assert_held(&lport->disc.disc_mutex);
133134
@@ -135,7 +136,9 @@ struct fc_rport_priv *fc_rport_create(struct fc_lport *lport, u32 port_id) · 1 unmodified line
135136 if (rdata)
136137 return rdata;
137138
138− rdata = kzalloc(sizeof(*rdata) + lport->rport_priv_size, GFP_KERNEL);
139+ if (lport->rport_priv_size > 0)
140+ rport_priv_size = lport->rport_priv_size;
141+ rdata = kzalloc(rport_priv_size, GFP_KERNEL);
139142 if (!rdata)
140143 return NULL;
141144
drivers/scsi/mpt3sas/mpt3sas_base.c+7−5
@@ -2703,6 +2703,8 @@ _base_config_dma_addressing(struct MPT3SAS_ADAPTER *ioc, struct pci_dev *pdev) · 2702 unmodified lines
27032703 {
27042704 u64 required_mask, coherent_mask;
27052705 struct sysinfo s;
2706+ /* Set 63 bit DMA mask for all SAS3 and SAS35 controllers */
2707+ int dma_mask = (ioc->hba_mpi_version_belonged > MPI2_VERSION) ? 63 : 64;
27062708
27072709 if (ioc->is_mcpu_endpoint)
27082710 goto try_32bit;
@@ -2712,17 +2714,17 @@ _base_config_dma_addressing(struct MPT3SAS_ADAPTER *ioc, struct pci_dev *pdev) · 3 unmodified lines
27122714 goto try_32bit;
27132715
27142716 if (ioc->dma_mask)
2715− coherent_mask = DMA_BIT_MASK(64);
2717+ coherent_mask = DMA_BIT_MASK(dma_mask);
27162718 else
27172719 coherent_mask = DMA_BIT_MASK(32);
27182720
2719− if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) ||
2721+ if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(dma_mask)) ||
27202722 dma_set_coherent_mask(&pdev->dev, coherent_mask))
27212723 goto try_32bit;
27222724
27232725 ioc->base_add_sg_single = &_base_add_sg_single_64;
27242726 ioc->sge_size = sizeof(Mpi2SGESimple64_t);
2725− ioc->dma_mask = 64;
2727+ ioc->dma_mask = dma_mask;
27262728 goto out;
27272729
27282730 try_32bit:
@@ -2744,7 +2746,7 @@ static int · 15 unmodified lines
27442746 _base_change_consistent_dma_mask(struct MPT3SAS_ADAPTER *ioc,
27452747 struct pci_dev *pdev)
27462748 {
2747− if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) {
2749+ if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(ioc->dma_mask))) {
27482750 if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)))
27492751 return -ENODEV;
27502752 }
@@ -4989,7 +4991,7 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc) · 2238 unmodified lines
49894991 total_sz += sz;
49904992 } while (ioc->rdpq_array_enable && (++i < ioc->reply_queue_count));
49914993
4992− if (ioc->dma_mask == 64) {
4994+ if (ioc->dma_mask > 32) {
49934995 if (_base_change_consistent_dma_mask(ioc, ioc->pdev) != 0) {
49944996 ioc_warn(ioc, "no suitable consistent DMA mask for %s\n",
49954997 pci_name(ioc->pdev));
drivers/scsi/qla2xxx/qla_init.c+1−1
@@ -4877,7 +4877,7 @@ qla2x00_alloc_fcport(scsi_qla_host_t *vha, gfp_t flags) · 4876 unmodified lines
48774877 ql_log(ql_log_warn, vha, 0xd049,
48784878 "Failed to allocate ct_sns request.\n");
48794879 kfree(fcport);
4880− fcport = NULL;
4880+ return NULL;
48814881 }
48824882
48834883 INIT_WORK(&fcport->del_work, qla24xx_delete_sess_fn);
drivers/spi/spi-bcm2835.c+2−1
@@ -834,7 +834,8 @@ static int bcm2835_spi_transfer_one(struct spi_controller *ctlr, · 833 unmodified lines
834834 bcm2835_wr(bs, BCM2835_SPI_CLK, cdiv);
835835
836836 /* handle all the 3-wire mode */
837− if ((spi->mode & SPI_3WIRE) && (tfr->rx_buf))
837+ if (spi->mode & SPI_3WIRE && tfr->rx_buf &&
838+ tfr->rx_buf != ctlr->dummy_rx)
838839 cs |= BCM2835_SPI_CS_REN;
839840 else
840841 cs &= ~BCM2835_SPI_CS_REN;
drivers/spi/spi-fsl-qspi.c+1−1
@@ -206,7 +206,7 @@ static const struct fsl_qspi_devtype_data imx6sx_data = { · 205 unmodified lines
206206 };
207207
208208 static const struct fsl_qspi_devtype_data imx7d_data = {
209− .rxfifo = SZ_512,
209+ .rxfifo = SZ_128,
210210 .txfifo = SZ_512,
211211 .ahb_buf_size = SZ_1K,
212212 .quirks = QUADSPI_QUIRK_TKT253890 | QUADSPI_QUIRK_4X_INT_CLK,
drivers/spi/spi-gpio.c+6−0
@@ -410,6 +410,12 @@ static int spi_gpio_probe(struct platform_device *pdev) · 409 unmodified lines
410410
411411 bb = &spi_gpio->bitbang;
412412 bb->master = master;
413+ /*
414+ * There is some additional business, apart from driving the CS GPIO
415+ * line, that we need to do on selection. This makes the local
416+ * callback for chipselect always get called.
417+ */
418+ master->flags |= SPI_MASTER_GPIO_SS;
413419 bb->chipselect = spi_gpio_chipselect;
414420 bb->set_line_direction = spi_gpio_set_direction;
415421
drivers/spi/spi-pxa2xx.c+12−2
@@ -1457,6 +1457,14 @@ static const struct pci_device_id pxa2xx_spi_pci_compound_match[] = { · 1456 unmodified lines
14571457 { PCI_VDEVICE(INTEL, 0x02aa), LPSS_CNL_SSP },
14581458 { PCI_VDEVICE(INTEL, 0x02ab), LPSS_CNL_SSP },
14591459 { PCI_VDEVICE(INTEL, 0x02fb), LPSS_CNL_SSP },
1460+ /* TGL-LP */
1461+ { PCI_VDEVICE(INTEL, 0xa0aa), LPSS_CNL_SSP },
1462+ { PCI_VDEVICE(INTEL, 0xa0ab), LPSS_CNL_SSP },
1463+ { PCI_VDEVICE(INTEL, 0xa0de), LPSS_CNL_SSP },
1464+ { PCI_VDEVICE(INTEL, 0xa0df), LPSS_CNL_SSP },
1465+ { PCI_VDEVICE(INTEL, 0xa0fb), LPSS_CNL_SSP },
1466+ { PCI_VDEVICE(INTEL, 0xa0fd), LPSS_CNL_SSP },
1467+ { PCI_VDEVICE(INTEL, 0xa0fe), LPSS_CNL_SSP },
14601468 { },
14611469 };
14621470
@@ -1831,14 +1839,16 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) · 368 unmodified lines
18311839 status = devm_spi_register_controller(&pdev->dev, controller);
18321840 if (status != 0) {
18331841 dev_err(&pdev->dev, "problem registering spi controller\n");
1834− goto out_error_clock_enabled;
1842+ goto out_error_pm_runtime_enabled;
18351843 }
18361844
18371845 return status;
18381846
1839−out_error_clock_enabled:
1847+out_error_pm_runtime_enabled:
18401848 pm_runtime_put_noidle(&pdev->dev);
18411849 pm_runtime_disable(&pdev->dev);
1850+
1851+out_error_clock_enabled:
18421852 clk_disable_unprepare(ssp->clk);
18431853
18441854 out_error_dma_irq_alloc:
drivers/staging/android/ion/ion_page_pool.c+3−0
@@ -8,11 +8,14 @@ · 7 unmodified lines
88 #include <linux/list.h>
99 #include <linux/slab.h>
1010 #include <linux/swap.h>
11+#include <linux/sched/signal.h>
1112
1213 #include "ion.h"
1314
1415 static inline struct page *ion_page_pool_alloc_pages(struct ion_page_pool *pool)
1516 {
17+ if (fatal_signal_pending(current))
18+ return NULL;
1619 return alloc_pages(pool->gfp_mask, pool->order);
1720 }
1821
drivers/staging/fbtft/fb_bd663474.c+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
2424
2525 static int init_display(struct fbtft_par *par)
2626 {
27− if (!par->gpio.cs)
27+ if (par->gpio.cs)
2828 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */
2929
3030 par->fbtftops.reset(par);
drivers/staging/fbtft/fb_ili9163.c+1−1
@@ -77,7 +77,7 @@ static int init_display(struct fbtft_par *par) · 76 unmodified lines
7777 {
7878 par->fbtftops.reset(par);
7979
80− if (!par->gpio.cs)
80+ if (par->gpio.cs)
8181 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */
8282
8383 write_reg(par, MIPI_DCS_SOFT_RESET); /* software reset */
drivers/staging/fbtft/fb_ili9325.c+1−1
@@ -85,7 +85,7 @@ static int init_display(struct fbtft_par *par) · 84 unmodified lines
8585 {
8686 par->fbtftops.reset(par);
8787
88− if (!par->gpio.cs)
88+ if (par->gpio.cs)
8989 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */
9090
9191 bt &= 0x07;
drivers/staging/fbtft/fb_s6d1121.c+1−1
@@ -29,7 +29,7 @@ static int init_display(struct fbtft_par *par) · 28 unmodified lines
2929 {
3030 par->fbtftops.reset(par);
3131
32− if (!par->gpio.cs)
32+ if (par->gpio.cs)
3333 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */
3434
3535 /* Initialization sequence from Lib_UTFT */
drivers/staging/fbtft/fb_ssd1289.c+1−1
@@ -28,7 +28,7 @@ static int init_display(struct fbtft_par *par) · 27 unmodified lines
2828 {
2929 par->fbtftops.reset(par);
3030
31− if (!par->gpio.cs)
31+ if (par->gpio.cs)
3232 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */
3333
3434 write_reg(par, 0x00, 0x0001);
drivers/staging/fbtft/fb_ssd1331.c+2−2
@@ -81,7 +81,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...) · 80 unmodified lines
8181 va_start(args, len);
8282
8383 *buf = (u8)va_arg(args, unsigned int);
84− if (!par->gpio.dc)
84+ if (par->gpio.dc)
8585 gpiod_set_value(par->gpio.dc, 0);
8686 ret = par->fbtftops.write(par, par->buf, sizeof(u8));
8787 if (ret < 0) {
@@ -104,7 +104,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...) · 16 unmodified lines
104104 return;
105105 }
106106 }
107− if (!par->gpio.dc)
107+ if (par->gpio.dc)
108108 gpiod_set_value(par->gpio.dc, 1);
109109 va_end(args);
110110 }
drivers/staging/fbtft/fb_upd161704.c+1−1
@@ -26,7 +26,7 @@ static int init_display(struct fbtft_par *par) · 25 unmodified lines
2626 {
2727 par->fbtftops.reset(par);
2828
29− if (!par->gpio.cs)
29+ if (par->gpio.cs)
3030 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */
3131
3232 /* Initialization sequence from Lib_UTFT */
drivers/staging/fbtft/fbtft-bus.c+1−1
@@ -135,7 +135,7 @@ int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len) · 134 unmodified lines
135135 remain = len / 2;
136136 vmem16 = (u16 *)(par->info->screen_buffer + offset);
137137
138− if (!par->gpio.dc)
138+ if (par->gpio.dc)
139139 gpiod_set_value(par->gpio.dc, 1);
140140
141141 /* non buffered write */
drivers/staging/fbtft/fbtft-core.c+22−25
@@ -76,21 +76,18 @@ static int fbtft_request_one_gpio(struct fbtft_par *par, · 75 unmodified lines
7676 struct gpio_desc **gpiop)
7777 {
7878 struct device *dev = par->info->device;
79− struct device_node *node = dev->of_node;
8079 int ret = 0;
8180
82− if (of_find_property(node, name, NULL)) {
83− *gpiop = devm_gpiod_get_index(dev, dev->driver->name, index,
84− GPIOD_OUT_HIGH);
85− if (IS_ERR(*gpiop)) {
86− ret = PTR_ERR(*gpiop);
87− dev_err(dev,
88− "Failed to request %s GPIO:%d\n", name, ret);
89− return ret;
90− }
91− fbtft_par_dbg(DEBUG_REQUEST_GPIOS, par, "%s: '%s' GPIO\n",
92− __func__, name);
81+ *gpiop = devm_gpiod_get_index_optional(dev, name, index,
82+ GPIOD_OUT_HIGH);
83+ if (IS_ERR(*gpiop)) {
84+ ret = PTR_ERR(*gpiop);
85+ dev_err(dev,
86+ "Failed to request %s GPIO: %d\n", name, ret);
87+ return ret;
9388 }
89+ fbtft_par_dbg(DEBUG_REQUEST_GPIOS, par, "%s: '%s' GPIO\n",
90+ __func__, name);
9491
9592 return ret;
9693 }
@@ -103,34 +100,34 @@ static int fbtft_request_gpios_dt(struct fbtft_par *par) · 6 unmodified lines
103100 if (!par->info->device->of_node)
104101 return -EINVAL;
105102
106− ret = fbtft_request_one_gpio(par, "reset-gpios", 0, &par->gpio.reset);
103+ ret = fbtft_request_one_gpio(par, "reset", 0, &par->gpio.reset);
107104 if (ret)
108105 return ret;
109− ret = fbtft_request_one_gpio(par, "dc-gpios", 0, &par->gpio.dc);
106+ ret = fbtft_request_one_gpio(par, "dc", 0, &par->gpio.dc);
110107 if (ret)
111108 return ret;
112− ret = fbtft_request_one_gpio(par, "rd-gpios", 0, &par->gpio.rd);
109+ ret = fbtft_request_one_gpio(par, "rd", 0, &par->gpio.rd);
113110 if (ret)
114111 return ret;
115− ret = fbtft_request_one_gpio(par, "wr-gpios", 0, &par->gpio.wr);
112+ ret = fbtft_request_one_gpio(par, "wr", 0, &par->gpio.wr);
116113 if (ret)
117114 return ret;
118− ret = fbtft_request_one_gpio(par, "cs-gpios", 0, &par->gpio.cs);
115+ ret = fbtft_request_one_gpio(par, "cs", 0, &par->gpio.cs);
119116 if (ret)
120117 return ret;
121− ret = fbtft_request_one_gpio(par, "latch-gpios", 0, &par->gpio.latch);
118+ ret = fbtft_request_one_gpio(par, "latch", 0, &par->gpio.latch);
122119 if (ret)
123120 return ret;
124121 for (i = 0; i < 16; i++) {
125− ret = fbtft_request_one_gpio(par, "db-gpios", i,
122+ ret = fbtft_request_one_gpio(par, "db", i,
126123 &par->gpio.db[i]);
127124 if (ret)
128125 return ret;
129− ret = fbtft_request_one_gpio(par, "led-gpios", i,
126+ ret = fbtft_request_one_gpio(par, "led", i,
130127 &par->gpio.led[i]);
131128 if (ret)
132129 return ret;
133− ret = fbtft_request_one_gpio(par, "aux-gpios", i,
130+ ret = fbtft_request_one_gpio(par, "aux", i,
134131 &par->gpio.aux[i]);
135132 if (ret)
136133 return ret;
@@ -234,9 +231,9 @@ static void fbtft_reset(struct fbtft_par *par) · 97 unmodified lines
234231 if (!par->gpio.reset)
235232 return;
236233 fbtft_par_dbg(DEBUG_RESET, par, "%s()\n", __func__);
237− gpiod_set_value_cansleep(par->gpio.reset, 0);
238− usleep_range(20, 40);
239234 gpiod_set_value_cansleep(par->gpio.reset, 1);
235+ usleep_range(20, 40);
236+ gpiod_set_value_cansleep(par->gpio.reset, 0);
240237 msleep(120);
241238 }
242239
@@ -921,7 +918,7 @@ static int fbtft_init_display_dt(struct fbtft_par *par) · 678 unmodified lines
921918 return -EINVAL;
922919
923920 par->fbtftops.reset(par);
924− if (!par->gpio.cs)
921+ if (par->gpio.cs)
925922 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */
926923
927924 while (p) {
@@ -1012,7 +1009,7 @@ int fbtft_init_display(struct fbtft_par *par) · 84 unmodified lines
10121009 }
10131010
10141011 par->fbtftops.reset(par);
1015− if (!par->gpio.cs)
1012+ if (par->gpio.cs)
10161013 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */
10171014
10181015 i = 0;
drivers/staging/gasket/apex_driver.c+1−1
@@ -532,7 +532,7 @@ static ssize_t sysfs_show(struct device *device, struct device_attribute *attr, · 531 unmodified lines
532532 break;
533533 case ATTR_KERNEL_HIB_SIMPLE_PAGE_TABLE_SIZE:
534534 ret = scnprintf(buf, PAGE_SIZE, "%u\n",
535− gasket_page_table_num_entries(
535+ gasket_page_table_num_simple_entries(
536536 gasket_dev->page_table[0]));
537537 break;
538538 case ATTR_KERNEL_HIB_NUM_ACTIVE_PAGES:
drivers/staging/unisys/visornic/visornic_main.c+2−1
@@ -1750,7 +1750,8 @@ static int visornic_poll(struct napi_struct *napi, int budget) · 1749 unmodified lines
17501750 }
17511751
17521752 /* poll_for_irq - checks the status of the response queue
1753− * @v: Void pointer to the visronic devdata struct.
1753+ * @t: pointer to the 'struct timer_list' from which we can retrieve the
1754+ * the visornic devdata struct.
17541755 *
17551756 * Main function of the vnic_incoming thread. Periodically check the response
17561757 * queue and drain it if needed.
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c+1−0
@@ -1969,6 +1969,7 @@ void wilc_deinit_host_int(struct net_device *net) · 1968 unmodified lines
19691969
19701970 priv->p2p_listen_state = false;
19711971
1972+ flush_workqueue(vif->wilc->hif_workqueue);
19721973 mutex_destroy(&priv->scan_req_lock);
19731974 ret = wilc_deinit(vif);
19741975
drivers/tty/serial/kgdboc.c+4−0
@@ -277,10 +277,14 @@ static void kgdboc_pre_exp_handler(void) · 276 unmodified lines
277277 /* Increment the module count when the debugger is active */
278278 if (!kgdb_connected)
279279 try_module_get(THIS_MODULE);
280+
281+ atomic_inc(&ignore_console_lock_warning);
280282 }
281283
282284 static void kgdboc_post_exp_handler(void)
283285 {
286+ atomic_dec(&ignore_console_lock_warning);
287+
284288 /* decrement the module count when the debugger detaches */
285289 if (!kgdb_connected)
286290 module_put(THIS_MODULE);
drivers/usb/core/devio.c+0−2
@@ -1812,8 +1812,6 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb · 1811 unmodified lines
18121812 return 0;
18131813
18141814 error:
1815− if (as && as->usbm)
1816− dec_usb_memory_use_count(as->usbm, &as->usbm->urb_use_count);
18171815 kfree(isopkt);
18181816 kfree(dr);
18191817 if (as)
drivers/usb/core/hcd.c+0−123
@@ -103,11 +103,6 @@ static DEFINE_SPINLOCK(hcd_urb_unlink_lock); · 102 unmodified lines
103103 /* wait queue for synchronous unlinks */
104104 DECLARE_WAIT_QUEUE_HEAD(usb_kill_urb_queue);
105105
106−static inline int is_root_hub(struct usb_device *udev)
107−{
108− return (udev->parent == NULL);
109−}
110−
111106 /*-------------------------------------------------------------------------*/
112107
113108 /*
@@ -880,101 +875,6 @@ static int usb_rh_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) · 766 unmodified lines
880875 }
881876
882877
883−
884−/*
885− * Show & store the current value of authorized_default
886− */
887−static ssize_t authorized_default_show(struct device *dev,
888− struct device_attribute *attr, char *buf)
889−{
890− struct usb_device *rh_usb_dev = to_usb_device(dev);
891− struct usb_bus *usb_bus = rh_usb_dev->bus;
892− struct usb_hcd *hcd;
893−
894− hcd = bus_to_hcd(usb_bus);
895− return snprintf(buf, PAGE_SIZE, "%u\n", hcd->dev_policy);
896−}
897−
898−static ssize_t authorized_default_store(struct device *dev,
899− struct device_attribute *attr,
900− const char *buf, size_t size)
901−{
902− ssize_t result;
903− unsigned val;
904− struct usb_device *rh_usb_dev = to_usb_device(dev);
905− struct usb_bus *usb_bus = rh_usb_dev->bus;
906− struct usb_hcd *hcd;
907−
908− hcd = bus_to_hcd(usb_bus);
909− result = sscanf(buf, "%u\n", &val);
910− if (result == 1) {
911− hcd->dev_policy = val <= USB_DEVICE_AUTHORIZE_INTERNAL ?
912− val : USB_DEVICE_AUTHORIZE_ALL;
913− result = size;
914− } else {
915− result = -EINVAL;
916− }
917− return result;
918−}
919−static DEVICE_ATTR_RW(authorized_default);
920−
921−/*
922− * interface_authorized_default_show - show default authorization status
923− * for USB interfaces
924− *
925− * note: interface_authorized_default is the default value
926− * for initializing the authorized attribute of interfaces
927− */
928−static ssize_t interface_authorized_default_show(struct device *dev,
929− struct device_attribute *attr, char *buf)
930−{
931− struct usb_device *usb_dev = to_usb_device(dev);
932− struct usb_hcd *hcd = bus_to_hcd(usb_dev->bus);
933−
934− return sprintf(buf, "%u\n", !!HCD_INTF_AUTHORIZED(hcd));
935−}
936−
937−/*
938− * interface_authorized_default_store - store default authorization status
939− * for USB interfaces
940− *
941− * note: interface_authorized_default is the default value
942− * for initializing the authorized attribute of interfaces
943− */
944−static ssize_t interface_authorized_default_store(struct device *dev,
945− struct device_attribute *attr, const char *buf, size_t count)
946−{
947− struct usb_device *usb_dev = to_usb_device(dev);
948− struct usb_hcd *hcd = bus_to_hcd(usb_dev->bus);
949− int rc = count;
950− bool val;
951−
952− if (strtobool(buf, &val) != 0)
953− return -EINVAL;
954−
955− if (val)
956− set_bit(HCD_FLAG_INTF_AUTHORIZED, &hcd->flags);
957− else
958− clear_bit(HCD_FLAG_INTF_AUTHORIZED, &hcd->flags);
959−
960− return rc;
961−}
962−static DEVICE_ATTR_RW(interface_authorized_default);
963−
964−/* Group all the USB bus attributes */
965−static struct attribute *usb_bus_attrs[] = {
966− &dev_attr_authorized_default.attr,
967− &dev_attr_interface_authorized_default.attr,
968− NULL,
969−};
970−
971−static const struct attribute_group usb_bus_attr_group = {
972− .name = NULL, /* we want them in the same directory */
973− .attrs = usb_bus_attrs,
974−};
975−
976−
977−
978878 /*-------------------------------------------------------------------------*/
979879
980880 /**
@@ -2894,32 +2794,11 @@ int usb_add_hcd(struct usb_hcd *hcd, · 1913 unmodified lines
28942794 if (retval != 0)
28952795 goto err_register_root_hub;
28962796
2897− retval = sysfs_create_group(&rhdev->dev.kobj, &usb_bus_attr_group);
2898− if (retval < 0) {
2899− printk(KERN_ERR "Cannot register USB bus sysfs attributes: %d\n",
2900− retval);
2901− goto error_create_attr_group;
2902− }
29032797 if (hcd->uses_new_polling && HCD_POLL_RH(hcd))
29042798 usb_hcd_poll_rh_status(hcd);
29052799
29062800 return retval;
29072801
2908−error_create_attr_group:
2909− clear_bit(HCD_FLAG_RH_RUNNING, &hcd->flags);
2910− if (HC_IS_RUNNING(hcd->state))
2911− hcd->state = HC_STATE_QUIESCING;
2912− spin_lock_irq(&hcd_root_hub_lock);
2913− hcd->rh_registered = 0;
2914− spin_unlock_irq(&hcd_root_hub_lock);
2915−
2916−#ifdef CONFIG_PM
2917− cancel_work_sync(&hcd->wakeup_work);
2918−#endif
2919− cancel_work_sync(&hcd->died_work);
2920− mutex_lock(&usb_bus_idr_lock);
2921− usb_disconnect(&rhdev); /* Sets rhdev to NULL */
2922− mutex_unlock(&usb_bus_idr_lock);
29232802 err_register_root_hub:
29242803 hcd->rh_pollable = 0;
29252804 clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
@@ -2963,8 +2842,6 @@ void usb_remove_hcd(struct usb_hcd *hcd) · 37 unmodified lines
29632842 dev_info(hcd->self.controller, "remove, state %x\n", hcd->state);
29642843
29652844 usb_get_dev(rhdev);
2966− sysfs_remove_group(&rhdev->dev.kobj, &usb_bus_attr_group);
2967−
29682845 clear_bit(HCD_FLAG_RH_RUNNING, &hcd->flags);
29692846 if (HC_IS_RUNNING (hcd->state))
29702847 hcd->state = HC_STATE_QUIESCING;
drivers/usb/core/sysfs.c+121−0
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <linux/kernel.h>
1616 #include <linux/string.h>
1717 #include <linux/usb.h>
18+#include <linux/usb/hcd.h>
1819 #include <linux/usb/quirks.h>
1920 #include <linux/of.h>
2021 #include "usb.h"
@@ -922,6 +923,116 @@ static struct bin_attribute dev_bin_attr_descriptors = { · 901 unmodified lines
922923 .size = 18 + 65535, /* dev descr + max-size raw descriptor */
923924 };
924925
926+/*
927+ * Show & store the current value of authorized_default
928+ */
929+static ssize_t authorized_default_show(struct device *dev,
930+ struct device_attribute *attr, char *buf)
931+{
932+ struct usb_device *rh_usb_dev = to_usb_device(dev);
933+ struct usb_bus *usb_bus = rh_usb_dev->bus;
934+ struct usb_hcd *hcd;
935+
936+ hcd = bus_to_hcd(usb_bus);
937+ return snprintf(buf, PAGE_SIZE, "%u\n", hcd->dev_policy);
938+}
939+
940+static ssize_t authorized_default_store(struct device *dev,
941+ struct device_attribute *attr,
942+ const char *buf, size_t size)
943+{
944+ ssize_t result;
945+ unsigned int val;
946+ struct usb_device *rh_usb_dev = to_usb_device(dev);
947+ struct usb_bus *usb_bus = rh_usb_dev->bus;
948+ struct usb_hcd *hcd;
949+
950+ hcd = bus_to_hcd(usb_bus);
951+ result = sscanf(buf, "%u\n", &val);
952+ if (result == 1) {
953+ hcd->dev_policy = val <= USB_DEVICE_AUTHORIZE_INTERNAL ?
954+ val : USB_DEVICE_AUTHORIZE_ALL;
955+ result = size;
956+ } else {
957+ result = -EINVAL;
958+ }
959+ return result;
960+}
961+static DEVICE_ATTR_RW(authorized_default);
962+
963+/*
964+ * interface_authorized_default_show - show default authorization status
965+ * for USB interfaces
966+ *
967+ * note: interface_authorized_default is the default value
968+ * for initializing the authorized attribute of interfaces
969+ */
970+static ssize_t interface_authorized_default_show(struct device *dev,
971+ struct device_attribute *attr, char *buf)
972+{
973+ struct usb_device *usb_dev = to_usb_device(dev);
974+ struct usb_hcd *hcd = bus_to_hcd(usb_dev->bus);
975+
976+ return sprintf(buf, "%u\n", !!HCD_INTF_AUTHORIZED(hcd));
977+}
978+
979+/*
980+ * interface_authorized_default_store - store default authorization status
981+ * for USB interfaces
982+ *
983+ * note: interface_authorized_default is the default value
984+ * for initializing the authorized attribute of interfaces
985+ */
986+static ssize_t interface_authorized_default_store(struct device *dev,
987+ struct device_attribute *attr, const char *buf, size_t count)
988+{
989+ struct usb_device *usb_dev = to_usb_device(dev);
990+ struct usb_hcd *hcd = bus_to_hcd(usb_dev->bus);
991+ int rc = count;
992+ bool val;
993+
994+ if (strtobool(buf, &val) != 0)
995+ return -EINVAL;
996+
997+ if (val)
998+ set_bit(HCD_FLAG_INTF_AUTHORIZED, &hcd->flags);
999+ else
1000+ clear_bit(HCD_FLAG_INTF_AUTHORIZED, &hcd->flags);
1001+
1002+ return rc;
1003+}
1004+static DEVICE_ATTR_RW(interface_authorized_default);
1005+
1006+/* Group all the USB bus attributes */
1007+static struct attribute *usb_bus_attrs[] = {
1008+ &dev_attr_authorized_default.attr,
1009+ &dev_attr_interface_authorized_default.attr,
1010+ NULL,
1011+};
1012+
1013+static const struct attribute_group usb_bus_attr_group = {
1014+ .name = NULL, /* we want them in the same directory */
1015+ .attrs = usb_bus_attrs,
1016+};
1017+
1018+
1019+static int add_default_authorized_attributes(struct device *dev)
1020+{
1021+ int rc = 0;
1022+
1023+ if (is_usb_device(dev))
1024+ rc = sysfs_create_group(&dev->kobj, &usb_bus_attr_group);
1025+
1026+ return rc;
1027+}
1028+
1029+static void remove_default_authorized_attributes(struct device *dev)
1030+{
1031+ if (is_usb_device(dev)) {
1032+ sysfs_remove_group(&dev->kobj, &usb_bus_attr_group);
1033+ }
1034+}
1035+
9251036 int usb_create_sysfs_dev_files(struct usb_device *udev)
9261037 {
9271038 struct device *dev = &udev->dev;
@@ -938,7 +1049,14 @@ int usb_create_sysfs_dev_files(struct usb_device *udev) · 10 unmodified lines
9381049 retval = add_power_attributes(dev);
9391050 if (retval)
9401051 goto error;
1052+
1053+ if (is_root_hub(udev)) {
1054+ retval = add_default_authorized_attributes(dev);
1055+ if (retval)
1056+ goto error;
1057+ }
9411058 return retval;
1059+
9421060 error:
9431061 usb_remove_sysfs_dev_files(udev);
9441062 return retval;
@@ -948,6 +1066,9 @@ void usb_remove_sysfs_dev_files(struct usb_device *udev) · 3 unmodified lines
9481066 {
9491067 struct device *dev = &udev->dev;
9501068
1069+ if (is_root_hub(udev))
1070+ remove_default_authorized_attributes(dev);
1071+
9511072 remove_power_attributes(dev);
9521073 remove_persist_attributes(dev);
9531074 device_remove_bin_file(dev, &dev_bin_attr_descriptors);
drivers/usb/core/usb.h+5−0
@@ -153,6 +153,11 @@ static inline int is_usb_port(const struct device *dev) · 152 unmodified lines
153153 return dev->type == &usb_port_device_type;
154154 }
155155
156+static inline int is_root_hub(struct usb_device *udev)
157+{
158+ return (udev->parent == NULL);
159+}
160+
156161 /* Do the same for device drivers and interface drivers. */
157162
158163 static inline int is_usb_device_driver(struct device_driver *drv)
drivers/usb/host/xhci-rcar.c+7−2
@@ -238,10 +238,15 @@ int xhci_rcar_init_quirk(struct usb_hcd *hcd) · 237 unmodified lines
238238 * pointers. So, this driver clears the AC64 bit of xhci->hcc_params
239239 * to call dma_set_coherent_mask(dev, DMA_BIT_MASK(32)) in
240240 * xhci_gen_setup().
241+ *
242+ * And, since the firmware/internal CPU control the USBSTS.STS_HALT
243+ * and the process speed is down when the roothub port enters U3,
244+ * long delay for the handshake of STS_HALT is neeed in xhci_suspend().
241245 */
242246 if (xhci_rcar_is_gen2(hcd->self.controller) ||
243− xhci_rcar_is_gen3(hcd->self.controller))
244− xhci->quirks |= XHCI_NO_64BIT_SUPPORT;
247+ xhci_rcar_is_gen3(hcd->self.controller)) {
248+ xhci->quirks |= XHCI_NO_64BIT_SUPPORT | XHCI_SLOW_SUSPEND;
249+ }
245250
246251 if (!xhci_rcar_wait_for_pll_active(hcd))
247252 return -ETIMEDOUT;
drivers/usb/host/xhci.c+10−0
@@ -3089,8 +3089,18 @@ static void xhci_endpoint_reset(struct usb_hcd *hcd, · 3088 unmodified lines
30893089 return;
30903090 udev = (struct usb_device *) host_ep->hcpriv;
30913091 vdev = xhci->devs[udev->slot_id];
3092+
3093+ /*
3094+ * vdev may be lost due to xHC restore error and re-initialization
3095+ * during S3/S4 resume. A new vdev will be allocated later by
3096+ * xhci_discover_or_reset_device()
3097+ */
3098+ if (!udev->slot_id || !vdev)
3099+ return;
30923100 ep_index = xhci_get_endpoint_index(&host_ep->desc);
30933101 ep = &vdev->eps[ep_index];
3102+ if (!ep)
3103+ return;
30943104
30953105 /* Bail out if toggle is already being cleared by a endpoint reset */
30963106 if (ep->ep_state & EP_HARD_CLEAR_TOGGLE) {
drivers/usb/misc/iowarrior.c+4−3
@@ -866,19 +866,20 @@ static void iowarrior_disconnect(struct usb_interface *interface) · 865 unmodified lines
866866 dev = usb_get_intfdata(interface);
867867 mutex_lock(&iowarrior_open_disc_lock);
868868 usb_set_intfdata(interface, NULL);
869+ /* prevent device read, write and ioctl */
870+ dev->present = 0;
869871
870872 minor = dev->minor;
873+ mutex_unlock(&iowarrior_open_disc_lock);
874+ /* give back our minor - this will call close() locks need to be dropped at this point*/
871875
872− /* give back our minor */
873876 usb_deregister_dev(interface, &iowarrior_class);
874877
875878 mutex_lock(&dev->mutex);
876879
877880 /* prevent device read, write and ioctl */
878− dev->present = 0;
879881
880882 mutex_unlock(&dev->mutex);
881− mutex_unlock(&iowarrior_open_disc_lock);
882883
883884 if (dev->opened) {
884885 /* There is a process that holds a filedescriptor to the device ,
drivers/usb/misc/rio500.c+27−16
@@ -51,6 +51,7 @@ struct rio_usb_data { · 50 unmodified lines
5151 char *obuf, *ibuf; /* transfer buffers */
5252 char bulk_in_ep, bulk_out_ep; /* Endpoint assignments */
5353 wait_queue_head_t wait_q; /* for timeouts */
54+ struct mutex lock; /* general race avoidance */
5455 };
5556
5657 static DEFINE_MUTEX(rio500_mutex);
@@ -62,8 +63,10 @@ static int open_rio(struct inode *inode, struct file *file) · 5 unmodified lines
6263
6364 /* against disconnect() */
6465 mutex_lock(&rio500_mutex);
66+ mutex_lock(&(rio->lock));
6567
6668 if (rio->isopen || !rio->present) {
69+ mutex_unlock(&(rio->lock));
6770 mutex_unlock(&rio500_mutex);
6871 return -EBUSY;
6972 }
@@ -71,6 +74,7 @@ static int open_rio(struct inode *inode, struct file *file) · 1 unmodified line
7174
7275 init_waitqueue_head(&rio->wait_q);
7376
77+ mutex_unlock(&(rio->lock));
7478
7579 dev_info(&rio->rio_dev->dev, "Rio opened.\n");
7680 mutex_unlock(&rio500_mutex);
@@ -84,6 +88,7 @@ static int close_rio(struct inode *inode, struct file *file) · 7 unmodified lines
8488
8589 /* against disconnect() */
8690 mutex_lock(&rio500_mutex);
91+ mutex_lock(&(rio->lock));
8792
8893 rio->isopen = 0;
8994 if (!rio->present) {
@@ -95,6 +100,7 @@ static int close_rio(struct inode *inode, struct file *file) · 5 unmodified lines
95100 } else {
96101 dev_info(&rio->rio_dev->dev, "Rio closed.\n");
97102 }
103+ mutex_unlock(&(rio->lock));
98104 mutex_unlock(&rio500_mutex);
99105 return 0;
100106 }
@@ -109,7 +115,7 @@ static long ioctl_rio(struct file *file, unsigned int cmd, unsigned long arg) · 8 unmodified lines
109115 int retries;
110116 int retval=0;
111117
112− mutex_lock(&rio500_mutex);
118+ mutex_lock(&(rio->lock));
113119 /* Sanity check to make sure rio is connected, powered, etc */
114120 if (rio->present == 0 || rio->rio_dev == NULL) {
115121 retval = -ENODEV;
@@ -253,7 +259,7 @@ static long ioctl_rio(struct file *file, unsigned int cmd, unsigned long arg) · 137 unmodified lines
253259
254260
255261 err_out:
256− mutex_unlock(&rio500_mutex);
262+ mutex_unlock(&(rio->lock));
257263 return retval;
258264 }
259265
@@ -273,12 +279,12 @@ write_rio(struct file *file, const char __user *buffer, · 13 unmodified lines
273279 int errn = 0;
274280 int intr;
275281
276− intr = mutex_lock_interruptible(&rio500_mutex);
282+ intr = mutex_lock_interruptible(&(rio->lock));
277283 if (intr)
278284 return -EINTR;
279285 /* Sanity check to make sure rio is connected, powered, etc */
280286 if (rio->present == 0 || rio->rio_dev == NULL) {
281− mutex_unlock(&rio500_mutex);
287+ mutex_unlock(&(rio->lock));
282288 return -ENODEV;
283289 }
284290
@@ -301,7 +307,7 @@ write_rio(struct file *file, const char __user *buffer, · 16 unmodified lines
301307 goto error;
302308 }
303309 if (signal_pending(current)) {
304− mutex_unlock(&rio500_mutex);
310+ mutex_unlock(&(rio->lock));
305311 return bytes_written ? bytes_written : -EINTR;
306312 }
307313
@@ -339,12 +345,12 @@ write_rio(struct file *file, const char __user *buffer, · 31 unmodified lines
339345 buffer += copy_size;
340346 } while (count > 0);
341347
342− mutex_unlock(&rio500_mutex);
348+ mutex_unlock(&(rio->lock));
343349
344350 return bytes_written ? bytes_written : -EIO;
345351
346352 error:
347− mutex_unlock(&rio500_mutex);
353+ mutex_unlock(&(rio->lock));
348354 return errn;
349355 }
350356
@@ -361,12 +367,12 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos) · 10 unmodified lines
361367 char *ibuf;
362368 int intr;
363369
364− intr = mutex_lock_interruptible(&rio500_mutex);
370+ intr = mutex_lock_interruptible(&(rio->lock));
365371 if (intr)
366372 return -EINTR;
367373 /* Sanity check to make sure rio is connected, powered, etc */
368374 if (rio->present == 0 || rio->rio_dev == NULL) {
369− mutex_unlock(&rio500_mutex);
375+ mutex_unlock(&(rio->lock));
370376 return -ENODEV;
371377 }
372378
@@ -377,11 +383,11 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos) · 4 unmodified lines
377383
378384 while (count > 0) {
379385 if (signal_pending(current)) {
380− mutex_unlock(&rio500_mutex);
386+ mutex_unlock(&(rio->lock));
381387 return read_count ? read_count : -EINTR;
382388 }
383389 if (!rio->rio_dev) {
384− mutex_unlock(&rio500_mutex);
390+ mutex_unlock(&(rio->lock));
385391 return -ENODEV;
386392 }
387393 this_read = (count >= IBUF_SIZE) ? IBUF_SIZE : count;
@@ -399,7 +405,7 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos) · 11 unmodified lines
399405 count = this_read = partial;
400406 } else if (result == -ETIMEDOUT || result == 15) { /* FIXME: 15 ??? */
401407 if (!maxretry--) {
402− mutex_unlock(&rio500_mutex);
408+ mutex_unlock(&(rio->lock));
403409 dev_err(&rio->rio_dev->dev,
404410 "read_rio: maxretry timeout\n");
405411 return -ETIME;
@@ -409,19 +415,19 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos) · 3 unmodified lines
409415 finish_wait(&rio->wait_q, &wait);
410416 continue;
411417 } else if (result != -EREMOTEIO) {
412− mutex_unlock(&rio500_mutex);
418+ mutex_unlock(&(rio->lock));
413419 dev_err(&rio->rio_dev->dev,
414420 "Read Whoops - result:%d partial:%u this_read:%u\n",
415421 result, partial, this_read);
416422 return -EIO;
417423 } else {
418− mutex_unlock(&rio500_mutex);
424+ mutex_unlock(&(rio->lock));
419425 return (0);
420426 }
421427
422428 if (this_read) {
423429 if (copy_to_user(buffer, ibuf, this_read)) {
424− mutex_unlock(&rio500_mutex);
430+ mutex_unlock(&(rio->lock));
425431 return -EFAULT;
426432 }
427433 count -= this_read;
@@ -429,7 +435,7 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos) · 1 unmodified line
429435 buffer += this_read;
430436 }
431437 }
432− mutex_unlock(&rio500_mutex);
438+ mutex_unlock(&(rio->lock));
433439 return read_count;
434440 }
435441
@@ -494,6 +500,8 @@ static int probe_rio(struct usb_interface *intf, · 58 unmodified lines
494500 }
495501 dev_dbg(&intf->dev, "ibuf address:%p\n", rio->ibuf);
496502
503+ mutex_init(&(rio->lock));
504+
497505 usb_set_intfdata (intf, rio);
498506 rio->present = 1;
499507 bail_out:
@@ -511,10 +519,12 @@ static void disconnect_rio(struct usb_interface *intf) · 11 unmodified lines
511519 if (rio) {
512520 usb_deregister_dev(intf, &usb_rio_class);
513521
522+ mutex_lock(&(rio->lock));
514523 if (rio->isopen) {
515524 rio->isopen = 0;
516525 /* better let it finish - the release will do whats needed */
517526 rio->rio_dev = NULL;
527+ mutex_unlock(&(rio->lock));
518528 mutex_unlock(&rio500_mutex);
519529 return;
520530 }
@@ -524,6 +534,7 @@ static void disconnect_rio(struct usb_interface *intf) · 3 unmodified lines
524534 dev_info(&intf->dev, "USB Rio disconnected.\n");
525535
526536 rio->present = 0;
537+ mutex_unlock(&(rio->lock));
527538 }
528539 mutex_unlock(&rio500_mutex);
529540 }
drivers/usb/misc/yurex.c+1−1
@@ -92,7 +92,6 @@ static void yurex_delete(struct kref *kref) · 91 unmodified lines
9292
9393 dev_dbg(&dev->interface->dev, "%s\n", __func__);
9494
95− usb_put_dev(dev->udev);
9695 if (dev->cntl_urb) {
9796 usb_kill_urb(dev->cntl_urb);
9897 kfree(dev->cntl_req);
@@ -108,6 +107,7 @@ static void yurex_delete(struct kref *kref) · 9 unmodified lines
108107 dev->int_buffer, dev->urb->transfer_dma);
109108 usb_free_urb(dev->urb);
110109 }
110+ usb_put_dev(dev->udev);
111111 kfree(dev);
112112 }
113113
drivers/usb/typec/tcpm/tcpm.c+41−17
@@ -379,7 +379,8 @@ static enum tcpm_state tcpm_default_state(struct tcpm_port *port) · 378 unmodified lines
379379 return SNK_UNATTACHED;
380380 else if (port->try_role == TYPEC_SOURCE)
381381 return SRC_UNATTACHED;
382− else if (port->tcpc->config->default_role == TYPEC_SINK)
382+ else if (port->tcpc->config &&
383+ port->tcpc->config->default_role == TYPEC_SINK)
383384 return SNK_UNATTACHED;
384385 /* Fall through to return SRC_UNATTACHED */
385386 } else if (port->port_type == TYPEC_PORT_SNK) {
@@ -586,7 +587,20 @@ static void tcpm_debugfs_init(struct tcpm_port *port) · 200 unmodified lines
586587
587588 static void tcpm_debugfs_exit(struct tcpm_port *port)
588589 {
590+ int i;
591+
592+ mutex_lock(&port->logbuffer_lock);
593+ for (i = 0; i < LOG_BUFFER_ENTRIES; i++) {
594+ kfree(port->logbuffer[i]);
595+ port->logbuffer[i] = NULL;
596+ }
597+ mutex_unlock(&port->logbuffer_lock);
598+
589599 debugfs_remove(port->dentry);
600+ if (list_empty(&rootdir->d_subdirs)) {
601+ debugfs_remove(rootdir);
602+ rootdir = NULL;
603+ }
590604 }
591605
592606 #else
@@ -1095,7 +1109,8 @@ static int tcpm_pd_svdm(struct tcpm_port *port, const __le32 *payload, int cnt, · 502 unmodified lines
10951109 break;
10961110 case CMD_ATTENTION:
10971111 /* Attention command does not have response */
1098− typec_altmode_attention(adev, p[1]);
1112+ if (adev)
1113+ typec_altmode_attention(adev, p[1]);
10991114 return 0;
11001115 default:
11011116 break;
@@ -1147,20 +1162,26 @@ static int tcpm_pd_svdm(struct tcpm_port *port, const __le32 *payload, int cnt, · 45 unmodified lines
11471162 }
11481163 break;
11491164 case CMD_ENTER_MODE:
1150− typec_altmode_update_active(pdev, true);
1151−
1152− if (typec_altmode_vdm(adev, p[0], &p[1], cnt)) {
1153− response[0] = VDO(adev->svid, 1, CMD_EXIT_MODE);
1154− response[0] |= VDO_OPOS(adev->mode);
1155− return 1;
1165+ if (adev && pdev) {
1166+ typec_altmode_update_active(pdev, true);
1167+
1168+ if (typec_altmode_vdm(adev, p[0], &p[1], cnt)) {
1169+ response[0] = VDO(adev->svid, 1,
1170+ CMD_EXIT_MODE);
1171+ response[0] |= VDO_OPOS(adev->mode);
1172+ return 1;
1173+ }
11561174 }
11571175 return 0;
11581176 case CMD_EXIT_MODE:
1159− typec_altmode_update_active(pdev, false);
1177+ if (adev && pdev) {
1178+ typec_altmode_update_active(pdev, false);
11601179
1161− /* Back to USB Operation */
1162− WARN_ON(typec_altmode_notify(adev, TYPEC_STATE_USB,
1163− NULL));
1180+ /* Back to USB Operation */
1181+ WARN_ON(typec_altmode_notify(adev,
1182+ TYPEC_STATE_USB,
1183+ NULL));
1184+ }
11641185 break;
11651186 default:
11661187 break;
@@ -1170,8 +1191,10 @@ static int tcpm_pd_svdm(struct tcpm_port *port, const __le32 *payload, int cnt, · 3 unmodified lines
11701191 switch (cmd) {
11711192 case CMD_ENTER_MODE:
11721193 /* Back to USB Operation */
1173− WARN_ON(typec_altmode_notify(adev, TYPEC_STATE_USB,
1174− NULL));
1194+ if (adev)
1195+ WARN_ON(typec_altmode_notify(adev,
1196+ TYPEC_STATE_USB,
1197+ NULL));
11751198 break;
11761199 default:
11771200 break;
@@ -1182,7 +1205,8 @@ static int tcpm_pd_svdm(struct tcpm_port *port, const __le32 *payload, int cnt, · 4 unmodified lines
11821205 }
11831206
11841207 /* Informing the alternate mode drivers about everything */
1185− typec_altmode_vdm(adev, p[0], &p[1], cnt);
1208+ if (adev)
1209+ typec_altmode_vdm(adev, p[0], &p[1], cnt);
11861210
11871211 return rlen;
11881212 }
@@ -4114,7 +4138,7 @@ static int tcpm_try_role(const struct typec_capability *cap, int role) · 2925 unmodified lines
41144138 mutex_lock(&port->lock);
41154139 if (tcpc->try_role)
41164140 ret = tcpc->try_role(tcpc, role);
4117− if (!ret && !tcpc->config->try_role_hw)
4141+ if (!ret && (!tcpc->config || !tcpc->config->try_role_hw))
41184142 port->try_role = role;
41194143 port->try_src_count = 0;
41204144 port->try_snk_count = 0;
@@ -4701,7 +4725,7 @@ static int tcpm_copy_caps(struct tcpm_port *port, · 580 unmodified lines
47014725 port->typec_caps.prefer_role = tcfg->default_role;
47024726 port->typec_caps.type = tcfg->type;
47034727 port->typec_caps.data = tcfg->data;
4704− port->self_powered = port->tcpc->config->self_powered;
4728+ port->self_powered = tcfg->self_powered;
47054729
47064730 return 0;
47074731 }
drivers/usb/typec/ucsi/ucsi_ccg.c+1−1
@@ -1018,7 +1018,7 @@ release_fw: · 1017 unmodified lines
10181018 ******************************************************************************/
10191019 static int ccg_fw_update(struct ucsi_ccg *uc, enum enum_flash_mode flash_mode)
10201020 {
1021− int err;
1021+ int err = 0;
10221022
10231023 while (flash_mode != FLASH_NOT_NEEDED) {
10241024 err = do_flash(uc, flash_mode);
drivers/vhost/vhost.h+1−1
@@ -96,7 +96,7 @@ struct vhost_uaddr { · 95 unmodified lines
9696 };
9797
9898 #if defined(CONFIG_MMU_NOTIFIER) && ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE == 0
99−#define VHOST_ARCH_CAN_ACCEL_UACCESS 1
99+#define VHOST_ARCH_CAN_ACCEL_UACCESS 0
100100 #else
101101 #define VHOST_ARCH_CAN_ACCEL_UACCESS 0
102102 #endif
drivers/video/fbdev/omap/omapfb_main.c+8−0
@@ -447,6 +447,7 @@ static int set_color_mode(struct omapfb_plane_struct *plane, · 446 unmodified lines
447447 return 0;
448448 case 12:
449449 var->bits_per_pixel = 16;
450+ /* fall through */
450451 case 16:
451452 if (plane->fbdev->panel->bpp == 12)
452453 plane->color_mode = OMAPFB_COLOR_RGB444;
@@ -1534,20 +1535,27 @@ static void omapfb_free_resources(struct omapfb_device *fbdev, int state) · 1081 unmodified lines
15341535 case OMAPFB_ACTIVE:
15351536 for (i = 0; i < fbdev->mem_desc.region_cnt; i++)
15361537 unregister_framebuffer(fbdev->fb_info[i]);
1538+ /* fall through */
15371539 case 7:
15381540 omapfb_unregister_sysfs(fbdev);
1541+ /* fall through */
15391542 case 6:
15401543 if (fbdev->panel->disable)
15411544 fbdev->panel->disable(fbdev->panel);
1545+ /* fall through */
15421546 case 5:
15431547 omapfb_set_update_mode(fbdev, OMAPFB_UPDATE_DISABLED);
1548+ /* fall through */
15441549 case 4:
15451550 planes_cleanup(fbdev);
1551+ /* fall through */
15461552 case 3:
15471553 ctrl_cleanup(fbdev);
1554+ /* fall through */
15481555 case 2:
15491556 if (fbdev->panel->cleanup)
15501557 fbdev->panel->cleanup(fbdev->panel);
1558+ /* fall through */
15511559 case 1:
15521560 dev_set_drvdata(fbdev->dev, NULL);
15531561 kfree(fbdev);
drivers/watchdog/ar7_wdt.c+1−0
@@ -235,6 +235,7 @@ static long ar7_wdt_ioctl(struct file *file, · 234 unmodified lines
235235 ar7_wdt_update_margin(new_margin);
236236 ar7_wdt_kick(1);
237237 spin_unlock(&wdt_lock);
238+ /* Fall through */
238239
239240 case WDIOC_GETTIMEOUT:
240241 if (put_user(margin, (int *)arg))
drivers/watchdog/pcwd.c+1−1
@@ -651,7 +651,7 @@ static long pcwd_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 650 unmodified lines
651651 return -EINVAL;
652652
653653 pcwd_keepalive();
654− /* Fall */
654+ /* Fall through */
655655
656656 case WDIOC_GETTIMEOUT:
657657 return put_user(heartbeat, argp);
drivers/watchdog/riowd.c+1−1
@@ -134,7 +134,7 @@ static long riowd_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) · 133 unmodified lines
134134 return -EINVAL;
135135 riowd_timeout = (new_margin + 59) / 60;
136136 riowd_writereg(p, riowd_timeout, WDTO_INDEX);
137− /* Fall */
137+ /* Fall through */
138138
139139 case WDIOC_GETTIMEOUT:
140140 return put_user(riowd_timeout * 60, (int __user *)argp);
drivers/watchdog/sb_wdog.c+1−0
@@ -202,6 +202,7 @@ static long sbwdog_ioctl(struct file *file, unsigned int cmd, · 201 unmodified lines
202202 timeout = time;
203203 sbwdog_set(user_dog, timeout);
204204 sbwdog_pet(user_dog);
205+ /* Fall through */
205206
206207 case WDIOC_GETTIMEOUT:
207208 /*
drivers/watchdog/scx200_wdt.c+1−0
@@ -186,6 +186,7 @@ static long scx200_wdt_ioctl(struct file *file, unsigned int cmd, · 185 unmodified lines
186186 margin = new_margin;
187187 scx200_wdt_update_margin();
188188 scx200_wdt_ping();
189+ /* Fall through */
189190 case WDIOC_GETTIMEOUT:
190191 if (put_user(margin, p))
191192 return -EFAULT;
drivers/watchdog/wdt.c+1−1
@@ -389,7 +389,7 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 388 unmodified lines
389389 if (wdt_set_heartbeat(new_heartbeat))
390390 return -EINVAL;
391391 wdt_ping();
392− /* Fall */
392+ /* Fall through */
393393 case WDIOC_GETTIMEOUT:
394394 return put_user(heartbeat, p);
395395 default:
drivers/watchdog/wdt977.c+1−1
@@ -398,7 +398,7 @@ static long wdt977_ioctl(struct file *file, unsigned int cmd, · 397 unmodified lines
398398 return -EINVAL;
399399
400400 wdt977_keepalive();
401− /* Fall */
401+ /* Fall through */
402402
403403 case WDIOC_GETTIMEOUT:
404404 return put_user(timeout, uarg.i);
drivers/xen/gntdev.c+1−1
@@ -1143,7 +1143,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma) · 1142 unmodified lines
11431143 goto out_put_map;
11441144
11451145 if (!use_ptemod) {
1146− err = vm_map_pages(vma, map->pages, map->count);
1146+ err = vm_map_pages_zero(vma, map->pages, map->count);
11471147 if (err)
11481148 goto out_put_map;
11491149 } else {
drivers/xen/privcmd.c+5−30
@@ -724,25 +724,6 @@ static long privcmd_ioctl_restrict(struct file *file, void __user *udata) · 723 unmodified lines
724724 return 0;
725725 }
726726
727−struct remap_pfn {
728− struct mm_struct *mm;
729− struct page **pages;
730− pgprot_t prot;
731− unsigned long i;
732−};
733−
734−static int remap_pfn_fn(pte_t *ptep, unsigned long addr, void *data)
735−{
736− struct remap_pfn *r = data;
737− struct page *page = r->pages[r->i];
738− pte_t pte = pte_mkspecial(pfn_pte(page_to_pfn(page), r->prot));
739−
740− set_pte_at(r->mm, addr, ptep, pte);
741− r->i++;
742−
743− return 0;
744−}
745−
746727 static long privcmd_ioctl_mmap_resource(struct file *file, void __user *udata)
747728 {
748729 struct privcmd_data *data = file->private_data;
@@ -774,7 +755,8 @@ static long privcmd_ioctl_mmap_resource(struct file *file, void __user *udata) · 25 unmodified lines
774755 goto out;
775756 }
776757
777− if (xen_feature(XENFEAT_auto_translated_physmap)) {
758+ if (IS_ENABLED(CONFIG_XEN_AUTO_XLATE) &&
759+ xen_feature(XENFEAT_auto_translated_physmap)) {
778760 unsigned int nr = DIV_ROUND_UP(kdata.num, XEN_PFN_PER_PAGE);
779761 struct page **pages;
780762 unsigned int i;
@@ -808,16 +790,9 @@ static long privcmd_ioctl_mmap_resource(struct file *file, void __user *udata) · 27 unmodified lines
808790 if (rc)
809791 goto out;
810792
811− if (xen_feature(XENFEAT_auto_translated_physmap)) {
812− struct remap_pfn r = {
813− .mm = vma->vm_mm,
814− .pages = vma->vm_private_data,
815− .prot = vma->vm_page_prot,
816− };
817−
818− rc = apply_to_page_range(r.mm, kdata.addr,
819− kdata.num << PAGE_SHIFT,
820− remap_pfn_fn, &r);
793+ if (IS_ENABLED(CONFIG_XEN_AUTO_XLATE) &&
794+ xen_feature(XENFEAT_auto_translated_physmap)) {
795+ rc = xen_remap_vma_range(vma, kdata.addr, kdata.num << PAGE_SHIFT);
821796 } else {
822797 unsigned int domid =
823798 (xdata.flags & XENMEM_rsrc_acq_caller_owned) ?
drivers/xen/swiotlb-xen.c+10−24
@@ -83,34 +83,18 @@ static inline dma_addr_t xen_virt_to_bus(void *address) · 82 unmodified lines
8383 return xen_phys_to_bus(virt_to_phys(address));
8484 }
8585
86−static int check_pages_physically_contiguous(unsigned long xen_pfn,
87− unsigned int offset,
88− size_t length)
86+static inline int range_straddles_page_boundary(phys_addr_t p, size_t size)
8987 {
90− unsigned long next_bfn;
91− int i;
92− int nr_pages;
88+ unsigned long next_bfn, xen_pfn = XEN_PFN_DOWN(p);
89+ unsigned int i, nr_pages = XEN_PFN_UP(xen_offset_in_page(p) + size);
9390
9491 next_bfn = pfn_to_bfn(xen_pfn);
95− nr_pages = (offset + length + XEN_PAGE_SIZE-1) >> XEN_PAGE_SHIFT;
9692
97− for (i = 1; i < nr_pages; i++) {
93+ for (i = 1; i < nr_pages; i++)
9894 if (pfn_to_bfn(++xen_pfn) != ++next_bfn)
99− return 0;
100− }
101− return 1;
102−}
95+ return 1;
10396
104−static inline int range_straddles_page_boundary(phys_addr_t p, size_t size)
105−{
106− unsigned long xen_pfn = XEN_PFN_DOWN(p);
107− unsigned int offset = p & ~XEN_PAGE_MASK;
108−
109− if (offset + size <= XEN_PAGE_SIZE)
110− return 0;
111− if (check_pages_physically_contiguous(xen_pfn, offset, size))
112− return 0;
113− return 1;
97+ return 0;
11498 }
11599
116100 static int is_xen_swiotlb_buffer(dma_addr_t dma_addr)
@@ -338,6 +322,7 @@ xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size, · 221 unmodified lines
338322 xen_free_coherent_pages(hwdev, size, ret, (dma_addr_t)phys, attrs);
339323 return NULL;
340324 }
325+ SetPageXenRemapped(virt_to_page(ret));
341326 }
342327 memset(ret, 0, size);
343328 return ret;
@@ -361,8 +346,9 @@ xen_swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr, · 17 unmodified lines
361346 /* Convert the size to actually allocated. */
362347 size = 1UL << (order + XEN_PAGE_SHIFT);
363348
364− if (((dev_addr + size - 1 <= dma_mask)) ||
365− range_straddles_page_boundary(phys, size))
349+ if (!WARN_ON((dev_addr + size - 1 > dma_mask) ||
350+ range_straddles_page_boundary(phys, size)) &&
351+ TestClearPageXenRemapped(virt_to_page(vaddr)))
366352 xen_destroy_contiguous_region(phys, order);
367353
368354 xen_free_coherent_pages(hwdev, size, vaddr, (dma_addr_t)phys, attrs);
drivers/xen/xen-pciback/conf_space_capability.c+1−2
@@ -116,13 +116,12 @@ static int pm_ctrl_write(struct pci_dev *dev, int offset, u16 new_value, · 115 unmodified lines
116116 {
117117 int err;
118118 u16 old_value;
119− pci_power_t new_state, old_state;
119+ pci_power_t new_state;
120120
121121 err = pci_read_config_word(dev, offset, &old_value);
122122 if (err)
123123 goto out;
124124
125− old_state = (pci_power_t)(old_value & PCI_PM_CTRL_STATE_MASK);
126125 new_state = (pci_power_t)(new_value & PCI_PM_CTRL_STATE_MASK);
127126
128127 new_value &= PM_OK_BITS;
drivers/xen/xlate_mmu.c+32−0
@@ -262,3 +262,35 @@ int __init xen_xlate_map_ballooned_pages(xen_pfn_t **gfns, void **virt, · 261 unmodified lines
262262 return 0;
263263 }
264264 EXPORT_SYMBOL_GPL(xen_xlate_map_ballooned_pages);
265+
266+struct remap_pfn {
267+ struct mm_struct *mm;
268+ struct page **pages;
269+ pgprot_t prot;
270+ unsigned long i;
271+};
272+
273+static int remap_pfn_fn(pte_t *ptep, unsigned long addr, void *data)
274+{
275+ struct remap_pfn *r = data;
276+ struct page *page = r->pages[r->i];
277+ pte_t pte = pte_mkspecial(pfn_pte(page_to_pfn(page), r->prot));
278+
279+ set_pte_at(r->mm, addr, ptep, pte);
280+ r->i++;
281+
282+ return 0;
283+}
284+
285+/* Used by the privcmd module, but has to be built-in on ARM */
286+int xen_remap_vma_range(struct vm_area_struct *vma, unsigned long addr, unsigned long len)
287+{
288+ struct remap_pfn r = {
289+ .mm = vma->vm_mm,
290+ .pages = vma->vm_private_data,
291+ .prot = vma->vm_page_prot,
292+ };
293+
294+ return apply_to_page_range(vma->vm_mm, addr, len, remap_pfn_fn, &r);
295+}
296+EXPORT_SYMBOL_GPL(xen_remap_vma_range);
fs/block_dev.c+73−40
@@ -349,7 +349,7 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) · 348 unmodified lines
349349 loff_t pos = iocb->ki_pos;
350350 blk_qc_t qc = BLK_QC_T_NONE;
351351 gfp_t gfp;
352− ssize_t ret;
352+ int ret;
353353
354354 if ((pos | iov_iter_alignment(iter)) &
355355 (bdev_logical_block_size(bdev) - 1))
@@ -386,8 +386,6 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) · 30 unmodified lines
386386
387387 ret = 0;
388388 for (;;) {
389− int err;
390−
391389 bio_set_dev(bio, bdev);
392390 bio->bi_iter.bi_sector = pos >> 9;
393391 bio->bi_write_hint = iocb->ki_hint;
@@ -395,10 +393,8 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) · 1 unmodified line
395393 bio->bi_end_io = blkdev_bio_end_io;
396394 bio->bi_ioprio = iocb->ki_ioprio;
397395
398− err = bio_iov_iter_get_pages(bio, iter);
399− if (unlikely(err)) {
400− if (!ret)
401− ret = err;
396+ ret = bio_iov_iter_get_pages(bio, iter);
397+ if (unlikely(ret)) {
402398 bio->bi_status = BLK_STS_IOERR;
403399 bio_endio(bio);
404400 break;
@@ -421,7 +417,6 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) · 16 unmodified lines
421417 if (nowait)
422418 bio->bi_opf |= (REQ_NOWAIT | REQ_NOWAIT_INLINE);
423419
424− dio->size += bio->bi_iter.bi_size;
425420 pos += bio->bi_iter.bi_size;
426421
427422 nr_pages = iov_iter_npages(iter, BIO_MAX_PAGES);
@@ -433,10 +428,11 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) · 5 unmodified lines
433428 polled = true;
434429 }
435430
431+ dio->size += bio->bi_iter.bi_size;
436432 qc = submit_bio(bio);
437433 if (qc == BLK_QC_T_EAGAIN) {
438− if (!ret)
439− ret = -EAGAIN;
434+ dio->size -= bio->bi_iter.bi_size;
435+ ret = -EAGAIN;
440436 goto error;
441437 }
442438
@@ -459,18 +455,17 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) · 16 unmodified lines
459455 atomic_inc(&dio->ref);
460456 }
461457
458+ dio->size += bio->bi_iter.bi_size;
462459 qc = submit_bio(bio);
463460 if (qc == BLK_QC_T_EAGAIN) {
464− if (!ret)
465− ret = -EAGAIN;
461+ dio->size -= bio->bi_iter.bi_size;
462+ ret = -EAGAIN;
466463 goto error;
467464 }
468− ret += bio->bi_iter.bi_size;
469465
470466 bio = bio_alloc(gfp, nr_pages);
471467 if (!bio) {
472− if (!ret)
473− ret = -EAGAIN;
468+ ret = -EAGAIN;
474469 goto error;
475470 }
476471 }
@@ -495,6 +490,8 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) · 18 unmodified lines
495490 out:
496491 if (!ret)
497492 ret = blk_status_to_errno(dio->bio.bi_status);
493+ if (likely(!ret))
494+ ret = dio->size;
498495
499496 bio_put(&dio->bio);
500497 return ret;
@@ -1181,8 +1178,7 @@ static struct gendisk *bdev_get_gendisk(struct block_device *bdev, int *partno) · 680 unmodified lines
11811178 * Pointer to the block device containing @bdev on success, ERR_PTR()
11821179 * value on failure.
11831180 */
1184−static struct block_device *bd_start_claiming(struct block_device *bdev,
1185− void *holder)
1181+struct block_device *bd_start_claiming(struct block_device *bdev, void *holder)
11861182 {
11871183 struct gendisk *disk;
11881184 struct block_device *whole;
@@ -1229,6 +1225,62 @@ static struct block_device *bd_start_claiming(struct block_device *bdev, · 40 unmodified lines
12291225 return ERR_PTR(err);
12301226 }
12311227 }
1228+EXPORT_SYMBOL(bd_start_claiming);
1229+
1230+static void bd_clear_claiming(struct block_device *whole, void *holder)
1231+{
1232+ lockdep_assert_held(&bdev_lock);
1233+ /* tell others that we're done */
1234+ BUG_ON(whole->bd_claiming != holder);
1235+ whole->bd_claiming = NULL;
1236+ wake_up_bit(&whole->bd_claiming, 0);
1237+}
1238+
1239+/**
1240+ * bd_finish_claiming - finish claiming of a block device
1241+ * @bdev: block device of interest
1242+ * @whole: whole block device (returned from bd_start_claiming())
1243+ * @holder: holder that has claimed @bdev
1244+ *
1245+ * Finish exclusive open of a block device. Mark the device as exlusively
1246+ * open by the holder and wake up all waiters for exclusive open to finish.
1247+ */
1248+void bd_finish_claiming(struct block_device *bdev, struct block_device *whole,
1249+ void *holder)
1250+{
1251+ spin_lock(&bdev_lock);
1252+ BUG_ON(!bd_may_claim(bdev, whole, holder));
1253+ /*
1254+ * Note that for a whole device bd_holders will be incremented twice,
1255+ * and bd_holder will be set to bd_may_claim before being set to holder
1256+ */
1257+ whole->bd_holders++;
1258+ whole->bd_holder = bd_may_claim;
1259+ bdev->bd_holders++;
1260+ bdev->bd_holder = holder;
1261+ bd_clear_claiming(whole, holder);
1262+ spin_unlock(&bdev_lock);
1263+}
1264+EXPORT_SYMBOL(bd_finish_claiming);
1265+
1266+/**
1267+ * bd_abort_claiming - abort claiming of a block device
1268+ * @bdev: block device of interest
1269+ * @whole: whole block device (returned from bd_start_claiming())
1270+ * @holder: holder that has claimed @bdev
1271+ *
1272+ * Abort claiming of a block device when the exclusive open failed. This can be
1273+ * also used when exclusive open is not actually desired and we just needed
1274+ * to block other exclusive openers for a while.
1275+ */
1276+void bd_abort_claiming(struct block_device *bdev, struct block_device *whole,
1277+ void *holder)
1278+{
1279+ spin_lock(&bdev_lock);
1280+ bd_clear_claiming(whole, holder);
1281+ spin_unlock(&bdev_lock);
1282+}
1283+EXPORT_SYMBOL(bd_abort_claiming);
12321284
12331285 #ifdef CONFIG_SYSFS
12341286 struct bd_holder_disk {
@@ -1698,29 +1750,10 @@ int blkdev_get(struct block_device *bdev, fmode_t mode, void *holder) · 463 unmodified lines
16981750
16991751 /* finish claiming */
17001752 mutex_lock(&bdev->bd_mutex);
1701− spin_lock(&bdev_lock);
1702−
1703− if (!res) {
1704− BUG_ON(!bd_may_claim(bdev, whole, holder));
1705− /*
1706− * Note that for a whole device bd_holders
1707− * will be incremented twice, and bd_holder
1708− * will be set to bd_may_claim before being
1709− * set to holder
1710− */
1711− whole->bd_holders++;
1712− whole->bd_holder = bd_may_claim;
1713− bdev->bd_holders++;
1714− bdev->bd_holder = holder;
1715− }
1716−
1717− /* tell others that we're done */
1718− BUG_ON(whole->bd_claiming != holder);
1719− whole->bd_claiming = NULL;
1720− wake_up_bit(&whole->bd_claiming, 0);
1721−
1722− spin_unlock(&bdev_lock);
1723−
1753+ if (!res)
1754+ bd_finish_claiming(bdev, whole, holder);
1755+ else
1756+ bd_abort_claiming(bdev, whole, holder);
17241757 /*
17251758 * Block event polling for write claims if requested. Any
17261759 * write holder makes the write_holder state stick until
fs/btrfs/backref.c+1−1
@@ -1483,7 +1483,7 @@ int btrfs_check_shared(struct btrfs_root *root, u64 inum, u64 bytenr, · 1482 unmodified lines
14831483 ulist_init(roots);
14841484 ulist_init(tmp);
14851485
1486− trans = btrfs_attach_transaction(root);
1486+ trans = btrfs_join_transaction_nostart(root);
14871487 if (IS_ERR(trans)) {
14881488 if (PTR_ERR(trans) != -ENOENT && PTR_ERR(trans) != -EROFS) {
14891489 ret = PTR_ERR(trans);
fs/btrfs/send.c+15−62
@@ -6322,68 +6322,21 @@ static int changed_extent(struct send_ctx *sctx, · 6321 unmodified lines
63226322 {
63236323 int ret = 0;
63246324
6325− if (sctx->cur_ino != sctx->cmp_key->objectid) {
6326−
6327− if (result == BTRFS_COMPARE_TREE_CHANGED) {
6328− struct extent_buffer *leaf_l;
6329− struct extent_buffer *leaf_r;
6330− struct btrfs_file_extent_item *ei_l;
6331− struct btrfs_file_extent_item *ei_r;
6332−
6333− leaf_l = sctx->left_path->nodes[0];
6334− leaf_r = sctx->right_path->nodes[0];
6335− ei_l = btrfs_item_ptr(leaf_l,
6336− sctx->left_path->slots[0],
6337− struct btrfs_file_extent_item);
6338− ei_r = btrfs_item_ptr(leaf_r,
6339− sctx->right_path->slots[0],
6340− struct btrfs_file_extent_item);
6341−
6342− /*
6343− * We may have found an extent item that has changed
6344− * only its disk_bytenr field and the corresponding
6345− * inode item was not updated. This case happens due to
6346− * very specific timings during relocation when a leaf
6347− * that contains file extent items is COWed while
6348− * relocation is ongoing and its in the stage where it
6349− * updates data pointers. So when this happens we can
6350− * safely ignore it since we know it's the same extent,
6351− * but just at different logical and physical locations
6352− * (when an extent is fully replaced with a new one, we
6353− * know the generation number must have changed too,
6354− * since snapshot creation implies committing the current
6355− * transaction, and the inode item must have been updated
6356− * as well).
6357− * This replacement of the disk_bytenr happens at
6358− * relocation.c:replace_file_extents() through
6359− * relocation.c:btrfs_reloc_cow_block().
6360− */
6361− if (btrfs_file_extent_generation(leaf_l, ei_l) ==
6362− btrfs_file_extent_generation(leaf_r, ei_r) &&
6363− btrfs_file_extent_ram_bytes(leaf_l, ei_l) ==
6364− btrfs_file_extent_ram_bytes(leaf_r, ei_r) &&
6365− btrfs_file_extent_compression(leaf_l, ei_l) ==
6366− btrfs_file_extent_compression(leaf_r, ei_r) &&
6367− btrfs_file_extent_encryption(leaf_l, ei_l) ==
6368− btrfs_file_extent_encryption(leaf_r, ei_r) &&
6369− btrfs_file_extent_other_encoding(leaf_l, ei_l) ==
6370− btrfs_file_extent_other_encoding(leaf_r, ei_r) &&
6371− btrfs_file_extent_type(leaf_l, ei_l) ==
6372− btrfs_file_extent_type(leaf_r, ei_r) &&
6373− btrfs_file_extent_disk_bytenr(leaf_l, ei_l) !=
6374− btrfs_file_extent_disk_bytenr(leaf_r, ei_r) &&
6375− btrfs_file_extent_disk_num_bytes(leaf_l, ei_l) ==
6376− btrfs_file_extent_disk_num_bytes(leaf_r, ei_r) &&
6377− btrfs_file_extent_offset(leaf_l, ei_l) ==
6378− btrfs_file_extent_offset(leaf_r, ei_r) &&
6379− btrfs_file_extent_num_bytes(leaf_l, ei_l) ==
6380− btrfs_file_extent_num_bytes(leaf_r, ei_r))
6381− return 0;
6382− }
6383−
6384− inconsistent_snapshot_error(sctx, result, "extent");
6385− return -EIO;
6386− }
6325+ /*
6326+ * We have found an extent item that changed without the inode item
6327+ * having changed. This can happen either after relocation (where the
6328+ * disk_bytenr of an extent item is replaced at
6329+ * relocation.c:replace_file_extents()) or after deduplication into a
6330+ * file in both the parent and send snapshots (where an extent item can
6331+ * get modified or replaced with a new one). Note that deduplication
6332+ * updates the inode item, but it only changes the iversion (sequence
6333+ * field in the inode item) of the inode, so if a file is deduplicated
6334+ * the same amount of times in both the parent and send snapshots, its
6335+ * iversion becames the same in both snapshots, whence the inode item is
6336+ * the same on both snapshots.
6337+ */
6338+ if (sctx->cur_ino != sctx->cmp_key->objectid)
6339+ return 0;
63876340
63886341 if (!sctx->cur_inode_new_gen && !sctx->cur_inode_deleted) {
63896342 if (result != BTRFS_COMPARE_TREE_DELETED)
fs/btrfs/transaction.c+28−4
@@ -28,15 +28,18 @@ static const unsigned int btrfs_blocked_trans_types[TRANS_STATE_MAX] = { · 27 unmodified lines
2828 [TRANS_STATE_COMMIT_START] = (__TRANS_START | __TRANS_ATTACH),
2929 [TRANS_STATE_COMMIT_DOING] = (__TRANS_START |
3030 __TRANS_ATTACH |
31− __TRANS_JOIN),
31+ __TRANS_JOIN |
32+ __TRANS_JOIN_NOSTART),
3233 [TRANS_STATE_UNBLOCKED] = (__TRANS_START |
3334 __TRANS_ATTACH |
3435 __TRANS_JOIN |
35− __TRANS_JOIN_NOLOCK),
36+ __TRANS_JOIN_NOLOCK |
37+ __TRANS_JOIN_NOSTART),
3638 [TRANS_STATE_COMPLETED] = (__TRANS_START |
3739 __TRANS_ATTACH |
3840 __TRANS_JOIN |
39− __TRANS_JOIN_NOLOCK),
41+ __TRANS_JOIN_NOLOCK |
42+ __TRANS_JOIN_NOSTART),
4043 };
4144
4245 void btrfs_put_transaction(struct btrfs_transaction *transaction)
@@ -543,7 +546,8 @@ again: · 500 unmodified lines
543546 ret = join_transaction(fs_info, type);
544547 if (ret == -EBUSY) {
545548 wait_current_trans(fs_info);
546− if (unlikely(type == TRANS_ATTACH))
549+ if (unlikely(type == TRANS_ATTACH ||
550+ type == TRANS_JOIN_NOSTART))
547551 ret = -ENOENT;
548552 }
549553 } while (ret == -EBUSY);
@@ -659,6 +663,16 @@ struct btrfs_trans_handle *btrfs_join_transaction_nolock(struct btrfs_root *root · 109 unmodified lines
659663 BTRFS_RESERVE_NO_FLUSH, true);
660664 }
661665
666+/*
667+ * Similar to regular join but it never starts a transaction when none is
668+ * running or after waiting for the current one to finish.
669+ */
670+struct btrfs_trans_handle *btrfs_join_transaction_nostart(struct btrfs_root *root)
671+{
672+ return start_transaction(root, 0, TRANS_JOIN_NOSTART,
673+ BTRFS_RESERVE_NO_FLUSH, true);
674+}
675+
662676 /*
663677 * btrfs_attach_transaction() - catch the running transaction
664678 *
@@ -2037,6 +2051,16 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans) · 1372 unmodified lines
20372051 }
20382052 } else {
20392053 spin_unlock(&fs_info->trans_lock);
2054+ /*
2055+ * The previous transaction was aborted and was already removed
2056+ * from the list of transactions at fs_info->trans_list. So we
2057+ * abort to prevent writing a new superblock that reflects a
2058+ * corrupt state (pointing to trees with unwritten nodes/leafs).
2059+ */
2060+ if (test_bit(BTRFS_FS_STATE_TRANS_ABORTED, &fs_info->fs_state)) {
2061+ ret = -EROFS;
2062+ goto cleanup_transaction;
2063+ }
20402064 }
20412065
20422066 extwriter_counter_dec(cur_trans, trans->type);
fs/btrfs/transaction.h+3−0
@@ -94,11 +94,13 @@ struct btrfs_transaction { · 93 unmodified lines
9494 #define __TRANS_JOIN (1U << 11)
9595 #define __TRANS_JOIN_NOLOCK (1U << 12)
9696 #define __TRANS_DUMMY (1U << 13)
97+#define __TRANS_JOIN_NOSTART (1U << 14)
9798
9899 #define TRANS_START (__TRANS_START | __TRANS_FREEZABLE)
99100 #define TRANS_ATTACH (__TRANS_ATTACH)
100101 #define TRANS_JOIN (__TRANS_JOIN | __TRANS_FREEZABLE)
101102 #define TRANS_JOIN_NOLOCK (__TRANS_JOIN_NOLOCK)
103+#define TRANS_JOIN_NOSTART (__TRANS_JOIN_NOSTART)
102104
103105 #define TRANS_EXTWRITERS (__TRANS_START | __TRANS_ATTACH)
104106
@@ -183,6 +185,7 @@ struct btrfs_trans_handle *btrfs_start_transaction_fallback_global_rsv( · 78 unmodified lines
183185 int min_factor);
184186 struct btrfs_trans_handle *btrfs_join_transaction(struct btrfs_root *root);
185187 struct btrfs_trans_handle *btrfs_join_transaction_nolock(struct btrfs_root *root);
188+struct btrfs_trans_handle *btrfs_join_transaction_nostart(struct btrfs_root *root);
186189 struct btrfs_trans_handle *btrfs_attach_transaction(struct btrfs_root *root);
187190 struct btrfs_trans_handle *btrfs_attach_transaction_barrier(
188191 struct btrfs_root *root);
fs/cifs/connect.c+1−0
@@ -1113,6 +1113,7 @@ cifs_demultiplex_thread(void *p) · 1112 unmodified lines
11131113 mempool_resize(cifs_req_poolp, length + cifs_min_rcv);
11141114
11151115 set_freezable();
1116+ allow_signal(SIGKILL);
11161117 while (server->tcpStatus != CifsExiting) {
11171118 if (try_to_freeze())
11181119 continue;
fs/cifs/smb2ops.c+26−13
@@ -3489,7 +3489,15 @@ fill_transform_hdr(struct smb2_transform_hdr *tr_hdr, unsigned int orig_len, · 3488 unmodified lines
34893489 static inline void smb2_sg_set_buf(struct scatterlist *sg, const void *buf,
34903490 unsigned int buflen)
34913491 {
3492− sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf));
3492+ void *addr;
3493+ /*
3494+ * VMAP_STACK (at least) puts stack into the vmalloc address space
3495+ */
3496+ if (is_vmalloc_addr(buf))
3497+ addr = vmalloc_to_page(buf);
3498+ else
3499+ addr = virt_to_page(buf);
3500+ sg_set_page(sg, addr, buflen, offset_in_page(buf));
34933501 }
34943502
34953503 /* Assumes the first rqst has a transform header as the first iov.
@@ -4070,7 +4078,6 @@ receive_encrypted_standard(struct TCP_Server_Info *server, · 574 unmodified lines
40704078 {
40714079 int ret, length;
40724080 char *buf = server->smallbuf;
4073− char *tmpbuf;
40744081 struct smb2_sync_hdr *shdr;
40754082 unsigned int pdu_length = server->pdu_size;
40764083 unsigned int buf_size;
@@ -4100,18 +4107,15 @@ receive_encrypted_standard(struct TCP_Server_Info *server, · 23 unmodified lines
41004107 return length;
41014108
41024109 next_is_large = server->large_buf;
4103− one_more:
4110+one_more:
41044111 shdr = (struct smb2_sync_hdr *)buf;
41054112 if (shdr->NextCommand) {
4106− if (next_is_large) {
4107− tmpbuf = server->bigbuf;
4113+ if (next_is_large)
41084114 next_buffer = (char *)cifs_buf_get();
4109− } else {
4110− tmpbuf = server->smallbuf;
4115+ else
41114116 next_buffer = (char *)cifs_small_buf_get();
4112− }
41134117 memcpy(next_buffer,
4114− tmpbuf + le32_to_cpu(shdr->NextCommand),
4118+ buf + le32_to_cpu(shdr->NextCommand),
41154119 pdu_length - le32_to_cpu(shdr->NextCommand));
41164120 }
41174121
@@ -4140,12 +4144,21 @@ receive_encrypted_standard(struct TCP_Server_Info *server, · 22 unmodified lines
41404144 pdu_length -= le32_to_cpu(shdr->NextCommand);
41414145 server->large_buf = next_is_large;
41424146 if (next_is_large)
4143− server->bigbuf = next_buffer;
4147+ server->bigbuf = buf = next_buffer;
41444148 else
4145− server->smallbuf = next_buffer;
4146−
4147− buf += le32_to_cpu(shdr->NextCommand);
4149+ server->smallbuf = buf = next_buffer;
41484150 goto one_more;
4151+ } else if (ret != 0) {
4152+ /*
4153+ * ret != 0 here means that we didn't get to handle_mid() thus
4154+ * server->smallbuf and server->bigbuf are still valid. We need
4155+ * to free next_buffer because it is not going to be used
4156+ * anywhere.
4157+ */
4158+ if (next_is_large)
4159+ free_rsp_buf(CIFS_LARGE_BUFFER, next_buffer);
4160+ else
4161+ free_rsp_buf(CIFS_SMALL_BUFFER, next_buffer);
41494162 }
41504163
41514164 return ret;
fs/cifs/smb2pdu.c+6−1
@@ -252,7 +252,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon) · 251 unmodified lines
252252 if (tcon == NULL)
253253 return 0;
254254
255− if (smb2_command == SMB2_TREE_CONNECT)
255+ if (smb2_command == SMB2_TREE_CONNECT || smb2_command == SMB2_IOCTL)
256256 return 0;
257257
258258 if (tcon->tidStatus == CifsExiting) {
@@ -1196,7 +1196,12 @@ SMB2_sess_alloc_buffer(struct SMB2_sess_data *sess_data) · 937 unmodified lines
11961196 else
11971197 req->SecurityMode = 0;
11981198
1199+#ifdef CONFIG_CIFS_DFS_UPCALL
1200+ req->Capabilities = cpu_to_le32(SMB2_GLOBAL_CAP_DFS);
1201+#else
11991202 req->Capabilities = 0;
1203+#endif /* DFS_UPCALL */
1204+
12001205 req->Channel = 0; /* MBZ */
12011206
12021207 sess_data->iov[0].iov_base = (char *)req;
fs/compat_ioctl.c+0−3
@@ -638,9 +638,6 @@ COMPATIBLE_IOCTL(PPPIOCDISCONN) · 637 unmodified lines
638638 COMPATIBLE_IOCTL(PPPIOCATTCHAN)
639639 COMPATIBLE_IOCTL(PPPIOCGCHAN)
640640 COMPATIBLE_IOCTL(PPPIOCGL2TPSTATS)
641−/* PPPOX */
642−COMPATIBLE_IOCTL(PPPOEIOCSFWD)
643−COMPATIBLE_IOCTL(PPPOEIOCDFWD)
644641 /* Big A */
645642 /* sparc only */
646643 /* Big Q for sound/OSS */
fs/coredump.c+39−5
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 #include <linux/stat.h>
88 #include <linux/fcntl.h>
99 #include <linux/swap.h>
10+#include <linux/ctype.h>
1011 #include <linux/string.h>
1112 #include <linux/init.h>
1213 #include <linux/pagemap.h>
@@ -187,11 +188,13 @@ put_exe_file: · 174 unmodified lines
187188 * name into corename, which must have space for at least
188189 * CORENAME_MAX_SIZE bytes plus one byte for the zero terminator.
189190 */
190−static int format_corename(struct core_name *cn, struct coredump_params *cprm)
191+static int format_corename(struct core_name *cn, struct coredump_params *cprm,
192+ size_t **argv, int *argc)
191193 {
192194 const struct cred *cred = current_cred();
193195 const char *pat_ptr = core_pattern;
194196 int ispipe = (*pat_ptr == '|');
197+ bool was_space = false;
195198 int pid_in_pattern = 0;
196199 int err = 0;
197200
@@ -201,12 +204,35 @@ static int format_corename(struct core_name *cn, struct coredump_params *cprm) · 3 unmodified lines
201204 return -ENOMEM;
202205 cn->corename[0] = '\0';
203206
204− if (ispipe)
207+ if (ispipe) {
208+ int argvs = sizeof(core_pattern) / 2;
209+ (*argv) = kmalloc_array(argvs, sizeof(**argv), GFP_KERNEL);
210+ if (!(*argv))
211+ return -ENOMEM;
212+ (*argv)[(*argc)++] = 0;
205213 ++pat_ptr;
214+ }
206215
207216 /* Repeat as long as we have more pattern to process and more output
208217 space */
209218 while (*pat_ptr) {
219+ /*
220+ * Split on spaces before doing template expansion so that
221+ * %e and %E don't get split if they have spaces in them
222+ */
223+ if (ispipe) {
224+ if (isspace(*pat_ptr)) {
225+ was_space = true;
226+ pat_ptr++;
227+ continue;
228+ } else if (was_space) {
229+ was_space = false;
230+ err = cn_printf(cn, "%c", '\0');
231+ if (err)
232+ return err;
233+ (*argv)[(*argc)++] = cn->used;
234+ }
235+ }
210236 if (*pat_ptr != '%') {
211237 err = cn_printf(cn, "%c", *pat_ptr++);
212238 } else {
@@ -546,6 +572,8 @@ void do_coredump(const kernel_siginfo_t *siginfo) · 333 unmodified lines
546572 struct cred *cred;
547573 int retval = 0;
548574 int ispipe;
575+ size_t *argv = NULL;
576+ int argc = 0;
549577 struct files_struct *displaced;
550578 /* require nonrelative corefile path and be extra careful */
551579 bool need_suid_safe = false;
@@ -592,9 +620,10 @@ void do_coredump(const kernel_siginfo_t *siginfo) · 40 unmodified lines
592620
593621 old_cred = override_creds(cred);
594622
595− ispipe = format_corename(&cn, &cprm);
623+ ispipe = format_corename(&cn, &cprm, &argv, &argc);
596624
597625 if (ispipe) {
626+ int argi;
598627 int dump_count;
599628 char **helper_argv;
600629 struct subprocess_info *sub_info;
@@ -637,12 +666,16 @@ void do_coredump(const kernel_siginfo_t *siginfo) · 36 unmodified lines
637666 goto fail_dropcount;
638667 }
639668
640− helper_argv = argv_split(GFP_KERNEL, cn.corename, NULL);
669+ helper_argv = kmalloc_array(argc + 1, sizeof(*helper_argv),
670+ GFP_KERNEL);
641671 if (!helper_argv) {
642672 printk(KERN_WARNING "%s failed to allocate memory\n",
643673 __func__);
644674 goto fail_dropcount;
645675 }
676+ for (argi = 0; argi < argc; argi++)
677+ helper_argv[argi] = cn.corename + argv[argi];
678+ helper_argv[argi] = NULL;
646679
647680 retval = -ENOMEM;
648681 sub_info = call_usermodehelper_setup(helper_argv[0],
@@ -652,7 +685,7 @@ void do_coredump(const kernel_siginfo_t *siginfo) · 3 unmodified lines
652685 retval = call_usermodehelper_exec(sub_info,
653686 UMH_WAIT_EXEC);
654687
655− argv_free(helper_argv);
688+ kfree(helper_argv);
656689 if (retval) {
657690 printk(KERN_INFO "Core dump to |%s pipe failed\n",
658691 cn.corename);
@@ -766,6 +799,7 @@ fail_dropcount: · 107 unmodified lines
766799 if (ispipe)
767800 atomic_dec(&core_dump_count);
768801 fail_unlock:
802+ kfree(argv);
769803 kfree(cn.corename);
770804 coredump_finish(mm, core_dumped);
771805 revert_creds(old_cred);
fs/dax.c+2−2
@@ -266,7 +266,7 @@ static void wait_entry_unlocked(struct xa_state *xas, void *entry) · 265 unmodified lines
266266 static void put_unlocked_entry(struct xa_state *xas, void *entry)
267267 {
268268 /* If we were the only waiter woken, wake the next one */
269− if (entry && dax_is_conflict(entry))
269+ if (entry && !dax_is_conflict(entry))
270270 dax_wake_entry(xas, entry, false);
271271 }
272272
@@ -600,7 +600,7 @@ struct page *dax_layout_busy_page(struct address_space *mapping) · 327 unmodified lines
600600 * guaranteed to either see new references or prevent new
601601 * references from being established.
602602 */
603− unmap_mapping_range(mapping, 0, 0, 1);
603+ unmap_mapping_range(mapping, 0, 0, 0);
604604
605605 xas_lock_irq(&xas);
606606 xas_for_each(&xas, entry, ULONG_MAX) {
fs/f2fs/file.c+23−40
@@ -1653,19 +1653,12 @@ static int f2fs_file_flush(struct file *file, fl_owner_t id) · 1652 unmodified lines
16531653 static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask)
16541654 {
16551655 struct f2fs_inode_info *fi = F2FS_I(inode);
1656− u32 oldflags;
16571656
16581657 /* Is it quota file? Do not allow user to mess with it */
16591658 if (IS_NOQUOTA(inode))
16601659 return -EPERM;
16611660
1662− oldflags = fi->i_flags;
1663−
1664− if ((iflags ^ oldflags) & (F2FS_APPEND_FL | F2FS_IMMUTABLE_FL))
1665− if (!capable(CAP_LINUX_IMMUTABLE))
1666− return -EPERM;
1667−
1668− fi->i_flags = iflags | (oldflags & ~mask);
1661+ fi->i_flags = iflags | (fi->i_flags & ~mask);
16691662
16701663 if (fi->i_flags & F2FS_PROJINHERIT_FL)
16711664 set_inode_flag(inode, FI_PROJ_INHERIT);
@@ -1770,7 +1763,8 @@ static int f2fs_ioc_getflags(struct file *filp, unsigned long arg) · 98 unmodified lines
17701763 static int f2fs_ioc_setflags(struct file *filp, unsigned long arg)
17711764 {
17721765 struct inode *inode = file_inode(filp);
1773− u32 fsflags;
1766+ struct f2fs_inode_info *fi = F2FS_I(inode);
1767+ u32 fsflags, old_fsflags;
17741768 u32 iflags;
17751769 int ret;
17761770
@@ -1794,8 +1788,14 @@ static int f2fs_ioc_setflags(struct file *filp, unsigned long arg) · 17 unmodified lines
17941788
17951789 inode_lock(inode);
17961790
1791+ old_fsflags = f2fs_iflags_to_fsflags(fi->i_flags);
1792+ ret = vfs_ioc_setflags_prepare(inode, old_fsflags, fsflags);
1793+ if (ret)
1794+ goto out;
1795+
17971796 ret = f2fs_setflags_common(inode, iflags,
17981797 f2fs_fsflags_to_iflags(F2FS_SETTABLE_FS_FL));
1798+out:
17991799 inode_unlock(inode);
18001800 mnt_drop_write_file(filp);
18011801 return ret;
@@ -2855,52 +2855,32 @@ static inline u32 f2fs_xflags_to_iflags(u32 xflags) · 1053 unmodified lines
28552855 return iflags;
28562856 }
28572857
2858−static int f2fs_ioc_fsgetxattr(struct file *filp, unsigned long arg)
2858+static void f2fs_fill_fsxattr(struct inode *inode, struct fsxattr *fa)
28592859 {
2860− struct inode *inode = file_inode(filp);
28612860 struct f2fs_inode_info *fi = F2FS_I(inode);
2862− struct fsxattr fa;
28632861
2864− memset(&fa, 0, sizeof(struct fsxattr));
2865− fa.fsx_xflags = f2fs_iflags_to_xflags(fi->i_flags);
2862+ simple_fill_fsxattr(fa, f2fs_iflags_to_xflags(fi->i_flags));
28662863
28672864 if (f2fs_sb_has_project_quota(F2FS_I_SB(inode)))
2868− fa.fsx_projid = (__u32)from_kprojid(&init_user_ns,
2869− fi->i_projid);
2870−
2871− if (copy_to_user((struct fsxattr __user *)arg, &fa, sizeof(fa)))
2872− return -EFAULT;
2873− return 0;
2865+ fa->fsx_projid = from_kprojid(&init_user_ns, fi->i_projid);
28742866 }
28752867
2876−static int f2fs_ioctl_check_project(struct inode *inode, struct fsxattr *fa)
2868+static int f2fs_ioc_fsgetxattr(struct file *filp, unsigned long arg)
28772869 {
2878− /*
2879− * Project Quota ID state is only allowed to change from within the init
2880− * namespace. Enforce that restriction only if we are trying to change
2881− * the quota ID state. Everything else is allowed in user namespaces.
2882− */
2883− if (current_user_ns() == &init_user_ns)
2884− return 0;
2870+ struct inode *inode = file_inode(filp);
2871+ struct fsxattr fa;
28852872
2886− if (__kprojid_val(F2FS_I(inode)->i_projid) != fa->fsx_projid)
2887− return -EINVAL;
2888−
2889− if (F2FS_I(inode)->i_flags & F2FS_PROJINHERIT_FL) {
2890− if (!(fa->fsx_xflags & FS_XFLAG_PROJINHERIT))
2891− return -EINVAL;
2892− } else {
2893− if (fa->fsx_xflags & FS_XFLAG_PROJINHERIT)
2894− return -EINVAL;
2895− }
2873+ f2fs_fill_fsxattr(inode, &fa);
28962874
2875+ if (copy_to_user((struct fsxattr __user *)arg, &fa, sizeof(fa)))
2876+ return -EFAULT;
28972877 return 0;
28982878 }
28992879
29002880 static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)
29012881 {
29022882 struct inode *inode = file_inode(filp);
2903− struct fsxattr fa;
2883+ struct fsxattr fa, old_fa;
29042884 u32 iflags;
29052885 int err;
29062886
@@ -2923,9 +2903,12 @@ static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg) · 16 unmodified lines
29232903 return err;
29242904
29252905 inode_lock(inode);
2926− err = f2fs_ioctl_check_project(inode, &fa);
2906+
2907+ f2fs_fill_fsxattr(inode, &old_fa);
2908+ err = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
29272909 if (err)
29282910 goto out;
2911+
29292912 err = f2fs_setflags_common(inode, iflags,
29302913 f2fs_xflags_to_iflags(F2FS_SUPPORTED_XFLAGS));
29312914 if (err)
fs/f2fs/gc.c+34−36
@@ -796,6 +796,29 @@ static int move_data_block(struct inode *inode, block_t bidx, · 795 unmodified lines
796796 if (lfs_mode)
797797 down_write(&fio.sbi->io_order_lock);
798798
799+ mpage = f2fs_grab_cache_page(META_MAPPING(fio.sbi),
800+ fio.old_blkaddr, false);
801+ if (!mpage)
802+ goto up_out;
803+
804+ fio.encrypted_page = mpage;
805+
806+ /* read source block in mpage */
807+ if (!PageUptodate(mpage)) {
808+ err = f2fs_submit_page_bio(&fio);
809+ if (err) {
810+ f2fs_put_page(mpage, 1);
811+ goto up_out;
812+ }
813+ lock_page(mpage);
814+ if (unlikely(mpage->mapping != META_MAPPING(fio.sbi) ||
815+ !PageUptodate(mpage))) {
816+ err = -EIO;
817+ f2fs_put_page(mpage, 1);
818+ goto up_out;
819+ }
820+ }
821+
799822 f2fs_allocate_data_block(fio.sbi, NULL, fio.old_blkaddr, &newaddr,
800823 &sum, CURSEG_COLD_DATA, NULL, false);
801824
@@ -803,44 +826,18 @@ static int move_data_block(struct inode *inode, block_t bidx, · 1 unmodified line
803826 newaddr, FGP_LOCK | FGP_CREAT, GFP_NOFS);
804827 if (!fio.encrypted_page) {
805828 err = -ENOMEM;
806− goto recover_block;
807− }
808−
809− mpage = f2fs_pagecache_get_page(META_MAPPING(fio.sbi),
810− fio.old_blkaddr, FGP_LOCK, GFP_NOFS);
811− if (mpage) {
812− bool updated = false;
813−
814− if (PageUptodate(mpage)) {
815− memcpy(page_address(fio.encrypted_page),
816− page_address(mpage), PAGE_SIZE);
817− updated = true;
818− }
819829 f2fs_put_page(mpage, 1);
820− invalidate_mapping_pages(META_MAPPING(fio.sbi),
821− fio.old_blkaddr, fio.old_blkaddr);
822− if (updated)
823− goto write_page;
824− }
825−
826− err = f2fs_submit_page_bio(&fio);
827− if (err)
828− goto put_page_out;
829−
830− /* write page */
831− lock_page(fio.encrypted_page);
832−
833− if (unlikely(fio.encrypted_page->mapping != META_MAPPING(fio.sbi))) {
834− err = -EIO;
835− goto put_page_out;
836− }
837− if (unlikely(!PageUptodate(fio.encrypted_page))) {
838− err = -EIO;
839− goto put_page_out;
830+ goto recover_block;
840831 }
841832
842−write_page:
833+ /* write target block */
843834 f2fs_wait_on_page_writeback(fio.encrypted_page, DATA, true, true);
835+ memcpy(page_address(fio.encrypted_page),
836+ page_address(mpage), PAGE_SIZE);
837+ f2fs_put_page(mpage, 1);
838+ invalidate_mapping_pages(META_MAPPING(fio.sbi),
839+ fio.old_blkaddr, fio.old_blkaddr);
840+
844841 set_page_dirty(fio.encrypted_page);
845842 if (clear_page_dirty_for_io(fio.encrypted_page))
846843 dec_page_count(fio.sbi, F2FS_DIRTY_META);
@@ -871,11 +868,12 @@ write_page: · 24 unmodified lines
871868 put_page_out:
872869 f2fs_put_page(fio.encrypted_page, 1);
873870 recover_block:
874− if (lfs_mode)
875− up_write(&fio.sbi->io_order_lock);
876871 if (err)
877872 f2fs_do_replace_block(fio.sbi, &sum, newaddr, fio.old_blkaddr,
878873 true, true);
874+up_out:
875+ if (lfs_mode)
876+ up_write(&fio.sbi->io_order_lock);
879877 put_out:
880878 f2fs_put_dnode(&dn);
881879 out:
fs/f2fs/super.c+24−24
@@ -2422,6 +2422,12 @@ static int sanity_check_raw_super(struct f2fs_sb_info *sbi, · 2421 unmodified lines
24222422 size_t crc_offset = 0;
24232423 __u32 crc = 0;
24242424
2425+ if (le32_to_cpu(raw_super->magic) != F2FS_SUPER_MAGIC) {
2426+ f2fs_info(sbi, "Magic Mismatch, valid(0x%x) - read(0x%x)",
2427+ F2FS_SUPER_MAGIC, le32_to_cpu(raw_super->magic));
2428+ return -EINVAL;
2429+ }
2430+
24252431 /* Check checksum_offset and crc in superblock */
24262432 if (__F2FS_HAS_FEATURE(raw_super, F2FS_FEATURE_SB_CHKSUM)) {
24272433 crc_offset = le32_to_cpu(raw_super->checksum_offset);
@@ -2429,26 +2435,20 @@ static int sanity_check_raw_super(struct f2fs_sb_info *sbi, · 1 unmodified line
24292435 offsetof(struct f2fs_super_block, crc)) {
24302436 f2fs_info(sbi, "Invalid SB checksum offset: %zu",
24312437 crc_offset);
2432− return 1;
2438+ return -EFSCORRUPTED;
24332439 }
24342440 crc = le32_to_cpu(raw_super->crc);
24352441 if (!f2fs_crc_valid(sbi, crc, raw_super, crc_offset)) {
24362442 f2fs_info(sbi, "Invalid SB checksum value: %u", crc);
2437− return 1;
2443+ return -EFSCORRUPTED;
24382444 }
24392445 }
24402446
2441− if (F2FS_SUPER_MAGIC != le32_to_cpu(raw_super->magic)) {
2442− f2fs_info(sbi, "Magic Mismatch, valid(0x%x) - read(0x%x)",
2443− F2FS_SUPER_MAGIC, le32_to_cpu(raw_super->magic));
2444− return 1;
2445− }
2446−
24472447 /* Currently, support only 4KB page cache size */
24482448 if (F2FS_BLKSIZE != PAGE_SIZE) {
24492449 f2fs_info(sbi, "Invalid page_cache_size (%lu), supports only 4KB",
24502450 PAGE_SIZE);
2451− return 1;
2451+ return -EFSCORRUPTED;
24522452 }
24532453
24542454 /* Currently, support only 4KB block size */
@@ -2456,14 +2456,14 @@ static int sanity_check_raw_super(struct f2fs_sb_info *sbi, · 1 unmodified line
24562456 if (blocksize != F2FS_BLKSIZE) {
24572457 f2fs_info(sbi, "Invalid blocksize (%u), supports only 4KB",
24582458 blocksize);
2459− return 1;
2459+ return -EFSCORRUPTED;
24602460 }
24612461
24622462 /* check log blocks per segment */
24632463 if (le32_to_cpu(raw_super->log_blocks_per_seg) != 9) {
24642464 f2fs_info(sbi, "Invalid log blocks per segment (%u)",
24652465 le32_to_cpu(raw_super->log_blocks_per_seg));
2466− return 1;
2466+ return -EFSCORRUPTED;
24672467 }
24682468
24692469 /* Currently, support 512/1024/2048/4096 bytes sector size */
@@ -2473,7 +2473,7 @@ static int sanity_check_raw_super(struct f2fs_sb_info *sbi, · 3 unmodified lines
24732473 F2FS_MIN_LOG_SECTOR_SIZE) {
24742474 f2fs_info(sbi, "Invalid log sectorsize (%u)",
24752475 le32_to_cpu(raw_super->log_sectorsize));
2476− return 1;
2476+ return -EFSCORRUPTED;
24772477 }
24782478 if (le32_to_cpu(raw_super->log_sectors_per_block) +
24792479 le32_to_cpu(raw_super->log_sectorsize) !=
@@ -2481,7 +2481,7 @@ static int sanity_check_raw_super(struct f2fs_sb_info *sbi, · 1 unmodified line
24812481 f2fs_info(sbi, "Invalid log sectors per block(%u) log sectorsize(%u)",
24822482 le32_to_cpu(raw_super->log_sectors_per_block),
24832483 le32_to_cpu(raw_super->log_sectorsize));
2484− return 1;
2484+ return -EFSCORRUPTED;
24852485 }
24862486
24872487 segment_count = le32_to_cpu(raw_super->segment_count);
@@ -2495,7 +2495,7 @@ static int sanity_check_raw_super(struct f2fs_sb_info *sbi, · 7 unmodified lines
24952495 if (segment_count > F2FS_MAX_SEGMENT ||
24962496 segment_count < F2FS_MIN_SEGMENTS) {
24972497 f2fs_info(sbi, "Invalid segment count (%u)", segment_count);
2498− return 1;
2498+ return -EFSCORRUPTED;
24992499 }
25002500
25012501 if (total_sections > segment_count ||
@@ -2503,25 +2503,25 @@ static int sanity_check_raw_super(struct f2fs_sb_info *sbi, · 1 unmodified line
25032503 segs_per_sec > segment_count || !segs_per_sec) {
25042504 f2fs_info(sbi, "Invalid segment/section count (%u, %u x %u)",
25052505 segment_count, total_sections, segs_per_sec);
2506− return 1;
2506+ return -EFSCORRUPTED;
25072507 }
25082508
25092509 if ((segment_count / segs_per_sec) < total_sections) {
25102510 f2fs_info(sbi, "Small segment_count (%u < %u * %u)",
25112511 segment_count, segs_per_sec, total_sections);
2512− return 1;
2512+ return -EFSCORRUPTED;
25132513 }
25142514
25152515 if (segment_count > (le64_to_cpu(raw_super->block_count) >> 9)) {
25162516 f2fs_info(sbi, "Wrong segment_count / block_count (%u > %llu)",
25172517 segment_count, le64_to_cpu(raw_super->block_count));
2518− return 1;
2518+ return -EFSCORRUPTED;
25192519 }
25202520
25212521 if (secs_per_zone > total_sections || !secs_per_zone) {
25222522 f2fs_info(sbi, "Wrong secs_per_zone / total_sections (%u, %u)",
25232523 secs_per_zone, total_sections);
2524− return 1;
2524+ return -EFSCORRUPTED;
25252525 }
25262526 if (le32_to_cpu(raw_super->extension_count) > F2FS_MAX_EXTENSION ||
25272527 raw_super->hot_ext_count > F2FS_MAX_EXTENSION ||
@@ -2531,7 +2531,7 @@ static int sanity_check_raw_super(struct f2fs_sb_info *sbi, · 3 unmodified lines
25312531 le32_to_cpu(raw_super->extension_count),
25322532 raw_super->hot_ext_count,
25332533 F2FS_MAX_EXTENSION);
2534− return 1;
2534+ return -EFSCORRUPTED;
25352535 }
25362536
25372537 if (le32_to_cpu(raw_super->cp_payload) >
@@ -2539,7 +2539,7 @@ static int sanity_check_raw_super(struct f2fs_sb_info *sbi, · 1 unmodified line
25392539 f2fs_info(sbi, "Insane cp_payload (%u > %u)",
25402540 le32_to_cpu(raw_super->cp_payload),
25412541 blocks_per_seg - F2FS_CP_PACKS);
2542− return 1;
2542+ return -EFSCORRUPTED;
25432543 }
25442544
25452545 /* check reserved ino info */
@@ -2550,12 +2550,12 @@ static int sanity_check_raw_super(struct f2fs_sb_info *sbi, · 4 unmodified lines
25502550 le32_to_cpu(raw_super->node_ino),
25512551 le32_to_cpu(raw_super->meta_ino),
25522552 le32_to_cpu(raw_super->root_ino));
2553− return 1;
2553+ return -EFSCORRUPTED;
25542554 }
25552555
25562556 /* check CP/SIT/NAT/SSA/MAIN_AREA area boundary */
25572557 if (sanity_check_area_boundary(sbi, bh))
2558− return 1;
2558+ return -EFSCORRUPTED;
25592559
25602560 return 0;
25612561 }
@@ -2870,10 +2870,10 @@ static int read_raw_super_block(struct f2fs_sb_info *sbi, · 308 unmodified lines
28702870 }
28712871
28722872 /* sanity checking of raw super */
2873− if (sanity_check_raw_super(sbi, bh)) {
2873+ err = sanity_check_raw_super(sbi, bh);
2874+ if (err) {
28742875 f2fs_err(sbi, "Can't find valid F2FS filesystem in %dth superblock",
28752876 block + 1);
2876− err = -EFSCORRUPTED;
28772877 brelse(bh);
28782878 continue;
28792879 }
fs/gfs2/bmap.c+113−66
@@ -390,6 +390,19 @@ static int fillup_metapath(struct gfs2_inode *ip, struct metapath *mp, int h) · 389 unmodified lines
390390 return mp->mp_aheight - x - 1;
391391 }
392392
393+static sector_t metapath_to_block(struct gfs2_sbd *sdp, struct metapath *mp)
394+{
395+ sector_t factor = 1, block = 0;
396+ int hgt;
397+
398+ for (hgt = mp->mp_fheight - 1; hgt >= 0; hgt--) {
399+ if (hgt < mp->mp_aheight)
400+ block += mp->mp_list[hgt] * factor;
401+ factor *= sdp->sd_inptrs;
402+ }
403+ return block;
404+}
405+
393406 static void release_metapath(struct metapath *mp)
394407 {
395408 int i;
@@ -430,60 +443,84 @@ static inline unsigned int gfs2_extent_length(struct buffer_head *bh, __be64 *pt · 34 unmodified lines
430443 return ptr - first;
431444 }
432445
433−typedef const __be64 *(*gfs2_metadata_walker)(
434− struct metapath *mp,
435− const __be64 *start, const __be64 *end,
436− u64 factor, void *data);
446+enum walker_status { WALK_STOP, WALK_FOLLOW, WALK_CONTINUE };
447+
448+/*
449+ * gfs2_metadata_walker - walk an indirect block
450+ * @mp: Metapath to indirect block
451+ * @ptrs: Number of pointers to look at
452+ *
453+ * When returning WALK_FOLLOW, the walker must update @mp to point at the right
454+ * indirect block to follow.
455+ */
456+typedef enum walker_status (*gfs2_metadata_walker)(struct metapath *mp,
457+ unsigned int ptrs);
437458
438−#define WALK_STOP ((__be64 *)0)
439−#define WALK_NEXT ((__be64 *)1)
459+/*
460+ * gfs2_walk_metadata - walk a tree of indirect blocks
461+ * @inode: The inode
462+ * @mp: Starting point of walk
463+ * @max_len: Maximum number of blocks to walk
464+ * @walker: Called during the walk
465+ *
466+ * Returns 1 if the walk was stopped by @walker, 0 if we went past @max_len or
467+ * past the end of metadata, and a negative error code otherwise.
468+ */
440469
441−static int gfs2_walk_metadata(struct inode *inode, sector_t lblock,
442− u64 len, struct metapath *mp, gfs2_metadata_walker walker,
443− void *data)
470+static int gfs2_walk_metadata(struct inode *inode, struct metapath *mp,
471+ u64 max_len, gfs2_metadata_walker walker)
444472 {
445− struct metapath clone;
446473 struct gfs2_inode *ip = GFS2_I(inode);
447474 struct gfs2_sbd *sdp = GFS2_SB(inode);
448− const __be64 *start, *end, *ptr;
449475 u64 factor = 1;
450476 unsigned int hgt;
451− int ret = 0;
477+ int ret;
452478
453− for (hgt = ip->i_height - 1; hgt >= mp->mp_aheight; hgt--)
479+ /*
480+ * The walk starts in the lowest allocated indirect block, which may be
481+ * before the position indicated by @mp. Adjust @max_len accordingly
482+ * to avoid a short walk.
483+ */
484+ for (hgt = mp->mp_fheight - 1; hgt >= mp->mp_aheight; hgt--) {
485+ max_len += mp->mp_list[hgt] * factor;
486+ mp->mp_list[hgt] = 0;
454487 factor *= sdp->sd_inptrs;
488+ }
455489
456490 for (;;) {
457− u64 step;
491+ u16 start = mp->mp_list[hgt];
492+ enum walker_status status;
493+ unsigned int ptrs;
494+ u64 len;
458495
459496 /* Walk indirect block. */
460− start = metapointer(hgt, mp);
461− end = metaend(hgt, mp);
462−
463− step = (end - start) * factor;
464− if (step > len)
465− end = start + DIV_ROUND_UP_ULL(len, factor);
466−
467− ptr = walker(mp, start, end, factor, data);
468− if (ptr == WALK_STOP)
497+ ptrs = (hgt >= 1 ? sdp->sd_inptrs : sdp->sd_diptrs) - start;
498+ len = ptrs * factor;
499+ if (len > max_len)
500+ ptrs = DIV_ROUND_UP_ULL(max_len, factor);
501+ status = walker(mp, ptrs);
502+ switch (status) {
503+ case WALK_STOP:
504+ return 1;
505+ case WALK_FOLLOW:
506+ BUG_ON(mp->mp_aheight == mp->mp_fheight);
507+ ptrs = mp->mp_list[hgt] - start;
508+ len = ptrs * factor;
469509 break;
470− if (step >= len)
510+ case WALK_CONTINUE:
471511 break;
472− len -= step;
473− if (ptr != WALK_NEXT) {
474− BUG_ON(!*ptr);
475− mp->mp_list[hgt] += ptr - start;
476− goto fill_up_metapath;
477512 }
513+ if (len >= max_len)
514+ break;
515+ max_len -= len;
516+ if (status == WALK_FOLLOW)
517+ goto fill_up_metapath;
478518
479519 lower_metapath:
480520 /* Decrease height of metapath. */
481− if (mp != &clone) {
482− clone_metapath(&clone, mp);
483− mp = &clone;
484− }
485521 brelse(mp->mp_bh[hgt]);
486522 mp->mp_bh[hgt] = NULL;
523+ mp->mp_list[hgt] = 0;
487524 if (!hgt)
488525 break;
489526 hgt--;
@@ -491,10 +528,7 @@ lower_metapath: · 1 unmodified line
491528
492529 /* Advance in metadata tree. */
493530 (mp->mp_list[hgt])++;
494− start = metapointer(hgt, mp);
495− end = metaend(hgt, mp);
496− if (start >= end) {
497− mp->mp_list[hgt] = 0;
531+ if (mp->mp_list[hgt] >= sdp->sd_inptrs) {
498532 if (!hgt)
499533 break;
500534 goto lower_metapath;
@@ -502,44 +536,36 @@ lower_metapath: · 1 unmodified line
502536
503537 fill_up_metapath:
504538 /* Increase height of metapath. */
505− if (mp != &clone) {
506− clone_metapath(&clone, mp);
507− mp = &clone;
508− }
509539 ret = fillup_metapath(ip, mp, ip->i_height - 1);
510540 if (ret < 0)
511− break;
541+ return ret;
512542 hgt += ret;
513543 for (; ret; ret--)
514544 do_div(factor, sdp->sd_inptrs);
515545 mp->mp_aheight = hgt + 1;
516546 }
517− if (mp == &clone)
518− release_metapath(mp);
519− return ret;
547+ return 0;
520548 }
521549
522−struct gfs2_hole_walker_args {
523− u64 blocks;
524−};
525−
526−static const __be64 *gfs2_hole_walker(struct metapath *mp,
527− const __be64 *start, const __be64 *end,
528− u64 factor, void *data)
550+static enum walker_status gfs2_hole_walker(struct metapath *mp,
551+ unsigned int ptrs)
529552 {
530− struct gfs2_hole_walker_args *args = data;
531− const __be64 *ptr;
553+ const __be64 *start, *ptr, *end;
554+ unsigned int hgt;
555+
556+ hgt = mp->mp_aheight - 1;
557+ start = metapointer(hgt, mp);
558+ end = start + ptrs;
532559
533560 for (ptr = start; ptr < end; ptr++) {
534561 if (*ptr) {
535− args->blocks += (ptr - start) * factor;
562+ mp->mp_list[hgt] += ptr - start;
536563 if (mp->mp_aheight == mp->mp_fheight)
537564 return WALK_STOP;
538− return ptr; /* increase height */
565+ return WALK_FOLLOW;
539566 }
540567 }
541− args->blocks += (end - start) * factor;
542− return WALK_NEXT;
568+ return WALK_CONTINUE;
543569 }
544570
545571 /**
@@ -557,12 +583,24 @@ static const __be64 *gfs2_hole_walker(struct metapath *mp, · 11 unmodified lines
557583 static int gfs2_hole_size(struct inode *inode, sector_t lblock, u64 len,
558584 struct metapath *mp, struct iomap *iomap)
559585 {
560− struct gfs2_hole_walker_args args = { };
561− int ret = 0;
586+ struct metapath clone;
587+ u64 hole_size;
588+ int ret;
562589
563− ret = gfs2_walk_metadata(inode, lblock, len, mp, gfs2_hole_walker, &args);
564− if (!ret)
565− iomap->length = args.blocks << inode->i_blkbits;
590+ clone_metapath(&clone, mp);
591+ ret = gfs2_walk_metadata(inode, &clone, len, gfs2_hole_walker);
592+ if (ret < 0)
593+ goto out;
594+
595+ if (ret == 1)
596+ hole_size = metapath_to_block(GFS2_SB(inode), &clone) - lblock;
597+ else
598+ hole_size = len;
599+ iomap->length = hole_size << inode->i_blkbits;
600+ ret = 0;
601+
602+out:
603+ release_metapath(&clone);
566604 return ret;
567605 }
568606
@@ -1002,11 +1040,16 @@ static void gfs2_iomap_page_done(struct inode *inode, loff_t pos, · 433 unmodified lines
10021040 unsigned copied, struct page *page,
10031041 struct iomap *iomap)
10041042 {
1043+ struct gfs2_trans *tr = current->journal_info;
10051044 struct gfs2_inode *ip = GFS2_I(inode);
10061045 struct gfs2_sbd *sdp = GFS2_SB(inode);
10071046
10081047 if (page && !gfs2_is_stuffed(ip))
10091048 gfs2_page_add_databufs(ip, page, offset_in_page(pos), copied);
1049+
1050+ if (tr->tr_num_buf_new)
1051+ __mark_inode_dirty(inode, I_DIRTY_DATASYNC);
1052+
10101053 gfs2_trans_end(sdp);
10111054 }
10121055
@@ -1099,8 +1142,6 @@ static int gfs2_iomap_begin_write(struct inode *inode, loff_t pos, · 86 unmodified lines
10991142 tr = current->journal_info;
11001143 if (tr->tr_num_buf_new)
11011144 __mark_inode_dirty(inode, I_DIRTY_DATASYNC);
1102− else
1103− gfs2_trans_add_meta(ip->i_gl, mp->mp_bh[0]);
11041145
11051146 gfs2_trans_end(sdp);
11061147 }
@@ -1181,10 +1222,16 @@ static int gfs2_iomap_end(struct inode *inode, loff_t pos, loff_t length, · 74 unmodified lines
11811222
11821223 if (ip->i_qadata && ip->i_qadata->qa_qd_num)
11831224 gfs2_quota_unlock(ip);
1225+
1226+ if (unlikely(!written))
1227+ goto out_unlock;
1228+
11841229 if (iomap->flags & IOMAP_F_SIZE_CHANGED)
11851230 mark_inode_dirty(inode);
1186− gfs2_write_unlock(inode);
1231+ set_bit(GLF_DIRTY, &ip->i_gl->gl_flags);
11871232
1233+out_unlock:
1234+ gfs2_write_unlock(inode);
11881235 out:
11891236 return 0;
11901237 }
fs/io_uring.c+2−1
@@ -1838,6 +1838,7 @@ restart: · 1837 unmodified lines
18381838 do {
18391839 struct sqe_submit *s = &req->submit;
18401840 const struct io_uring_sqe *sqe = s->sqe;
1841+ unsigned int flags = req->flags;
18411842
18421843 /* Ensure we clear previously set non-block flag */
18431844 req->rw.ki_flags &= ~IOCB_NOWAIT;
@@ -1883,7 +1884,7 @@ restart: · 39 unmodified lines
18831884 kfree(sqe);
18841885
18851886 /* req from defer and link list needn't decrease async cnt */
1886− if (req->flags & (REQ_F_IO_DRAINED | REQ_F_LINK_DONE))
1887+ if (flags & (REQ_F_IO_DRAINED | REQ_F_LINK_DONE))
18871888 goto out;
18881889
18891890 if (!async_list)
fs/nfs/delegation.c+18−7
@@ -153,7 +153,7 @@ again: · 152 unmodified lines
153153 /* Block nfs4_proc_unlck */
154154 mutex_lock(&sp->so_delegreturn_mutex);
155155 seq = raw_seqcount_begin(&sp->so_reclaim_seqcount);
156− err = nfs4_open_delegation_recall(ctx, state, stateid, type);
156+ err = nfs4_open_delegation_recall(ctx, state, stateid);
157157 if (!err)
158158 err = nfs_delegation_claim_locks(state, stateid);
159159 if (!err && read_seqcount_retry(&sp->so_reclaim_seqcount, seq))
@@ -1046,6 +1046,22 @@ void nfs_test_expired_all_delegations(struct nfs_client *clp) · 886 unmodified lines
10461046 nfs4_schedule_state_manager(clp);
10471047 }
10481048
1049+static void
1050+nfs_delegation_test_free_expired(struct inode *inode,
1051+ nfs4_stateid *stateid,
1052+ const struct cred *cred)
1053+{
1054+ struct nfs_server *server = NFS_SERVER(inode);
1055+ const struct nfs4_minor_version_ops *ops = server->nfs_client->cl_mvops;
1056+ int status;
1057+
1058+ if (!cred)
1059+ return;
1060+ status = ops->test_and_free_expired(server, stateid, cred);
1061+ if (status == -NFS4ERR_EXPIRED || status == -NFS4ERR_BAD_STATEID)
1062+ nfs_remove_bad_delegation(inode, stateid);
1063+}
1064+
10491065 /**
10501066 * nfs_reap_expired_delegations - reap expired delegations
10511067 * @clp: nfs_client to process
@@ -1057,7 +1073,6 @@ void nfs_test_expired_all_delegations(struct nfs_client *clp) · 5 unmodified lines
10571073 */
10581074 void nfs_reap_expired_delegations(struct nfs_client *clp)
10591075 {
1060− const struct nfs4_minor_version_ops *ops = clp->cl_mvops;
10611076 struct nfs_delegation *delegation;
10621077 struct nfs_server *server;
10631078 struct inode *inode;
@@ -1088,11 +1103,7 @@ restart: · 24 unmodified lines
10881103 nfs4_stateid_copy(&stateid, &delegation->stateid);
10891104 clear_bit(NFS_DELEGATION_TEST_EXPIRED, &delegation->flags);
10901105 rcu_read_unlock();
1091− if (cred != NULL &&
1092− ops->test_and_free_expired(server, &stateid, cred) < 0) {
1093− nfs_revoke_delegation(inode, &stateid);
1094− nfs_inode_find_state_and_recover(inode, &stateid);
1095− }
1106+ nfs_delegation_test_free_expired(inode, &stateid, cred);
10961107 put_cred(cred);
10971108 if (nfs4_server_rebooted(clp)) {
10981109 nfs_inode_mark_test_expired_delegation(server,inode);
fs/nfs/delegation.h+1−1
@@ -63,7 +63,7 @@ void nfs_reap_expired_delegations(struct nfs_client *clp); · 62 unmodified lines
6363
6464 /* NFSv4 delegation-related procedures */
6565 int nfs4_proc_delegreturn(struct inode *inode, const struct cred *cred, const nfs4_stateid *stateid, int issync);
66−int nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid, fmode_t type);
66+int nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid);
6767 int nfs4_lock_delegation_recall(struct file_lock *fl, struct nfs4_state *state, const nfs4_stateid *stateid);
6868 bool nfs4_copy_delegation_stateid(struct inode *inode, fmode_t flags, nfs4_stateid *dst, const struct cred **cred);
6969 bool nfs4_refresh_delegation_stateid(nfs4_stateid *dst, struct inode *inode);
fs/nfs/fscache.c+6−1
@@ -114,6 +114,10 @@ void nfs_fscache_get_super_cookie(struct super_block *sb, const char *uniq, int · 113 unmodified lines
114114 struct rb_node **p, *parent;
115115 int diff;
116116
117+ nfss->fscache_key = NULL;
118+ nfss->fscache = NULL;
119+ if (!(nfss->options & NFS_OPTION_FSCACHE))
120+ return;
117121 if (!uniq) {
118122 uniq = "";
119123 ulen = 1;
@@ -226,10 +230,11 @@ void nfs_fscache_release_super_cookie(struct super_block *sb) · 106 unmodified lines
226230 void nfs_fscache_init_inode(struct inode *inode)
227231 {
228232 struct nfs_fscache_inode_auxdata auxdata;
233+ struct nfs_server *nfss = NFS_SERVER(inode);
229234 struct nfs_inode *nfsi = NFS_I(inode);
230235
231236 nfsi->fscache = NULL;
232− if (!S_ISREG(inode->i_mode))
237+ if (!(nfss->fscache && S_ISREG(inode->i_mode)))
233238 return;
234239
235240 memset(&auxdata, 0, sizeof(auxdata));
fs/nfs/fscache.h+1−1
@@ -182,7 +182,7 @@ static inline void nfs_fscache_wait_on_invalidate(struct inode *inode) · 181 unmodified lines
182182 */
183183 static inline const char *nfs_server_fscache_state(struct nfs_server *server)
184184 {
185− if (server->fscache && (server->options & NFS_OPTION_FSCACHE))
185+ if (server->fscache)
186186 return "yes";
187187 return "no ";
188188 }
fs/nfs/nfs4_fs.h+2−1
@@ -465,7 +465,8 @@ static inline void nfs4_schedule_session_recovery(struct nfs4_session *session, · 464 unmodified lines
465465
466466 extern struct nfs4_state_owner *nfs4_get_state_owner(struct nfs_server *, const struct cred *, gfp_t);
467467 extern void nfs4_put_state_owner(struct nfs4_state_owner *);
468−extern void nfs4_purge_state_owners(struct nfs_server *);
468+extern void nfs4_purge_state_owners(struct nfs_server *, struct list_head *);
469+extern void nfs4_free_state_owners(struct list_head *head);
469470 extern struct nfs4_state * nfs4_get_open_state(struct inode *, struct nfs4_state_owner *);
470471 extern void nfs4_put_open_state(struct nfs4_state *);
471472 extern void nfs4_close_state(struct nfs4_state *, fmode_t);
fs/nfs/nfs4client.c+4−1
@@ -758,9 +758,12 @@ out: · 757 unmodified lines
758758
759759 static void nfs4_destroy_server(struct nfs_server *server)
760760 {
761+ LIST_HEAD(freeme);
762+
761763 nfs_server_return_all_delegations(server);
762764 unset_pnfs_layoutdriver(server);
763− nfs4_purge_state_owners(server);
765+ nfs4_purge_state_owners(server, &freeme);
766+ nfs4_free_state_owners(&freeme);
764767 }
765768
766769 /*
fs/nfs/nfs4proc.c+62−47
@@ -1683,6 +1683,14 @@ static void nfs_state_set_open_stateid(struct nfs4_state *state, · 1682 unmodified lines
16831683 write_sequnlock(&state->seqlock);
16841684 }
16851685
1686+static void nfs_state_clear_open_state_flags(struct nfs4_state *state)
1687+{
1688+ clear_bit(NFS_O_RDWR_STATE, &state->flags);
1689+ clear_bit(NFS_O_WRONLY_STATE, &state->flags);
1690+ clear_bit(NFS_O_RDONLY_STATE, &state->flags);
1691+ clear_bit(NFS_OPEN_STATE, &state->flags);
1692+}
1693+
16861694 static void nfs_state_set_delegation(struct nfs4_state *state,
16871695 const nfs4_stateid *deleg_stateid,
16881696 fmode_t fmode)
@@ -1907,8 +1915,9 @@ _nfs4_opendata_reclaim_to_nfs4_state(struct nfs4_opendata *data) · 218 unmodified lines
19071915 if (data->o_res.delegation_type != 0)
19081916 nfs4_opendata_check_deleg(data, state);
19091917 update:
1910− update_open_stateid(state, &data->o_res.stateid, NULL,
1911− data->o_arg.fmode);
1918+ if (!update_open_stateid(state, &data->o_res.stateid,
1919+ NULL, data->o_arg.fmode))
1920+ return ERR_PTR(-EAGAIN);
19121921 refcount_inc(&state->count);
19131922
19141923 return state;
@@ -1973,8 +1982,11 @@ _nfs4_opendata_to_nfs4_state(struct nfs4_opendata *data) · 58 unmodified lines
19731982
19741983 if (data->o_res.delegation_type != 0)
19751984 nfs4_opendata_check_deleg(data, state);
1976− update_open_stateid(state, &data->o_res.stateid, NULL,
1977− data->o_arg.fmode);
1985+ if (!update_open_stateid(state, &data->o_res.stateid,
1986+ NULL, data->o_arg.fmode)) {
1987+ nfs4_put_open_state(state);
1988+ state = ERR_PTR(-EAGAIN);
1989+ }
19781990 out:
19791991 nfs_release_seqid(data->o_arg.seqid);
19801992 return state;
@@ -2074,13 +2086,7 @@ static int nfs4_open_recover(struct nfs4_opendata *opendata, struct nfs4_state * · 93 unmodified lines
20742086 {
20752087 int ret;
20762088
2077− /* Don't trigger recovery in nfs_test_and_clear_all_open_stateid */
2078− clear_bit(NFS_O_RDWR_STATE, &state->flags);
2079− clear_bit(NFS_O_WRONLY_STATE, &state->flags);
2080− clear_bit(NFS_O_RDONLY_STATE, &state->flags);
20812089 /* memory barrier prior to reading state->n_* */
2082− clear_bit(NFS_DELEGATED_STATE, &state->flags);
2083− clear_bit(NFS_OPEN_STATE, &state->flags);
20842090 smp_rmb();
20852091 ret = nfs4_open_recover_helper(opendata, FMODE_READ|FMODE_WRITE);
20862092 if (ret != 0)
@@ -2156,6 +2162,8 @@ static int nfs4_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state *sta · 69 unmodified lines
21562162 ctx = nfs4_state_find_open_context(state);
21572163 if (IS_ERR(ctx))
21582164 return -EAGAIN;
2165+ clear_bit(NFS_DELEGATED_STATE, &state->flags);
2166+ nfs_state_clear_open_state_flags(state);
21592167 ret = nfs4_do_open_reclaim(ctx, state);
21602168 put_nfs_open_context(ctx);
21612169 return ret;
@@ -2171,18 +2179,17 @@ static int nfs4_handle_delegation_recall_error(struct nfs_server *server, struct · 9 unmodified lines
21712179 case -ENOENT:
21722180 case -EAGAIN:
21732181 case -ESTALE:
2182+ case -ETIMEDOUT:
21742183 break;
21752184 case -NFS4ERR_BADSESSION:
21762185 case -NFS4ERR_BADSLOT:
21772186 case -NFS4ERR_BAD_HIGH_SLOT:
21782187 case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION:
21792188 case -NFS4ERR_DEADSESSION:
2180− set_bit(NFS_DELEGATED_STATE, &state->flags);
21812189 nfs4_schedule_session_recovery(server->nfs_client->cl_session, err);
21822190 return -EAGAIN;
21832191 case -NFS4ERR_STALE_CLIENTID:
21842192 case -NFS4ERR_STALE_STATEID:
2185− set_bit(NFS_DELEGATED_STATE, &state->flags);
21862193 /* Don't recall a delegation if it was lost */
21872194 nfs4_schedule_lease_recovery(server->nfs_client);
21882195 return -EAGAIN;
@@ -2203,7 +2210,6 @@ static int nfs4_handle_delegation_recall_error(struct nfs_server *server, struct · 14 unmodified lines
22032210 return -EAGAIN;
22042211 case -NFS4ERR_DELAY:
22052212 case -NFS4ERR_GRACE:
2206− set_bit(NFS_DELEGATED_STATE, &state->flags);
22072213 ssleep(1);
22082214 return -EAGAIN;
22092215 case -ENOMEM:
@@ -2219,8 +2225,7 @@ static int nfs4_handle_delegation_recall_error(struct nfs_server *server, struct · 9 unmodified lines
22192225 }
22202226
22212227 int nfs4_open_delegation_recall(struct nfs_open_context *ctx,
2222− struct nfs4_state *state, const nfs4_stateid *stateid,
2223− fmode_t type)
2228+ struct nfs4_state *state, const nfs4_stateid *stateid)
22242229 {
22252230 struct nfs_server *server = NFS_SERVER(state->inode);
22262231 struct nfs4_opendata *opendata;
@@ -2231,20 +2236,23 @@ int nfs4_open_delegation_recall(struct nfs_open_context *ctx, · 4 unmodified lines
22312236 if (IS_ERR(opendata))
22322237 return PTR_ERR(opendata);
22332238 nfs4_stateid_copy(&opendata->o_arg.u.delegation, stateid);
2234− nfs_state_clear_delegation(state);
2235− switch (type & (FMODE_READ|FMODE_WRITE)) {
2236− case FMODE_READ|FMODE_WRITE:
2237− case FMODE_WRITE:
2239+ if (!test_bit(NFS_O_RDWR_STATE, &state->flags)) {
22382240 err = nfs4_open_recover_helper(opendata, FMODE_READ|FMODE_WRITE);
22392241 if (err)
2240− break;
2242+ goto out;
2243+ }
2244+ if (!test_bit(NFS_O_WRONLY_STATE, &state->flags)) {
22412245 err = nfs4_open_recover_helper(opendata, FMODE_WRITE);
22422246 if (err)
2243− break;
2244− /* Fall through */
2245− case FMODE_READ:
2247+ goto out;
2248+ }
2249+ if (!test_bit(NFS_O_RDONLY_STATE, &state->flags)) {
22462250 err = nfs4_open_recover_helper(opendata, FMODE_READ);
2251+ if (err)
2252+ goto out;
22472253 }
2254+ nfs_state_clear_delegation(state);
2255+out:
22482256 nfs4_opendata_put(opendata);
22492257 return nfs4_handle_delegation_recall_error(server, state, stateid, NULL, err);
22502258 }
@@ -2492,6 +2500,7 @@ static int nfs4_run_open_task(struct nfs4_opendata *data, · 241 unmodified lines
24922500 if (!ctx) {
24932501 nfs4_init_sequence(&o_arg->seq_args, &o_res->seq_res, 1, 1);
24942502 data->is_recover = true;
2503+ task_setup_data.flags |= RPC_TASK_TIMEOUT;
24952504 } else {
24962505 nfs4_init_sequence(&o_arg->seq_args, &o_res->seq_res, 1, 0);
24972506 pnfs_lgopen_prepare(data, ctx);
@@ -2698,6 +2707,7 @@ static int nfs40_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *st · 200 unmodified lines
26982707 {
26992708 /* NFSv4.0 doesn't allow for delegation recovery on open expire */
27002709 nfs40_clear_delegation_stateid(state);
2710+ nfs_state_clear_open_state_flags(state);
27012711 return nfs4_open_expired(sp, state);
27022712 }
27032713
@@ -2740,13 +2750,13 @@ out_free: · 36 unmodified lines
27402750 return -NFS4ERR_EXPIRED;
27412751 }
27422752
2743−static void nfs41_check_delegation_stateid(struct nfs4_state *state)
2753+static int nfs41_check_delegation_stateid(struct nfs4_state *state)
27442754 {
27452755 struct nfs_server *server = NFS_SERVER(state->inode);
27462756 nfs4_stateid stateid;
27472757 struct nfs_delegation *delegation;
27482758 const struct cred *cred = NULL;
2749− int status;
2759+ int status, ret = NFS_OK;
27502760
27512761 /* Get the delegation credential for use by test/free_stateid */
27522762 rcu_read_lock();
@@ -2754,20 +2764,15 @@ static void nfs41_check_delegation_stateid(struct nfs4_state *state) · 1 unmodified line
27542764 if (delegation == NULL) {
27552765 rcu_read_unlock();
27562766 nfs_state_clear_delegation(state);
2757− return;
2767+ return NFS_OK;
27582768 }
27592769
27602770 nfs4_stateid_copy(&stateid, &delegation->stateid);
2761− if (test_bit(NFS_DELEGATION_REVOKED, &delegation->flags)) {
2762− rcu_read_unlock();
2763− nfs_state_clear_delegation(state);
2764− return;
2765− }
27662771
27672772 if (!test_and_clear_bit(NFS_DELEGATION_TEST_EXPIRED,
27682773 &delegation->flags)) {
27692774 rcu_read_unlock();
2770− return;
2775+ return NFS_OK;
27712776 }
27722777
27732778 if (delegation->cred)
@@ -2777,9 +2782,24 @@ static void nfs41_check_delegation_stateid(struct nfs4_state *state) · 3 unmodified lines
27772782 trace_nfs4_test_delegation_stateid(state, NULL, status);
27782783 if (status == -NFS4ERR_EXPIRED || status == -NFS4ERR_BAD_STATEID)
27792784 nfs_finish_clear_delegation_stateid(state, &stateid);
2785+ else

68 more lines aren’t shown here.

fs/nfs/nfs4state.c+39−10

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

fs/nfs/pnfs.c+1−6

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

fs/nfs/super.c+1−0

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

fs/ocfs2/xattr.c+0−3

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

fs/super.c+1−4

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

fs/xfs/scrub/dabtree.c+5−1

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

fs/xfs/xfs_itable.c+3−0

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

include/asm-generic/getorder.h+20−30

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

include/drm/drm_client.h+2−0

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

include/drm/drm_mode_config.h+7−0

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

include/kvm/arm_pmu.h+2−0

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

include/kvm/arm_vgic.h+1−0

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

include/linux/ccp.h+2−0

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

include/linux/clk.h+1−0

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

include/linux/dim.h+0−56

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

include/linux/filter.h+13−0

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

include/linux/fs.h+6−0

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

include/linux/gpio/consumer.h+32−32

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

include/linux/hmm.h+0−54

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

include/linux/if_pppox.h+3−0

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

include/linux/if_rmnet.h+2−2

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

include/linux/kvm_host.h+4−2

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

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

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

include/linux/mlx5/mlx5_ifc.h+4−2

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

include/linux/mod_devicetable.h+1−0

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

include/linux/page-flags-layout.h+11−7

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

include/linux/page-flags.h+4−0

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

include/linux/skmsg.h+7−1

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

include/net/cfg80211.h+15−0

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

include/net/tc_act/tc_police.h+2−2

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

include/net/tc_act/tc_sample.h+1−1

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

include/net/tcp.h+3−0

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

include/net/tls.h+9−4

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

include/rdma/ib_verbs.h+3−1

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

include/rdma/rdmavt_qp.h+4−5

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

include/scsi/libfc.h+26−26

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

include/scsi/libfcoe.h+1−0

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

include/sound/simple_card_utils.h+4−0

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

include/trace/events/dma_fence.h+1−1

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

include/trace/events/napi.h+2−2

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

include/trace/events/qdisc.h+2−2

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

include/trace/events/tegra_apb_dma.h+2−2

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

include/uapi/linux/kfd_ioctl.h+1−19

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

include/uapi/linux/netfilter/xt_connlabel.h+6−0

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

include/uapi/linux/socket.h+13−6

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

include/uapi/linux/virtio_iommu.h+18−14

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

include/uapi/sound/sof/fw.h+9−7

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

include/uapi/sound/sof/header.h+8−6

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

include/xen/xen-ops.h+3−0

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

kernel/Makefile+0−1

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

kernel/bpf/verifier.c+2−2

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

kernel/dma/contiguous.c+5−3

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

kernel/dma/mapping.c+11−2

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

kernel/exit.c+3−2

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

kernel/irq/affinity.c+2−4

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

kernel/sched/deadline.c+0−8

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

kernel/sched/psi.c+2−2

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

kernel/signal.c+2−1

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

kernel/trace/trace_functions_graph.c+7−10

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

lib/Kconfig.kasan+5−6

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

lib/Makefile+2−1

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

lib/dim/dim.c+2−2

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

lib/dim/net_dim.c+56−0

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

lib/raid6/Makefile+1−1

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

lib/test_meminit.c+1−1

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

lib/vdso/gettimeofday.c+47−32

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

mm/Makefile+1−0

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

mm/balloon_compaction.c+41−28

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

mm/compaction.c+7−4

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

mm/hmm.c+4−6

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

mm/kmemleak.c+1−1

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

mm/memory_hotplug.c+0−2

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

mm/memremap.crenamed from kernel/memremap.c+6−0

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

mm/migrate.c+10−11

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

mm/slub.c+6−2

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

mm/vmscan.c+8−1

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

net/bridge/br.c+4−1

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

net/bridge/br_multicast.c+3−0

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

net/bridge/br_private.h+5−4

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

net/bridge/br_vlan.c+16−13

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

net/bridge/netfilter/ebtables.c+20−12

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

net/bridge/netfilter/nft_meta_bridge.c+2−8

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

net/can/gw.c+33−15

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

net/core/dev.c+12−5

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

net/core/filter.c+3−3

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

net/core/skmsg.c+2−2

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

net/core/sock_map.c+14−5

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

net/dsa/tag_sja1105.c+2−10

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

net/ipv4/inet_fragment.c+1−1

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

net/ipv4/ipip.c+3−0

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

net/ipv4/tcp_ulp.c+13−0

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

net/ipv6/ip6_gre.c+2−1

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

net/ipv6/ip6_tunnel.c+2−4

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

net/ipv6/route.c+1−1

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

net/iucv/af_iucv.c+9−5

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

net/l2tp/l2tp_ppp.c+3−0

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

net/mac80211/iface.c+0−1

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

net/mac80211/mlme.c+10−0

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

net/mac80211/util.c+3−4

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

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

net/netfilter/ipset/ip_set_hash_ipmac.c+1−5

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

net/netfilter/nft_meta.c+4−12

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

net/netrom/af_netrom.c+1−0

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

net/openvswitch/datapath.c+8−7

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

net/rds/rdma_transport.c+4−1

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

net/rxrpc/ar-internal.h+1−0

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

net/rxrpc/peer_event.c+1−1

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

net/rxrpc/peer_object.c+18−0

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

net/rxrpc/sendmsg.c+1−0

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

net/sched/act_bpf.c+5−4

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

net/sched/act_connmark.c+5−4

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

net/sched/act_csum.c+5−4

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

net/sched/act_ct.c+5−4

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

net/sched/act_ctinfo.c+5−4

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

net/sched/act_gact.c+5−3

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

net/sched/act_ife.c+10−3

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

net/sched/act_mirred.c+7−6

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

net/sched/act_mpls.c+5−3

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

net/sched/act_nat.c+5−4

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

net/sched/act_pedit.c+6−4

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

net/sched/act_police.c+5−3

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

net/sched/act_sample.c+5−5

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

net/sched/act_simple.c+6−4

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

net/sched/act_skbedit.c+6−5

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

net/sched/act_skbmod.c+6−5

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

net/sched/act_tunnel_key.c+5−3

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

net/sched/act_vlan.c+18−7

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

net/sched/sch_codel.c+3−3

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

net/sctp/socket.c+2−2

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

net/smc/af_smc.c+10−5

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

net/tipc/netlink_compat.c+7−4

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

net/tipc/socket.c+1−2

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

net/tls/tls_main.c+60−37

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

net/tls/tls_sw.c+59−24

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

net/vmw_vsock/hyperv_transport.c+8−0

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

net/wireless/core.c+2−4

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

net/wireless/nl80211.c+1−3

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

net/wireless/util.c+25−2

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

scripts/Kconfig.include+1−1

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

scripts/Makefile.build+10−1

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

scripts/Makefile.modpost+44−42

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

scripts/headers_install.sh+6−0

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

scripts/kconfig/confdata.c+4−0

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

scripts/link-vmlinux.sh+1−1

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

security/selinux/ss/policydb.c+5−1

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

sound/core/pcm_native.c+2−1

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

sound/firewire/packets-buffer.c+1−1

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

sound/hda/hdac_i915.c+6−4

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

sound/pci/hda/hda_controller.c+9−4

This diff is large: its 28 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+62−1

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

sound/soc/amd/raven/acp3x-pcm-dma.c+9−11

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

sound/soc/codecs/cs42xx8.c+97−19

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

sound/soc/codecs/max98357a.c+4−21

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

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

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

sound/soc/codecs/max98373.h+2−0

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

sound/soc/codecs/pcm3060-i2c.c+2−2

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

sound/soc/codecs/pcm3060-spi.c+2−2

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

sound/soc/codecs/pcm3060.c+2−2

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

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

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

sound/soc/codecs/rt1011.c+2−2

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

sound/soc/codecs/rt1308.c+0−0

File mode changed from 100755 to 100644.

sound/soc/codecs/rt1308.h+0−0

File mode changed from 100755 to 100644.

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

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

sound/soc/generic/simple-card-utils.c+7−0

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

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

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

sound/soc/intel/boards/bytcht_es8316.c+8−0

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

sound/soc/intel/common/soc-acpi-intel-bxt-match.c+1−1

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

sound/soc/intel/common/soc-acpi-intel-byt-match.c+1−1

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

sound/soc/intel/common/soc-acpi-intel-cht-match.c+1−1

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

sound/soc/intel/common/soc-acpi-intel-cnl-match.c+1−1

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

sound/soc/intel/common/soc-acpi-intel-glk-match.c+1−1

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

sound/soc/intel/common/soc-acpi-intel-hda-match.c+1−1

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

sound/soc/intel/common/soc-acpi-intel-hsw-bdw-match.c+1−1

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

sound/soc/intel/common/soc-acpi-intel-icl-match.c+1−1

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

sound/soc/intel/common/soc-acpi-intel-kbl-match.c+1−1

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

sound/soc/intel/common/soc-acpi-intel-skl-match.c+1−1

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

sound/soc/qcom/apq8016_sbc.c+8−8

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

sound/soc/rockchip/rockchip_i2s.c+2−3

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

sound/soc/rockchip/rockchip_max98090.c+32−0

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

sound/soc/samsung/odroid.c+5−3

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

sound/soc/soc-core.c+5−2

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

sound/soc/soc-dapm.c+6−4

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

sound/soc/sof/intel/cnl.c+2−2

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

sound/soc/sof/intel/hda-ipc.c+2−2

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

sound/soc/sunxi/sun4i-i2s.c+2−2

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

sound/soc/ti/davinci-mcasp.c+36−10

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

sound/sound_core.c+2−1

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

sound/usb/helper.c+1−1

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

sound/usb/hiface/pcm.c+8−3

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

sound/usb/stream.c+1−0

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

tools/arch/arm/include/uapi/asm/kvm.h+12−0

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

tools/arch/arm64/include/uapi/asm/kvm.h+10−0

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

tools/arch/powerpc/include/uapi/asm/mman.h+0−4

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

tools/arch/sparc/include/uapi/asm/mman.h+0−4

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

tools/arch/x86/include/uapi/asm/kvm.h+18−4

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

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

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

tools/include/uapi/asm-generic/mman-common.h+9−6

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

tools/include/uapi/asm-generic/mman.h+4−6

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

tools/include/uapi/asm-generic/unistd.h+7−1

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

tools/include/uapi/drm/drm.h+1−0

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

tools/include/uapi/drm/i915_drm.h+206−3

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

tools/include/uapi/linux/if_link.h+5−0

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

tools/include/uapi/linux/kvm.h+3−0

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

tools/include/uapi/linux/sched.h+29−1

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

tools/include/uapi/linux/usbdevice_fs.h+26−0

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

tools/lib/bpf/btf.c+3−2

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

tools/lib/bpf/hashmap.h+5−0

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

tools/lib/bpf/libbpf.c+23−11

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

tools/lib/bpf/xsk.c+5−6

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

tools/perf/Documentation/Makefile+1−1

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

tools/perf/Documentation/perf.data-file-format.txt+1−1

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

tools/perf/arch/s390/util/machine.c+30−1

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

tools/perf/arch/x86/entry/syscalls/syscall_64.tbl+2−0

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

tools/perf/bench/numa.c+4−2

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

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

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

tools/perf/pmu-events/jevents.c+1−0

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

tools/perf/trace/beauty/usbdevfs_ioctl.sh+6−3

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

tools/perf/ui/browser.c+5−4

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

tools/perf/ui/tui/progress.c+1−1

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

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

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

tools/perf/util/cpumap.c+4−1

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

tools/perf/util/header.c+8−1

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

tools/perf/util/machine.c+2−1

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

tools/perf/util/machine.h+1−1

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

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

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

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

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

tools/perf/util/thread.c+11−1

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

tools/testing/selftests/bpf/Makefile+2−1

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

tools/testing/selftests/bpf/progs/sendmsg6_prog.c+1−2

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

tools/testing/selftests/bpf/test_xdp_vlan.sh+45−12

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

tools/testing/selftests/bpf/test_xdp_vlan_mode_generic.sh+9−0

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

tools/testing/selftests/bpf/test_xdp_vlan_mode_native.sh+9−0

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

tools/testing/selftests/bpf/verifier/ctx_skb.c+11−0

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

tools/testing/selftests/cgroup/cgroup_util.c+1−2

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

tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh+2−2

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

tools/testing/selftests/kmod/kmod.sh+3−3

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

tools/testing/selftests/kselftest.h+15−0

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

tools/testing/selftests/kvm/.gitignore+2−1

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

tools/testing/selftests/kvm/config+3−0

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

tools/testing/selftests/livepatch/functions.sh+40−6

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

tools/testing/selftests/net/.gitignore+2−2

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

tools/testing/selftests/net/forwarding/gre_multipath.sh+16−12

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

tools/testing/selftests/net/tls.c+223−0

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

tools/testing/selftests/pidfd/pidfd_test.c+1−5

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

tools/testing/selftests/tc-testing/tc-tests/actions/vlan.json+94−0

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

tools/testing/selftests/x86/test_vsyscall.c+1−1

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

virt/kvm/arm/arm.c+13−5

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

virt/kvm/arm/hyp/vgic-v3-sr.c+8−0

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

virt/kvm/arm/pmu.c+15−3

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

virt/kvm/arm/vgic/vgic-mmio.c+16−0

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

virt/kvm/arm/vgic/vgic-v2.c+8−1

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

virt/kvm/arm/vgic/vgic-v3.c+6−1

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

virt/kvm/arm/vgic/vgic.c+11−0

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

virt/kvm/arm/vgic/vgic.h+2−0

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

virt/kvm/kvm_main.c+36−25

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