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
41 41
42The following CVE entries describe Spectre variants:42The following CVE entries describe Spectre variants:
43 43
44 ============= ======================= =================44 ============= ======================= ==========================
45 CVE-2017-5753 Bounds check bypass Spectre variant 145 CVE-2017-5753 Bounds check bypass Spectre variant 1
46 CVE-2017-5715 Branch target injection Spectre variant 246 CVE-2017-5715 Branch target injection Spectre variant 2
47 ============= ======================= =================47 CVE-2019-1125 Spectre v1 swapgs Spectre variant 1 (swapgs)
48 ============= ======================= ==========================
48 49
49Problem50Problem
50-------51-------
@@ -78,6 +79,13 @@ There are some extensions of Spectre variant 1 attacks for reading data · 27 unmodified lines
78over the network, see :ref:`[12] <spec_ref12>`. However such attacks79over the network, see :ref:`[12] <spec_ref12>`. However such attacks
79are difficult, low bandwidth, fragile, and are considered low risk.80are difficult, low bandwidth, fragile, and are considered low risk.
80 81
82Note that, despite "Bounds Check Bypass" name, Spectre variant 1 is not
83only about user-controlled array bounds checks. It can affect any
84conditional checks. The kernel entry code interrupt, exception, and NMI
85handlers all have conditional swapgs checks. Those may be problematic
86in the context of Spectre v1, as kernel code can speculatively run with
87a user GS.
88
81Spectre variant 2 (Branch Target Injection)89Spectre variant 2 (Branch Target Injection)
82-------------------------------------------90-------------------------------------------
83 91
@@ -132,6 +140,9 @@ not cover all possible attack vectors. · 48 unmodified lines
1321. A user process attacking the kernel1401. A user process attacking the kernel
133^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^141^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
134 142
143Spectre variant 1
144~~~~~~~~~~~~~~~~~
145
135 The attacker passes a parameter to the kernel via a register or146 The attacker passes a parameter to the kernel via a register or
136 via a known address in memory during a syscall. Such parameter may147 via a known address in memory during a syscall. Such parameter may
137 be used later by the kernel as an index to an array or to derive148 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
144 potentially be influenced for Spectre attacks, new "nospec" accessor155 potentially be influenced for Spectre attacks, new "nospec" accessor
145 macros are used to prevent speculative loading of data.156 macros are used to prevent speculative loading of data.
146 157
147 Spectre variant 2 attacker can :ref:`poison <poison_btb>` the branch158Spectre 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
188Spectre variant 2
189~~~~~~~~~~~~~~~~~
190
191 A spectre variant 2 attacker can :ref:`poison <poison_btb>` the branch
148 target buffer (BTB) before issuing syscall to launch an attack.192 target buffer (BTB) before issuing syscall to launch an attack.
149 After entering the kernel, the kernel could use the poisoned branch193 After entering the kernel, the kernel could use the poisoned branch
150 target buffer on indirect jump and jump to gadget code in speculative194 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
280 324
281The possible values in this file are:325The possible values in this file are:
282 326
283 ======================================= =================================327 .. list-table::
284 'Mitigation: __user pointer sanitation' Protection in kernel on a case by328
285 case base with explicit pointer329 * - 'Not affected'
286 sanitation.330 - The processor is not vulnerable.
287 ======================================= =================================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.
288 339
289However, the protections are put in place on a case by case basis,340However, the protections are put in place on a case by case basis,
290and there is no guarantee that all possible attack vectors for Spectre341and 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
3661. Kernel mitigation4171. Kernel mitigation
367^^^^^^^^^^^^^^^^^^^^418^^^^^^^^^^^^^^^^^^^^
368 419
420Spectre variant 1
421~~~~~~~~~~~~~~~~~
422
369 For the Spectre variant 1, vulnerable kernel code (as determined423 For the Spectre variant 1, vulnerable kernel code (as determined
370 by code audit or scanning tools) is annotated on a case by case424 by code audit or scanning tools) is annotated on a case by case
371 basis to use nospec accessor macros for bounds clipping :ref:`[2]425 basis to use nospec accessor macros for bounds clipping :ref:`[2]
372 <spec_ref2>` to avoid any usable disclosure gadgets. However, it may426 <spec_ref2>` to avoid any usable disclosure gadgets. However, it may
373 not cover all attack vectors for Spectre variant 1.427 not cover all attack vectors for Spectre variant 1.
374 428
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
438Spectre variant 2
439~~~~~~~~~~~~~~~~~
440
375 For Spectre variant 2 mitigation, the compiler turns indirect calls or441 For Spectre variant 2 mitigation, the compiler turns indirect calls or
376 jumps in the kernel into equivalent return trampolines (retpolines)442 jumps in the kernel into equivalent return trampolines (retpolines)
377 :ref:`[3] <spec_ref3>` :ref:`[9] <spec_ref9>` to go to the target443 :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
473Spectre variant 2 mitigation can be disabled or force enabled at the539Spectre variant 2 mitigation can be disabled or force enabled at the
474kernel command line.540kernel command line.
475 541
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
476 nospectre_v2548 nospectre_v2
477 549
478 [X86] Disable all mitigations for the Spectre variant 2550 [X86] Disable all mitigations for the Spectre variant 2
Documentation/admin-guide/kernel-parameters.txt+4−4
@@ -2604,7 +2604,7 @@ · 2603 unmodified lines
2604 expose users to several CPU vulnerabilities.2604 expose users to several CPU vulnerabilities.
2605 Equivalent to: nopti [X86,PPC]2605 Equivalent to: nopti [X86,PPC]
2606 kpti=0 [ARM64]2606 kpti=0 [ARM64]
2607 nospectre_v1 [PPC]2607 nospectre_v1 [X86,PPC]
2608 nobp=0 [S390]2608 nobp=0 [S390]
2609 nospectre_v2 [X86,PPC,S390,ARM64]2609 nospectre_v2 [X86,PPC,S390,ARM64]
2610 spectre_v2_user=off [X86]2610 spectre_v2_user=off [X86]
@@ -2965,9 +2965,9 @@ · 354 unmodified lines
2965 nosmt=force: Force disable SMT, cannot be undone2965 nosmt=force: Force disable SMT, cannot be undone
2966 via the sysfs control file.2966 via the sysfs control file.
2967 2967
2968 nospectre_v1 [PPC] Disable mitigations for Spectre Variant 1 (bounds2968 nospectre_v1 [X86,PPC] Disable mitigations for Spectre Variant 1
2969 check bypass). With this option data leaks are possible2969 (bounds check bypass). With this option data leaks are
2970 in the system.2970 possible in the system.
2971 2971
2972 nospectre_v2 [X86,PPC_FSL_BOOK3E,ARM64] Disable all mitigations for2972 nospectre_v2 [X86,PPC_FSL_BOOK3E,ARM64] Disable all mitigations for
2973 the Spectre variant 2 (indirect branch prediction)2973 the Spectre variant 2 (indirect branch prediction)
Documentation/devicetree/bindings/riscv/cpus.txt+0−162
@@ -1,162 +0,0 @@
1===================
2RISC-V CPU Bindings
3===================
4
5The device tree allows to describe the layout of CPUs in a system through
6the "cpus" node, which in turn contains a number of subnodes (ie "cpu")
7defining properties for every cpu.
8
9Bindings for CPU nodes follow the Devicetree Specification, available from:
10
11https://www.devicetree.org/specifications/
12
13with updates for 32-bit and 64-bit RISC-V systems provided in this document.
14
15===========
16Terminology
17===========
18
19This document uses some terminology common to the RISC-V community that is not
20widely 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=====================================
30cpus and cpu node bindings definition
31=====================================
32
33The RISC-V architecture, in accordance with the Devicetree Specification,
34requires the cpus and cpu nodes to be present and contain the properties
35described 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
86Example: SiFive Freedom U540G Development Kit
87---------------------------------------------
88
89This system contains two harts: a hart marked as disabled that's used for
90low-level system tasks and should be ignored by Linux, and a second hart that
91Linux 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
142Example: Spike ISA Simulator with 1 Hart
143----------------------------------------
144
145This 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
10 - Paul Walmsley <paul.walmsley@sifive.com>10 - Paul Walmsley <paul.walmsley@sifive.com>
11 - Palmer Dabbelt <palmer@sifive.com>11 - Palmer Dabbelt <palmer@sifive.com>
12 12
13description: |
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
13properties:25properties:
14 compatible:26 compatible:
15 items:27 items:
@@ -50,6 +62,10 @@ properties: · 34 unmodified lines
50 User-Level ISA document, available from62 User-Level ISA document, available from
51 https://riscv.org/specifications/63 https://riscv.org/specifications/
52 64
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
53 timebase-frequency:69 timebase-frequency:
54 type: integer70 type: integer
55 minimum: 171 minimum: 1
Documentation/devicetree/bindings/riscv/sifive.yaml+1−1
@@ -19,7 +19,7 @@ properties: · 18 unmodified lines
19 compatible:19 compatible:
20 items:20 items:
21 - enum:21 - enum:
22 - sifive,freedom-unleashed-a0022 - sifive,hifive-unleashed-a00
23 - const: sifive,fu540-c00023 - const: sifive,fu540-c000
24 - const: sifive,fu54024 - const: sifive,fu540
25...25...
Documentation/devicetree/bindings/spi/spi-controller.yaml+0−1
@@ -73,7 +73,6 @@ patternProperties: · 72 unmodified lines
73 Compatible of the SPI device.73 Compatible of the SPI device.
74 74
75 reg:75 reg:
76 maxItems: 1
77 minimum: 076 minimum: 0
78 maximum: 25677 maximum: 256
79 description:78 description:
Documentation/filesystems/cifs/TODO+16−10
@@ -13,7 +13,8 @@ a) SMB3 (and SMB3.1.1) missing optional features: · 12 unmodified lines
13 - T10 copy offload ie "ODX" (copy chunk, and "Duplicate Extents" ioctl13 - T10 copy offload ie "ODX" (copy chunk, and "Duplicate Extents" ioctl
14 currently the only two server side copy mechanisms supported)14 currently the only two server side copy mechanisms supported)
15 15
16b) improved sparse file support16b) improved sparse file support (fiemap and SEEK_HOLE are implemented
17but additional features would be supportable by the protocol).
17 18
18c) Directory entry caching relies on a 1 second timer, rather than19c) Directory entry caching relies on a 1 second timer, rather than
19using Directory Leases, currently only the root file handle is cached longer20using 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
21d) quota support (needs minor kernel change since quota calls22d) quota support (needs minor kernel change since quota calls
22to make it to network filesystems or deviceless filesystems)23to make it to network filesystems or deviceless filesystems)
23 24
24e) Additional use cases where we use "compoounding" (e.g. open/query/close25e) Additional use cases can be optimized to use "compounding"
25and open/setinfo/close) to reduce the number of roundtrips, and also26(e.g. open/query/close and open/setinfo/close) to reduce the number
26open to reduce redundant opens (using deferred close and reference counts more).27of roundtrips to the server and improve performance. Various cases
28(stat, statfs, create, unlink, mkdir) already have been improved by
29using compounding but more can be done. In addition we could significantly
30reduce redundant opens by using deferred close (with handle caching leases)
31and better using reference counters on file handles.
27 32
28f) Finish inotify support so kde and gnome file list windows33f) Finish inotify support so kde and gnome file list windows
29will autorefresh (partially complete by Asser). Needs minor kernel34will 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
43exists. Also better integration with winbind for resolving SID owners48exists. Also better integration with winbind for resolving SID owners
44 49
45k) Add tools to take advantage of more smb3 specific ioctls and features50k) Add tools to take advantage of more smb3 specific ioctls and features
46(passthrough ioctl/fsctl for sending various SMB3 fsctls to the server51(passthrough ioctl/fsctl is now implemented in cifs.ko to allow sending
47is in progress, and a passthrough query_info call is already implemented52various SMB3 fsctls and query info and set info calls directly from user space)
48in cifs.ko to allow smb3 info levels queries to be sent from userspace)53Add tools to make setting various non-POSIX metadata attributes easier
54from tools (e.g. extending what was done in smb-info tool).
49 55
50l) encrypted file support56l) encrypted file support
51 57
52m) improved stats gathering tools (perhaps integration with nfsometer?)58m) improved stats gathering tools (perhaps integration with nfsometer?)
53to extend and make easier to use what is currently in /proc/fs/cifs/Stats59to extend and make easier to use what is currently in /proc/fs/cifs/Stats
54 60
55n) allow setting more NTFS/SMB3 file attributes remotely (currently limited to compressed61n) Add support for claims based ACLs ("DAC")
56file attribute via chflags) and improve user space tools for managing and
57viewing them.
58 62
59o) mount helper GUI (to simplify the various configuration options on mount)63o) mount helper GUI (to simplify the various configuration options on mount)
60 64
@@ -82,6 +86,8 @@ so far). · 21 unmodified lines
82w) Add support for additional strong encryption types, and additional spnego86w) Add support for additional strong encryption types, and additional spnego
83authentication mechanisms (see MS-SMB2)87authentication mechanisms (see MS-SMB2)
84 88
89x) Finish support for SMB3.1.1 compression
90
85KNOWN BUGS91KNOWN BUGS
86====================================92====================================
87See http://bugzilla.samba.org - search on product "CifsVFS" for93See http://bugzilla.samba.org - search on product "CifsVFS" for
Documentation/networking/tls-offload.rst+17−6
@@ -424,13 +424,24 @@ Statistics · 423 unmodified lines
424Following minimum set of TLS-related statistics should be reported424Following minimum set of TLS-related statistics should be reported
425by the driver:425by the driver:
426 426
427 * ``rx_tls_decrypted`` - number of successfully decrypted TLS segments427 * ``rx_tls_decrypted_packets`` - number of successfully decrypted RX packets
428 * ``tx_tls_encrypted`` - number of in-order TLS segments passed to device428 which were part of a TLS stream.
429 for encryption429 * ``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.
430 * ``tx_tls_ooo`` - number of TX packets which were part of a TLS stream437 * ``tx_tls_ooo`` - number of TX packets which were part of a TLS stream
431 but did not arrive in the expected order438 but did not arrive in the expected order.
432 * ``tx_tls_drop_no_sync_data`` - number of TX packets dropped because439 * ``tx_tls_drop_no_sync_data`` - number of TX packets which were part of
433 they arrived out of order and associated record could not be found440 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.
434 445
435Notable corner cases, exceptions and additional requirements446Notable corner cases, exceptions and additional requirements
436============================================================447============================================================
Documentation/vm/hmm.rst+1−1
@@ -237,7 +237,7 @@ The usage pattern is:: · 236 unmodified lines
237 ret = hmm_range_snapshot(&range);237 ret = hmm_range_snapshot(&range);
238 if (ret) {238 if (ret) {
239 up_read(&mm->mmap_sem);239 up_read(&mm->mmap_sem);
240 if (ret == -EAGAIN) {240 if (ret == -EBUSY) {
241 /*241 /*
242 * No need to check hmm_range_wait_until_valid() return value242 * No need to check hmm_range_wait_until_valid() return value
243 * on retry we will get proper error with hmm_range_snapshot()243 * 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
2155 2155
2156ARM/RENESAS ARM64 ARCHITECTURE2156ARM/RENESAS ARM64 ARCHITECTURE
2157M: Simon Horman <horms@verge.net.au>2157M: Simon Horman <horms@verge.net.au>
2158M: Geert Uytterhoeven <geert+renesas@glider.be>
2158M: Magnus Damm <magnus.damm@gmail.com>2159M: Magnus Damm <magnus.damm@gmail.com>
2159L: linux-renesas-soc@vger.kernel.org2160L: linux-renesas-soc@vger.kernel.org
2160Q: http://patchwork.kernel.org/project/linux-renesas-soc/list/2161Q: http://patchwork.kernel.org/project/linux-renesas-soc/list/
2161T: git git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git next2162T: git git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git next
2163T: git git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git next
2162S: Supported2164S: Supported
2163F: arch/arm64/boot/dts/renesas/2165F: arch/arm64/boot/dts/renesas/
2164F: Documentation/devicetree/bindings/arm/renesas.yaml2166F: Documentation/devicetree/bindings/arm/renesas.yaml
@@ -2269,10 +2271,12 @@ F: drivers/media/platform/s5p-mfc/ · 104 unmodified lines
2269 2271
2270ARM/SHMOBILE ARM ARCHITECTURE2272ARM/SHMOBILE ARM ARCHITECTURE
2271M: Simon Horman <horms@verge.net.au>2273M: Simon Horman <horms@verge.net.au>
2274M: Geert Uytterhoeven <geert+renesas@glider.be>
2272M: Magnus Damm <magnus.damm@gmail.com>2275M: Magnus Damm <magnus.damm@gmail.com>
2273L: linux-renesas-soc@vger.kernel.org2276L: linux-renesas-soc@vger.kernel.org
2274Q: http://patchwork.kernel.org/project/linux-renesas-soc/list/2277Q: http://patchwork.kernel.org/project/linux-renesas-soc/list/
2275T: git git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git next2278T: git git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git next
2279T: git git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git next
2276S: Supported2280S: Supported
2277F: arch/arm/boot/dts/emev2*2281F: arch/arm/boot/dts/emev2*
2278F: arch/arm/boot/dts/gr-peach*2282F: arch/arm/boot/dts/gr-peach*
@@ -6322,7 +6326,8 @@ F: Documentation/devicetree/bindings/counter/ftm-quaddec.txt · 4043 unmodified lines
6322F: drivers/counter/ftm-quaddec.c6326F: drivers/counter/ftm-quaddec.c
6323 6327
6324FLOPPY DRIVER6328FLOPPY DRIVER
6325S: Orphan6329M: Denis Efremov <efremov@linux.com>
6330S: Odd Fixes
6326L: linux-block@vger.kernel.org6331L: linux-block@vger.kernel.org
6327F: drivers/block/floppy.c6332F: drivers/block/floppy.c
6328 6333
@@ -6339,7 +6344,7 @@ FPGA MANAGER FRAMEWORK · 10 unmodified lines
6339M: Moritz Fischer <mdf@kernel.org>6344M: Moritz Fischer <mdf@kernel.org>
6340L: linux-fpga@vger.kernel.org6345L: linux-fpga@vger.kernel.org
6341S: Maintained6346S: Maintained
6342T: git git://git.kernel.org/pub/scm/linux/kernel/git/atull/linux-fpga.git6347T: git git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga.git
6343Q: http://patchwork.kernel.org/project/linux-fpga/list/6348Q: http://patchwork.kernel.org/project/linux-fpga/list/
6344F: Documentation/fpga/6349F: Documentation/fpga/
6345F: Documentation/driver-api/fpga/6350F: Documentation/driver-api/fpga/
@@ -6372,7 +6377,7 @@ FRAMEBUFFER LAYER · 26 unmodified lines
6372M: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>6377M: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
6373L: dri-devel@lists.freedesktop.org6378L: dri-devel@lists.freedesktop.org
6374L: linux-fbdev@vger.kernel.org6379L: linux-fbdev@vger.kernel.org
6375T: git git://github.com/bzolnier/linux.git6380T: git git://anongit.freedesktop.org/drm/drm-misc
6376Q: http://patchwork.kernel.org/project/linux-fbdev/list/6381Q: http://patchwork.kernel.org/project/linux-fbdev/list/
6377S: Maintained6382S: Maintained
6378F: Documentation/fb/6383F: Documentation/fb/
@@ -6822,13 +6827,6 @@ F: Documentation/filesystems/gfs2*.txt · 443 unmodified lines
6822F: fs/gfs2/6827F: fs/gfs2/
6823F: include/uapi/linux/gfs2_ondisk.h6828F: include/uapi/linux/gfs2_ondisk.h
6824 6829
6825GIGASET ISDN DRIVERS
6826M: Paul Bolle <pebolle@tiscali.nl>
6827L: gigaset307x-common@lists.sourceforge.net
6828W: http://gigaset307x.sourceforge.net/
6829S: Odd Fixes
6830F: drivers/staging/isdn/gigaset/
6831
6832GNSS SUBSYSTEM6830GNSS SUBSYSTEM
6833M: Johan Hovold <johan@kernel.org>6831M: Johan Hovold <johan@kernel.org>
6834T: git git://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss.git6832T: git git://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss.git
@@ -8044,6 +8042,7 @@ S: Maintained · 1209 unmodified lines
8044F: drivers/video/fbdev/i810/8042F: drivers/video/fbdev/i810/
8045 8043
8046INTEL ASoC DRIVERS8044INTEL ASoC DRIVERS
8045M: Cezary Rojewski <cezary.rojewski@intel.com>
8047M: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>8046M: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
8048M: Liam Girdwood <liam.r.girdwood@linux.intel.com>8047M: Liam Girdwood <liam.r.girdwood@linux.intel.com>
8049M: Jie Yang <yang.jie@linux.intel.com>8048M: Jie Yang <yang.jie@linux.intel.com>
@@ -11145,6 +11144,7 @@ L: netdev@vger.kernel.org · 3095 unmodified lines
11145S: Maintained11144S: Maintained
11146W: https://fedorahosted.org/dropwatch/11145W: https://fedorahosted.org/dropwatch/
11147F: net/core/drop_monitor.c11146F: net/core/drop_monitor.c
11147F: include/uapi/linux/net_dropmon.h
11148 11148
11149NETWORKING DRIVERS11149NETWORKING DRIVERS
11150M: "David S. Miller" <davem@davemloft.net>11150M: "David S. Miller" <davem@davemloft.net>
@@ -11283,6 +11283,7 @@ M: Aviad Yehezkel <aviadye@mellanox.com> · 132 unmodified lines
11283M: Dave Watson <davejwatson@fb.com>11283M: Dave Watson <davejwatson@fb.com>
11284M: John Fastabend <john.fastabend@gmail.com>11284M: John Fastabend <john.fastabend@gmail.com>
11285M: Daniel Borkmann <daniel@iogearbox.net>11285M: Daniel Borkmann <daniel@iogearbox.net>
11286M: Jakub Kicinski <jakub.kicinski@netronome.com>
11286L: netdev@vger.kernel.org11287L: netdev@vger.kernel.org
11287S: Maintained11288S: Maintained
11288F: net/tls/*11289F: net/tls/*
@@ -14017,6 +14018,12 @@ F: drivers/media/common/saa7146/ · 2728 unmodified lines
14017F: drivers/media/pci/saa7146/14018F: drivers/media/pci/saa7146/
14018F: include/media/drv-intf/saa7146*14019F: include/media/drv-intf/saa7146*
14019 14020
14021SAFESETID SECURITY MODULE
14022M: Micah Morton <mortonm@chromium.org>
14023S: Supported
14024F: security/safesetid/
14025F: Documentation/admin-guide/LSM/SafeSetID.rst
14026
14020SAMSUNG AUDIO (ASoC) DRIVERS14027SAMSUNG AUDIO (ASoC) DRIVERS
14021M: Krzysztof Kozlowski <krzk@kernel.org>14028M: Krzysztof Kozlowski <krzk@kernel.org>
14022M: Sangbeom Kim <sbkim73@samsung.com>14029M: Sangbeom Kim <sbkim73@samsung.com>
@@ -16079,7 +16086,7 @@ S: Maintained · 2056 unmodified lines
16079F: drivers/net/ethernet/ti/netcp*16086F: drivers/net/ethernet/ti/netcp*
16080 16087
16081TI PCM3060 ASoC CODEC DRIVER16088TI PCM3060 ASoC CODEC DRIVER
16082M: Kirill Marinushkin <kmarinushkin@birdec.tech>16089M: Kirill Marinushkin <kmarinushkin@birdec.com>
16083L: alsa-devel@alsa-project.org (moderated for non-subscribers)16090L: alsa-devel@alsa-project.org (moderated for non-subscribers)
16084S: Maintained16091S: Maintained
16085F: Documentation/devicetree/bindings/sound/pcm3060.txt16092F: Documentation/devicetree/bindings/sound/pcm3060.txt
@@ -17555,7 +17562,6 @@ M: Jakub Kicinski <jakub.kicinski@netronome.com> · 1469 unmodified lines
17555M: Jesper Dangaard Brouer <hawk@kernel.org>17562M: Jesper Dangaard Brouer <hawk@kernel.org>
17556M: John Fastabend <john.fastabend@gmail.com>17563M: John Fastabend <john.fastabend@gmail.com>
17557L: netdev@vger.kernel.org17564L: netdev@vger.kernel.org
17558L: xdp-newbies@vger.kernel.org
17559L: bpf@vger.kernel.org17565L: bpf@vger.kernel.org
17560S: Supported17566S: Supported
17561F: net/core/xdp.c17567F: net/core/xdp.c
Makefile+20−7
@@ -2,7 +2,7 @@ · 1 unmodified line
2VERSION = 52VERSION = 5
3PATCHLEVEL = 33PATCHLEVEL = 3
4SUBLEVEL = 04SUBLEVEL = 0
5EXTRAVERSION = -rc25EXTRAVERSION = -rc4
6NAME = Bobtail Squid6NAME = Bobtail Squid
7 7
8# *DOCUMENTATION*8# *DOCUMENTATION*
@@ -419,6 +419,7 @@ NM = $(CROSS_COMPILE)nm · 410 unmodified lines
419STRIP = $(CROSS_COMPILE)strip419STRIP = $(CROSS_COMPILE)strip
420OBJCOPY = $(CROSS_COMPILE)objcopy420OBJCOPY = $(CROSS_COMPILE)objcopy
421OBJDUMP = $(CROSS_COMPILE)objdump421OBJDUMP = $(CROSS_COMPILE)objdump
422OBJSIZE = $(CROSS_COMPILE)size
422PAHOLE = pahole423PAHOLE = pahole
423LEX = flex424LEX = flex
424YACC = bison425YACC = bison
@@ -472,11 +473,12 @@ KBUILD_CFLAGS_MODULE := -DMODULE · 47 unmodified lines
472KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds473KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
473KBUILD_LDFLAGS :=474KBUILD_LDFLAGS :=
474GCC_PLUGINS_CFLAGS :=475GCC_PLUGINS_CFLAGS :=
476CLANG_FLAGS :=
475 477
476export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC478export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC
477export CPP AR NM STRIP OBJCOPY OBJDUMP PAHOLE KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS479export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE PAHOLE LEX YACC AWK INSTALLKERNEL
478export MAKE LEX YACC AWK INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE480export PERL PYTHON PYTHON2 PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
479export HOSTCXX KBUILD_HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS481export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE
480 482
481export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS483export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS
482export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE484export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
@@ -519,7 +521,7 @@ endif · 36 unmodified lines
519 521
520ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)522ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
521ifneq ($(CROSS_COMPILE),)523ifneq ($(CROSS_COMPILE),)
522CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE:%-=%))524CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
523GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))525GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
524CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)526CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)
525GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..)527GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..)
@@ -844,7 +846,7 @@ NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) · 318 unmodified lines
844KBUILD_CFLAGS += -Wdeclaration-after-statement846KBUILD_CFLAGS += -Wdeclaration-after-statement
845 847
846# Warn about unmarked fall-throughs in switch statement.848# Warn about unmarked fall-throughs in switch statement.
847KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough=3,)849KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough,)
848 850
849# Variable Length Arrays (VLAs) should not be used anywhere in the kernel851# Variable Length Arrays (VLAs) should not be used anywhere in the kernel
850KBUILD_CFLAGS += -Wvla852KBUILD_CFLAGS += -Wvla
@@ -1001,6 +1003,8 @@ endif · 150 unmodified lines
1001 1003
1002PHONY += prepare01004PHONY += prepare0
1003 1005
1006export MODORDER := $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)modules.order
1007
1004ifeq ($(KBUILD_EXTMOD),)1008ifeq ($(KBUILD_EXTMOD),)
1005core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/1009core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
1006 1010
@@ -1770,13 +1774,22 @@ build-dir = $(patsubst %/,%,$(dir $(build-target))) · 763 unmodified lines
1770 $(Q)$(MAKE) $(build)=$(build-dir) $(build-target)1774 $(Q)$(MAKE) $(build)=$(build-dir) $(build-target)
1771%.symtypes: prepare FORCE1775%.symtypes: prepare FORCE
1772 $(Q)$(MAKE) $(build)=$(build-dir) $(build-target)1776 $(Q)$(MAKE) $(build)=$(build-dir) $(build-target)
1777ifeq ($(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
1781endif
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
1773 1786
1774# Modules1787# Modules
1775PHONY += /1788PHONY += /
1776/: ./1789/: ./
1777 1790
1778%/: prepare FORCE1791%/: prepare FORCE
1779 $(Q)$(MAKE) KBUILD_MODULES=1 $(build)=$(build-dir)1792 $(Q)$(MAKE) KBUILD_MODULES=1 $(build)=$(build-dir) need-modorder=1
1780 1793
1781# FIXME Should go into a make.lib or something1794# FIXME Should go into a make.lib or something
1782# ===========================================================================1795# ===========================================================================
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
18 18
19static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)19static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
20{20{
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;
22}24}
23 25
24#ifdef __arch_page_to_dma26#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
544 if ((hw->ctrl.type != ARM_BREAKPOINT_EXECUTE)544 if ((hw->ctrl.type != ARM_BREAKPOINT_EXECUTE)
545 && max_watchpoint_len >= 8)545 && max_watchpoint_len >= 8)
546 break;546 break;
547 /* Else, fall through */
547 default:548 default:
548 return -EINVAL;549 return -EINVAL;
549 }550 }
@@ -608,10 +609,12 @@ int hw_breakpoint_arch_parse(struct perf_event *bp, · 58 unmodified lines
608 /* Allow halfword watchpoints and breakpoints. */609 /* Allow halfword watchpoints and breakpoints. */
609 if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2)610 if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2)
610 break;611 break;
612 /* Else, fall through */
611 case 3:613 case 3:
612 /* Allow single byte watchpoint. */614 /* Allow single byte watchpoint. */
613 if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1)615 if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1)
614 break;616 break;
617 /* Else, fall through */
615 default:618 default:
616 ret = -EINVAL;619 ret = -EINVAL;
617 goto out;620 goto out;
@@ -861,6 +864,7 @@ static int hw_breakpoint_pending(unsigned long addr, unsigned int fsr, · 243 unmodified lines
861 break;864 break;
862 case ARM_ENTRY_ASYNC_WATCHPOINT:865 case ARM_ENTRY_ASYNC_WATCHPOINT:
863 WARN(1, "Asynchronous watchpoint exception taken. Debugging results may be unreliable\n");866 WARN(1, "Asynchronous watchpoint exception taken. Debugging results may be unreliable\n");
867 /* Fall through */
864 case ARM_ENTRY_SYNC_WATCHPOINT:868 case ARM_ENTRY_SYNC_WATCHPOINT:
865 watchpoint_handler(addr, fsr, regs);869 watchpoint_handler(addr, fsr, regs);
866 break;870 break;
@@ -909,6 +913,7 @@ static bool core_has_os_save_restore(void) · 42 unmodified lines
909 ARM_DBG_READ(c1, c1, 4, oslsr);913 ARM_DBG_READ(c1, c1, 4, oslsr);
910 if (oslsr & ARM_OSLSR_OSLM0)914 if (oslsr & ARM_OSLSR_OSLM0)
911 return true;915 return true;
916 /* Else, fall through */
912 default:917 default:
913 return false;918 return false;
914 }919 }
arch/arm/kernel/signal.c+1−0
@@ -596,6 +596,7 @@ static int do_signal(struct pt_regs *regs, int syscall) · 595 unmodified lines
596 switch (retval) {596 switch (retval) {
597 case -ERESTART_RESTARTBLOCK:597 case -ERESTART_RESTARTBLOCK:
598 restart -= 2;598 restart -= 2;
599 /* Fall through */
599 case -ERESTARTNOHAND:600 case -ERESTARTNOHAND:
600 case -ERESTARTSYS:601 case -ERESTARTSYS:
601 case -ERESTARTNOINTR:602 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
651}651}
652 652
653static void reset_coproc_regs(struct kvm_vcpu *vcpu,653static 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)
655{656{
656 unsigned long i;657 unsigned long i;
657 658
658 for (i = 0; i < num; i++)659 for (i = 0; i < num; i++)
659 if (table[i].reset)660 if (table[i].reset) {
661 int reg = table[i].reg;
662
660 table[i].reset(vcpu, &table[i]);663 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 }
661}670}
662 671
663static struct coproc_params decode_32bit_hsr(struct kvm_vcpu *vcpu)672static 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
1432{1441{
1433 size_t num;1442 size_t num;
1434 const struct coproc_reg *table;1443 const struct coproc_reg *table;
1435 1444 DECLARE_BITMAP(bmap, NR_CP15_REGS) = { 0, };
1436 /* Catch someone adding a register without putting in reset entry. */
1437 memset(vcpu->arch.ctxt.cp15, 0x42, sizeof(vcpu->arch.ctxt.cp15));
1438 1445
1439 /* Generic chip reset first (so target could override). */1446 /* 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);
1441 1448
1442 table = get_target_table(vcpu->arch.target, &num);1449 table = get_target_table(vcpu->arch.target, &num);
1443 reset_coproc_regs(vcpu, table, num);1450 reset_coproc_regs(vcpu, table, num, bmap);
1444 1451
1445 for (num = 1; num < NR_CP15_REGS; num++)1452 for (num = 1; num < NR_CP15_REGS; num++)
1446 WARN(vcpu_cp15(vcpu, num) == 0x42424242,1453 WARN(!test_bit(num, bmap),
1447 "Didn't reset vcpu_cp15(vcpu, %zi)", num);1454 "Didn't reset vcpu_cp15(vcpu, %zi)", num);
1448}1455}
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
49 * FALLTHROUGH: Ensure we don't try to overwrite our newly49 * FALLTHROUGH: Ensure we don't try to overwrite our newly
50 * initialised state information on the first fault.50 * initialised state information on the first fault.
51 */51 */
52 /* Fall through */
52 53
53 case THREAD_NOTIFY_EXIT:54 case THREAD_NOTIFY_EXIT:
54 crunch_task_release(thread);55 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
70 switch (err) {70 switch (err) {
71 case -ENOSYS:71 case -ENOSYS:
72 tegra_cpu_reset_handler_set(reset_address);72 tegra_cpu_reset_handler_set(reset_address);
73 /* pass-through */73 /* fall through */
74 case 0:74 case 0:
75 is_enabled = true;75 is_enabled = true;
76 break;76 break;
arch/arm/mm/Kconfig+5−0
@@ -663,6 +663,11 @@ config ARM_LPAE · 662 unmodified lines
663 depends on MMU && CPU_32v7 && !CPU_32v6 && !CPU_32v5 && \663 depends on MMU && CPU_32v7 && !CPU_32v6 && !CPU_32v5 && \
664 !CPU_32v4 && !CPU_32v3664 !CPU_32v4 && !CPU_32v3
665 select PHYS_ADDR_T_64BIT665 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
666 help671 help
667 Say Y if you have an ARMv7 processor supporting the LPAE page672 Say Y if you have an ARMv7 processor supporting the LPAE page
668 table format and you would like to access memory beyond the673 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
695 return subset[(L<<1) | ((tinstr & (1<<8)) >> 8)] |695 return subset[(L<<1) | ((tinstr & (1<<8)) >> 8)] |
696 (tinstr & 255); /* register_list */696 (tinstr & 255); /* register_list */
697 }697 }
698 /* Else fall through for illegal instruction case */698 /* Else, fall through - for illegal instruction case */
699 699
700 default:700 default:
701 return BAD_INSTR;701 return BAD_INSTR;
@@ -751,6 +751,8 @@ do_alignment_t32_to_handler(unsigned long *pinstr, struct pt_regs *regs, · 49 unmodified lines
751 case 0xe8e0:751 case 0xe8e0:
752 case 0xe9e0:752 case 0xe9e0:
753 poffset->un = (tinst2 & 0xff) << 2;753 poffset->un = (tinst2 & 0xff) << 2;
754 /* Fall through */
755
754 case 0xe940:756 case 0xe940:
755 case 0xe9c0:757 case 0xe9c0:
756 return do_alignment_ldrdstrd;758 return do_alignment_ldrdstrd;
arch/arm/mm/dma-mapping.c+61−0
@@ -15,6 +15,7 @@ · 14 unmodified lines
15#include <linux/init.h>15#include <linux/init.h>
16#include <linux/device.h>16#include <linux/device.h>
17#include <linux/dma-mapping.h>17#include <linux/dma-mapping.h>
18#include <linux/dma-noncoherent.h>
18#include <linux/dma-contiguous.h>19#include <linux/dma-contiguous.h>
19#include <linux/highmem.h>20#include <linux/highmem.h>
20#include <linux/memblock.h>21#include <linux/memblock.h>
@@ -1125,6 +1126,19 @@ int arm_dma_supported(struct device *dev, u64 mask) · 1104 unmodified lines
1125 1126
1126static const struct dma_map_ops *arm_get_dma_map_ops(bool coherent)1127static const struct dma_map_ops *arm_get_dma_map_ops(bool coherent)
1127{1128{
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;
1128 return coherent ? &arm_coherent_dma_ops : &arm_dma_ops;1142 return coherent ? &arm_coherent_dma_ops : &arm_dma_ops;
1129}1143}
1130 1144
@@ -2329,6 +2343,9 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, · 1198 unmodified lines
2329 const struct dma_map_ops *dma_ops;2343 const struct dma_map_ops *dma_ops;
2330 2344
2331 dev->archdata.dma_coherent = coherent;2345 dev->archdata.dma_coherent = coherent;
2346#ifdef CONFIG_SWIOTLB
2347 dev->dma_coherent = coherent;
2348#endif
2332 2349
2333 /*2350 /*
2334 * Don't override the dma_ops if they have already been set. Ideally2351 * 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
2363 /* Let arch_setup_dma_ops() start again from scratch upon re-probe */2380 /* Let arch_setup_dma_ops() start again from scratch upon re-probe */
2364 set_dma_ops(dev, NULL);2381 set_dma_ops(dev, NULL);
2365}2382}
2383
2384#ifdef CONFIG_SWIOTLB
2385void 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
2392void 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
2399long 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
2405pgprot_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
2413void *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
2421void 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
21#include <linux/dma-contiguous.h>21#include <linux/dma-contiguous.h>
22#include <linux/sizes.h>22#include <linux/sizes.h>
23#include <linux/stop_machine.h>23#include <linux/stop_machine.h>
24#include <linux/swiotlb.h>
24 25
25#include <asm/cp15.h>26#include <asm/cp15.h>
26#include <asm/mach-types.h>27#include <asm/mach-types.h>
@@ -463,6 +464,10 @@ static void __init free_highpages(void) · 436 unmodified lines
463 */464 */
464void __init mem_init(void)465void __init mem_init(void)
465{466{
467#ifdef CONFIG_ARM_LPAE
468 swiotlb_init(1);
469#endif
470
466 set_max_mapnr(pfn_to_page(max_pfn) - mem_map);471 set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
467 472
468 /* this will put all unused low memory onto the freelists */473 /* 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
388 /*388 /*
389 * not supported by current hardware on OMAP1389 * not supported by current hardware on OMAP1
390 * w |= (0x03 << 7);390 * w |= (0x03 << 7);
391 * fall through
392 */391 */
392 /* fall through */
393 case OMAP_DMA_DATA_BURST_16:393 case OMAP_DMA_DATA_BURST_16:
394 if (dma_omap2plus()) {394 if (dma_omap2plus()) {
395 burst = 0x3;395 burst = 0x3;
396 break;396 break;
397 }397 }
398 /*398 /* OMAP1 don't support burst 16 */
399 * OMAP1 don't support burst 16399 /* fall through */
400 * fall through
401 */
402 default:400 default:
403 BUG();401 BUG();
404 }402 }
@@ -474,10 +472,8 @@ void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) · 69 unmodified lines
474 burst = 0x3;472 burst = 0x3;
475 break;473 break;
476 }474 }
477 /*475 /* OMAP1 don't support burst 16 */
478 * OMAP1 don't support burst 16476 /* fall through */
479 * fall through
480 */
481 default:477 default:
482 printk(KERN_ERR "Invalid DMA burst mode\n");478 printk(KERN_ERR "Invalid DMA burst mode\n");
483 BUG();479 BUG();
arch/arm64/Makefile+1−1
@@ -52,7 +52,7 @@ ifeq ($(CONFIG_GENERIC_COMPAT_VDSO), y) · 51 unmodified lines
52 52
53 ifeq ($(CONFIG_CC_IS_CLANG), y)53 ifeq ($(CONFIG_CC_IS_CLANG), y)
54 $(warning CROSS_COMPILE_COMPAT is clang, the compat vDSO will not be built)54 $(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)),)
56 $(warning CROSS_COMPILE_COMPAT not defined or empty, the compat vDSO will not be built)56 $(warning CROSS_COMPILE_COMPAT not defined or empty, the compat vDSO will not be built)
57 else ifeq ($(shell which $(CROSS_COMPILE_COMPAT)gcc 2> /dev/null),)57 else ifeq ($(shell which $(CROSS_COMPILE_COMPAT)gcc 2> /dev/null),)
58 $(error $(CROSS_COMPILE_COMPAT)gcc not found, check CROSS_COMPILE_COMPAT)58 $(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
155 BUILD_BUG_ON(GICD_INT_DEF_PRI < (GIC_PRIO_IRQOFF |155 BUILD_BUG_ON(GICD_INT_DEF_PRI < (GIC_PRIO_IRQOFF |
156 GIC_PRIO_PSR_I_SET));156 GIC_PRIO_PSR_I_SET));
157 BUILD_BUG_ON(GICD_INT_DEF_PRI >= GIC_PRIO_IRQON);157 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);
158 gic_write_pmr(GIC_PRIO_IRQOFF);164 gic_write_pmr(GIC_PRIO_IRQOFF);
159}165}
160 166
arch/arm64/include/asm/cpufeature.h+4−3
@@ -35,9 +35,10 @@ · 34 unmodified lines
35 */35 */
36 36
37enum ftr_type {37enum ftr_type {
38 FTR_EXACT, /* Use a predefined safe value */38 FTR_EXACT, /* Use a predefined safe value */
39 FTR_LOWER_SAFE, /* Smaller value is safe */39 FTR_LOWER_SAFE, /* Smaller value is safe */
40 FTR_HIGHER_SAFE,/* Bigger 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 */
41};42};
42 43
43#define FTR_STRICT true /* SANITY check strict matching required */44#define FTR_STRICT true /* SANITY check strict matching required */
arch/arm64/include/asm/daifflags.h+2−0
@@ -13,6 +13,8 @@ · 12 unmodified lines
13#define DAIF_PROCCTX 013#define DAIF_PROCCTX 0
14#define DAIF_PROCCTX_NOIRQ PSR_I_BIT14#define DAIF_PROCCTX_NOIRQ PSR_I_BIT
15#define DAIF_ERRCTX (PSR_I_BIT | PSR_A_BIT)15#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
16 18
17/* mask/save/unmask/restore all exceptions, including interrupts. */19/* mask/save/unmask/restore all exceptions, including interrupts. */
18static inline void local_daif_mask(void)20static 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
105 ((protocol##_t *)instance)->f(instance, ##__VA_ARGS__)105 ((protocol##_t *)instance)->f(instance, ##__VA_ARGS__)
106 106
107#define alloc_screen_info(x...) &screen_info107#define alloc_screen_info(x...) &screen_info
108#define free_screen_info(x...)108
109static inline void free_screen_info(efi_system_table_t *sys_table_arg,
110 struct screen_info *si)
111{
112}
109 113
110/* redeclare as 'hidden' so the compiler will generate relative references */114/* redeclare as 'hidden' so the compiler will generate relative references */
111extern struct screen_info screen_info __attribute__((__visibility__("hidden")));115extern struct screen_info screen_info __attribute__((__visibility__("hidden")));
arch/arm64/include/asm/kvm_arm.h+4−3
@@ -316,9 +316,10 @@ · 315 unmodified lines
316 316
317#define kvm_arm_exception_class \317#define kvm_arm_exception_class \
318 ECN(UNKNOWN), ECN(WFx), ECN(CP15_32), ECN(CP15_64), ECN(CP14_MR), \318 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), \319 ECN(CP14_LS), ECN(FP_ASIMD), ECN(CP10_ID), ECN(PAC), ECN(CP14_64), \
320 ECN(HVC64), ECN(SMC64), ECN(SYS64), ECN(IMP_DEF), ECN(IABT_LOW), \320 ECN(SVC64), ECN(HVC64), ECN(SMC64), ECN(SYS64), ECN(SVE), \
321 ECN(IABT_CUR), ECN(PC_ALIGN), ECN(DABT_LOW), ECN(DABT_CUR), \321 ECN(IMP_DEF), ECN(IABT_LOW), ECN(IABT_CUR), \
322 ECN(PC_ALIGN), ECN(DABT_LOW), ECN(DABT_CUR), \
322 ECN(SP_ALIGN), ECN(FP_EXC32), ECN(FP_EXC64), ECN(SERROR), \323 ECN(SP_ALIGN), ECN(FP_EXC32), ECN(FP_EXC64), ECN(SERROR), \
323 ECN(BREAKPT_LOW), ECN(BREAKPT_CUR), ECN(SOFTSTP_LOW), \324 ECN(BREAKPT_LOW), ECN(BREAKPT_CUR), ECN(SOFTSTP_LOW), \
324 ECN(SOFTSTP_CUR), ECN(WATCHPT_LOW), ECN(WATCHPT_CUR), \325 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
210#define __tag_reset(addr) untagged_addr(addr)210#define __tag_reset(addr) untagged_addr(addr)
211#define __tag_get(addr) (__u8)((u64)(addr) >> 56)211#define __tag_get(addr) (__u8)((u64)(addr) >> 56)
212#else212#else
213#define __tag_set(addr, tag) (addr)213static inline const void *__tag_set(const void *addr, u8 tag)
214{
215 return addr;
216}
217
214#define __tag_reset(addr) (addr)218#define __tag_reset(addr) (addr)
215#define __tag_get(addr) 0219#define __tag_get(addr) 0
216#endif220#endif
@@ -301,8 +305,8 @@ static inline void *phys_to_virt(phys_addr_t x) · 84 unmodified lines
301#define page_to_virt(page) ({ \305#define page_to_virt(page) ({ \
302 unsigned long __addr = \306 unsigned long __addr = \
303 ((__page_to_voff(page)) | PAGE_OFFSET); \307 ((__page_to_voff(page)) | PAGE_OFFSET); \
304 unsigned long __addr_tag = \308 const void *__addr_tag = \
305 __tag_set(__addr, page_kasan_tag(page)); \309 __tag_set((void *)__addr, page_kasan_tag(page)); \
306 ((void *)__addr_tag); \310 ((void *)__addr_tag); \
307})311})
308 312
arch/arm64/include/asm/pgtable.h+7−4
@@ -209,7 +209,7 @@ static inline pmd_t pmd_mkcont(pmd_t pmd) · 208 unmodified lines
209 209
210static inline pte_t pte_mkdevmap(pte_t pte)210static inline pte_t pte_mkdevmap(pte_t pte)
211{211{
212 return set_pte_bit(pte, __pgprot(PTE_DEVMAP));212 return set_pte_bit(pte, __pgprot(PTE_DEVMAP | PTE_SPECIAL));
213}213}
214 214
215static inline void set_pte(pte_t *ptep, pte_t pte)215static 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
396#ifdef CONFIG_TRANSPARENT_HUGEPAGE396#ifdef CONFIG_TRANSPARENT_HUGEPAGE
397#define pmd_devmap(pmd) pte_devmap(pmd_pte(pmd))397#define pmd_devmap(pmd) pte_devmap(pmd_pte(pmd))
398#endif398#endif
399#define pmd_mkdevmap(pmd) pte_pmd(pte_mkdevmap(pmd_pte(pmd)))399static inline pmd_t pmd_mkdevmap(pmd_t pmd)
400{
401 return pte_pmd(set_pte_bit(pmd_pte(pmd), __pgprot(PTE_DEVMAP)));
402}
400 403
401#define __pmd_to_phys(pmd) __pte_to_phys(pmd_pte(pmd))404#define __pmd_to_phys(pmd) __pte_to_phys(pmd_pte(pmd))
402#define __phys_to_pmd_val(phys) __phys_to_pte_val(phys)405#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
447 PMD_TYPE_SECT)450 PMD_TYPE_SECT)
448 451
449#if defined(CONFIG_ARM64_64K_PAGES) || CONFIG_PGTABLE_LEVELS < 3452#if defined(CONFIG_ARM64_64K_PAGES) || CONFIG_PGTABLE_LEVELS < 3
450#define pud_sect(pud) (0)453static inline bool pud_sect(pud_t pud) { return false; }
451#define pud_table(pud) (1)454static inline bool pud_table(pud_t pud) { return true; }
452#else455#else
453#define pud_sect(pud) ((pud_val(pud) & PUD_TYPE_MASK) == \456#define pud_sect(pud) ((pud_val(pud) & PUD_TYPE_MASK) == \
454 PUD_TYPE_SECT)457 PUD_TYPE_SECT)
arch/arm64/include/asm/ptrace.h+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
30 * in the the priority mask, it indicates that PSR.I should be set and30 * in the the priority mask, it indicates that PSR.I should be set and
31 * interrupt disabling temporarily does not rely on IRQ priorities.31 * interrupt disabling temporarily does not rely on IRQ priorities.
32 */32 */
33#define GIC_PRIO_IRQON 0xc033#define GIC_PRIO_IRQON 0xe0
34#define GIC_PRIO_IRQOFF (GIC_PRIO_IRQON & ~0x80)34#define GIC_PRIO_IRQOFF (GIC_PRIO_IRQON & ~0x80)
35#define GIC_PRIO_PSR_I_SET (1 << 4)35#define GIC_PRIO_PSR_I_SET (1 << 4)
36 36
arch/arm64/include/asm/vdso/compat_gettimeofday.h+40−0
@@ -16,6 +16,8 @@ · 15 unmodified lines
16 16
17#define VDSO_HAS_CLOCK_GETRES 117#define VDSO_HAS_CLOCK_GETRES 1
18 18
19#define VDSO_HAS_32BIT_FALLBACK 1
20
19static __always_inline21static __always_inline
20int gettimeofday_fallback(struct __kernel_old_timeval *_tv,22int gettimeofday_fallback(struct __kernel_old_timeval *_tv,
21 struct timezone *_tz)23 struct timezone *_tz)
@@ -51,6 +53,23 @@ long clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts) · 29 unmodified lines
51 return ret;53 return ret;
52}54}
53 55
56static __always_inline
57long 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
54static __always_inline73static __always_inline
55int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)74int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
56{75{
@@ -72,6 +91,27 @@ int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts) · 15 unmodified lines
72 return ret;91 return ret;
73}92}
74 93
94static __always_inline
95int 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
75static __always_inline u64 __arch_get_hw_counter(s32 clock_mode)115static __always_inline u64 __arch_get_hw_counter(s32 clock_mode)
76{116{
77 u64 res;117 u64 res;
arch/arm64/kernel/cpufeature.c+6−2
@@ -225,8 +225,8 @@ static const struct arm64_ftr_bits ftr_ctr[] = { · 224 unmodified lines
225 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_EXACT, 31, 1, 1), /* RES1 */225 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_EXACT, 31, 1, 1), /* RES1 */
226 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_DIC_SHIFT, 1, 1),226 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_DIC_SHIFT, 1, 1),
227 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_IDC_SHIFT, 1, 1),227 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),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_SAFE, CTR_ERG_SHIFT, 4, 0),229 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_OR_ZERO_SAFE, CTR_ERG_SHIFT, 4, 0),
230 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_DMINLINE_SHIFT, 4, 1),230 ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_DMINLINE_SHIFT, 4, 1),
231 /*231 /*
232 * Linux can handle differing I-cache policies. Userspace JITs will232 * 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
468 case FTR_LOWER_SAFE:468 case FTR_LOWER_SAFE:
469 ret = new < cur ? new : cur;469 ret = new < cur ? new : cur;
470 break;470 break;
471 case FTR_HIGHER_OR_ZERO_SAFE:
472 if (!cur || !new)
473 break;
474 /* Fallthrough */
471 case FTR_HIGHER_SAFE:475 case FTR_HIGHER_SAFE:
472 ret = new > cur ? new : cur;476 ret = new > cur ? new : cur;
473 break;477 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
207 207
208 list = user_mode(regs) ? &user_step_hook : &kernel_step_hook;208 list = user_mode(regs) ? &user_step_hook : &kernel_step_hook;
209 209
210 rcu_read_lock();210 /*
211 211 * Since single-step exception disables interrupt, this function is
212 * entirely not preemptible, and we can use rcu list safely here.
213 */
212 list_for_each_entry_rcu(hook, list, node) {214 list_for_each_entry_rcu(hook, list, node) {
213 retval = hook->fn(regs, esr);215 retval = hook->fn(regs, esr);
214 if (retval == DBG_HOOK_HANDLED)216 if (retval == DBG_HOOK_HANDLED)
215 break;217 break;
216 }218 }
217 219
218 rcu_read_unlock();
219
220 return retval;220 return retval;
221}221}
222NOKPROBE_SYMBOL(call_step_hook);222NOKPROBE_SYMBOL(call_step_hook);
@@ -305,14 +305,16 @@ static int call_break_hook(struct pt_regs *regs, unsigned int esr) · 82 unmodified lines
305 305
306 list = user_mode(regs) ? &user_break_hook : &kernel_break_hook;306 list = user_mode(regs) ? &user_break_hook : &kernel_break_hook;
307 307
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 */
309 list_for_each_entry_rcu(hook, list, node) {312 list_for_each_entry_rcu(hook, list, node) {
310 unsigned int comment = esr & ESR_ELx_BRK64_ISS_COMMENT_MASK;313 unsigned int comment = esr & ESR_ELx_BRK64_ISS_COMMENT_MASK;
311 314
312 if ((comment & ~hook->mask) == hook->imm)315 if ((comment & ~hook->mask) == hook->imm)
313 fn = hook->fn;316 fn = hook->fn;
314 }317 }
315 rcu_read_unlock();
316 318
317 return fn ? fn(regs, esr) : DBG_HOOK_ERROR;319 return fn ? fn(regs, esr) : DBG_HOOK_ERROR;
318}320}
arch/arm64/kernel/hw_breakpoint.c+8−3
@@ -536,13 +536,18 @@ int hw_breakpoint_arch_parse(struct perf_event *bp, · 535 unmodified lines
536 /* Aligned */536 /* Aligned */
537 break;537 break;
538 case 1:538 case 1:
539 /* Allow single byte watchpoint. */
540 if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1)
541 break;
542 case 2:539 case 2:
543 /* Allow halfword watchpoints and breakpoints. */540 /* Allow halfword watchpoints and breakpoints. */
544 if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2)541 if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2)
545 break;542 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 */
546 default:551 default:
547 return -EINVAL;552 return -EINVAL;
548 }553 }
arch/arm64/kernel/module.c+4−0
@@ -314,18 +314,21 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, · 313 unmodified lines
314 /* MOVW instruction relocations. */314 /* MOVW instruction relocations. */
315 case R_AARCH64_MOVW_UABS_G0_NC:315 case R_AARCH64_MOVW_UABS_G0_NC:
316 overflow_check = false;316 overflow_check = false;
317 /* Fall through */
317 case R_AARCH64_MOVW_UABS_G0:318 case R_AARCH64_MOVW_UABS_G0:
318 ovf = reloc_insn_movw(RELOC_OP_ABS, loc, val, 0,319 ovf = reloc_insn_movw(RELOC_OP_ABS, loc, val, 0,
319 AARCH64_INSN_IMM_MOVKZ);320 AARCH64_INSN_IMM_MOVKZ);
320 break;321 break;
321 case R_AARCH64_MOVW_UABS_G1_NC:322 case R_AARCH64_MOVW_UABS_G1_NC:
322 overflow_check = false;323 overflow_check = false;
324 /* Fall through */
323 case R_AARCH64_MOVW_UABS_G1:325 case R_AARCH64_MOVW_UABS_G1:
324 ovf = reloc_insn_movw(RELOC_OP_ABS, loc, val, 16,326 ovf = reloc_insn_movw(RELOC_OP_ABS, loc, val, 16,
325 AARCH64_INSN_IMM_MOVKZ);327 AARCH64_INSN_IMM_MOVKZ);
326 break;328 break;
327 case R_AARCH64_MOVW_UABS_G2_NC:329 case R_AARCH64_MOVW_UABS_G2_NC:
328 overflow_check = false;330 overflow_check = false;
331 /* Fall through */
329 case R_AARCH64_MOVW_UABS_G2:332 case R_AARCH64_MOVW_UABS_G2:
330 ovf = reloc_insn_movw(RELOC_OP_ABS, loc, val, 32,333 ovf = reloc_insn_movw(RELOC_OP_ABS, loc, val, 32,
331 AARCH64_INSN_IMM_MOVKZ);334 AARCH64_INSN_IMM_MOVKZ);
@@ -393,6 +396,7 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, · 61 unmodified lines
393 break;396 break;
394 case R_AARCH64_ADR_PREL_PG_HI21_NC:397 case R_AARCH64_ADR_PREL_PG_HI21_NC:
395 overflow_check = false;398 overflow_check = false;
399 /* Fall through */
396 case R_AARCH64_ADR_PREL_PG_HI21:400 case R_AARCH64_ADR_PREL_PG_HI21:
397 ovf = reloc_insn_adrp(me, sechdrs, loc, val);401 ovf = reloc_insn_adrp(me, sechdrs, loc, val);
398 if (ovf && ovf != -ERANGE)402 if (ovf && ovf != -ERANGE)
arch/arm64/kernel/probes/kprobes.c+6−34
@@ -21,6 +21,7 @@ · 20 unmodified lines
21#include <asm/ptrace.h>21#include <asm/ptrace.h>
22#include <asm/cacheflush.h>22#include <asm/cacheflush.h>
23#include <asm/debug-monitors.h>23#include <asm/debug-monitors.h>
24#include <asm/daifflags.h>
24#include <asm/system_misc.h>25#include <asm/system_misc.h>
25#include <asm/insn.h>26#include <asm/insn.h>
26#include <linux/uaccess.h>27#include <linux/uaccess.h>
@@ -167,33 +168,6 @@ static void __kprobes set_current_kprobe(struct kprobe *p) · 140 unmodified lines
167 __this_cpu_write(current_kprobe, p);168 __this_cpu_write(current_kprobe, p);
168}169}
169 170
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 */
184static void __kprobes
185spsr_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
197/*171/*
198 * Interrupts need to be disabled before single-step mode is set, and not172 * Interrupts need to be disabled before single-step mode is set, and not
199 * reenabled until after single-step mode ends.173 * reenabled until after single-step mode ends.
@@ -205,17 +179,17 @@ spsr_set_debug_flag(struct pt_regs *regs, int mask) · 5 unmodified lines
205static void __kprobes kprobes_save_local_irqflag(struct kprobe_ctlblk *kcb,179static void __kprobes kprobes_save_local_irqflag(struct kprobe_ctlblk *kcb,
206 struct pt_regs *regs)180 struct pt_regs *regs)
207{181{
208 kcb->saved_irqflag = regs->pstate;182 kcb->saved_irqflag = regs->pstate & DAIF_MASK;
209 regs->pstate |= PSR_I_BIT;183 regs->pstate |= PSR_I_BIT;
184 /* Unmask PSTATE.D for enabling software step exceptions. */
185 regs->pstate &= ~PSR_D_BIT;
210}186}
211 187
212static void __kprobes kprobes_restore_local_irqflag(struct kprobe_ctlblk *kcb,188static void __kprobes kprobes_restore_local_irqflag(struct kprobe_ctlblk *kcb,
213 struct pt_regs *regs)189 struct pt_regs *regs)
214{190{
215 if (kcb->saved_irqflag & PSR_I_BIT)191 regs->pstate &= ~DAIF_MASK;
216 regs->pstate |= PSR_I_BIT;192 regs->pstate |= kcb->saved_irqflag;
217 else
218 regs->pstate &= ~PSR_I_BIT;
219}193}
220 194
221static void __kprobes195static void __kprobes
@@ -252,8 +226,6 @@ static void __kprobes setup_singlestep(struct kprobe *p, · 30 unmodified lines
252 226
253 set_ss_context(kcb, slot); /* mark pending ss */227 set_ss_context(kcb, slot); /* mark pending ss */
254 228
255 spsr_set_debug_flag(regs, 0);
256
257 /* IRQs and single stepping do not mix well. */229 /* IRQs and single stepping do not mix well. */
258 kprobes_save_local_irqflag(kcb, regs);230 kprobes_save_local_irqflag(kcb, regs);
259 kernel_enable_single_step(regs);231 kernel_enable_single_step(regs);
arch/arm64/kernel/return_address.c+3−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
8 8
9#include <linux/export.h>9#include <linux/export.h>
10#include <linux/ftrace.h>10#include <linux/ftrace.h>
11#include <linux/kprobes.h>
11 12
12#include <asm/stack_pointer.h>13#include <asm/stack_pointer.h>
13#include <asm/stacktrace.h>14#include <asm/stacktrace.h>
@@ -29,6 +30,7 @@ static int save_return_addr(struct stackframe *frame, void *d) · 15 unmodified lines
29 return 0;30 return 0;
30 }31 }
31}32}
33NOKPROBE_SYMBOL(save_return_addr);
32 34
33void *return_address(unsigned int level)35void *return_address(unsigned int level)
34{36{
@@ -49,3 +51,4 @@ void *return_address(unsigned int level) · 14 unmodified lines
49 return NULL;51 return NULL;
50}52}
51EXPORT_SYMBOL_GPL(return_address);53EXPORT_SYMBOL_GPL(return_address);
54NOKPROBE_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
152 pr_crit("CPU%u: died during early boot\n", cpu);152 pr_crit("CPU%u: died during early boot\n", cpu);
153 break;153 break;
154 }154 }
155 /* Fall through */
156 pr_crit("CPU%u: may not have shut down cleanly\n", cpu);155 pr_crit("CPU%u: may not have shut down cleanly\n", cpu);
156 /* Fall through */
157 case CPU_STUCK_IN_KERNEL:157 case CPU_STUCK_IN_KERNEL:
158 pr_crit("CPU%u: is stuck in kernel\n", cpu);158 pr_crit("CPU%u: is stuck in kernel\n", cpu);
159 if (status & CPU_STUCK_REASON_52_BIT_VA)159 if (status & CPU_STUCK_REASON_52_BIT_VA)
arch/arm64/kernel/stacktrace.c+3−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
7#include <linux/kernel.h>7#include <linux/kernel.h>
8#include <linux/export.h>8#include <linux/export.h>
9#include <linux/ftrace.h>9#include <linux/ftrace.h>
10#include <linux/kprobes.h>
10#include <linux/sched.h>11#include <linux/sched.h>
11#include <linux/sched/debug.h>12#include <linux/sched/debug.h>
12#include <linux/sched/task_stack.h>13#include <linux/sched/task_stack.h>
@@ -111,6 +112,7 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame) · 98 unmodified lines
111 112
112 return 0;113 return 0;
113}114}
115NOKPROBE_SYMBOL(unwind_frame);
114 116
115void notrace walk_stackframe(struct task_struct *tsk, struct stackframe *frame,117void notrace walk_stackframe(struct task_struct *tsk, struct stackframe *frame,
116 int (*fn)(struct stackframe *, void *), void *data)118 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
125 break;127 break;
126 }128 }
127}129}
130NOKPROBE_SYMBOL(walk_stackframe);
128 131
129#ifdef CONFIG_STACKTRACE132#ifdef CONFIG_STACKTRACE
130struct stack_trace_data {133struct stack_trace_data {
arch/arm64/kernel/traps.c+1−0
@@ -733,6 +733,7 @@ static const char *esr_class_str[] = { · 732 unmodified lines
733 [ESR_ELx_EC_CP14_LS] = "CP14 LDC/STC",733 [ESR_ELx_EC_CP14_LS] = "CP14 LDC/STC",
734 [ESR_ELx_EC_FP_ASIMD] = "ASIMD",734 [ESR_ELx_EC_FP_ASIMD] = "ASIMD",
735 [ESR_ELx_EC_CP10_ID] = "CP10 MRC/VMRS",735 [ESR_ELx_EC_CP10_ID] = "CP10 MRC/VMRS",
736 [ESR_ELx_EC_PAC] = "PAC",
736 [ESR_ELx_EC_CP14_64] = "CP14 MCRR/MRRC",737 [ESR_ELx_EC_CP14_64] = "CP14 MCRR/MRRC",
737 [ESR_ELx_EC_ILL] = "PSTATE.IL",738 [ESR_ELx_EC_ILL] = "PSTATE.IL",
738 [ESR_ELx_EC_SVC32] = "SVC (AArch32)",739 [ESR_ELx_EC_SVC32] = "SVC (AArch32)",
arch/arm64/kvm/hyp/debug-sr.c+30−0
@@ -18,40 +18,70 @@ · 17 unmodified lines
18#define save_debug(ptr,reg,nr) \18#define save_debug(ptr,reg,nr) \
19 switch (nr) { \19 switch (nr) { \
20 case 15: ptr[15] = read_debug(reg, 15); \20 case 15: ptr[15] = read_debug(reg, 15); \
21 /* Fall through */ \
21 case 14: ptr[14] = read_debug(reg, 14); \22 case 14: ptr[14] = read_debug(reg, 14); \
23 /* Fall through */ \
22 case 13: ptr[13] = read_debug(reg, 13); \24 case 13: ptr[13] = read_debug(reg, 13); \
25 /* Fall through */ \
23 case 12: ptr[12] = read_debug(reg, 12); \26 case 12: ptr[12] = read_debug(reg, 12); \
27 /* Fall through */ \
24 case 11: ptr[11] = read_debug(reg, 11); \28 case 11: ptr[11] = read_debug(reg, 11); \
29 /* Fall through */ \
25 case 10: ptr[10] = read_debug(reg, 10); \30 case 10: ptr[10] = read_debug(reg, 10); \
31 /* Fall through */ \
26 case 9: ptr[9] = read_debug(reg, 9); \32 case 9: ptr[9] = read_debug(reg, 9); \
33 /* Fall through */ \
27 case 8: ptr[8] = read_debug(reg, 8); \34 case 8: ptr[8] = read_debug(reg, 8); \
35 /* Fall through */ \
28 case 7: ptr[7] = read_debug(reg, 7); \36 case 7: ptr[7] = read_debug(reg, 7); \
37 /* Fall through */ \
29 case 6: ptr[6] = read_debug(reg, 6); \38 case 6: ptr[6] = read_debug(reg, 6); \
39 /* Fall through */ \
30 case 5: ptr[5] = read_debug(reg, 5); \40 case 5: ptr[5] = read_debug(reg, 5); \
41 /* Fall through */ \
31 case 4: ptr[4] = read_debug(reg, 4); \42 case 4: ptr[4] = read_debug(reg, 4); \
43 /* Fall through */ \
32 case 3: ptr[3] = read_debug(reg, 3); \44 case 3: ptr[3] = read_debug(reg, 3); \
45 /* Fall through */ \
33 case 2: ptr[2] = read_debug(reg, 2); \46 case 2: ptr[2] = read_debug(reg, 2); \
47 /* Fall through */ \
34 case 1: ptr[1] = read_debug(reg, 1); \48 case 1: ptr[1] = read_debug(reg, 1); \
49 /* Fall through */ \
35 default: ptr[0] = read_debug(reg, 0); \50 default: ptr[0] = read_debug(reg, 0); \
36 }51 }
37 52
38#define restore_debug(ptr,reg,nr) \53#define restore_debug(ptr,reg,nr) \
39 switch (nr) { \54 switch (nr) { \
40 case 15: write_debug(ptr[15], reg, 15); \55 case 15: write_debug(ptr[15], reg, 15); \
56 /* Fall through */ \
41 case 14: write_debug(ptr[14], reg, 14); \57 case 14: write_debug(ptr[14], reg, 14); \
58 /* Fall through */ \
42 case 13: write_debug(ptr[13], reg, 13); \59 case 13: write_debug(ptr[13], reg, 13); \
60 /* Fall through */ \
43 case 12: write_debug(ptr[12], reg, 12); \61 case 12: write_debug(ptr[12], reg, 12); \
62 /* Fall through */ \
44 case 11: write_debug(ptr[11], reg, 11); \63 case 11: write_debug(ptr[11], reg, 11); \
64 /* Fall through */ \
45 case 10: write_debug(ptr[10], reg, 10); \65 case 10: write_debug(ptr[10], reg, 10); \
66 /* Fall through */ \
46 case 9: write_debug(ptr[9], reg, 9); \67 case 9: write_debug(ptr[9], reg, 9); \
68 /* Fall through */ \
47 case 8: write_debug(ptr[8], reg, 8); \69 case 8: write_debug(ptr[8], reg, 8); \
70 /* Fall through */ \
48 case 7: write_debug(ptr[7], reg, 7); \71 case 7: write_debug(ptr[7], reg, 7); \
72 /* Fall through */ \
49 case 6: write_debug(ptr[6], reg, 6); \73 case 6: write_debug(ptr[6], reg, 6); \
74 /* Fall through */ \
50 case 5: write_debug(ptr[5], reg, 5); \75 case 5: write_debug(ptr[5], reg, 5); \
76 /* Fall through */ \
51 case 4: write_debug(ptr[4], reg, 4); \77 case 4: write_debug(ptr[4], reg, 4); \
78 /* Fall through */ \
52 case 3: write_debug(ptr[3], reg, 3); \79 case 3: write_debug(ptr[3], reg, 3); \
80 /* Fall through */ \
53 case 2: write_debug(ptr[2], reg, 2); \81 case 2: write_debug(ptr[2], reg, 2); \
82 /* Fall through */ \
54 case 1: write_debug(ptr[1], reg, 1); \83 case 1: write_debug(ptr[1], reg, 1); \
84 /* Fall through */ \
55 default: write_debug(ptr[0], reg, 0); \85 default: write_debug(ptr[0], reg, 0); \
56 }86 }
57 87
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
178 switch (spsr_idx) {178 switch (spsr_idx) {
179 case KVM_SPSR_SVC:179 case KVM_SPSR_SVC:
180 write_sysreg_el1(v, SYS_SPSR);180 write_sysreg_el1(v, SYS_SPSR);
181 break;
181 case KVM_SPSR_ABT:182 case KVM_SPSR_ABT:
182 write_sysreg(v, spsr_abt);183 write_sysreg(v, spsr_abt);
184 break;
183 case KVM_SPSR_UND:185 case KVM_SPSR_UND:
184 write_sysreg(v, spsr_und);186 write_sysreg(v, spsr_und);
187 break;
185 case KVM_SPSR_IRQ:188 case KVM_SPSR_IRQ:
186 write_sysreg(v, spsr_irq);189 write_sysreg(v, spsr_irq);
190 break;
187 case KVM_SPSR_FIQ:191 case KVM_SPSR_FIQ:
188 write_sysreg(v, spsr_fiq);192 write_sysreg(v, spsr_fiq);
193 break;
189 }194 }
190}195}
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
632 */632 */
633 val = ((pmcr & ~ARMV8_PMU_PMCR_MASK)633 val = ((pmcr & ~ARMV8_PMU_PMCR_MASK)
634 | (ARMV8_PMU_PMCR_MASK & 0xdecafbad)) & (~ARMV8_PMU_PMCR_E);634 | (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;
636}636}
637 637
638static bool check_pmu_access_disabled(struct kvm_vcpu *vcpu, u64 flags)638static 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
981/* Silly macro to expand the DBG{BCR,BVR,WVR,WCR}n_EL1 registers in one go */981/* Silly macro to expand the DBG{BCR,BVR,WVR,WCR}n_EL1 registers in one go */
982#define DBG_BCR_BVR_WCR_WVR_EL1(n) \982#define DBG_BCR_BVR_WCR_WVR_EL1(n) \
983 { SYS_DESC(SYS_DBGBVRn_EL1(n)), \983 { 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 }, \
985 { SYS_DESC(SYS_DBGBCRn_EL1(n)), \985 { 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 }, \
987 { SYS_DESC(SYS_DBGWVRn_EL1(n)), \987 { 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 }, \
989 { SYS_DESC(SYS_DBGWCRn_EL1(n)), \989 { 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 }
991 991
992/* Macro to expand the PMEVCNTRn_EL0 register */992/* Macro to expand the PMEVCNTRn_EL0 register */
993#define PMU_PMEVCNTR_EL0(n) \993#define PMU_PMEVCNTR_EL0(n) \
@@ -1540,7 +1540,7 @@ static const struct sys_reg_desc sys_reg_descs[] = { · 546 unmodified lines
1540 { SYS_DESC(SYS_CSSELR_EL1), access_csselr, reset_unknown, CSSELR_EL1 },1540 { SYS_DESC(SYS_CSSELR_EL1), access_csselr, reset_unknown, CSSELR_EL1 },
1541 { SYS_DESC(SYS_CTR_EL0), access_ctr },1541 { SYS_DESC(SYS_CTR_EL0), access_ctr },
1542 1542
1543 { SYS_DESC(SYS_PMCR_EL0), access_pmcr, reset_pmcr, },1543 { SYS_DESC(SYS_PMCR_EL0), access_pmcr, reset_pmcr, PMCR_EL0 },
1544 { SYS_DESC(SYS_PMCNTENSET_EL0), access_pmcnten, reset_unknown, PMCNTENSET_EL0 },1544 { SYS_DESC(SYS_PMCNTENSET_EL0), access_pmcnten, reset_unknown, PMCNTENSET_EL0 },
1545 { SYS_DESC(SYS_PMCNTENCLR_EL0), access_pmcnten, NULL, PMCNTENSET_EL0 },1545 { SYS_DESC(SYS_PMCNTENCLR_EL0), access_pmcnten, NULL, PMCNTENSET_EL0 },
1546 { SYS_DESC(SYS_PMOVSCLR_EL0), access_pmovs, NULL, PMOVSSET_EL0 },1546 { 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
2254}2254}
2255 2255
2256static void reset_sys_reg_descs(struct kvm_vcpu *vcpu,2256static 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)
2258{2259{
2259 unsigned long i;2260 unsigned long i;
2260 2261
2261 for (i = 0; i < num; i++)2262 for (i = 0; i < num; i++)
2262 if (table[i].reset)2263 if (table[i].reset) {
2264 int reg = table[i].reg;
2265
2263 table[i].reset(vcpu, &table[i]);2266 table[i].reset(vcpu, &table[i]);
2267 if (reg > 0 && reg < NR_SYS_REGS)
2268 set_bit(reg, bmap);
2269 }
2264}2270}
2265 2271
2266/**2272/**
@@ -2774,18 +2780,16 @@ void kvm_reset_sys_regs(struct kvm_vcpu *vcpu) · 507 unmodified lines
2774{2780{
2775 size_t num;2781 size_t num;
2776 const struct sys_reg_desc *table;2782 const struct sys_reg_desc *table;
2777 2783 DECLARE_BITMAP(bmap, NR_SYS_REGS) = { 0, };
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));
2780 2784
2781 /* Generic chip reset first (so target could override). */2785 /* 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);
2783 2787
2784 table = get_target_table(vcpu->arch.target, true, &num);2788 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);
2786 2790
2787 for (num = 1; num < NR_SYS_REGS; num++) {2791 for (num = 1; num < NR_SYS_REGS; num++) {
2788 if (WARN(__vcpu_sys_reg(vcpu, num) == 0x4242424242424242,2792 if (WARN(!test_bit(num, bmap),
2789 "Didn't reset __vcpu_sys_reg(%zi)\n", num))2793 "Didn't reset __vcpu_sys_reg(%zi)\n", num))
2790 break;2794 break;
2791 }2795 }
arch/arm64/mm/fault.c+49−8
@@ -777,6 +777,53 @@ void __init hook_debug_fault_code(int nr, · 776 unmodified lines
777 debug_fault_info[nr].name = name;777 debug_fault_info[nr].name = name;
778}778}
779 779
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 */
787static 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}
813NOKPROBE_SYMBOL(debug_exception_enter);
814
815static 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}
825NOKPROBE_SYMBOL(debug_exception_exit);
826
780#ifdef CONFIG_ARM64_ERRATUM_1463225827#ifdef CONFIG_ARM64_ERRATUM_1463225
781DECLARE_PER_CPU(int, __in_cortex_a76_erratum_1463225_wa);828DECLARE_PER_CPU(int, __in_cortex_a76_erratum_1463225_wa);
782 829
@@ -817,12 +864,7 @@ asmlinkage void __exception do_debug_exception(unsigned long addr_if_watchpoint, · 34 unmodified lines
817 if (cortex_a76_erratum_1463225_debug_handler(regs))864 if (cortex_a76_erratum_1463225_debug_handler(regs))
818 return;865 return;
819 866
820 /*867 debug_exception_enter(regs);
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();
826 868
827 if (user_mode(regs) && !is_ttbr0_addr(pc))869 if (user_mode(regs) && !is_ttbr0_addr(pc))
828 arm64_apply_bp_hardening();870 arm64_apply_bp_hardening();
@@ -832,7 +874,6 @@ asmlinkage void __exception do_debug_exception(unsigned long addr_if_watchpoint, · 3 unmodified lines
832 inf->sig, inf->code, (void __user *)pc, esr);874 inf->sig, inf->code, (void __user *)pc, esr);
833 }875 }
834 876
835 if (interrupts_enabled(regs))877 debug_exception_exit(regs);
836 trace_hardirqs_on();
837}878}
838NOKPROBE_SYMBOL(do_debug_exception);879NOKPROBE_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
398 default:398 default:
399 dev_err(dev, "Invalid ref_clk %u, using 100000000 instead\n",399 dev_err(dev, "Invalid ref_clk %u, using 100000000 instead\n",
400 clock_rate);400 clock_rate);
401 /* fall through */
401 case 100000000:402 case 100000000:
402 mpll_mul = 0x19;403 mpll_mul = 0x19;
403 if (ref_clk_sel < 2)404 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
69 if (c->tcache.waysize)69 if (c->tcache.waysize)
70 populate_cache(tcache, this_leaf, 3, CACHE_TYPE_UNIFIED);70 populate_cache(tcache, this_leaf, 3, CACHE_TYPE_UNIFIED);
71 71
72 this_cpu_ci->cpu_map_populated = true;
73
72 return 0;74 return 0;
73}75}
74 76
arch/mips/kernel/i8253.c+2−1
@@ -32,7 +32,8 @@ void __init setup_pit_timer(void) · 31 unmodified lines
32 32
33static int __init init_pit_clocksource(void)33static int __init init_pit_clocksource(void)
34{34{
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))
36 return 0;37 return 0;
37 38
38 return clocksource_i8253_init();39 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
140 /* These are unconditional and in j_format. */140 /* These are unconditional and in j_format. */
141 case jal_op:141 case jal_op:
142 arch->gprs[31] = instpc + 8;142 arch->gprs[31] = instpc + 8;
143 /* fall through */
143 case j_op:144 case j_op:
144 epc += 4;145 epc += 4;
145 epc >>= 28;146 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
150 return 0;150 return 0;
151}151}
152 152
153bool kvm_arch_has_vcpu_debugfs(void)
154{
155 return false;
156}
157
158int kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu)
159{
160 return 0;
161}
162
163void kvm_mips_free_vcpus(struct kvm *kvm)153void kvm_mips_free_vcpus(struct kvm *kvm)
164{154{
165 unsigned int i;155 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
172 case 4:172 case 4:
173 w_c0_perfctrl3(0);173 w_c0_perfctrl3(0);
174 w_c0_perfcntr3(reg.counter[3]);174 w_c0_perfcntr3(reg.counter[3]);
175 /* fall through */
175 case 3:176 case 3:
176 w_c0_perfctrl2(0);177 w_c0_perfctrl2(0);
177 w_c0_perfcntr2(reg.counter[2]);178 w_c0_perfcntr2(reg.counter[2]);
179 /* fall through */
178 case 2:180 case 2:
179 w_c0_perfctrl1(0);181 w_c0_perfctrl1(0);
180 w_c0_perfcntr1(reg.counter[1]);182 w_c0_perfcntr1(reg.counter[1]);
183 /* fall through */
181 case 1:184 case 1:
182 w_c0_perfctrl0(0);185 w_c0_perfctrl0(0);
183 w_c0_perfcntr0(reg.counter[0]);186 w_c0_perfcntr0(reg.counter[0]);
@@ -195,10 +198,13 @@ static void mipsxx_cpu_start(void *args) · 11 unmodified lines
195 switch (counters) {198 switch (counters) {
196 case 4:199 case 4:
197 w_c0_perfctrl3(WHAT | reg.control[3]);200 w_c0_perfctrl3(WHAT | reg.control[3]);
201 /* fall through */
198 case 3:202 case 3:
199 w_c0_perfctrl2(WHAT | reg.control[2]);203 w_c0_perfctrl2(WHAT | reg.control[2]);
204 /* fall through */
200 case 2:205 case 2:
201 w_c0_perfctrl1(WHAT | reg.control[1]);206 w_c0_perfctrl1(WHAT | reg.control[1]);
207 /* fall through */
202 case 1:208 case 1:
203 w_c0_perfctrl0(WHAT | reg.control[0]);209 w_c0_perfctrl0(WHAT | reg.control[0]);
204 }210 }
@@ -215,10 +221,13 @@ static void mipsxx_cpu_stop(void *args) · 10 unmodified lines
215 switch (counters) {221 switch (counters) {
216 case 4:222 case 4:
217 w_c0_perfctrl3(0);223 w_c0_perfctrl3(0);
224 /* fall through */
218 case 3:225 case 3:
219 w_c0_perfctrl2(0);226 w_c0_perfctrl2(0);
227 /* fall through */
220 case 2:228 case 2:
221 w_c0_perfctrl1(0);229 w_c0_perfctrl1(0);
230 /* fall through */
222 case 1:231 case 1:
223 w_c0_perfctrl0(0);232 w_c0_perfctrl0(0);
224 }233 }
@@ -236,6 +245,7 @@ static int mipsxx_perfcount_handler(void) · 11 unmodified lines
236 245
237 switch (counters) {246 switch (counters) {
238#define HANDLE_COUNTER(n) \247#define HANDLE_COUNTER(n) \
248 /* fall through */ \
239 case n + 1: \249 case n + 1: \
240 control = r_c0_perfctrl ## n(); \250 control = r_c0_perfctrl ## n(); \
241 counter = r_c0_perfcntr ## n(); \251 counter = r_c0_perfcntr ## n(); \
@@ -297,12 +307,15 @@ static void reset_counters(void *arg) · 55 unmodified lines
297 case 4:307 case 4:
298 w_c0_perfctrl3(0);308 w_c0_perfctrl3(0);
299 w_c0_perfcntr3(0);309 w_c0_perfcntr3(0);
310 /* fall through */
300 case 3:311 case 3:
301 w_c0_perfctrl2(0);312 w_c0_perfctrl2(0);
302 w_c0_perfcntr2(0);313 w_c0_perfcntr2(0);
314 /* fall through */
303 case 2:315 case 2:
304 w_c0_perfctrl1(0);316 w_c0_perfctrl1(0);
305 w_c0_perfcntr1(0);317 w_c0_perfcntr1(0);
318 /* fall through */
306 case 1:319 case 1:
307 w_c0_perfctrl0(0);320 w_c0_perfctrl0(0);
308 w_c0_perfcntr0(0);321 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
474 if (PCI_SLOT(devfn) == 0)474 if (PCI_SLOT(devfn) == 0)
475 return bcm_pcie_readl(PCIE_DLSTATUS_REG)475 return bcm_pcie_readl(PCIE_DLSTATUS_REG)
476 & DLSTATUS_PHYLINKUP;476 & DLSTATUS_PHYLINKUP;
477 /* else, fall through */
477 default:478 default:
478 return false;479 return false;
479 }480 }
arch/mips/vdso/vdso.h+1−0
@@ -9,6 +9,7 @@ · 8 unmodified lines
9#if _MIPS_SIM != _MIPS_SIM_ABI64 && defined(CONFIG_64BIT)9#if _MIPS_SIM != _MIPS_SIM_ABI64 && defined(CONFIG_64BIT)
10 10
11/* Building 32-bit VDSO for the 64-bit kernel. Fake a 32-bit Kconfig. */11/* Building 32-bit VDSO for the 64-bit kernel. Fake a 32-bit Kconfig. */
12#define BUILD_VDSO32_64
12#undef CONFIG_64BIT13#undef CONFIG_64BIT
13#define CONFIG_32BIT 114#define CONFIG_32BIT 1
14#ifndef __ASSEMBLY__15#ifndef __ASSEMBLY__
arch/parisc/Makefile+3−2
@@ -19,8 +19,6 @@ · 18 unmodified lines
19 19
20KBUILD_IMAGE := vmlinuz20KBUILD_IMAGE := vmlinuz
21 21
22KBUILD_DEFCONFIG := default_defconfig
23
24NM = sh $(srctree)/arch/parisc/nm22NM = sh $(srctree)/arch/parisc/nm
25CHECKFLAGS += -D__hppa__=123CHECKFLAGS += -D__hppa__=1
26LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)24LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
@@ -182,5 +180,8 @@ define archhelp · 155 unmodified lines
182 @echo ' zinstall - Install compressed vmlinuz kernel'180 @echo ' zinstall - Install compressed vmlinuz kernel'
183endef181endef
184 182
183archclean:
184 $(Q)$(MAKE) $(clean)=$(boot)
185
185archheaders:186archheaders:
186 $(Q)$(MAKE) $(build)=arch/parisc/kernel/syscalls all187 $(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
12targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz212targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
13targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz413targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
14targets += misc.o piggy.o sizes.h head.o real2.o firmware.o14targets += misc.o piggy.o sizes.h head.o real2.o firmware.o
15targets += real2.S firmware.c
15 16
16KBUILD_CFLAGS := -D__KERNEL__ -O2 -DBOOTLOADER17KBUILD_CFLAGS := -D__KERNEL__ -O2 -DBOOTLOADER
17KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING18KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
@@ -55,7 +56,8 @@ $(obj)/misc.o: $(obj)/sizes.h · 37 unmodified lines
55CPPFLAGS_vmlinux.lds += -I$(objtree)/$(obj) -DBOOTLOADER56CPPFLAGS_vmlinux.lds += -I$(objtree)/$(obj) -DBOOTLOADER
56$(obj)/vmlinux.lds: $(obj)/sizes.h57$(obj)/vmlinux.lds: $(obj)/sizes.h
57 58
58$(obj)/vmlinux.bin: vmlinux59OBJCOPYFLAGS_vmlinux.bin := -R .comment -R .note -S
60$(obj)/vmlinux.bin: vmlinux FORCE
59 $(call if_changed,objcopy)61 $(call if_changed,objcopy)
60 62
61vmlinux.bin.all-y := $(obj)/vmlinux.bin63vmlinux.bin.all-y := $(obj)/vmlinux.bin
arch/parisc/boot/compressed/vmlinux.lds.S+2−2
@@ -48,8 +48,8 @@ SECTIONS · 47 unmodified lines
48 *(.rodata.compressed)48 *(.rodata.compressed)
49 }49 }
50 50
51 /* bootloader code and data starts behind area of extracted kernel */51 /* bootloader code and data starts at least behind area of extracted kernel */
52 . = (SZ_end - SZparisc_kernel_start + KERNEL_BINARY_TEXT_START);52 . = MAX(ABSOLUTE(.), (SZ_end - SZparisc_kernel_start + KERNEL_BINARY_TEXT_START));
53 53
54 /* align on next page boundary */54 /* align on next page boundary */
55 . = ALIGN(4096);55 . = 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
181 for (i = 0; i < ARRAY_SIZE(insn); i++)181 for (i = 0; i < ARRAY_SIZE(insn); i++)
182 insn[i] = INSN_NOP;182 insn[i] = INSN_NOP;
183 183
184 __patch_text((void *)rec->ip, INSN_NOP);
184 __patch_text_multiple((void *)rec->ip + 4 - sizeof(insn),185 __patch_text_multiple((void *)rec->ip + 4 - sizeof(insn),
185 insn, sizeof(insn));186 insn, sizeof(insn)-4);
186 return 0;187 return 0;
187}188}
188#endif189#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
18# other very old or stripped-down PA-RISC CPUs -- not currently supported18# other very old or stripped-down PA-RISC CPUs -- not currently supported
19 19
20obj-$(CONFIG_MATH_EMULATION) += unimplemented-math-emulation.o20obj-$(CONFIG_MATH_EMULATION) += unimplemented-math-emulation.o
21CFLAGS_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
66 case 0x30000000: /* coproc2 */66 case 0x30000000: /* coproc2 */
67 if (bit22set(inst))67 if (bit22set(inst))
68 return VM_WRITE;68 return VM_WRITE;
69 /* fall through */
69 70
70 case 0x0: /* indexed/memory management */71 case 0x0: /* indexed/memory management */
71 if (bit22set(inst)) {72 if (bit22set(inst)) {
arch/powerpc/include/asm/cache.h+4−4
@@ -107,22 +107,22 @@ extern void _set_L3CR(unsigned long); · 106 unmodified lines
107 107
108static inline void dcbz(void *addr)108static inline void dcbz(void *addr)
109{109{
110 __asm__ __volatile__ ("dcbz %y0" : : "Z"(*(u8 *)addr) : "memory");110 __asm__ __volatile__ ("dcbz 0, %0" : : "r"(addr) : "memory");
111}111}
112 112
113static inline void dcbi(void *addr)113static inline void dcbi(void *addr)
114{114{
115 __asm__ __volatile__ ("dcbi %y0" : : "Z"(*(u8 *)addr) : "memory");115 __asm__ __volatile__ ("dcbi 0, %0" : : "r"(addr) : "memory");
116}116}
117 117
118static inline void dcbf(void *addr)118static inline void dcbf(void *addr)
119{119{
120 __asm__ __volatile__ ("dcbf %y0" : : "Z"(*(u8 *)addr) : "memory");120 __asm__ __volatile__ ("dcbf 0, %0" : : "r"(addr) : "memory");
121}121}
122 122
123static inline void dcbst(void *addr)123static inline void dcbst(void *addr)
124{124{
125 __asm__ __volatile__ ("dcbst %y0" : : "Z"(*(u8 *)addr) : "memory");125 __asm__ __volatile__ ("dcbst 0, %0" : : "r"(addr) : "memory");
126}126}
127#endif /* !__ASSEMBLY__ */127#endif /* !__ASSEMBLY__ */
128#endif /* __KERNEL__ */128#endif /* __KERNEL__ */
arch/powerpc/include/asm/unistd.h+1−0
@@ -49,6 +49,7 @@ · 48 unmodified lines
49#define __ARCH_WANT_SYS_FORK49#define __ARCH_WANT_SYS_FORK
50#define __ARCH_WANT_SYS_VFORK50#define __ARCH_WANT_SYS_VFORK
51#define __ARCH_WANT_SYS_CLONE51#define __ARCH_WANT_SYS_CLONE
52#define __ARCH_WANT_SYS_CLONE3
52 53
53#endif /* __ASSEMBLY__ */54#endif /* __ASSEMBLY__ */
54#endif /* _ASM_POWERPC_UNISTD_H_ */55#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
176 ret |= __get_user_inatomic(temp.v[1], p++);176 ret |= __get_user_inatomic(temp.v[1], p++);
177 ret |= __get_user_inatomic(temp.v[2], p++);177 ret |= __get_user_inatomic(temp.v[2], p++);
178 ret |= __get_user_inatomic(temp.v[3], p++);178 ret |= __get_user_inatomic(temp.v[3], p++);
179 /* fall through */
179 case 4:180 case 4:
180 ret |= __get_user_inatomic(temp.v[4], p++);181 ret |= __get_user_inatomic(temp.v[4], p++);
181 ret |= __get_user_inatomic(temp.v[5], p++);182 ret |= __get_user_inatomic(temp.v[5], p++);
183 /* fall through */
182 case 2:184 case 2:
183 ret |= __get_user_inatomic(temp.v[6], p++);185 ret |= __get_user_inatomic(temp.v[6], p++);
184 ret |= __get_user_inatomic(temp.v[7], p++);186 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
259 ret |= __put_user_inatomic(data.v[1], p++);261 ret |= __put_user_inatomic(data.v[1], p++);
260 ret |= __put_user_inatomic(data.v[2], p++);262 ret |= __put_user_inatomic(data.v[2], p++);
261 ret |= __put_user_inatomic(data.v[3], p++);263 ret |= __put_user_inatomic(data.v[3], p++);
264 /* fall through */
262 case 4:265 case 4:
263 ret |= __put_user_inatomic(data.v[4], p++);266 ret |= __put_user_inatomic(data.v[4], p++);
264 ret |= __put_user_inatomic(data.v[5], p++);267 ret |= __put_user_inatomic(data.v[5], p++);
268 /* fall through */
265 case 2:269 case 2:
266 ret |= __put_user_inatomic(data.v[6], p++);270 ret |= __put_user_inatomic(data.v[6], p++);
267 ret |= __put_user_inatomic(data.v[7], p++);271 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
597 stw r0,_TRAP(r1) /* register set saved */597 stw r0,_TRAP(r1) /* register set saved */
598 b sys_clone598 b sys_clone
599 599
600 .globl ppc_clone3
601ppc_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
600 .globl ppc_swapcontext608 .globl ppc_swapcontext
601ppc_swapcontext:609ppc_swapcontext:
602 SAVE_NVGPRS(r1)610 SAVE_NVGPRS(r1)
arch/powerpc/kernel/entry_64.S+5−0
@@ -487,6 +487,11 @@ _GLOBAL(ppc_clone) · 486 unmodified lines
487 bl sys_clone487 bl sys_clone
488 b .Lsyscall_exit488 b .Lsyscall_exit
489 489
490_GLOBAL(ppc_clone3)
491 bl save_nvgprs
492 bl sys_clone3
493 b .Lsyscall_exit
494
490_GLOBAL(ppc32_swapcontext)495_GLOBAL(ppc32_swapcontext)
491 bl save_nvgprs496 bl save_nvgprs
492 bl compat_sys_swapcontext497 bl compat_sys_swapcontext
arch/powerpc/kernel/syscalls/syscall.tbl+1−1
@@ -516,4 +516,4 @@ · 515 unmodified lines
516432 common fsmount sys_fsmount516432 common fsmount sys_fsmount
517433 common fspick sys_fspick517433 common fspick sys_fspick
518434 common pidfd_open sys_pidfd_open518434 common pidfd_open sys_pidfd_open
519# 435 reserved for clone3519435 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
239 case 2:239 case 2:
240 case 6:240 case 6:
241 pte->may_write = true;241 pte->may_write = true;
242 /* fall through */
242 case 3:243 case 3:
243 case 5:244 case 5:
244 case 7:245 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
50 return !!(v->arch.pending_exceptions) || kvm_request_pending(v);50 return !!(v->arch.pending_exceptions) || kvm_request_pending(v);
51}51}
52 52
53bool kvm_arch_dy_runnable(struct kvm_vcpu *vcpu)
54{
55 return kvm_arch_vcpu_runnable(vcpu);
56}
57
53bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu)58bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu)
54{59{
55 return false;60 return false;
@@ -452,16 +457,6 @@ err_out: · 396 unmodified lines
452 return -EINVAL;457 return -EINVAL;
453}458}
454 459
455bool kvm_arch_has_vcpu_debugfs(void)
456{
457 return false;
458}
459
460int kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu)
461{
462 return 0;
463}
464
465void kvm_arch_destroy_vm(struct kvm *kvm)460void kvm_arch_destroy_vm(struct kvm *kvm)
466{461{
467 unsigned int i;462 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
21 __set_pte_at(&init_mm, va, ptep, pfn_pte(PHYS_PFN(pa), prot), 0);21 __set_pte_at(&init_mm, va, ptep, pfn_pte(PHYS_PFN(pa), prot), 0);
22}22}
23 23
24static int kasan_init_shadow_page_tables(unsigned long k_start, unsigned long k_end)24static int __ref kasan_init_shadow_page_tables(unsigned long k_start, unsigned long k_end)
25{25{
26 pmd_t *pmd;26 pmd_t *pmd;
27 unsigned long k_cur, k_next;27 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
35 if ((void *)pmd_page_vaddr(*pmd) != kasan_early_shadow_pte)35 if ((void *)pmd_page_vaddr(*pmd) != kasan_early_shadow_pte)
36 continue;36 continue;
37 37
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);
39 42
40 if (!new)43 if (!new)
41 return -ENOMEM;44 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
275 NULL,275 NULL,
276};276};
277 277
278static 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
278static int papr_scm_nvdimm_init(struct papr_scm_priv *p)297static int papr_scm_nvdimm_init(struct papr_scm_priv *p)
279{298{
280 struct device *dev = &p->pdev->dev;299 struct device *dev = &p->pdev->dev;
281 struct nd_mapping_desc mapping;300 struct nd_mapping_desc mapping;
282 struct nd_region_desc ndr_desc;301 struct nd_region_desc ndr_desc;
283 unsigned long dimm_flags;302 unsigned long dimm_flags;
303 int target_nid, online_nid;
284 304
285 p->bus_desc.ndctl = papr_scm_ndctl;305 p->bus_desc.ndctl = papr_scm_ndctl;
286 p->bus_desc.module = THIS_MODULE;306 p->bus_desc.module = THIS_MODULE;
@@ -319,8 +339,10 @@ static int papr_scm_nvdimm_init(struct papr_scm_priv *p) · 32 unmodified lines
319 339
320 memset(&ndr_desc, 0, sizeof(ndr_desc));340 memset(&ndr_desc, 0, sizeof(ndr_desc));
321 ndr_desc.attr_groups = region_attr_groups;341 ndr_desc.attr_groups = region_attr_groups;
322 ndr_desc.numa_node = dev_to_node(&p->pdev->dev);342 target_nid = dev_to_node(&p->pdev->dev);
323 ndr_desc.target_node = ndr_desc.numa_node;343 online_nid = papr_scm_node(target_nid);
344 ndr_desc.numa_node = online_nid;
345 ndr_desc.target_node = target_nid;
324 ndr_desc.res = &p->res;346 ndr_desc.res = &p->res;
325 ndr_desc.of_node = p->dn;347 ndr_desc.of_node = p->dn;
326 ndr_desc.provider_data = p;348 ndr_desc.provider_data = p;
@@ -338,6 +360,9 @@ static int papr_scm_nvdimm_init(struct papr_scm_priv *p) · 11 unmodified lines
338 ndr_desc.res, p->dn);360 ndr_desc.res, p->dn);
339 goto err;361 goto err;
340 }362 }
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);
341 366
342 return 0;367 return 0;
343 368
arch/riscv/boot/dts/sifive/fu540-c000.dtsi+0−1
@@ -21,7 +21,6 @@ · 20 unmodified lines
21 cpus {21 cpus {
22 #address-cells = <1>;22 #address-cells = <1>;
23 #size-cells = <0>;23 #size-cells = <0>;
24 timebase-frequency = <1000000>;
25 cpu0: cpu@0 {24 cpu0: cpu@0 {
26 compatible = "sifive,e51", "sifive,rocket0", "riscv";25 compatible = "sifive,e51", "sifive,rocket0", "riscv";
27 device_type = "cpu";26 device_type = "cpu";
arch/riscv/configs/defconfig+5−5
@@ -34,6 +34,7 @@ CONFIG_PCIEPORTBUS=y · 33 unmodified lines
34CONFIG_PCI_HOST_GENERIC=y34CONFIG_PCI_HOST_GENERIC=y
35CONFIG_PCIE_XILINX=y35CONFIG_PCIE_XILINX=y
36CONFIG_DEVTMPFS=y36CONFIG_DEVTMPFS=y
37CONFIG_DEVTMPFS_MOUNT=y
37CONFIG_BLK_DEV_LOOP=y38CONFIG_BLK_DEV_LOOP=y
38CONFIG_VIRTIO_BLK=y39CONFIG_VIRTIO_BLK=y
39CONFIG_BLK_DEV_SD=y40CONFIG_BLK_DEV_SD=y
@@ -53,6 +54,8 @@ CONFIG_SERIAL_8250_CONSOLE=y · 13 unmodified lines
53CONFIG_SERIAL_OF_PLATFORM=y54CONFIG_SERIAL_OF_PLATFORM=y
54CONFIG_SERIAL_EARLYCON_RISCV_SBI=y55CONFIG_SERIAL_EARLYCON_RISCV_SBI=y
55CONFIG_HVC_RISCV_SBI=y56CONFIG_HVC_RISCV_SBI=y
57CONFIG_SPI=y
58CONFIG_SPI_SIFIVE=y
56# CONFIG_PTP_1588_CLOCK is not set59# CONFIG_PTP_1588_CLOCK is not set
57CONFIG_DRM=y60CONFIG_DRM=y
58CONFIG_DRM_RADEON=y61CONFIG_DRM_RADEON=y
@@ -66,8 +69,9 @@ CONFIG_USB_OHCI_HCD=y · 7 unmodified lines
66CONFIG_USB_OHCI_HCD_PLATFORM=y69CONFIG_USB_OHCI_HCD_PLATFORM=y
67CONFIG_USB_STORAGE=y70CONFIG_USB_STORAGE=y
68CONFIG_USB_UAS=y71CONFIG_USB_UAS=y
72CONFIG_MMC=y
73CONFIG_MMC_SPI=y
69CONFIG_VIRTIO_MMIO=y74CONFIG_VIRTIO_MMIO=y
70CONFIG_SPI_SIFIVE=y
71CONFIG_EXT4_FS=y75CONFIG_EXT4_FS=y
72CONFIG_EXT4_FS_POSIX_ACL=y76CONFIG_EXT4_FS_POSIX_ACL=y
73CONFIG_AUTOFS4_FS=y77CONFIG_AUTOFS4_FS=y
@@ -83,8 +87,4 @@ CONFIG_ROOT_NFS=y · 9 unmodified lines
83CONFIG_CRYPTO_USER_API_HASH=y87CONFIG_CRYPTO_USER_API_HASH=y
84CONFIG_CRYPTO_DEV_VIRTIO=y88CONFIG_CRYPTO_DEV_VIRTIO=y
85CONFIG_PRINTK_TIME=y89CONFIG_PRINTK_TIME=y
86CONFIG_SPI=y
87CONFIG_MMC_SPI=y
88CONFIG_MMC=y
89CONFIG_DEVTMPFS_MOUNT=y
90# CONFIG_RCU_TRACE is not set90# 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
37# these symbols in the kernel code rather than hand-coded addresses.37# these symbols in the kernel code rather than hand-coded addresses.
38 38
39SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \39SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
40 -Wl,--hash-style=both40 -Wl,--build-id -Wl,--hash-style=both
41$(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/rt_sigreturn.o FORCE41$(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/rt_sigreturn.o FORCE
42 $(call if_changed,vdsold)42 $(call if_changed,vdsold)
43 43
arch/riscv/lib/Makefile+0−2
@@ -5,5 +5,3 @@ lib-y += memset.o · 4 unmodified lines
5lib-y += uaccess.o5lib-y += uaccess.o
6 6
7lib-$(CONFIG_64BIT) += tishift.o7lib-$(CONFIG_64BIT) += tishift.o
8
9lib-$(CONFIG_32BIT) += udivdi3.o
arch/riscv/lib/delay.c+5−1
@@ -81,9 +81,13 @@ EXPORT_SYMBOL(__delay); · 80 unmodified lines
81void udelay(unsigned long usecs)81void udelay(unsigned long usecs)
82{82{
83 u64 ucycles = (u64)usecs * lpj_fine * UDELAY_MULT;83 u64 ucycles = (u64)usecs * lpj_fine * UDELAY_MULT;
84 u64 n;
84 85
85 if (unlikely(usecs > MAX_UDELAY_US)) {86 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);
87 return;91 return;
88 }92 }
89 93
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
8ENTRY(__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
32ENDPROC(__udivdi3)
arch/s390/boot/boot.h+1−0
@@ -8,6 +8,7 @@ void store_ipl_parmblock(void); · 7 unmodified lines
8void setup_boot_command_line(void);8void setup_boot_command_line(void);
9void parse_boot_command_line(void);9void parse_boot_command_line(void);
10void setup_memory_end(void);10void setup_memory_end(void);
11void verify_facilities(void);
11void print_missing_facilities(void);12void print_missing_facilities(void);
12unsigned long get_random_base(unsigned long safe_addr);13unsigned long get_random_base(unsigned long safe_addr);
13 14
arch/s390/boot/ipl_parm.c+0−2
@@ -48,9 +48,7 @@ void store_ipl_parmblock(void) · 47 unmodified lines
48{48{
49 int rc;49 int rc;
50 50
51 uv_set_shared(__pa(&ipl_block));
52 rc = __diag308(DIAG308_STORE, &ipl_block);51 rc = __diag308(DIAG308_STORE, &ipl_block);
53 uv_remove_shared(__pa(&ipl_block));
54 if (rc == DIAG308_RC_OK &&52 if (rc == DIAG308_RC_OK &&
55 ipl_block.hdr.version <= IPL_MAX_SUPPORTED_VERSION)53 ipl_block.hdr.version <= IPL_MAX_SUPPORTED_VERSION)
56 ipl_block_valid = 1;54 ipl_block_valid = 1;
arch/s390/boot/kaslr.c+1−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
7#include <asm/timex.h>7#include <asm/timex.h>
8#include <asm/sclp.h>8#include <asm/sclp.h>
9#include "compressed/decompressor.h"9#include "compressed/decompressor.h"
10#include "boot.h"
10 11
11#define PRNG_MODE_TDES 112#define PRNG_MODE_TDES 1
12#define PRNG_MODE_SHA512 213#define PRNG_MODE_SHA512 2
arch/s390/configs/debug_defconfig+199−131
@@ -3,6 +3,7 @@ CONFIG_POSIX_MQUEUE=y · 2 unmodified lines
3CONFIG_AUDIT=y3CONFIG_AUDIT=y
4CONFIG_NO_HZ_IDLE=y4CONFIG_NO_HZ_IDLE=y
5CONFIG_HIGH_RES_TIMERS=y5CONFIG_HIGH_RES_TIMERS=y
6CONFIG_PREEMPT=y
6CONFIG_BSD_PROCESS_ACCT=y7CONFIG_BSD_PROCESS_ACCT=y
7CONFIG_BSD_PROCESS_ACCT_V3=y8CONFIG_BSD_PROCESS_ACCT_V3=y
8CONFIG_TASKSTATS=y9CONFIG_TASKSTATS=y
@@ -18,55 +19,71 @@ CONFIG_BLK_CGROUP=y · 9 unmodified lines
18CONFIG_CFS_BANDWIDTH=y19CONFIG_CFS_BANDWIDTH=y
19CONFIG_RT_GROUP_SCHED=y20CONFIG_RT_GROUP_SCHED=y
20CONFIG_CGROUP_PIDS=y21CONFIG_CGROUP_PIDS=y
22CONFIG_CGROUP_RDMA=y
21CONFIG_CGROUP_FREEZER=y23CONFIG_CGROUP_FREEZER=y
22CONFIG_CGROUP_HUGETLB=y24CONFIG_CGROUP_HUGETLB=y
23CONFIG_CPUSETS=y25CONFIG_CPUSETS=y
24CONFIG_CGROUP_DEVICE=y26CONFIG_CGROUP_DEVICE=y
25CONFIG_CGROUP_CPUACCT=y27CONFIG_CGROUP_CPUACCT=y
26CONFIG_CGROUP_PERF=y28CONFIG_CGROUP_PERF=y
29CONFIG_CGROUP_BPF=y
27CONFIG_NAMESPACES=y30CONFIG_NAMESPACES=y
28CONFIG_USER_NS=y31CONFIG_USER_NS=y
32CONFIG_CHECKPOINT_RESTORE=y
29CONFIG_SCHED_AUTOGROUP=y33CONFIG_SCHED_AUTOGROUP=y
30CONFIG_BLK_DEV_INITRD=y34CONFIG_BLK_DEV_INITRD=y
31CONFIG_EXPERT=y35CONFIG_EXPERT=y
32# CONFIG_SYSFS_SYSCALL is not set36# CONFIG_SYSFS_SYSCALL is not set
33CONFIG_CHECKPOINT_RESTORE=y
34CONFIG_BPF_SYSCALL=y37CONFIG_BPF_SYSCALL=y
35CONFIG_USERFAULTFD=y38CONFIG_USERFAULTFD=y
36# CONFIG_COMPAT_BRK is not set39# CONFIG_COMPAT_BRK is not set
37CONFIG_PROFILING=y40CONFIG_PROFILING=y
41CONFIG_LIVEPATCH=y
42CONFIG_TUNE_ZEC12=y
43CONFIG_NR_CPUS=512
44CONFIG_NUMA=y
45CONFIG_HZ_100=y
46CONFIG_KEXEC_FILE=y
47CONFIG_EXPOLINE=y
48CONFIG_EXPOLINE_AUTO=y
49CONFIG_CHSC_SCH=y
50CONFIG_VFIO_CCW=m
51CONFIG_VFIO_AP=m
52CONFIG_CRASH_DUMP=y
53CONFIG_HIBERNATION=y
54CONFIG_PM_DEBUG=y
55CONFIG_CMM=m
56CONFIG_APPLDATA_BASE=y
57CONFIG_KVM=m
58CONFIG_VHOST_NET=m
59CONFIG_VHOST_VSOCK=m
38CONFIG_OPROFILE=m60CONFIG_OPROFILE=m
39CONFIG_KPROBES=y61CONFIG_KPROBES=y
40CONFIG_JUMP_LABEL=y62CONFIG_JUMP_LABEL=y
41CONFIG_STATIC_KEYS_SELFTEST=y63CONFIG_STATIC_KEYS_SELFTEST=y
64CONFIG_REFCOUNT_FULL=y
65CONFIG_LOCK_EVENT_COUNTS=y
42CONFIG_MODULES=y66CONFIG_MODULES=y
43CONFIG_MODULE_FORCE_LOAD=y67CONFIG_MODULE_FORCE_LOAD=y
44CONFIG_MODULE_UNLOAD=y68CONFIG_MODULE_UNLOAD=y
45CONFIG_MODULE_FORCE_UNLOAD=y69CONFIG_MODULE_FORCE_UNLOAD=y
46CONFIG_MODVERSIONS=y70CONFIG_MODVERSIONS=y
47CONFIG_MODULE_SRCVERSION_ALL=y71CONFIG_MODULE_SRCVERSION_ALL=y
72CONFIG_MODULE_SIG=y
73CONFIG_MODULE_SIG_SHA256=y
48CONFIG_BLK_DEV_INTEGRITY=y74CONFIG_BLK_DEV_INTEGRITY=y
49CONFIG_BLK_DEV_THROTTLING=y75CONFIG_BLK_DEV_THROTTLING=y
50CONFIG_BLK_WBT=y76CONFIG_BLK_WBT=y
51CONFIG_BLK_WBT_SQ=y77CONFIG_BLK_CGROUP_IOLATENCY=y
52CONFIG_PARTITION_ADVANCED=y78CONFIG_PARTITION_ADVANCED=y
53CONFIG_IBM_PARTITION=y79CONFIG_IBM_PARTITION=y
54CONFIG_BSD_DISKLABEL=y80CONFIG_BSD_DISKLABEL=y
55CONFIG_MINIX_SUBPARTITION=y81CONFIG_MINIX_SUBPARTITION=y
56CONFIG_SOLARIS_X86_PARTITION=y82CONFIG_SOLARIS_X86_PARTITION=y
57CONFIG_UNIXWARE_DISKLABEL=y83CONFIG_UNIXWARE_DISKLABEL=y
58CONFIG_CFQ_GROUP_IOSCHED=y84CONFIG_IOSCHED_BFQ=y
59CONFIG_DEFAULT_DEADLINE=y85CONFIG_BFQ_GROUP_IOSCHED=y
60CONFIG_LIVEPATCH=y86CONFIG_BINFMT_MISC=m
61CONFIG_TUNE_ZEC12=y
62CONFIG_NR_CPUS=512
63CONFIG_NUMA=y
64CONFIG_PREEMPT=y
65CONFIG_HZ_100=y
66CONFIG_KEXEC_FILE=y
67CONFIG_KEXEC_VERIFY_SIG=y
68CONFIG_EXPOLINE=y
69CONFIG_EXPOLINE_AUTO=y
70CONFIG_MEMORY_HOTPLUG=y87CONFIG_MEMORY_HOTPLUG=y
71CONFIG_MEMORY_HOTREMOVE=y88CONFIG_MEMORY_HOTREMOVE=y
72CONFIG_KSM=y89CONFIG_KSM=y
@@ -82,17 +99,8 @@ CONFIG_ZSMALLOC=m · 9 unmodified lines
82CONFIG_ZSMALLOC_STAT=y99CONFIG_ZSMALLOC_STAT=y
83CONFIG_DEFERRED_STRUCT_PAGE_INIT=y100CONFIG_DEFERRED_STRUCT_PAGE_INIT=y
84CONFIG_IDLE_PAGE_TRACKING=y101CONFIG_IDLE_PAGE_TRACKING=y
85CONFIG_PCI=y102CONFIG_PERCPU_STATS=y
86CONFIG_PCI_DEBUG=y103CONFIG_GUP_BENCHMARK=y
87CONFIG_HOTPLUG_PCI=y
88CONFIG_HOTPLUG_PCI_S390=y
89CONFIG_CHSC_SCH=y
90CONFIG_VFIO_AP=m
91CONFIG_VFIO_CCW=m
92CONFIG_CRASH_DUMP=y
93CONFIG_BINFMT_MISC=m
94CONFIG_HIBERNATION=y
95CONFIG_PM_DEBUG=y
96CONFIG_NET=y104CONFIG_NET=y
97CONFIG_PACKET=y105CONFIG_PACKET=y
98CONFIG_PACKET_DIAG=m106CONFIG_PACKET_DIAG=m
@@ -121,9 +129,6 @@ CONFIG_NET_IPVTI=m · 22 unmodified lines
121CONFIG_INET_AH=m129CONFIG_INET_AH=m
122CONFIG_INET_ESP=m130CONFIG_INET_ESP=m
123CONFIG_INET_IPCOMP=m131CONFIG_INET_IPCOMP=m
124CONFIG_INET_XFRM_MODE_TRANSPORT=m
125CONFIG_INET_XFRM_MODE_TUNNEL=m
126CONFIG_INET_XFRM_MODE_BEET=m
127CONFIG_INET_DIAG=m132CONFIG_INET_DIAG=m
128CONFIG_INET_UDP_DIAG=m133CONFIG_INET_UDP_DIAG=m
129CONFIG_TCP_CONG_ADVANCED=y134CONFIG_TCP_CONG_ADVANCED=y
@@ -139,10 +144,6 @@ CONFIG_INET6_AH=m · 9 unmodified lines
139CONFIG_INET6_ESP=m144CONFIG_INET6_ESP=m
140CONFIG_INET6_IPCOMP=m145CONFIG_INET6_IPCOMP=m
141CONFIG_IPV6_MIP6=m146CONFIG_IPV6_MIP6=m
142CONFIG_INET6_XFRM_MODE_TRANSPORT=m
143CONFIG_INET6_XFRM_MODE_TUNNEL=m
144CONFIG_INET6_XFRM_MODE_BEET=m
145CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
146CONFIG_IPV6_VTI=m147CONFIG_IPV6_VTI=m
147CONFIG_IPV6_SIT=m148CONFIG_IPV6_SIT=m
148CONFIG_IPV6_GRE=m149CONFIG_IPV6_GRE=m
@@ -264,11 +265,8 @@ CONFIG_IP_VS_SED=m · 115 unmodified lines
264CONFIG_IP_VS_NQ=m265CONFIG_IP_VS_NQ=m
265CONFIG_IP_VS_FTP=m266CONFIG_IP_VS_FTP=m
266CONFIG_IP_VS_PE_SIP=m267CONFIG_IP_VS_PE_SIP=m
267CONFIG_NF_CONNTRACK_IPV4=m
268CONFIG_NF_TABLES_IPV4=y268CONFIG_NF_TABLES_IPV4=y
269CONFIG_NFT_CHAIN_ROUTE_IPV4=m
270CONFIG_NF_TABLES_ARP=y269CONFIG_NF_TABLES_ARP=y
271CONFIG_NFT_CHAIN_NAT_IPV4=m
272CONFIG_IP_NF_IPTABLES=m270CONFIG_IP_NF_IPTABLES=m
273CONFIG_IP_NF_MATCH_AH=m271CONFIG_IP_NF_MATCH_AH=m
274CONFIG_IP_NF_MATCH_ECN=m272CONFIG_IP_NF_MATCH_ECN=m
@@ -287,10 +285,7 @@ CONFIG_IP_NF_SECURITY=m · 12 unmodified lines
287CONFIG_IP_NF_ARPTABLES=m285CONFIG_IP_NF_ARPTABLES=m
288CONFIG_IP_NF_ARPFILTER=m286CONFIG_IP_NF_ARPFILTER=m
289CONFIG_IP_NF_ARP_MANGLE=m287CONFIG_IP_NF_ARP_MANGLE=m
290CONFIG_NF_CONNTRACK_IPV6=m
291CONFIG_NF_TABLES_IPV6=y288CONFIG_NF_TABLES_IPV6=y
292CONFIG_NFT_CHAIN_ROUTE_IPV6=m
293CONFIG_NFT_CHAIN_NAT_IPV6=m
294CONFIG_IP6_NF_IPTABLES=m289CONFIG_IP6_NF_IPTABLES=m
295CONFIG_IP6_NF_MATCH_AH=m290CONFIG_IP6_NF_MATCH_AH=m
296CONFIG_IP6_NF_MATCH_EUI64=m291CONFIG_IP6_NF_MATCH_EUI64=m
@@ -309,7 +304,7 @@ CONFIG_IP6_NF_RAW=m · 12 unmodified lines
309CONFIG_IP6_NF_SECURITY=m304CONFIG_IP6_NF_SECURITY=m
310CONFIG_IP6_NF_NAT=m305CONFIG_IP6_NF_NAT=m
311CONFIG_IP6_NF_TARGET_MASQUERADE=m306CONFIG_IP6_NF_TARGET_MASQUERADE=m
312CONFIG_NF_TABLES_BRIDGE=y307CONFIG_NF_TABLES_BRIDGE=m
313CONFIG_RDS=m308CONFIG_RDS=m
314CONFIG_RDS_RDMA=m309CONFIG_RDS_RDMA=m
315CONFIG_RDS_TCP=m310CONFIG_RDS_TCP=m
@@ -375,9 +370,11 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
375CONFIG_CGROUP_NET_PRIO=y370CONFIG_CGROUP_NET_PRIO=y
376CONFIG_BPF_JIT=y371CONFIG_BPF_JIT=y
377CONFIG_NET_PKTGEN=m372CONFIG_NET_PKTGEN=m
373CONFIG_PCI=y
374CONFIG_PCI_DEBUG=y
375CONFIG_HOTPLUG_PCI=y
376CONFIG_HOTPLUG_PCI_S390=y
378CONFIG_DEVTMPFS=y377CONFIG_DEVTMPFS=y
379CONFIG_DMA_CMA=y
380CONFIG_CMA_SIZE_MBYTES=0
381CONFIG_CONNECTOR=y378CONFIG_CONNECTOR=y
382CONFIG_ZRAM=m379CONFIG_ZRAM=m
383CONFIG_BLK_DEV_LOOP=m380CONFIG_BLK_DEV_LOOP=m
@@ -395,7 +392,6 @@ CONFIG_RAID_ATTRS=m · 11 unmodified lines
395CONFIG_SCSI=y392CONFIG_SCSI=y
396CONFIG_BLK_DEV_SD=y393CONFIG_BLK_DEV_SD=y
397CONFIG_CHR_DEV_ST=m394CONFIG_CHR_DEV_ST=m
398CONFIG_CHR_DEV_OSST=m
399CONFIG_BLK_DEV_SR=m395CONFIG_BLK_DEV_SR=m
400CONFIG_CHR_DEV_SG=y396CONFIG_CHR_DEV_SG=y
401CONFIG_CHR_DEV_SCH=m397CONFIG_CHR_DEV_SCH=m
@@ -415,17 +411,19 @@ CONFIG_SCSI_DH_RDAC=m · 13 unmodified lines
415CONFIG_SCSI_DH_HP_SW=m411CONFIG_SCSI_DH_HP_SW=m
416CONFIG_SCSI_DH_EMC=m412CONFIG_SCSI_DH_EMC=m
417CONFIG_SCSI_DH_ALUA=m413CONFIG_SCSI_DH_ALUA=m
418CONFIG_SCSI_OSD_INITIATOR=m
419CONFIG_SCSI_OSD_ULD=m
420CONFIG_MD=y414CONFIG_MD=y
421CONFIG_BLK_DEV_MD=y415CONFIG_BLK_DEV_MD=y
422CONFIG_MD_LINEAR=m416CONFIG_MD_LINEAR=m
423CONFIG_MD_MULTIPATH=m417CONFIG_MD_MULTIPATH=m
424CONFIG_MD_FAULTY=m418CONFIG_MD_FAULTY=m
419CONFIG_MD_CLUSTER=m
420CONFIG_BCACHE=m
425CONFIG_BLK_DEV_DM=m421CONFIG_BLK_DEV_DM=m
422CONFIG_DM_UNSTRIPED=m
426CONFIG_DM_CRYPT=m423CONFIG_DM_CRYPT=m
427CONFIG_DM_SNAPSHOT=m424CONFIG_DM_SNAPSHOT=m
428CONFIG_DM_THIN_PROVISIONING=m425CONFIG_DM_THIN_PROVISIONING=m
426CONFIG_DM_WRITECACHE=m
429CONFIG_DM_MIRROR=m427CONFIG_DM_MIRROR=m
430CONFIG_DM_LOG_USERSPACE=m428CONFIG_DM_LOG_USERSPACE=m
431CONFIG_DM_RAID=m429CONFIG_DM_RAID=m
@@ -445,23 +443,78 @@ CONFIG_EQUALIZER=m · 13 unmodified lines
445CONFIG_IFB=m443CONFIG_IFB=m
446CONFIG_MACVLAN=m444CONFIG_MACVLAN=m
447CONFIG_MACVTAP=m445CONFIG_MACVTAP=m
448CONFIG_VXLAN=m
449CONFIG_TUN=m446CONFIG_TUN=m
450CONFIG_VETH=m447CONFIG_VETH=m
451CONFIG_VIRTIO_NET=m448CONFIG_VIRTIO_NET=m
452CONFIG_NLMON=m449CONFIG_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
453# CONFIG_NET_VENDOR_ARC is not set458# 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
454# CONFIG_NET_VENDOR_CHELSIO is not set465# 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
455# CONFIG_NET_VENDOR_INTEL is not set475# CONFIG_NET_VENDOR_INTEL is not set
456# CONFIG_NET_VENDOR_MARVELL is not set476# CONFIG_NET_VENDOR_MARVELL is not set
457CONFIG_MLX4_EN=m477CONFIG_MLX4_EN=m
458CONFIG_MLX5_CORE=m478CONFIG_MLX5_CORE=m
459CONFIG_MLX5_CORE_EN=y479CONFIG_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
460# CONFIG_NET_VENDOR_NATSEMI is not set485# 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
461CONFIG_PPP=m512CONFIG_PPP=m
462CONFIG_PPP_BSDCOMP=m513CONFIG_PPP_BSDCOMP=m
463CONFIG_PPP_DEFLATE=m514CONFIG_PPP_DEFLATE=m
515CONFIG_PPP_FILTER=y
464CONFIG_PPP_MPPE=m516CONFIG_PPP_MPPE=m
517CONFIG_PPP_MULTILINK=y
465CONFIG_PPPOE=m518CONFIG_PPPOE=m
466CONFIG_PPTP=m519CONFIG_PPTP=m
467CONFIG_PPPOL2TP=m520CONFIG_PPPOL2TP=m
@@ -473,10 +526,13 @@ CONFIG_INPUT_EVDEV=y · 5 unmodified lines
473# CONFIG_INPUT_MOUSE is not set526# CONFIG_INPUT_MOUSE is not set
474# CONFIG_SERIO is not set527# CONFIG_SERIO is not set
475CONFIG_LEGACY_PTY_COUNT=0528CONFIG_LEGACY_PTY_COUNT=0
529CONFIG_NULL_TTY=m
476CONFIG_HW_RANDOM_VIRTIO=m530CONFIG_HW_RANDOM_VIRTIO=m
477CONFIG_RAW_DRIVER=m531CONFIG_RAW_DRIVER=m
478CONFIG_HANGCHECK_TIMER=m532CONFIG_HANGCHECK_TIMER=m
479CONFIG_TN3270_FS=y533CONFIG_TN3270_FS=y
534CONFIG_PPS=m
535# CONFIG_PTP_1588_CLOCK is not set
480# CONFIG_HWMON is not set536# CONFIG_HWMON is not set
481CONFIG_WATCHDOG=y537CONFIG_WATCHDOG=y
482CONFIG_WATCHDOG_NOWAYOUT=y538CONFIG_WATCHDOG_NOWAYOUT=y
@@ -498,8 +554,8 @@ CONFIG_VFIO_MDEV_DEVICE=m · 15 unmodified lines
498CONFIG_VIRTIO_PCI=m554CONFIG_VIRTIO_PCI=m
499CONFIG_VIRTIO_BALLOON=m555CONFIG_VIRTIO_BALLOON=m
500CONFIG_VIRTIO_INPUT=y556CONFIG_VIRTIO_INPUT=y
501CONFIG_S390_AP_IOMMU=y
502CONFIG_S390_CCW_IOMMU=y557CONFIG_S390_CCW_IOMMU=y
558CONFIG_S390_AP_IOMMU=y
503CONFIG_EXT4_FS=y559CONFIG_EXT4_FS=y
504CONFIG_EXT4_FS_POSIX_ACL=y560CONFIG_EXT4_FS_POSIX_ACL=y
505CONFIG_EXT4_FS_SECURITY=y561CONFIG_EXT4_FS_SECURITY=y
@@ -519,6 +575,7 @@ CONFIG_OCFS2_FS=m · 13 unmodified lines
519CONFIG_BTRFS_FS=y575CONFIG_BTRFS_FS=y
520CONFIG_BTRFS_FS_POSIX_ACL=y576CONFIG_BTRFS_FS_POSIX_ACL=y
521CONFIG_BTRFS_DEBUG=y577CONFIG_BTRFS_DEBUG=y
578CONFIG_BTRFS_ASSERT=y
522CONFIG_NILFS2_FS=m579CONFIG_NILFS2_FS=m
523CONFIG_FS_DAX=y580CONFIG_FS_DAX=y
524CONFIG_EXPORTFS_BLOCK_OPS=y581CONFIG_EXPORTFS_BLOCK_OPS=y
@@ -552,8 +609,10 @@ CONFIG_ECRYPT_FS=m · 27 unmodified lines
552CONFIG_CRAMFS=m609CONFIG_CRAMFS=m
553CONFIG_SQUASHFS=m610CONFIG_SQUASHFS=m
554CONFIG_SQUASHFS_XATTR=y611CONFIG_SQUASHFS_XATTR=y
612CONFIG_SQUASHFS_LZ4=y
555CONFIG_SQUASHFS_LZO=y613CONFIG_SQUASHFS_LZO=y
556CONFIG_SQUASHFS_XZ=y614CONFIG_SQUASHFS_XZ=y
615CONFIG_SQUASHFS_ZSTD=y
557CONFIG_ROMFS_FS=m616CONFIG_ROMFS_FS=m
558CONFIG_NFS_FS=m617CONFIG_NFS_FS=m
559CONFIG_NFS_V3_ACL=y618CONFIG_NFS_V3_ACL=y
@@ -564,7 +623,6 @@ CONFIG_NFSD_V3_ACL=y · 4 unmodified lines
564CONFIG_NFSD_V4=y623CONFIG_NFSD_V4=y
565CONFIG_NFSD_V4_SECURITY_LABEL=y624CONFIG_NFSD_V4_SECURITY_LABEL=y
566CONFIG_CIFS=m625CONFIG_CIFS=m
567CONFIG_CIFS_STATS=y
568CONFIG_CIFS_STATS2=y626CONFIG_CIFS_STATS2=y
569CONFIG_CIFS_WEAK_PW_HASH=y627CONFIG_CIFS_WEAK_PW_HASH=y
570CONFIG_CIFS_UPCALL=y628CONFIG_CIFS_UPCALL=y
@@ -580,19 +638,112 @@ CONFIG_NLS_ISO8859_1=m · 9 unmodified lines
580CONFIG_NLS_ISO8859_15=m638CONFIG_NLS_ISO8859_15=m
581CONFIG_NLS_UTF8=m639CONFIG_NLS_UTF8=m
582CONFIG_DLM=m640CONFIG_DLM=m
641CONFIG_UNICODE=y
642CONFIG_PERSISTENT_KEYRINGS=y
643CONFIG_BIG_KEYS=y
644CONFIG_ENCRYPTED_KEYS=m
645CONFIG_SECURITY=y
646CONFIG_SECURITY_NETWORK=y
647CONFIG_FORTIFY_SOURCE=y
648CONFIG_SECURITY_SELINUX=y
649CONFIG_SECURITY_SELINUX_BOOTPARAM=y
650CONFIG_SECURITY_SELINUX_DISABLE=y
651CONFIG_INTEGRITY_SIGNATURE=y
652CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y
653CONFIG_IMA=y
654CONFIG_IMA_DEFAULT_HASH_SHA256=y
655CONFIG_IMA_WRITE_POLICY=y
656CONFIG_IMA_APPRAISE=y
657CONFIG_CRYPTO_USER=m
658# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
659CONFIG_CRYPTO_PCRYPT=m
660CONFIG_CRYPTO_CRYPTD=m
661CONFIG_CRYPTO_TEST=m
662CONFIG_CRYPTO_DH=m
663CONFIG_CRYPTO_ECDH=m
664CONFIG_CRYPTO_ECRDSA=m
665CONFIG_CRYPTO_CHACHA20POLY1305=m
666CONFIG_CRYPTO_AEGIS128=m
667CONFIG_CRYPTO_AEGIS128L=m
668CONFIG_CRYPTO_AEGIS256=m
669CONFIG_CRYPTO_MORUS640=m
670CONFIG_CRYPTO_MORUS1280=m
671CONFIG_CRYPTO_CFB=m
672CONFIG_CRYPTO_LRW=m
673CONFIG_CRYPTO_PCBC=m
674CONFIG_CRYPTO_KEYWRAP=m
675CONFIG_CRYPTO_ADIANTUM=m
676CONFIG_CRYPTO_XCBC=m
677CONFIG_CRYPTO_VMAC=m
678CONFIG_CRYPTO_CRC32=m
679CONFIG_CRYPTO_XXHASH=m
680CONFIG_CRYPTO_MICHAEL_MIC=m
681CONFIG_CRYPTO_RMD128=m
682CONFIG_CRYPTO_RMD160=m
683CONFIG_CRYPTO_RMD256=m
684CONFIG_CRYPTO_RMD320=m
685CONFIG_CRYPTO_SHA3=m
686CONFIG_CRYPTO_SM3=m
687CONFIG_CRYPTO_TGR192=m
688CONFIG_CRYPTO_WP512=m
689CONFIG_CRYPTO_AES_TI=m
690CONFIG_CRYPTO_ANUBIS=m
691CONFIG_CRYPTO_ARC4=m
692CONFIG_CRYPTO_BLOWFISH=m
693CONFIG_CRYPTO_CAMELLIA=m
694CONFIG_CRYPTO_CAST5=m
695CONFIG_CRYPTO_CAST6=m
696CONFIG_CRYPTO_FCRYPT=m
697CONFIG_CRYPTO_KHAZAD=m
698CONFIG_CRYPTO_SALSA20=m
699CONFIG_CRYPTO_SEED=m
700CONFIG_CRYPTO_SERPENT=m
701CONFIG_CRYPTO_SM4=m
702CONFIG_CRYPTO_TEA=m
703CONFIG_CRYPTO_TWOFISH=m
704CONFIG_CRYPTO_842=m
705CONFIG_CRYPTO_LZ4=m
706CONFIG_CRYPTO_LZ4HC=m
707CONFIG_CRYPTO_ZSTD=m
708CONFIG_CRYPTO_ANSI_CPRNG=m
709CONFIG_CRYPTO_USER_API_HASH=m
710CONFIG_CRYPTO_USER_API_SKCIPHER=m
711CONFIG_CRYPTO_USER_API_RNG=m
712CONFIG_CRYPTO_USER_API_AEAD=m
713CONFIG_CRYPTO_STATS=y
714CONFIG_ZCRYPT=m
715CONFIG_PKEY=m
716CONFIG_CRYPTO_PAES_S390=m
717CONFIG_CRYPTO_SHA1_S390=m
718CONFIG_CRYPTO_SHA256_S390=m
719CONFIG_CRYPTO_SHA512_S390=m
720CONFIG_CRYPTO_DES_S390=m
721CONFIG_CRYPTO_AES_S390=m
722CONFIG_CRYPTO_GHASH_S390=m
723CONFIG_CRYPTO_CRC32_S390=y
724CONFIG_CORDIC=m
725CONFIG_CRC32_SELFTEST=y
726CONFIG_CRC4=m
727CONFIG_CRC7=m
728CONFIG_CRC8=m
729CONFIG_RANDOM32_SELFTEST=y
730CONFIG_DMA_CMA=y
731CONFIG_CMA_SIZE_MBYTES=0
732CONFIG_DMA_API_DEBUG=y
733CONFIG_STRING_SELFTEST=y
583CONFIG_PRINTK_TIME=y734CONFIG_PRINTK_TIME=y
584CONFIG_DYNAMIC_DEBUG=y735CONFIG_DYNAMIC_DEBUG=y
585CONFIG_DEBUG_INFO=y736CONFIG_DEBUG_INFO=y
586CONFIG_DEBUG_INFO_DWARF4=y737CONFIG_DEBUG_INFO_DWARF4=y
587CONFIG_GDB_SCRIPTS=y738CONFIG_GDB_SCRIPTS=y
588CONFIG_FRAME_WARN=1024739CONFIG_FRAME_WARN=1024
589CONFIG_READABLE_ASM=y
590CONFIG_UNUSED_SYMBOLS=y740CONFIG_UNUSED_SYMBOLS=y
591CONFIG_HEADERS_INSTALL=y741CONFIG_HEADERS_INSTALL=y
592CONFIG_HEADERS_CHECK=y742CONFIG_HEADERS_CHECK=y
593CONFIG_DEBUG_SECTION_MISMATCH=y743CONFIG_DEBUG_SECTION_MISMATCH=y
594CONFIG_MAGIC_SYSRQ=y744CONFIG_MAGIC_SYSRQ=y
595CONFIG_DEBUG_PAGEALLOC=y745CONFIG_DEBUG_PAGEALLOC=y
746CONFIG_PAGE_OWNER=y
596CONFIG_DEBUG_RODATA_TEST=y747CONFIG_DEBUG_RODATA_TEST=y
597CONFIG_DEBUG_OBJECTS=y748CONFIG_DEBUG_OBJECTS=y
598CONFIG_DEBUG_OBJECTS_SELFTEST=y749CONFIG_DEBUG_OBJECTS_SELFTEST=y
@@ -645,7 +796,6 @@ CONFIG_STACK_TRACER=y · 46 unmodified lines
645CONFIG_BLK_DEV_IO_TRACE=y796CONFIG_BLK_DEV_IO_TRACE=y
646CONFIG_FUNCTION_PROFILER=y797CONFIG_FUNCTION_PROFILER=y
647CONFIG_HIST_TRIGGERS=y798CONFIG_HIST_TRIGGERS=y
648CONFIG_DMA_API_DEBUG=y
649CONFIG_LKDTM=m799CONFIG_LKDTM=m
650CONFIG_TEST_LIST_SORT=y800CONFIG_TEST_LIST_SORT=y
651CONFIG_TEST_SORT=y801CONFIG_TEST_SORT=y
@@ -657,85 +807,3 @@ CONFIG_ATOMIC64_SELFTEST=y · 5 unmodified lines
657CONFIG_TEST_BPF=m807CONFIG_TEST_BPF=m
658CONFIG_BUG_ON_DATA_CORRUPTION=y808CONFIG_BUG_ON_DATA_CORRUPTION=y
659CONFIG_S390_PTDUMP=y809CONFIG_S390_PTDUMP=y
660CONFIG_PERSISTENT_KEYRINGS=y
661CONFIG_BIG_KEYS=y
662CONFIG_ENCRYPTED_KEYS=m
663CONFIG_SECURITY=y
664CONFIG_SECURITY_NETWORK=y
665CONFIG_FORTIFY_SOURCE=y
666CONFIG_SECURITY_SELINUX=y
667CONFIG_SECURITY_SELINUX_BOOTPARAM=y
668CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
669CONFIG_SECURITY_SELINUX_DISABLE=y
670CONFIG_INTEGRITY_SIGNATURE=y
671CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y
672CONFIG_IMA=y
673CONFIG_IMA_DEFAULT_HASH_SHA256=y
674CONFIG_IMA_WRITE_POLICY=y
675CONFIG_IMA_APPRAISE=y
676CONFIG_CRYPTO_DH=m
677CONFIG_CRYPTO_ECDH=m
678CONFIG_CRYPTO_USER=m
679# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
680CONFIG_CRYPTO_PCRYPT=m
681CONFIG_CRYPTO_CRYPTD=m
682CONFIG_CRYPTO_TEST=m
683CONFIG_CRYPTO_CHACHA20POLY1305=m
684CONFIG_CRYPTO_LRW=m
685CONFIG_CRYPTO_PCBC=m
686CONFIG_CRYPTO_KEYWRAP=m
687CONFIG_CRYPTO_XCBC=m
688CONFIG_CRYPTO_VMAC=m
689CONFIG_CRYPTO_CRC32=m
690CONFIG_CRYPTO_MICHAEL_MIC=m
691CONFIG_CRYPTO_RMD128=m
692CONFIG_CRYPTO_RMD160=m
693CONFIG_CRYPTO_RMD256=m
694CONFIG_CRYPTO_RMD320=m
695CONFIG_CRYPTO_SHA512=m
696CONFIG_CRYPTO_SHA3=m
697CONFIG_CRYPTO_TGR192=m
698CONFIG_CRYPTO_WP512=m
699CONFIG_CRYPTO_AES_TI=m
700CONFIG_CRYPTO_ANUBIS=m
701CONFIG_CRYPTO_BLOWFISH=m
702CONFIG_CRYPTO_CAMELLIA=m
703CONFIG_CRYPTO_CAST5=m
704CONFIG_CRYPTO_CAST6=m
705CONFIG_CRYPTO_FCRYPT=m
706CONFIG_CRYPTO_KHAZAD=m
707CONFIG_CRYPTO_SALSA20=m
708CONFIG_CRYPTO_SEED=m
709CONFIG_CRYPTO_SERPENT=m
710CONFIG_CRYPTO_TEA=m
711CONFIG_CRYPTO_TWOFISH=m
712CONFIG_CRYPTO_842=m
713CONFIG_CRYPTO_LZ4=m
714CONFIG_CRYPTO_LZ4HC=m
715CONFIG_CRYPTO_ANSI_CPRNG=m
716CONFIG_CRYPTO_USER_API_HASH=m
717CONFIG_CRYPTO_USER_API_SKCIPHER=m
718CONFIG_CRYPTO_USER_API_RNG=m
719CONFIG_CRYPTO_USER_API_AEAD=m
720CONFIG_ZCRYPT=m
721CONFIG_PKEY=m
722CONFIG_CRYPTO_PAES_S390=m
723CONFIG_CRYPTO_SHA1_S390=m
724CONFIG_CRYPTO_SHA256_S390=m
725CONFIG_CRYPTO_SHA512_S390=m
726CONFIG_CRYPTO_DES_S390=m
727CONFIG_CRYPTO_AES_S390=m
728CONFIG_CRYPTO_GHASH_S390=m
729CONFIG_CRYPTO_CRC32_S390=y
730CONFIG_PKCS7_MESSAGE_PARSER=y
731CONFIG_SYSTEM_TRUSTED_KEYRING=y
732CONFIG_CRC7=m
733CONFIG_CRC8=m
734CONFIG_RANDOM32_SELFTEST=y
735CONFIG_CORDIC=m
736CONFIG_CMM=m
737CONFIG_APPLDATA_BASE=y
738CONFIG_KVM=m
739CONFIG_KVM_S390_UCONTROL=y
740CONFIG_VHOST_NET=m
741CONFIG_VHOST_VSOCK=m
arch/s390/configs/defconfig+150−83
@@ -12,30 +12,51 @@ CONFIG_TASK_IO_ACCOUNTING=y · 11 unmodified lines
12CONFIG_IKCONFIG=y12CONFIG_IKCONFIG=y
13CONFIG_IKCONFIG_PROC=y13CONFIG_IKCONFIG_PROC=y
14CONFIG_NUMA_BALANCING=y14CONFIG_NUMA_BALANCING=y
15# CONFIG_NUMA_BALANCING_DEFAULT_ENABLED is not set
16CONFIG_MEMCG=y15CONFIG_MEMCG=y
17CONFIG_MEMCG_SWAP=y16CONFIG_MEMCG_SWAP=y
18CONFIG_BLK_CGROUP=y17CONFIG_BLK_CGROUP=y
19CONFIG_CFS_BANDWIDTH=y18CONFIG_CFS_BANDWIDTH=y
20CONFIG_RT_GROUP_SCHED=y19CONFIG_RT_GROUP_SCHED=y
21CONFIG_CGROUP_PIDS=y20CONFIG_CGROUP_PIDS=y
21CONFIG_CGROUP_RDMA=y
22CONFIG_CGROUP_FREEZER=y22CONFIG_CGROUP_FREEZER=y
23CONFIG_CGROUP_HUGETLB=y23CONFIG_CGROUP_HUGETLB=y
24CONFIG_CPUSETS=y24CONFIG_CPUSETS=y
25CONFIG_CGROUP_DEVICE=y25CONFIG_CGROUP_DEVICE=y
26CONFIG_CGROUP_CPUACCT=y26CONFIG_CGROUP_CPUACCT=y
27CONFIG_CGROUP_PERF=y27CONFIG_CGROUP_PERF=y
28CONFIG_CGROUP_BPF=y
28CONFIG_NAMESPACES=y29CONFIG_NAMESPACES=y
29CONFIG_USER_NS=y30CONFIG_USER_NS=y
31CONFIG_CHECKPOINT_RESTORE=y
30CONFIG_SCHED_AUTOGROUP=y32CONFIG_SCHED_AUTOGROUP=y
31CONFIG_BLK_DEV_INITRD=y33CONFIG_BLK_DEV_INITRD=y
32CONFIG_EXPERT=y34CONFIG_EXPERT=y
33# CONFIG_SYSFS_SYSCALL is not set35# CONFIG_SYSFS_SYSCALL is not set
34CONFIG_CHECKPOINT_RESTORE=y
35CONFIG_BPF_SYSCALL=y36CONFIG_BPF_SYSCALL=y
36CONFIG_USERFAULTFD=y37CONFIG_USERFAULTFD=y
37# CONFIG_COMPAT_BRK is not set38# CONFIG_COMPAT_BRK is not set
38CONFIG_PROFILING=y39CONFIG_PROFILING=y
40CONFIG_LIVEPATCH=y
41CONFIG_TUNE_ZEC12=y
42CONFIG_NR_CPUS=512
43CONFIG_NUMA=y
44# CONFIG_NUMA_EMU is not set
45CONFIG_HZ_100=y
46CONFIG_KEXEC_FILE=y
47CONFIG_EXPOLINE=y
48CONFIG_EXPOLINE_AUTO=y
49CONFIG_CHSC_SCH=y
50CONFIG_VFIO_CCW=m
51CONFIG_VFIO_AP=m
52CONFIG_CRASH_DUMP=y
53CONFIG_HIBERNATION=y
54CONFIG_PM_DEBUG=y
55CONFIG_CMM=m
56CONFIG_APPLDATA_BASE=y
57CONFIG_KVM=m
58CONFIG_VHOST_NET=m
59CONFIG_VHOST_VSOCK=m
39CONFIG_OPROFILE=m60CONFIG_OPROFILE=m
40CONFIG_KPROBES=y61CONFIG_KPROBES=y
41CONFIG_JUMP_LABEL=y62CONFIG_JUMP_LABEL=y
@@ -47,27 +68,18 @@ CONFIG_MODVERSIONS=y · 5 unmodified lines
47CONFIG_MODULE_SRCVERSION_ALL=y68CONFIG_MODULE_SRCVERSION_ALL=y
48CONFIG_MODULE_SIG=y69CONFIG_MODULE_SIG=y
49CONFIG_MODULE_SIG_SHA256=y70CONFIG_MODULE_SIG_SHA256=y
50CONFIG_BLK_DEV_INTEGRITY=y
51CONFIG_BLK_DEV_THROTTLING=y71CONFIG_BLK_DEV_THROTTLING=y
52CONFIG_BLK_WBT=y72CONFIG_BLK_WBT=y
53CONFIG_BLK_WBT_SQ=y73CONFIG_BLK_CGROUP_IOLATENCY=y
54CONFIG_PARTITION_ADVANCED=y74CONFIG_PARTITION_ADVANCED=y
55CONFIG_IBM_PARTITION=y75CONFIG_IBM_PARTITION=y
56CONFIG_BSD_DISKLABEL=y76CONFIG_BSD_DISKLABEL=y
57CONFIG_MINIX_SUBPARTITION=y77CONFIG_MINIX_SUBPARTITION=y
58CONFIG_SOLARIS_X86_PARTITION=y78CONFIG_SOLARIS_X86_PARTITION=y
59CONFIG_UNIXWARE_DISKLABEL=y79CONFIG_UNIXWARE_DISKLABEL=y
60CONFIG_CFQ_GROUP_IOSCHED=y80CONFIG_IOSCHED_BFQ=y
61CONFIG_DEFAULT_DEADLINE=y81CONFIG_BFQ_GROUP_IOSCHED=y
62CONFIG_LIVEPATCH=y82CONFIG_BINFMT_MISC=m
63CONFIG_TUNE_ZEC12=y
64CONFIG_NR_CPUS=512
65CONFIG_NUMA=y
66CONFIG_HZ_100=y
67CONFIG_KEXEC_FILE=y
68CONFIG_KEXEC_VERIFY_SIG=y
69CONFIG_EXPOLINE=y
70CONFIG_EXPOLINE_AUTO=y
71CONFIG_MEMORY_HOTPLUG=y83CONFIG_MEMORY_HOTPLUG=y
72CONFIG_MEMORY_HOTREMOVE=y84CONFIG_MEMORY_HOTREMOVE=y
73CONFIG_KSM=y85CONFIG_KSM=y
@@ -81,16 +93,8 @@ CONFIG_ZSMALLOC=m · 7 unmodified lines
81CONFIG_ZSMALLOC_STAT=y93CONFIG_ZSMALLOC_STAT=y
82CONFIG_DEFERRED_STRUCT_PAGE_INIT=y94CONFIG_DEFERRED_STRUCT_PAGE_INIT=y
83CONFIG_IDLE_PAGE_TRACKING=y95CONFIG_IDLE_PAGE_TRACKING=y
84CONFIG_PCI=y96CONFIG_PERCPU_STATS=y
85CONFIG_HOTPLUG_PCI=y97CONFIG_GUP_BENCHMARK=y
86CONFIG_HOTPLUG_PCI_S390=y
87CONFIG_CHSC_SCH=y
88CONFIG_VFIO_AP=m
89CONFIG_VFIO_CCW=m
90CONFIG_CRASH_DUMP=y
91CONFIG_BINFMT_MISC=m
92CONFIG_HIBERNATION=y
93CONFIG_PM_DEBUG=y
94CONFIG_NET=y98CONFIG_NET=y
95CONFIG_PACKET=y99CONFIG_PACKET=y
96CONFIG_PACKET_DIAG=m100CONFIG_PACKET_DIAG=m
@@ -119,9 +123,6 @@ CONFIG_NET_IPVTI=m · 22 unmodified lines
119CONFIG_INET_AH=m123CONFIG_INET_AH=m
120CONFIG_INET_ESP=m124CONFIG_INET_ESP=m
121CONFIG_INET_IPCOMP=m125CONFIG_INET_IPCOMP=m
122CONFIG_INET_XFRM_MODE_TRANSPORT=m
123CONFIG_INET_XFRM_MODE_TUNNEL=m
124CONFIG_INET_XFRM_MODE_BEET=m
125CONFIG_INET_DIAG=m126CONFIG_INET_DIAG=m
126CONFIG_INET_UDP_DIAG=m127CONFIG_INET_UDP_DIAG=m
127CONFIG_TCP_CONG_ADVANCED=y128CONFIG_TCP_CONG_ADVANCED=y
@@ -137,10 +138,6 @@ CONFIG_INET6_AH=m · 9 unmodified lines
137CONFIG_INET6_ESP=m138CONFIG_INET6_ESP=m
138CONFIG_INET6_IPCOMP=m139CONFIG_INET6_IPCOMP=m
139CONFIG_IPV6_MIP6=m140CONFIG_IPV6_MIP6=m
140CONFIG_INET6_XFRM_MODE_TRANSPORT=m
141CONFIG_INET6_XFRM_MODE_TUNNEL=m
142CONFIG_INET6_XFRM_MODE_BEET=m
143CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
144CONFIG_IPV6_VTI=m141CONFIG_IPV6_VTI=m
145CONFIG_IPV6_SIT=m142CONFIG_IPV6_SIT=m
146CONFIG_IPV6_GRE=m143CONFIG_IPV6_GRE=m
@@ -262,11 +259,8 @@ CONFIG_IP_VS_SED=m · 115 unmodified lines
262CONFIG_IP_VS_NQ=m259CONFIG_IP_VS_NQ=m
263CONFIG_IP_VS_FTP=m260CONFIG_IP_VS_FTP=m
264CONFIG_IP_VS_PE_SIP=m261CONFIG_IP_VS_PE_SIP=m
265CONFIG_NF_CONNTRACK_IPV4=m
266CONFIG_NF_TABLES_IPV4=y262CONFIG_NF_TABLES_IPV4=y
267CONFIG_NFT_CHAIN_ROUTE_IPV4=m
268CONFIG_NF_TABLES_ARP=y263CONFIG_NF_TABLES_ARP=y
269CONFIG_NFT_CHAIN_NAT_IPV4=m
270CONFIG_IP_NF_IPTABLES=m264CONFIG_IP_NF_IPTABLES=m
271CONFIG_IP_NF_MATCH_AH=m265CONFIG_IP_NF_MATCH_AH=m
272CONFIG_IP_NF_MATCH_ECN=m266CONFIG_IP_NF_MATCH_ECN=m
@@ -285,10 +279,7 @@ CONFIG_IP_NF_SECURITY=m · 12 unmodified lines
285CONFIG_IP_NF_ARPTABLES=m279CONFIG_IP_NF_ARPTABLES=m
286CONFIG_IP_NF_ARPFILTER=m280CONFIG_IP_NF_ARPFILTER=m
287CONFIG_IP_NF_ARP_MANGLE=m281CONFIG_IP_NF_ARP_MANGLE=m
288CONFIG_NF_CONNTRACK_IPV6=m
289CONFIG_NF_TABLES_IPV6=y282CONFIG_NF_TABLES_IPV6=y
290CONFIG_NFT_CHAIN_ROUTE_IPV6=m
291CONFIG_NFT_CHAIN_NAT_IPV6=m
292CONFIG_IP6_NF_IPTABLES=m283CONFIG_IP6_NF_IPTABLES=m
293CONFIG_IP6_NF_MATCH_AH=m284CONFIG_IP6_NF_MATCH_AH=m
294CONFIG_IP6_NF_MATCH_EUI64=m285CONFIG_IP6_NF_MATCH_EUI64=m
@@ -307,7 +298,7 @@ CONFIG_IP6_NF_RAW=m · 12 unmodified lines
307CONFIG_IP6_NF_SECURITY=m298CONFIG_IP6_NF_SECURITY=m
308CONFIG_IP6_NF_NAT=m299CONFIG_IP6_NF_NAT=m
309CONFIG_IP6_NF_TARGET_MASQUERADE=m300CONFIG_IP6_NF_TARGET_MASQUERADE=m
310CONFIG_NF_TABLES_BRIDGE=y301CONFIG_NF_TABLES_BRIDGE=m
311CONFIG_RDS=m302CONFIG_RDS=m
312CONFIG_RDS_RDMA=m303CONFIG_RDS_RDMA=m
313CONFIG_RDS_TCP=m304CONFIG_RDS_TCP=m
@@ -372,9 +363,11 @@ CONFIG_NETLINK_DIAG=m · 58 unmodified lines
372CONFIG_CGROUP_NET_PRIO=y363CONFIG_CGROUP_NET_PRIO=y
373CONFIG_BPF_JIT=y364CONFIG_BPF_JIT=y
374CONFIG_NET_PKTGEN=m365CONFIG_NET_PKTGEN=m
366CONFIG_PCI=y
367CONFIG_HOTPLUG_PCI=y
368CONFIG_HOTPLUG_PCI_S390=y
369CONFIG_UEVENT_HELPER=y
375CONFIG_DEVTMPFS=y370CONFIG_DEVTMPFS=y
376CONFIG_DMA_CMA=y
377CONFIG_CMA_SIZE_MBYTES=0
378CONFIG_CONNECTOR=y371CONFIG_CONNECTOR=y
379CONFIG_ZRAM=m372CONFIG_ZRAM=m
380CONFIG_BLK_DEV_LOOP=m373CONFIG_BLK_DEV_LOOP=m
@@ -383,6 +376,7 @@ CONFIG_BLK_DEV_DRBD=m · 2 unmodified lines
383CONFIG_BLK_DEV_NBD=m376CONFIG_BLK_DEV_NBD=m
384CONFIG_BLK_DEV_RAM=y377CONFIG_BLK_DEV_RAM=y
385CONFIG_BLK_DEV_RAM_SIZE=32768378CONFIG_BLK_DEV_RAM_SIZE=32768
379# CONFIG_BLK_DEV_XPRAM is not set
386CONFIG_VIRTIO_BLK=y380CONFIG_VIRTIO_BLK=y
387CONFIG_BLK_DEV_RBD=m381CONFIG_BLK_DEV_RBD=m
388CONFIG_BLK_DEV_NVME=m382CONFIG_BLK_DEV_NVME=m
@@ -392,7 +386,6 @@ CONFIG_RAID_ATTRS=m · 3 unmodified lines
392CONFIG_SCSI=y386CONFIG_SCSI=y
393CONFIG_BLK_DEV_SD=y387CONFIG_BLK_DEV_SD=y
394CONFIG_CHR_DEV_ST=m388CONFIG_CHR_DEV_ST=m
395CONFIG_CHR_DEV_OSST=m
396CONFIG_BLK_DEV_SR=m389CONFIG_BLK_DEV_SR=m
397CONFIG_CHR_DEV_SG=y390CONFIG_CHR_DEV_SG=y
398CONFIG_CHR_DEV_SCH=m391CONFIG_CHR_DEV_SCH=m
@@ -412,17 +405,19 @@ CONFIG_SCSI_DH_RDAC=m · 13 unmodified lines
412CONFIG_SCSI_DH_HP_SW=m405CONFIG_SCSI_DH_HP_SW=m
413CONFIG_SCSI_DH_EMC=m406CONFIG_SCSI_DH_EMC=m
414CONFIG_SCSI_DH_ALUA=m407CONFIG_SCSI_DH_ALUA=m
415CONFIG_SCSI_OSD_INITIATOR=m
416CONFIG_SCSI_OSD_ULD=m
417CONFIG_MD=y408CONFIG_MD=y
418CONFIG_BLK_DEV_MD=y409CONFIG_BLK_DEV_MD=y
419CONFIG_MD_LINEAR=m410CONFIG_MD_LINEAR=m
420CONFIG_MD_MULTIPATH=m411CONFIG_MD_MULTIPATH=m
421CONFIG_MD_FAULTY=m412CONFIG_MD_FAULTY=m
413CONFIG_MD_CLUSTER=m
414CONFIG_BCACHE=m
422CONFIG_BLK_DEV_DM=m415CONFIG_BLK_DEV_DM=m
416CONFIG_DM_UNSTRIPED=m
423CONFIG_DM_CRYPT=m417CONFIG_DM_CRYPT=m
424CONFIG_DM_SNAPSHOT=m418CONFIG_DM_SNAPSHOT=m
425CONFIG_DM_THIN_PROVISIONING=m419CONFIG_DM_THIN_PROVISIONING=m
420CONFIG_DM_WRITECACHE=m
426CONFIG_DM_MIRROR=m421CONFIG_DM_MIRROR=m
427CONFIG_DM_LOG_USERSPACE=m422CONFIG_DM_LOG_USERSPACE=m
428CONFIG_DM_RAID=m423CONFIG_DM_RAID=m
@@ -435,6 +430,7 @@ CONFIG_DM_UEVENT=y · 6 unmodified lines
435CONFIG_DM_FLAKEY=m430CONFIG_DM_FLAKEY=m
436CONFIG_DM_VERITY=m431CONFIG_DM_VERITY=m
437CONFIG_DM_SWITCH=m432CONFIG_DM_SWITCH=m
433CONFIG_DM_INTEGRITY=m
438CONFIG_NETDEVICES=y434CONFIG_NETDEVICES=y
439CONFIG_BONDING=m435CONFIG_BONDING=m
440CONFIG_DUMMY=m436CONFIG_DUMMY=m
@@ -442,23 +438,78 @@ CONFIG_EQUALIZER=m · 1 unmodified line
442CONFIG_IFB=m438CONFIG_IFB=m
443CONFIG_MACVLAN=m439CONFIG_MACVLAN=m
444CONFIG_MACVTAP=m440CONFIG_MACVTAP=m
445CONFIG_VXLAN=m
446CONFIG_TUN=m441CONFIG_TUN=m
447CONFIG_VETH=m442CONFIG_VETH=m
448CONFIG_VIRTIO_NET=m443CONFIG_VIRTIO_NET=m
449CONFIG_NLMON=m444CONFIG_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
450# CONFIG_NET_VENDOR_ARC is not set453# 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
451# CONFIG_NET_VENDOR_CHELSIO is not set460# 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
452# CONFIG_NET_VENDOR_INTEL is not set470# CONFIG_NET_VENDOR_INTEL is not set
453# CONFIG_NET_VENDOR_MARVELL is not set471# CONFIG_NET_VENDOR_MARVELL is not set
454CONFIG_MLX4_EN=m472CONFIG_MLX4_EN=m
455CONFIG_MLX5_CORE=m473CONFIG_MLX5_CORE=m
456CONFIG_MLX5_CORE_EN=y474CONFIG_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
457# CONFIG_NET_VENDOR_NATSEMI is not set480# 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
458CONFIG_PPP=m507CONFIG_PPP=m
459CONFIG_PPP_BSDCOMP=m508CONFIG_PPP_BSDCOMP=m
460CONFIG_PPP_DEFLATE=m509CONFIG_PPP_DEFLATE=m
510CONFIG_PPP_FILTER=y
461CONFIG_PPP_MPPE=m511CONFIG_PPP_MPPE=m
512CONFIG_PPP_MULTILINK=y
462CONFIG_PPPOE=m513CONFIG_PPPOE=m
463CONFIG_PPTP=m514CONFIG_PPTP=m
464CONFIG_PPPOL2TP=m515CONFIG_PPPOL2TP=m
@@ -470,17 +521,21 @@ CONFIG_INPUT_EVDEV=y · 5 unmodified lines
470# CONFIG_INPUT_MOUSE is not set521# CONFIG_INPUT_MOUSE is not set
471# CONFIG_SERIO is not set522# CONFIG_SERIO is not set
472CONFIG_LEGACY_PTY_COUNT=0523CONFIG_LEGACY_PTY_COUNT=0
524CONFIG_NULL_TTY=m
473CONFIG_HW_RANDOM_VIRTIO=m525CONFIG_HW_RANDOM_VIRTIO=m
474CONFIG_RAW_DRIVER=m526CONFIG_RAW_DRIVER=m
475CONFIG_HANGCHECK_TIMER=m527CONFIG_HANGCHECK_TIMER=m
476CONFIG_TN3270_FS=y528CONFIG_TN3270_FS=y
529# CONFIG_PTP_1588_CLOCK is not set
477# CONFIG_HWMON is not set530# CONFIG_HWMON is not set
478CONFIG_WATCHDOG=y531CONFIG_WATCHDOG=y
532CONFIG_WATCHDOG_CORE=y
479CONFIG_WATCHDOG_NOWAYOUT=y533CONFIG_WATCHDOG_NOWAYOUT=y
480CONFIG_SOFT_WATCHDOG=m534CONFIG_SOFT_WATCHDOG=m
481CONFIG_DIAG288_WATCHDOG=m535CONFIG_DIAG288_WATCHDOG=m
482CONFIG_DRM=y536CONFIG_DRM=y
483CONFIG_DRM_VIRTIO_GPU=y537CONFIG_DRM_VIRTIO_GPU=y
538# CONFIG_BACKLIGHT_CLASS_DEVICE is not set
484CONFIG_FRAMEBUFFER_CONSOLE=y539CONFIG_FRAMEBUFFER_CONSOLE=y
485# CONFIG_HID is not set540# CONFIG_HID is not set
486# CONFIG_USB_SUPPORT is not set541# CONFIG_USB_SUPPORT is not set
@@ -495,8 +550,8 @@ CONFIG_VFIO_MDEV_DEVICE=m · 8 unmodified lines
495CONFIG_VIRTIO_PCI=m550CONFIG_VIRTIO_PCI=m
496CONFIG_VIRTIO_BALLOON=m551CONFIG_VIRTIO_BALLOON=m
497CONFIG_VIRTIO_INPUT=y552CONFIG_VIRTIO_INPUT=y
498CONFIG_S390_AP_IOMMU=y
499CONFIG_S390_CCW_IOMMU=y553CONFIG_S390_CCW_IOMMU=y
554CONFIG_S390_AP_IOMMU=y
500CONFIG_EXT4_FS=y555CONFIG_EXT4_FS=y
501CONFIG_EXT4_FS_POSIX_ACL=y556CONFIG_EXT4_FS_POSIX_ACL=y
502CONFIG_EXT4_FS_SECURITY=y557CONFIG_EXT4_FS_SECURITY=y
@@ -546,8 +601,10 @@ CONFIG_ECRYPT_FS=m · 43 unmodified lines
546CONFIG_CRAMFS=m601CONFIG_CRAMFS=m
547CONFIG_SQUASHFS=m602CONFIG_SQUASHFS=m
548CONFIG_SQUASHFS_XATTR=y603CONFIG_SQUASHFS_XATTR=y
604CONFIG_SQUASHFS_LZ4=y
549CONFIG_SQUASHFS_LZO=y605CONFIG_SQUASHFS_LZO=y
550CONFIG_SQUASHFS_XZ=y606CONFIG_SQUASHFS_XZ=y
607CONFIG_SQUASHFS_ZSTD=y
551CONFIG_ROMFS_FS=m608CONFIG_ROMFS_FS=m
552CONFIG_NFS_FS=m609CONFIG_NFS_FS=m
553CONFIG_NFS_V3_ACL=y610CONFIG_NFS_V3_ACL=y
@@ -558,7 +615,6 @@ CONFIG_NFSD_V3_ACL=y · 4 unmodified lines
558CONFIG_NFSD_V4=y615CONFIG_NFSD_V4=y
559CONFIG_NFSD_V4_SECURITY_LABEL=y616CONFIG_NFSD_V4_SECURITY_LABEL=y
560CONFIG_CIFS=m617CONFIG_CIFS=m
561CONFIG_CIFS_STATS=y
562CONFIG_CIFS_STATS2=y618CONFIG_CIFS_STATS2=y
563CONFIG_CIFS_WEAK_PW_HASH=y619CONFIG_CIFS_WEAK_PW_HASH=y
564CONFIG_CIFS_UPCALL=y620CONFIG_CIFS_UPCALL=y
@@ -574,31 +630,7 @@ CONFIG_NLS_ISO8859_1=m · 9 unmodified lines
574CONFIG_NLS_ISO8859_15=m630CONFIG_NLS_ISO8859_15=m
575CONFIG_NLS_UTF8=m631CONFIG_NLS_UTF8=m
576CONFIG_DLM=m632CONFIG_DLM=m
577CONFIG_PRINTK_TIME=y633CONFIG_UNICODE=y
578CONFIG_DEBUG_INFO=y
579CONFIG_DEBUG_INFO_DWARF4=y
580CONFIG_GDB_SCRIPTS=y
581# CONFIG_ENABLE_MUST_CHECK is not set
582CONFIG_FRAME_WARN=1024
583CONFIG_UNUSED_SYMBOLS=y
584CONFIG_MAGIC_SYSRQ=y
585CONFIG_DEBUG_MEMORY_INIT=y
586CONFIG_PANIC_ON_OOPS=y
587CONFIG_RCU_TORTURE_TEST=m
588CONFIG_RCU_CPU_STALL_TIMEOUT=60
589CONFIG_LATENCYTOP=y
590CONFIG_SCHED_TRACER=y
591CONFIG_FTRACE_SYSCALLS=y
592CONFIG_STACK_TRACER=y
593CONFIG_BLK_DEV_IO_TRACE=y
594CONFIG_FUNCTION_PROFILER=y
595CONFIG_HIST_TRIGGERS=y
596CONFIG_LKDTM=m
597CONFIG_PERCPU_TEST=m
598CONFIG_ATOMIC64_SELFTEST=y
599CONFIG_TEST_BPF=m
600CONFIG_BUG_ON_DATA_CORRUPTION=y
601CONFIG_S390_PTDUMP=y
602CONFIG_PERSISTENT_KEYRINGS=y634CONFIG_PERSISTENT_KEYRINGS=y
603CONFIG_BIG_KEYS=y635CONFIG_BIG_KEYS=y
604CONFIG_ENCRYPTED_KEYS=m636CONFIG_ENCRYPTED_KEYS=m
@@ -606,7 +638,6 @@ CONFIG_SECURITY=y · 1 unmodified line
606CONFIG_SECURITY_NETWORK=y638CONFIG_SECURITY_NETWORK=y
607CONFIG_SECURITY_SELINUX=y639CONFIG_SECURITY_SELINUX=y
608CONFIG_SECURITY_SELINUX_BOOTPARAM=y640CONFIG_SECURITY_SELINUX_BOOTPARAM=y
609CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
610CONFIG_SECURITY_SELINUX_DISABLE=y641CONFIG_SECURITY_SELINUX_DISABLE=y
611CONFIG_INTEGRITY_SIGNATURE=y642CONFIG_INTEGRITY_SIGNATURE=y
612CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y643CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y
@@ -615,31 +646,42 @@ CONFIG_IMA_DEFAULT_HASH_SHA256=y · 2 unmodified lines
615CONFIG_IMA_WRITE_POLICY=y646CONFIG_IMA_WRITE_POLICY=y
616CONFIG_IMA_APPRAISE=y647CONFIG_IMA_APPRAISE=y
617CONFIG_CRYPTO_FIPS=y648CONFIG_CRYPTO_FIPS=y
618CONFIG_CRYPTO_DH=m
619CONFIG_CRYPTO_ECDH=m
620CONFIG_CRYPTO_USER=m649CONFIG_CRYPTO_USER=m
621# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set650# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
622CONFIG_CRYPTO_PCRYPT=m651CONFIG_CRYPTO_PCRYPT=m
623CONFIG_CRYPTO_CRYPTD=m652CONFIG_CRYPTO_CRYPTD=m
624CONFIG_CRYPTO_TEST=m653CONFIG_CRYPTO_TEST=m
654CONFIG_CRYPTO_DH=m
655CONFIG_CRYPTO_ECDH=m
656CONFIG_CRYPTO_ECRDSA=m
625CONFIG_CRYPTO_CHACHA20POLY1305=m657CONFIG_CRYPTO_CHACHA20POLY1305=m
658CONFIG_CRYPTO_AEGIS128=m
659CONFIG_CRYPTO_AEGIS128L=m
660CONFIG_CRYPTO_AEGIS256=m
661CONFIG_CRYPTO_MORUS640=m
662CONFIG_CRYPTO_MORUS1280=m
663CONFIG_CRYPTO_CFB=m
626CONFIG_CRYPTO_LRW=m664CONFIG_CRYPTO_LRW=m
665CONFIG_CRYPTO_OFB=m
627CONFIG_CRYPTO_PCBC=m666CONFIG_CRYPTO_PCBC=m
628CONFIG_CRYPTO_KEYWRAP=m667CONFIG_CRYPTO_KEYWRAP=m
668CONFIG_CRYPTO_ADIANTUM=m
629CONFIG_CRYPTO_XCBC=m669CONFIG_CRYPTO_XCBC=m
630CONFIG_CRYPTO_VMAC=m670CONFIG_CRYPTO_VMAC=m
631CONFIG_CRYPTO_CRC32=m671CONFIG_CRYPTO_CRC32=m
672CONFIG_CRYPTO_XXHASH=m
632CONFIG_CRYPTO_MICHAEL_MIC=m673CONFIG_CRYPTO_MICHAEL_MIC=m
633CONFIG_CRYPTO_RMD128=m674CONFIG_CRYPTO_RMD128=m
634CONFIG_CRYPTO_RMD160=m675CONFIG_CRYPTO_RMD160=m
635CONFIG_CRYPTO_RMD256=m676CONFIG_CRYPTO_RMD256=m
636CONFIG_CRYPTO_RMD320=m677CONFIG_CRYPTO_RMD320=m
637CONFIG_CRYPTO_SHA512=m
638CONFIG_CRYPTO_SHA3=m678CONFIG_CRYPTO_SHA3=m
679CONFIG_CRYPTO_SM3=m
639CONFIG_CRYPTO_TGR192=m680CONFIG_CRYPTO_TGR192=m
640CONFIG_CRYPTO_WP512=m681CONFIG_CRYPTO_WP512=m
641CONFIG_CRYPTO_AES_TI=m682CONFIG_CRYPTO_AES_TI=m
642CONFIG_CRYPTO_ANUBIS=m683CONFIG_CRYPTO_ANUBIS=m
684CONFIG_CRYPTO_ARC4=m
643CONFIG_CRYPTO_BLOWFISH=m685CONFIG_CRYPTO_BLOWFISH=m
644CONFIG_CRYPTO_CAMELLIA=m686CONFIG_CRYPTO_CAMELLIA=m
645CONFIG_CRYPTO_CAST5=m687CONFIG_CRYPTO_CAST5=m
@@ -649,16 +691,19 @@ CONFIG_CRYPTO_KHAZAD=m · 3 unmodified lines
649CONFIG_CRYPTO_SALSA20=m691CONFIG_CRYPTO_SALSA20=m
650CONFIG_CRYPTO_SEED=m692CONFIG_CRYPTO_SEED=m
651CONFIG_CRYPTO_SERPENT=m693CONFIG_CRYPTO_SERPENT=m
694CONFIG_CRYPTO_SM4=m
652CONFIG_CRYPTO_TEA=m695CONFIG_CRYPTO_TEA=m
653CONFIG_CRYPTO_TWOFISH=m696CONFIG_CRYPTO_TWOFISH=m
654CONFIG_CRYPTO_842=m697CONFIG_CRYPTO_842=m
655CONFIG_CRYPTO_LZ4=m698CONFIG_CRYPTO_LZ4=m
656CONFIG_CRYPTO_LZ4HC=m699CONFIG_CRYPTO_LZ4HC=m
700CONFIG_CRYPTO_ZSTD=m
657CONFIG_CRYPTO_ANSI_CPRNG=m701CONFIG_CRYPTO_ANSI_CPRNG=m
658CONFIG_CRYPTO_USER_API_HASH=m702CONFIG_CRYPTO_USER_API_HASH=m
659CONFIG_CRYPTO_USER_API_SKCIPHER=m703CONFIG_CRYPTO_USER_API_SKCIPHER=m
660CONFIG_CRYPTO_USER_API_RNG=m704CONFIG_CRYPTO_USER_API_RNG=m
661CONFIG_CRYPTO_USER_API_AEAD=m705CONFIG_CRYPTO_USER_API_AEAD=m
706CONFIG_CRYPTO_STATS=y
662CONFIG_ZCRYPT=m707CONFIG_ZCRYPT=m
663CONFIG_PKEY=m708CONFIG_PKEY=m
664CONFIG_CRYPTO_PAES_S390=m709CONFIG_CRYPTO_PAES_S390=m
@@ -669,12 +714,34 @@ CONFIG_CRYPTO_DES_S390=m · 4 unmodified lines
669CONFIG_CRYPTO_AES_S390=m714CONFIG_CRYPTO_AES_S390=m
670CONFIG_CRYPTO_GHASH_S390=m715CONFIG_CRYPTO_GHASH_S390=m
671CONFIG_CRYPTO_CRC32_S390=y716CONFIG_CRYPTO_CRC32_S390=y
717CONFIG_CORDIC=m
718CONFIG_CRC4=m
672CONFIG_CRC7=m719CONFIG_CRC7=m
673CONFIG_CRC8=m720CONFIG_CRC8=m
674CONFIG_CORDIC=m721CONFIG_DMA_CMA=y
675CONFIG_CMM=m722CONFIG_CMA_SIZE_MBYTES=0
676CONFIG_APPLDATA_BASE=y723CONFIG_PRINTK_TIME=y
677CONFIG_KVM=m724CONFIG_DEBUG_INFO=y
678CONFIG_KVM_S390_UCONTROL=y725CONFIG_DEBUG_INFO_DWARF4=y
679CONFIG_VHOST_NET=m726CONFIG_GDB_SCRIPTS=y
680CONFIG_VHOST_VSOCK=m727CONFIG_FRAME_WARN=1024
728CONFIG_UNUSED_SYMBOLS=y
729CONFIG_DEBUG_SECTION_MISMATCH=y
730CONFIG_MAGIC_SYSRQ=y
731CONFIG_DEBUG_MEMORY_INIT=y
732CONFIG_PANIC_ON_OOPS=y
733CONFIG_RCU_TORTURE_TEST=m
734CONFIG_RCU_CPU_STALL_TIMEOUT=60
735CONFIG_LATENCYTOP=y
736CONFIG_SCHED_TRACER=y
737CONFIG_FTRACE_SYSCALLS=y
738CONFIG_STACK_TRACER=y
739CONFIG_BLK_DEV_IO_TRACE=y
740CONFIG_FUNCTION_PROFILER=y
741CONFIG_HIST_TRIGGERS=y
742CONFIG_LKDTM=m
743CONFIG_PERCPU_TEST=m
744CONFIG_ATOMIC64_SELFTEST=y
745CONFIG_TEST_BPF=m
746CONFIG_BUG_ON_DATA_CORRUPTION=y
747CONFIG_S390_PTDUMP=y
arch/s390/configs/zfcpdump_defconfig+17−14
@@ -1,27 +1,33 @@
1# CONFIG_SWAP is not set1# CONFIG_SWAP is not set
2CONFIG_NO_HZ_IDLE=y2CONFIG_NO_HZ_IDLE=y
3CONFIG_HIGH_RES_TIMERS=y3CONFIG_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
4CONFIG_BLK_DEV_INITRD=y8CONFIG_BLK_DEV_INITRD=y
5CONFIG_CC_OPTIMIZE_FOR_SIZE=y9CONFIG_CC_OPTIMIZE_FOR_SIZE=y
6# CONFIG_COMPAT_BRK is not set10# CONFIG_COMPAT_BRK is not set
7CONFIG_PARTITION_ADVANCED=y
8CONFIG_IBM_PARTITION=y
9CONFIG_DEFAULT_DEADLINE=y
10CONFIG_TUNE_ZEC12=y11CONFIG_TUNE_ZEC12=y
11# CONFIG_COMPAT is not set12# CONFIG_COMPAT is not set
12CONFIG_NR_CPUS=213CONFIG_NR_CPUS=2
13# CONFIG_HOTPLUG_CPU is not set
14CONFIG_HZ_100=y14CONFIG_HZ_100=y
15# CONFIG_ARCH_RANDOM is not set15# CONFIG_ARCH_RANDOM is not set
16# CONFIG_COMPACTION is not set16# CONFIG_RELOCATABLE is not set
17# CONFIG_MIGRATION is not set
18# CONFIG_BOUNCE is not set
19# CONFIG_CHECK_STACK is not set
20# CONFIG_CHSC_SCH is not set17# CONFIG_CHSC_SCH is not set
21# CONFIG_SCM_BUS is not set18# CONFIG_SCM_BUS is not set
22CONFIG_CRASH_DUMP=y19CONFIG_CRASH_DUMP=y
23# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
24# CONFIG_SECCOMP is not set20# 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
25CONFIG_PARTITION_ADVANCED=y
26CONFIG_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
25CONFIG_NET=y31CONFIG_NET=y
26# CONFIG_IUCV is not set32# CONFIG_IUCV is not set
27CONFIG_DEVTMPFS=y33CONFIG_DEVTMPFS=y
@@ -43,7 +49,6 @@ CONFIG_ZFCP=y · 15 unmodified lines
43# CONFIG_HVC_IUCV is not set49# CONFIG_HVC_IUCV is not set
44# CONFIG_HW_RANDOM_S390 is not set50# CONFIG_HW_RANDOM_S390 is not set
45CONFIG_RAW_DRIVER=y51CONFIG_RAW_DRIVER=y
46# CONFIG_SCLP_ASYNC is not set
47# CONFIG_HMC_DRV is not set52# CONFIG_HMC_DRV is not set
48# CONFIG_S390_TAPE is not set53# CONFIG_S390_TAPE is not set
49# CONFIG_VMCP is not set54# CONFIG_VMCP is not set
@@ -56,6 +61,7 @@ CONFIG_RAW_DRIVER=y · 6 unmodified lines
56CONFIG_CONFIGFS_FS=y61CONFIG_CONFIGFS_FS=y
57# CONFIG_MISC_FILESYSTEMS is not set62# CONFIG_MISC_FILESYSTEMS is not set
58# CONFIG_NETWORK_FILESYSTEMS is not set63# CONFIG_NETWORK_FILESYSTEMS is not set
64# CONFIG_DIMLIB is not set
59CONFIG_PRINTK_TIME=y65CONFIG_PRINTK_TIME=y
60CONFIG_DEBUG_INFO=y66CONFIG_DEBUG_INFO=y
61CONFIG_DEBUG_FS=y67CONFIG_DEBUG_FS=y
@@ -64,7 +70,4 @@ CONFIG_PANIC_ON_OOPS=y · 2 unmodified lines
64# CONFIG_SCHED_DEBUG is not set70# CONFIG_SCHED_DEBUG is not set
65CONFIG_RCU_CPU_STALL_TIMEOUT=6071CONFIG_RCU_CPU_STALL_TIMEOUT=60
66# CONFIG_FTRACE is not set72# CONFIG_FTRACE is not set
67# CONFIG_PFAULT is not set73# CONFIG_RUNTIME_TESTING_MENU is not set
68# CONFIG_S390_HYPFS_FS is not set
69# CONFIG_VIRTUALIZATION is not set
70# CONFIG_S390_GUEST is not set
arch/s390/include/asm/qdio.h+5−5
@@ -28,7 +28,7 @@ · 27 unmodified lines
28 * @sliba: storage list information block address28 * @sliba: storage list information block address
29 * @sla: storage list address29 * @sla: storage list address
30 * @slsba: storage list state block address30 * @slsba: storage list state block address
31 * @akey: access key for DLIB31 * @akey: access key for SLIB
32 * @bkey: access key for SL32 * @bkey: access key for SL
33 * @ckey: access key for SBALs33 * @ckey: access key for SBALs
34 * @dkey: access key for SLSB34 * @dkey: access key for SLSB
@@ -50,11 +50,10 @@ struct qdesfmt0 { · 15 unmodified lines
50/**50/**
51 * struct qdr - queue description record (QDR)51 * struct qdr - queue description record (QDR)
52 * @qfmt: queue format52 * @qfmt: queue format
53 * @pfmt: implementation dependent parameter format
54 * @ac: adapter characteristics53 * @ac: adapter characteristics
55 * @iqdcnt: input queue descriptor count54 * @iqdcnt: input queue descriptor count
56 * @oqdcnt: output queue descriptor count55 * @oqdcnt: output queue descriptor count
57 * @iqdsz: inpout queue descriptor size56 * @iqdsz: input queue descriptor size
58 * @oqdsz: output queue descriptor size57 * @oqdsz: output queue descriptor size
59 * @qiba: queue information block address58 * @qiba: queue information block address
60 * @qkey: queue information block key59 * @qkey: queue information block key
@@ -62,8 +61,7 @@ struct qdesfmt0 { · 1 unmodified line
62 */61 */
63struct qdr {62struct qdr {
64 u32 qfmt : 8;63 u32 qfmt : 8;
65 u32 pfmt : 8;64 u32 : 16;
66 u32 : 8;
67 u32 ac : 8;65 u32 ac : 8;
68 u32 : 8;66 u32 : 8;
69 u32 iqdcnt : 8;67 u32 iqdcnt : 8;
@@ -327,6 +325,7 @@ typedef void qdio_handler_t(struct ccw_device *, unsigned int, int, · 257 unmodified lines
327 * struct qdio_initialize - qdio initialization data325 * struct qdio_initialize - qdio initialization data
328 * @cdev: associated ccw device326 * @cdev: associated ccw device
329 * @q_format: queue format327 * @q_format: queue format
328 * @qdr_ac: feature flags to set
330 * @adapter_name: name for the adapter329 * @adapter_name: name for the adapter
331 * @qib_param_field_format: format for qib_parm_field330 * @qib_param_field_format: format for qib_parm_field
332 * @qib_param_field: pointer to 128 bytes or NULL, if no param field331 * @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
338 * @input_handler: handler to be called for input queues337 * @input_handler: handler to be called for input queues
339 * @output_handler: handler to be called for output queues338 * @output_handler: handler to be called for output queues
340 * @queue_start_poll_array: polling handlers (one per input queue or NULL)339 * @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
341 * @int_parm: interruption parameter341 * @int_parm: interruption parameter
342 * @input_sbal_addr_array: address of no_input_qs * 128 pointers342 * @input_sbal_addr_array: address of no_input_qs * 128 pointers
343 * @output_sbal_addr_array: address of no_output_qs * 128 pointers343 * @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
84extern int memory_end_set;84extern int memory_end_set;
85extern unsigned long memory_end;85extern unsigned long memory_end;
86extern unsigned long max_physmem_end;86extern unsigned long max_physmem_end;
87extern unsigned long __swsusp_reset_dma;
87 88
88#define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM)89#define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM)
89#define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM)90#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
114 * If it comes up a second time then there's something wrong going on:114 * If it comes up a second time then there's something wrong going on:
115 * just break out and report an unknown stack type.115 * just break out and report an unknown stack type.
116 */116 */
117 if (*visit_mask & (1UL << info->type)) {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);
121 goto unknown;118 goto unknown;
122 }
123 *visit_mask |= 1UL << info->type;119 *visit_mask |= 1UL << info->type;
124 return 0;120 return 0;
125unknown:121unknown:
arch/s390/kernel/head64.S+0−7
@@ -60,12 +60,5 @@ ENTRY(startup_continue) · 59 unmodified lines
60 60
61 .align 1661 .align 16
62.LPG1:62.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
70.Ldw: .quad 0x0002000180000000,0x000000000000000063.Ldw: .quad 0x0002000180000000,0x0000000000000000
71.Laregs:.long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,064.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
31#include <asm/os_info.h>31#include <asm/os_info.h>
32#include <asm/sections.h>32#include <asm/sections.h>
33#include <asm/boot_data.h>33#include <asm/boot_data.h>
34#include <asm/uv.h>
35#include "entry.h"34#include "entry.h"
36 35
37#define IPL_PARM_BLOCK_VERSION 036#define IPL_PARM_BLOCK_VERSION 0
@@ -892,21 +891,15 @@ static void __reipl_run(void *unused) · 854 unmodified lines
892{891{
893 switch (reipl_type) {892 switch (reipl_type) {
894 case IPL_TYPE_CCW:893 case IPL_TYPE_CCW:
895 uv_set_shared(__pa(reipl_block_ccw));
896 diag308(DIAG308_SET, reipl_block_ccw);894 diag308(DIAG308_SET, reipl_block_ccw);
897 uv_remove_shared(__pa(reipl_block_ccw));
898 diag308(DIAG308_LOAD_CLEAR, NULL);895 diag308(DIAG308_LOAD_CLEAR, NULL);
899 break;896 break;
900 case IPL_TYPE_FCP:897 case IPL_TYPE_FCP:
901 uv_set_shared(__pa(reipl_block_fcp));
902 diag308(DIAG308_SET, reipl_block_fcp);898 diag308(DIAG308_SET, reipl_block_fcp);
903 uv_remove_shared(__pa(reipl_block_fcp));
904 diag308(DIAG308_LOAD_CLEAR, NULL);899 diag308(DIAG308_LOAD_CLEAR, NULL);
905 break;900 break;
906 case IPL_TYPE_NSS:901 case IPL_TYPE_NSS:
907 uv_set_shared(__pa(reipl_block_nss));
908 diag308(DIAG308_SET, reipl_block_nss);902 diag308(DIAG308_SET, reipl_block_nss);
909 uv_remove_shared(__pa(reipl_block_nss));
910 diag308(DIAG308_LOAD_CLEAR, NULL);903 diag308(DIAG308_LOAD_CLEAR, NULL);
911 break;904 break;
912 case IPL_TYPE_UNKNOWN:905 case IPL_TYPE_UNKNOWN:
@@ -1176,9 +1169,7 @@ static struct kset *dump_kset; · 263 unmodified lines
1176 1169
1177static void diag308_dump(void *dump_block)1170static void diag308_dump(void *dump_block)
1178{1171{
1179 uv_set_shared(__pa(dump_block));
1180 diag308(DIAG308_SET, dump_block);1172 diag308(DIAG308_SET, dump_block);
1181 uv_remove_shared(__pa(dump_block));
1182 while (1) {1173 while (1) {
1183 if (diag308(DIAG308_LOAD_NORMAL_DUMP, NULL) != 0x302)1174 if (diag308(DIAG308_LOAD_NORMAL_DUMP, NULL) != 0x302)
1184 break;1175 break;
arch/s390/kernel/machine_kexec_reloc.c+1−0
@@ -1,5 +1,6 @@
1// SPDX-License-Identifier: GPL-2.01// SPDX-License-Identifier: GPL-2.0
2#include <linux/elf.h>2#include <linux/elf.h>
3#include <asm/kexec.h>
3 4
4int arch_kexec_do_relocs(int r_type, void *loc, unsigned long val,5int arch_kexec_do_relocs(int r_type, void *loc, unsigned long val,
5 unsigned long addr)6 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
34 unsigned char start[PAGE_SIZE]; /* Counter set at event start */34 unsigned char start[PAGE_SIZE]; /* Counter set at event start */
35 unsigned char data[PAGE_SIZE]; /* Counter set at event delete */35 unsigned char data[PAGE_SIZE]; /* Counter set at event delete */
36};36};
37DEFINE_PER_CPU(struct cf_diag_csd, cf_diag_csd);37static DEFINE_PER_CPU(struct cf_diag_csd, cf_diag_csd);
38 38
39/* Counter sets are stored as data stream in a page sized memory buffer and39/* Counter sets are stored as data stream in a page sized memory buffer and
40 * exported to user space via raw data attached to the event sample data.40 * 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
1114 1114
1115 ROOT_DEV = Root_RAM0;1115 ROOT_DEV = Root_RAM0;
1116 1116
1117 /* Is init_mm really needed? */1117 init_mm.start_code = (unsigned long) _text;
1118 init_mm.start_code = PAGE_OFFSET;
1119 init_mm.end_code = (unsigned long) _etext;1118 init_mm.end_code = (unsigned long) _etext;
1120 init_mm.end_data = (unsigned long) _edata;1119 init_mm.end_data = (unsigned long) _edata;
1121 init_mm.brk = (unsigned long) _end;1120 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
216 216
217 if (!vdso_enabled)217 if (!vdso_enabled)
218 return 0;218 return 0;
219 /*
220 * Only map the vdso for dynamically linked elf binaries.
221 */
222 if (!uses_interp)
223 return 0;
224 219
225 vdso_pages = vdso64_pages;220 vdso_pages = vdso64_pages;
226#ifdef CONFIG_COMPAT_VDSO221#ifdef CONFIG_COMPAT_VDSO
arch/s390/kernel/vmlinux.lds.S+4−6
@@ -32,10 +32,9 @@ PHDRS { · 31 unmodified lines
32SECTIONS32SECTIONS
33{33{
34 . = 0x100000;34 . = 0x100000;
35 _stext = .; /* Start of text section */
36 .text : {35 .text : {
37 /* Text and read-only data */36 _stext = .; /* Start of text section */
38 _text = .;37 _text = .; /* Text and read-only data */
39 HEAD_TEXT38 HEAD_TEXT
40 TEXT_TEXT39 TEXT_TEXT
41 SCHED_TEXT40 SCHED_TEXT
@@ -47,11 +46,10 @@ SECTIONS · 5 unmodified lines
47 *(.text.*_indirect_*)46 *(.text.*_indirect_*)
48 *(.fixup)47 *(.fixup)
49 *(.gnu.warning)48 *(.gnu.warning)
49 . = ALIGN(PAGE_SIZE);
50 _etext = .; /* End of text section */
50 } :text = 0x070051 } :text = 0x0700
51 52
52 . = ALIGN(PAGE_SIZE);
53 _etext = .; /* End of text section */
54
55 NOTES :text :note53 NOTES :text :note
56 54
57 .dummy : { *(.dummy) } :data55 .dummy : { *(.dummy) } :data
arch/s390/kvm/kvm-s390.c+0−10
@@ -2516,16 +2516,6 @@ out_err: · 2515 unmodified lines
2516 return rc;2516 return rc;
2517}2517}
2518 2518
2519bool kvm_arch_has_vcpu_debugfs(void)
2520{
2521 return false;
2522}
2523
2524int kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu)
2525{
2526 return 0;
2527}
2528
2529void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)2519void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
2530{2520{
2531 VCPU_EVENT(vcpu, 3, "%s", "free cpu");2521 VCPU_EVENT(vcpu, 3, "%s", "free cpu");
arch/s390/lib/xor.c+1−0
@@ -9,6 +9,7 @@ · 8 unmodified lines
9#include <linux/types.h>9#include <linux/types.h>
10#include <linux/export.h>10#include <linux/export.h>
11#include <linux/raid/xor.h>11#include <linux/raid/xor.h>
12#include <asm/xor.h>
12 13
13static void xor_xc_2(unsigned long bytes, unsigned long *p1, unsigned long *p2)14static void xor_xc_2(unsigned long bytes, unsigned long *p1, unsigned long *p2)
14{15{
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
161 }161 }
162#endif162#endif
163 163
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++) {
165 st->current_address = addr;166 st->current_address = addr;
166 pmd = pmd_offset(pud, addr);
167 if (!pmd_none(*pmd)) {167 if (!pmd_none(*pmd)) {
168 if (pmd_large(*pmd)) {168 if (pmd_large(*pmd)) {
169 prot = pmd_val(*pmd) &169 prot = pmd_val(*pmd) &
@@ -192,9 +192,9 @@ static void walk_pud_level(struct seq_file *m, struct pg_state *st, · 22 unmodified lines
192 }192 }
193#endif193#endif
194 194
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++) {
196 st->current_address = addr;197 st->current_address = addr;
197 pud = pud_offset(p4d, addr);
198 if (!pud_none(*pud))198 if (!pud_none(*pud))
199 if (pud_large(*pud)) {199 if (pud_large(*pud)) {
200 prot = pud_val(*pud) &200 prot = pud_val(*pud) &
@@ -222,9 +222,9 @@ static void walk_p4d_level(struct seq_file *m, struct pg_state *st, · 21 unmodified lines
222 }222 }
223#endif223#endif
224 224
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++) {
226 st->current_address = addr;227 st->current_address = addr;
227 p4d = p4d_offset(pgd, addr);
228 if (!p4d_none(*p4d))228 if (!p4d_none(*p4d))
229 walk_pud_level(m, st, p4d, addr);229 walk_pud_level(m, st, p4d, addr);
230 else230 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
327 case VM_FAULT_BADACCESS:327 case VM_FAULT_BADACCESS:
328 if (access == VM_EXEC && signal_return(regs) == 0)328 if (access == VM_EXEC && signal_return(regs) == 0)
329 break;329 break;
330 /* fallthrough */
330 case VM_FAULT_BADMAP:331 case VM_FAULT_BADMAP:
331 /* Bad memory access. Check if it is kernel or user space. */332 /* Bad memory access. Check if it is kernel or user space. */
332 if (user_mode(regs)) {333 if (user_mode(regs)) {
@@ -336,7 +337,9 @@ static noinline void do_fault_error(struct pt_regs *regs, int access, · 3 unmodified lines
336 do_sigsegv(regs, si_code);337 do_sigsegv(regs, si_code);
337 break;338 break;
338 }339 }
340 /* fallthrough */
339 case VM_FAULT_BADCONTEXT:341 case VM_FAULT_BADCONTEXT:
342 /* fallthrough */
340 case VM_FAULT_PFAULT:343 case VM_FAULT_PFAULT:
341 do_no_context(regs);344 do_no_context(regs);
342 break;345 break;
arch/s390/mm/gmap.c+2−2
@@ -2424,8 +2424,8 @@ EXPORT_SYMBOL_GPL(gmap_pmdp_idte_global); · 2423 unmodified lines
2424 * This function is assumed to be called with the guest_table_lock2424 * This function is assumed to be called with the guest_table_lock
2425 * held.2425 * held.
2426 */2426 */
2427bool gmap_test_and_clear_dirty_pmd(struct gmap *gmap, pmd_t *pmdp,2427static bool gmap_test_and_clear_dirty_pmd(struct gmap *gmap, pmd_t *pmdp,
2428 unsigned long gaddr)2428 unsigned long gaddr)
2429{2429{
2430 if (pmd_val(*pmdp) & _SEGMENT_ENTRY_INVALID)2430 if (pmd_val(*pmdp) & _SEGMENT_ENTRY_INVALID)
2431 return false;2431 return false;
arch/s390/scripts/Makefile.chkbss+1−2
@@ -11,8 +11,7 @@ chkbss: $(addprefix $(obj)/, $(chkbss-files)) · 10 unmodified lines
11 11
12quiet_cmd_chkbss = CHKBSS $<12quiet_cmd_chkbss = CHKBSS $<
13 cmd_chkbss = \13 cmd_chkbss = \
14 if $(OBJDUMP) -h $< | grep -q "\.bss" && \14 if ! $(OBJSIZE) --common $< | $(AWK) 'END { if ($$3) exit 1 }'; then \
15 ! $(OBJDUMP) -j .bss -w -h $< | awk 'END { if ($$3) exit 1 }'; then \
16 echo "error: $< .bss section is not empty" >&2; exit 1; \15 echo "error: $< .bss section is not empty" >&2; exit 1; \
17 fi; \16 fi; \
18 touch $@;17 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
37 return diff;37 return diff;
38}38}
39 39
40/*
41 * Clang may lower `memcmp == 0` to `bcmp == 0`.
42 */
43int bcmp(const void *s1, const void *s2, size_t len)
44{
45 return memcmp(s1, s2, len);
46}
47
40int strcmp(const char *str1, const char *str2)48int strcmp(const char *str1, const char *str2)
41{49{
42 const unsigned char *s1 = (const unsigned char *)str1;50 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
314 314
315#endif315#endif
316 316
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
317.macro STACKLEAK_ERASE_NOCLOBBER334.macro STACKLEAK_ERASE_NOCLOBBER
318#ifdef CONFIG_GCC_PLUGIN_STACKLEAK335#ifdef CONFIG_GCC_PLUGIN_STACKLEAK
319 PUSH_AND_CLEAR_REGS336 PUSH_AND_CLEAR_REGS
arch/x86/entry/entry_64.S+18−3
@@ -519,7 +519,7 @@ ENTRY(interrupt_entry) · 518 unmodified lines
519 testb $3, CS-ORIG_RAX+8(%rsp)519 testb $3, CS-ORIG_RAX+8(%rsp)
520 jz 1f520 jz 1f
521 SWAPGS521 SWAPGS
522 522 FENCE_SWAPGS_USER_ENTRY
523 /*523 /*
524 * Switch to the thread stack. The IRET frame and orig_ax are524 * Switch to the thread stack. The IRET frame and orig_ax are
525 * on the stack, as well as the return address. RDI..R12 are525 * on the stack, as well as the return address. RDI..R12 are
@@ -549,8 +549,10 @@ ENTRY(interrupt_entry) · 23 unmodified lines
549 UNWIND_HINT_FUNC549 UNWIND_HINT_FUNC
550 550
551 movq (%rdi), %rdi551 movq (%rdi), %rdi
552 jmp 2f
5521:5531:
553 554 FENCE_SWAPGS_KERNEL_ENTRY
5552:
554 PUSH_AND_CLEAR_REGS save_ret=1556 PUSH_AND_CLEAR_REGS save_ret=1
555 ENCODE_FRAME_POINTER 8557 ENCODE_FRAME_POINTER 8
556 558
@@ -1238,6 +1240,13 @@ ENTRY(paranoid_entry) · 681 unmodified lines
1238 */1240 */
1239 SAVE_AND_SWITCH_TO_KERNEL_CR3 scratch_reg=%rax save_reg=%r141241 SAVE_AND_SWITCH_TO_KERNEL_CR3 scratch_reg=%rax save_reg=%r14
1240 1242
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
1241 ret1250 ret
1242END(paranoid_entry)1251END(paranoid_entry)
1243 1252
@@ -1288,6 +1297,7 @@ ENTRY(error_entry) · 44 unmodified lines
1288 * from user mode due to an IRET fault.1297 * from user mode due to an IRET fault.
1289 */1298 */
1290 SWAPGS1299 SWAPGS
1300 FENCE_SWAPGS_USER_ENTRY
1291 /* We have user CR3. Change to kernel CR3. */1301 /* We have user CR3. Change to kernel CR3. */
1292 SWITCH_TO_KERNEL_CR3 scratch_reg=%rax1302 SWITCH_TO_KERNEL_CR3 scratch_reg=%rax
1293 1303
@@ -1301,6 +1311,8 @@ ENTRY(error_entry) · 7 unmodified lines
1301 pushq %r121311 pushq %r12
1302 ret1312 ret
1303 1313
1314.Lerror_entry_done_lfence:
1315 FENCE_SWAPGS_KERNEL_ENTRY
1304.Lerror_entry_done:1316.Lerror_entry_done:
1305 ret1317 ret
1306 1318
@@ -1318,7 +1330,7 @@ ENTRY(error_entry) · 11 unmodified lines
1318 cmpq %rax, RIP+8(%rsp)1330 cmpq %rax, RIP+8(%rsp)
1319 je .Lbstep_iret1331 je .Lbstep_iret
1320 cmpq $.Lgs_change, RIP+8(%rsp)1332 cmpq $.Lgs_change, RIP+8(%rsp)
1321 jne .Lerror_entry_done1333 jne .Lerror_entry_done_lfence
1322 1334
1323 /*1335 /*
1324 * hack: .Lgs_change can fail with user gsbase. If this happens, fix up1336 * hack: .Lgs_change can fail with user gsbase. If this happens, fix up
@@ -1326,6 +1338,7 @@ ENTRY(error_entry) · 1 unmodified line
1326 * .Lgs_change's error handler with kernel gsbase.1338 * .Lgs_change's error handler with kernel gsbase.
1327 */1339 */
1328 SWAPGS1340 SWAPGS
1341 FENCE_SWAPGS_USER_ENTRY
1329 SWITCH_TO_KERNEL_CR3 scratch_reg=%rax1342 SWITCH_TO_KERNEL_CR3 scratch_reg=%rax
1330 jmp .Lerror_entry_done1343 jmp .Lerror_entry_done
1331 1344
@@ -1340,6 +1353,7 @@ ENTRY(error_entry) · 8 unmodified lines
1340 * gsbase and CR3. Switch to kernel gsbase and CR3:1353 * gsbase and CR3. Switch to kernel gsbase and CR3:
1341 */1354 */
1342 SWAPGS1355 SWAPGS
1356 FENCE_SWAPGS_USER_ENTRY
1343 SWITCH_TO_KERNEL_CR3 scratch_reg=%rax1357 SWITCH_TO_KERNEL_CR3 scratch_reg=%rax
1344 1358
1345 /*1359 /*
@@ -1431,6 +1445,7 @@ ENTRY(nmi) · 85 unmodified lines
1431 1445
1432 swapgs1446 swapgs
1433 cld1447 cld
1448 FENCE_SWAPGS_USER_ENTRY
1434 SWITCH_TO_KERNEL_CR3 scratch_reg=%rdx1449 SWITCH_TO_KERNEL_CR3 scratch_reg=%rdx
1435 movq %rsp, %rdx1450 movq %rsp, %rdx
1436 movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp1451 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
281#define X86_FEATURE_CQM_OCCUP_LLC (11*32+ 1) /* LLC occupancy monitoring */281#define X86_FEATURE_CQM_OCCUP_LLC (11*32+ 1) /* LLC occupancy monitoring */
282#define X86_FEATURE_CQM_MBM_TOTAL (11*32+ 2) /* LLC Total MBM monitoring */282#define X86_FEATURE_CQM_MBM_TOTAL (11*32+ 2) /* LLC Total MBM monitoring */
283#define X86_FEATURE_CQM_MBM_LOCAL (11*32+ 3) /* LLC Local MBM monitoring */283#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 */
284 286
285/* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */287/* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */
286#define X86_FEATURE_AVX512_BF16 (12*32+ 5) /* AVX512 BFLOAT16 instructions */288#define X86_FEATURE_AVX512_BF16 (12*32+ 5) /* AVX512 BFLOAT16 instructions */
@@ -394,5 +396,6 @@ · 107 unmodified lines
394#define X86_BUG_L1TF X86_BUG(18) /* CPU is affected by L1 Terminal Fault */396#define X86_BUG_L1TF X86_BUG(18) /* CPU is affected by L1 Terminal Fault */
395#define X86_BUG_MDS X86_BUG(19) /* CPU is affected by Microarchitectural data sampling */397#define X86_BUG_MDS X86_BUG(19) /* CPU is affected by Microarchitectural data sampling */
396#define X86_BUG_MSBDS_ONLY X86_BUG(20) /* CPU is only affected by the MSDBS variant of BUG_MDS */398#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 */
397 400
398#endif /* _ASM_X86_CPUFEATURES_H */401#endif /* _ASM_X86_CPUFEATURES_H */
arch/x86/include/asm/kvm_host.h+3−0
@@ -35,6 +35,8 @@ · 34 unmodified lines
35#include <asm/kvm_vcpu_regs.h>35#include <asm/kvm_vcpu_regs.h>
36#include <asm/hyperv-tlfs.h>36#include <asm/hyperv-tlfs.h>
37 37
38#define __KVM_HAVE_ARCH_VCPU_DEBUGFS
39
38#define KVM_MAX_VCPUS 28840#define KVM_MAX_VCPUS 288
39#define KVM_SOFT_MAX_VCPUS 24041#define KVM_SOFT_MAX_VCPUS 240
40#define KVM_MAX_VCPU_ID 102342#define KVM_MAX_VCPU_ID 1023
@@ -1175,6 +1177,7 @@ struct kvm_x86_ops { · 1134 unmodified lines
1175 int (*update_pi_irte)(struct kvm *kvm, unsigned int host_irq,1177 int (*update_pi_irte)(struct kvm *kvm, unsigned int host_irq,
1176 uint32_t guest_irq, bool set);1178 uint32_t guest_irq, bool set);
1177 void (*apicv_post_state_restore)(struct kvm_vcpu *vcpu);1179 void (*apicv_post_state_restore)(struct kvm_vcpu *vcpu);
1180 bool (*dy_apicv_has_pending_interrupt)(struct kvm_vcpu *vcpu);
1178 1181
1179 int (*set_hv_timer)(struct kvm_vcpu *vcpu, u64 guest_deadline_tsc,1182 int (*set_hv_timer)(struct kvm_vcpu *vcpu, u64 guest_deadline_tsc,
1180 bool *expired);1183 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
96 96
97#else97#else
98 98
99#define VDSO_HAS_32BIT_FALLBACK 1
100
99static __always_inline101static __always_inline
100long clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)102long clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
101{103{
@@ -113,6 +115,23 @@ long clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts) · 11 unmodified lines
113 return ret;115 return ret;
114}116}
115 117
118static __always_inline
119long 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
116static __always_inline135static __always_inline
117long gettimeofday_fallback(struct __kernel_old_timeval *_tv,136long gettimeofday_fallback(struct __kernel_old_timeval *_tv,
118 struct timezone *_tz)137 struct timezone *_tz)
@@ -148,6 +167,23 @@ clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts) · 29 unmodified lines
148 return ret;167 return ret;
149}168}
150 169
170static __always_inline
171long 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
151#endif187#endif
152 188
153#ifdef CONFIG_PARAVIRT_CLOCK189#ifdef CONFIG_PARAVIRT_CLOCK
arch/x86/kernel/cpu/bugs.c+96−9
@@ -34,6 +34,7 @@ · 33 unmodified lines
34 34
35#include "cpu.h"35#include "cpu.h"
36 36
37static void __init spectre_v1_select_mitigation(void);
37static void __init spectre_v2_select_mitigation(void);38static void __init spectre_v2_select_mitigation(void);
38static void __init ssb_select_mitigation(void);39static void __init ssb_select_mitigation(void);
39static void __init l1tf_select_mitigation(void);40static void __init l1tf_select_mitigation(void);
@@ -98,17 +99,11 @@ void __init check_bugs(void) · 58 unmodified lines
98 if (boot_cpu_has(X86_FEATURE_STIBP))99 if (boot_cpu_has(X86_FEATURE_STIBP))
99 x86_spec_ctrl_mask |= SPEC_CTRL_STIBP;100 x86_spec_ctrl_mask |= SPEC_CTRL_STIBP;
100 101
101 /* Select the proper spectre mitigation before patching alternatives */102 /* Select the proper CPU mitigations before patching alternatives: */
103 spectre_v1_select_mitigation();
102 spectre_v2_select_mitigation();104 spectre_v2_select_mitigation();
103
104 /*
105 * Select proper mitigation for any exposure to the Speculative Store
106 * Bypass vulnerability.
107 */
108 ssb_select_mitigation();105 ssb_select_mitigation();
109
110 l1tf_select_mitigation();106 l1tf_select_mitigation();
111
112 mds_select_mitigation();107 mds_select_mitigation();
113 108
114 arch_smt_update();109 arch_smt_update();
@@ -273,6 +268,98 @@ static int __init mds_cmdline(char *str) · 158 unmodified lines
273}268}
274early_param("mds", mds_cmdline);269early_param("mds", mds_cmdline);
275 270
271#undef pr_fmt
272#define pr_fmt(fmt) "Spectre V1 : " fmt
273
274enum spectre_v1_mitigation {
275 SPECTRE_V1_MITIGATION_NONE,
276 SPECTRE_V1_MITIGATION_AUTO,
277};
278
279static enum spectre_v1_mitigation spectre_v1_mitigation __ro_after_init =
280 SPECTRE_V1_MITIGATION_AUTO;
281
282static 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 */
291static 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
308static 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
356static int __init nospectre_v1_cmdline(char *str)
357{
358 spectre_v1_mitigation = SPECTRE_V1_MITIGATION_NONE;
359 return 0;
360}
361early_param("nospectre_v1", nospectre_v1_cmdline);
362
276#undef pr_fmt363#undef pr_fmt
277#define pr_fmt(fmt) "Spectre V2 : " fmt364#define pr_fmt(fmt) "Spectre V2 : " fmt
278 365
@@ -1290,7 +1377,7 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr · 1011 unmodified lines
1290 break;1377 break;
1291 1378
1292 case X86_BUG_SPECTRE_V1:1379 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]);
1294 1381
1295 case X86_BUG_SPECTRE_V2:1382 case X86_BUG_SPECTRE_V2:
1296 return sprintf(buf, "%s%s%s%s%s%s\n", spectre_v2_strings[spectre_v2_enabled],1383 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
1022#define NO_L1TF BIT(3)1022#define NO_L1TF BIT(3)
1023#define NO_MDS BIT(4)1023#define NO_MDS BIT(4)
1024#define MSBDS_ONLY BIT(5)1024#define MSBDS_ONLY BIT(5)
1025#define NO_SWAPGS BIT(6)
1025 1026
1026#define VULNWL(_vendor, _family, _model, _whitelist) \1027#define VULNWL(_vendor, _family, _model, _whitelist) \
1027 { X86_VENDOR_##_vendor, _family, _model, X86_FEATURE_ANY, _whitelist }1028 { 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
1048 VULNWL_INTEL(ATOM_BONNELL, NO_SPECULATION),1049 VULNWL_INTEL(ATOM_BONNELL, NO_SPECULATION),
1049 VULNWL_INTEL(ATOM_BONNELL_MID, NO_SPECULATION),1050 VULNWL_INTEL(ATOM_BONNELL_MID, NO_SPECULATION),
1050 1051
1051 VULNWL_INTEL(ATOM_SILVERMONT, NO_SSB | NO_L1TF | MSBDS_ONLY),1052 VULNWL_INTEL(ATOM_SILVERMONT, NO_SSB | NO_L1TF | MSBDS_ONLY | NO_SWAPGS),
1052 VULNWL_INTEL(ATOM_SILVERMONT_X, NO_SSB | NO_L1TF | MSBDS_ONLY),1053 VULNWL_INTEL(ATOM_SILVERMONT_X, NO_SSB | NO_L1TF | MSBDS_ONLY | NO_SWAPGS),
1053 VULNWL_INTEL(ATOM_SILVERMONT_MID, NO_SSB | NO_L1TF | MSBDS_ONLY),1054 VULNWL_INTEL(ATOM_SILVERMONT_MID, NO_SSB | NO_L1TF | MSBDS_ONLY | NO_SWAPGS),
1054 VULNWL_INTEL(ATOM_AIRMONT, NO_SSB | NO_L1TF | MSBDS_ONLY),1055 VULNWL_INTEL(ATOM_AIRMONT, NO_SSB | NO_L1TF | MSBDS_ONLY | NO_SWAPGS),
1055 VULNWL_INTEL(XEON_PHI_KNL, NO_SSB | NO_L1TF | MSBDS_ONLY),1056 VULNWL_INTEL(XEON_PHI_KNL, NO_SSB | NO_L1TF | MSBDS_ONLY | NO_SWAPGS),
1056 VULNWL_INTEL(XEON_PHI_KNM, NO_SSB | NO_L1TF | MSBDS_ONLY),1057 VULNWL_INTEL(XEON_PHI_KNM, NO_SSB | NO_L1TF | MSBDS_ONLY | NO_SWAPGS),
1057 1058
1058 VULNWL_INTEL(CORE_YONAH, NO_SSB),1059 VULNWL_INTEL(CORE_YONAH, NO_SSB),
1059 1060
1060 VULNWL_INTEL(ATOM_AIRMONT_MID, NO_L1TF | MSBDS_ONLY),1061 VULNWL_INTEL(ATOM_AIRMONT_MID, NO_L1TF | MSBDS_ONLY | NO_SWAPGS),
1061 1062
1062 VULNWL_INTEL(ATOM_GOLDMONT, NO_MDS | NO_L1TF),1063 VULNWL_INTEL(ATOM_GOLDMONT, NO_MDS | NO_L1TF | NO_SWAPGS),
1063 VULNWL_INTEL(ATOM_GOLDMONT_X, NO_MDS | NO_L1TF),1064 VULNWL_INTEL(ATOM_GOLDMONT_X, NO_MDS | NO_L1TF | NO_SWAPGS),
1064 VULNWL_INTEL(ATOM_GOLDMONT_PLUS, NO_MDS | NO_L1TF),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 */
1065 1074
1066 /* AMD Family 0xf - 0x12 */1075 /* AMD Family 0xf - 0x12 */
1067 VULNWL_AMD(0x0f, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS),1076 VULNWL_AMD(0x0f, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS | NO_SWAPGS),
1068 VULNWL_AMD(0x10, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS),1077 VULNWL_AMD(0x10, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS | NO_SWAPGS),
1069 VULNWL_AMD(0x11, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS),1078 VULNWL_AMD(0x11, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS | NO_SWAPGS),
1070 VULNWL_AMD(0x12, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS),1079 VULNWL_AMD(0x12, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS | NO_SWAPGS),
1071 1080
1072 /* FAMILY_ANY must be last, otherwise 0x0f - 0x12 matches won't work */1081 /* FAMILY_ANY must be last, otherwise 0x0f - 0x12 matches won't work */
1073 VULNWL_AMD(X86_FAMILY_ANY, NO_MELTDOWN | NO_L1TF | NO_MDS),1082 VULNWL_AMD(X86_FAMILY_ANY, NO_MELTDOWN | NO_L1TF | NO_MDS | NO_SWAPGS),
1074 VULNWL_HYGON(X86_FAMILY_ANY, NO_MELTDOWN | NO_L1TF | NO_MDS),1083 VULNWL_HYGON(X86_FAMILY_ANY, NO_MELTDOWN | NO_L1TF | NO_MDS | NO_SWAPGS),
1075 {}1084 {}
1076};1085};
1077 1086
@@ -1108,6 +1117,9 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c) · 30 unmodified lines
1108 setup_force_cpu_bug(X86_BUG_MSBDS_ONLY);1117 setup_force_cpu_bug(X86_BUG_MSBDS_ONLY);
1109 }1118 }
1110 1119
1120 if (!cpu_matches(NO_SWAPGS))
1121 setup_force_cpu_bug(X86_BUG_SWAPGS);
1122
1111 if (cpu_matches(NO_MELTDOWN))1123 if (cpu_matches(NO_MELTDOWN))
1112 return;1124 return;
1113 1125
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
98 case 7:98 case 7:
99 if (size < 0x40)99 if (size < 0x40)
100 break;100 break;
101 /* Else, fall through */
101 case 6:102 case 6:
102 case 5:103 case 5:
103 case 4:104 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
308 308
309static void kvm_guest_cpu_init(void)309static void kvm_guest_cpu_init(void)
310{310{
311 if (!kvm_para_available())
312 return;
313
314 if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF) && kvmapf) {311 if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF) && kvmapf) {
315 u64 pa = slow_virt_to_phys(this_cpu_ptr(&apf_reason));312 u64 pa = slow_virt_to_phys(this_cpu_ptr(&apf_reason));
316 313
@@ -625,9 +622,6 @@ static void __init kvm_guest_init(void) · 308 unmodified lines
625{622{
626 int i;623 int i;
627 624
628 if (!kvm_para_available())
629 return;
630
631 paravirt_ops_setup();625 paravirt_ops_setup();
632 register_reboot_notifier(&kvm_pv_reboot_nb);626 register_reboot_notifier(&kvm_pv_reboot_nb);
633 for (i = 0; i < KVM_TASK_SLEEP_HASHSIZE; i++)627 for (i = 0; i < KVM_TASK_SLEEP_HASHSIZE; i++)
@@ -848,8 +842,6 @@ asm( · 214 unmodified lines
848 */842 */
849void __init kvm_spinlock_init(void)843void __init kvm_spinlock_init(void)
850{844{
851 if (!kvm_para_available())
852 return;
853 /* Does host kernel support KVM_FEATURE_PV_UNHALT? */845 /* Does host kernel support KVM_FEATURE_PV_UNHALT? */
854 if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT))846 if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT))
855 return;847 return;
arch/x86/kernel/ptrace.c+1−0
@@ -201,6 +201,7 @@ static int set_segment_reg(struct task_struct *task, · 200 unmodified lines
201 case offsetof(struct user_regs_struct, ss):201 case offsetof(struct user_regs_struct, ss):
202 if (unlikely(value == 0))202 if (unlikely(value == 0))
203 return -EIO;203 return -EIO;
204 /* Else, fall through */
204 205
205 default:206 default:
206 *pt_regs_access(task_pt_regs(task), offset) = value;207 *pt_regs_access(task_pt_regs(task), offset) = value;
arch/x86/kvm/debugfs.c+13−33
@@ -8,11 +8,6 @@ · 7 unmodified lines
8#include <linux/debugfs.h>8#include <linux/debugfs.h>
9#include "lapic.h"9#include "lapic.h"
10 10
11bool kvm_arch_has_vcpu_debugfs(void)
12{
13 return true;
14}
15
16static int vcpu_get_timer_advance_ns(void *data, u64 *val)11static int vcpu_get_timer_advance_ns(void *data, u64 *val)
17{12{
18 struct kvm_vcpu *vcpu = (struct kvm_vcpu *) data;13 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
48 43
49DEFINE_SIMPLE_ATTRIBUTE(vcpu_tsc_scaling_frac_fops, vcpu_get_tsc_scaling_frac_bits, NULL, "%llu\n");44DEFINE_SIMPLE_ATTRIBUTE(vcpu_tsc_scaling_frac_fops, vcpu_get_tsc_scaling_frac_bits, NULL, "%llu\n");
50 45
51int kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu)46void kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu)
52{47{
53 struct dentry *ret;48 debugfs_create_file("tsc-offset", 0444, vcpu->debugfs_dentry, vcpu,
54 49 &vcpu_tsc_offset_fops);
55 ret = debugfs_create_file("tsc-offset", 0444,
56 vcpu->debugfs_dentry,
57 vcpu, &vcpu_tsc_offset_fops);
58 if (!ret)
59 return -ENOMEM;
60 50
61 if (lapic_in_kernel(vcpu)) {51 if (lapic_in_kernel(vcpu))
62 ret = debugfs_create_file("lapic_timer_advance_ns", 0444,52 debugfs_create_file("lapic_timer_advance_ns", 0444,
63 vcpu->debugfs_dentry,53 vcpu->debugfs_dentry, vcpu,
64 vcpu, &vcpu_timer_advance_ns_fops);54 &vcpu_timer_advance_ns_fops);
65 if (!ret)
66 return -ENOMEM;
67 }
68 55
69 if (kvm_has_tsc_control) {56 if (kvm_has_tsc_control) {
70 ret = debugfs_create_file("tsc-scaling-ratio", 0444,57 debugfs_create_file("tsc-scaling-ratio", 0444,
71 vcpu->debugfs_dentry,58 vcpu->debugfs_dentry, vcpu,
72 vcpu, &vcpu_tsc_scaling_fops);59 &vcpu_tsc_scaling_fops);
73 if (!ret)60 debugfs_create_file("tsc-scaling-ratio-frac-bits", 0444,
74 return -ENOMEM;61 vcpu->debugfs_dentry, vcpu,
75 ret = debugfs_create_file("tsc-scaling-ratio-frac-bits", 0444,62 &vcpu_tsc_scaling_frac_fops);
76 vcpu->debugfs_dentry,
77 vcpu, &vcpu_tsc_scaling_frac_fops);
78 if (!ret)
79 return -ENOMEM;
80
81 }63 }
82
83 return 0;
84}64}
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
1548static void apic_timer_expired(struct kvm_lapic *apic)1548static void apic_timer_expired(struct kvm_lapic *apic)
1549{1549{
1550 struct kvm_vcpu *vcpu = apic->vcpu;1550 struct kvm_vcpu *vcpu = apic->vcpu;
1551 struct swait_queue_head *q = &vcpu->wq;
1552 struct kvm_timer *ktimer = &apic->lapic_timer;1551 struct kvm_timer *ktimer = &apic->lapic_timer;
1553 1552
1554 if (atomic_read(&apic->lapic_timer.pending))1553 if (atomic_read(&apic->lapic_timer.pending))
@@ -1566,13 +1565,6 @@ static void apic_timer_expired(struct kvm_lapic *apic) · 11 unmodified lines
1566 1565
1567 atomic_inc(&apic->lapic_timer.pending);1566 atomic_inc(&apic->lapic_timer.pending);
1568 kvm_set_pending_timer(vcpu);1567 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);
1576}1568}
1577 1569
1578static void start_sw_tscdeadline(struct kvm_lapic *apic)1570static 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
5190 kvm_vcpu_wake_up(vcpu);5190 kvm_vcpu_wake_up(vcpu);
5191}5191}
5192 5192
5193static bool svm_dy_apicv_has_pending_interrupt(struct kvm_vcpu *vcpu)
5194{
5195 return false;
5196}
5197
5193static void svm_ir_list_del(struct vcpu_svm *svm, struct amd_iommu_pi_data *pi)5198static void svm_ir_list_del(struct vcpu_svm *svm, struct amd_iommu_pi_data *pi)
5194{5199{
5195 unsigned long flags;5200 unsigned long flags;
@@ -7314,6 +7319,7 @@ static struct kvm_x86_ops svm_x86_ops __ro_after_init = { · 2118 unmodified lines
7314 7319
7315 .pmu_ops = &amd_pmu_ops,7320 .pmu_ops = &amd_pmu_ops,
7316 .deliver_posted_interrupt = svm_deliver_avic_intr,7321 .deliver_posted_interrupt = svm_deliver_avic_intr,
7322 .dy_apicv_has_pending_interrupt = svm_dy_apicv_has_pending_interrupt,
7317 .update_pi_irte = svm_update_pi_irte,7323 .update_pi_irte = svm_update_pi_irte,
7318 .setup_mce = svm_setup_mce,7324 .setup_mce = svm_setup_mce,
7319 7325
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
6117 return max_irr;6117 return max_irr;
6118}6118}
6119 6119
6120static bool vmx_dy_apicv_has_pending_interrupt(struct kvm_vcpu *vcpu)
6121{
6122 return pi_test_on(vcpu_to_pi_desc(vcpu));
6123}
6124
6120static void vmx_load_eoi_exitmap(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap)6125static void vmx_load_eoi_exitmap(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap)
6121{6126{
6122 if (!kvm_vcpu_apicv_active(vcpu))6127 if (!kvm_vcpu_apicv_active(vcpu))
@@ -7726,6 +7731,7 @@ static struct kvm_x86_ops vmx_x86_ops __ro_after_init = { · 1603 unmodified lines
7726 .guest_apic_has_interrupt = vmx_guest_apic_has_interrupt,7731 .guest_apic_has_interrupt = vmx_guest_apic_has_interrupt,
7727 .sync_pir_to_irr = vmx_sync_pir_to_irr,7732 .sync_pir_to_irr = vmx_sync_pir_to_irr,
7728 .deliver_posted_interrupt = vmx_deliver_posted_interrupt,7733 .deliver_posted_interrupt = vmx_deliver_posted_interrupt,
7734 .dy_apicv_has_pending_interrupt = vmx_dy_apicv_has_pending_interrupt,
7729 7735
7730 .set_tss_addr = vmx_set_tss_addr,7736 .set_tss_addr = vmx_set_tss_addr,
7731 .set_identity_map_addr = vmx_set_identity_map_addr,7737 .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
9698 return kvm_vcpu_running(vcpu) || kvm_vcpu_has_events(vcpu);9698 return kvm_vcpu_running(vcpu) || kvm_vcpu_has_events(vcpu);
9699}9699}
9700 9700
9701bool 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
9701bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu)9717bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu)
9702{9718{
9703 return vcpu->arch.preempted_in_kernel;9719 return vcpu->arch.preempted_in_kernel;
arch/x86/lib/cpu.c+1−0
@@ -1,6 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0-only1// SPDX-License-Identifier: GPL-2.0-only
2#include <linux/types.h>2#include <linux/types.h>
3#include <linux/export.h>3#include <linux/export.h>
4#include <asm/cpu.h>
4 5
5unsigned int x86_family(unsigned int sig)6unsigned int x86_family(unsigned int sig)
6{7{
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
6targets += $(purgatory-y)6targets += $(purgatory-y)
7PURGATORY_OBJS = $(addprefix $(obj)/,$(purgatory-y))7PURGATORY_OBJS = $(addprefix $(obj)/,$(purgatory-y))
8 8
9$(obj)/string.o: $(srctree)/arch/x86/boot/compressed/string.c FORCE
10 $(call if_changed_rule,cc_o_c)
11
9$(obj)/sha256.o: $(srctree)/lib/sha256.c FORCE12$(obj)/sha256.o: $(srctree)/lib/sha256.c FORCE
10 $(call if_changed_rule,cc_o_c)13 $(call if_changed_rule,cc_o_c)
11 14
@@ -17,11 +20,34 @@ KCOV_INSTRUMENT := n · 5 unmodified lines
17 20
18# Default KBUILD_CFLAGS can have -pg option set when FTRACE is enabled. That21# Default KBUILD_CFLAGS can have -pg option set when FTRACE is enabled. That
19# in turn leaves some undefined symbols like __fentry__ in purgatory and not22# in turn leaves some undefined symbols like __fentry__ in purgatory and not
20# sure how to relocate those. Like kexec-tools, use custom flags.23# sure how to relocate those.
21 24ifdef CONFIG_FUNCTION_TRACER
22KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes -fno-zero-initialized-in-bss -fno-builtin -ffreestanding -c -Os -mcmodel=large25CFLAGS_REMOVE_sha256.o += $(CC_FLAGS_FTRACE)
23KBUILD_CFLAGS += -m$(BITS)26CFLAGS_REMOVE_purgatory.o += $(CC_FLAGS_FTRACE)
24KBUILD_CFLAGS += $(call cc-option,-fno-PIE)27CFLAGS_REMOVE_string.o += $(CC_FLAGS_FTRACE)
28CFLAGS_REMOVE_kexec-purgatory.o += $(CC_FLAGS_FTRACE)
29endif
30
31ifdef CONFIG_STACKPROTECTOR
32CFLAGS_REMOVE_sha256.o += -fstack-protector
33CFLAGS_REMOVE_purgatory.o += -fstack-protector
34CFLAGS_REMOVE_string.o += -fstack-protector
35CFLAGS_REMOVE_kexec-purgatory.o += -fstack-protector
36endif
37
38ifdef CONFIG_STACKPROTECTOR_STRONG
39CFLAGS_REMOVE_sha256.o += -fstack-protector-strong
40CFLAGS_REMOVE_purgatory.o += -fstack-protector-strong
41CFLAGS_REMOVE_string.o += -fstack-protector-strong
42CFLAGS_REMOVE_kexec-purgatory.o += -fstack-protector-strong
43endif
44
45ifdef CONFIG_RETPOLINE
46CFLAGS_REMOVE_sha256.o += $(RETPOLINE_CFLAGS)
47CFLAGS_REMOVE_purgatory.o += $(RETPOLINE_CFLAGS)
48CFLAGS_REMOVE_string.o += $(RETPOLINE_CFLAGS)
49CFLAGS_REMOVE_kexec-purgatory.o += $(RETPOLINE_CFLAGS)
50endif
25 51
26$(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE52$(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE
27 $(call if_changed,ld)53 $(call if_changed,ld)
arch/x86/purgatory/purgatory.c+6−0
@@ -68,3 +68,9 @@ void purgatory(void) · 67 unmodified lines
68 }68 }
69 copy_backup_region();69 copy_backup_region();
70}70}
71
72/*
73 * Defined in order to reuse memcpy() and memset() from
74 * arch/x86/boot/compressed/string.c
75 */
76void 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
15void *memcpy(void *dst, const void *src, size_t len)
16{
17 return __builtin_memcpy(dst, src, len);
18}
19
20void *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
14 14
15#include <linux/linkage.h>15#include <linux/linkage.h>
16#include <asm/asm-offsets.h>16#include <asm/asm-offsets.h>
17#include <asm/asmmacro.h>
17#include <asm/processor.h>18#include <asm/processor.h>
18#include <asm/coprocessor.h>19#include <asm/coprocessor.h>
19#include <asm/thread_info.h>20#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
1924 * confirmed no later than during the next1924 * confirmed no later than during the next
1925 * I/O-plugging interval for bfqq.1925 * I/O-plugging interval for bfqq.
1926 */1926 */
1927 if (!bfq_bfqq_has_short_ttime(bfqq) &&1927 if (bfqd->last_completed_rq_bfqq &&
1928 !bfq_bfqq_has_short_ttime(bfqq) &&
1928 ktime_get_ns() - bfqd->last_completion <1929 ktime_get_ns() - bfqd->last_completion <
1929 200 * NSEC_PER_USEC) {1930 200 * NSEC_PER_USEC) {
1930 if (bfqd->last_completed_rq_bfqq != bfqq &&1931 if (bfqd->last_completed_rq_bfqq != bfqq &&
1931 bfqd->last_completed_rq_bfqq !=1932 bfqd->last_completed_rq_bfqq !=
1932 bfqq->waker_bfqq) {1933 bfqq->waker_bfqq) {
1933 /*1934 /*
1934 * First synchronization detected with1935 * First synchronization detected with
1935 * a candidate waker queue, or with a1936 * 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
2250 blk_rq_pos(container_of(rb_prev(&req->rb_node),2251 blk_rq_pos(container_of(rb_prev(&req->rb_node),
2251 struct request, rb_node))) {2252 struct request, rb_node))) {
2252 struct bfq_queue *bfqq = bfq_init_rq(req);2253 struct bfq_queue *bfqq = bfq_init_rq(req);
2253 struct bfq_data *bfqd = bfqq->bfqd;2254 struct bfq_data *bfqd;
2254 struct request *prev, *next_rq;2255 struct request *prev, *next_rq;
2255 2256
2257 if (!bfqq)
2258 return;
2259
2260 bfqd = bfqq->bfqd;
2261
2256 /* Reposition request in its sort_list */2262 /* Reposition request in its sort_list */
2257 elv_rb_del(&bfqq->sort_list, req);2263 elv_rb_del(&bfqq->sort_list, req);
2258 elv_rb_add(&bfqq->sort_list, req);2264 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
2299 struct bfq_queue *bfqq = bfq_init_rq(rq),2305 struct bfq_queue *bfqq = bfq_init_rq(rq),
2300 *next_bfqq = bfq_init_rq(next);2306 *next_bfqq = bfq_init_rq(next);
2301 2307
2308 if (!bfqq)
2309 return;
2310
2302 /*2311 /*
2303 * If next and rq belong to the same bfq_queue and next is older2312 * If next and rq belong to the same bfq_queue and next is older
2304 * than rq, then reposition rq in the fifo (by substituting next2313 * 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
4764 */4773 */
4765void bfq_put_queue(struct bfq_queue *bfqq)4774void bfq_put_queue(struct bfq_queue *bfqq)
4766{4775{
4776 struct bfq_queue *item;
4777 struct hlist_node *n;
4767#ifdef CONFIG_BFQ_GROUP_IOSCHED4778#ifdef CONFIG_BFQ_GROUP_IOSCHED
4768 struct bfq_group *bfqg = bfqq_group(bfqq);4779 struct bfq_group *bfqg = bfqq_group(bfqq);
4769#endif4780#endif
@@ -4808,6 +4819,36 @@ void bfq_put_queue(struct bfq_queue *bfqq) · 38 unmodified lines
4808 bfqq->bfqd->burst_size--;4819 bfqq->bfqd->burst_size--;
4809 }4820 }
4810 4821
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
4811 kmem_cache_free(bfq_pool, bfqq);4852 kmem_cache_free(bfq_pool, bfqq);
4812#ifdef CONFIG_BFQ_GROUP_IOSCHED4853#ifdef CONFIG_BFQ_GROUP_IOSCHED
4813 bfqg_and_blkg_put(bfqg);4854 bfqg_and_blkg_put(bfqg);
@@ -4835,9 +4876,6 @@ static void bfq_put_cooperator(struct bfq_queue *bfqq) · 21 unmodified lines
4835 4876
4836static void bfq_exit_bfqq(struct bfq_data *bfqd, struct bfq_queue *bfqq)4877static void bfq_exit_bfqq(struct bfq_data *bfqd, struct bfq_queue *bfqq)
4837{4878{
4838 struct bfq_queue *item;
4839 struct hlist_node *n;
4840
4841 if (bfqq == bfqd->in_service_queue) {4879 if (bfqq == bfqd->in_service_queue) {
4842 __bfq_bfqq_expire(bfqd, bfqq, BFQQE_BUDGET_TIMEOUT);4880 __bfq_bfqq_expire(bfqd, bfqq, BFQQE_BUDGET_TIMEOUT);
4843 bfq_schedule_dispatch(bfqd);4881 bfq_schedule_dispatch(bfqd);
@@ -4847,18 +4885,6 @@ static void bfq_exit_bfqq(struct bfq_data *bfqd, struct bfq_queue *bfqq) · 3 unmodified lines
4847 4885
4848 bfq_put_cooperator(bfqq);4886 bfq_put_cooperator(bfqq);
4849 4887
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
4862 bfq_put_queue(bfqq); /* release process reference */4888 bfq_put_queue(bfqq); /* release process reference */
4863}4889}
4864 4890
@@ -5436,12 +5462,12 @@ static void bfq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq, · 571 unmodified lines
5436 5462
5437 spin_lock_irq(&bfqd->lock);5463 spin_lock_irq(&bfqd->lock);
5438 bfqq = bfq_init_rq(rq);5464 bfqq = bfq_init_rq(rq);
5439 if (at_head || blk_rq_is_passthrough(rq)) {5465 if (!bfqq || at_head || blk_rq_is_passthrough(rq)) {
5440 if (at_head)5466 if (at_head)
5441 list_add(&rq->queuelist, &bfqd->dispatch);5467 list_add(&rq->queuelist, &bfqd->dispatch);
5442 else5468 else
5443 list_add_tail(&rq->queuelist, &bfqd->dispatch);5469 list_add_tail(&rq->queuelist, &bfqd->dispatch);
5444 } else { /* bfqq is assumed to be non null here */5470 } else {
5445 idle_timer_disabled = __bfq_insert_request(bfqd, rq);5471 idle_timer_disabled = __bfq_insert_request(bfqd, rq);
5446 /*5472 /*
5447 * Update bfqq, because, if a queue merge has occurred5473 * 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
232 if (device->power.flags.power_resources)232 if (device->power.flags.power_resources)
233 result = acpi_power_transition(device, target_state);233 result = acpi_power_transition(device, target_state);
234 } else {234 } else {
235 int cur_state = device->power.state;
236
235 if (device->power.flags.power_resources) {237 if (device->power.flags.power_resources) {
236 result = acpi_power_transition(device, ACPI_STATE_D0);238 result = acpi_power_transition(device, ACPI_STATE_D0);
237 if (result)239 if (result)
238 goto end;240 goto end;
239 }241 }
240 242
241 if (device->power.state == ACPI_STATE_D0) {243 if (cur_state == ACPI_STATE_D0) {
242 int psc;244 int psc;
243 245
244 /* Nothing to do here if _PSC is not present. */246 /* 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
2204 acpi_gpe_apply_masked_gpes();2204 acpi_gpe_apply_masked_gpes();
2205 acpi_update_all_gpes();2205 acpi_update_all_gpes();
2206 2206
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 */
2207 mutex_lock(&acpi_scan_lock);2213 mutex_lock(&acpi_scan_lock);
2208 /*2214 /*
2209 * Enumerate devices in the ACPI namespace.2215 * 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
338 hpriv->phys[port] = NULL;338 hpriv->phys[port] = NULL;
339 rc = 0;339 rc = 0;
340 break;340 break;
341 case -EPROBE_DEFER:
342 /* Do not complain yet */
343 break;
341 344
342 default:345 default:
343 dev_err(dev,346 dev_err(dev,
drivers/ata/libata-scsi.c+21−0
@@ -1786,6 +1786,21 @@ nothing_to_do: · 1785 unmodified lines
1786 return 1;1786 return 1;
1787}1787}
1788 1788
1789static 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
1789/**1804/**
1790 * ata_scsi_rw_xlat - Translate SCSI r/w command into an ATA one1805 * ata_scsi_rw_xlat - Translate SCSI r/w command into an ATA one
1791 * @qc: Storage for translated ATA taskfile1806 * @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
1830 scsi_10_lba_len(cdb, &block, &n_block);1845 scsi_10_lba_len(cdb, &block, &n_block);
1831 if (cdb[1] & (1 << 3))1846 if (cdb[1] & (1 << 3))
1832 tf_flags |= ATA_TFLAG_FUA;1847 tf_flags |= ATA_TFLAG_FUA;
1848 if (!ata_check_nblocks(scmd, n_block))
1849 goto invalid_fld;
1833 break;1850 break;
1834 case READ_6:1851 case READ_6:
1835 case WRITE_6:1852 case WRITE_6:
@@ -1844,6 +1861,8 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc) · 8 unmodified lines
1844 */1861 */
1845 if (!n_block)1862 if (!n_block)
1846 n_block = 256;1863 n_block = 256;
1864 if (!ata_check_nblocks(scmd, n_block))
1865 goto invalid_fld;
1847 break;1866 break;
1848 case READ_16:1867 case READ_16:
1849 case WRITE_16:1868 case WRITE_16:
@@ -1854,6 +1873,8 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc) · 4 unmodified lines
1854 scsi_16_lba_len(cdb, &block, &n_block);1873 scsi_16_lba_len(cdb, &block, &n_block);
1855 if (cdb[1] & (1 << 3))1874 if (cdb[1] & (1 << 3))
1856 tf_flags |= ATA_TFLAG_FUA;1875 tf_flags |= ATA_TFLAG_FUA;
1876 if (!ata_check_nblocks(scmd, n_block))
1877 goto invalid_fld;
1857 break;1878 break;
1858 default:1879 default:
1859 DPRINTK("no-byte command\n");1880 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
658 unsigned int offset;658 unsigned int offset;
659 unsigned char *buf;659 unsigned char *buf;
660 660
661 if (!qc->cursg) {
662 qc->curbytes = qc->nbytes;
663 return;
664 }
661 if (qc->curbytes == qc->nbytes - qc->sect_size)665 if (qc->curbytes == qc->nbytes - qc->sect_size)
662 ap->hsm_task_state = HSM_ST_LAST;666 ap->hsm_task_state = HSM_ST_LAST;
663 667
@@ -683,6 +687,8 @@ static void ata_pio_sector(struct ata_queued_cmd *qc) · 19 unmodified lines
683 687
684 if (qc->cursg_ofs == qc->cursg->length) {688 if (qc->cursg_ofs == qc->cursg->length) {
685 qc->cursg = sg_next(qc->cursg);689 qc->cursg = sg_next(qc->cursg);
690 if (!qc->cursg)
691 ap->hsm_task_state = HSM_ST_LAST;
686 qc->cursg_ofs = 0;692 qc->cursg_ofs = 0;
687 }693 }
688}694}
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
56 unsigned int ret;56 unsigned int ret;
57 struct rm_feature_desc *desc;57 struct rm_feature_desc *desc;
58 struct ata_taskfile tf;58 struct ata_taskfile tf;
59 static const char cdb[] = { GPCMD_GET_CONFIGURATION,59 static const char cdb[ATAPI_CDB_LEN] = { GPCMD_GET_CONFIGURATION,
60 2, /* only 1 feature descriptor requested */60 2, /* only 1 feature descriptor requested */
61 0, 3, /* 3, removable medium feature */61 0, 3, /* 3, removable medium feature */
62 0, 0, 0,/* reserved */62 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
158static int rb532_pata_driver_remove(struct platform_device *pdev)158static int rb532_pata_driver_remove(struct platform_device *pdev)
159{159{
160 struct ata_host *ah = platform_get_drvdata(pdev);160 struct ata_host *ah = platform_get_drvdata(pdev);
161 struct rb532_cf_info *info = ah->private_data;
162 161
163 ata_host_detach(ah);162 ata_host_detach(ah);
164 163
drivers/atm/iphase.c+6−2
@@ -63,6 +63,7 @@ · 62 unmodified lines
63#include <asm/byteorder.h> 63#include <asm/byteorder.h>
64#include <linux/vmalloc.h>64#include <linux/vmalloc.h>
65#include <linux/jiffies.h>65#include <linux/jiffies.h>
66#include <linux/nospec.h>
66#include "iphase.h" 67#include "iphase.h"
67#include "suni.h" 68#include "suni.h"
68#define swap_byte_order(x) (((x & 0xff) << 8) | ((x & 0xff00) >> 8))69#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
2760 }2761 }
2761 if (copy_from_user(&ia_cmds, arg, sizeof ia_cmds)) return -EFAULT; 2762 if (copy_from_user(&ia_cmds, arg, sizeof ia_cmds)) return -EFAULT;
2762 board = ia_cmds.status;2763 board = ia_cmds.status;
2763 if ((board < 0) || (board > iadev_count))2764
2764 board = 0; 2765 if ((board < 0) || (board > iadev_count))
2766 board = 0;
2767 board = array_index_nospec(board, iadev_count + 1);
2768
2765 iadev = ia_dev[board];2769 iadev = ia_dev[board];
2766 switch (ia_cmds.cmd) {2770 switch (ia_cmds.cmd) {
2767 case MEMDUMP:2771 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
1823 */1823 */
1824static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir)1824static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir)
1825{1825{
1826 unsigned int ref;
1827
1826 /* see if we live in a "glue" directory */1828 /* see if we live in a "glue" directory */
1827 if (!live_in_glue_dir(glue_dir, dev))1829 if (!live_in_glue_dir(glue_dir, dev))
1828 return;1830 return;
1829 1831
1830 mutex_lock(&gdp_mutex);1832 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)
1832 kobject_del(glue_dir);1883 kobject_del(glue_dir);
1833 kobject_put(glue_dir);1884 kobject_put(glue_dir);
1834 mutex_unlock(&gdp_mutex);1885 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
157 * the device will only expose one IRQ, and this fallback157 * the device will only expose one IRQ, and this fallback
158 * allows a common code path across either kind of resource.158 * allows a common code path across either kind of resource.
159 */159 */
160 if (num == 0 && has_acpi_companion(&dev->dev))160 if (num == 0 && has_acpi_companion(&dev->dev)) {
161 return acpi_dev_gpio_irq_get(ACPI_COMPANION(&dev->dev), num);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 }
162 167
163 return -ENXIO;168 return -ENXIO;
164#endif169#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
323 }323 }
324 324
325 flush_scheduled_work();325 flush_scheduled_work();
326 /* pass one: without sleeping, do aoedev_downdev */326 /* pass one: do aoedev_downdev, which might sleep */
327restart1:
327 spin_lock_irqsave(&devlist_lock, flags);328 spin_lock_irqsave(&devlist_lock, flags);
328 for (d = devlist; d; d = d->next) {329 for (d = devlist; d; d = d->next) {
329 spin_lock(&d->lock);330 spin_lock(&d->lock);
331 if (d->flags & DEVFL_TKILL)
332 goto cont;
333
330 if (exiting) {334 if (exiting) {
331 /* unconditionally take each device down */335 /* unconditionally take each device down */
332 } else if (specified) {336 } else if (specified) {
@@ -338,8 +342,11 @@ flush(const char __user *str, size_t cnt, int exiting) · 5 unmodified lines
338 || d->ref)342 || d->ref)
339 goto cont;343 goto cont;
340 344
345 spin_unlock(&d->lock);
346 spin_unlock_irqrestore(&devlist_lock, flags);
341 aoedev_downdev(d);347 aoedev_downdev(d);
342 d->flags |= DEVFL_TKILL;348 d->flags |= DEVFL_TKILL;
349 goto restart1;
343cont:350cont:
344 spin_unlock(&d->lock);351 spin_unlock(&d->lock);
345 }352 }
@@ -348,7 +355,7 @@ cont: · 2 unmodified lines
348 /* pass two: call freedev, which might sleep,355 /* pass two: call freedev, which might sleep,
349 * for aoedevs marked with DEVFL_TKILL356 * for aoedevs marked with DEVFL_TKILL
350 */357 */
351restart:358restart2:
352 spin_lock_irqsave(&devlist_lock, flags);359 spin_lock_irqsave(&devlist_lock, flags);
353 for (d = devlist; d; d = d->next) {360 for (d = devlist; d; d = d->next) {
354 spin_lock(&d->lock);361 spin_lock(&d->lock);
@@ -357,7 +364,7 @@ restart: · 2 unmodified lines
357 spin_unlock(&d->lock);364 spin_unlock(&d->lock);
358 spin_unlock_irqrestore(&devlist_lock, flags);365 spin_unlock_irqrestore(&devlist_lock, flags);
359 freedev(d);366 freedev(d);
360 goto restart;367 goto restart2;
361 }368 }
362 spin_unlock(&d->lock);369 spin_unlock(&d->lock);
363 }370 }
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
1726 /* MSch: invalidate default_params */1726 /* MSch: invalidate default_params */
1727 default_params[drive].blocks = 0;1727 default_params[drive].blocks = 0;
1728 set_capacity(floppy->disk, MAX_DISK_SIZE * 2);1728 set_capacity(floppy->disk, MAX_DISK_SIZE * 2);
1729 /* Fall through */
1729 case FDFMTEND:1730 case FDFMTEND:
1730 case FDFLUSH:1731 case FDFLUSH:
1731 /* invalidate the buffer track to force a reread */1732 /* 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
885 885
886static int loop_kthread_worker_fn(void *worker_ptr)886static int loop_kthread_worker_fn(void *worker_ptr)
887{887{
888 current->flags |= PF_LESS_THROTTLE;888 current->flags |= PF_LESS_THROTTLE | PF_MEMALLOC_NOIO;
889 return kthread_worker_fn(worker_ptr);889 return kthread_worker_fn(worker_ptr);
890}890}
891 891
@@ -924,6 +924,7 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode, · 32 unmodified lines
924 struct file *file;924 struct file *file;
925 struct inode *inode;925 struct inode *inode;
926 struct address_space *mapping;926 struct address_space *mapping;
927 struct block_device *claimed_bdev = NULL;
927 int lo_flags = 0;928 int lo_flags = 0;
928 int error;929 int error;
929 loff_t size;930 loff_t size;
@@ -942,10 +943,11 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode, · 12 unmodified lines
942 * here to avoid changing device under exclusive owner.943 * here to avoid changing device under exclusive owner.
943 */944 */
944 if (!(mode & FMODE_EXCL)) {945 if (!(mode & FMODE_EXCL)) {
945 bdgrab(bdev);946 claimed_bdev = bd_start_claiming(bdev, loop_set_fd);
946 error = blkdev_get(bdev, mode | FMODE_EXCL, loop_set_fd);947 if (IS_ERR(claimed_bdev)) {
947 if (error)948 error = PTR_ERR(claimed_bdev);
948 goto out_putf;949 goto out_putf;
950 }
949 }951 }
950 952
951 error = mutex_lock_killable(&loop_ctl_mutex);953 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
1015 mutex_unlock(&loop_ctl_mutex);1017 mutex_unlock(&loop_ctl_mutex);
1016 if (partscan)1018 if (partscan)
1017 loop_reread_partitions(lo, bdev);1019 loop_reread_partitions(lo, bdev);
1018 if (!(mode & FMODE_EXCL))1020 if (claimed_bdev)
1019 blkdev_put(bdev, mode | FMODE_EXCL);1021 bd_abort_claiming(bdev, claimed_bdev, loop_set_fd);
1020 return 0;1022 return 0;
1021 1023
1022out_unlock:1024out_unlock:
1023 mutex_unlock(&loop_ctl_mutex);1025 mutex_unlock(&loop_ctl_mutex);
1024out_bdev:1026out_bdev:
1025 if (!(mode & FMODE_EXCL))1027 if (claimed_bdev)
1026 blkdev_put(bdev, mode | FMODE_EXCL);1028 bd_abort_claiming(bdev, claimed_bdev, loop_set_fd);
1027out_putf:1029out_putf:
1028 fput(file);1030 fput(file);
1029out:1031out:
drivers/block/nbd.c+1−1
@@ -1231,7 +1231,7 @@ static void nbd_clear_sock_ioctl(struct nbd_device *nbd, · 1230 unmodified lines
1231 struct block_device *bdev)1231 struct block_device *bdev)
1232{1232{
1233 sock_shutdown(nbd);1233 sock_shutdown(nbd);
1234 kill_bdev(bdev);1234 __invalidate_device(bdev, true);
1235 nbd_bdev_reset(bdev);1235 nbd_bdev_reset(bdev);
1236 if (test_and_clear_bit(NBD_HAS_CONFIG_REF,1236 if (test_and_clear_bit(NBD_HAS_CONFIG_REF,
1237 &nbd->config->runtime_flags))1237 &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
98 98
99 BT_DBG("hu %p", hu);99 BT_DBG("hu %p", hu);
100 100
101 if (!hci_uart_has_flow_control(hu))
102 return -EOPNOTSUPP;
103
101 ath = kzalloc(sizeof(*ath), GFP_KERNEL);104 ath = kzalloc(sizeof(*ath), GFP_KERNEL);
102 if (!ath)105 if (!ath)
103 return -ENOMEM;106 return -ENOMEM;
drivers/bluetooth/hci_bcm.c+3−0
@@ -406,6 +406,9 @@ static int bcm_open(struct hci_uart *hu) · 405 unmodified lines
406 406
407 bt_dev_dbg(hu->hdev, "hu %p", hu);407 bt_dev_dbg(hu->hdev, "hu %p", hu);
408 408
409 if (!hci_uart_has_flow_control(hu))
410 return -EOPNOTSUPP;
411
409 bcm = kzalloc(sizeof(*bcm), GFP_KERNEL);412 bcm = kzalloc(sizeof(*bcm), GFP_KERNEL);
410 if (!bcm)413 if (!bcm)
411 return -ENOMEM;414 return -ENOMEM;
drivers/bluetooth/hci_intel.c+3−0
@@ -391,6 +391,9 @@ static int intel_open(struct hci_uart *hu) · 390 unmodified lines
391 391
392 BT_DBG("hu %p", hu);392 BT_DBG("hu %p", hu);
393 393
394 if (!hci_uart_has_flow_control(hu))
395 return -EOPNOTSUPP;
396
394 intel = kzalloc(sizeof(*intel), GFP_KERNEL);397 intel = kzalloc(sizeof(*intel), GFP_KERNEL);
395 if (!intel)398 if (!intel)
396 return -ENOMEM;399 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
292 return 0;292 return 0;
293}293}
294 294
295/* Check the underlying device or tty has flow control support */
296bool 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
295/* Flow control or un-flow control the device */308/* Flow control or un-flow control the device */
296void hci_uart_set_flow_control(struct hci_uart *hu, bool enable)309void hci_uart_set_flow_control(struct hci_uart *hu, bool enable)
297{310{
drivers/bluetooth/hci_mrvl.c+3−0
@@ -59,6 +59,9 @@ static int mrvl_open(struct hci_uart *hu) · 58 unmodified lines
59 59
60 BT_DBG("hu %p", hu);60 BT_DBG("hu %p", hu);
61 61
62 if (!hci_uart_has_flow_control(hu))
63 return -EOPNOTSUPP;
64
62 mrvl = kzalloc(sizeof(*mrvl), GFP_KERNEL);65 mrvl = kzalloc(sizeof(*mrvl), GFP_KERNEL);
63 if (!mrvl)66 if (!mrvl)
64 return -ENOMEM;67 return -ENOMEM;
drivers/bluetooth/hci_qca.c+3−0
@@ -473,6 +473,9 @@ static int qca_open(struct hci_uart *hu) · 472 unmodified lines
473 473
474 BT_DBG("hu %p qca_open", hu);474 BT_DBG("hu %p qca_open", hu);
475 475
476 if (!hci_uart_has_flow_control(hu))
477 return -EOPNOTSUPP;
478
476 qca = kzalloc(sizeof(struct qca_data), GFP_KERNEL);479 qca = kzalloc(sizeof(struct qca_data), GFP_KERNEL);
477 if (!qca)480 if (!qca)
478 return -ENOMEM;481 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
104int hci_uart_init_ready(struct hci_uart *hu);104int hci_uart_init_ready(struct hci_uart *hu);
105void hci_uart_init_work(struct work_struct *work);105void hci_uart_init_work(struct work_struct *work);
106void hci_uart_set_baudrate(struct hci_uart *hu, unsigned int speed);106void hci_uart_set_baudrate(struct hci_uart *hu, unsigned int speed);
107bool hci_uart_has_flow_control(struct hci_uart *hu);
107void hci_uart_set_flow_control(struct hci_uart *hu, bool enable);108void hci_uart_set_flow_control(struct hci_uart *hu, bool enable);
108void hci_uart_set_speeds(struct hci_uart *hu, unsigned int init_speed,109void hci_uart_set_speeds(struct hci_uart *hu, unsigned int init_speed,
109 unsigned int oper_speed);110 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
76 struct ipmb_dev *ipmb_dev = to_ipmb_dev(file);76 struct ipmb_dev *ipmb_dev = to_ipmb_dev(file);
77 struct ipmb_request_elem *queue_elem;77 struct ipmb_request_elem *queue_elem;
78 struct ipmb_msg msg;78 struct ipmb_msg msg;
79 ssize_t ret;79 ssize_t ret = 0;
80 80
81 memset(&msg, 0, sizeof(msg));81 memset(&msg, 0, sizeof(msg));
82 82
drivers/char/tpm/tpm-chip.c+36−7
@@ -77,6 +77,18 @@ static int tpm_go_idle(struct tpm_chip *chip) · 76 unmodified lines
77 return chip->ops->go_idle(chip);77 return chip->ops->go_idle(chip);
78}78}
79 79
80static void tpm_clk_enable(struct tpm_chip *chip)
81{
82 if (chip->ops->clk_enable)
83 chip->ops->clk_enable(chip, true);
84}
85
86static void tpm_clk_disable(struct tpm_chip *chip)
87{
88 if (chip->ops->clk_enable)
89 chip->ops->clk_enable(chip, false);
90}
91
80/**92/**
81 * tpm_chip_start() - power on the TPM93 * tpm_chip_start() - power on the TPM
82 * @chip: a TPM chip to use94 * @chip: a TPM chip to use
@@ -89,13 +101,12 @@ int tpm_chip_start(struct tpm_chip *chip) · 6 unmodified lines
89{101{
90 int ret;102 int ret;
91 103
92 if (chip->ops->clk_enable)104 tpm_clk_enable(chip);
93 chip->ops->clk_enable(chip, true);
94 105
95 if (chip->locality == -1) {106 if (chip->locality == -1) {
96 ret = tpm_request_locality(chip);107 ret = tpm_request_locality(chip);
97 if (ret) {108 if (ret) {
98 chip->ops->clk_enable(chip, false);109 tpm_clk_disable(chip);
99 return ret;110 return ret;
100 }111 }
101 }112 }
@@ -103,8 +114,7 @@ int tpm_chip_start(struct tpm_chip *chip) · 1 unmodified line
103 ret = tpm_cmd_ready(chip);114 ret = tpm_cmd_ready(chip);
104 if (ret) {115 if (ret) {
105 tpm_relinquish_locality(chip);116 tpm_relinquish_locality(chip);
106 if (chip->ops->clk_enable)117 tpm_clk_disable(chip);
107 chip->ops->clk_enable(chip, false);
108 return ret;118 return ret;
109 }119 }
110 120
@@ -124,8 +134,7 @@ void tpm_chip_stop(struct tpm_chip *chip) · 13 unmodified lines
124{134{
125 tpm_go_idle(chip);135 tpm_go_idle(chip);
126 tpm_relinquish_locality(chip);136 tpm_relinquish_locality(chip);
127 if (chip->ops->clk_enable)137 tpm_clk_disable(chip);
128 chip->ops->clk_enable(chip, false);
129}138}
130EXPORT_SYMBOL_GPL(tpm_chip_stop);139EXPORT_SYMBOL_GPL(tpm_chip_stop);
131 140
@@ -545,6 +554,20 @@ static int tpm_add_hwrng(struct tpm_chip *chip) · 413 unmodified lines
545 return hwrng_register(&chip->hwrng);554 return hwrng_register(&chip->hwrng);
546}555}
547 556
557static 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
548/*571/*
549 * tpm_chip_register() - create a character device for the TPM chip572 * tpm_chip_register() - create a character device for the TPM chip
550 * @chip: TPM chip to use.573 * @chip: TPM chip to use.
@@ -564,6 +587,12 @@ int tpm_chip_register(struct tpm_chip *chip) · 13 unmodified lines
564 if (rc)587 if (rc)
565 return rc;588 return rc;
566 rc = tpm_auto_startup(chip);589 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);
567 tpm_chip_stop(chip);596 tpm_chip_stop(chip);
568 if (rc)597 if (rc)
569 return rc;598 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
394ssize_t tpm1_getcap(struct tpm_chip *chip, u32 subcap_id, cap_t *cap,394ssize_t tpm1_getcap(struct tpm_chip *chip, u32 subcap_id, cap_t *cap,
395 const char *desc, size_t min_cap_length);395 const char *desc, size_t min_cap_length);
396int tpm1_get_random(struct tpm_chip *chip, u8 *out, size_t max);396int tpm1_get_random(struct tpm_chip *chip, u8 *out, size_t max);
397int tpm1_get_pcr_allocation(struct tpm_chip *chip);
397unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip, u32 ordinal);398unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip, u32 ordinal);
398int tpm_pm_suspend(struct device *dev);399int tpm_pm_suspend(struct device *dev);
399int tpm_pm_resume(struct device *dev);400int tpm_pm_resume(struct device *dev);
@@ -449,6 +450,7 @@ int tpm2_unseal_trusted(struct tpm_chip *chip, · 49 unmodified lines
449ssize_t tpm2_get_tpm_pt(struct tpm_chip *chip, u32 property_id,450ssize_t tpm2_get_tpm_pt(struct tpm_chip *chip, u32 property_id,
450 u32 *value, const char *desc);451 u32 *value, const char *desc);
451 452
453ssize_t tpm2_get_pcr_allocation(struct tpm_chip *chip);
452int tpm2_auto_startup(struct tpm_chip *chip);454int tpm2_auto_startup(struct tpm_chip *chip);
453void tpm2_shutdown(struct tpm_chip *chip, u16 shutdown_type);455void tpm2_shutdown(struct tpm_chip *chip, u16 shutdown_type);
454unsigned long tpm2_calc_ordinal_duration(struct tpm_chip *chip, u32 ordinal);456unsigned 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
699 goto out;699 goto out;
700 }700 }
701 701
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
714 return rc;702 return rc;
715out:703out:
716 if (rc > 0)704 if (rc > 0)
@@ -779,3 +767,27 @@ int tpm1_pm_suspend(struct tpm_chip *chip, u32 tpm_suspend_pcr) · 62 unmodified lines
779 return rc;767 return rc;
780}768}
781 769
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 */
780int 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
840 u8 pcr_select[3];840 u8 pcr_select[3];
841} __packed;841} __packed;
842 842
843static ssize_t tpm2_get_pcr_allocation(struct tpm_chip *chip)843ssize_t tpm2_get_pcr_allocation(struct tpm_chip *chip)
844{844{
845 struct tpm2_pcr_selection pcr_selection;845 struct tpm2_pcr_selection pcr_selection;
846 struct tpm_buf buf;846 struct tpm_buf buf;
@@ -1040,10 +1040,6 @@ int tpm2_auto_startup(struct tpm_chip *chip) · 193 unmodified lines
1040 goto out;1040 goto out;
1041 }1041 }
1042 1042
1043 rc = tpm2_get_pcr_allocation(chip);
1044 if (rc)
1045 goto out;
1046
1047 rc = tpm2_get_cc_attrs_tbl(chip);1043 rc = tpm2_get_cc_attrs_tbl(chip);
1048 1044
1049out:1045out:
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
141 continue;141 continue;
142 142
143 div = DIV_ROUND_CLOSEST(parent_rate, req->rate);143 div = DIV_ROUND_CLOSEST(parent_rate, req->rate);
144 if (div > GENERATED_MAX_DIV + 1)
145 div = GENERATED_MAX_DIV + 1;
144 146
145 clk_generated_best_diff(req, parent, parent_rate, div,147 clk_generated_best_diff(req, parent, parent_rate, div,
146 &best_diff, &best_rate);148 &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
25 FIXED_CLK(CLK_TOP_UNIVP_192M, "univpll_192m", "univpll", 192000000),25 FIXED_CLK(CLK_TOP_UNIVP_192M, "univpll_192m", "univpll", 192000000),
26};26};
27 27
28static const struct mtk_fixed_factor top_early_divs[] = {
29 FACTOR(CLK_TOP_CLK13M, "clk13m", "clk26m", 1, 2),
30};
31
28static const struct mtk_fixed_factor top_divs[] = {32static const struct mtk_fixed_factor top_divs[] = {
29 FACTOR(CLK_TOP_CLK13M, "clk13m", "clk26m", 1,
30 2),
31 FACTOR(CLK_TOP_F26M_CK_D2, "csw_f26m_ck_d2", "clk26m", 1,33 FACTOR(CLK_TOP_F26M_CK_D2, "csw_f26m_ck_d2", "clk26m", 1,
32 2),34 2),
33 FACTOR(CLK_TOP_SYSPLL_CK, "syspll_ck", "mainpll", 1,35 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
1148 return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);1150 return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
1149}1151}
1150 1152
1153static struct clk_onecell_data *top_clk_data;
1154
1155static 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
1170CLK_OF_DECLARE_DRIVER(mt8183_topckgen, "mediatek,mt8183-topckgen",
1171 clk_mt8183_top_init_early);
1172
1151static int clk_mt8183_top_probe(struct platform_device *pdev)1173static int clk_mt8183_top_probe(struct platform_device *pdev)
1152{1174{
1153 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);1175 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1154 void __iomem *base;1176 void __iomem *base;
1155 struct clk_onecell_data *clk_data;
1156 struct device_node *node = pdev->dev.of_node;1177 struct device_node *node = pdev->dev.of_node;
1157 1178
1158 base = devm_ioremap_resource(&pdev->dev, res);1179 base = devm_ioremap_resource(&pdev->dev, res);
1159 if (IS_ERR(base))1180 if (IS_ERR(base))
1160 return PTR_ERR(base);1181 return PTR_ERR(base);
1161 1182
1162 clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK);
1163
1164 mtk_clk_register_fixed_clks(top_fixed_clks, ARRAY_SIZE(top_fixed_clks),1183 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);
1166 1188
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);
1168 1190
1169 mtk_clk_register_muxes(top_muxes, ARRAY_SIZE(top_muxes),1191 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);
1171 1193
1172 mtk_clk_register_composites(top_aud_muxes, ARRAY_SIZE(top_aud_muxes),1194 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);
1174 1196
1175 mtk_clk_register_composites(top_aud_divs, ARRAY_SIZE(top_aud_divs),1197 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);
1177 1199
1178 mtk_clk_register_gates(node, top_clks, ARRAY_SIZE(top_clks),1200 mtk_clk_register_gates(node, top_clks, ARRAY_SIZE(top_clks),
1179 clk_data);1201 top_clk_data);
1180 1202
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);
1182}1204}
1183 1205
1184static int clk_mt8183_infra_probe(struct platform_device *pdev)1206static 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
572 unsigned int reg = id / 32;572 unsigned int reg = id / 32;
573 unsigned int bit = id % 32;573 unsigned int bit = id % 32;
574 u32 bitmask = BIT(bit);574 u32 bitmask = BIT(bit);
575 unsigned long flags;
576 u32 value;
577 575
578 dev_dbg(priv->dev, "reset %u%02u\n", reg, bit);576 dev_dbg(priv->dev, "reset %u%02u\n", reg, bit);
579 577
580 /* Reset module */578 /* Reset module */
581 spin_lock_irqsave(&priv->rmw_lock, flags);579 writel(bitmask, priv->base + SRCR(reg));
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);
586 580
587 /* Wait for at least one cycle of the RCLK clock (@ ca. 32 kHz) */581 /* Wait for at least one cycle of the RCLK clock (@ ca. 32 kHz) */
588 udelay(35);582 udelay(35);
@@ -599,16 +593,10 @@ static int cpg_mssr_assert(struct reset_controller_dev *rcdev, unsigned long id) · 10 unmodified lines
599 unsigned int reg = id / 32;593 unsigned int reg = id / 32;
600 unsigned int bit = id % 32;594 unsigned int bit = id % 32;
601 u32 bitmask = BIT(bit);595 u32 bitmask = BIT(bit);
602 unsigned long flags;
603 u32 value;
604 596
605 dev_dbg(priv->dev, "assert %u%02u\n", reg, bit);597 dev_dbg(priv->dev, "assert %u%02u\n", reg, bit);
606 598
607 spin_lock_irqsave(&priv->rmw_lock, flags);599 writel(bitmask, priv->base + SRCR(reg));
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);
612 return 0;600 return 0;
613}601}
614 602
drivers/clk/sprd/Kconfig+1−0
@@ -3,6 +3,7 @@ config SPRD_COMMON_CLK · 2 unmodified lines
3 tristate "Clock support for Spreadtrum SoCs"3 tristate "Clock support for Spreadtrum SoCs"
4 depends on ARCH_SPRD || COMPILE_TEST4 depends on ARCH_SPRD || COMPILE_TEST
5 default ARCH_SPRD5 default ARCH_SPRD
6 select REGMAP_MMIO
6 7
7if SPRD_COMMON_CLK8if SPRD_COMMON_CLK
8 9
drivers/clocksource/timer-riscv.c+2−4
@@ -55,7 +55,7 @@ static u64 riscv_sched_clock(void) · 54 unmodified lines
55 return get_cycles64();55 return get_cycles64();
56}56}
57 57
58static DEFINE_PER_CPU(struct clocksource, riscv_clocksource) = {58static struct clocksource riscv_clocksource = {
59 .name = "riscv_clocksource",59 .name = "riscv_clocksource",
60 .rating = 300,60 .rating = 300,
61 .mask = CLOCKSOURCE_MASK(64),61 .mask = CLOCKSOURCE_MASK(64),
@@ -92,7 +92,6 @@ void riscv_timer_interrupt(void) · 30 unmodified lines
92static int __init riscv_timer_init_dt(struct device_node *n)92static int __init riscv_timer_init_dt(struct device_node *n)
93{93{
94 int cpuid, hartid, error;94 int cpuid, hartid, error;
95 struct clocksource *cs;
96 95
97 hartid = riscv_of_processor_hartid(n);96 hartid = riscv_of_processor_hartid(n);
98 if (hartid < 0) {97 if (hartid < 0) {
@@ -112,8 +111,7 @@ static int __init riscv_timer_init_dt(struct device_node *n) · 13 unmodified lines
112 111
113 pr_info("%s: Registering clocksource cpuid [%d] hartid [%d]\n",112 pr_info("%s: Registering clocksource cpuid [%d] hartid [%d]\n",
114 __func__, cpuid, hartid);113 __func__, cpuid, hartid);
115 cs = per_cpu_ptr(&riscv_clocksource, cpuid);114 error = clocksource_register_hz(&riscv_clocksource, riscv_timebase);
116 error = clocksource_register_hz(cs, riscv_timebase);
117 if (error) {115 if (error) {
118 pr_err("RISCV timer register failed [%d] for cpu = [%d]\n",116 pr_err("RISCV timer register failed [%d] for cpu = [%d]\n",
119 error, cpuid);117 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
58static int ccp_aes_gcm_setauthsize(struct crypto_aead *tfm,58static int ccp_aes_gcm_setauthsize(struct crypto_aead *tfm,
59 unsigned int authsize)59 unsigned int authsize)
60{60{
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
61 return 0;74 return 0;
62}75}
63 76
@@ -104,6 +117,7 @@ static int ccp_aes_gcm_crypt(struct aead_request *req, bool encrypt) · 40 unmodified lines
104 memset(&rctx->cmd, 0, sizeof(rctx->cmd));117 memset(&rctx->cmd, 0, sizeof(rctx->cmd));
105 INIT_LIST_HEAD(&rctx->cmd.entry);118 INIT_LIST_HEAD(&rctx->cmd.entry);
106 rctx->cmd.engine = CCP_ENGINE_AES;119 rctx->cmd.engine = CCP_ENGINE_AES;
120 rctx->cmd.u.aes.authsize = crypto_aead_authsize(tfm);
107 rctx->cmd.u.aes.type = ctx->u.aes.type;121 rctx->cmd.u.aes.type = ctx->u.aes.type;
108 rctx->cmd.u.aes.mode = ctx->u.aes.mode;122 rctx->cmd.u.aes.mode = ctx->u.aes.mode;
109 rctx->cmd.u.aes.action = encrypt;123 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
622 622
623 unsigned long long *final;623 unsigned long long *final;
624 unsigned int dm_offset;624 unsigned int dm_offset;
625 unsigned int authsize;
625 unsigned int jobid;626 unsigned int jobid;
626 unsigned int ilen;627 unsigned int ilen;
627 bool in_place = true; /* Default value */628 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
643 if (!aes->key) /* Gotta have a key SGL */644 if (!aes->key) /* Gotta have a key SGL */
644 return -EINVAL;645 return -EINVAL;
645 646
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
646 /* First, decompose the source buffer into AAD & PT,662 /* First, decompose the source buffer into AAD & PT,
647 * and the destination buffer into AAD, CT & tag, or663 * and the destination buffer into AAD, CT & tag, or
648 * the input into CT & tag.664 * 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
657 p_tag = scatterwalk_ffwd(sg_tag, p_outp, ilen);673 p_tag = scatterwalk_ffwd(sg_tag, p_outp, ilen);
658 } else {674 } else {
659 /* Input length for decryption includes tag */675 /* Input length for decryption includes tag */
660 ilen = aes->src_len - AES_BLOCK_SIZE;676 ilen = aes->src_len - authsize;
661 p_tag = scatterwalk_ffwd(sg_tag, p_inp, ilen);677 p_tag = scatterwalk_ffwd(sg_tag, p_inp, ilen);
662 }678 }
663 679
@@ -766,8 +782,7 @@ static int ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q, · 102 unmodified lines
766 while (src.sg_wa.bytes_left) {782 while (src.sg_wa.bytes_left) {
767 ccp_prepare_data(&src, &dst, &op, AES_BLOCK_SIZE, true);783 ccp_prepare_data(&src, &dst, &op, AES_BLOCK_SIZE, true);
768 if (!src.sg_wa.bytes_left) {784 if (!src.sg_wa.bytes_left) {
769 unsigned int nbytes = aes->src_len785 unsigned int nbytes = ilen % AES_BLOCK_SIZE;
770 % AES_BLOCK_SIZE;
771 786
772 if (nbytes) {787 if (nbytes) {
773 op.eom = 1;788 op.eom = 1;
@@ -839,19 +854,19 @@ static int ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q, · 65 unmodified lines
839 854
840 if (aes->action == CCP_AES_ACTION_ENCRYPT) {855 if (aes->action == CCP_AES_ACTION_ENCRYPT) {
841 /* Put the ciphered tag after the ciphertext. */856 /* 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);
843 } else {858 } else {
844 /* Does this ciphered tag match the input? */859 /* 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,
846 DMA_BIDIRECTIONAL);861 DMA_BIDIRECTIONAL);
847 if (ret)862 if (ret)
848 goto e_tag;863 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);
850 if (ret)865 if (ret)
851 goto e_tag;866 goto e_tag;
852 867
853 ret = crypto_memneq(tag.address, final_wa.address,868 ret = crypto_memneq(tag.address, final_wa.address,
854 AES_BLOCK_SIZE) ? -EBADMSG : 0;869 authsize) ? -EBADMSG : 0;
855 ccp_dm_free(&tag);870 ccp_dm_free(&tag);
856 }871 }
857 872
@@ -859,11 +874,11 @@ e_tag: · 1 unmodified line
859 ccp_dm_free(&final_wa);874 ccp_dm_free(&final_wa);
860 875
861e_dst:876e_dst:
862 if (aes->src_len && !in_place)877 if (ilen > 0 && !in_place)
863 ccp_free_data(&dst, cmd_q);878 ccp_free_data(&dst, cmd_q);
864 879
865e_src:880e_src:
866 if (aes->src_len)881 if (ilen > 0)
867 ccp_free_data(&src, cmd_q);882 ccp_free_data(&src, cmd_q);
868 883
869e_aad:884e_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
314 case CRYP_KEY_SIZE_256:314 case CRYP_KEY_SIZE_256:
315 ctx->key_4_l = readl_relaxed(&src_reg->key_4_l);315 ctx->key_4_l = readl_relaxed(&src_reg->key_4_l);
316 ctx->key_4_r = readl_relaxed(&src_reg->key_4_r);316 ctx->key_4_r = readl_relaxed(&src_reg->key_4_r);
317 /* Fall through */
317 318
318 case CRYP_KEY_SIZE_192:319 case CRYP_KEY_SIZE_192:
319 ctx->key_3_l = readl_relaxed(&src_reg->key_3_l);320 ctx->key_3_l = readl_relaxed(&src_reg->key_3_l);
320 ctx->key_3_r = readl_relaxed(&src_reg->key_3_r);321 ctx->key_3_r = readl_relaxed(&src_reg->key_3_r);
322 /* Fall through */
321 323
322 case CRYP_KEY_SIZE_128:324 case CRYP_KEY_SIZE_128:
323 ctx->key_2_l = readl_relaxed(&src_reg->key_2_l);325 ctx->key_2_l = readl_relaxed(&src_reg->key_2_l);
324 ctx->key_2_r = readl_relaxed(&src_reg->key_2_r);326 ctx->key_2_r = readl_relaxed(&src_reg->key_2_r);
327 /* Fall through */
325 328
326 default:329 default:
327 ctx->key_1_l = readl_relaxed(&src_reg->key_1_l);330 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
361 case CRYP_KEY_SIZE_256:364 case CRYP_KEY_SIZE_256:
362 writel_relaxed(ctx->key_4_l, &reg->key_4_l);365 writel_relaxed(ctx->key_4_l, &reg->key_4_l);
363 writel_relaxed(ctx->key_4_r, &reg->key_4_r);366 writel_relaxed(ctx->key_4_r, &reg->key_4_r);
367 /* Fall through */
364 368
365 case CRYP_KEY_SIZE_192:369 case CRYP_KEY_SIZE_192:
366 writel_relaxed(ctx->key_3_l, &reg->key_3_l);370 writel_relaxed(ctx->key_3_l, &reg->key_3_l);
367 writel_relaxed(ctx->key_3_r, &reg->key_3_r);371 writel_relaxed(ctx->key_3_r, &reg->key_3_r);
372 /* Fall through */
368 373
369 case CRYP_KEY_SIZE_128:374 case CRYP_KEY_SIZE_128:
370 writel_relaxed(ctx->key_2_l, &reg->key_2_l);375 writel_relaxed(ctx->key_2_l, &reg->key_2_l);
371 writel_relaxed(ctx->key_2_r, &reg->key_2_r);376 writel_relaxed(ctx->key_2_r, &reg->key_2_r);
377 /* Fall through */
372 378
373 default:379 default:
374 writel_relaxed(ctx->key_1_l, &reg->key_1_l);380 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
956 }956 }
957 957
958 if (eflags & GPIOEVENT_REQUEST_RISING_EDGE)958 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;
960 if (eflags & GPIOEVENT_REQUEST_FALLING_EDGE)961 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;
962 irqflags |= IRQF_ONESHOT;964 irqflags |= IRQF_ONESHOT;
963 965
964 INIT_KFIFO(le->events);966 INIT_KFIFO(le->events);
@@ -1392,12 +1394,17 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, · 427 unmodified lines
1392 for (i = 0; i < chip->ngpio; i++) {1394 for (i = 0; i < chip->ngpio; i++) {
1393 struct gpio_desc *desc = &gdev->descs[i];1395 struct gpio_desc *desc = &gdev->descs[i];
1394 1396
1395 if (chip->get_direction && gpiochip_line_is_valid(chip, i))1397 if (chip->get_direction && gpiochip_line_is_valid(chip, i)) {
1396 desc->flags = !chip->get_direction(chip, i) ?1398 if (!chip->get_direction(chip, i))
1397 (1 << FLAG_IS_OUT) : 0;1399 set_bit(FLAG_IS_OUT, &desc->flags);
1398 else1400 else
1399 desc->flags = !chip->direction_input ?1401 clear_bit(FLAG_IS_OUT, &desc->flags);
1400 (1 << FLAG_IS_OUT) : 0;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 }
1401 }1408 }
1402 1409
1403 acpi_gpiochip_add(chip);1410 acpi_gpiochip_add(chip);
drivers/gpu/drm/Kconfig+1−1
@@ -394,7 +394,7 @@ config DRM_R128 · 393 unmodified lines
394config DRM_I810394config DRM_I810
395 tristate "Intel I810"395 tristate "Intel I810"
396 # !PREEMPT because of missing ioctl locking396 # !PREEMPT because of missing ioctl locking
397 depends on DRM && AGP && AGP_INTEL && (!PREEMPT || BROKEN)397 depends on DRM && AGP && AGP_INTEL && (!PREEMPTION || BROKEN)
398 help398 help
399 Choose this option if you have an Intel I810 graphics card. If M is399 Choose this option if you have an Intel I810 graphics card. If M is
400 selected, the module will be called i810. AGP support is required400 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
1140 adev->asic_type != CHIP_FIJI &&1140 adev->asic_type != CHIP_FIJI &&
1141 adev->asic_type != CHIP_POLARIS10 &&1141 adev->asic_type != CHIP_POLARIS10 &&
1142 adev->asic_type != CHIP_POLARIS11 &&1142 adev->asic_type != CHIP_POLARIS11 &&
1143 adev->asic_type != CHIP_POLARIS12) ?1143 adev->asic_type != CHIP_POLARIS12 &&
1144 adev->asic_type != CHIP_VEGAM) ?
1144 VI_BO_SIZE_ALIGN : 1;1145 VI_BO_SIZE_ALIGN : 1;
1145 1146
1146 mapping_flags = AMDGPU_VM_PAGE_READABLE;1147 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
1044 return r;1044 return r;
1045 }1045 }
1046 1046
1047 fence = amdgpu_ctx_get_fence(ctx, entity,1047 fence = amdgpu_ctx_get_fence(ctx, entity, deps[i].handle);
1048 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;
1049 1054
1050 if (chunk->chunk_id == AMDGPU_CHUNK_ID_SCHEDULED_DEPENDENCIES) {1055 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;
1052 struct dma_fence *old = fence;1057 struct dma_fence *old = fence;
1053 1058
1059 s_fence = to_drm_sched_fence(fence);
1054 fence = dma_fence_get(&s_fence->scheduled);1060 fence = dma_fence_get(&s_fence->scheduled);
1055 dma_fence_put(old);1061 dma_fence_put(old);
1056 }1062 }
1057 1063
1058 if (IS_ERR(fence)) {1064 r = amdgpu_sync_fence(p->adev, &p->job->sync, fence, true);
1059 r = PTR_ERR(fence);1065 dma_fence_put(fence);
1060 amdgpu_ctx_put(ctx);1066 if (r)
1061 return r;1067 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 }
1070 }1068 }
1071 return 0;1069 return 0;
1072}1070}
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
707 thread = (*pos & GENMASK_ULL(59, 52)) >> 52;707 thread = (*pos & GENMASK_ULL(59, 52)) >> 52;
708 bank = (*pos & GENMASK_ULL(61, 60)) >> 60;708 bank = (*pos & GENMASK_ULL(61, 60)) >> 60;
709 709
710 data = kmalloc_array(1024, sizeof(*data), GFP_KERNEL);710 data = kcalloc(1024, sizeof(*data), GFP_KERNEL);
711 if (!data)711 if (!data)
712 return -ENOMEM;712 return -ENOMEM;
713 713
drivers/gpu/drm/amd/amdgpu/amdgpu_gds.h+0−1
@@ -32,7 +32,6 @@ struct amdgpu_gds { · 31 unmodified lines
32 uint32_t gws_size;32 uint32_t gws_size;
33 uint32_t oa_size;33 uint32_t oa_size;
34 uint32_t gds_compute_max_wave_id;34 uint32_t gds_compute_max_wave_id;
35 uint32_t vgt_gs_max_wave_id;
36};35};
37 36
38struct amdgpu_gds_reg_offset {37struct 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
159 struct amdgpu_device *adev = ddev->dev_private;159 struct amdgpu_device *adev = ddev->dev_private;
160 enum amd_pm_state_type pm;160 enum amd_pm_state_type pm;
161 161
162 if (is_support_sw_smu(adev) && adev->smu.ppt_funcs->get_current_power_state)162 if (is_support_sw_smu(adev)) {
163 pm = amdgpu_smu_get_current_power_state(adev);163 if (adev->smu.ppt_funcs->get_current_power_state)
164 else if (adev->powerplay.pp_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) {
165 pm = amdgpu_dpm_get_current_power_state(adev);168 pm = amdgpu_dpm_get_current_power_state(adev);
166 else169 } else {
167 pm = adev->pm.dpm.user_state;170 pm = adev->pm.dpm.user_state;
171 }
168 172
169 return snprintf(buf, PAGE_SIZE, "%s\n",173 return snprintf(buf, PAGE_SIZE, "%s\n",
170 (pm == POWER_STATE_TYPE_BATTERY) ? "battery" :174 (pm == POWER_STATE_TYPE_BATTERY) ? "battery" :
@@ -191,7 +195,11 @@ static ssize_t amdgpu_set_dpm_state(struct device *dev, · 20 unmodified lines
191 goto fail;195 goto fail;
192 }196 }
193 197
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) {
195 amdgpu_dpm_dispatch_task(adev, AMD_PP_TASK_ENABLE_USER_STATE, &state);203 amdgpu_dpm_dispatch_task(adev, AMD_PP_TASK_ENABLE_USER_STATE, &state);
196 } else {204 } else {
197 mutex_lock(&adev->pm.mutex);205 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
3067 if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK, (void *)&value64, &size))3075 if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK, (void *)&value64, &size))
3068 seq_printf(m, "SMC Feature Mask: 0x%016llx\n", value64);3076 seq_printf(m, "SMC Feature Mask: 0x%016llx\n", value64);
3069 3077
3070 /* UVD clocks */3078 if (adev->asic_type > CHIP_VEGA20) {
3071 if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_UVD_POWER, (void *)&value, &size)) {3079 /* VCN clocks */
3072 if (!value) {3080 if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_VCN_POWER_STATE, (void *)&value, &size)) {
3073 seq_printf(m, "UVD: Disabled\n");3081 if (!value) {
3074 } else {3082 seq_printf(m, "VCN: Disabled\n");
3075 seq_printf(m, "UVD: Enabled\n");3083 } else {
3076 if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_UVD_DCLK, (void *)&value, &size))3084 seq_printf(m, "VCN: Enabled\n");
3077 seq_printf(m, "\t%u MHz (DCLK)\n", value/100);3085 if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_UVD_DCLK, (void *)&value, &size))
3078 if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_UVD_VCLK, (void *)&value, &size))3086 seq_printf(m, "\t%u MHz (DCLK)\n", value/100);
3079 seq_printf(m, "\t%u MHz (VCLK)\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 }
3080 }3090 }
3081 }3091 seq_printf(m, "\n");
3082 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");
3083 3106
3084 /* VCE clocks */3107 /* VCE clocks */
3085 if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_VCE_POWER, (void *)&value, &size)) {3108 if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_VCE_POWER, (void *)&value, &size)) {
3086 if (!value) {3109 if (!value) {
3087 seq_printf(m, "VCE: Disabled\n");3110 seq_printf(m, "VCE: Disabled\n");
3088 } else {3111 } else {
3089 seq_printf(m, "VCE: Enabled\n");3112 seq_printf(m, "VCE: Enabled\n");
3090 if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_VCE_ECCLK, (void *)&value, &size))3113 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);3114 seq_printf(m, "\t%u MHz (ECCLK)\n", value/100);
3115 }
3092 }3116 }
3093 }3117 }
3094 3118
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h+1−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
30#define AMDGPU_VCN_FIRMWARE_OFFSET 25630#define AMDGPU_VCN_FIRMWARE_OFFSET 256
31#define AMDGPU_VCN_MAX_ENC_RINGS 331#define AMDGPU_VCN_MAX_ENC_RINGS 3
32 32
33#define VCN_DEC_KMD_CMD 0x80000000
33#define VCN_DEC_CMD_FENCE 0x0000000034#define VCN_DEC_CMD_FENCE 0x00000000
34#define VCN_DEC_CMD_TRAP 0x0000000135#define VCN_DEC_CMD_TRAP 0x00000001
35#define VCN_DEC_CMD_WRITE_REG 0x0000000436#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
4206 unsigned vmid = AMDGPU_JOB_GET_VMID(job);4206 unsigned vmid = AMDGPU_JOB_GET_VMID(job);
4207 u32 header, control = 0;4207 u32 header, control = 0;
4208 4208
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
4218 if (ib->flags & AMDGPU_IB_FLAG_CE)4209 if (ib->flags & AMDGPU_IB_FLAG_CE)
4219 header = PACKET3(PACKET3_INDIRECT_BUFFER_CNST, 2);4210 header = PACKET3(PACKET3_INDIRECT_BUFFER_CNST, 2);
4220 else4211 else
@@ -4961,7 +4952,7 @@ static const struct amdgpu_ring_funcs gfx_v10_0_ring_funcs_gfx = { · 740 unmodified lines
4961 5 + /* HDP_INVL */4952 5 + /* HDP_INVL */
4962 8 + 8 + /* FENCE x2 */4953 8 + 8 + /* FENCE x2 */
4963 2, /* SWITCH_BUFFER */4954 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 */
4965 .emit_ib = gfx_v10_0_ring_emit_ib_gfx,4956 .emit_ib = gfx_v10_0_ring_emit_ib_gfx,
4966 .emit_fence = gfx_v10_0_ring_emit_fence,4957 .emit_fence = gfx_v10_0_ring_emit_fence,
4967 .emit_pipeline_sync = gfx_v10_0_ring_emit_pipeline_sync,4958 .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
5112 default:5103 default:
5113 adev->gds.gds_size = 0x10000;5104 adev->gds.gds_size = 0x10000;
5114 adev->gds.gds_compute_max_wave_id = 0x4ff;5105 adev->gds.gds_compute_max_wave_id = 0x4ff;
5115 adev->gds.vgt_gs_max_wave_id = 0x3ff;
5116 break;5106 break;
5117 }5107 }
5118 5108
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
1321 return 0;1321 return 0;
1322}1322}
1323 1323
1324static 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
1343static 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
1324static void gfx_v8_0_mec_fini(struct amdgpu_device *adev)1357static void gfx_v8_0_mec_fini(struct amdgpu_device *adev)
1325{1358{
1326 amdgpu_bo_free_kernel(&adev->gfx.mec.hpd_eop_obj, NULL, NULL);1359 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
4785 gfx_v8_0_init_golden_registers(adev);4818 gfx_v8_0_init_golden_registers(adev);
4786 gfx_v8_0_constants_init(adev);4819 gfx_v8_0_constants_init(adev);
4787 4820
4821 r = gfx_v8_0_csb_vram_pin(adev);
4822 if (r)
4823 return r;
4824
4788 r = adev->gfx.rlc.funcs->resume(adev);4825 r = adev->gfx.rlc.funcs->resume(adev);
4789 if (r)4826 if (r)
4790 return r;4827 return r;
@@ -4901,6 +4938,9 @@ static int gfx_v8_0_hw_fini(void *handle) · 110 unmodified lines
4901 else4938 else
4902 pr_err("rlc is busy, skip halt rlc\n");4939 pr_err("rlc is busy, skip halt rlc\n");
4903 amdgpu_gfx_rlc_exit_safe_mode(adev);4940 amdgpu_gfx_rlc_exit_safe_mode(adev);
4941
4942 gfx_v8_0_csb_vram_unpin(adev);
4943
4904 return 0;4944 return 0;
4905}4945}
4906 4946
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
1485 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_DATA0_INTERNAL_OFFSET, 0));1485 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_DATA0_INTERNAL_OFFSET, 0));
1486 amdgpu_ring_write(ring, 0);1486 amdgpu_ring_write(ring, 0);
1487 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET, 0));1487 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));
1489}1489}
1490 1490
1491/**1491/**
@@ -1498,7 +1498,7 @@ static void vcn_v2_0_dec_ring_insert_start(struct amdgpu_ring *ring) · 6 unmodified lines
1498static void vcn_v2_0_dec_ring_insert_end(struct amdgpu_ring *ring)1498static void vcn_v2_0_dec_ring_insert_end(struct amdgpu_ring *ring)
1499{1499{
1500 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET, 0));1500 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));
1502}1502}
1503 1503
1504/**1504/**
@@ -1543,7 +1543,7 @@ static void vcn_v2_0_dec_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 · 38 unmodified lines
1543 amdgpu_ring_write(ring, upper_32_bits(addr) & 0xff);1543 amdgpu_ring_write(ring, upper_32_bits(addr) & 0xff);
1544 1544
1545 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET, 0));1545 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));
1547 1547
1548 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_DATA0_INTERNAL_OFFSET, 0));1548 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_DATA0_INTERNAL_OFFSET, 0));
1549 amdgpu_ring_write(ring, 0);1549 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
1553 1553
1554 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET, 0));1554 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET, 0));
1555 1555
1556 amdgpu_ring_write(ring, VCN_DEC_CMD_TRAP << 1);1556 amdgpu_ring_write(ring, VCN_DEC_KMD_CMD | (VCN_DEC_CMD_TRAP << 1));
1557}1557}
1558 1558
1559/**1559/**
@@ -1597,7 +1597,7 @@ static void vcn_v2_0_dec_ring_emit_reg_wait(struct amdgpu_ring *ring, · 37 unmodified lines
1597 1597
1598 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET, 0));1598 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET, 0));
1599 1599
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));
1601}1601}
1602 1602
1603static void vcn_v2_0_dec_ring_emit_vm_flush(struct amdgpu_ring *ring,1603static 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
1626 1626
1627 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET, 0));1627 amdgpu_ring_write(ring, PACKET0(mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET, 0));
1628 1628
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));
1630}1630}
1631 1631
1632/**1632/**
@@ -2079,6 +2079,36 @@ static int vcn_v2_0_process_interrupt(struct amdgpu_device *adev, · 446 unmodified lines
2079 return 0;2079 return 0;
2080}2080}
2081 2081
2082static 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
2082static int vcn_v2_0_set_powergating_state(void *handle,2112static int vcn_v2_0_set_powergating_state(void *handle,
2083 enum amd_powergating_state state)2113 enum amd_powergating_state state)
2084{2114{
@@ -2142,7 +2172,7 @@ static const struct amdgpu_ring_funcs vcn_v2_0_dec_ring_vm_funcs = { · 57 unmodified lines
2142 .emit_ib = vcn_v2_0_dec_ring_emit_ib,2172 .emit_ib = vcn_v2_0_dec_ring_emit_ib,
2143 .emit_fence = vcn_v2_0_dec_ring_emit_fence,2173 .emit_fence = vcn_v2_0_dec_ring_emit_fence,
2144 .emit_vm_flush = vcn_v2_0_dec_ring_emit_vm_flush,2174 .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,
2146 .test_ib = amdgpu_vcn_dec_ring_test_ib,2176 .test_ib = amdgpu_vcn_dec_ring_test_ib,
2147 .insert_nop = vcn_v2_0_dec_ring_insert_nop,2177 .insert_nop = vcn_v2_0_dec_ring_insert_nop,
2148 .insert_start = vcn_v2_0_dec_ring_insert_start,2178 .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
1567 return err;1567 return err;
1568}1568}
1569 1569
1570static 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
1596static int kfd_ioctl_get_dmabuf_info(struct file *filep,1570static int kfd_ioctl_get_dmabuf_info(struct file *filep,
1597 struct kfd_process *p, void *data)1571 struct kfd_process *p, void *data)
1598{1572{
@@ -1795,8 +1769,6 @@ static const struct amdkfd_ioctl_desc amdkfd_ioctls[] = { · 196 unmodified lines
1795 AMDKFD_IOCTL_DEF(AMDKFD_IOC_IMPORT_DMABUF,1769 AMDKFD_IOCTL_DEF(AMDKFD_IOC_IMPORT_DMABUF,
1796 kfd_ioctl_import_dmabuf, 0),1770 kfd_ioctl_import_dmabuf, 0),
1797 1771
1798 AMDKFD_IOCTL_DEF(AMDKFD_IOC_ALLOC_QUEUE_GWS,
1799 kfd_ioctl_alloc_queue_gws, 0),
1800};1772};
1801 1773
1802#define AMDKFD_CORE_IOCTL_COUNT ARRAY_SIZE(amdkfd_ioctls)1774#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
123 AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK,123 AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK,
124 AMDGPU_PP_SENSOR_MIN_FAN_RPM,124 AMDGPU_PP_SENSOR_MIN_FAN_RPM,
125 AMDGPU_PP_SENSOR_MAX_FAN_RPM,125 AMDGPU_PP_SENSOR_MAX_FAN_RPM,
126 AMDGPU_PP_SENSOR_VCN_POWER_STATE,
126};127};
127 128
128enum amd_pp_task {129enum 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
306 306
307 /* not support power state */307 /* not support power state */
308 memset(state_info, 0, sizeof(struct pp_states_info));308 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;
310 311
311 return 0;312 return 0;
312}313}
@@ -314,6 +315,8 @@ int smu_get_power_num_states(struct smu_context *smu, · 1 unmodified line
314int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor,315int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor,
315 void *data, uint32_t *size)316 void *data, uint32_t *size)
316{317{
318 struct smu_power_context *smu_power = &smu->smu_power;
319 struct smu_power_gate *power_gate = &smu_power->power_gate;
317 int ret = 0;320 int ret = 0;
318 321
319 switch (sensor) {322 switch (sensor) {
@@ -337,6 +340,10 @@ int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor, · 17 unmodified lines
337 *(uint32_t *)data = smu_feature_is_enabled(smu, SMU_FEATURE_DPM_VCE_BIT) ? 1 : 0;340 *(uint32_t *)data = smu_feature_is_enabled(smu, SMU_FEATURE_DPM_VCE_BIT) ? 1 : 0;
338 *size = 4;341 *size = 4;
339 break;342 break;
343 case AMDGPU_PP_SENSOR_VCN_POWER_STATE:
344 *(uint32_t *)data = power_gate->vcn_gated ? 0 : 1;
345 *size = 4;
346 break;
340 default:347 default:
341 ret = -EINVAL;348 ret = -EINVAL;
342 break;349 break;
@@ -723,6 +730,12 @@ static int smu_sw_init(void *handle) · 380 unmodified lines
723 return ret;730 return ret;
724 }731 }
725 732
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
726 return 0;739 return 0;
727}740}
728 741
@@ -732,6 +745,9 @@ static int smu_sw_fini(void *handle) · 3 unmodified lines
732 struct smu_context *smu = &adev->smu;745 struct smu_context *smu = &adev->smu;
733 int ret;746 int ret;
734 747
748 kfree(smu->irq_source);
749 smu->irq_source = NULL;
750
735 ret = smu_smc_table_sw_fini(smu);751 ret = smu_smc_table_sw_fini(smu);
736 if (ret) {752 if (ret) {
737 pr_err("Failed to sw fini smc table!\n");753 pr_err("Failed to sw fini smc table!\n");
@@ -1088,10 +1104,6 @@ static int smu_hw_init(void *handle) · 350 unmodified lines
1088 if (ret)1104 if (ret)
1089 goto failed;1105 goto failed;
1090 1106
1091 ret = smu_register_irq_handler(smu);
1092 if (ret)
1093 goto failed;
1094
1095 if (!smu->pm_enabled)1107 if (!smu->pm_enabled)
1096 adev->pm.dpm_enabled = false;1108 adev->pm.dpm_enabled = false;
1097 else1109 else
@@ -1121,9 +1133,6 @@ static int smu_hw_fini(void *handle) · 23 unmodified lines
1121 kfree(table_context->overdrive_table);1133 kfree(table_context->overdrive_table);
1122 table_context->overdrive_table = NULL;1134 table_context->overdrive_table = NULL;
1123 1135
1124 kfree(smu->irq_source);
1125 smu->irq_source = NULL;
1126
1127 ret = smu_fini_fb_allocations(smu);1136 ret = smu_fini_fb_allocations(smu);
1128 if (ret)1137 if (ret)
1129 return ret;1138 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
1111static int smu10_read_sensor(struct pp_hwmgr *hwmgr, int idx,1111static int smu10_read_sensor(struct pp_hwmgr *hwmgr, int idx,
1112 void *value, int *size)1112 void *value, int *size)
1113{1113{
1114 struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend);
1114 uint32_t sclk, mclk;1115 uint32_t sclk, mclk;
1115 int ret = 0;1116 int ret = 0;
1116 1117
@@ -1132,6 +1133,10 @@ static int smu10_read_sensor(struct pp_hwmgr *hwmgr, int idx, · 15 unmodified lines
1132 case AMDGPU_PP_SENSOR_GPU_TEMP:1133 case AMDGPU_PP_SENSOR_GPU_TEMP:
1133 *((uint32_t *)value) = smu10_thermal_get_temperature(hwmgr);1134 *((uint32_t *)value) = smu10_thermal_get_temperature(hwmgr);
1134 break;1135 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;
1135 default:1140 default:
1136 ret = -EINVAL;1141 ret = -EINVAL;
1137 break;1142 break;
@@ -1175,18 +1180,22 @@ static int smu10_powergate_sdma(struct pp_hwmgr *hwmgr, bool gate) · 37 unmodified lines
1175 1180
1176static void smu10_powergate_vcn(struct pp_hwmgr *hwmgr, bool bgate)1181static void smu10_powergate_vcn(struct pp_hwmgr *hwmgr, bool bgate)
1177{1182{
1183 struct smu10_hwmgr *smu10_data = (struct smu10_hwmgr *)(hwmgr->backend);
1184
1178 if (bgate) {1185 if (bgate) {
1179 amdgpu_device_ip_set_powergating_state(hwmgr->adev,1186 amdgpu_device_ip_set_powergating_state(hwmgr->adev,
1180 AMD_IP_BLOCK_TYPE_VCN,1187 AMD_IP_BLOCK_TYPE_VCN,
1181 AMD_PG_STATE_GATE);1188 AMD_PG_STATE_GATE);
1182 smum_send_msg_to_smc_with_parameter(hwmgr,1189 smum_send_msg_to_smc_with_parameter(hwmgr,
1183 PPSMC_MSG_PowerDownVcn, 0);1190 PPSMC_MSG_PowerDownVcn, 0);
1191 smu10_data->vcn_power_gated = true;
1184 } else {1192 } else {
1185 smum_send_msg_to_smc_with_parameter(hwmgr,1193 smum_send_msg_to_smc_with_parameter(hwmgr,
1186 PPSMC_MSG_PowerUpVcn, 0);1194 PPSMC_MSG_PowerUpVcn, 0);
1187 amdgpu_device_ip_set_powergating_state(hwmgr->adev,1195 amdgpu_device_ip_set_powergating_state(hwmgr->adev,
1188 AMD_IP_BLOCK_TYPE_VCN,1196 AMD_IP_BLOCK_TYPE_VCN,
1189 AMD_PG_STATE_UNGATE);1197 AMD_PG_STATE_UNGATE);
1198 smu10_data->vcn_power_gated = false;
1190 }1199 }
1191}1200}
1192 1201
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h+1−1
@@ -429,7 +429,6 @@ struct smu_table_context · 428 unmodified lines
429 struct smu_table *tables;429 struct smu_table *tables;
430 uint32_t table_count;430 uint32_t table_count;
431 struct smu_table memory_pool;431 struct smu_table memory_pool;
432 uint16_t software_shutdown_temp;
433 uint8_t thermal_controller_type;432 uint8_t thermal_controller_type;
434 uint16_t TDPODLimit;433 uint16_t TDPODLimit;
435 434
@@ -452,6 +451,7 @@ struct smu_dpm_context { · 16 unmodified lines
452struct smu_power_gate {451struct smu_power_gate {
453 bool uvd_gated;452 bool uvd_gated;
454 bool vce_gated;453 bool vce_gated;
454 bool vcn_gated;
455};455};
456 456
457struct smu_power_context {457struct smu_power_context {
drivers/gpu/drm/amd/powerplay/navi10_ppt.c+68−31
@@ -23,6 +23,7 @@ · 22 unmodified lines
23 23
24#include "pp_debug.h"24#include "pp_debug.h"
25#include <linux/firmware.h>25#include <linux/firmware.h>
26#include <linux/pci.h>
26#include "amdgpu.h"27#include "amdgpu.h"
27#include "amdgpu_smu.h"28#include "amdgpu_smu.h"
28#include "atomfirmware.h"29#include "atomfirmware.h"
@@ -501,6 +502,8 @@ static int navi10_store_powerplay_table(struct smu_context *smu) · 472 unmodified lines
501 502
502static int navi10_tables_init(struct smu_context *smu, struct smu_table *tables)503static int navi10_tables_init(struct smu_context *smu, struct smu_table *tables)
503{504{
505 struct smu_table_context *smu_table = &smu->smu_table;
506
504 SMU_TABLE_INIT(tables, SMU_TABLE_PPTABLE, sizeof(PPTable_t),507 SMU_TABLE_INIT(tables, SMU_TABLE_PPTABLE, sizeof(PPTable_t),
505 PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM);508 PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM);
506 SMU_TABLE_INIT(tables, SMU_TABLE_WATERMARKS, sizeof(Watermarks_t),509 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
515 sizeof(DpmActivityMonitorCoeffInt_t), PAGE_SIZE,518 sizeof(DpmActivityMonitorCoeffInt_t), PAGE_SIZE,
516 AMDGPU_GEM_DOMAIN_VRAM);519 AMDGPU_GEM_DOMAIN_VRAM);
517 520
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
518 return 0;526 return 0;
519}527}
520 528
529static 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
521static int navi10_allocate_dpm_context(struct smu_context *smu)550static int navi10_allocate_dpm_context(struct smu_context *smu)
522{551{
523 struct smu_dpm_context *smu_dpm = &smu->smu_dpm;552 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
576 605
577static int navi10_dpm_set_uvd_enable(struct smu_context *smu, bool enable)606static int navi10_dpm_set_uvd_enable(struct smu_context *smu, bool enable)
578{607{
579 int ret = 0;
580 struct smu_power_context *smu_power = &smu->smu_power;608 struct smu_power_context *smu_power = &smu->smu_power;
581 struct smu_power_gate *power_gate = &smu_power->power_gate;609 struct smu_power_gate *power_gate = &smu_power->power_gate;
610 int ret = 0;
582 611
583 if (enable && power_gate->uvd_gated) {612 if (enable) {
584 if (smu_feature_is_enabled(smu, SMU_FEATURE_DPM_UVD_BIT)) {613 /* vcn dpm on is a prerequisite for vcn power gate messages */
614 if (smu_feature_is_enabled(smu, SMU_FEATURE_VCN_PG_BIT)) {
585 ret = smu_send_smc_msg_with_param(smu, SMU_MSG_PowerUpVcn, 1);615 ret = smu_send_smc_msg_with_param(smu, SMU_MSG_PowerUpVcn, 1);
586 if (ret)616 if (ret)
587 return ret;617 return ret;
588 }618 }
589 power_gate->uvd_gated = false;619 power_gate->vcn_gated = false;
590 } else {620 } else {
591 if (!enable && !power_gate->uvd_gated) {621 if (smu_feature_is_enabled(smu, SMU_FEATURE_VCN_PG_BIT)) {
592 if (smu_feature_is_enabled(smu, SMU_FEATURE_DPM_UVD_BIT)) {622 ret = smu_send_smc_msg(smu, SMU_MSG_PowerDownVcn);
593 ret = smu_send_smc_msg(smu, SMU_MSG_PowerDownVcn);623 if (ret)
594 if (ret)624 return ret;
595 return ret;
596 }
597 power_gate->uvd_gated = true;
598 }625 }
626 power_gate->vcn_gated = true;
599 }627 }
600 628
601 return 0;629 return ret;
602}630}
603 631
604static int navi10_get_current_clk_freq_by_table(struct smu_context *smu,632static int navi10_get_current_clk_freq_by_table(struct smu_context *smu,
605 enum smu_clk_type clk_type,633 enum smu_clk_type clk_type,
606 uint32_t *value)634 uint32_t *value)
607{635{
608 static SmuMetrics_t metrics;
609 int ret = 0, clk_id = 0;636 int ret = 0, clk_id = 0;
637 SmuMetrics_t metrics;
610 638
611 if (!value)639 ret = navi10_get_metrics_table(smu, &metrics);
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);
617 if (ret)640 if (ret)
618 return ret;641 return ret;
619 642
@@ -901,8 +924,9 @@ static int navi10_get_gpu_power(struct smu_context *smu, uint32_t *value) · 281 unmodified lines
901 if (!value)924 if (!value)
902 return -EINVAL;925 return -EINVAL;
903 926
904 ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0, (void *)&metrics,927 ret = navi10_get_metrics_table(smu, &metrics);
905 false);928 if (ret)
929 return ret;
906 if (ret)930 if (ret)
907 return ret;931 return ret;
908 932
@@ -921,10 +945,7 @@ static int navi10_get_current_activity_percent(struct smu_context *smu, · 12 unmodified lines
921 if (!value)945 if (!value)
922 return -EINVAL;946 return -EINVAL;
923 947
924 msleep(1);948 ret = navi10_get_metrics_table(smu, &metrics);
925
926 ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0,
927 (void *)&metrics, false);
928 if (ret)949 if (ret)
929 return ret;950 return ret;
930 951
@@ -963,10 +984,9 @@ static int navi10_get_fan_speed_rpm(struct smu_context *smu, · 32 unmodified lines
963 if (!speed)984 if (!speed)
964 return -EINVAL;985 return -EINVAL;
965 986
966 memset(&metrics, 0, sizeof(metrics));987 ret = navi10_get_metrics_table(smu, &metrics);
967 988 if (ret)
968 ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0,989 return ret;
969 (void *)&metrics, false);
970 if (ret)990 if (ret)
971 return ret;991 return ret;
972 992
@@ -1314,7 +1334,7 @@ static int navi10_thermal_get_temperature(struct smu_context *smu, · 341 unmodified lines
1314 if (!value)1334 if (!value)
1315 return -EINVAL;1335 return -EINVAL;
1316 1336
1317 ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0, (void *)&metrics, false);1337 ret = navi10_get_metrics_table(smu, &metrics);
1318 if (ret)1338 if (ret)
1319 return ret;1339 return ret;
1320 1340
@@ -1573,7 +1593,7 @@ static int navi10_set_peak_clock_by_device(struct smu_context *smu) · 252 unmodified lines
1573 uint32_t sclk_freq = 0, uclk_freq = 0;1593 uint32_t sclk_freq = 0, uclk_freq = 0;
1574 uint32_t uclk_level = 0;1594 uint32_t uclk_level = 0;
1575 1595
1576 switch (adev->rev_id) {1596 switch (adev->pdev->revision) {
1577 case 0xf0: /* XTX */1597 case 0xf0: /* XTX */
1578 case 0xc0:1598 case 0xc0:
1579 sclk_freq = NAVI10_PEAK_SCLK_XTX;1599 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
1620 return ret;1640 return ret;
1621}1641}
1622 1642
1643static 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
1623static const struct pptable_funcs navi10_ppt_funcs = {1659static const struct pptable_funcs navi10_ppt_funcs = {
1624 .tables_init = navi10_tables_init,1660 .tables_init = navi10_tables_init,
1625 .alloc_dpm_context = navi10_allocate_dpm_context,1661 .alloc_dpm_context = navi10_allocate_dpm_context,
@@ -1657,6 +1693,7 @@ static const struct pptable_funcs navi10_ppt_funcs = { · 31 unmodified lines
1657 .get_ppfeature_status = navi10_get_ppfeature_status,1693 .get_ppfeature_status = navi10_get_ppfeature_status,
1658 .set_ppfeature_status = navi10_set_ppfeature_status,1694 .set_ppfeature_status = navi10_set_ppfeature_status,
1659 .set_performance_level = navi10_set_performance_level,1695 .set_performance_level = navi10_set_performance_level,
1696 .get_thermal_temperature_range = navi10_get_thermal_temperature_range,
1660};1697};
1661 1698
1662void navi10_set_ppt_funcs(struct smu_context *smu)1699void 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
1124 struct smu_temperature_range *range)1124 struct smu_temperature_range *range)
1125{1125{
1126 struct amdgpu_device *adev = smu->adev;1126 struct amdgpu_device *adev = smu->adev;
1127 int low = SMU_THERMAL_MINIMUM_ALERT_TEMP *1127 int low = SMU_THERMAL_MINIMUM_ALERT_TEMP;
1128 SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;1128 int high = SMU_THERMAL_MAXIMUM_ALERT_TEMP;
1129 int high = SMU_THERMAL_MAXIMUM_ALERT_TEMP *
1130 SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1131 uint32_t val;1129 uint32_t val;
1132 1130
1133 if (!range)1131 if (!range)
@@ -1138,6 +1136,9 @@ static int smu_v11_0_set_thermal_range(struct smu_context *smu, · 4 unmodified lines
1138 if (high > range->max)1136 if (high > range->max)
1139 high = range->max;1137 high = range->max;
1140 1138
1139 low = max(SMU_THERMAL_MINIMUM_ALERT_TEMP, range->min);
1140 high = min(SMU_THERMAL_MAXIMUM_ALERT_TEMP, range->max);
1141
1141 if (low > high)1142 if (low > high)
1142 return -EINVAL;1143 return -EINVAL;
1143 1144
@@ -1146,8 +1147,8 @@ static int smu_v11_0_set_thermal_range(struct smu_context *smu, · 2 unmodified lines
1146 val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, THERM_IH_HW_ENA, 1);1147 val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, THERM_IH_HW_ENA, 1);
1147 val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, THERM_INTH_MASK, 0);1148 val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, THERM_INTH_MASK, 0);
1148 val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, THERM_INTL_MASK, 0);1149 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_INTH, (high & 0xff));
1150 val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, DIG_THERM_INTL, (low / SMU_TEMPERATURE_UNITS_PER_CENTIGRADES));1151 val = REG_SET_FIELD(val, THM_THERMAL_INT_CTRL, DIG_THERM_INTL, (low & 0xff));
1151 val = val & (~THM_THERMAL_INT_CTRL__THERM_TRIGGER_MASK_MASK);1152 val = val & (~THM_THERMAL_INT_CTRL__THERM_TRIGGER_MASK_MASK);
1152 1153
1153 WREG32_SOC15(THM, 0, mmTHM_THERMAL_INT_CTRL, val);1154 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
1186 1187
1187 if (!smu->pm_enabled)1188 if (!smu->pm_enabled)
1188 return ret;1189 return ret;
1190
1189 ret = smu_get_thermal_temperature_range(smu, &range);1191 ret = smu_get_thermal_temperature_range(smu, &range);
1192 if (ret)
1193 return ret;
1190 1194
1191 if (smu->smu_table.thermal_controller_type) {1195 if (smu->smu_table.thermal_controller_type) {
1192 ret = smu_v11_0_set_thermal_range(smu, &range);1196 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
1202 return ret;1206 return ret;
1203 }1207 }
1204 1208
1205 adev->pm.dpm.thermal.min_temp = range.min;1209 adev->pm.dpm.thermal.min_temp = range.min * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1206 adev->pm.dpm.thermal.max_temp = range.max;1210 adev->pm.dpm.thermal.max_temp = range.max * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1207 adev->pm.dpm.thermal.max_edge_emergency_temp = range.edge_emergency_max;1211 adev->pm.dpm.thermal.max_edge_emergency_temp = range.edge_emergency_max * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1208 adev->pm.dpm.thermal.min_hotspot_temp = range.hotspot_min;1212 adev->pm.dpm.thermal.min_hotspot_temp = range.hotspot_min * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1209 adev->pm.dpm.thermal.max_hotspot_crit_temp = range.hotspot_crit_max;1213 adev->pm.dpm.thermal.max_hotspot_crit_temp = range.hotspot_crit_max * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1210 adev->pm.dpm.thermal.max_hotspot_emergency_temp = range.hotspot_emergency_max;1214 adev->pm.dpm.thermal.max_hotspot_emergency_temp = range.hotspot_emergency_max * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1211 adev->pm.dpm.thermal.min_mem_temp = range.mem_min;1215 adev->pm.dpm.thermal.min_mem_temp = range.mem_min * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1212 adev->pm.dpm.thermal.max_mem_crit_temp = range.mem_crit_max;1216 adev->pm.dpm.thermal.max_mem_crit_temp = range.mem_crit_max * SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
1213 adev->pm.dpm.thermal.max_mem_emergency_temp = range.mem_emergency_max;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;
1214 1220
1215 return ret;1221 return ret;
1216}1222}
@@ -1385,7 +1391,7 @@ smu_v11_0_smc_fan_control(struct smu_context *smu, bool start) · 168 unmodified lines
1385{1391{
1386 int ret = 0;1392 int ret = 0;
1387 1393
1388 if (smu_feature_is_supported(smu, SMU_FEATURE_FAN_CONTROL_BIT))1394 if (!smu_feature_is_supported(smu, SMU_FEATURE_FAN_CONTROL_BIT))
1389 return 0;1395 return 0;
1390 1396
1391 ret = smu_feature_set_enabled(smu, SMU_FEATURE_FAN_CONTROL_BIT, start);1397 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
450 memcpy(table_context->driver_pptable, &powerplay_table->smcPPTable,450 memcpy(table_context->driver_pptable, &powerplay_table->smcPPTable,
451 sizeof(PPTable_t));451 sizeof(PPTable_t));
452 452
453 table_context->software_shutdown_temp = powerplay_table->usSoftwareShutdownTemp;
454 table_context->thermal_controller_type = powerplay_table->ucThermalControllerType;453 table_context->thermal_controller_type = powerplay_table->ucThermalControllerType;
455 table_context->TDPODLimit = le32_to_cpu(powerplay_table->OverDrive8Table.ODSettingsMax[ATOM_VEGA20_ODSETTING_POWERPERCENTAGE]);454 table_context->TDPODLimit = le32_to_cpu(powerplay_table->OverDrive8Table.ODSettingsMax[ATOM_VEGA20_ODSETTING_POWERPERCENTAGE]);
456 455
@@ -3234,35 +3233,24 @@ static int vega20_set_watermarks_table(struct smu_context *smu, · 2777 unmodified lines
3234 return 0;3233 return 0;
3235}3234}
3236 3235
3237static 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
3243static int vega20_get_thermal_temperature_range(struct smu_context *smu,3236static int vega20_get_thermal_temperature_range(struct smu_context *smu,
3244 struct smu_temperature_range *range)3237 struct smu_temperature_range *range)
3245{3238{
3246 3239 struct smu_table_context *table_context = &smu->smu_table;
3240 ATOM_Vega20_POWERPLAYTABLE *powerplay_table = table_context->power_play_table;
3247 PPTable_t *pptable = smu->smu_table.driver_pptable;3241 PPTable_t *pptable = smu->smu_table.driver_pptable;
3248 3242
3249 if (!range)3243 if (!range || !powerplay_table)
3250 return -EINVAL;3244 return -EINVAL;
3251 3245
3252 memcpy(range, &vega20_thermal_policy[0], sizeof(struct smu_temperature_range));3246 /* The unit is temperature */
3253 3247 range->min = 0;
3254 range->max = pptable->TedgeLimit *3248 range->max = powerplay_table->usSoftwareShutdownTemp;
3255 SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;3249 range->edge_emergency_max = (pptable->TedgeLimit + CTF_OFFSET_EDGE);
3256 range->edge_emergency_max = (pptable->TedgeLimit + CTF_OFFSET_EDGE) *3250 range->hotspot_crit_max = pptable->ThotspotLimit;
3257 SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;3251 range->hotspot_emergency_max = (pptable->ThotspotLimit + CTF_OFFSET_HOTSPOT);
3258 range->hotspot_crit_max = pptable->ThotspotLimit *3252 range->mem_crit_max = pptable->ThbmLimit;
3259 SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;3253 range->mem_emergency_max = (pptable->ThbmLimit + CTF_OFFSET_HBM);
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;
3266 3254
3267 3255
3268 return 0;3256 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
191 bochs->dev->mode_config.fb_base = bochs->fb_base;191 bochs->dev->mode_config.fb_base = bochs->fb_base;
192 bochs->dev->mode_config.preferred_depth = 24;192 bochs->dev->mode_config.preferred_depth = 24;
193 bochs->dev->mode_config.prefer_shadow = 0;193 bochs->dev->mode_config.prefer_shadow = 0;
194 bochs->dev->mode_config.prefer_shadow_fbdev = 1;
194 bochs->dev->mode_config.quirk_addfb_prefer_host_byte_order = true;195 bochs->dev->mode_config.quirk_addfb_prefer_host_byte_order = true;
195 196
196 bochs->dev->mode_config.funcs = &bochs_mode_funcs;197 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
48config DRM_LVDS_ENCODER48config DRM_LVDS_ENCODER
49 tristate "Transparent parallel to LVDS encoder support"49 tristate "Transparent parallel to LVDS encoder support"
50 depends on OF50 depends on OF
51 select DRM_KMS_HELPER
51 select DRM_PANEL_BRIDGE52 select DRM_PANEL_BRIDGE
52 help53 help
53 Support for transparent parallel to LVDS encoders that don't require54 Support for transparent parallel to LVDS encoders that don't require
@@ -116,9 +117,10 @@ config DRM_THINE_THC63LVD1024 · 62 unmodified lines
116 117
117config DRM_TOSHIBA_TC358764118config DRM_TOSHIBA_TC358764
118 tristate "TC358764 DSI/LVDS bridge"119 tristate "TC358764 DSI/LVDS bridge"
119 depends on DRM && DRM_PANEL
120 depends on OF120 depends on OF
121 select DRM_MIPI_DSI121 select DRM_MIPI_DSI
122 select DRM_KMS_HELPER
123 select DRM_PANEL
122 help124 help
123 Toshiba TC358764 DSI/LVDS bridge driver.125 Toshiba TC358764 DSI/LVDS bridge driver.
124 126
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
254 struct drm_device *dev = client->dev;254 struct drm_device *dev = client->dev;
255 struct drm_client_buffer *buffer;255 struct drm_client_buffer *buffer;
256 struct drm_gem_object *obj;256 struct drm_gem_object *obj;
257 void *vaddr;
258 int ret;257 int ret;
259 258
260 buffer = kzalloc(sizeof(*buffer), GFP_KERNEL);259 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
281 280
282 buffer->gem = obj;281 buffer->gem = obj;
283 282
283 return buffer;
284
285err_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 */
306void *drm_client_buffer_vmap(struct drm_client_buffer *buffer)
307{
308 void *vaddr;
309
310 if (buffer->vaddr)
311 return buffer->vaddr;
312
284 /*313 /*
285 * FIXME: The dependency on GEM here isn't required, we could314 * FIXME: The dependency on GEM here isn't required, we could
286 * convert the driver handle to a dma-buf instead and use the315 * 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
289 * fd_install step out of the driver backend hooks, to make that318 * fd_install step out of the driver backend hooks, to make that
290 * final step optional for internal users.319 * final step optional for internal users.
291 */320 */
292 vaddr = drm_gem_vmap(obj);321 vaddr = drm_gem_vmap(buffer->gem);
293 if (IS_ERR(vaddr)) {322 if (IS_ERR(vaddr))
294 ret = PTR_ERR(vaddr);323 return vaddr;
295 goto err_delete;
296 }
297 324
298 buffer->vaddr = vaddr;325 buffer->vaddr = vaddr;
299 326
300 return buffer;327 return vaddr;
301 328}
302err_delete:329EXPORT_SYMBOL(drm_client_buffer_vmap);
303 drm_client_buffer_delete(buffer);
304 330
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 */
339void drm_client_buffer_vunmap(struct drm_client_buffer *buffer)
340{
341 drm_gem_vunmap(buffer->gem, buffer->vaddr);
342 buffer->vaddr = NULL;
306}343}
344EXPORT_SYMBOL(drm_client_buffer_vunmap);
307 345
308static void drm_client_buffer_rmfb(struct drm_client_buffer *buffer)346static void drm_client_buffer_rmfb(struct drm_client_buffer *buffer)
309{347{
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
403 struct drm_clip_rect *clip = &helper->dirty_clip;403 struct drm_clip_rect *clip = &helper->dirty_clip;
404 struct drm_clip_rect clip_copy;404 struct drm_clip_rect clip_copy;
405 unsigned long flags;405 unsigned long flags;
406 void *vaddr;
406 407
407 spin_lock_irqsave(&helper->dirty_lock, flags);408 spin_lock_irqsave(&helper->dirty_lock, flags);
408 clip_copy = *clip;409 clip_copy = *clip;
@@ -412,10 +413,20 @@ static void drm_fb_helper_dirty_work(struct work_struct *work) · 3 unmodified lines
412 413
413 /* call dirty callback only when it has been really touched */414 /* call dirty callback only when it has been really touched */
414 if (clip_copy.x1 < clip_copy.x2 && clip_copy.y1 < clip_copy.y2) {415 if (clip_copy.x1 < clip_copy.x2 && clip_copy.y1 < clip_copy.y2) {
416
415 /* Generic fbdev uses a shadow buffer */417 /* 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;
417 drm_fb_helper_dirty_blit_real(helper, &clip_copy);422 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);
419 }430 }
420}431}
421 432
@@ -604,6 +615,16 @@ void drm_fb_helper_unlink_fbi(struct drm_fb_helper *fb_helper) · 182 unmodified lines
604}615}
605EXPORT_SYMBOL(drm_fb_helper_unlink_fbi);616EXPORT_SYMBOL(drm_fb_helper_unlink_fbi);
606 617
618static 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
607static void drm_fb_helper_dirty(struct fb_info *info, u32 x, u32 y,628static void drm_fb_helper_dirty(struct fb_info *info, u32 x, u32 y,
608 u32 width, u32 height)629 u32 width, u32 height)
609{630{
@@ -611,7 +632,7 @@ static void drm_fb_helper_dirty(struct fb_info *info, u32 x, u32 y, · 1 unmodified line
611 struct drm_clip_rect *clip = &helper->dirty_clip;632 struct drm_clip_rect *clip = &helper->dirty_clip;
612 unsigned long flags;633 unsigned long flags;
613 634
614 if (!helper->fb->funcs->dirty)635 if (!drm_fbdev_use_shadow_fb(helper))
615 return;636 return;
616 637
617 spin_lock_irqsave(&helper->dirty_lock, flags);638 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
2178 struct drm_framebuffer *fb;2199 struct drm_framebuffer *fb;
2179 struct fb_info *fbi;2200 struct fb_info *fbi;
2180 u32 format;2201 u32 format;
2202 void *vaddr;
2181 2203
2182 DRM_DEBUG_KMS("surface width(%d), height(%d) and bpp(%d)\n",2204 DRM_DEBUG_KMS("surface width(%d), height(%d) and bpp(%d)\n",
2183 sizes->surface_width, sizes->surface_height,2205 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
2200 fbi->fbops = &drm_fbdev_fb_ops;2222 fbi->fbops = &drm_fbdev_fb_ops;
2201 fbi->screen_size = fb->height * fb->pitches[0];2223 fbi->screen_size = fb->height * fb->pitches[0];
2202 fbi->fix.smem_len = fbi->screen_size;2224 fbi->fix.smem_len = fbi->screen_size;
2203 fbi->screen_buffer = buffer->vaddr;2225
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
2210 drm_fb_helper_fill_info(fbi, fb_helper, sizes);2226 drm_fb_helper_fill_info(fbi, fb_helper, sizes);
2211 2227
2212 if (fb->funcs->dirty) {2228 if (drm_fbdev_use_shadow_fb(fb_helper)) {
2213 struct fb_ops *fbops;2229 struct fb_ops *fbops;
2214 void *shadow;2230 void *shadow;
2215 2231
@@ -2231,6 +2247,19 @@ int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper, · 15 unmodified lines
2231 fbi->fbdefio = &drm_fbdev_defio;2247 fbi->fbdefio = &drm_fbdev_defio;
2232 2248
2233 fb_deferred_io_init(fbi);2249 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
2234 }2263 }
2235 2264
2236 return 0;2265 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
1770 }1770 }
1771 1771
1772 if (named_mode) {1772 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);
1774 } else {1776 } else {
1775 ret = drm_mode_parse_cmdline_res_mode(name, mode_end,1777 ret = drm_mode_parse_cmdline_res_mode(name, mode_end,
1776 parse_extras,1778 parse_extras,
drivers/gpu/drm/exynos/Kconfig+1−0
@@ -2,6 +2,7 @@ · 1 unmodified line
2config DRM_EXYNOS2config DRM_EXYNOS
3 tristate "DRM Support for Samsung SoC EXYNOS Series"3 tristate "DRM Support for Samsung SoC EXYNOS Series"
4 depends on OF && DRM && (ARCH_S3C64XX || ARCH_S5PV210 || ARCH_EXYNOS || ARCH_MULTIPLATFORM || COMPILE_TEST)4 depends on OF && DRM && (ARCH_S3C64XX || ARCH_S5PV210 || ARCH_EXYNOS || ARCH_MULTIPLATFORM || COMPILE_TEST)
5 depends on MMU
5 select DRM_KMS_HELPER6 select DRM_KMS_HELPER
6 select VIDEOMODE_HELPERS7 select VIDEOMODE_HELPERS
7 select SND_SOC_HDMI_CODEC if SND_SOC8 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
44module_param_named(fimc_devs, fimc_mask, uint, 0644);44module_param_named(fimc_devs, fimc_mask, uint, 0644);
45MODULE_PARM_DESC(fimc_devs, "Alias mask for assigning FIMC devices to Exynos DRM");45MODULE_PARM_DESC(fimc_devs, "Alias mask for assigning FIMC devices to Exynos DRM");
46 46
47#define get_fimc_context(dev) platform_get_drvdata(to_platform_device(dev))47#define get_fimc_context(dev) dev_get_drvdata(dev)
48 48
49enum {49enum {
50 FIMC_CLK_LCLK,50 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
267static int g2d_init_cmdlist(struct g2d_data *g2d)267static int g2d_init_cmdlist(struct g2d_data *g2d)
268{268{
269 struct device *dev = g2d->dev;269 struct device *dev = g2d->dev;
270 struct g2d_cmdlist_node *node = g2d->cmdlist_node;270 struct g2d_cmdlist_node *node;
271 int nr;271 int nr;
272 int ret;272 int ret;
273 struct g2d_buf_info *buf_info;273 struct g2d_buf_info *buf_info;
drivers/gpu/drm/exynos/exynos_drm_gsc.c+1−1
@@ -58,7 +58,7 @@ · 57 unmodified lines
58#define GSC_COEF_DEPTH 358#define GSC_COEF_DEPTH 3
59#define GSC_AUTOSUSPEND_DELAY 200059#define GSC_AUTOSUSPEND_DELAY 2000
60 60
61#define get_gsc_context(dev) platform_get_drvdata(to_platform_device(dev))61#define get_gsc_context(dev) dev_get_drvdata(dev)
62#define gsc_read(offset) readl(ctx->regs + (offset))62#define gsc_read(offset) readl(ctx->regs + (offset))
63#define gsc_write(cfg, offset) writel(cfg, ctx->regs + (offset))63#define gsc_write(cfg, offset) writel(cfg, ctx->regs + (offset))
64 64
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
94 scaler_write(SCALER_CFG_SOFT_RESET, SCALER_CFG);94 scaler_write(SCALER_CFG_SOFT_RESET, SCALER_CFG);
95 do {95 do {
96 cpu_relax();96 cpu_relax();
97 } while (retry > 1 &&97 } while (--retry > 1 &&
98 scaler_read(SCALER_CFG) & SCALER_CFG_SOFT_RESET);98 scaler_read(SCALER_CFG) & SCALER_CFG_SOFT_RESET);
99 do {99 do {
100 cpu_relax();100 cpu_relax();
101 scaler_write(1, SCALER_INT_EN);101 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);
103 103
104 return retry ? 0 : -EIO;104 return retry ? 0 : -EIO;
105}105}
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
765 }765 }
766 766
767 if (bdb->version >= 226) {767 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;
769 769
770 wakeup_time = (wakeup_time >> (2 * panel_type)) & 0x3;770 wakeup_time = (wakeup_time >> (2 * panel_type)) & 0x3;
771 switch (wakeup_time) {771 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
178 clpchgroup = (sa->deburst * deinterleave / num_channels) << i;178 clpchgroup = (sa->deburst * deinterleave / num_channels) << i;
179 bi->num_planes = (ipqdepth - clpchgroup) / clpchgroup + 1;179 bi->num_planes = (ipqdepth - clpchgroup) / clpchgroup + 1;
180 180
181 bi->num_qgv_points = qi.num_points;
182
181 for (j = 0; j < qi.num_points; j++) {183 for (j = 0; j < qi.num_points; j++) {
182 const struct intel_qgv_point *sp = &qi.points[j];184 const struct intel_qgv_point *sp = &qi.points[j];
183 int ct, bw;185 int ct, bw;
@@ -195,7 +197,7 @@ static int icl_get_bw_info(struct drm_i915_private *dev_priv) · 11 unmodified lines
195 bi->deratedbw[j] = min(maxdebw,197 bi->deratedbw[j] = min(maxdebw,
196 bw * 9 / 10); /* 90% */198 bw * 9 / 10); /* 90% */
197 199
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",
199 i, j, bi->num_planes, bi->deratedbw[j]);201 i, j, bi->num_planes, bi->deratedbw[j]);
200 }202 }
201 203
@@ -211,14 +213,17 @@ static unsigned int icl_max_bw(struct drm_i915_private *dev_priv, · 9 unmodified lines
211{213{
212 int i;214 int i;
213 215
214 /* Did we initialize the bw limits successfully? */
215 if (dev_priv->max_bw[0].num_planes == 0)
216 return UINT_MAX;
217
218 for (i = 0; i < ARRAY_SIZE(dev_priv->max_bw); i++) {216 for (i = 0; i < ARRAY_SIZE(dev_priv->max_bw); i++) {
219 const struct intel_bw_info *bi =217 const struct intel_bw_info *bi =
220 &dev_priv->max_bw[i];218 &dev_priv->max_bw[i];
221 219
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
222 if (num_planes >= bi->num_planes)227 if (num_planes >= bi->num_planes)
223 return bi->deratedbw[qgv_point];228 return bi->deratedbw[qgv_point];
224 }229 }
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
2239 if (crtc_state->has_audio && INTEL_GEN(dev_priv) >= 9)2239 if (crtc_state->has_audio && INTEL_GEN(dev_priv) >= 9)
2240 min_cdclk = max(2 * 96000, min_cdclk);2240 min_cdclk = max(2 * 96000, min_cdclk);
2241 2241
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
2242 /*2253 /*
2243 * On Valleyview some DSI panels lose (v|h)sync when the clock is lower2254 * On Valleyview some DSI panels lose (v|h)sync when the clock is lower
2244 * than 320000KHz.2255 * 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
1839 /* FIXME: assert CPU port conditions for SNB+ */1839 /* FIXME: assert CPU port conditions for SNB+ */
1840 }1840 }
1841 1841
1842 trace_intel_pipe_enable(dev_priv, pipe);1842 trace_intel_pipe_enable(crtc);
1843 1843
1844 reg = PIPECONF(cpu_transcoder);1844 reg = PIPECONF(cpu_transcoder);
1845 val = I915_READ(reg);1845 val = I915_READ(reg);
@@ -1880,7 +1880,7 @@ static void intel_disable_pipe(const struct intel_crtc_state *old_crtc_state) · 34 unmodified lines
1880 */1880 */
1881 assert_planes_disabled(crtc);1881 assert_planes_disabled(crtc);
1882 1882
1883 trace_intel_pipe_disable(dev_priv, pipe);1883 trace_intel_pipe_disable(crtc);
1884 1884
1885 reg = PIPECONF(cpu_transcoder);1885 reg = PIPECONF(cpu_transcoder);
1886 val = I915_READ(reg);1886 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
438#define ICL_AUX_PW_TO_CH(pw_idx) \438#define ICL_AUX_PW_TO_CH(pw_idx) \
439 ((pw_idx) - ICL_PW_CTL_IDX_AUX_A + AUX_CH_A)439 ((pw_idx) - ICL_PW_CTL_IDX_AUX_A + AUX_CH_A)
440 440
441#define ICL_TBT_AUX_PW_TO_CH(pw_idx) \
442 ((pw_idx) - ICL_PW_CTL_IDX_AUX_TBT1 + AUX_CH_C)
443
441static void444static void
442icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,445icl_tc_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,
443 struct i915_power_well *power_well)446 struct i915_power_well *power_well)
444{447{
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;
446 u32 val;451 u32 val;
447 452
453 aux_ch = is_tbt ? ICL_TBT_AUX_PW_TO_CH(pw_idx) :
454 ICL_AUX_PW_TO_CH(pw_idx);
448 val = I915_READ(DP_AUX_CH_CTL(aux_ch));455 val = I915_READ(DP_AUX_CH_CTL(aux_ch));
449 val &= ~DP_AUX_CH_CTL_TBT_IO;456 val &= ~DP_AUX_CH_CTL_TBT_IO;
450 if (power_well->desc->hsw.is_tc_tbt)457 if (is_tbt)
451 val |= DP_AUX_CH_CTL_TBT_IO;458 val |= DP_AUX_CH_CTL_TBT_IO;
452 I915_WRITE(DP_AUX_CH_CTL(aux_ch), val);459 I915_WRITE(DP_AUX_CH_CTL(aux_ch), val);
453 460
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
536 536
537 if (drm_hdcp_check_ksvs_revoked(dev, ksv_fifo, num_downstream)) {537 if (drm_hdcp_check_ksvs_revoked(dev, ksv_fifo, num_downstream)) {
538 DRM_ERROR("Revoked Ksv(s) in ksv_fifo\n");538 DRM_ERROR("Revoked Ksv(s) in ksv_fifo\n");
539 return -EPERM;539 ret = -EPERM;
540 goto err;
540 }541 }
541 542
542 /*543 /*
drivers/gpu/drm/i915/display/intel_vbt_defs.h+3−3
@@ -478,13 +478,13 @@ struct psr_table { · 477 unmodified lines
478 /* TP wake up time in multiple of 100 */478 /* TP wake up time in multiple of 100 */
479 u16 tp1_wakeup_time;479 u16 tp1_wakeup_time;
480 u16 tp2_tp3_wakeup_time;480 u16 tp2_tp3_wakeup_time;
481
482 /* PSR2 TP2/TP3 wakeup time for 16 panels */
483 u32 psr2_tp2_tp3_wakeup_time;
484} __packed;481} __packed;
485 482
486struct bdb_psr {483struct bdb_psr {
487 struct psr_table psr_table[16];484 struct psr_table psr_table[16];
485
486 /* PSR2 TP2/TP3 wakeup time for 16 panels */
487 u32 psr2_tp2_tp3_wakeup_time;
488} __packed;488} __packed;
489 489
490/*490/*
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
396 else396 else
397 txesc2_div = 10;397 txesc2_div = 10;
398 398
399 I915_WRITE(MIPIO_TXESC_CLK_DIV1, txesc1_div & GLK_TX_ESC_CLK_DIV1_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, txesc2_div & GLK_TX_ESC_CLK_DIV2_MASK);400 I915_WRITE(MIPIO_TXESC_CLK_DIV2, (1 << (txesc2_div - 1)) & GLK_TX_ESC_CLK_DIV2_MASK);
401}401}
402 402
403/* Program BXT Mipi clocks and dividers */403/* 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
1628 1628
1629static int eb_copy_relocations(const struct i915_execbuffer *eb)1629static int eb_copy_relocations(const struct i915_execbuffer *eb)
1630{1630{
1631 struct drm_i915_gem_relocation_entry *relocs;
1631 const unsigned int count = eb->buffer_count;1632 const unsigned int count = eb->buffer_count;
1632 unsigned int i;1633 unsigned int i;
1633 int err;1634 int err;
@@ -1635,7 +1636,6 @@ static int eb_copy_relocations(const struct i915_execbuffer *eb) · 1 unmodified line
1635 for (i = 0; i < count; i++) {1636 for (i = 0; i < count; i++) {
1636 const unsigned int nreloc = eb->exec[i].relocation_count;1637 const unsigned int nreloc = eb->exec[i].relocation_count;
1637 struct drm_i915_gem_relocation_entry __user *urelocs;1638 struct drm_i915_gem_relocation_entry __user *urelocs;
1638 struct drm_i915_gem_relocation_entry *relocs;
1639 unsigned long size;1639 unsigned long size;
1640 unsigned long copied;1640 unsigned long copied;
1641 1641
@@ -1663,14 +1663,8 @@ static int eb_copy_relocations(const struct i915_execbuffer *eb) · 21 unmodified lines
1663 1663
1664 if (__copy_from_user((char *)relocs + copied,1664 if (__copy_from_user((char *)relocs + copied,
1665 (char __user *)urelocs + copied,1665 (char __user *)urelocs + copied,
1666 len)) {1666 len))
1667end_user:1667 goto end;
1668 user_access_end();
1669end:
1670 kvfree(relocs);
1671 err = -EFAULT;
1672 goto err;
1673 }
1674 1668
1675 copied += len;1669 copied += len;
1676 } while (copied < size);1670 } while (copied < size);
@@ -1699,10 +1693,14 @@ end: · 22 unmodified lines
1699 1693
1700 return 0;1694 return 0;
1701 1695
1696end_user:
1697 user_access_end();
1698end:
1699 kvfree(relocs);
1700 err = -EFAULT;
1702err:1701err:
1703 while (i--) {1702 while (i--) {
1704 struct drm_i915_gem_relocation_entry *relocs =1703 relocs = u64_to_ptr(typeof(*relocs), eb->exec[i].relocs_ptr);
1705 u64_to_ptr(typeof(*relocs), eb->exec[i].relocs_ptr);
1706 if (eb->exec[i].relocation_count)1704 if (eb->exec[i].relocation_count)
1707 kvfree(relocs);1705 kvfree(relocs);
1708 }1706 }
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
253 i915_gem_restore_gtt_mappings(i915);253 i915_gem_restore_gtt_mappings(i915);
254 i915_gem_restore_fences(i915);254 i915_gem_restore_fences(i915);
255 255
256 if (i915_gem_init_hw(i915))
257 goto err_wedged;
258
256 /*259 /*
257 * As we didn't flush the kernel context before suspend, we cannot260 * As we didn't flush the kernel context before suspend, we cannot
258 * guarantee that the context image is complete. So let's just reset261 * guarantee that the context image is complete. So let's just reset
259 * it and start again.262 * it and start again.
260 */263 */
261 intel_gt_resume(i915);264 if (intel_gt_resume(i915))
262
263 if (i915_gem_init_hw(i915))
264 goto err_wedged;265 goto err_wedged;
265 266
266 intel_uc_resume(i915);267 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
664 664
665 for_each_sgt_page(page, sgt_iter, pages) {665 for_each_sgt_page(page, sgt_iter, pages) {
666 if (obj->mm.dirty)666 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);
668 676
669 mark_page_accessed(page);677 mark_page_accessed(page);
670 put_page(page);678 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
126 if (ce->state)126 if (ce->state)
127 __context_unpin_state(ce->state);127 __context_unpin_state(ce->state);
128 128
129 intel_ring_unpin(ce->ring);
129 intel_context_put(ce);130 intel_context_put(ce);
130}131}
131 132
@@ -160,27 +161,35 @@ int intel_context_active_acquire(struct intel_context *ce, unsigned long flags) · 28 unmodified lines
160 161
161 intel_context_get(ce);162 intel_context_get(ce);
162 163
164 err = intel_ring_pin(ce->ring);
165 if (err)
166 goto err_put;
167
163 if (!ce->state)168 if (!ce->state)
164 return 0;169 return 0;
165 170
166 err = __context_pin_state(ce->state, flags);171 err = __context_pin_state(ce->state, flags);
167 if (err) {172 if (err)
168 i915_active_cancel(&ce->active);173 goto err_ring;
169 intel_context_put(ce);
170 return err;
171 }
172 174
173 /* Preallocate tracking nodes */175 /* Preallocate tracking nodes */
174 if (!i915_gem_context_is_kernel(ce->gem_context)) {176 if (!i915_gem_context_is_kernel(ce->gem_context)) {
175 err = i915_active_acquire_preallocate_barrier(&ce->active,177 err = i915_active_acquire_preallocate_barrier(&ce->active,
176 ce->engine);178 ce->engine);
177 if (err) {179 if (err)
178 i915_active_release(&ce->active);180 goto err_state;
179 return err;
180 }
181 }181 }
182 182
183 return 0;183 return 0;
184
185err_state:
186 __context_unpin_state(ce->state);
187err_ring:
188 intel_ring_unpin(ce->ring);
189err_put:
190 intel_context_put(ce);
191 i915_active_cancel(&ce->active);
192 return err;
184}193}
185 194
186void intel_context_active_release(struct intel_context *ce)195void 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
969u32 intel_calculate_mcr_s_ss_select(struct drm_i915_private *dev_priv)969u32 intel_calculate_mcr_s_ss_select(struct drm_i915_private *dev_priv)
970{970{
971 const struct sseu_dev_info *sseu = &RUNTIME_INFO(dev_priv)->sseu;971 const struct sseu_dev_info *sseu = &RUNTIME_INFO(dev_priv)->sseu;
972 unsigned int slice = fls(sseu->slice_mask) - 1;
973 unsigned int subslice;
972 u32 mcr_s_ss_select;974 u32 mcr_s_ss_select;
973 u32 slice = fls(sseu->slice_mask);975
974 u32 subslice = fls(sseu->subslice_mask[slice]);976 GEM_BUG_ON(slice >= ARRAY_SIZE(sseu->subslice_mask));
977 subslice = fls(sseu->subslice_mask[slice]);
978 GEM_BUG_ON(!subslice);
979 subslice--;
975 980
976 if (IS_GEN(dev_priv, 10))981 if (IS_GEN(dev_priv, 10))
977 mcr_s_ss_select = GEN8_MCR_SLICE(slice) |982 mcr_s_ss_select = GEN8_MCR_SLICE(slice) |
@@ -1471,6 +1476,7 @@ void intel_engine_dump(struct intel_engine_cs *engine, · 493 unmodified lines
1471 struct i915_gpu_error * const error = &engine->i915->gpu_error;1476 struct i915_gpu_error * const error = &engine->i915->gpu_error;
1472 struct i915_request *rq;1477 struct i915_request *rq;
1473 intel_wakeref_t wakeref;1478 intel_wakeref_t wakeref;
1479 unsigned long flags;
1474 1480
1475 if (header) {1481 if (header) {
1476 va_list ap;1482 va_list ap;
@@ -1490,10 +1496,9 @@ void intel_engine_dump(struct intel_engine_cs *engine, · 13 unmodified lines
1490 i915_reset_engine_count(error, engine),1496 i915_reset_engine_count(error, engine),
1491 i915_reset_count(error));1497 i915_reset_count(error));
1492 1498
1493 rcu_read_lock();
1494
1495 drm_printf(m, "\tRequests:\n");1499 drm_printf(m, "\tRequests:\n");
1496 1500
1501 spin_lock_irqsave(&engine->active.lock, flags);
1497 rq = intel_engine_find_active_request(engine);1502 rq = intel_engine_find_active_request(engine);
1498 if (rq) {1503 if (rq) {
1499 print_request(m, rq, "\t\tactive ");1504 print_request(m, rq, "\t\tactive ");
@@ -1513,8 +1518,7 @@ void intel_engine_dump(struct intel_engine_cs *engine, · 13 unmodified lines
1513 1518
1514 print_request_ring(m, rq);1519 print_request_ring(m, rq);
1515 }1520 }
1516 1521 spin_unlock_irqrestore(&engine->active.lock, flags);
1517 rcu_read_unlock();
1518 1522
1519 wakeref = intel_runtime_pm_get_if_in_use(&engine->i915->runtime_pm);1523 wakeref = intel_runtime_pm_get_if_in_use(&engine->i915->runtime_pm);
1520 if (wakeref) {1524 if (wakeref) {
@@ -1672,7 +1676,6 @@ struct i915_request * · 151 unmodified lines
1672intel_engine_find_active_request(struct intel_engine_cs *engine)1676intel_engine_find_active_request(struct intel_engine_cs *engine)
1673{1677{
1674 struct i915_request *request, *active = NULL;1678 struct i915_request *request, *active = NULL;
1675 unsigned long flags;
1676 1679
1677 /*1680 /*
1678 * We are called by the error capture, reset and to dump engine1681 * 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
1685 * At all other times, we must assume the GPU is still running, but1688 * At all other times, we must assume the GPU is still running, but
1686 * we only care about the snapshot of this moment.1689 * we only care about the snapshot of this moment.
1687 */1690 */
1688 spin_lock_irqsave(&engine->active.lock, flags);1691 lockdep_assert_held(&engine->active.lock);
1689 list_for_each_entry(request, &engine->active.requests, sched.link) {1692 list_for_each_entry(request, &engine->active.requests, sched.link) {
1690 if (i915_request_completed(request))1693 if (i915_request_completed(request))
1691 continue;1694 continue;
@@ -1700,7 +1703,6 @@ intel_engine_find_active_request(struct intel_engine_cs *engine) · 8 unmodified lines
1700 active = request;1703 active = request;
1701 break;1704 break;
1702 }1705 }
1703 spin_unlock_irqrestore(&engine->active.lock, flags);
1704 1706
1705 return active;1707 return active;
1706}1708}
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
142{142{
143 intel_wakeref_init(&engine->wakeref);143 intel_wakeref_init(&engine->wakeref);
144}144}
145
146int 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
7#ifndef INTEL_ENGINE_PM_H7#ifndef INTEL_ENGINE_PM_H
8#define INTEL_ENGINE_PM_H8#define INTEL_ENGINE_PM_H
9 9
10#include "intel_engine_types.h"
11#include "intel_wakeref.h"
12
10struct drm_i915_private;13struct drm_i915_private;
11struct intel_engine_cs;
12 14
13void intel_engine_pm_get(struct intel_engine_cs *engine);15void intel_engine_pm_get(struct intel_engine_cs *engine);
14void intel_engine_pm_put(struct intel_engine_cs *engine);16void intel_engine_pm_put(struct intel_engine_cs *engine);
15 17
18static inline bool
19intel_engine_pm_get_if_awake(struct intel_engine_cs *engine)
20{
21 return intel_wakeref_get_if_active(&engine->wakeref);
22}
23
16void intel_engine_park(struct intel_engine_cs *engine);24void intel_engine_park(struct intel_engine_cs *engine);
17 25
18void intel_engine_init__pm(struct intel_engine_cs *engine);26void intel_engine_init__pm(struct intel_engine_cs *engine);
19 27
20int intel_engines_resume(struct drm_i915_private *i915);
21
22#endif /* INTEL_ENGINE_PM_H */28#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
70 struct list_head request_list;70 struct list_head request_list;
71 struct list_head active_link;71 struct list_head active_link;
72 72
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
73 u32 head;85 u32 head;
74 u32 tail;86 u32 tail;
75 u32 emit;87 u32 emit;
drivers/gpu/drm/i915/gt/intel_gt_pm.c+20−1
@@ -5,6 +5,7 @@ · 4 unmodified lines
5 */5 */
6 6
7#include "i915_drv.h"7#include "i915_drv.h"
8#include "intel_engine_pm.h"
8#include "intel_gt_pm.h"9#include "intel_gt_pm.h"
9#include "intel_pm.h"10#include "intel_pm.h"
10#include "intel_wakeref.h"11#include "intel_wakeref.h"
@@ -118,10 +119,11 @@ void intel_gt_sanitize(struct drm_i915_private *i915, bool force) · 107 unmodified lines
118 intel_engine_reset(engine, false);119 intel_engine_reset(engine, false);
119}120}
120 121
121void intel_gt_resume(struct drm_i915_private *i915)122int intel_gt_resume(struct drm_i915_private *i915)
122{123{
123 struct intel_engine_cs *engine;124 struct intel_engine_cs *engine;
124 enum intel_engine_id id;125 enum intel_engine_id id;
126 int err = 0;
125 127
126 /*128 /*
127 * After resume, we may need to poke into the pinned kernel129 * 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
129 * Only the kernel contexts should remain pinned over suspend,131 * Only the kernel contexts should remain pinned over suspend,
130 * allowing us to fixup the user contexts on their first pin.132 * allowing us to fixup the user contexts on their first pin.
131 */133 */
134 intel_gt_pm_get(i915);
132 for_each_engine(engine, i915, id) {135 for_each_engine(engine, i915, id) {
133 struct intel_context *ce;136 struct intel_context *ce;
134 137
138 intel_engine_pm_get(engine);
139
135 ce = engine->kernel_context;140 ce = engine->kernel_context;
136 if (ce)141 if (ce)
137 ce->ops->reset(ce);142 ce->ops->reset(ce);
@@ -139,5 +144,19 @@ void intel_gt_resume(struct drm_i915_private *i915) · 1 unmodified line
139 ce = engine->preempt_context;144 ce = engine->preempt_context;
140 if (ce)145 if (ce)
141 ce->ops->reset(ce);146 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 }
142 }158 }
159 intel_gt_pm_put(i915);
160
161 return err;
143}162}
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
22void intel_gt_pm_init(struct drm_i915_private *i915);22void intel_gt_pm_init(struct drm_i915_private *i915);
23 23
24void intel_gt_sanitize(struct drm_i915_private *i915, bool force);24void intel_gt_sanitize(struct drm_i915_private *i915, bool force);
25void intel_gt_resume(struct drm_i915_private *i915);25int intel_gt_resume(struct drm_i915_private *i915);
26 26
27#endif /* INTEL_GT_PM_H */27#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
1414{1414{
1415 struct intel_context *ce = container_of(kref, typeof(*ce), ref);1415 struct intel_context *ce = container_of(kref, typeof(*ce), ref);
1416 1416
1417 GEM_BUG_ON(!i915_active_is_idle(&ce->active));
1417 GEM_BUG_ON(intel_context_is_pinned(ce));1418 GEM_BUG_ON(intel_context_is_pinned(ce));
1418 1419
1419 if (ce->state)1420 if (ce->state)
@@ -1426,7 +1427,6 @@ static void execlists_context_unpin(struct intel_context *ce) · 6 unmodified lines
1426{1427{
1427 i915_gem_context_unpin_hw_id(ce->gem_context);1428 i915_gem_context_unpin_hw_id(ce->gem_context);
1428 i915_gem_object_unpin_map(ce->state->obj);1429 i915_gem_object_unpin_map(ce->state->obj);
1429 intel_ring_unpin(ce->ring);
1430}1430}
1431 1431
1432static void1432static void
@@ -1478,13 +1478,9 @@ __execlists_context_pin(struct intel_context *ce, · 45 unmodified lines
1478 goto unpin_active;1478 goto unpin_active;
1479 }1479 }
1480 1480
1481 ret = intel_ring_pin(ce->ring);
1482 if (ret)
1483 goto unpin_map;
1484
1485 ret = i915_gem_context_pin_hw_id(ce->gem_context);1481 ret = i915_gem_context_pin_hw_id(ce->gem_context);
1486 if (ret)1482 if (ret)
1487 goto unpin_ring;1483 goto unpin_map;
1488 1484
1489 ce->lrc_desc = lrc_descriptor(ce, engine);1485 ce->lrc_desc = lrc_descriptor(ce, engine);
1490 ce->lrc_reg_state = vaddr + LRC_STATE_PN * PAGE_SIZE;1486 ce->lrc_reg_state = vaddr + LRC_STATE_PN * PAGE_SIZE;
@@ -1492,8 +1488,6 @@ __execlists_context_pin(struct intel_context *ce, · 1 unmodified line
1492 1488
1493 return 0;1489 return 0;
1494 1490
1495unpin_ring:
1496 intel_ring_unpin(ce->ring);
1497unpin_map:1491unpin_map:
1498 i915_gem_object_unpin_map(ce->state->obj);1492 i915_gem_object_unpin_map(ce->state->obj);
1499unpin_active:1493unpin_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
687 * written to the powercontext is undefined and so we may lose687 * written to the powercontext is undefined and so we may lose
688 * GPU state upon resume, i.e. fail to restart after a reset.688 * GPU state upon resume, i.e. fail to restart after a reset.
689 */689 */
690 intel_engine_pm_get(engine);
691 intel_uncore_forcewake_get(engine->uncore, FORCEWAKE_ALL);690 intel_uncore_forcewake_get(engine->uncore, FORCEWAKE_ALL);
692 engine->reset.prepare(engine);691 engine->reset.prepare(engine);
693}692}
@@ -718,16 +717,21 @@ static void revoke_mmaps(struct drm_i915_private *i915) · 24 unmodified lines
718 }717 }
719}718}
720 719
721static void reset_prepare(struct drm_i915_private *i915)720static intel_engine_mask_t reset_prepare(struct drm_i915_private *i915)
722{721{
723 struct intel_engine_cs *engine;722 struct intel_engine_cs *engine;
723 intel_engine_mask_t awake = 0;
724 enum intel_engine_id id;724 enum intel_engine_id id;
725 725
726 intel_gt_pm_get(i915);726 for_each_engine(engine, i915, id) {
727 for_each_engine(engine, i915, id)727 if (intel_engine_pm_get_if_awake(engine))
728 awake |= engine->mask;
728 reset_prepare_engine(engine);729 reset_prepare_engine(engine);
730 }
729 731
730 intel_uc_reset_prepare(i915);732 intel_uc_reset_prepare(i915);
733
734 return awake;
731}735}
732 736
733static void gt_revoke(struct drm_i915_private *i915)737static void gt_revoke(struct drm_i915_private *i915)
@@ -761,20 +765,22 @@ static int gt_reset(struct drm_i915_private *i915, · 27 unmodified lines
761static void reset_finish_engine(struct intel_engine_cs *engine)765static void reset_finish_engine(struct intel_engine_cs *engine)
762{766{
763 engine->reset.finish(engine);767 engine->reset.finish(engine);
764 intel_engine_pm_put(engine);
765 intel_uncore_forcewake_put(engine->uncore, FORCEWAKE_ALL);768 intel_uncore_forcewake_put(engine->uncore, FORCEWAKE_ALL);
769
770 intel_engine_signal_breadcrumbs(engine);
766}771}
767 772
768static void reset_finish(struct drm_i915_private *i915)773static void reset_finish(struct drm_i915_private *i915,
774 intel_engine_mask_t awake)
769{775{
770 struct intel_engine_cs *engine;776 struct intel_engine_cs *engine;
771 enum intel_engine_id id;777 enum intel_engine_id id;
772 778
773 for_each_engine(engine, i915, id) {779 for_each_engine(engine, i915, id) {
774 reset_finish_engine(engine);780 reset_finish_engine(engine);
775 intel_engine_signal_breadcrumbs(engine);781 if (awake & engine->mask)
782 intel_engine_pm_put(engine);
776 }783 }
777 intel_gt_pm_put(i915);
778}784}
779 785
780static void nop_submit_request(struct i915_request *request)786static 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
798{804{
799 struct i915_gpu_error *error = &i915->gpu_error;805 struct i915_gpu_error *error = &i915->gpu_error;
800 struct intel_engine_cs *engine;806 struct intel_engine_cs *engine;
807 intel_engine_mask_t awake;
801 enum intel_engine_id id;808 enum intel_engine_id id;
802 809
803 if (test_bit(I915_WEDGED, &error->flags))810 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
817 * rolling the global seqno forward (since this would complete requests824 * rolling the global seqno forward (since this would complete requests
818 * for which we haven't set the fence error to EIO yet).825 * for which we haven't set the fence error to EIO yet).
819 */826 */
820 reset_prepare(i915);827 awake = reset_prepare(i915);
821 828
822 /* Even if the GPU reset fails, it should still stop the engines */829 /* Even if the GPU reset fails, it should still stop the engines */
823 if (!INTEL_INFO(i915)->gpu_reset_clobbers_display)830 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
841 for_each_engine(engine, i915, id)848 for_each_engine(engine, i915, id)
842 engine->cancel_requests(engine);849 engine->cancel_requests(engine);
843 850
844 reset_finish(i915);851 reset_finish(i915, awake);
845 852
846 GEM_TRACE("end\n");853 GEM_TRACE("end\n");
847}854}
@@ -951,6 +958,21 @@ static int do_reset(struct drm_i915_private *i915, · 103 unmodified lines
951 return gt_reset(i915, stalled_mask);958 return gt_reset(i915, stalled_mask);
952}959}
953 960
961static 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
954/**976/**
955 * i915_reset - reset chip after a hang977 * i915_reset - reset chip after a hang
956 * @i915: #drm_i915_private to reset978 * @i915: #drm_i915_private to reset
@@ -973,6 +995,7 @@ void i915_reset(struct drm_i915_private *i915, · 16 unmodified lines
973 const char *reason)995 const char *reason)
974{996{
975 struct i915_gpu_error *error = &i915->gpu_error;997 struct i915_gpu_error *error = &i915->gpu_error;
998 intel_engine_mask_t awake;
976 int ret;999 int ret;
977 1000
978 GEM_TRACE("flags=%lx\n", error->flags);1001 GEM_TRACE("flags=%lx\n", error->flags);
@@ -989,7 +1012,7 @@ void i915_reset(struct drm_i915_private *i915, · 10 unmodified lines
989 dev_notice(i915->drm.dev, "Resetting chip for %s\n", reason);1012 dev_notice(i915->drm.dev, "Resetting chip for %s\n", reason);
990 error->reset_count++;1013 error->reset_count++;
991 1014
992 reset_prepare(i915);1015 awake = reset_prepare(i915);
993 1016
994 if (!intel_has_gpu_reset(i915)) {1017 if (!intel_has_gpu_reset(i915)) {
995 if (i915_modparams.reset)1018 if (i915_modparams.reset)
@@ -1024,13 +1047,17 @@ void i915_reset(struct drm_i915_private *i915, · 28 unmodified lines
1024 if (ret) {1047 if (ret) {
1025 DRM_ERROR("Failed to initialise HW following reset (%d)\n",1048 DRM_ERROR("Failed to initialise HW following reset (%d)\n",
1026 ret);1049 ret);
1027 goto error;1050 goto taint;
1028 }1051 }
1029 1052
1053 ret = resume(i915);
1054 if (ret)
1055 goto taint;
1056
1030 i915_queue_hangcheck(i915);1057 i915_queue_hangcheck(i915);
1031 1058
1032finish:1059finish:
1033 reset_finish(i915);1060 reset_finish(i915, awake);
1034unlock:1061unlock:
1035 mutex_unlock(&error->wedge_mutex);1062 mutex_unlock(&error->wedge_mutex);
1036 return;1063 return;
@@ -1081,7 +1108,7 @@ int i915_reset_engine(struct intel_engine_cs *engine, const char *msg) · 44 unmodified lines
1081 GEM_TRACE("%s flags=%lx\n", engine->name, error->flags);1108 GEM_TRACE("%s flags=%lx\n", engine->name, error->flags);
1082 GEM_BUG_ON(!test_bit(I915_RESET_ENGINE + engine->id, &error->flags));1109 GEM_BUG_ON(!test_bit(I915_RESET_ENGINE + engine->id, &error->flags));
1083 1110
1084 if (!intel_wakeref_active(&engine->wakeref))1111 if (!intel_engine_pm_get_if_awake(engine))
1085 return 0;1112 return 0;
1086 1113
1087 reset_prepare_engine(engine);1114 reset_prepare_engine(engine);
@@ -1116,12 +1143,11 @@ int i915_reset_engine(struct intel_engine_cs *engine, const char *msg) · 28 unmodified lines
1116 * process to program RING_MODE, HWSP and re-enable submission.1143 * process to program RING_MODE, HWSP and re-enable submission.
1117 */1144 */
1118 ret = engine->resume(engine);1145 ret = engine->resume(engine);
1119 if (ret)
1120 goto out;
1121 1146
1122out:1147out:
1123 intel_engine_cancel_stop_cs(engine);1148 intel_engine_cancel_stop_cs(engine);
1124 reset_finish_engine(engine);1149 reset_finish_engine(engine);
1150 intel_engine_pm_put(engine);
1125 return ret;1151 return ret;
1126}1152}
1127 1153
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
1149int intel_ring_pin(struct intel_ring *ring)1149int intel_ring_pin(struct intel_ring *ring)
1150{1150{
1151 struct i915_vma *vma = ring->vma;1151 struct i915_vma *vma = ring->vma;
1152 enum i915_map_type map = i915_coherent_map_type(vma->vm->i915);
1153 unsigned int flags;1152 unsigned int flags;
1154 void *addr;1153 void *addr;
1155 int ret;1154 int ret;
1156 1155
1157 GEM_BUG_ON(ring->vaddr);1156 if (atomic_fetch_inc(&ring->pin_count))
1157 return 0;
1158 1158
1159 ret = i915_timeline_pin(ring->timeline);1159 ret = i915_timeline_pin(ring->timeline);
1160 if (ret)1160 if (ret)
1161 return ret;1161 goto err_unpin;
1162 1162
1163 flags = PIN_GLOBAL;1163 flags = PIN_GLOBAL;
1164 1164
@@ -1172,26 +1172,31 @@ int intel_ring_pin(struct intel_ring *ring) · 7 unmodified lines
1172 1172
1173 ret = i915_vma_pin(vma, 0, 0, flags);1173 ret = i915_vma_pin(vma, 0, 0, flags);
1174 if (unlikely(ret))1174 if (unlikely(ret))
1175 goto unpin_timeline;1175 goto err_timeline;
1176 1176
1177 if (i915_vma_is_map_and_fenceable(vma))1177 if (i915_vma_is_map_and_fenceable(vma))
1178 addr = (void __force *)i915_vma_pin_iomap(vma);1178 addr = (void __force *)i915_vma_pin_iomap(vma);
1179 else1179 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));
1181 if (IS_ERR(addr)) {1182 if (IS_ERR(addr)) {
1182 ret = PTR_ERR(addr);1183 ret = PTR_ERR(addr);
1183 goto unpin_ring;1184 goto err_ring;
1184 }1185 }
1185 1186
1186 vma->obj->pin_global++;1187 vma->obj->pin_global++;
1187 1188
1189 GEM_BUG_ON(ring->vaddr);
1188 ring->vaddr = addr;1190 ring->vaddr = addr;
1191
1189 return 0;1192 return 0;
1190 1193
1191unpin_ring:1194err_ring:
1192 i915_vma_unpin(vma);1195 i915_vma_unpin(vma);
1193unpin_timeline:1196err_timeline:
1194 i915_timeline_unpin(ring->timeline);1197 i915_timeline_unpin(ring->timeline);
1198err_unpin:
1199 atomic_dec(&ring->pin_count);
1195 return ret;1200 return ret;
1196}1201}
1197 1202
@@ -1207,16 +1212,19 @@ void intel_ring_reset(struct intel_ring *ring, u32 tail) · 9 unmodified lines
1207 1212
1208void intel_ring_unpin(struct intel_ring *ring)1213void intel_ring_unpin(struct intel_ring *ring)
1209{1214{
1210 GEM_BUG_ON(!ring->vma);1215 if (!atomic_dec_and_test(&ring->pin_count))
1211 GEM_BUG_ON(!ring->vaddr);1216 return;
1212 1217
1213 /* Discard any unused bytes beyond that submitted to hw. */1218 /* Discard any unused bytes beyond that submitted to hw. */
1214 intel_ring_reset(ring, ring->tail);1219 intel_ring_reset(ring, ring->tail);
1215 1220
1221 GEM_BUG_ON(!ring->vma);
1216 if (i915_vma_is_map_and_fenceable(ring->vma))1222 if (i915_vma_is_map_and_fenceable(ring->vma))
1217 i915_vma_unpin_iomap(ring->vma);1223 i915_vma_unpin_iomap(ring->vma);
1218 else1224 else
1219 i915_gem_object_unpin_map(ring->vma->obj);1225 i915_gem_object_unpin_map(ring->vma->obj);
1226
1227 GEM_BUG_ON(!ring->vaddr);
1220 ring->vaddr = NULL;1228 ring->vaddr = NULL;
1221 1229
1222 ring->vma->obj->pin_global--;1230 ring->vma->obj->pin_global--;
@@ -2081,10 +2089,11 @@ static void ring_destroy(struct intel_engine_cs *engine) · 858 unmodified lines
2081 WARN_ON(INTEL_GEN(dev_priv) > 2 &&2089 WARN_ON(INTEL_GEN(dev_priv) > 2 &&
2082 (ENGINE_READ(engine, RING_MI_MODE) & MODE_IDLE) == 0);2090 (ENGINE_READ(engine, RING_MI_MODE) & MODE_IDLE) == 0);
2083 2091
2092 intel_engine_cleanup_common(engine);
2093
2084 intel_ring_unpin(engine->buffer);2094 intel_ring_unpin(engine->buffer);
2085 intel_ring_put(engine->buffer);2095 intel_ring_put(engine->buffer);
2086 2096
2087 intel_engine_cleanup_common(engine);
2088 kfree(engine);2097 kfree(engine);
2089}2098}
2090 2099
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
1098 1098
1099static void cfl_whitelist_build(struct intel_engine_cs *engine)1099static void cfl_whitelist_build(struct intel_engine_cs *engine)
1100{1100{
1101 struct i915_wa_list *w = &engine->whitelist;
1102
1101 if (engine->class != RENDER_CLASS)1103 if (engine->class != RENDER_CLASS)
1102 return;1104 return;
1103 1105
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);
1105}1120}
1106 1121
1107static void cnl_whitelist_build(struct intel_engine_cs *engine)1122static 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
1129 1144
1130 /* WaEnableStateCacheRedirectToCS:icl */1145 /* WaEnableStateCacheRedirectToCS:icl */
1131 whitelist_reg(w, GEN9_SLICE_COMMON_ECO_CHICKEN1);1146 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);
1132 break;1160 break;
1133 1161
1134 case VIDEO_DECODE_CLASS:1162 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
1258 if (IS_ICL_REVID(i915, ICL_REVID_A0, ICL_REVID_B0))1286 if (IS_ICL_REVID(i915, ICL_REVID_A0, ICL_REVID_B0))
1259 wa_write_or(wal,1287 wa_write_or(wal,
1260 GEN7_SARCHKMD,1288 GEN7_SARCHKMD,
1261 GEN7_DISABLE_DEMAND_PREFETCH |1289 GEN7_DISABLE_DEMAND_PREFETCH);
1262 GEN7_DISABLE_SAMPLER_PREFETCH);1290
1291 /* Wa_1606682166:icl */
1292 wa_write_or(wal,
1293 GEN7_SARCHKMD,
1294 GEN7_DISABLE_SAMPLER_PREFETCH);
1263 }1295 }
1264 1296
1265 if (IS_GEN_RANGE(i915, 9, 11)) {1297 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
66 ring->base.effective_size = sz;66 ring->base.effective_size = sz;
67 ring->base.vaddr = (void *)(ring + 1);67 ring->base.vaddr = (void *)(ring + 1);
68 ring->base.timeline = &ring->timeline;68 ring->base.timeline = &ring->timeline;
69 atomic_set(&ring->base.pin_count, 1);
69 70
70 INIT_LIST_HEAD(&ring->base.request_list);71 INIT_LIST_HEAD(&ring->base.request_list);
71 intel_ring_update_space(&ring->base);72 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
71 goto unlock;71 goto unlock;
72 72
73 for (p = igt_atomic_phases; p->name; p++) {73 for (p = igt_atomic_phases; p->name; p++) {
74 intel_engine_mask_t awake;
75
74 GEM_TRACE("intel_gpu_reset under %s\n", p->name);76 GEM_TRACE("intel_gpu_reset under %s\n", p->name);
75 77
78 awake = reset_prepare(i915);
76 p->critical_section_begin();79 p->critical_section_begin();
77 reset_prepare(i915);80 reset_prepare(i915);
78 err = intel_gpu_reset(i915, ALL_ENGINES);81 err = intel_gpu_reset(i915, ALL_ENGINES);
79 reset_finish(i915);
80 p->critical_section_end();82 p->critical_section_end();
83 reset_finish(i915, awake);
81 84
82 if (err) {85 if (err) {
83 pr_err("intel_gpu_reset failed under %s\n", p->name);86 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
925 925
926 err = 0;926 err = 0;
927 for (i = 0; i < engine->whitelist.count; i++) {927 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))
929 err = -EINVAL;934 err = -EINVAL;
930 }935 }
931 936
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
2674 gma_head == gma_tail)2674 gma_head == gma_tail)
2675 return 0;2675 return 0;
2676 2676
2677 if (!intel_gvt_ggtt_validate_range(s.vgpu, s.ring_start, s.ring_size)) {
2678 ret = -EINVAL;
2679 goto out;
2680 }
2681
2682 ret = ip_gma_set(&s, gma_head);2677 ret = ip_gma_set(&s, gma_head);
2683 if (ret)2678 if (ret)
2684 goto out;2679 goto out;
@@ -2724,11 +2719,6 @@ static int scan_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx) · 39 unmodified lines
2724 s.workload = workload;2719 s.workload = workload;
2725 s.is_ctx_wa = true;2720 s.is_ctx_wa = true;
2726 2721
2727 if (!intel_gvt_ggtt_validate_range(s.vgpu, s.ring_start, s.ring_size)) {
2728 ret = -EINVAL;
2729 goto out;
2730 }
2731
2732 ret = ip_gma_set(&s, gma_head);2722 ret = ip_gma_set(&s, gma_head);
2733 if (ret)2723 if (ret)
2734 goto out;2724 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
245 plane->hw_format = fmt;245 plane->hw_format = fmt;
246 246
247 plane->base = vgpu_vreg_t(vgpu, DSPSURF(pipe)) & I915_GTT_PAGE_MASK;247 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))
249 return -EINVAL;249 return -EINVAL;
250 250
251 plane->base_gpa = intel_vgpu_gma_to_gpa(vgpu->gtt.ggtt_mm, plane->base);251 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
368 alpha_plane, alpha_force);368 alpha_plane, alpha_force);
369 369
370 plane->base = vgpu_vreg_t(vgpu, CURBASE(pipe)) & I915_GTT_PAGE_MASK;370 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))
372 return -EINVAL;372 return -EINVAL;
373 373
374 plane->base_gpa = intel_vgpu_gma_to_gpa(vgpu->gtt.ggtt_mm, plane->base);374 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
472 plane->drm_format = drm_format;472 plane->drm_format = drm_format;
473 473
474 plane->base = vgpu_vreg_t(vgpu, SPRSURF(pipe)) & I915_GTT_PAGE_MASK;474 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))
476 return -EINVAL;476 return -EINVAL;
477 477
478 plane->base_gpa = intel_vgpu_gma_to_gpa(vgpu->gtt.ggtt_mm, plane->base);478 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
2141 struct intel_vgpu_mm *ggtt_mm = vgpu->gtt.ggtt_mm;2141 struct intel_vgpu_mm *ggtt_mm = vgpu->gtt.ggtt_mm;
2142 const struct intel_gvt_device_info *info = &vgpu->gvt->device_info;2142 const struct intel_gvt_device_info *info = &vgpu->gvt->device_info;
2143 unsigned long index = off >> info->gtt_entry_size_shift;2143 unsigned long index = off >> info->gtt_entry_size_shift;
2144 unsigned long gma;
2144 struct intel_gvt_gtt_entry e;2145 struct intel_gvt_gtt_entry e;
2145 2146
2146 if (bytes != 4 && bytes != 8)2147 if (bytes != 4 && bytes != 8)
2147 return -EINVAL;2148 return -EINVAL;
2148 2149
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
2149 ggtt_get_guest_entry(ggtt_mm, &e, index);2158 ggtt_get_guest_entry(ggtt_mm, &e, index);
2150 memcpy(p_data, (void *)&e.val64 + (off & (info->gtt_entry_size - 1)),2159 memcpy(p_data, (void *)&e.val64 + (off & (info->gtt_entry_size - 1)),
2151 bytes);2160 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
1904 1904
1905 entry = __gvt_cache_find_gfn(info->vgpu, gfn);1905 entry = __gvt_cache_find_gfn(info->vgpu, gfn);
1906 if (!entry) {1906 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
1907 ret = gvt_dma_map_page(vgpu, gfn, dma_addr, size);1919 ret = gvt_dma_map_page(vgpu, gfn, dma_addr, size);
1908 if (ret)1920 if (ret)
1909 goto err_unlock;1921 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
364 wa_ctx->indirect_ctx.shadow_va = NULL;364 wa_ctx->indirect_ctx.shadow_va = NULL;
365}365}
366 366
367static int set_context_ppgtt_from_shadow(struct intel_vgpu_workload *workload,367static void set_context_ppgtt_from_shadow(struct intel_vgpu_workload *workload,
368 struct i915_gem_context *ctx)368 struct i915_gem_context *ctx)
369{369{
370 struct intel_vgpu_mm *mm = workload->shadow_mm;370 struct intel_vgpu_mm *mm = workload->shadow_mm;
371 struct i915_ppgtt *ppgtt = i915_vm_to_ppgtt(ctx->vm);371 struct i915_ppgtt *ppgtt = i915_vm_to_ppgtt(ctx->vm);
372 int i = 0;372 int i = 0;
373 373
374 if (mm->type != INTEL_GVT_MM_PPGTT || !mm->ppgtt_mm.shadowed)
375 return -EINVAL;
376
377 if (mm->ppgtt_mm.root_entry_type == GTT_TYPE_PPGTT_ROOT_L4_ENTRY) {374 if (mm->ppgtt_mm.root_entry_type == GTT_TYPE_PPGTT_ROOT_L4_ENTRY) {
378 px_dma(ppgtt->pd) = mm->ppgtt_mm.shadow_pdps[0];375 px_dma(ppgtt->pd) = mm->ppgtt_mm.shadow_pdps[0];
379 } else {376 } else {
@@ -384,8 +381,6 @@ static int set_context_ppgtt_from_shadow(struct intel_vgpu_workload *workload, · 4 unmodified lines
384 px_dma(pd) = mm->ppgtt_mm.shadow_pdps[i];381 px_dma(pd) = mm->ppgtt_mm.shadow_pdps[i];
385 }382 }
386 }383 }
387
388 return 0;
389}384}
390 385
391static int386static int
@@ -614,6 +609,8 @@ static void release_shadow_batch_buffer(struct intel_vgpu_workload *workload) · 222 unmodified lines
614static int prepare_workload(struct intel_vgpu_workload *workload)609static int prepare_workload(struct intel_vgpu_workload *workload)
615{610{
616 struct intel_vgpu *vgpu = workload->vgpu;611 struct intel_vgpu *vgpu = workload->vgpu;
612 struct intel_vgpu_submission *s = &vgpu->submission;
613 int ring = workload->ring_id;
617 int ret = 0;614 int ret = 0;
618 615
619 ret = intel_vgpu_pin_mm(workload->shadow_mm);616 ret = intel_vgpu_pin_mm(workload->shadow_mm);
@@ -622,8 +619,16 @@ static int prepare_workload(struct intel_vgpu_workload *workload) · 2 unmodified lines
622 return ret;619 return ret;
623 }620 }
624 621
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
625 update_shadow_pdps(workload);628 update_shadow_pdps(workload);
626 629
630 set_context_ppgtt_from_shadow(workload, s->shadow[ring]->gem_context);
631
627 ret = intel_vgpu_sync_oos_pages(workload->vgpu);632 ret = intel_vgpu_sync_oos_pages(workload->vgpu);
628 if (ret) {633 if (ret) {
629 gvt_vgpu_err("fail to vgpu sync oos pages\n");634 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
674{679{
675 struct intel_vgpu *vgpu = workload->vgpu;680 struct intel_vgpu *vgpu = workload->vgpu;
676 struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;681 struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;
677 struct intel_vgpu_submission *s = &vgpu->submission;
678 struct i915_request *rq;682 struct i915_request *rq;
679 int ring_id = workload->ring_id;683 int ring_id = workload->ring_id;
680 int ret;684 int ret;
@@ -685,13 +689,6 @@ static int dispatch_workload(struct intel_vgpu_workload *workload) · 4 unmodified lines
685 mutex_lock(&vgpu->vgpu_lock);689 mutex_lock(&vgpu->vgpu_lock);
686 mutex_lock(&dev_priv->drm.struct_mutex);690 mutex_lock(&dev_priv->drm.struct_mutex);
687 691
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
695 ret = intel_gvt_workload_req_alloc(workload);692 ret = intel_gvt_workload_req_alloc(workload);
696 if (ret)693 if (ret)
697 goto err_req;694 goto err_req;
@@ -990,6 +987,7 @@ static int workload_thread(void *priv) · 292 unmodified lines
990 int ret;987 int ret;
991 bool need_force_wake = (INTEL_GEN(gvt->dev_priv) >= 9);988 bool need_force_wake = (INTEL_GEN(gvt->dev_priv) >= 9);
992 DEFINE_WAIT_FUNC(wait, woken_wake_function);989 DEFINE_WAIT_FUNC(wait, woken_wake_function);
990 struct intel_runtime_pm *rpm = &gvt->dev_priv->runtime_pm;
993 991
994 kfree(p);992 kfree(p);
995 993
@@ -1013,6 +1011,8 @@ static int workload_thread(void *priv) · 17 unmodified lines
1013 workload->ring_id, workload,1011 workload->ring_id, workload,
1014 workload->vgpu->id);1012 workload->vgpu->id);
1015 1013
1014 intel_runtime_pm_get(rpm);
1015
1016 gvt_dbg_sched("ring id %d will dispatch workload %p\n",1016 gvt_dbg_sched("ring id %d will dispatch workload %p\n",
1017 workload->ring_id, workload);1017 workload->ring_id, workload);
1018 1018
@@ -1042,6 +1042,7 @@ complete: · 23 unmodified lines
1042 intel_uncore_forcewake_put(&gvt->dev_priv->uncore,1042 intel_uncore_forcewake_put(&gvt->dev_priv->uncore,
1043 FORCEWAKE_ALL);1043 FORCEWAKE_ALL);
1044 1044
1045 intel_runtime_pm_put_unchecked(rpm);
1045 if (ret && (vgpu_is_vm_unhealthy(ret)))1046 if (ret && (vgpu_is_vm_unhealthy(ret)))
1046 enter_failsafe_mode(vgpu, GVT_FAILSAFE_GUEST_ERR);1047 enter_failsafe_mode(vgpu, GVT_FAILSAFE_GUEST_ERR);
1047 }1048 }
@@ -1492,6 +1493,12 @@ intel_vgpu_create_workload(struct intel_vgpu *vgpu, int ring_id, · 444 unmodified lines
1492 intel_gvt_hypervisor_read_gpa(vgpu, ring_context_gpa +1493 intel_gvt_hypervisor_read_gpa(vgpu, ring_context_gpa +
1493 RING_CTX_OFF(ctx_ctrl.val), &ctx_ctl, 4);1494 RING_CTX_OFF(ctx_ctrl.val), &ctx_ctl, 4);
1494 1495
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
1495 workload = alloc_workload(vgpu);1502 workload = alloc_workload(vgpu);
1496 if (IS_ERR(workload))1503 if (IS_ERR(workload))
1497 return workload;1504 return workload;
@@ -1516,9 +1523,31 @@ intel_vgpu_create_workload(struct intel_vgpu *vgpu, int ring_id, · 18 unmodified lines
1516 workload->wa_ctx.indirect_ctx.size =1523 workload->wa_ctx.indirect_ctx.size =
1517 (indirect_ctx & INDIRECT_CTX_SIZE_MASK) *1524 (indirect_ctx & INDIRECT_CTX_SIZE_MASK) *
1518 CACHELINE_BYTES;1525 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
1519 workload->wa_ctx.per_ctx.guest_gma =1538 workload->wa_ctx.per_ctx.guest_gma =
1520 per_ctx & PER_CTX_ADDR_MASK;1539 per_ctx & PER_CTX_ADDR_MASK;
1521 workload->wa_ctx.per_ctx.valid = per_ctx & 1;1540 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 }
1522 }1551 }
1523 1552
1524 gvt_dbg_el("workload %p ring id %d head %x tail %x start %x ctl %x\n",1553 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
28 *28 *
29 */29 */
30 30
31#include "trace.h"
32
33#ifndef __CHECKER__31#ifndef __CHECKER__
34#define CREATE_TRACE_POINTS32#define CREATE_TRACE_POINTS
35#include "trace.h"33#include "trace.h"
drivers/gpu/drm/i915/i915_drv.h+3−2
@@ -1674,8 +1674,9 @@ struct drm_i915_private { · 1673 unmodified lines
1674 } dram_info;1674 } dram_info;
1675 1675
1676 struct intel_bw_info {1676 struct intel_bw_info {
1677 int num_planes;1677 unsigned int deratedbw[3]; /* for each QGV point */
1678 int deratedbw[3];1678 u8 num_qgv_points;
1679 u8 num_planes;
1679 } max_bw[6];1680 } max_bw[6];
1680 1681
1681 struct drm_private_obj bw_obj;1682 struct drm_private_obj bw_obj;
drivers/gpu/drm/i915/i915_gem.c+11−14
@@ -46,7 +46,6 @@ · 45 unmodified lines
46#include "gem/i915_gem_ioctls.h"46#include "gem/i915_gem_ioctls.h"
47#include "gem/i915_gem_pm.h"47#include "gem/i915_gem_pm.h"
48#include "gem/i915_gemfs.h"48#include "gem/i915_gemfs.h"
49#include "gt/intel_engine_pm.h"
50#include "gt/intel_gt_pm.h"49#include "gt/intel_gt_pm.h"
51#include "gt/intel_mocs.h"50#include "gt/intel_mocs.h"
52#include "gt/intel_reset.h"51#include "gt/intel_reset.h"
@@ -1307,21 +1306,13 @@ int i915_gem_init_hw(struct drm_i915_private *dev_priv) · 1254 unmodified lines
1307 1306
1308 intel_mocs_init_l3cc_table(dev_priv);1307 intel_mocs_init_l3cc_table(dev_priv);
1309 1308
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
1315 intel_uncore_forcewake_put(&dev_priv->uncore, FORCEWAKE_ALL);1309 intel_uncore_forcewake_put(&dev_priv->uncore, FORCEWAKE_ALL);
1316 1310
1317 intel_engines_set_scheduler_caps(dev_priv);1311 intel_engines_set_scheduler_caps(dev_priv);
1318 return 0;1312 return 0;
1319 1313
1320cleanup_uc:
1321 intel_uc_fini_hw(dev_priv);
1322out:1314out:
1323 intel_uncore_forcewake_put(&dev_priv->uncore, FORCEWAKE_ALL);1315 intel_uncore_forcewake_put(&dev_priv->uncore, FORCEWAKE_ALL);
1324
1325 return ret;1316 return ret;
1326}1317}
1327 1318
@@ -1580,6 +1571,11 @@ int i915_gem_init(struct drm_i915_private *dev_priv) · 252 unmodified lines
1580 if (ret)1571 if (ret)
1581 goto err_uc_init;1572 goto err_uc_init;
1582 1573
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
1583 /*1579 /*
1584 * Despite its name intel_init_clock_gating applies both display1580 * Despite its name intel_init_clock_gating applies both display
1585 * clock gating workarounds; GT mmio workarounds and the occasional1581 * 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
1593 1589
1594 ret = intel_engines_verify_workarounds(dev_priv);1590 ret = intel_engines_verify_workarounds(dev_priv);
1595 if (ret)1591 if (ret)
1596 goto err_init_hw;1592 goto err_gt;
1597 1593
1598 ret = __intel_engines_record_defaults(dev_priv);1594 ret = __intel_engines_record_defaults(dev_priv);
1599 if (ret)1595 if (ret)
1600 goto err_init_hw;1596 goto err_gt;
1601 1597
1602 if (i915_inject_load_failure()) {1598 if (i915_inject_load_failure()) {
1603 ret = -ENODEV;1599 ret = -ENODEV;
1604 goto err_init_hw;1600 goto err_gt;
1605 }1601 }
1606 1602
1607 if (i915_inject_load_failure()) {1603 if (i915_inject_load_failure()) {
1608 ret = -EIO;1604 ret = -EIO;
1609 goto err_init_hw;1605 goto err_gt;
1610 }1606 }
1611 1607
1612 intel_uncore_forcewake_put(&dev_priv->uncore, FORCEWAKE_ALL);1608 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
1620 * HW as irrevisibly wedged, but keep enough state around that the1616 * HW as irrevisibly wedged, but keep enough state around that the
1621 * driver doesn't explode during runtime.1617 * driver doesn't explode during runtime.
1622 */1618 */
1623err_init_hw:1619err_gt:
1624 mutex_unlock(&dev_priv->drm.struct_mutex);1620 mutex_unlock(&dev_priv->drm.struct_mutex);
1625 1621
1626 i915_gem_set_wedged(dev_priv);1622 i915_gem_set_wedged(dev_priv);
@@ -1630,6 +1626,7 @@ err_init_hw: · 3 unmodified lines
1630 i915_gem_drain_workqueue(dev_priv);1626 i915_gem_drain_workqueue(dev_priv);
1631 1627
1632 mutex_lock(&dev_priv->drm.struct_mutex);1628 mutex_lock(&dev_priv->drm.struct_mutex);
1629err_init_hw:
1633 intel_uc_fini_hw(dev_priv);1630 intel_uc_fini_hw(dev_priv);
1634err_uc_init:1631err_uc_init:
1635 intel_uc_fini(dev_priv);1632 intel_uc_fini(dev_priv);
drivers/gpu/drm/i915/i915_gem_gtt.c+6−2
@@ -1444,9 +1444,11 @@ unwind_pd: · 1443 unmodified lines
1444 spin_lock(&pdp->lock);1444 spin_lock(&pdp->lock);
1445 if (atomic_dec_and_test(&pd->used)) {1445 if (atomic_dec_and_test(&pd->used)) {
1446 gen8_ppgtt_set_pdpe(pdp, vm->scratch_pd, pdpe);1446 gen8_ppgtt_set_pdpe(pdp, vm->scratch_pd, pdpe);
1447 pdp->entry[pdpe] = vm->scratch_pd;
1447 GEM_BUG_ON(!atomic_read(&pdp->used));1448 GEM_BUG_ON(!atomic_read(&pdp->used));
1448 atomic_dec(&pdp->used);1449 atomic_dec(&pdp->used);
1449 free_pd(vm, pd);1450 GEM_BUG_ON(alloc);
1451 alloc = pd; /* defer the free to after the lock */
1450 }1452 }
1451 spin_unlock(&pdp->lock);1453 spin_unlock(&pdp->lock);
1452unwind:1454unwind:
@@ -1515,7 +1517,9 @@ unwind_pdp: · 62 unmodified lines
1515 spin_lock(&pml4->lock);1517 spin_lock(&pml4->lock);
1516 if (atomic_dec_and_test(&pdp->used)) {1518 if (atomic_dec_and_test(&pdp->used)) {
1517 gen8_ppgtt_set_pml4e(pml4, vm->scratch_pdp, pml4e);1519 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 */
1519 }1523 }
1520 spin_unlock(&pml4->lock);1524 spin_unlock(&pml4->lock);
1521unwind:1525unwind:
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
1418 struct intel_engine_cs *engine = i915->engine[i];1418 struct intel_engine_cs *engine = i915->engine[i];
1419 struct drm_i915_error_engine *ee = &error->engine[i];1419 struct drm_i915_error_engine *ee = &error->engine[i];
1420 struct i915_request *request;1420 struct i915_request *request;
1421 unsigned long flags;
1421 1422
1422 ee->engine_id = -1;1423 ee->engine_id = -1;
1423 1424
@@ -1429,10 +1430,11 @@ static void gem_record_rings(struct i915_gpu_state *error) · 5 unmodified lines
1429 error_record_engine_registers(error, engine, ee);1430 error_record_engine_registers(error, engine, ee);
1430 error_record_engine_execlists(engine, ee);1431 error_record_engine_execlists(engine, ee);
1431 1432
1433 spin_lock_irqsave(&engine->active.lock, flags);
1432 request = intel_engine_find_active_request(engine);1434 request = intel_engine_find_active_request(engine);
1433 if (request) {1435 if (request) {
1434 struct i915_gem_context *ctx = request->gem_context;1436 struct i915_gem_context *ctx = request->gem_context;
1435 struct intel_ring *ring;1437 struct intel_ring *ring = request->ring;
1436 1438
1437 ee->vm = ctx->vm ?: &ggtt->vm;1439 ee->vm = ctx->vm ?: &ggtt->vm;
1438 1440
@@ -1462,7 +1464,6 @@ static void gem_record_rings(struct i915_gpu_state *error) · 23 unmodified lines
1462 ee->rq_post = request->postfix;1464 ee->rq_post = request->postfix;
1463 ee->rq_tail = request->tail;1465 ee->rq_tail = request->tail;
1464 1466
1465 ring = request->ring;
1466 ee->cpu_ring_head = ring->head;1467 ee->cpu_ring_head = ring->head;
1467 ee->cpu_ring_tail = ring->tail;1468 ee->cpu_ring_tail = ring->tail;
1468 ee->ringbuffer =1469 ee->ringbuffer =
@@ -1470,6 +1471,7 @@ static void gem_record_rings(struct i915_gpu_state *error) · 1 unmodified line
1470 1471
1471 engine_record_requests(engine, request, ee);1472 engine_record_requests(engine, request, ee);
1472 }1473 }
1474 spin_unlock_irqrestore(&engine->active.lock, flags);
1473 1475
1474 ee->hws_page =1476 ee->hws_page =
1475 i915_error_object_create(i915,1477 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
1567 }1567 }
1568}1568}
1569 1569
1570static int hsw_enable_metric_set(struct i915_perf_stream *stream)1570static void delay_after_mux(void)
1571{1571{
1572 struct drm_i915_private *dev_priv = stream->dev_priv;1572 /*
1573 const struct i915_oa_config *oa_config = stream->oa_config;1573 * It apparently takes a fairly long time for a new MUX
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
1592 * configuration to be be applied after these register writes.1574 * configuration to be be applied after these register writes.
1593 * This delay duration was derived empirically based on the1575 * This delay duration was derived empirically based on the
1594 * render_basic config but hopefully it covers the maximum1576 * 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
1610 * a delay at this location would mitigate any invalid reports.1592 * a delay at this location would mitigate any invalid reports.
1611 */1593 */
1612 usleep_range(15000, 20000);1594 usleep_range(15000, 20000);
1595}
1596
1597static 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();
1613 1619
1614 config_oa_regs(dev_priv, oa_config->b_counter_regs,1620 config_oa_regs(dev_priv, oa_config->b_counter_regs,
1615 oa_config->b_counter_regs_len);1621 oa_config->b_counter_regs_len);
@@ -1835,6 +1841,7 @@ static int gen8_enable_metric_set(struct i915_perf_stream *stream) · 219 unmodified lines
1835 return ret;1841 return ret;
1836 1842
1837 config_oa_regs(dev_priv, oa_config->mux_regs, oa_config->mux_regs_len);1843 config_oa_regs(dev_priv, oa_config->mux_regs, oa_config->mux_regs_len);
1844 delay_after_mux();
1838 1845
1839 config_oa_regs(dev_priv, oa_config->b_counter_regs,1846 config_oa_regs(dev_priv, oa_config->b_counter_regs,
1840 oa_config->b_counter_regs_len);1847 oa_config->b_counter_regs_len);
@@ -2515,6 +2522,9 @@ static int i915_perf_release(struct inode *inode, struct file *file) · 674 unmodified lines
2515 i915_perf_destroy_locked(stream);2522 i915_perf_destroy_locked(stream);
2516 mutex_unlock(&dev_priv->perf.lock);2523 mutex_unlock(&dev_priv->perf.lock);
2517 2524
2525 /* Release the reference the perf stream kept on the driver. */
2526 drm_dev_put(&dev_priv->drm);
2527
2518 return 0;2528 return 0;
2519}2529}
2520 2530
@@ -2650,6 +2660,11 @@ i915_perf_open_ioctl_locked(struct drm_i915_private *dev_priv, · 129 unmodified lines
2650 if (!(param->flags & I915_PERF_FLAG_DISABLED))2660 if (!(param->flags & I915_PERF_FLAG_DISABLED))
2651 i915_perf_enable_locked(stream);2661 i915_perf_enable_locked(stream);
2652 2662
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
2653 return stream_fd;2668 return stream_fd;
2654 2669
2655err_open:2670err_open:
@@ -3477,9 +3492,13 @@ void i915_perf_init(struct drm_i915_private *dev_priv) · 821 unmodified lines
3477 dev_priv->perf.oa.ops.enable_metric_set = gen8_enable_metric_set;3492 dev_priv->perf.oa.ops.enable_metric_set = gen8_enable_metric_set;
3478 dev_priv->perf.oa.ops.disable_metric_set = gen10_disable_metric_set;3493 dev_priv->perf.oa.ops.disable_metric_set = gen10_disable_metric_set;
3479 3494
3480 dev_priv->perf.oa.ctx_oactxctrl_offset = 0x128;3495 if (IS_GEN(dev_priv, 10)) {
3481 dev_priv->perf.oa.ctx_flexeu0_offset = 0x3de;3496 dev_priv->perf.oa.ctx_oactxctrl_offset = 0x128;
3482 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 }
3483 dev_priv->perf.oa.gen8_valid_ctx_bit = (1<<16);3502 dev_priv->perf.oa.gen8_valid_ctx_bit = (1<<16);
3484 }3503 }
3485 }3504 }
drivers/gpu/drm/i915/i915_trace.h+33−43
@@ -21,24 +21,22 @@ · 20 unmodified lines
21/* watermark/fifo updates */21/* watermark/fifo updates */
22 22
23TRACE_EVENT(intel_pipe_enable,23TRACE_EVENT(intel_pipe_enable,
24 TP_PROTO(struct drm_i915_private *dev_priv, enum pipe pipe),24 TP_PROTO(struct intel_crtc *crtc),
25 TP_ARGS(dev_priv, pipe),25 TP_ARGS(crtc),
26 26
27 TP_STRUCT__entry(27 TP_STRUCT__entry(
28 __array(u32, frame, 3)28 __array(u32, frame, 3)
29 __array(u32, scanline, 3)29 __array(u32, scanline, 3)
30 __field(enum pipe, pipe)30 __field(enum pipe, pipe)
31 ),31 ),
32
33 TP_fast_assign(32 TP_fast_assign(
34 enum pipe _pipe;33 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
35 for_each_pipe(dev_priv, _pipe) {34 struct intel_crtc *it__;
36 __entry->frame[_pipe] =35 for_each_intel_crtc(&dev_priv->drm, it__) {
37 dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, _pipe);36 __entry->frame[it__->pipe] = intel_crtc_get_vblank_counter(it__);
38 __entry->scanline[_pipe] =37 __entry->scanline[it__->pipe] = intel_get_crtc_scanline(it__);
39 intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, _pipe));
40 }38 }
41 __entry->pipe = pipe;39 __entry->pipe = crtc->pipe;
42 ),40 ),
43 41
44 TP_printk("pipe %c enable, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u",42 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
49);47);
50 48
51TRACE_EVENT(intel_pipe_disable,49TRACE_EVENT(intel_pipe_disable,
52 TP_PROTO(struct drm_i915_private *dev_priv, enum pipe pipe),50 TP_PROTO(struct intel_crtc *crtc),
53 TP_ARGS(dev_priv, pipe),51 TP_ARGS(crtc),
54 52
55 TP_STRUCT__entry(53 TP_STRUCT__entry(
56 __array(u32, frame, 3)54 __array(u32, frame, 3)
@@ -59,14 +57,13 @@ TRACE_EVENT(intel_pipe_disable, · 2 unmodified lines
59 ),57 ),
60 58
61 TP_fast_assign(59 TP_fast_assign(
62 enum pipe _pipe;60 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
63 for_each_pipe(dev_priv, _pipe) {61 struct intel_crtc *it__;
64 __entry->frame[_pipe] =62 for_each_intel_crtc(&dev_priv->drm, it__) {
65 dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, _pipe);63 __entry->frame[it__->pipe] = intel_crtc_get_vblank_counter(it__);
66 __entry->scanline[_pipe] =64 __entry->scanline[it__->pipe] = intel_get_crtc_scanline(it__);
67 intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, _pipe));
68 }65 }
69 __entry->pipe = pipe;66 __entry->pipe = crtc->pipe;
70 ),67 ),
71 68
72 TP_printk("pipe %c disable, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u",69 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
89 86
90 TP_fast_assign(87 TP_fast_assign(
91 __entry->pipe = crtc->pipe;88 __entry->pipe = crtc->pipe;
92 __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,89 __entry->frame = intel_crtc_get_vblank_counter(crtc);
93 crtc->pipe);
94 __entry->scanline = intel_get_crtc_scanline(crtc);90 __entry->scanline = intel_get_crtc_scanline(crtc);
95 memcpy(__entry->crcs, crcs, sizeof(__entry->crcs));91 memcpy(__entry->crcs, crcs, sizeof(__entry->crcs));
96 ),92 ),
@@ -112,9 +108,10 @@ TRACE_EVENT(intel_cpu_fifo_underrun, · 15 unmodified lines
112 ),108 ),
113 109
114 TP_fast_assign(110 TP_fast_assign(
111 struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
115 __entry->pipe = pipe;112 __entry->pipe = pipe;
116 __entry->frame = dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, pipe);113 __entry->frame = intel_crtc_get_vblank_counter(crtc);
117 __entry->scanline = intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, pipe));114 __entry->scanline = intel_get_crtc_scanline(crtc);
118 ),115 ),
119 116
120 TP_printk("pipe %c, frame=%u, scanline=%u",117 TP_printk("pipe %c, frame=%u, scanline=%u",
@@ -134,9 +131,10 @@ TRACE_EVENT(intel_pch_fifo_underrun, · 13 unmodified lines
134 131
135 TP_fast_assign(132 TP_fast_assign(
136 enum pipe pipe = pch_transcoder;133 enum pipe pipe = pch_transcoder;
134 struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
137 __entry->pipe = pipe;135 __entry->pipe = pipe;
138 __entry->frame = dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, pipe);136 __entry->frame = intel_crtc_get_vblank_counter(crtc);
139 __entry->scanline = intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, pipe));137 __entry->scanline = intel_get_crtc_scanline(crtc);
140 ),138 ),
141 139
142 TP_printk("pch transcoder %c, frame=%u, scanline=%u",140 TP_printk("pch transcoder %c, frame=%u, scanline=%u",
@@ -156,12 +154,10 @@ TRACE_EVENT(intel_memory_cxsr, · 13 unmodified lines
156 ),154 ),
157 155
158 TP_fast_assign(156 TP_fast_assign(
159 enum pipe pipe;157 struct intel_crtc *crtc;
160 for_each_pipe(dev_priv, pipe) {158 for_each_intel_crtc(&dev_priv->drm, crtc) {
161 __entry->frame[pipe] =159 __entry->frame[crtc->pipe] = intel_crtc_get_vblank_counter(crtc);
162 dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, pipe);160 __entry->scanline[crtc->pipe] = intel_get_crtc_scanline(crtc);
163 __entry->scanline[pipe] =
164 intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, pipe));
165 }161 }
166 __entry->old = old;162 __entry->old = old;
167 __entry->new = new;163 __entry->new = new;
@@ -198,8 +194,7 @@ TRACE_EVENT(g4x_wm, · 30 unmodified lines
198 194
199 TP_fast_assign(195 TP_fast_assign(
200 __entry->pipe = crtc->pipe;196 __entry->pipe = crtc->pipe;
201 __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,197 __entry->frame = intel_crtc_get_vblank_counter(crtc);
202 crtc->pipe);
203 __entry->scanline = intel_get_crtc_scanline(crtc);198 __entry->scanline = intel_get_crtc_scanline(crtc);
204 __entry->primary = wm->pipe[crtc->pipe].plane[PLANE_PRIMARY];199 __entry->primary = wm->pipe[crtc->pipe].plane[PLANE_PRIMARY];
205 __entry->sprite = wm->pipe[crtc->pipe].plane[PLANE_SPRITE0];200 __entry->sprite = wm->pipe[crtc->pipe].plane[PLANE_SPRITE0];
@@ -243,8 +238,7 @@ TRACE_EVENT(vlv_wm, · 37 unmodified lines
243 238
244 TP_fast_assign(239 TP_fast_assign(
245 __entry->pipe = crtc->pipe;240 __entry->pipe = crtc->pipe;
246 __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,241 __entry->frame = intel_crtc_get_vblank_counter(crtc);
247 crtc->pipe);
248 __entry->scanline = intel_get_crtc_scanline(crtc);242 __entry->scanline = intel_get_crtc_scanline(crtc);
249 __entry->level = wm->level;243 __entry->level = wm->level;
250 __entry->cxsr = wm->cxsr;244 __entry->cxsr = wm->cxsr;
@@ -278,8 +272,7 @@ TRACE_EVENT(vlv_fifo_size, · 27 unmodified lines
278 272
279 TP_fast_assign(273 TP_fast_assign(
280 __entry->pipe = crtc->pipe;274 __entry->pipe = crtc->pipe;
281 __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,275 __entry->frame = intel_crtc_get_vblank_counter(crtc);
282 crtc->pipe);
283 __entry->scanline = intel_get_crtc_scanline(crtc);276 __entry->scanline = intel_get_crtc_scanline(crtc);
284 __entry->sprite0_start = sprite0_start;277 __entry->sprite0_start = sprite0_start;
285 __entry->sprite1_start = sprite1_start;278 __entry->sprite1_start = sprite1_start;
@@ -310,8 +303,7 @@ TRACE_EVENT(intel_update_plane, · 24 unmodified lines
310 TP_fast_assign(303 TP_fast_assign(
311 __entry->pipe = crtc->pipe;304 __entry->pipe = crtc->pipe;
312 __entry->name = plane->name;305 __entry->name = plane->name;
313 __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,306 __entry->frame = intel_crtc_get_vblank_counter(crtc);
314 crtc->pipe);
315 __entry->scanline = intel_get_crtc_scanline(crtc);307 __entry->scanline = intel_get_crtc_scanline(crtc);
316 memcpy(__entry->src, &plane->state->src, sizeof(__entry->src));308 memcpy(__entry->src, &plane->state->src, sizeof(__entry->src));
317 memcpy(__entry->dst, &plane->state->dst, sizeof(__entry->dst));309 memcpy(__entry->dst, &plane->state->dst, sizeof(__entry->dst));
@@ -338,8 +330,7 @@ TRACE_EVENT(intel_disable_plane, · 20 unmodified lines
338 TP_fast_assign(330 TP_fast_assign(
339 __entry->pipe = crtc->pipe;331 __entry->pipe = crtc->pipe;
340 __entry->name = plane->name;332 __entry->name = plane->name;
341 __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,333 __entry->frame = intel_crtc_get_vblank_counter(crtc);
342 crtc->pipe);
343 __entry->scanline = intel_get_crtc_scanline(crtc);334 __entry->scanline = intel_get_crtc_scanline(crtc);
344 ),335 ),
345 336
@@ -364,8 +355,7 @@ TRACE_EVENT(i915_pipe_update_start, · 18 unmodified lines
364 355
365 TP_fast_assign(356 TP_fast_assign(
366 __entry->pipe = crtc->pipe;357 __entry->pipe = crtc->pipe;
367 __entry->frame = crtc->base.dev->driver->get_vblank_counter(crtc->base.dev,358 __entry->frame = intel_crtc_get_vblank_counter(crtc);
368 crtc->pipe);
369 __entry->scanline = intel_get_crtc_scanline(crtc);359 __entry->scanline = intel_get_crtc_scanline(crtc);
370 __entry->min = crtc->debug.min_vbl;360 __entry->min = crtc->debug.min_vbl;
371 __entry->max = crtc->debug.max_vbl;361 __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
221static void221static void
222dump_and_free_wakeref_tracking(struct intel_runtime_pm_debug *debug)222dump_and_free_wakeref_tracking(struct intel_runtime_pm_debug *debug)
223{223{
224 struct drm_printer p;224 if (debug->count) {
225 struct drm_printer p = drm_debug_printer("i915");
225 226
226 if (!debug->count)227 __print_intel_runtime_pm_wakeref(&p, debug);
227 return;228 }
228
229 p = drm_debug_printer("i915");
230 __print_intel_runtime_pm_wakeref(&p, debug);
231 229
232 kfree(debug->owners);230 kfree(debug->owners);
233}231}
drivers/gpu/drm/i915/intel_wakeref.h+15−0
@@ -65,6 +65,21 @@ intel_wakeref_get(struct intel_runtime_pm *rpm, · 64 unmodified lines
65 return 0;65 return 0;
66}66}
67 67
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 */
77static inline bool
78intel_wakeref_get_if_active(struct intel_wakeref *wf)
79{
80 return atomic_inc_not_zero(&wf->count);
81}
82
68/**83/**
69 * intel_wakeref_put: Release the wakeref84 * intel_wakeref_put: Release the wakeref
70 * @i915: the drm_i915_private device85 * @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
59 case MSM_SUBMIT_CMD_CTX_RESTORE_BUF:59 case MSM_SUBMIT_CMD_CTX_RESTORE_BUF:
60 if (priv->lastctx == ctx)60 if (priv->lastctx == ctx)
61 break;61 break;
62 /* fall-thru */
62 case MSM_SUBMIT_CMD_BUF:63 case MSM_SUBMIT_CMD_BUF:
63 /* copy commands into RB: */64 /* copy commands into RB: */
64 obj = submit->bos[submit->cmd[i].idx].obj;65 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
149 case MSM_SUBMIT_CMD_CTX_RESTORE_BUF:150 case MSM_SUBMIT_CMD_CTX_RESTORE_BUF:
150 if (priv->lastctx == ctx)151 if (priv->lastctx == ctx)
151 break;152 break;
153 /* fall-thru */
152 case MSM_SUBMIT_CMD_BUF:154 case MSM_SUBMIT_CMD_BUF:
153 OUT_PKT7(ring, CP_INDIRECT_BUFFER_PFE, 3);155 OUT_PKT7(ring, CP_INDIRECT_BUFFER_PFE, 3);
154 OUT_RING(ring, lower_32_bits(submit->cmd[i].iova));156 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
115 case MSM_SUBMIT_CMD_CTX_RESTORE_BUF:115 case MSM_SUBMIT_CMD_CTX_RESTORE_BUF:
116 if (priv->lastctx == ctx)116 if (priv->lastctx == ctx)
117 break;117 break;
118 /* fall-thru */
118 case MSM_SUBMIT_CMD_BUF:119 case MSM_SUBMIT_CMD_BUF:
119 OUT_PKT7(ring, CP_INDIRECT_BUFFER_PFE, 3);120 OUT_PKT7(ring, CP_INDIRECT_BUFFER_PFE, 3);
120 OUT_RING(ring, lower_32_bits(submit->cmd[i].iova));121 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
428 /* ignore if there has not been a ctx switch: */428 /* ignore if there has not been a ctx switch: */
429 if (priv->lastctx == ctx)429 if (priv->lastctx == ctx)
430 break;430 break;
431 /* fall-thru */
431 case MSM_SUBMIT_CMD_BUF:432 case MSM_SUBMIT_CMD_BUF:
432 OUT_PKT3(ring, adreno_is_a430(adreno_gpu) ?433 OUT_PKT3(ring, adreno_is_a430(adreno_gpu) ?
433 CP_INDIRECT_BUFFER_PFE : CP_INDIRECT_BUFFER_PFD, 2);434 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
439 mdp5_crtc->enabled = false;439 mdp5_crtc->enabled = false;
440}440}
441 441
442static 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
442static void mdp5_crtc_atomic_enable(struct drm_crtc *crtc,454static void mdp5_crtc_atomic_enable(struct drm_crtc *crtc,
443 struct drm_crtc_state *old_state)455 struct drm_crtc_state *old_state)
444{456{
@@ -475,7 +487,7 @@ static void mdp5_crtc_atomic_enable(struct drm_crtc *crtc, · 30 unmodified lines
475 }487 }
476 488
477 /* Restore vblank irq handling after power is enabled */489 /* Restore vblank irq handling after power is enabled */
478 drm_crtc_vblank_on(crtc);490 mdp5_crtc_vblank_on(crtc);
479 491
480 mdp5_crtc_mode_set_nofb(crtc);492 mdp5_crtc_mode_set_nofb(crtc);
481 493
@@ -1028,6 +1040,8 @@ static void mdp5_crtc_reset(struct drm_crtc *crtc) · 546 unmodified lines
1028 mdp5_crtc_destroy_state(crtc, crtc->state);1040 mdp5_crtc_destroy_state(crtc, crtc->state);
1029 1041
1030 __drm_atomic_helper_crtc_reset(crtc, &mdp5_cstate->base);1042 __drm_atomic_helper_crtc_reset(crtc, &mdp5_cstate->base);
1043
1044 drm_crtc_vblank_reset(crtc);
1031}1045}
1032 1046
1033static const struct drm_crtc_funcs mdp5_crtc_funcs = {1047static 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
740 dev->driver->get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos;740 dev->driver->get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos;
741 dev->driver->get_scanout_position = mdp5_get_scanoutpos;741 dev->driver->get_scanout_position = mdp5_get_scanoutpos;
742 dev->driver->get_vblank_counter = mdp5_get_vblank_counter;742 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 */
744 dev->vblank_disable_immediate = true;744 dev->vblank_disable_immediate = true;
745 745
746 return kms;746 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
1279 if (!np)1279 if (!np)
1280 return 0;1280 return 0;
1281 1281
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);
1283 1284
1284 of_node_put(np);1285 of_node_put(np);
1285 1286
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
32 return !msm_obj->vram_node;32 return !msm_obj->vram_node;
33}33}
34 34
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
49static 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
62static 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
35/* allocate pages from VRAM carveout, used when no IOMMU: */75/* allocate pages from VRAM carveout, used when no IOMMU: */
36static struct page **get_pages_vram(struct drm_gem_object *obj, int npages)76static struct page **get_pages_vram(struct drm_gem_object *obj, int npages)
37{77{
@@ -97,8 +137,7 @@ static struct page **get_pages(struct drm_gem_object *obj) · 59 unmodified lines
97 * because display controller, GPU, etc. are not coherent:137 * because display controller, GPU, etc. are not coherent:
98 */138 */
99 if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED))139 if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED))
100 dma_sync_sg_for_device(dev->dev, msm_obj->sgt->sgl,140 sync_for_device(msm_obj);
101 msm_obj->sgt->nents, DMA_BIDIRECTIONAL);
102 }141 }
103 142
104 return msm_obj->pages;143 return msm_obj->pages;
@@ -127,9 +166,7 @@ static void put_pages(struct drm_gem_object *obj) · 22 unmodified lines
127 * GPU, etc. are not coherent:166 * GPU, etc. are not coherent:
128 */167 */
129 if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED))168 if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED))
130 dma_sync_sg_for_cpu(obj->dev->dev, msm_obj->sgt->sgl,169 sync_for_cpu(msm_obj);
131 msm_obj->sgt->nents,
132 DMA_BIDIRECTIONAL);
133 170
134 sg_free_table(msm_obj->sgt);171 sg_free_table(msm_obj->sgt);
135 kfree(msm_obj->sgt);172 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
780 drm_dp_calc_pbn_mode(crtc_state->adjusted_mode.clock,780 drm_dp_calc_pbn_mode(crtc_state->adjusted_mode.clock,
781 connector->display_info.bpc * 3);781 connector->display_info.bpc * 3);
782 782
783 if (drm_atomic_crtc_needs_modeset(crtc_state)) {783 if (crtc_state->mode_changed) {
784 slots = drm_dp_atomic_find_vcpi_slots(state, &mstm->mgr,784 slots = drm_dp_atomic_find_vcpi_slots(state, &mstm->mgr,
785 mstc->port,785 mstc->port,
786 asyh->dp.pbn);786 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
475 fault->inst, fault->addr, fault->access);475 fault->inst, fault->addr, fault->access);
476}476}
477 477
478static inline bool
479nouveau_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
487static int
488nouveau_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
478static int519static int
479nouveau_svm_fault(struct nvif_notify *notify)520nouveau_svm_fault(struct nvif_notify *notify)
480{521{
@@ -649,10 +690,10 @@ nouveau_svm_fault(struct nvif_notify *notify) · 168 unmodified lines
649 range.values = nouveau_svm_pfn_values;690 range.values = nouveau_svm_pfn_values;
650 range.pfn_shift = NVIF_VMM_PFNMAP_V0_ADDR_SHIFT;691 range.pfn_shift = NVIF_VMM_PFNMAP_V0_ADDR_SHIFT;
651again:692again:
652 ret = hmm_vma_fault(&svmm->mirror, &range, true);693 ret = nouveau_range_fault(&svmm->mirror, &range);
653 if (ret == 0) {694 if (ret == 0) {
654 mutex_lock(&svmm->mutex);695 mutex_lock(&svmm->mutex);
655 if (!hmm_vma_range_done(&range)) {696 if (!nouveau_range_done(&range)) {
656 mutex_unlock(&svmm->mutex);697 mutex_unlock(&svmm->mutex);
657 goto again;698 goto again;
658 }699 }
@@ -666,8 +707,8 @@ again: · 7 unmodified lines
666 NULL);707 NULL);
667 svmm->vmm->vmm.object.client->super = false;708 svmm->vmm->vmm.object.client->super = false;
668 mutex_unlock(&svmm->mutex);709 mutex_unlock(&svmm->mutex);
710 up_read(&svmm->mm->mmap_sem);
669 }711 }
670 up_read(&svmm->mm->mmap_sem);
671 712
672 /* Cancel any faults in the window whose pages didn't manage713 /* Cancel any faults in the window whose pages didn't manage
673 * to keep their valid bit, or stay writeable when required.714 * 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
432 432
433static const struct dev_pm_ops rockchip_dp_pm_ops = {433static const struct dev_pm_ops rockchip_dp_pm_ops = {
434#ifdef CONFIG_PM_SLEEP434#ifdef CONFIG_PM_SLEEP
435 .suspend = rockchip_dp_suspend,435 .suspend_late = rockchip_dp_suspend,
436 .resume_early = rockchip_dp_resume,436 .resume_early = rockchip_dp_resume,
437#endif437#endif
438};438};
drivers/gpu/drm/tegra/output.c+6−2
@@ -126,8 +126,12 @@ int tegra_output_probe(struct tegra_output *output) · 125 unmodified lines
126 "nvidia,hpd-gpio", 0,126 "nvidia,hpd-gpio", 0,
127 GPIOD_IN,127 GPIOD_IN,
128 "HDMI hotplug detect");128 "HDMI hotplug detect");
129 if (IS_ERR(output->hpd_gpio))129 if (IS_ERR(output->hpd_gpio)) {
130 return PTR_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 }
131 135
132 if (output->hpd_gpio) {136 if (output->hpd_gpio) {
133 err = gpiod_to_irq(output->hpd_gpio);137 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
389 break;389 break;
390 }390 }
391 391
392 if (retries == RETRIES)392 if (retries == RETRIES) {
393 kfree(reply);
393 return -EINVAL;394 return -EINVAL;
395 }
394 396
395 *msg_len = reply_len;397 *msg_len = reply_len;
396 *msg = reply;398 *msg = reply;
drivers/hid/hid-a4tech.c+27−3
@@ -23,12 +23,36 @@ · 22 unmodified lines
23#define A4_2WHEEL_MOUSE_HACK_7 0x0123#define A4_2WHEEL_MOUSE_HACK_7 0x01
24#define A4_2WHEEL_MOUSE_HACK_B8 0x0224#define A4_2WHEEL_MOUSE_HACK_B8 0x02
25 25
26#define A4_WHEEL_ORIENTATION (HID_UP_GENDESK | 0x000000b8)
27
26struct a4tech_sc {28struct a4tech_sc {
27 unsigned long quirks;29 unsigned long quirks;
28 unsigned int hw_wheel;30 unsigned int hw_wheel;
29 __s32 delayed_value;31 __s32 delayed_value;
30};32};
31 33
34static 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
32static int a4_input_mapped(struct hid_device *hdev, struct hid_input *hi,56static int a4_input_mapped(struct hid_device *hdev, struct hid_input *hi,
33 struct hid_field *field, struct hid_usage *usage,57 struct hid_field *field, struct hid_usage *usage,
34 unsigned long **bit, int *max)58 unsigned long **bit, int *max)
@@ -52,8 +76,7 @@ static int a4_event(struct hid_device *hdev, struct hid_field *field, · 17 unmodified lines
52 struct a4tech_sc *a4 = hid_get_drvdata(hdev);76 struct a4tech_sc *a4 = hid_get_drvdata(hdev);
53 struct input_dev *input;77 struct input_dev *input;
54 78
55 if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput ||79 if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput)
56 !usage->type)
57 return 0;80 return 0;
58 81
59 input = field->hidinput->input;82 input = field->hidinput->input;
@@ -64,7 +87,7 @@ static int a4_event(struct hid_device *hdev, struct hid_field *field, · 4 unmodified lines
64 return 1;87 return 1;
65 }88 }
66 89
67 if (usage->hid == 0x000100b8) {90 if (usage->hid == A4_WHEEL_ORIENTATION) {
68 input_event(input, EV_REL, value ? REL_HWHEEL :91 input_event(input, EV_REL, value ? REL_HWHEEL :
69 REL_WHEEL, a4->delayed_value);92 REL_WHEEL, a4->delayed_value);
70 input_event(input, EV_REL, value ? REL_HWHEEL_HI_RES :93 input_event(input, EV_REL, value ? REL_HWHEEL_HI_RES :
@@ -131,6 +154,7 @@ MODULE_DEVICE_TABLE(hid, a4_devices); · 60 unmodified lines
131static struct hid_driver a4_driver = {154static struct hid_driver a4_driver = {
132 .name = "a4tech",155 .name = "a4tech",
133 .id_table = a4_devices,156 .id_table = a4_devices,
157 .input_mapping = a4_input_mapping,
134 .input_mapped = a4_input_mapped,158 .input_mapped = a4_input_mapped,
135 .event = a4_event,159 .event = a4_event,
136 .probe = a4_probe,160 .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
123 123
124 /* Locate the boot interface, to receive the LED change events */124 /* Locate the boot interface, to receive the LED change events */
125 struct usb_interface *boot_interface = usb_ifnum_to_if(usb_dev, 0);125 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;
126 128
127 struct hid_device *boot_hid = usb_get_intfdata(boot_interface);129 if (unlikely(boot_interface == NULL))
128 struct hid_input *boot_hid_input = list_first_entry(&boot_hid->inputs,130 return -ENODEV;
131
132 boot_hid = usb_get_intfdata(boot_interface);
133 boot_hid_input = list_first_entry(&boot_hid->inputs,
129 struct hid_input, list);134 struct hid_input, list);
130 135
131 return boot_hid_input->input->event(boot_hid_input->input, type, code,136 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
568#define USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0B4A 0x0b4a568#define USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0B4A 0x0b4a
569#define USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE 0x134a569#define USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE 0x134a
570#define USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE_094A 0x094a570#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
571 572
572#define USB_VENDOR_ID_HUION 0x256c573#define USB_VENDOR_ID_HUION 0x256c
573#define USB_DEVICE_ID_HUION_TABLET 0x006e574#define USB_DEVICE_ID_HUION_TABLET 0x006e
@@ -768,7 +769,8 @@ · 194 unmodified lines
768#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER 0xc52f769#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER 0xc52f
769#define USB_DEVICE_ID_LOGITECH_UNIFYING_RECEIVER_2 0xc532770#define USB_DEVICE_ID_LOGITECH_UNIFYING_RECEIVER_2 0xc532
770#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_2 0xc534771#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_2 0xc534
771#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_GAMING 0xc539772#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_LIGHTSPEED 0xc539
773#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_POWERPLAY 0xc53a
772#define USB_DEVICE_ID_SPACETRAVELLER 0xc623774#define USB_DEVICE_ID_SPACETRAVELLER 0xc623
773#define USB_DEVICE_ID_SPACENAVIGATOR 0xc626775#define USB_DEVICE_ID_SPACENAVIGATOR 0xc626
774#define USB_DEVICE_ID_DINOVO_DESKTOP 0xc704776#define USB_DEVICE_ID_DINOVO_DESKTOP 0xc704
@@ -989,6 +991,7 @@ · 214 unmodified lines
989#define USB_DEVICE_ID_SAITEK_RAT7 0x0cd7991#define USB_DEVICE_ID_SAITEK_RAT7 0x0cd7
990#define USB_DEVICE_ID_SAITEK_RAT9 0x0cfa992#define USB_DEVICE_ID_SAITEK_RAT9 0x0cfa
991#define USB_DEVICE_ID_SAITEK_MMO7 0x0cd0993#define USB_DEVICE_ID_SAITEK_MMO7 0x0cd0
994#define USB_DEVICE_ID_SAITEK_X52 0x075c
992 995
993#define USB_VENDOR_ID_SAMSUNG 0x0419996#define USB_VENDOR_ID_SAMSUNG 0x0419
994#define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001997#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
1125 HID_REQ_SET_REPORT);1125 HID_REQ_SET_REPORT);
1126 1126
1127 kfree(hidpp_report);1127 kfree(hidpp_report);
1128 return retval;1128 return (retval < 0) ? retval : 0;
1129}1129}
1130 1130
1131static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev)1131static 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
1832 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,1832 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
1833 USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_2),1833 USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_2),
1834 .driver_data = recvr_type_hidpp},1834 .driver_data = recvr_type_hidpp},
1835 { /* Logitech gaming receiver (0xc539) */1835 { /* Logitech lightspeed receiver (0xc539) */
1836 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,1836 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
1837 USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_GAMING),1837 USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_LIGHTSPEED),
1838 .driver_data = recvr_type_gaming_hidpp},1838 .driver_data = recvr_type_gaming_hidpp},
1839 { /* Logitech 27 MHz HID++ 1.0 receiver (0xc513) */1839 { /* Logitech 27 MHz HID++ 1.0 receiver (0xc513) */
1840 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER),1840 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER),
1841 .driver_data = recvr_type_27mhz},1841 .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},
1842 { /* Logitech 27 MHz HID++ 1.0 receiver (0xc517) */1846 { /* Logitech 27 MHz HID++ 1.0 receiver (0xc517) */
1843 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,1847 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
1844 USB_DEVICE_ID_S510_RECEIVER_2),1848 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
3749 3749
3750 { L27MHZ_DEVICE(HID_ANY_ID) },3750 { L27MHZ_DEVICE(HID_ANY_ID) },
3751 3751
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 */
3753 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC082) },3761 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) },
3754 { /* Logitech G700 Gaming Mouse over USB */3772 { /* Logitech G700 Gaming Mouse over USB */
3755 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC06B) },3773 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) },
3756 { /* Logitech G900 Gaming Mouse over USB */3780 { /* Logitech G900 Gaming Mouse over USB */
3757 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC081) },3781 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) },
3758 { /* Logitech G920 Wheel over USB */3786 { /* Logitech G920 Wheel over USB */
3759 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G920_WHEEL),3787 HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G920_WHEEL),
3760 .driver_data = HIDPP_QUIRK_CLASS_G920 | HIDPP_QUIRK_FORCE_OUTPUT_REPORTS},3788 .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) },
3761 3791
3762 { /* MX5000 keyboard over Bluetooth */3792 { /* MX5000 keyboard over Bluetooth */
3763 HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb305),3793 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
92 { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0B4A), HID_QUIRK_ALWAYS_POLL },92 { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0B4A), HID_QUIRK_ALWAYS_POLL },
93 { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },93 { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },
94 { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE_094A), HID_QUIRK_ALWAYS_POLL },94 { 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 },
95 { HID_USB_DEVICE(USB_VENDOR_ID_IDEACOM, USB_DEVICE_ID_IDEACOM_IDC6680), HID_QUIRK_MULTI_INPUT },96 { HID_USB_DEVICE(USB_VENDOR_ID_IDEACOM, USB_DEVICE_ID_IDEACOM_IDC6680), HID_QUIRK_MULTI_INPUT },
96 { HID_USB_DEVICE(USB_VENDOR_ID_INNOMEDIA, USB_DEVICE_ID_INNEX_GENESIS_ATARI), HID_QUIRK_MULTI_INPUT },97 { HID_USB_DEVICE(USB_VENDOR_ID_INNOMEDIA, USB_DEVICE_ID_INNEX_GENESIS_ATARI), HID_QUIRK_MULTI_INPUT },
97 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X), HID_QUIRK_MULTI_INPUT },98 { 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
141 { HID_USB_DEVICE(USB_VENDOR_ID_RETROUSB, USB_DEVICE_ID_RETROUSB_SNES_RETROPAD), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE },142 { HID_USB_DEVICE(USB_VENDOR_ID_RETROUSB, USB_DEVICE_ID_RETROUSB_SNES_RETROPAD), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE },
142 { HID_USB_DEVICE(USB_VENDOR_ID_RETROUSB, USB_DEVICE_ID_RETROUSB_SNES_RETROPORT), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE },143 { HID_USB_DEVICE(USB_VENDOR_ID_RETROUSB, USB_DEVICE_ID_RETROUSB_SNES_RETROPORT), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE },
143 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD), HID_QUIRK_BADPAD },144 { 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 },
144 { HID_USB_DEVICE(USB_VENDOR_ID_SEMICO, USB_DEVICE_ID_SEMICO_USB_KEYKOARD2), HID_QUIRK_NO_INIT_REPORTS },146 { HID_USB_DEVICE(USB_VENDOR_ID_SEMICO, USB_DEVICE_ID_SEMICO_USB_KEYKOARD2), HID_QUIRK_NO_INIT_REPORTS },
145 { HID_USB_DEVICE(USB_VENDOR_ID_SEMICO, USB_DEVICE_ID_SEMICO_USB_KEYKOARD), HID_QUIRK_NO_INIT_REPORTS },147 { HID_USB_DEVICE(USB_VENDOR_ID_SEMICO, USB_DEVICE_ID_SEMICO_USB_KEYKOARD), HID_QUIRK_NO_INIT_REPORTS },
146 { HID_USB_DEVICE(USB_VENDOR_ID_SENNHEISER, USB_DEVICE_ID_SENNHEISER_BTD500USB), HID_QUIRK_NOGET },148 { 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
585static inline void sony_schedule_work(struct sony_sc *sc,585static inline void sony_schedule_work(struct sony_sc *sc,
586 enum sony_worker which)586 enum sony_worker which)
587{587{
588 unsigned long flags;
589
588 switch (which) {590 switch (which) {
589 case SONY_WORKER_STATE:591 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)
591 schedule_work(&sc->state_worker);594 schedule_work(&sc->state_worker);
595 spin_unlock_irqrestore(&sc->lock, flags);
592 break;596 break;
593 case SONY_WORKER_HOTPLUG:597 case SONY_WORKER_HOTPLUG:
594 if (sc->hotplug_worker_initialized)598 if (sc->hotplug_worker_initialized)
@@ -2558,13 +2562,18 @@ static inline void sony_init_output_report(struct sony_sc *sc, · 1963 unmodified lines
2558 2562
2559static inline void sony_cancel_work_sync(struct sony_sc *sc)2563static inline void sony_cancel_work_sync(struct sony_sc *sc)
2560{2564{
2565 unsigned long flags;
2566
2561 if (sc->hotplug_worker_initialized)2567 if (sc->hotplug_worker_initialized)
2562 cancel_work_sync(&sc->hotplug_worker);2568 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);
2564 cancel_work_sync(&sc->state_worker);2573 cancel_work_sync(&sc->state_worker);
2574 }
2565}2575}
2566 2576
2567
2568static int sony_input_configured(struct hid_device *hdev,2577static int sony_input_configured(struct hid_device *hdev,
2569 struct hid_input *hidinput)2578 struct hid_input *hidinput)
2570{2579{
drivers/hid/hid-tmff.c+12−0
@@ -22,6 +22,8 @@ · 21 unmodified lines
22 22
23#include "hid-ids.h"23#include "hid-ids.h"
24 24
25#define THRUSTMASTER_DEVICE_ID_2_IN_1_DT 0xb320
26
25static const signed short ff_rumble[] = {27static const signed short ff_rumble[] = {
26 FF_RUMBLE,28 FF_RUMBLE,
27 -129 -1
@@ -76,6 +78,7 @@ static int tmff_play(struct input_dev *dev, void *data, · 48 unmodified lines
76 struct hid_field *ff_field = tmff->ff_field;78 struct hid_field *ff_field = tmff->ff_field;
77 int x, y;79 int x, y;
78 int left, right; /* Rumbling */80 int left, right; /* Rumbling */
81 int motor_swap;
79 82
80 switch (effect->type) {83 switch (effect->type) {
81 case FF_CONSTANT:84 case FF_CONSTANT:
@@ -100,6 +103,13 @@ static int tmff_play(struct input_dev *dev, void *data, · 18 unmodified lines
100 ff_field->logical_minimum,103 ff_field->logical_minimum,
101 ff_field->logical_maximum);104 ff_field->logical_maximum);
102 105
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
103 dbg_hid("(left,right)=(%08x, %08x)\n", left, right);113 dbg_hid("(left,right)=(%08x, %08x)\n", left, right);
104 ff_field->value[0] = left;114 ff_field->value[0] = left;
105 ff_field->value[1] = right;115 ff_field->value[1] = right;
@@ -226,6 +236,8 @@ static const struct hid_device_id tm_devices[] = { · 120 unmodified lines
226 .driver_data = (unsigned long)ff_rumble },236 .driver_data = (unsigned long)ff_rumble },
227 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304), /* FireStorm Dual Power 2 (and 3) */237 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304), /* FireStorm Dual Power 2 (and 3) */
228 .driver_data = (unsigned long)ff_rumble },238 .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 },
229 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb323), /* Dual Trigger 3-in-1 (PC Mode) */241 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb323), /* Dual Trigger 3-in-1 (PC Mode) */
230 .driver_data = (unsigned long)ff_rumble },242 .driver_data = (unsigned long)ff_rumble },
231 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb324), /* Dual Trigger 3-in-1 (PS3 Mode) */243 { 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
284 spin_unlock_irq(&list->hiddev->list_lock);284 spin_unlock_irq(&list->hiddev->list_lock);
285 285
286 mutex_lock(&hiddev->existancelock);286 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 }
287 if (!list->hiddev->open++)295 if (!list->hiddev->open++)
288 if (list->hiddev->exist) {296 if (list->hiddev->exist) {
289 struct hid_device *hid = hiddev->hid;297 struct hid_device *hid = hiddev->hid;
@@ -300,6 +308,10 @@ bail_normal_power: · 10 unmodified lines
300 hid_hw_power(hid, PM_HINT_NORMAL);308 hid_hw_power(hid, PM_HINT_NORMAL);
301bail_unlock:309bail_unlock:
302 mutex_unlock(&hiddev->existancelock);310 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);
303bail:315bail:
304 file->private_data = NULL;316 file->private_data = NULL;
305 vfree(list);317 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
533 */533 */
534 buttons = (data[4] << 1) | (data[3] & 0x01);534 buttons = (data[4] << 1) | (data[3] & 0x01);
535 } else if (features->type == CINTIQ_COMPANION_2) {535 } else if (features->type == CINTIQ_COMPANION_2) {
536 /* d-pad right -> data[4] & 0x10536 /* d-pad right -> data[2] & 0x10
537 * d-pad up -> data[4] & 0x20537 * d-pad up -> data[2] & 0x20
538 * d-pad left -> data[4] & 0x40538 * d-pad left -> data[2] & 0x40
539 * d-pad down -> data[4] & 0x80539 * d-pad down -> data[2] & 0x80
540 * d-pad center -> data[3] & 0x01540 * d-pad center -> data[1] & 0x01
541 */541 */
542 buttons = ((data[2] >> 4) << 7) |542 buttons = ((data[2] >> 4) << 7) |
543 ((data[1] & 0x04) << 6) |543 ((data[1] & 0x04) << 4) |
544 ((data[2] & 0x0F) << 2) |544 ((data[2] & 0x0F) << 2) |
545 (data[1] & 0x03);545 (data[1] & 0x03);
546 } else if (features->type >= INTUOS5S && features->type <= INTUOSPL) {546 } 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
343 data->sample_time = MSEC_PER_SEC / 2;343 data->sample_time = MSEC_PER_SEC / 2;
344 break;344 break;
345 case tmp75b: /* not one-shot mode, Conversion rate 37Hz */345 case tmp75b: /* not one-shot mode, Conversion rate 37Hz */
346 clr_mask |= 1 << 15 | 0x3 << 13;346 clr_mask |= 1 << 7 | 0x3 << 5;
347 data->resolution = 12;347 data->resolution = 12;
348 data->sample_time = MSEC_PER_SEC / 37;348 data->sample_time = MSEC_PER_SEC / 37;
349 break;349 break;
drivers/hwmon/nct7802.c+3−3
@@ -704,7 +704,7 @@ static struct attribute *nct7802_in_attrs[] = { · 703 unmodified lines
704 &sensor_dev_attr_in3_alarm.dev_attr.attr,704 &sensor_dev_attr_in3_alarm.dev_attr.attr,
705 &sensor_dev_attr_in3_beep.dev_attr.attr,705 &sensor_dev_attr_in3_beep.dev_attr.attr,
706 706
707 &sensor_dev_attr_in4_input.dev_attr.attr, /* 17 */707 &sensor_dev_attr_in4_input.dev_attr.attr, /* 16 */
708 &sensor_dev_attr_in4_min.dev_attr.attr,708 &sensor_dev_attr_in4_min.dev_attr.attr,
709 &sensor_dev_attr_in4_max.dev_attr.attr,709 &sensor_dev_attr_in4_max.dev_attr.attr,
710 &sensor_dev_attr_in4_alarm.dev_attr.attr,710 &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
730 730
731 if (index >= 6 && index < 11 && (reg & 0x03) != 0x03) /* VSEN1 */731 if (index >= 6 && index < 11 && (reg & 0x03) != 0x03) /* VSEN1 */
732 return 0;732 return 0;
733 if (index >= 11 && index < 17 && (reg & 0x0c) != 0x0c) /* VSEN2 */733 if (index >= 11 && index < 16 && (reg & 0x0c) != 0x0c) /* VSEN2 */
734 return 0;734 return 0;
735 if (index >= 17 && (reg & 0x30) != 0x30) /* VSEN3 */735 if (index >= 16 && (reg & 0x30) != 0x30) /* VSEN3 */
736 return 0;736 return 0;
737 737
738 return attr->mode;738 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
544 /* See function coresight_get_sink_by_id() to know where this is used */544 /* See function coresight_get_sink_by_id() to know where this is used */
545 hash = hashlen_hash(hashlen_string(NULL, name));545 hash = hashlen_hash(hashlen_string(NULL, name));
546 546
547 sysfs_attr_init(&ea->attr.attr);
547 ea->attr.attr.name = devm_kstrdup(dev, name, GFP_KERNEL);548 ea->attr.attr.name = devm_kstrdup(dev, name, GFP_KERNEL);
548 if (!ea->attr.attr.name)549 if (!ea->attr.attr.name)
549 return -ENOMEM;550 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
142 142
143static struct at91_twi_pdata sama5d2_config = {143static struct at91_twi_pdata sama5d2_config = {
144 .clk_max_div = 7,144 .clk_max_div = 7,
145 .clk_offset = 4,145 .clk_offset = 3,
146 .has_unre_flag = true,146 .has_unre_flag = true,
147 .has_alt_cmd = true,147 .has_alt_cmd = true,
148 .has_hold_field = true,148 .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
122 writeb_relaxed(*dev->buf, dev->base + AT91_TWI_THR);122 writeb_relaxed(*dev->buf, dev->base + AT91_TWI_THR);
123 123
124 /* send stop when last byte has been written */124 /* send stop when last byte has been written */
125 if (--dev->buf_len == 0)125 if (--dev->buf_len == 0) {
126 if (!dev->use_alt_cmd)126 if (!dev->use_alt_cmd)
127 at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_STOP);127 at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_STOP);
128 at91_twi_write(dev, AT91_TWI_IDR, AT91_TWI_TXRDY);
129 }
128 130
129 dev_dbg(dev->dev, "wrote 0x%x, to go %zu\n", *dev->buf, dev->buf_len);131 dev_dbg(dev->dev, "wrote 0x%x, to go %zu\n", *dev->buf, dev->buf_len);
130 132
@@ -542,9 +544,8 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev) · 411 unmodified lines
542 } else {544 } else {
543 at91_twi_write_next_byte(dev);545 at91_twi_write_next_byte(dev);
544 at91_twi_write(dev, AT91_TWI_IER,546 at91_twi_write(dev, AT91_TWI_IER,
545 AT91_TWI_TXCOMP |547 AT91_TWI_TXCOMP | AT91_TWI_NACK |
546 AT91_TWI_NACK |548 (dev->buf_len ? AT91_TWI_TXRDY : 0));
547 AT91_TWI_TXRDY);
548 }549 }
549 }550 }
550 551
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
392static void bcm_iproc_i2c_read_valid_bytes(struct bcm_iproc_i2c_dev *iproc_i2c)392static void bcm_iproc_i2c_read_valid_bytes(struct bcm_iproc_i2c_dev *iproc_i2c)
393{393{
394 struct i2c_msg *msg = iproc_i2c->msg;394 struct i2c_msg *msg = iproc_i2c->msg;
395 uint32_t val;
395 396
396 /* Read valid data from RX FIFO */397 /* Read valid data from RX FIFO */
397 while (iproc_i2c->rx_bytes < msg->len) {398 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 val = iproc_i2c_rd_reg(iproc_i2c, M_RX_OFFSET);
399 & M_FIFO_RX_CNT_MASK))400
401 /* rx fifo empty */
402 if (!((val >> M_RX_STATUS_SHIFT) & M_RX_STATUS_MASK))
400 break;403 break;
401 404
402 msg->buf[iproc_i2c->rx_bytes] =405 msg->buf[iproc_i2c->rx_bytes] =
403 (iproc_i2c_rd_reg(iproc_i2c, M_RX_OFFSET) >>406 (val >> M_RX_DATA_SHIFT) & M_RX_DATA_MASK;
404 M_RX_DATA_SHIFT) & M_RX_DATA_MASK;
405 iproc_i2c->rx_bytes++;407 iproc_i2c->rx_bytes++;
406 }408 }
407}409}
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
435 * fall through to the write state, as we will need to435 * fall through to the write state, as we will need to
436 * send a byte as well436 * send a byte as well
437 */437 */
438 /* Fall through */
438 439
439 case STATE_WRITE:440 case STATE_WRITE:
440 /*441 /*
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
319 .modified = 1, \319 .modified = 1, \
320 .info_mask_separate = \320 .info_mask_separate = \
321 BIT(IIO_CHAN_INFO_RAW) | \321 BIT(IIO_CHAN_INFO_RAW) | \
322 BIT(IIO_CHAN_INFO_SCALE) | \
323 BIT(IIO_CHAN_INFO_CALIBBIAS), \322 BIT(IIO_CHAN_INFO_CALIBBIAS), \
324 .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SCALE), \323 .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SCALE), \
325 .ext_info = cros_ec_accel_legacy_ext_info, \324 .ext_info = cros_ec_accel_legacy_ext_info, \
drivers/iio/adc/ingenic-adc.c+54−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
11#include <linux/iio/iio.h>11#include <linux/iio/iio.h>
12#include <linux/io.h>12#include <linux/io.h>
13#include <linux/iopoll.h>13#include <linux/iopoll.h>
14#include <linux/kernel.h>
14#include <linux/module.h>15#include <linux/module.h>
15#include <linux/mutex.h>16#include <linux/mutex.h>
16#include <linux/platform_device.h>17#include <linux/platform_device.h>
@@ -22,8 +23,11 @@ · 5 unmodified lines
22#define JZ_ADC_REG_ADTCH 0x1823#define JZ_ADC_REG_ADTCH 0x18
23#define JZ_ADC_REG_ADBDAT 0x1c24#define JZ_ADC_REG_ADBDAT 0x1c
24#define JZ_ADC_REG_ADSDAT 0x2025#define JZ_ADC_REG_ADSDAT 0x20
26#define JZ_ADC_REG_ADCLK 0x28
25 27
26#define JZ_ADC_REG_CFG_BAT_MD BIT(4)28#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
27 31
28#define JZ_ADC_AUX_VREF 330032#define JZ_ADC_AUX_VREF 3300
29#define JZ_ADC_AUX_VREF_BITS 1233#define JZ_ADC_AUX_VREF_BITS 12
@@ -34,6 +38,8 @@ · 4 unmodified lines
34#define JZ4740_ADC_BATTERY_HIGH_VREF (7500 * 0.986)38#define JZ4740_ADC_BATTERY_HIGH_VREF (7500 * 0.986)
35#define JZ4740_ADC_BATTERY_HIGH_VREF_BITS 1239#define JZ4740_ADC_BATTERY_HIGH_VREF_BITS 12
36 40
41struct ingenic_adc;
42
37struct ingenic_adc_soc_data {43struct ingenic_adc_soc_data {
38 unsigned int battery_high_vref;44 unsigned int battery_high_vref;
39 unsigned int battery_high_vref_bits;45 unsigned int battery_high_vref_bits;
@@ -41,6 +47,7 @@ struct ingenic_adc_soc_data { · 1 unmodified line
41 size_t battery_raw_avail_size;47 size_t battery_raw_avail_size;
42 const int *battery_scale_avail;48 const int *battery_scale_avail;
43 size_t battery_scale_avail_size;49 size_t battery_scale_avail_size;
50 int (*init_clk_div)(struct device *dev, struct ingenic_adc *adc);
44};51};
45 52
46struct ingenic_adc {53struct ingenic_adc {
@@ -151,6 +158,42 @@ static const int jz4740_adc_battery_scale_avail[] = { · 104 unmodified lines
151 JZ_ADC_BATTERY_LOW_VREF, JZ_ADC_BATTERY_LOW_VREF_BITS,158 JZ_ADC_BATTERY_LOW_VREF, JZ_ADC_BATTERY_LOW_VREF_BITS,
152};159};
153 160
161static 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
154static const struct ingenic_adc_soc_data jz4725b_adc_soc_data = {197static const struct ingenic_adc_soc_data jz4725b_adc_soc_data = {
155 .battery_high_vref = JZ4725B_ADC_BATTERY_HIGH_VREF,198 .battery_high_vref = JZ4725B_ADC_BATTERY_HIGH_VREF,
156 .battery_high_vref_bits = JZ4725B_ADC_BATTERY_HIGH_VREF_BITS,199 .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
158 .battery_raw_avail_size = ARRAY_SIZE(jz4725b_adc_battery_raw_avail),201 .battery_raw_avail_size = ARRAY_SIZE(jz4725b_adc_battery_raw_avail),
159 .battery_scale_avail = jz4725b_adc_battery_scale_avail,202 .battery_scale_avail = jz4725b_adc_battery_scale_avail,
160 .battery_scale_avail_size = ARRAY_SIZE(jz4725b_adc_battery_scale_avail),203 .battery_scale_avail_size = ARRAY_SIZE(jz4725b_adc_battery_scale_avail),
204 .init_clk_div = jz4725b_adc_init_clk_div,
161};205};
162 206
163static const struct ingenic_adc_soc_data jz4740_adc_soc_data = {207static 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
167 .battery_raw_avail_size = ARRAY_SIZE(jz4740_adc_battery_raw_avail),211 .battery_raw_avail_size = ARRAY_SIZE(jz4740_adc_battery_raw_avail),
168 .battery_scale_avail = jz4740_adc_battery_scale_avail,212 .battery_scale_avail = jz4740_adc_battery_scale_avail,
169 .battery_scale_avail_size = ARRAY_SIZE(jz4740_adc_battery_scale_avail),213 .battery_scale_avail_size = ARRAY_SIZE(jz4740_adc_battery_scale_avail),
214 .init_clk_div = NULL, /* no ADCLK register on JZ4740 */
170};215};
171 216
172static int ingenic_adc_read_avail(struct iio_dev *iio_dev,217static 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
317 return ret;362 return ret;
318 }363 }
319 364
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
320 /* Put hardware in a known passive state. */374 /* Put hardware in a known passive state. */
321 writeb(0x00, adc->base + JZ_ADC_REG_ENABLE);375 writeb(0x00, adc->base + JZ_ADC_REG_ENABLE);
322 writeb(0xff, adc->base + JZ_ADC_REG_CTRL);376 writeb(0xff, adc->base + JZ_ADC_REG_CTRL);
drivers/iio/adc/max9611.c+1−1
@@ -83,7 +83,7 @@ · 82 unmodified lines
83#define MAX9611_TEMP_MAX_POS 0x7f8083#define MAX9611_TEMP_MAX_POS 0x7f80
84#define MAX9611_TEMP_MAX_NEG 0xff8084#define MAX9611_TEMP_MAX_NEG 0xff80
85#define MAX9611_TEMP_MIN_NEG 0xd98085#define MAX9611_TEMP_MIN_NEG 0xd980
86#define MAX9611_TEMP_MASK GENMASK(7, 15)86#define MAX9611_TEMP_MASK GENMASK(15, 7)
87#define MAX9611_TEMP_SHIFT 0x0787#define MAX9611_TEMP_SHIFT 0x07
88#define MAX9611_TEMP_RAW(_r) ((_r) >> MAX9611_TEMP_SHIFT)88#define MAX9611_TEMP_RAW(_r) ((_r) >> MAX9611_TEMP_SHIFT)
89#define MAX9611_TEMP_SCALE_NUM 100000089#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
382 dev_err(dev,382 dev_err(dev,
383 "Only %i channels supported with %pOFn, but reg = <%i>.\n",383 "Only %i channels supported with %pOFn, but reg = <%i>.\n",
384 num_channels, child, reg);384 num_channels, child, reg);
385 return ret;385 return -EINVAL;
386 }386 }
387 }387 }
388 388
@@ -391,7 +391,7 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev) · 2 unmodified lines
391 dev_err(dev,391 dev_err(dev,
392 "Channel %i uses different ADC mode than the rest.\n",392 "Channel %i uses different ADC mode than the rest.\n",
393 reg);393 reg);
394 return ret;394 return -EINVAL;
395 }395 }
396 396
397 /* Channel is valid, grab the regulator. */397 /* 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
845 INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Z, INV_MPU6050_SCAN_ACCL_Z),845 INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Z, INV_MPU6050_SCAN_ACCL_Z),
846};846};
847 847
848static 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
848static const struct iio_chan_spec inv_icm20602_channels[] = {867static const struct iio_chan_spec inv_icm20602_channels[] = {
849 IIO_CHAN_SOFT_TIMESTAMP(INV_ICM20602_SCAN_TIMESTAMP),868 IIO_CHAN_SOFT_TIMESTAMP(INV_ICM20602_SCAN_TIMESTAMP),
850 {869 {
@@ -871,6 +890,28 @@ static const struct iio_chan_spec inv_icm20602_channels[] = { · 20 unmodified lines
871 INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Z, INV_ICM20602_SCAN_ACCL_Z),890 INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Z, INV_ICM20602_SCAN_ACCL_Z),
872};891};
873 892
893static 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
874/*915/*
875 * The user can choose any frequency between INV_MPU6050_MIN_FIFO_RATE and916 * The user can choose any frequency between INV_MPU6050_MIN_FIFO_RATE and
876 * INV_MPU6050_MAX_FIFO_RATE, but only these frequencies are matched by the917 * 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
1130 if (chip_type == INV_ICM20602) {1171 if (chip_type == INV_ICM20602) {
1131 indio_dev->channels = inv_icm20602_channels;1172 indio_dev->channels = inv_icm20602_channels;
1132 indio_dev->num_channels = ARRAY_SIZE(inv_icm20602_channels);1173 indio_dev->num_channels = ARRAY_SIZE(inv_icm20602_channels);
1174 indio_dev->available_scan_masks = inv_icm20602_scan_masks;
1133 } else {1175 } else {
1134 indio_dev->channels = inv_mpu_channels;1176 indio_dev->channels = inv_mpu_channels;
1135 indio_dev->num_channels = ARRAY_SIZE(inv_mpu_channels);1177 indio_dev->num_channels = ARRAY_SIZE(inv_mpu_channels);
1178 indio_dev->available_scan_masks = inv_mpu_scan_masks;
1136 }1179 }
1137 1180
1138 indio_dev->info = &mpu_info;1181 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
302 struct ib_udata *udata,302 struct ib_udata *udata,
303 struct ib_uobject *uobj)303 struct ib_uobject *uobj)
304{304{
305 enum ib_qp_type qp_type = attr->qp_type;
305 struct ib_qp *qp;306 struct ib_qp *qp;
307 bool is_xrc;
306 308
307 if (!dev->ops.create_qp)309 if (!dev->ops.create_qp)
308 return ERR_PTR(-EOPNOTSUPP);310 return ERR_PTR(-EOPNOTSUPP);
@@ -320,7 +322,8 @@ static inline struct ib_qp *_ib_create_qp(struct ib_device *dev, · 11 unmodified lines
320 * and more importantly they are created internaly by driver,322 * and more importantly they are created internaly by driver,
321 * see mlx5 create_dev_resources() as an example.323 * see mlx5 create_dev_resources() as an example.
322 */324 */
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) {
324 qp->res.type = RDMA_RESTRACK_QP;327 qp->res.type = RDMA_RESTRACK_QP;
325 if (uobj)328 if (uobj)
326 rdma_restrack_uadd(&qp->res);329 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
393 u64 sum;393 u64 sum;
394 394
395 port_counter = &dev->port_data[port].port_counter;395 port_counter = &dev->port_data[port].port_counter;
396 if (!port_counter->hstats)
397 return 0;
398
396 sum = get_running_counters_hwstat_sum(dev, port, index);399 sum = get_running_counters_hwstat_sum(dev, port, index);
397 sum += port_counter->hstats->value[index];400 sum += port_counter->hstats->value[index];
398 401
@@ -594,7 +597,7 @@ void rdma_counter_init(struct ib_device *dev) · 195 unmodified lines
594 struct rdma_port_counter *port_counter;597 struct rdma_port_counter *port_counter;
595 u32 port;598 u32 port;
596 599
597 if (!dev->ops.alloc_hw_stats || !dev->port_data)600 if (!dev->port_data)
598 return;601 return;
599 602
600 rdma_for_each_port(dev, port) {603 rdma_for_each_port(dev, port) {
@@ -602,6 +605,9 @@ void rdma_counter_init(struct ib_device *dev) · 1 unmodified line
602 port_counter->mode.mode = RDMA_COUNTER_MODE_NONE;605 port_counter->mode.mode = RDMA_COUNTER_MODE_NONE;
603 mutex_init(&port_counter->lock);606 mutex_init(&port_counter->lock);
604 607
608 if (!dev->ops.alloc_hw_stats)
609 continue;
610
605 port_counter->hstats = dev->ops.alloc_hw_stats(dev, port);611 port_counter->hstats = dev->ops.alloc_hw_stats(dev, port);
606 if (!port_counter->hstats)612 if (!port_counter->hstats)
607 goto fail;613 goto fail;
@@ -624,9 +630,6 @@ void rdma_counter_release(struct ib_device *dev) · 16 unmodified lines
624 struct rdma_port_counter *port_counter;630 struct rdma_port_counter *port_counter;
625 u32 port;631 u32 port;
626 632
627 if (!dev->ops.alloc_hw_stats)
628 return;
629
630 rdma_for_each_port(dev, port) {633 rdma_for_each_port(dev, port) {
631 port_counter = &dev->port_data[port].port_counter;634 port_counter = &dev->port_data[port].port_counter;
632 kfree(port_counter->hstats);635 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
94static DECLARE_RWSEM(devices_rwsem);94static DECLARE_RWSEM(devices_rwsem);
95#define DEVICE_REGISTERED XA_MARK_195#define DEVICE_REGISTERED XA_MARK_1
96 96
97static LIST_HEAD(client_list);97static u32 highest_client_id;
98#define CLIENT_REGISTERED XA_MARK_198#define CLIENT_REGISTERED XA_MARK_1
99static DEFINE_XARRAY_FLAGS(clients, XA_FLAGS_ALLOC);99static DEFINE_XARRAY_FLAGS(clients, XA_FLAGS_ALLOC);
100static DECLARE_RWSEM(clients_rwsem);100static DECLARE_RWSEM(clients_rwsem);
101 101
102static void ib_client_put(struct ib_client *client)
103{
104 if (refcount_dec_and_test(&client->uses))
105 complete(&client->uses_zero);
106}
107
102/*108/*
103 * If client_data is registered then the corresponding client must also still109 * If client_data is registered then the corresponding client must also still
104 * be registered.110 * be registered.
@@ -660,6 +666,14 @@ static int add_client_context(struct ib_device *device, · 555 unmodified lines
660 return 0;666 return 0;
661 667
662 down_write(&device->client_data_rwsem);668 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
663 /*677 /*
664 * Another caller to add_client_context got here first and has already678 * Another caller to add_client_context got here first and has already
665 * completely initialized context.679 * completely initialized context.
@@ -683,6 +697,9 @@ static int add_client_context(struct ib_device *device, · 17 unmodified lines
683 return 0;697 return 0;
684 698
685out:699out:
700 ib_device_put(device);
701 ib_client_put(client);
702out_unlock:
686 up_write(&device->client_data_rwsem);703 up_write(&device->client_data_rwsem);
687 return ret;704 return ret;
688}705}
@@ -702,7 +719,7 @@ static void remove_client_context(struct ib_device *device, · 13 unmodified lines
702 client_data = xa_load(&device->client_data, client_id);719 client_data = xa_load(&device->client_data, client_id);
703 xa_clear_mark(&device->client_data, client_id, CLIENT_DATA_REGISTERED);720 xa_clear_mark(&device->client_data, client_id, CLIENT_DATA_REGISTERED);
704 client = xa_load(&clients, client_id);721 client = xa_load(&clients, client_id);
705 downgrade_write(&device->client_data_rwsem);722 up_write(&device->client_data_rwsem);
706 723
707 /*724 /*
708 * Notice we cannot be holding any exclusive locks when calling the725 * 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
712 *729 *
713 * For this reason clients and drivers should not call the730 * For this reason clients and drivers should not call the
714 * unregistration functions will holdling any locks.731 * 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.
720 */732 */
721 if (client->remove)733 if (client->remove)
722 client->remove(device, client_data);734 client->remove(device, client_data);
723 735
724 xa_erase(&device->client_data, client_id);736 xa_erase(&device->client_data, client_id);
725 up_read(&device->client_data_rwsem);737 ib_device_put(device);
738 ib_client_put(client);
726}739}
727 740
728static int alloc_port_data(struct ib_device *device)741static int alloc_port_data(struct ib_device *device)
@@ -1224,7 +1237,7 @@ static int setup_device(struct ib_device *device) · 495 unmodified lines
1224 1237
1225static void disable_device(struct ib_device *device)1238static void disable_device(struct ib_device *device)
1226{1239{
1227 struct ib_client *client;1240 u32 cid;
1228 1241
1229 WARN_ON(!refcount_read(&device->refcount));1242 WARN_ON(!refcount_read(&device->refcount));
1230 1243
@@ -1232,10 +1245,19 @@ static void disable_device(struct ib_device *device) · 1 unmodified line
1232 xa_clear_mark(&devices, device->index, DEVICE_REGISTERED);1245 xa_clear_mark(&devices, device->index, DEVICE_REGISTERED);
1233 up_write(&devices_rwsem);1246 up_write(&devices_rwsem);
1234 1247
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 */
1235 down_read(&clients_rwsem);1254 down_read(&clients_rwsem);
1236 list_for_each_entry_reverse(client, &client_list, list)1255 cid = highest_client_id;
1237 remove_client_context(device, client->client_id);
1238 up_read(&clients_rwsem);1256 up_read(&clients_rwsem);
1257 while (cid) {
1258 cid--;
1259 remove_client_context(device, cid);
1260 }
1239 1261
1240 /* Pairs with refcount_set in enable_device */1262 /* Pairs with refcount_set in enable_device */
1241 ib_device_put(device);1263 ib_device_put(device);
@@ -1662,30 +1684,31 @@ static int assign_client_id(struct ib_client *client) · 420 unmodified lines
1662 /*1684 /*
1663 * The add/remove callbacks must be called in FIFO/LIFO order. To1685 * The add/remove callbacks must be called in FIFO/LIFO order. To
1664 * achieve this we assign client_ids so they are sorted in1686 * achieve this we assign client_ids so they are sorted in
1665 * registration order, and retain a linked list we can reverse iterate1687 * registration order.
1666 * to get the LIFO order. The extra linked list can go away if xarray
1667 * learns to reverse iterate.
1668 */1688 */
1669 if (list_empty(&client_list)) {1689 client->client_id = highest_client_id;
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 }
1677 ret = xa_insert(&clients, client->client_id, client, GFP_KERNEL);1690 ret = xa_insert(&clients, client->client_id, client, GFP_KERNEL);
1678 if (ret)1691 if (ret)
1679 goto out;1692 goto out;
1680 1693
1694 highest_client_id++;
1681 xa_set_mark(&clients, client->client_id, CLIENT_REGISTERED);1695 xa_set_mark(&clients, client->client_id, CLIENT_REGISTERED);
1682 list_add_tail(&client->list, &client_list);
1683 1696
1684out:1697out:
1685 up_write(&clients_rwsem);1698 up_write(&clients_rwsem);
1686 return ret;1699 return ret;
1687}1700}
1688 1701
1702static 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
1689/**1712/**
1690 * ib_register_client - Register an IB client1713 * ib_register_client - Register an IB client
1691 * @client:Client to register1714 * @client:Client to register
@@ -1705,6 +1728,8 @@ int ib_register_client(struct ib_client *client) · 13 unmodified lines
1705 unsigned long index;1728 unsigned long index;
1706 int ret;1729 int ret;
1707 1730
1731 refcount_set(&client->uses, 1);
1732 init_completion(&client->uses_zero);
1708 ret = assign_client_id(client);1733 ret = assign_client_id(client);
1709 if (ret)1734 if (ret)
1710 return ret;1735 return ret;
@@ -1740,21 +1765,30 @@ void ib_unregister_client(struct ib_client *client) · 29 unmodified lines
1740 unsigned long index;1765 unsigned long index;
1741 1766
1742 down_write(&clients_rwsem);1767 down_write(&clients_rwsem);
1768 ib_client_put(client);
1743 xa_clear_mark(&clients, client->client_id, CLIENT_REGISTERED);1769 xa_clear_mark(&clients, client->client_id, CLIENT_REGISTERED);
1744 up_write(&clients_rwsem);1770 up_write(&clients_rwsem);
1745 /*1771
1746 * Every device still known must be serialized to make sure we are1772 /* We do not want to have locks while calling client->remove() */
1747 * done with the client callbacks before we return.1773 rcu_read_lock();
1748 */1774 xa_for_each (&devices, index, device) {
1749 down_read(&devices_rwsem);1775 if (!ib_device_try_get(device))
1750 xa_for_each (&devices, index, device)1776 continue;
1777 rcu_read_unlock();
1778
1751 remove_client_context(device, client->client_id);1779 remove_client_context(device, client->client_id);
1752 up_read(&devices_rwsem);
1753 1780
1754 down_write(&clients_rwsem);1781 ib_device_put(device);
1755 list_del(&client->list);1782 rcu_read_lock();
1756 xa_erase(&clients, client->client_id);1783 }
1757 up_write(&clients_rwsem);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);
1758}1792}
1759EXPORT_SYMBOL(ib_unregister_client);1793EXPORT_SYMBOL(ib_unregister_client);
1760 1794
drivers/infiniband/core/mad.c+10−10
@@ -3224,18 +3224,18 @@ static int ib_mad_port_open(struct ib_device *device, · 3223 unmodified lines
3224 if (has_smi)3224 if (has_smi)
3225 cq_size *= 2;3225 cq_size *= 2;
3226 3226
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
3227 port_priv->cq = ib_alloc_cq(port_priv->device, port_priv, cq_size, 0,3234 port_priv->cq = ib_alloc_cq(port_priv->device, port_priv, cq_size, 0,
3228 IB_POLL_UNBOUND_WORKQUEUE);3235 IB_POLL_UNBOUND_WORKQUEUE);
3229 if (IS_ERR(port_priv->cq)) {3236 if (IS_ERR(port_priv->cq)) {
3230 dev_err(&device->dev, "Couldn't create ib_mad CQ\n");3237 dev_err(&device->dev, "Couldn't create ib_mad CQ\n");
3231 ret = PTR_ERR(port_priv->cq);3238 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);
3239 goto error4;3239 goto error4;
3240 }3240 }
3241 3241
@@ -3278,11 +3278,11 @@ error8: · 36 unmodified lines
3278error7:3278error7:
3279 destroy_mad_qp(&port_priv->qp_info[0]);3279 destroy_mad_qp(&port_priv->qp_info[0]);
3280error6:3280error6:
3281 ib_dealloc_pd(port_priv->pd);
3282error4:
3283 ib_free_cq(port_priv->cq);3281 ib_free_cq(port_priv->cq);
3284 cleanup_recv_queue(&port_priv->qp_info[1]);3282 cleanup_recv_queue(&port_priv->qp_info[1]);
3285 cleanup_recv_queue(&port_priv->qp_info[0]);3283 cleanup_recv_queue(&port_priv->qp_info[0]);
3284error4:
3285 ib_dealloc_pd(port_priv->pd);
3286error3:3286error3:
3287 kfree(port_priv);3287 kfree(port_priv);
3288 3288
@@ -3312,8 +3312,8 @@ static int ib_mad_port_close(struct ib_device *device, int port_num) · 23 unmodified lines
3312 destroy_workqueue(port_priv->wq);3312 destroy_workqueue(port_priv->wq);
3313 destroy_mad_qp(&port_priv->qp_info[1]);3313 destroy_mad_qp(&port_priv->qp_info[1]);
3314 destroy_mad_qp(&port_priv->qp_info[0]);3314 destroy_mad_qp(&port_priv->qp_info[0]);
3315 ib_dealloc_pd(port_priv->pd);
3316 ib_free_cq(port_priv->cq);3315 ib_free_cq(port_priv->cq);
3316 ib_dealloc_pd(port_priv->pd);
3317 cleanup_recv_queue(&port_priv->qp_info[1]);3317 cleanup_recv_queue(&port_priv->qp_info[1]);
3318 cleanup_recv_queue(&port_priv->qp_info[0]);3318 cleanup_recv_queue(&port_priv->qp_info[0]);
3319 /* XXX: Handle deallocation of MAD registration tables */3319 /* XXX: Handle deallocation of MAD registration tables */
drivers/infiniband/core/user_mad.c+5−1
@@ -49,6 +49,7 @@ · 48 unmodified lines
49#include <linux/sched.h>49#include <linux/sched.h>
50#include <linux/semaphore.h>50#include <linux/semaphore.h>
51#include <linux/slab.h>51#include <linux/slab.h>
52#include <linux/nospec.h>
52 53
53#include <linux/uaccess.h>54#include <linux/uaccess.h>
54 55
@@ -884,11 +885,14 @@ static int ib_umad_unreg_agent(struct ib_umad_file *file, u32 __user *arg) · 829 unmodified lines
884 885
885 if (get_user(id, arg))886 if (get_user(id, arg))
886 return -EFAULT;887 return -EFAULT;
888 if (id >= IB_UMAD_MAX_AGENTS)
889 return -EINVAL;
887 890
888 mutex_lock(&file->port->file_mutex);891 mutex_lock(&file->port->file_mutex);
889 mutex_lock(&file->mutex);892 mutex_lock(&file->mutex);
890 893
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)) {
892 ret = -EINVAL;896 ret = -EINVAL;
893 goto out;897 goto out;
894 }898 }
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
308 struct bnxt_re_dev *rdev = to_bnxt_re_dev(attr->device, ibdev);308 struct bnxt_re_dev *rdev = to_bnxt_re_dev(attr->device, ibdev);
309 struct bnxt_qplib_sgid_tbl *sgid_tbl = &rdev->qplib_res.sgid_tbl;309 struct bnxt_qplib_sgid_tbl *sgid_tbl = &rdev->qplib_res.sgid_tbl;
310 struct bnxt_qplib_gid *gid_to_del;310 struct bnxt_qplib_gid *gid_to_del;
311 u16 vlan_id = 0xFFFF;
311 312
312 /* Delete the entry from the hardware */313 /* Delete the entry from the hardware */
313 ctx = *context;314 ctx = *context;
@@ -317,7 +318,8 @@ int bnxt_re_del_gid(const struct ib_gid_attr *attr, void **context) · 3 unmodified lines
317 if (sgid_tbl && sgid_tbl->active) {318 if (sgid_tbl && sgid_tbl->active) {
318 if (ctx->idx >= sgid_tbl->max)319 if (ctx->idx >= sgid_tbl->max)
319 return -EINVAL;320 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;
321 /* DEL_GID is called in WQ context(netdevice_event_work_handler)323 /* DEL_GID is called in WQ context(netdevice_event_work_handler)
322 * or via the ib_unregister_device path. In the former case QP1324 * or via the ib_unregister_device path. In the former case QP1
323 * may not be destroyed yet, in which case just return as FW325 * 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
335 }337 }
336 ctx->refcnt--;338 ctx->refcnt--;
337 if (!ctx->refcnt) {339 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);
339 if (rc) {342 if (rc) {
340 dev_err(rdev_to_dev(rdev),343 dev_err(rdev_to_dev(rdev),
341 "Failed to remove GID: %#x", rc);344 "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
488 struct bnxt_qplib_sgid_tbl *sgid_tbl,488 struct bnxt_qplib_sgid_tbl *sgid_tbl,
489 u16 max)489 u16 max)
490{490{
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);
492 if (!sgid_tbl->tbl)492 if (!sgid_tbl->tbl)
493 return -ENOMEM;493 return -ENOMEM;
494 494
@@ -526,9 +526,10 @@ static void bnxt_qplib_cleanup_sgid_tbl(struct bnxt_qplib_res *res, · 31 unmodified lines
526 for (i = 0; i < sgid_tbl->max; i++) {526 for (i = 0; i < sgid_tbl->max; i++) {
527 if (memcmp(&sgid_tbl->tbl[i], &bnxt_qplib_gid_zero,527 if (memcmp(&sgid_tbl->tbl[i], &bnxt_qplib_gid_zero,
528 sizeof(bnxt_qplib_gid_zero)))528 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);
530 }531 }
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);
532 memset(sgid_tbl->hw_id, -1, sizeof(u16) * sgid_tbl->max);533 memset(sgid_tbl->hw_id, -1, sizeof(u16) * sgid_tbl->max);
533 memset(sgid_tbl->vlan, 0, sizeof(u8) * sgid_tbl->max);534 memset(sgid_tbl->vlan, 0, sizeof(u8) * sgid_tbl->max);
534 sgid_tbl->active = 0;535 sgid_tbl->active = 0;
@@ -537,7 +538,11 @@ static void bnxt_qplib_cleanup_sgid_tbl(struct bnxt_qplib_res *res, · 2 unmodified lines
537static void bnxt_qplib_init_sgid_tbl(struct bnxt_qplib_sgid_tbl *sgid_tbl,538static void bnxt_qplib_init_sgid_tbl(struct bnxt_qplib_sgid_tbl *sgid_tbl,
538 struct net_device *netdev)539 struct net_device *netdev)
539{540{
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
541 memset(sgid_tbl->hw_id, -1, sizeof(u16) * sgid_tbl->max);546 memset(sgid_tbl->hw_id, -1, sizeof(u16) * sgid_tbl->max);
542}547}
543 548
drivers/infiniband/hw/bnxt_re/qplib_res.h+1−1
@@ -111,7 +111,7 @@ struct bnxt_qplib_pd_tbl { · 110 unmodified lines
111};111};
112 112
113struct bnxt_qplib_sgid_tbl {113struct bnxt_qplib_sgid_tbl {
114 struct bnxt_qplib_gid *tbl;114 struct bnxt_qplib_gid_info *tbl;
115 u16 *hw_id;115 u16 *hw_id;
116 u16 max;116 u16 max;
117 u16 active;117 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
213 index, sgid_tbl->max);213 index, sgid_tbl->max);
214 return -EINVAL;214 return -EINVAL;
215 }215 }
216 memcpy(gid, &sgid_tbl->tbl[index], sizeof(*gid));216 memcpy(gid, &sgid_tbl->tbl[index].gid, sizeof(*gid));
217 return 0;217 return 0;
218}218}
219 219
220int bnxt_qplib_del_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl,220int 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)
222{222{
223 struct bnxt_qplib_res *res = to_bnxt_qplib(sgid_tbl,223 struct bnxt_qplib_res *res = to_bnxt_qplib(sgid_tbl,
224 struct bnxt_qplib_res,224 struct bnxt_qplib_res,
@@ -236,7 +236,8 @@ int bnxt_qplib_del_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, · 11 unmodified lines
236 return -ENOMEM;236 return -ENOMEM;
237 }237 }
238 for (index = 0; index < sgid_tbl->max; index++) {238 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)
240 break;241 break;
241 }242 }
242 if (index == sgid_tbl->max) {243 if (index == sgid_tbl->max) {
@@ -262,8 +263,9 @@ int bnxt_qplib_del_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, · 19 unmodified lines
262 if (rc)263 if (rc)
263 return rc;264 return rc;
264 }265 }
265 memcpy(&sgid_tbl->tbl[index], &bnxt_qplib_gid_zero,266 memcpy(&sgid_tbl->tbl[index].gid, &bnxt_qplib_gid_zero,
266 sizeof(bnxt_qplib_gid_zero));267 sizeof(bnxt_qplib_gid_zero));
268 sgid_tbl->tbl[index].vlan_id = 0xFFFF;
267 sgid_tbl->vlan[index] = 0;269 sgid_tbl->vlan[index] = 0;
268 sgid_tbl->active--;270 sgid_tbl->active--;
269 dev_dbg(&res->pdev->dev,271 dev_dbg(&res->pdev->dev,
@@ -296,7 +298,8 @@ int bnxt_qplib_add_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, · 26 unmodified lines
296 }298 }
297 free_idx = sgid_tbl->max;299 free_idx = sgid_tbl->max;
298 for (i = 0; i < sgid_tbl->max; i++) {300 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) {
300 dev_dbg(&res->pdev->dev,303 dev_dbg(&res->pdev->dev,
301 "SGID entry already exist in entry %d!\n", i);304 "SGID entry already exist in entry %d!\n", i);
302 *index = i;305 *index = i;
@@ -351,6 +354,7 @@ int bnxt_qplib_add_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, · 48 unmodified lines
351 }354 }
352 /* Add GID to the sgid_tbl */355 /* Add GID to the sgid_tbl */
353 memcpy(&sgid_tbl->tbl[free_idx], gid, sizeof(*gid));356 memcpy(&sgid_tbl->tbl[free_idx], gid, sizeof(*gid));
357 sgid_tbl->tbl[free_idx].vlan_id = vlan_id;
354 sgid_tbl->active++;358 sgid_tbl->active++;
355 if (vlan_id != 0xFFFF)359 if (vlan_id != 0xFFFF)
356 sgid_tbl->vlan[free_idx] = 1;360 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
84 u8 data[16];84 u8 data[16];
85};85};
86 86
87struct bnxt_qplib_gid_info {
88 struct bnxt_qplib_gid gid;
89 u16 vlan_id;
90};
91
87struct bnxt_qplib_ah {92struct bnxt_qplib_ah {
88 struct bnxt_qplib_gid dgid;93 struct bnxt_qplib_gid dgid;
89 struct bnxt_qplib_pd *pd;94 struct bnxt_qplib_pd *pd;
@@ -221,7 +226,7 @@ int bnxt_qplib_get_sgid(struct bnxt_qplib_res *res, · 131 unmodified lines
221 struct bnxt_qplib_sgid_tbl *sgid_tbl, int index,226 struct bnxt_qplib_sgid_tbl *sgid_tbl, int index,
222 struct bnxt_qplib_gid *gid);227 struct bnxt_qplib_gid *gid);
223int bnxt_qplib_del_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl,228int 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);
225int bnxt_qplib_add_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl,230int bnxt_qplib_add_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl,
226 struct bnxt_qplib_gid *gid, u8 *mac, u16 vlan_id,231 struct bnxt_qplib_gid *gid, u8 *mac, u16 vlan_id,
227 bool update, u32 *index);232 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
14452 clear_rcvctrl(dd, RCV_CTRL_RCV_RSM_ENABLE_SMASK);14452 clear_rcvctrl(dd, RCV_CTRL_RCV_RSM_ENABLE_SMASK);
14453}14453}
14454 14454
14455static void init_rxe(struct hfi1_devdata *dd)14455static int init_rxe(struct hfi1_devdata *dd)
14456{14456{
14457 struct rsm_map_table *rmt;14457 struct rsm_map_table *rmt;
14458 u64 val;14458 u64 val;
@@ -14461,6 +14461,9 @@ static void init_rxe(struct hfi1_devdata *dd) · 2 unmodified lines
14461 write_csr(dd, RCV_ERR_MASK, ~0ull);14461 write_csr(dd, RCV_ERR_MASK, ~0ull);
14462 14462
14463 rmt = alloc_rsm_map_table(dd);14463 rmt = alloc_rsm_map_table(dd);
14464 if (!rmt)
14465 return -ENOMEM;
14466
14464 /* set up QOS, including the QPN map table */14467 /* set up QOS, including the QPN map table */
14465 init_qos(dd, rmt);14468 init_qos(dd, rmt);
14466 init_fecn_handling(dd, rmt);14469 init_fecn_handling(dd, rmt);
@@ -14487,6 +14490,7 @@ static void init_rxe(struct hfi1_devdata *dd) · 20 unmodified lines
14487 val |= ((4ull & RCV_BYPASS_HDR_SIZE_MASK) <<14490 val |= ((4ull & RCV_BYPASS_HDR_SIZE_MASK) <<
14488 RCV_BYPASS_HDR_SIZE_SHIFT);14491 RCV_BYPASS_HDR_SIZE_SHIFT);
14489 write_csr(dd, RCV_BYPASS, val);14492 write_csr(dd, RCV_BYPASS, val);
14493 return 0;
14490}14494}
14491 14495
14492static void init_other(struct hfi1_devdata *dd)14496static void init_other(struct hfi1_devdata *dd)
@@ -15024,7 +15028,10 @@ int hfi1_init_dd(struct hfi1_devdata *dd) · 531 unmodified lines
15024 goto bail_cleanup;15028 goto bail_cleanup;
15025 15029
15026 /* set initial RXE CSRs */15030 /* set initial RXE CSRs */
15027 init_rxe(dd);15031 ret = init_rxe(dd);
15032 if (ret)
15033 goto bail_cleanup;
15034
15028 /* set initial TXE CSRs */15035 /* set initial TXE CSRs */
15029 init_txe(dd);15036 init_txe(dd);
15030 /* set initial non-RXE, non-TXE CSRs */15037 /* 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
1835 cmp_psn(qp->s_sending_psn, qp->s_sending_hpsn) <= 0)1835 cmp_psn(qp->s_sending_psn, qp->s_sending_hpsn) <= 0)
1836 break;1836 break;
1837 trdma_clean_swqe(qp, wqe);1837 trdma_clean_swqe(qp, wqe);
1838 rvt_qp_wqe_unreserve(qp, wqe);
1839 trace_hfi1_qp_send_completion(qp, wqe, qp->s_last);1838 trace_hfi1_qp_send_completion(qp, wqe, qp->s_last);
1840 rvt_qp_complete_swqe(qp,1839 rvt_qp_complete_swqe(qp,
1841 wqe,1840 wqe,
@@ -1882,7 +1881,6 @@ struct rvt_swqe *do_rc_completion(struct rvt_qp *qp, · 40 unmodified lines
1882 if (cmp_psn(wqe->lpsn, qp->s_sending_psn) < 0 ||1881 if (cmp_psn(wqe->lpsn, qp->s_sending_psn) < 0 ||
1883 cmp_psn(qp->s_sending_psn, qp->s_sending_hpsn) > 0) {1882 cmp_psn(qp->s_sending_psn, qp->s_sending_hpsn) > 0) {
1884 trdma_clean_swqe(qp, wqe);1883 trdma_clean_swqe(qp, wqe);
1885 rvt_qp_wqe_unreserve(qp, wqe);
1886 trace_hfi1_qp_send_completion(qp, wqe, qp->s_last);1884 trace_hfi1_qp_send_completion(qp, wqe, qp->s_last);
1887 rvt_qp_complete_swqe(qp,1885 rvt_qp_complete_swqe(qp,
1888 wqe,1886 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
1620 flows[i].req = req;1620 flows[i].req = req;
1621 flows[i].npagesets = 0;1621 flows[i].npagesets = 0;
1622 flows[i].pagesets[0].mapped = 0;1622 flows[i].pagesets[0].mapped = 0;
1623 flows[i].resync_npkts = 0;
1623 }1624 }
1624 req->flows = flows;1625 req->flows = flows;
1625 return 0;1626 return 0;
@@ -1673,34 +1674,6 @@ static struct tid_rdma_flow *find_flow_ib(struct tid_rdma_request *req, · 47 unmodified lines
1673 return NULL;1674 return NULL;
1674}1675}
1675 1676
1676static 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
1697static 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
1704/* TID RDMA READ functions */1677/* TID RDMA READ functions */
1705u32 hfi1_build_tid_rdma_read_packet(struct rvt_swqe *wqe,1678u32 hfi1_build_tid_rdma_read_packet(struct rvt_swqe *wqe,
1706 struct ib_other_headers *ohdr, u32 *bth1,1679 struct ib_other_headers *ohdr, u32 *bth1,
@@ -2788,19 +2761,7 @@ static bool handle_read_kdeth_eflags(struct hfi1_ctxtdata *rcd, · 1081 unmodified lines
2788 * to prevent continuous Flow Sequence errors for any2761 * to prevent continuous Flow Sequence errors for any
2789 * packets that could be still in the fabric.2762 * packets that could be still in the fabric.
2790 */2763 */
2791 flow = find_flow(req, psn, NULL);2764 flow = &req->flows[req->clear_tail];
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 }
2804 if (priv->s_flags & HFI1_R_TID_SW_PSN) {2765 if (priv->s_flags & HFI1_R_TID_SW_PSN) {
2805 diff = cmp_psn(psn,2766 diff = cmp_psn(psn,
2806 flow->flow_state.r_next_psn);2767 flow->flow_state.r_next_psn);
drivers/infiniband/hw/hfi1/verbs.c+2−0
@@ -54,6 +54,7 @@ · 53 unmodified lines
54#include <linux/mm.h>54#include <linux/mm.h>
55#include <linux/vmalloc.h>55#include <linux/vmalloc.h>
56#include <rdma/opa_addr.h>56#include <rdma/opa_addr.h>
57#include <linux/nospec.h>
57 58
58#include "hfi.h"59#include "hfi.h"
59#include "common.h"60#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
1536 sl = rdma_ah_get_sl(ah_attr);1537 sl = rdma_ah_get_sl(ah_attr);
1537 if (sl >= ARRAY_SIZE(ibp->sl_to_sc))1538 if (sl >= ARRAY_SIZE(ibp->sl_to_sc))
1538 return -EINVAL;1539 return -EINVAL;
1540 sl = array_index_nospec(sl, ARRAY_SIZE(ibp->sl_to_sc));
1539 1541
1540 sc5 = ibp->sl_to_sc[sl];1542 sc5 = ibp->sl_to_sc[sl];
1541 if (sc_to_vlt(dd, sc5) > num_vls && sc_to_vlt(dd, sc5) != 0xf)1543 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 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2config INFINIBAND_HNS2config INFINIBAND_HNS
3 tristate "HNS RoCE Driver"3 bool "HNS RoCE Driver"
4 depends on NET_VENDOR_HISILICON4 depends on NET_VENDOR_HISILICON
5 depends on ARM64 || (COMPILE_TEST && 64BIT)5 depends on ARM64 || (COMPILE_TEST && 64BIT)
6 ---help---6 ---help---
@@ -11,7 +11,7 @@ config INFINIBAND_HNS · 4 unmodified lines
11 To compile HIP06 or HIP08 driver as module, choose M here.11 To compile HIP06 or HIP08 driver as module, choose M here.
12 12
13config INFINIBAND_HNS_HIP0613config INFINIBAND_HNS_HIP06
14 bool "Hisilicon Hip06 Family RoCE support"14 tristate "Hisilicon Hip06 Family RoCE support"
15 depends on INFINIBAND_HNS && HNS && HNS_DSAF && HNS_ENET15 depends on INFINIBAND_HNS && HNS && HNS_DSAF && HNS_ENET
16 ---help---16 ---help---
17 RoCE driver support for Hisilicon RoCE engine in Hisilicon Hip06 and17 RoCE driver support for Hisilicon RoCE engine in Hisilicon Hip06 and
@@ -21,7 +21,7 @@ config INFINIBAND_HNS_HIP06 · 3 unmodified lines
21 module will be called hns-roce-hw-v121 module will be called hns-roce-hw-v1
22 22
23config INFINIBAND_HNS_HIP0823config INFINIBAND_HNS_HIP08
24 bool "Hisilicon Hip08 Family RoCE support"24 tristate "Hisilicon Hip08 Family RoCE support"
25 depends on INFINIBAND_HNS && PCI && HNS325 depends on INFINIBAND_HNS && PCI && HNS3
26 ---help---26 ---help---
27 RoCE driver support for Hisilicon RoCE engine in Hisilicon Hip08 SoC.27 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
9 hns_roce_ah.o hns_roce_hem.o hns_roce_mr.o hns_roce_qp.o \9 hns_roce_ah.o hns_roce_hem.o hns_roce_mr.o hns_roce_qp.o \
10 hns_roce_cq.o hns_roce_alloc.o hns_roce_db.o hns_roce_srq.o hns_roce_restrack.o10 hns_roce_cq.o hns_roce_alloc.o hns_roce_db.o hns_roce_srq.o hns_roce_restrack.o
11 11
12ifdef CONFIG_INFINIBAND_HNS_HIP06
13hns-roce-hw-v1-objs := hns_roce_hw_v1.o $(hns-roce-objs)12hns-roce-hw-v1-objs := hns_roce_hw_v1.o $(hns-roce-objs)
14obj-$(CONFIG_INFINIBAND_HNS) += hns-roce-hw-v1.o13obj-$(CONFIG_INFINIBAND_HNS_HIP06) += hns-roce-hw-v1.o
15endif
16 14
17ifdef CONFIG_INFINIBAND_HNS_HIP08
18hns-roce-hw-v2-objs := hns_roce_hw_v2.o hns_roce_hw_v2_dfx.o $(hns-roce-objs)15hns-roce-hw-v2-objs := hns_roce_hw_v2.o hns_roce_hw_v2_dfx.o $(hns-roce-objs)
19obj-$(CONFIG_INFINIBAND_HNS) += hns-roce-hw-v2.o16obj-$(CONFIG_INFINIBAND_HNS_HIP08) += hns-roce-hw-v2.o
20endif
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
12 struct ib_udata *udata, unsigned long virt,12 struct ib_udata *udata, unsigned long virt,
13 struct hns_roce_db *db)13 struct hns_roce_db *db)
14{14{
15 unsigned long page_addr = virt & PAGE_MASK;
15 struct hns_roce_user_db_page *page;16 struct hns_roce_user_db_page *page;
17 unsigned int offset;
16 int ret = 0;18 int ret = 0;
17 19
18 mutex_lock(&context->page_mutex);20 mutex_lock(&context->page_mutex);
19 21
20 list_for_each_entry(page, &context->page_list, list)22 list_for_each_entry(page, &context->page_list, list)
21 if (page->user_virt == (virt & PAGE_MASK))23 if (page->user_virt == page_addr)
22 goto found;24 goto found;
23 25
24 page = kmalloc(sizeof(*page), GFP_KERNEL);26 page = kmalloc(sizeof(*page), GFP_KERNEL);
@@ -28,8 +30,8 @@ int hns_roce_db_map_user(struct hns_roce_ucontext *context, · 3 unmodified lines
28 }30 }
29 31
30 refcount_set(&page->refcount, 1);32 refcount_set(&page->refcount, 1);
31 page->user_virt = (virt & PAGE_MASK);33 page->user_virt = page_addr;
32 page->umem = ib_umem_get(udata, virt & PAGE_MASK, PAGE_SIZE, 0, 0);34 page->umem = ib_umem_get(udata, page_addr, PAGE_SIZE, 0, 0);
33 if (IS_ERR(page->umem)) {35 if (IS_ERR(page->umem)) {
34 ret = PTR_ERR(page->umem);36 ret = PTR_ERR(page->umem);
35 kfree(page);37 kfree(page);
@@ -39,10 +41,9 @@ int hns_roce_db_map_user(struct hns_roce_ucontext *context, · 3 unmodified lines
39 list_add(&page->list, &context->page_list);41 list_add(&page->list, &context->page_list);
40 42
41found:43found:
42 db->dma = sg_dma_address(page->umem->sg_head.sgl) +44 offset = virt - page_addr;
43 (virt & ~PAGE_MASK);45 db->dma = sg_dma_address(page->umem->sg_head.sgl) + offset;
44 page->umem->sg_head.sgl->offset = virt & ~PAGE_MASK;46 db->virt_addr = sg_virt(page->umem->sg_head.sgl) + offset;
45 db->virt_addr = sg_virt(page->umem->sg_head.sgl);
46 db->u.user_page = page;47 db->u.user_page = page;
47 refcount_inc(&page->refcount);48 refcount_inc(&page->refcount);
48 49
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
750 atomic_set(&free_mr->mr_free_cq->ib_cq.usecnt, 0);750 atomic_set(&free_mr->mr_free_cq->ib_cq.usecnt, 0);
751 751
752 pd = rdma_zalloc_drv_obj(ibdev, ib_pd);752 pd = rdma_zalloc_drv_obj(ibdev, ib_pd);
753 if (!pd)753 if (!pd) {
754 ret = -ENOMEM;
754 goto alloc_mem_failed;755 goto alloc_mem_failed;
756 }
755 757
756 pd->device = ibdev;758 pd->device = ibdev;
757 ret = hns_roce_alloc_pd(pd, NULL);759 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
5802 return;5802 return;
5803 }5803 }
5804 5804
5805 if (mpi->mdev_events.notifier_call)
5806 mlx5_notifier_unregister(mpi->mdev, &mpi->mdev_events);
5807 mpi->mdev_events.notifier_call = NULL;
5808
5809 mpi->ibdev = NULL;5805 mpi->ibdev = NULL;
5810 5806
5811 spin_unlock(&port->mp.mpi_lock);5807 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;
5812 mlx5_remove_netdev_notifier(ibdev, port_num);5811 mlx5_remove_netdev_notifier(ibdev, port_num);
5813 spin_lock(&port->mp.mpi_lock);5812 spin_lock(&port->mp.mpi_lock);
5814 5813
drivers/infiniband/hw/mlx5/mlx5_ib.h+1−0
@@ -481,6 +481,7 @@ struct mlx5_umr_wr { · 480 unmodified lines
481 u64 length;481 u64 length;
482 int access_flags;482 int access_flags;
483 u32 mkey;483 u32 mkey;
484 u8 ignore_free_state:1;
484};485};
485 486
486static inline const struct mlx5_umr_wr *umr_wr(const struct ib_send_wr *wr)487static 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
51static void dereg_mr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr);51static void dereg_mr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr);
52static int mr_cache_max_order(struct mlx5_ib_dev *dev);52static int mr_cache_max_order(struct mlx5_ib_dev *dev);
53static int unreg_umr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr);53static int unreg_umr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr);
54static 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}
58 54
59static bool umr_can_use_indirect_mkey(struct mlx5_ib_dev *dev)55static bool umr_can_use_indirect_mkey(struct mlx5_ib_dev *dev)
60{56{
61 return !MLX5_CAP_GEN(dev->mdev, umr_indirect_mkey_disabled);57 return !MLX5_CAP_GEN(dev->mdev, umr_indirect_mkey_disabled);
62}58}
63 59
64static 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
70static int destroy_mkey(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr)60static int destroy_mkey(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr)
71{61{
72 int err = mlx5_core_destroy_mkey(dev->mdev, &mr->mmkey);62 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
545 return;535 return;
546 536
547 c = order2idx(dev, mr->order);537 c = order2idx(dev, mr->order);
548 if (c < 0 || c >= MAX_MR_CACHE_ENTRIES) {538 WARN_ON(c < 0 || c >= MAX_MR_CACHE_ENTRIES);
549 mlx5_ib_warn(dev, "order %d, cache index %d\n", mr->order, c);
550 return;
551 }
552 539
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);
554 return;546 return;
547 }
555 548
556 ent = &cache->ent[c];549 ent = &cache->ent[c];
557 spin_lock_irq(&ent->lock);550 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
1268{1261{
1269 struct mlx5_ib_dev *dev = to_mdev(pd->device);1262 struct mlx5_ib_dev *dev = to_mdev(pd->device);
1270 struct mlx5_ib_mr *mr = NULL;1263 struct mlx5_ib_mr *mr = NULL;
1271 bool populate_mtts = false;1264 bool use_umr;
1272 struct ib_umem *umem;1265 struct ib_umem *umem;
1273 int page_shift;1266 int page_shift;
1274 int npages;1267 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
1300 if (err < 0)1293 if (err < 0)
1301 return ERR_PTR(err);1294 return ERR_PTR(err);
1302 1295
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) {
1304 mr = alloc_mr_from_cache(pd, umem, virt_addr, length, ncont,1301 mr = alloc_mr_from_cache(pd, umem, virt_addr, length, ncont,
1305 page_shift, order, access_flags);1302 page_shift, order, access_flags);
1306 if (PTR_ERR(mr) == -EAGAIN) {1303 if (PTR_ERR(mr) == -EAGAIN) {
1307 mlx5_ib_dbg(dev, "cache empty for order %d\n", order);1304 mlx5_ib_dbg(dev, "cache empty for order %d\n", order);
1308 mr = NULL;1305 mr = NULL;
1309 }1306 }
1310 populate_mtts = false;
1311 } else if (!MLX5_CAP_GEN(dev->mdev, umr_extended_translation_offset)) {1307 } else if (!MLX5_CAP_GEN(dev->mdev, umr_extended_translation_offset)) {
1312 if (access_flags & IB_ACCESS_ON_DEMAND) {1308 if (access_flags & IB_ACCESS_ON_DEMAND) {
1313 err = -EINVAL;1309 err = -EINVAL;
1314 pr_err("Got MR registration for ODP MR > 512MB, not supported for Connect-IB\n");1310 pr_err("Got MR registration for ODP MR > 512MB, not supported for Connect-IB\n");
1315 goto error;1311 goto error;
1316 }1312 }
1317 populate_mtts = true;1313 use_umr = false;
1318 }1314 }
1319 1315
1320 if (!mr) {1316 if (!mr) {
1321 if (!umr_can_modify_entity_size(dev))
1322 populate_mtts = true;
1323 mutex_lock(&dev->slow_path_mutex);1317 mutex_lock(&dev->slow_path_mutex);
1324 mr = reg_create(NULL, pd, virt_addr, length, umem, ncont,1318 mr = reg_create(NULL, pd, virt_addr, length, umem, ncont,
1325 page_shift, access_flags, populate_mtts);1319 page_shift, access_flags, !use_umr);
1326 mutex_unlock(&dev->slow_path_mutex);1320 mutex_unlock(&dev->slow_path_mutex);
1327 }1321 }
1328 1322
@@ -1338,7 +1332,7 @@ struct ib_mr *mlx5_ib_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, · 9 unmodified lines
1338 1332
1339 update_odp_mr(mr);1333 update_odp_mr(mr);
1340 1334
1341 if (!populate_mtts) {1335 if (use_umr) {
1342 int update_xlt_flags = MLX5_IB_UPD_XLT_ENABLE;1336 int update_xlt_flags = MLX5_IB_UPD_XLT_ENABLE;
1343 1337
1344 if (access_flags & IB_ACCESS_ON_DEMAND)1338 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
1373 return 0;1367 return 0;
1374 1368
1375 umrwr.wr.send_flags = MLX5_IB_SEND_UMR_DISABLE_MR |1369 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;
1377 umrwr.wr.opcode = MLX5_IB_WR_UMR;1371 umrwr.wr.opcode = MLX5_IB_WR_UMR;
1372 umrwr.pd = dev->umrc.pd;
1378 umrwr.mkey = mr->mmkey.key;1373 umrwr.mkey = mr->mmkey.key;
1374 umrwr.ignore_free_state = 1;
1379 1375
1380 return mlx5_ib_post_send_wait(dev, &umrwr);1376 return mlx5_ib_post_send_wait(dev, &umrwr);
1381}1377}
@@ -1577,10 +1573,10 @@ static void clean_mr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr) · 195 unmodified lines
1577 mr->sig = NULL;1573 mr->sig = NULL;
1578 }1574 }
1579 1575
1580 mlx5_free_priv_descs(mr);1576 if (!allocated_from_cache) {
1581
1582 if (!allocated_from_cache)
1583 destroy_mkey(dev, mr);1577 destroy_mkey(dev, mr);
1578 mlx5_free_priv_descs(mr);
1579 }
1584}1580}
1585 1581
1586static void dereg_mr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr)1582static 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
246 * overwrite the same MTTs. Concurent invalidations might race us,246 * overwrite the same MTTs. Concurent invalidations might race us,
247 * but they will write 0s as well, so no difference in the end result.247 * but they will write 0s as well, so no difference in the end result.
248 */248 */
249 249 mutex_lock(&umem_odp->umem_mutex);
250 for (addr = start; addr < end; addr += BIT(umem_odp->page_shift)) {250 for (addr = start; addr < end; addr += BIT(umem_odp->page_shift)) {
251 idx = (addr - ib_umem_start(umem_odp)) >> umem_odp->page_shift;251 idx = (addr - ib_umem_start(umem_odp)) >> umem_odp->page_shift;
252 /*252 /*
@@ -278,6 +278,7 @@ void mlx5_ib_invalidate_range(struct ib_umem_odp *umem_odp, unsigned long start, · 25 unmodified lines
278 idx - blk_start_idx + 1, 0,278 idx - blk_start_idx + 1, 0,
279 MLX5_IB_UPD_XLT_ZAP |279 MLX5_IB_UPD_XLT_ZAP |
280 MLX5_IB_UPD_XLT_ATOMIC);280 MLX5_IB_UPD_XLT_ATOMIC);
281 mutex_unlock(&umem_odp->umem_mutex);
281 /*282 /*
282 * We are now sure that the device will not access the283 * We are now sure that the device will not access the
283 * memory. We can safely unmap it, and mark it as dirty if284 * 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
1771 1772
1772 num_pending_prefetch_dec(to_mdev(w->pd->device), w->sg_list,1773 num_pending_prefetch_dec(to_mdev(w->pd->device), w->sg_list,
1773 w->num_sge, 0);1774 w->num_sge, 0);
1774 kfree(w);1775 kvfree(w);
1775}1776}
1776 1777
1777int mlx5_ib_advise_mr_prefetch(struct ib_pd *pd,1778int 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
1813 if (valid_req)1814 if (valid_req)
1814 queue_work(system_unbound_wq, &work->work);1815 queue_work(system_unbound_wq, &work->work);
1815 else1816 else
1816 kfree(work);1817 kvfree(work);
1817 1818
1818 srcu_read_unlock(&dev->mr_srcu, srcu_key);1819 srcu_read_unlock(&dev->mr_srcu, srcu_key);
1819 1820
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
1713 }1713 }
1714 1714
1715 MLX5_SET(tirc, tirc, rx_hash_fn, MLX5_RX_HASH_FN_TOEPLITZ);1715 MLX5_SET(tirc, tirc, rx_hash_fn, MLX5_RX_HASH_FN_TOEPLITZ);
1716 MLX5_SET(tirc, tirc, rx_hash_symmetric, 1);
1717 memcpy(rss_key, ucmd.rx_hash_key, len);1716 memcpy(rss_key, ucmd.rx_hash_key, len);
1718 break;1717 break;
1719 }1718 }
@@ -4295,10 +4294,14 @@ static int set_reg_umr_segment(struct mlx5_ib_dev *dev, · 2575 unmodified lines
4295 4294
4296 memset(umr, 0, sizeof(*umr));4295 memset(umr, 0, sizeof(*umr));
4297 4296
4298 if (wr->send_flags & MLX5_IB_SEND_UMR_FAIL_IF_FREE)4297 if (!umrwr->ignore_free_state) {
4299 umr->flags = MLX5_UMR_CHECK_FREE; /* fail if free */4298 if (wr->send_flags & MLX5_IB_SEND_UMR_FAIL_IF_FREE)
4300 else4299 /* fail if free */
4301 umr->flags = MLX5_UMR_CHECK_NOT_FREE; /* fail if not free */4300 umr->flags = MLX5_UMR_CHECK_FREE;
4301 else
4302 /* fail if not free */
4303 umr->flags = MLX5_UMR_CHECK_NOT_FREE;
4304 }
4302 4305
4303 umr->xlt_octowords = cpu_to_be16(get_xlt_octo(umrwr->xlt_size));4306 umr->xlt_octowords = cpu_to_be16(get_xlt_octo(umrwr->xlt_size));
4304 if (wr->send_flags & MLX5_IB_SEND_UMR_UPDATE_XLT) {4307 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
125 struct qedr_dev *dev =125 struct qedr_dev *dev =
126 rdma_device_to_drv_device(device, struct qedr_dev, ibdev);126 rdma_device_to_drv_device(device, struct qedr_dev, ibdev);
127 127
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);
129}129}
130static DEVICE_ATTR_RO(hw_rev);130static DEVICE_ATTR_RO(hw_rev);
131 131
132static ssize_t hca_type_show(struct device *device,132static ssize_t hca_type_show(struct device *device,
133 struct device_attribute *attr, char *buf)133 struct device_attribute *attr, char *buf)
134{134{
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");
136}142}
137static DEVICE_ATTR_RO(hca_type);143static DEVICE_ATTR_RO(hca_type);
138 144
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
220static void siw_cep_set_inuse(struct siw_cep *cep)220static void siw_cep_set_inuse(struct siw_cep *cep)
221{221{
222 unsigned long flags;222 unsigned long flags;
223 int rv;
224retry:223retry:
225 spin_lock_irqsave(&cep->lock, flags);224 spin_lock_irqsave(&cep->lock, flags);
226 225
227 if (cep->in_use) {226 if (cep->in_use) {
228 spin_unlock_irqrestore(&cep->lock, flags);227 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);
230 if (signal_pending(current))229 if (signal_pending(current))
231 flush_signals(current);230 flush_signals(current);
232 goto retry;231 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
612 612
613 if (!siw_create_tx_threads()) {613 if (!siw_create_tx_threads()) {
614 pr_info("siw: Could not start any TX thread\n");614 pr_info("siw: Could not start any TX thread\n");
615 rv = -ENOMEM;
615 goto out_error;616 goto out_error;
616 }617 }
617 /*618 /*
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
220{220{
221 struct siw_rx_stream *c_rx = &qp->rx_stream;221 struct siw_rx_stream *c_rx = &qp->rx_stream;
222 struct siw_iwarp_tx *c_tx = &qp->tx_ctx;222 struct siw_iwarp_tx *c_tx = &qp->tx_ctx;
223 int size = crypto_shash_descsize(siw_crypto_shash) +223 int size;
224 sizeof(struct shash_desc);
225 224
226 if (siw_crypto_shash == NULL)225 if (siw_crypto_shash == NULL)
227 return -ENOENT;226 return -ENOENT;
228 227
228 size = crypto_shash_descsize(siw_crypto_shash) +
229 sizeof(struct shash_desc);
230
229 c_tx->mpa_crc_hd = kzalloc(size, GFP_KERNEL);231 c_tx->mpa_crc_hd = kzalloc(size, GFP_KERNEL);
230 c_rx->mpa_crc_hd = kzalloc(size, GFP_KERNEL);232 c_rx->mpa_crc_hd = kzalloc(size, GFP_KERNEL);
231 if (!c_tx->mpa_crc_hd || !c_rx->mpa_crc_hd) {233 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
201 return -ENODEV;201 return -ENODEV;
202 202
203 epirq = &interface->endpoint[0].desc;203 epirq = &interface->endpoint[0].desc;
204 if (!usb_endpoint_is_int_in(epirq))
205 return -ENODEV;
206
204 epout = &interface->endpoint[1].desc;207 epout = &interface->endpoint[1].desc;
208 if (!usb_endpoint_is_int_out(epout))
209 return -ENODEV;
205 210
206 iforce_usb = kzalloc(sizeof(*iforce_usb), GFP_KERNEL);211 iforce_usb = kzalloc(sizeof(*iforce_usb), GFP_KERNEL);
207 if (!iforce_usb)212 if (!iforce_usb)
drivers/input/keyboard/Kconfig+2−0
@@ -76,6 +76,8 @@ config KEYBOARD_APPLESPI · 75 unmodified lines
76 depends on ACPI && EFI76 depends on ACPI && EFI
77 depends on SPI77 depends on SPI
78 depends on X86 || COMPILE_TEST78 depends on X86 || COMPILE_TEST
79 depends on LEDS_CLASS
80 select CRC16
79 help81 help
80 Say Y here if you are running Linux on any Apple MacBook8,1 or later,82 Say Y here if you are running Linux on any Apple MacBook8,1 or later,
81 or any MacBookPro13,* or MacBookPro14,*.83 or any MacBookPro13,* or MacBookPro14,*.
drivers/input/keyboard/applespi.c+16−13
@@ -134,10 +134,10 @@ struct keyboard_protocol { · 133 unmodified lines
134 * struct tp_finger - single trackpad finger structure, le16-aligned134 * struct tp_finger - single trackpad finger structure, le16-aligned
135 *135 *
136 * @origin: zero when switching track finger136 * @origin: zero when switching track finger
137 * @abs_x: absolute x coodinate137 * @abs_x: absolute x coordinate
138 * @abs_y: absolute y coodinate138 * @abs_y: absolute y coordinate
139 * @rel_x: relative x coodinate139 * @rel_x: relative x coordinate
140 * @rel_y: relative y coodinate140 * @rel_y: relative y coordinate
141 * @tool_major: tool area, major axis141 * @tool_major: tool area, major axis
142 * @tool_minor: tool area, minor axis142 * @tool_minor: tool area, minor axis
143 * @orientation: 16384 when point, else 15 bit angle143 * @orientation: 16384 when point, else 15 bit angle
@@ -944,10 +944,14 @@ static inline int le16_to_int(__le16 x) · 800 unmodified lines
944static void applespi_debug_update_dimensions(struct applespi_data *applespi,944static void applespi_debug_update_dimensions(struct applespi_data *applespi,
945 const struct tp_finger *f)945 const struct tp_finger *f)
946{946{
947 applespi->tp_dim_min_x = min_t(int, applespi->tp_dim_min_x, f->abs_x);947 applespi->tp_dim_min_x = min(applespi->tp_dim_min_x,
948 applespi->tp_dim_max_x = max_t(int, applespi->tp_dim_max_x, f->abs_x);948 le16_to_int(f->abs_x));
949 applespi->tp_dim_min_y = min_t(int, applespi->tp_dim_min_y, f->abs_y);949 applespi->tp_dim_max_x = max(applespi->tp_dim_max_x,
950 applespi->tp_dim_max_y = max_t(int, applespi->tp_dim_max_y, f->abs_y);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));
951}955}
952 956
953static int applespi_tp_dim_open(struct inode *inode, struct file *file)957static 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
1490 size_t tp_len;1494 size_t tp_len;
1491 1495
1492 tp = &message->touchpad;1496 tp = &message->touchpad;
1493 tp_len = sizeof(*tp) +1497 tp_len = struct_size(tp, fingers, tp->number_of_fingers);
1494 tp->number_of_fingers * sizeof(tp->fingers[0]);
1495 1498
1496 if (le16_to_cpu(message->length) + 2 != tp_len) {1499 if (le16_to_cpu(message->length) + 2 != tp_len) {
1497 dev_warn_ratelimited(&applespi->spi->dev,1500 dev_warn_ratelimited(&applespi->spi->dev,
@@ -1611,8 +1614,8 @@ static void applespi_save_bl_level(struct applespi_data *applespi, · 113 unmodified lines
1611 efi_attr = EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS |1614 efi_attr = EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS |
1612 EFI_VARIABLE_RUNTIME_ACCESS;1615 EFI_VARIABLE_RUNTIME_ACCESS;
1613 1616
1614 sts = efivar_entry_set_safe(EFI_BL_LEVEL_NAME, efi_guid, efi_attr, true,1617 sts = efivar_entry_set_safe((efi_char16_t *)EFI_BL_LEVEL_NAME, efi_guid,
1615 efi_data_len, &efi_data);1618 efi_attr, true, efi_data_len, &efi_data);
1616 if (sts)1619 if (sts)
1617 dev_warn(&applespi->spi->dev,1620 dev_warn(&applespi->spi->dev,
1618 "Error saving backlight level to EFI vars: %d\n", sts);1621 "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
1953};1956};
1954MODULE_DEVICE_TABLE(acpi, applespi_acpi_match);1957MODULE_DEVICE_TABLE(acpi, applespi_acpi_match);
1955 1958
1956const struct dev_pm_ops applespi_pm_ops = {1959static const struct dev_pm_ops applespi_pm_ops = {
1957 SET_SYSTEM_SLEEP_PM_OPS(applespi_suspend, applespi_resume)1960 SET_SYSTEM_SLEEP_PM_OPS(applespi_suspend, applespi_resume)
1958 .poweroff_late = applespi_poweroff_late,1961 .poweroff_late = applespi_poweroff_late,
1959};1962};
drivers/input/mouse/elantech.c+26−29
@@ -1827,6 +1827,31 @@ static int elantech_create_smbus(struct psmouse *psmouse, · 1826 unmodified lines
1827 leave_breadcrumbs);1827 leave_breadcrumbs);
1828}1828}
1829 1829
1830static 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
1830/**1855/**
1831 * elantech_setup_smbus - called once the PS/2 devices are enumerated1856 * elantech_setup_smbus - called once the PS/2 devices are enumerated
1832 * and decides to instantiate a SMBus InterTouch device.1857 * and decides to instantiate a SMBus InterTouch device.
@@ -1846,7 +1871,7 @@ static int elantech_setup_smbus(struct psmouse *psmouse, · 13 unmodified lines
1846 * i2c_blacklist_pnp_ids.1871 * i2c_blacklist_pnp_ids.
1847 * Old ICs are up to the user to decide.1872 * Old ICs are up to the user to decide.
1848 */1873 */
1849 if (!ETP_NEW_IC_SMBUS_HOST_NOTIFY(info->fw_version) ||1874 if (!elantech_use_host_notify(psmouse, info) ||
1850 psmouse_matches_pnp_id(psmouse, i2c_blacklist_pnp_ids))1875 psmouse_matches_pnp_id(psmouse, i2c_blacklist_pnp_ids))
1851 return -ENXIO;1876 return -ENXIO;
1852 }1877 }
@@ -1866,34 +1891,6 @@ static int elantech_setup_smbus(struct psmouse *psmouse, · 13 unmodified lines
1866 return 0;1891 return 0;
1867}1892}
1868 1893
1869static 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
1897int elantech_init_smbus(struct psmouse *psmouse)1894int elantech_init_smbus(struct psmouse *psmouse)
1898{1895{
1899 struct elantech_device_info info;1896 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
182 "LEN2055", /* E580 */182 "LEN2055", /* E580 */
183 "SYN3052", /* HP EliteBook 840 G4 */183 "SYN3052", /* HP EliteBook 840 G4 */
184 "SYN3221", /* HP 15-ay000 */184 "SYN3221", /* HP 15-ay000 */
185 "SYN323d", /* HP Spectre X360 13-w013dx */
185 NULL186 NULL
186};187};
187 188
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
117 if (intf->cur_altsetting->desc.bNumEndpoints < 1)117 if (intf->cur_altsetting->desc.bNumEndpoints < 1)
118 return -ENODEV;118 return -ENODEV;
119 119
120 endpoint = &intf->cur_altsetting->endpoint[0].desc;
121 if (!usb_endpoint_is_int_in(endpoint))
122 return -ENODEV;
123
120 kbtab = kzalloc(sizeof(struct kbtab), GFP_KERNEL);124 kbtab = kzalloc(sizeof(struct kbtab), GFP_KERNEL);
121 input_dev = input_allocate_device();125 input_dev = input_allocate_device();
122 if (!kbtab || !input_dev)126 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
155 input_set_abs_params(input_dev, ABS_Y, 0, 0x1750, 4, 0);159 input_set_abs_params(input_dev, ABS_Y, 0, 0x1750, 4, 0);
156 input_set_abs_params(input_dev, ABS_PRESSURE, 0, 0xff, 0, 0);160 input_set_abs_params(input_dev, ABS_PRESSURE, 0, 0xff, 0, 0);
157 161
158 endpoint = &intf->cur_altsetting->endpoint[0].desc;
159
160 usb_fill_int_urb(kbtab->irq, dev,162 usb_fill_int_urb(kbtab->irq, dev,
161 usb_rcvintpipe(dev, endpoint->bEndpointAddress),163 usb_rcvintpipe(dev, endpoint->bEndpointAddress),
162 kbtab->data, 8,164 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
1659 if (!usbtouch || !input_dev)1659 if (!usbtouch || !input_dev)
1660 goto out_free;1660 goto out_free;
1661 1661
1662 mutex_init(&usbtouch->pm_mutex);
1663
1662 type = &usbtouch_dev_info[id->driver_info];1664 type = &usbtouch_dev_info[id->driver_info];
1663 usbtouch->type = type;1665 usbtouch->type = type;
1664 if (!type->process_pkt)1666 if (!type->process_pkt)
drivers/iommu/virtio-iommu.c+29−11
@@ -2,7 +2,7 @@ · 1 unmodified line
2/*2/*
3 * Virtio driver for the paravirtualized IOMMU3 * Virtio driver for the paravirtualized IOMMU
4 *4 *
5 * Copyright (C) 2018 Arm Limited5 * Copyright (C) 2019 Arm Limited
6 */6 */
7 7
8#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt8#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -47,7 +47,10 @@ struct viommu_dev { · 38 unmodified lines
47 /* Device configuration */47 /* Device configuration */
48 struct iommu_domain_geometry geometry;48 struct iommu_domain_geometry geometry;
49 u64 pgsize_bitmap;49 u64 pgsize_bitmap;
50 u8 domain_bits;50 u32 first_domain;
51 u32 last_domain;
52 /* Supported MAP flags */
53 u32 map_flags;
51 u32 probe_size;54 u32 probe_size;
52};55};
53 56
@@ -62,6 +65,7 @@ struct viommu_domain { · 8 unmodified lines
62 struct viommu_dev *viommu;65 struct viommu_dev *viommu;
63 struct mutex mutex; /* protects viommu pointer */66 struct mutex mutex; /* protects viommu pointer */
64 unsigned int id;67 unsigned int id;
68 u32 map_flags;
65 69
66 spinlock_t mappings_lock;70 spinlock_t mappings_lock;
67 struct rb_root_cached mappings;71 struct rb_root_cached mappings;
@@ -113,6 +117,8 @@ static int viommu_get_req_errno(void *buf, size_t len) · 45 unmodified lines
113 return -ENOENT;117 return -ENOENT;
114 case VIRTIO_IOMMU_S_FAULT:118 case VIRTIO_IOMMU_S_FAULT:
115 return -EFAULT;119 return -EFAULT;
120 case VIRTIO_IOMMU_S_NOMEM:
121 return -ENOMEM;
116 case VIRTIO_IOMMU_S_IOERR:122 case VIRTIO_IOMMU_S_IOERR:
117 case VIRTIO_IOMMU_S_DEVERR:123 case VIRTIO_IOMMU_S_DEVERR:
118 default:124 default:
@@ -607,15 +613,15 @@ static int viommu_domain_finalise(struct viommu_dev *viommu, · 488 unmodified lines
607{613{
608 int ret;614 int ret;
609 struct viommu_domain *vdomain = to_viommu_domain(domain);615 struct viommu_domain *vdomain = to_viommu_domain(domain);
610 unsigned int max_domain = viommu->domain_bits > 31 ? ~0 :
611 (1U << viommu->domain_bits) - 1;
612 616
613 vdomain->viommu = viommu;617 vdomain->viommu = viommu;
618 vdomain->map_flags = viommu->map_flags;
614 619
615 domain->pgsize_bitmap = viommu->pgsize_bitmap;620 domain->pgsize_bitmap = viommu->pgsize_bitmap;
616 domain->geometry = viommu->geometry;621 domain->geometry = viommu->geometry;
617 622
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);
619 if (ret >= 0)625 if (ret >= 0)
620 vdomain->id = (unsigned int)ret;626 vdomain->id = (unsigned int)ret;
621 627
@@ -710,7 +716,7 @@ static int viommu_map(struct iommu_domain *domain, unsigned long iova, · 88 unmodified lines
710 phys_addr_t paddr, size_t size, int prot)716 phys_addr_t paddr, size_t size, int prot)
711{717{
712 int ret;718 int ret;
713 int flags;719 u32 flags;
714 struct virtio_iommu_req_map map;720 struct virtio_iommu_req_map map;
715 struct viommu_domain *vdomain = to_viommu_domain(domain);721 struct viommu_domain *vdomain = to_viommu_domain(domain);
716 722
@@ -718,6 +724,9 @@ static int viommu_map(struct iommu_domain *domain, unsigned long iova, · 1 unmodified line
718 (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) |724 (prot & IOMMU_WRITE ? VIRTIO_IOMMU_MAP_F_WRITE : 0) |
719 (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0);725 (prot & IOMMU_MMIO ? VIRTIO_IOMMU_MAP_F_MMIO : 0);
720 726
727 if (flags & ~vdomain->map_flags)
728 return -EINVAL;
729
721 ret = viommu_add_mapping(vdomain, iova, paddr, size, flags);730 ret = viommu_add_mapping(vdomain, iova, paddr, size, flags);
722 if (ret)731 if (ret)
723 return ret;732 return ret;
@@ -1027,7 +1036,8 @@ static int viommu_probe(struct virtio_device *vdev) · 303 unmodified lines
1027 goto err_free_vqs;1036 goto err_free_vqs;
1028 }1037 }
1029 1038
1030 viommu->domain_bits = 32;1039 viommu->map_flags = VIRTIO_IOMMU_MAP_F_READ | VIRTIO_IOMMU_MAP_F_WRITE;
1040 viommu->last_domain = ~0U;
1031 1041
1032 /* Optional features */1042 /* Optional features */
1033 virtio_cread_feature(vdev, VIRTIO_IOMMU_F_INPUT_RANGE,1043 virtio_cread_feature(vdev, VIRTIO_IOMMU_F_INPUT_RANGE,
@@ -1038,9 +1048,13 @@ static int viommu_probe(struct virtio_device *vdev) · 4 unmodified lines
1038 struct virtio_iommu_config, input_range.end,1048 struct virtio_iommu_config, input_range.end,
1039 &input_end);1049 &input_end);
1040 1050
1041 virtio_cread_feature(vdev, VIRTIO_IOMMU_F_DOMAIN_BITS,1051 virtio_cread_feature(vdev, VIRTIO_IOMMU_F_DOMAIN_RANGE,
1042 struct virtio_iommu_config, domain_bits,1052 struct virtio_iommu_config, domain_range.start,
1043 &viommu->domain_bits);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);
1044 1058
1045 virtio_cread_feature(vdev, VIRTIO_IOMMU_F_PROBE,1059 virtio_cread_feature(vdev, VIRTIO_IOMMU_F_PROBE,
1046 struct virtio_iommu_config, probe_size,1060 struct virtio_iommu_config, probe_size,
@@ -1052,6 +1066,9 @@ static int viommu_probe(struct virtio_device *vdev) · 5 unmodified lines
1052 .force_aperture = true,1066 .force_aperture = true,
1053 };1067 };
1054 1068
1069 if (virtio_has_feature(vdev, VIRTIO_IOMMU_F_MMIO))
1070 viommu->map_flags |= VIRTIO_IOMMU_MAP_F_MMIO;
1071
1055 viommu_ops.pgsize_bitmap = viommu->pgsize_bitmap;1072 viommu_ops.pgsize_bitmap = viommu->pgsize_bitmap;
1056 1073
1057 virtio_device_ready(vdev);1074 virtio_device_ready(vdev);
@@ -1130,9 +1147,10 @@ static void viommu_config_changed(struct virtio_device *vdev) · 72 unmodified lines
1130 1147
1131static unsigned int features[] = {1148static unsigned int features[] = {
1132 VIRTIO_IOMMU_F_MAP_UNMAP,1149 VIRTIO_IOMMU_F_MAP_UNMAP,
1133 VIRTIO_IOMMU_F_DOMAIN_BITS,
1134 VIRTIO_IOMMU_F_INPUT_RANGE,1150 VIRTIO_IOMMU_F_INPUT_RANGE,
1151 VIRTIO_IOMMU_F_DOMAIN_RANGE,
1135 VIRTIO_IOMMU_F_PROBE,1152 VIRTIO_IOMMU_F_PROBE,
1153 VIRTIO_IOMMU_F_MMIO,
1136};1154};
1137 1155
1138static struct virtio_device_id id_table[] = {1156static 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
3010 3010
3011 if (!its_alloc_vpe_table(vpe_id)) {3011 if (!its_alloc_vpe_table(vpe_id)) {
3012 its_vpe_id_free(vpe_id);3012 its_vpe_id_free(vpe_id);
3013 its_free_pending_table(vpe->vpt_page);3013 its_free_pending_table(vpt_page);
3014 return -ENOMEM;3014 return -ENOMEM;
3015 }3015 }
3016 3016
drivers/irqchip/irq-gic-v3.c+4−0
@@ -771,8 +771,10 @@ static void gic_cpu_sys_reg_init(void) · 770 unmodified lines
771 case 7:771 case 7:
772 write_gicreg(0, ICC_AP0R3_EL1);772 write_gicreg(0, ICC_AP0R3_EL1);
773 write_gicreg(0, ICC_AP0R2_EL1);773 write_gicreg(0, ICC_AP0R2_EL1);
774 /* Fall through */
774 case 6:775 case 6:
775 write_gicreg(0, ICC_AP0R1_EL1);776 write_gicreg(0, ICC_AP0R1_EL1);
777 /* Fall through */
776 case 5:778 case 5:
777 case 4:779 case 4:
778 write_gicreg(0, ICC_AP0R0_EL1);780 write_gicreg(0, ICC_AP0R0_EL1);
@@ -786,8 +788,10 @@ static void gic_cpu_sys_reg_init(void) · 7 unmodified lines
786 case 7:788 case 7:
787 write_gicreg(0, ICC_AP1R3_EL1);789 write_gicreg(0, ICC_AP1R3_EL1);
788 write_gicreg(0, ICC_AP1R2_EL1);790 write_gicreg(0, ICC_AP1R2_EL1);
791 /* Fall through */
789 case 6:792 case 6:
790 write_gicreg(0, ICC_AP1R1_EL1);793 write_gicreg(0, ICC_AP1R1_EL1);
794 /* Fall through */
791 case 5:795 case 5:
792 case 4:796 case 4:
793 write_gicreg(0, ICC_AP1R0_EL1);797 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
131 .irq_unmask = imx_gpcv2_irq_unmask,131 .irq_unmask = imx_gpcv2_irq_unmask,
132 .irq_set_wake = imx_gpcv2_irq_set_wake,132 .irq_set_wake = imx_gpcv2_irq_set_wake,
133 .irq_retrigger = irq_chip_retrigger_hierarchy,133 .irq_retrigger = irq_chip_retrigger_hierarchy,
134 .irq_set_type = irq_chip_set_type_parent,
134#ifdef CONFIG_SMP135#ifdef CONFIG_SMP
135 .irq_set_affinity = irq_chip_set_affinity_parent,136 .irq_set_affinity = irq_chip_set_affinity_parent,
136#endif137#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
241 241
242 parent = platform_bus_type.dev_root;242 parent = platform_bus_type.dev_root;
243 child = of_platform_device_create(np, NULL, parent);243 child = of_platform_device_create(np, NULL, parent);
244 if (!child)244 if (!child) {
245 of_node_put(np);
245 return -ENOMEM;246 return -ENOMEM;
247 }
246 248
247 if (of_property_read_u32(child->dev.of_node, "num-pins",249 if (of_property_read_u32(child->dev.of_node, "num-pins",
248 &num_pins) < 0) {250 &num_pins) < 0) {
249 dev_err(&pdev->dev, "No num-pins property\n");251 dev_err(&pdev->dev, "No num-pins property\n");
252 of_node_put(np);
250 return -EINVAL;253 return -EINVAL;
251 }254 }
252 255
@@ -254,8 +257,10 @@ static int mbigen_of_create_domain(struct platform_device *pdev, · 1 unmodified line
254 mbigen_write_msg,257 mbigen_write_msg,
255 &mbigen_domain_ops,258 &mbigen_domain_ops,
256 mgn_chip);259 mgn_chip);
257 if (!domain)260 if (!domain) {
261 of_node_put(np);
258 return -ENOMEM;262 return -ENOMEM;
263 }
259 }264 }
260 265
261 return 0;266 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
1394 printk(KERN_DEBUG1394 printk(KERN_DEBUG
1395 "%s: %s: alloc urb for fifo %i failed",1395 "%s: %s: alloc urb for fifo %i failed",
1396 hw->name, __func__, fifo->fifonum);1396 hw->name, __func__, fifo->fifonum);
1397 continue;
1397 }1398 }
1398 fifo->iso[i].owner_fifo = (struct usb_fifo *) fifo;1399 fifo->iso[i].owner_fifo = (struct usb_fifo *) fifo;
1399 fifo->iso[i].indx = i;1400 fifo->iso[i].indx = i;
@@ -1692,13 +1693,23 @@ hfcsusb_stop_endpoint(struct hfcsusb *hw, int channel) · 292 unmodified lines
1692static int1693static int
1693setup_hfcsusb(struct hfcsusb *hw)1694setup_hfcsusb(struct hfcsusb *hw)
1694{1695{
1696 void *dmabuf = kmalloc(sizeof(u_char), GFP_KERNEL);
1695 u_char b;1697 u_char b;
1698 int ret;
1696 1699
1697 if (debug & DBG_HFC_CALL_TRACE)1700 if (debug & DBG_HFC_CALL_TRACE)
1698 printk(KERN_DEBUG "%s: %s\n", hw->name, __func__);1701 printk(KERN_DEBUG "%s: %s\n", hw->name, __func__);
1699 1702
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
1700 /* check the chip id */1711 /* check the chip id */
1701 if (read_reg_atomic(hw, HFCUSB_CHIP_ID, &b) != 1) {1712 if (ret != 1) {
1702 printk(KERN_DEBUG "%s: %s: cannot read chip id\n",1713 printk(KERN_DEBUG "%s: %s: cannot read chip id\n",
1703 hw->name, __func__);1714 hw->name, __func__);
1704 return 1;1715 return 1;
drivers/macintosh/smu.c+1−0
@@ -852,6 +852,7 @@ int smu_queue_i2c(struct smu_i2c_cmd *cmd) · 851 unmodified lines
852 break;852 break;
853 case SMU_I2C_TRANSFER_COMBINED:853 case SMU_I2C_TRANSFER_COMBINED:
854 cmd->info.devaddr &= 0xfe;854 cmd->info.devaddr &= 0xfe;
855 /* fall through */
855 case SMU_I2C_TRANSFER_STDSUB:856 case SMU_I2C_TRANSFER_STDSUB:
856 if (cmd->info.sublen > 3)857 if (cmd->info.sublen > 3)
857 return -EINVAL;858 return -EINVAL;
drivers/md/bcache/sysfs.c+12−8
@@ -23,24 +23,28 @@ static const char * const bch_cache_modes[] = { · 22 unmodified lines
23 "writethrough",23 "writethrough",
24 "writeback",24 "writeback",
25 "writearound",25 "writearound",
26 "none"26 "none",
27 NULL
27};28};
28 29
29/* Default is 0 ("auto") */30/* Default is 0 ("auto") */
30static const char * const bch_stop_on_failure_modes[] = {31static const char * const bch_stop_on_failure_modes[] = {
31 "auto",32 "auto",
32 "always"33 "always",
34 NULL
33};35};
34 36
35static const char * const cache_replacement_policies[] = {37static const char * const cache_replacement_policies[] = {
36 "lru",38 "lru",
37 "fifo",39 "fifo",
38 "random"40 "random",
41 NULL
39};42};
40 43
41static const char * const error_actions[] = {44static const char * const error_actions[] = {
42 "unregister",45 "unregister",
43 "panic"46 "panic",
47 NULL
44};48};
45 49
46write_attribute(attach);50write_attribute(attach);
@@ -338,7 +342,7 @@ STORE(__cached_dev) · 291 unmodified lines
338 }342 }
339 343
340 if (attr == &sysfs_cache_mode) {344 if (attr == &sysfs_cache_mode) {
341 v = sysfs_match_string(bch_cache_modes, buf);345 v = __sysfs_match_string(bch_cache_modes, -1, buf);
342 if (v < 0)346 if (v < 0)
343 return v;347 return v;
344 348
@@ -349,7 +353,7 @@ STORE(__cached_dev) · 4 unmodified lines
349 }353 }
350 354
351 if (attr == &sysfs_stop_when_cache_set_failed) {355 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);
353 if (v < 0)357 if (v < 0)
354 return v;358 return v;
355 359
@@ -816,7 +820,7 @@ STORE(__bch_cache_set) · 460 unmodified lines
816 0, UINT_MAX);820 0, UINT_MAX);
817 821
818 if (attr == &sysfs_errors) {822 if (attr == &sysfs_errors) {
819 v = sysfs_match_string(error_actions, buf);823 v = __sysfs_match_string(error_actions, -1, buf);
820 if (v < 0)824 if (v < 0)
821 return v;825 return v;
822 826
@@ -1088,7 +1092,7 @@ STORE(__bch_cache) · 265 unmodified lines
1088 }1092 }
1089 1093
1090 if (attr == &sysfs_cache_replacement_policy) {1094 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);
1092 if (v < 0)1096 if (v < 0)
1093 return v;1097 return v;
1094 1098
drivers/md/dm-table.c+8−8
@@ -882,23 +882,23 @@ EXPORT_SYMBOL_GPL(dm_table_set_type); · 881 unmodified lines
882 882
883/* validate the dax capability of the target device span */883/* validate the dax capability of the target device span */
884int device_supports_dax(struct dm_target *ti, struct dm_dev *dev,884int 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)
886{886{
887 int blocksize = *(int *) data;887 int blocksize = *(int *) data;
888 888
889 return generic_fsdax_supported(dev->dax_dev, dev->bdev, blocksize,889 return generic_fsdax_supported(dev->dax_dev, dev->bdev, blocksize,
890 start, len);890 start, len);
891}891}
892 892
893/* Check devices support synchronous DAX */893/* Check devices support synchronous DAX */
894static int device_synchronous(struct dm_target *ti, struct dm_dev *dev,894static int device_dax_synchronous(struct dm_target *ti, struct dm_dev *dev,
895 sector_t start, sector_t len, void *data)895 sector_t start, sector_t len, void *data)
896{896{
897 return dax_synchronous(dev->dax_dev);897 return dev->dax_dev && dax_synchronous(dev->dax_dev);
898}898}
899 899
900bool dm_table_supports_dax(struct dm_table *t,900bool 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)
902{902{
903 struct dm_target *ti;903 struct dm_target *ti;
904 unsigned i;904 unsigned i;
@@ -911,7 +911,7 @@ bool dm_table_supports_dax(struct dm_table *t, · 6 unmodified lines
911 return false;911 return false;
912 912
913 if (!ti->type->iterate_devices ||913 if (!ti->type->iterate_devices ||
914 !ti->type->iterate_devices(ti, iterate_fn, blocksize))914 !ti->type->iterate_devices(ti, iterate_fn, blocksize))
915 return false;915 return false;
916 }916 }
917 917
@@ -1921,7 +1921,7 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, · 1003 unmodified lines
1921 1921
1922 if (dm_table_supports_dax(t, device_supports_dax, &page_size)) {1922 if (dm_table_supports_dax(t, device_supports_dax, &page_size)) {
1923 blk_queue_flag_set(QUEUE_FLAG_DAX, q);1923 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))
1925 set_dax_synchronous(t->md->dax_dev);1925 set_dax_synchronous(t->md->dax_dev);
1926 }1926 }
1927 else1927 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
1099 1099
1100 /* start creating the vb2 queues */1100 /* start creating the vb2 queues */
1101 if (dev->has_vid_cap) {1101 if (dev->has_vid_cap) {
1102 snprintf(dev->vid_cap_dev.name, sizeof(dev->vid_cap_dev.name),
1103 "vivid-%03d-vid-cap", inst);
1102 /* initialize vid_cap queue */1104 /* initialize vid_cap queue */
1103 q = &dev->vb_vid_cap_q;1105 q = &dev->vb_vid_cap_q;
1104 q->type = dev->multiplanar ? V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE :1106 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
1122 }1124 }
1123 1125
1124 if (dev->has_vid_out) {1126 if (dev->has_vid_out) {
1127 snprintf(dev->vid_out_dev.name, sizeof(dev->vid_out_dev.name),
1128 "vivid-%03d-vid-out", inst);
1125 /* initialize vid_out queue */1129 /* initialize vid_out queue */
1126 q = &dev->vb_vid_out_q;1130 q = &dev->vb_vid_out_q;
1127 q->type = dev->multiplanar ? V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE :1131 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
1265 /* finally start creating the device nodes */1269 /* finally start creating the device nodes */
1266 if (dev->has_vid_cap) {1270 if (dev->has_vid_cap) {
1267 vfd = &dev->vid_cap_dev;1271 vfd = &dev->vid_cap_dev;
1268 snprintf(vfd->name, sizeof(vfd->name),
1269 "vivid-%03d-vid-cap", inst);
1270 vfd->fops = &vivid_fops;1272 vfd->fops = &vivid_fops;
1271 vfd->ioctl_ops = &vivid_ioctl_ops;1273 vfd->ioctl_ops = &vivid_ioctl_ops;
1272 vfd->device_caps = dev->vid_cap_caps;1274 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
1312 1314
1313 if (dev->has_vid_out) {1315 if (dev->has_vid_out) {
1314 vfd = &dev->vid_out_dev;1316 vfd = &dev->vid_out_dev;
1315 snprintf(vfd->name, sizeof(vfd->name),
1316 "vivid-%03d-vid-out", inst);
1317 vfd->vfl_dir = VFL_DIR_TX;1317 vfd->vfl_dir = VFL_DIR_TX;
1318 vfd->fops = &vivid_fops;1318 vfd->fops = &vivid_fops;
1319 vfd->ioctl_ops = &vivid_ioctl_ops;1319 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
1590 switch (divsel) {1590 switch (divsel) {
1591 case PRCM_DSI_PLLOUT_SEL_PHI_4:1591 case PRCM_DSI_PLLOUT_SEL_PHI_4:
1592 div *= 2;1592 div *= 2;
1593 /* Fall through */
1593 case PRCM_DSI_PLLOUT_SEL_PHI_2:1594 case PRCM_DSI_PLLOUT_SEL_PHI_2:
1594 div *= 2;1595 div *= 2;
1596 /* Fall through */
1595 case PRCM_DSI_PLLOUT_SEL_PHI:1597 case PRCM_DSI_PLLOUT_SEL_PHI:
1596 return pll_rate(PRCM_PLLDSI_FREQ, clock_rate(PRCMU_HDMICLK),1598 return pll_rate(PRCM_PLLDSI_FREQ, clock_rate(PRCMU_HDMICLK),
1597 PLL_RAW) / div;1599 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
308 i, r);308 i, r);
309 }309 }
310 }310 }
311 /* Fall through as HSIC mode needs utmi_clk */311 /* Fall through - as HSIC mode needs utmi_clk */
312 312
313 case OMAP_EHCI_PORT_MODE_TLL:313 case OMAP_EHCI_PORT_MODE_TLL:
314 if (!IS_ERR(omap->utmi_clk[i])) {314 if (!IS_ERR(omap->utmi_clk[i])) {
@@ -344,7 +344,7 @@ static int usbhs_runtime_suspend(struct device *dev) · 29 unmodified lines
344 344
345 if (!IS_ERR(omap->hsic480m_clk[i]))345 if (!IS_ERR(omap->hsic480m_clk[i]))
346 clk_disable_unprepare(omap->hsic480m_clk[i]);346 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 */
348 348
349 case OMAP_EHCI_PORT_MODE_TLL:349 case OMAP_EHCI_PORT_MODE_TLL:
350 if (!IS_ERR(omap->utmi_clk[i]))350 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
685 nvmem_config.name = dev_name(dev);685 nvmem_config.name = dev_name(dev);
686 nvmem_config.dev = dev;686 nvmem_config.dev = dev;
687 nvmem_config.read_only = !writable;687 nvmem_config.read_only = !writable;
688 nvmem_config.root_only = true;688 nvmem_config.root_only = !(flags & AT24_FLAG_IRUGO);
689 nvmem_config.owner = THIS_MODULE;689 nvmem_config.owner = THIS_MODULE;
690 nvmem_config.compat = true;690 nvmem_config.compat = true;
691 nvmem_config.base_dev = dev;691 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
683 683
684 rc = hl_poll_timeout_memory(hdev,684 rc = hl_poll_timeout_memory(hdev,
685 &ctx->thread_ctx_switch_wait_token, tmp, (tmp == 1),685 &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);
687 687
688 if (rc == -ETIMEDOUT) {688 if (rc == -ETIMEDOUT) {
689 dev_err(hdev->dev,689 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
24{24{
25 const struct firmware *fw;25 const struct firmware *fw;
26 const u64 *fw_data;26 const u64 *fw_data;
27 size_t fw_size, i;27 size_t fw_size;
28 int rc;28 int rc;
29 29
30 rc = request_firmware(&fw, fw_name, hdev->dev);30 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
45 45
46 fw_data = (const u64 *) fw->data;46 fw_data = (const u64 *) fw->data;
47 47
48 if ((fw->size % 8) != 0)48 memcpy_toio(dst, fw_data, fw_size);
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);
64 49
65out:50out:
66 release_firmware(fw);51 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
112 }97 }
113 98
114 rc = hl_poll_timeout_memory(hdev, &pkt->fence, tmp,99 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);
116 102
117 hl_hw_queue_inc_ci_kernel(hdev, hw_queue_id);103 hl_hw_queue_inc_ci_kernel(hdev, hw_queue_id);
118 104
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
2864 }2864 }
2865 2865
2866 rc = hl_poll_timeout_memory(hdev, fence_ptr, tmp,2866 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);
2868 2869
2869 hl_hw_queue_inc_ci_kernel(hdev, GOYA_QUEUE_ID_DMA_0);2870 hl_hw_queue_inc_ci_kernel(hdev, GOYA_QUEUE_ID_DMA_0);
2870 2871
@@ -2945,7 +2946,7 @@ int goya_test_queue(struct hl_device *hdev, u32 hw_queue_id) · 74 unmodified lines
2945 }2946 }
2946 2947
2947 rc = hl_poll_timeout_memory(hdev, fence_ptr, tmp, (tmp == fence_val),2948 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);
2949 2950
2950 hl_hw_queue_inc_ci_kernel(hdev, hw_queue_id);2951 hl_hw_queue_inc_ci_kernel(hdev, hw_queue_id);
2951 2952
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
1062/*1062/*
1063 * address in this macro points always to a memory location in the1063 * address in this macro points always to a memory location in the
1064 * host's (server's) memory. That location is updated asynchronously1064 * host's (server's) memory. That location is updated asynchronously
1065 * either by the direct access of the device or by another core1065 * 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.
1066 */1073 */
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) \
1068({ \1076({ \
1069 ktime_t __timeout; \1077 ktime_t __timeout; \
1070 /* timeout should be longer when working with simulator */ \1078 /* 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
1077 /* Verify we read updates done by other cores or by device */ \1085 /* Verify we read updates done by other cores or by device */ \
1078 mb(); \1086 mb(); \
1079 (val) = *((u32 *) (uintptr_t) (addr)); \1087 (val) = *((u32 *) (uintptr_t) (addr)); \
1088 if (mem_written_by_device) \
1089 (val) = le32_to_cpu(val); \
1080 if (cond) \1090 if (cond) \
1081 break; \1091 break; \
1082 if (timeout_us && ktime_compare(ktime_get(), __timeout) > 0) { \1092 if (timeout_us && ktime_compare(ktime_get(), __timeout) > 0) { \
1083 (val) = *((u32 *) (uintptr_t) (addr)); \1093 (val) = *((u32 *) (uintptr_t) (addr)); \
1094 if (mem_written_by_device) \
1095 (val) = le32_to_cpu(val); \
1084 break; \1096 break; \
1085 } \1097 } \
1086 if (sleep_us) \1098 if (sleep_us) \
drivers/mmc/core/queue.c+5−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
10#include <linux/kthread.h>10#include <linux/kthread.h>
11#include <linux/scatterlist.h>11#include <linux/scatterlist.h>
12#include <linux/dma-mapping.h>12#include <linux/dma-mapping.h>
13#include <linux/backing-dev.h>
13 14
14#include <linux/mmc/card.h>15#include <linux/mmc/card.h>
15#include <linux/mmc/host.h>16#include <linux/mmc/host.h>
@@ -427,6 +428,10 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card) · 411 unmodified lines
427 goto free_tag_set;428 goto free_tag_set;
428 }429 }
429 430
431 if (mmc_host_is_spi(host) && host->use_spi_crc)
432 mq->queue->backing_dev_info->capabilities |=
433 BDI_CAP_STABLE_WRITES;
434
430 mq->queue->queuedata = mq;435 mq->queue->queuedata = mq;
431 blk_queue_rq_timeout(mq->queue, 60 * HZ);436 blk_queue_rq_timeout(mq->queue, 60 * HZ);
432 437
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
374{374{
375 data->bytes_xfered = data->blocks * data->blksz;375 data->bytes_xfered = data->blocks * data->blksz;
376 data->error = 0;376 data->error = 0;
377 dma_unmap_sg(host->dev, data->sg, data->sg_len, get_dma_dir(data));
377 return 1;378 return 1;
378}379}
379 380
@@ -1046,7 +1047,8 @@ int cvm_mmc_of_slot_probe(struct device *dev, struct cvm_mmc_host *host) · 666 unmodified lines
1046 mmc->max_segs = 1;1047 mmc->max_segs = 1;
1047 1048
1048 /* DMA size field can address up to 8 MB */1049 /* 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));
1050 mmc->max_req_size = mmc->max_seg_size;1052 mmc->max_req_size = mmc->max_seg_size;
1051 /* External DMA is in 512 byte blocks */1053 /* External DMA is in 512 byte blocks */
1052 mmc->max_blk_size = 512;1054 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
2012 * delayed. Allowing the transfer to take place2012 * delayed. Allowing the transfer to take place
2013 * avoids races and keeps things simple.2013 * avoids races and keeps things simple.
2014 */2014 */
2015 if ((err != -ETIMEDOUT) &&2015 if (err != -ETIMEDOUT) {
2016 (cmd->opcode == MMC_SEND_TUNING_BLOCK)) {
2017 state = STATE_SENDING_DATA;2016 state = STATE_SENDING_DATA;
2018 continue;2017 continue;
2019 }2018 }
drivers/mmc/host/meson-mx-sdio.c+1−1
@@ -73,7 +73,7 @@ · 72 unmodified lines
73 #define MESON_MX_SDIO_IRQC_IF_CONFIG_MASK GENMASK(7, 6)73 #define MESON_MX_SDIO_IRQC_IF_CONFIG_MASK GENMASK(7, 6)
74 #define MESON_MX_SDIO_IRQC_FORCE_DATA_CLK BIT(8)74 #define MESON_MX_SDIO_IRQC_FORCE_DATA_CLK BIT(8)
75 #define MESON_MX_SDIO_IRQC_FORCE_DATA_CMD BIT(9)75 #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)
77 #define MESON_MX_SDIO_IRQC_SOFT_RESET BIT(15)77 #define MESON_MX_SDIO_IRQC_SOFT_RESET BIT(15)
78 #define MESON_MX_SDIO_IRQC_FORCE_HALT BIT(30)78 #define MESON_MX_SDIO_IRQC_FORCE_HALT BIT(30)
79 #define MESON_MX_SDIO_IRQC_HALT_HOLE BIT(31)79 #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
883 883
884 sdhci_acpi_byt_setting(&c->pdev->dev);884 sdhci_acpi_byt_setting(&c->pdev->dev);
885 885
886 return sdhci_runtime_resume_host(c->host);886 return sdhci_runtime_resume_host(c->host, 0);
887}887}
888 888
889#endif889#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
1705 esdhc_pltfm_set_clock(host, imx_data->actual_clock);1705 esdhc_pltfm_set_clock(host, imx_data->actual_clock);
1706 }1706 }
1707 1707
1708 err = sdhci_runtime_resume_host(host);1708 err = sdhci_runtime_resume_host(host, 0);
1709 if (err)1709 if (err)
1710 goto disable_ipg_clk;1710 goto disable_ipg_clk;
1711 1711
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
289 }289 }
290 290
291out:291out:
292 return sdhci_runtime_resume_host(host);292 return sdhci_runtime_resume_host(host, 0);
293}293}
294#endif /* CONFIG_PM */294#endif /* CONFIG_PM */
295 295
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
167 167
168err_pci_runtime_suspend:168err_pci_runtime_suspend:
169 while (--i >= 0)169 while (--i >= 0)
170 sdhci_runtime_resume_host(chip->slots[i]->host);170 sdhci_runtime_resume_host(chip->slots[i]->host, 0);
171 return ret;171 return ret;
172}172}
173 173
@@ -181,7 +181,7 @@ static int sdhci_pci_runtime_resume_host(struct sdhci_pci_chip *chip) · 7 unmodified lines
181 if (!slot)181 if (!slot)
182 continue;182 continue;
183 183
184 ret = sdhci_runtime_resume_host(slot->host);184 ret = sdhci_runtime_resume_host(slot->host, 0);
185 if (ret)185 if (ret)
186 return ret;186 return ret;
187 }187 }
drivers/mmc/host/sdhci-pxav3.c+1−1
@@ -554,7 +554,7 @@ static int sdhci_pxav3_runtime_resume(struct device *dev) · 553 unmodified lines
554 if (!IS_ERR(pxa->clk_core))554 if (!IS_ERR(pxa->clk_core))
555 clk_prepare_enable(pxa->clk_core);555 clk_prepare_enable(pxa->clk_core);
556 556
557 return sdhci_runtime_resume_host(host);557 return sdhci_runtime_resume_host(host, 0);
558}558}
559#endif559#endif
560 560
drivers/mmc/host/sdhci-s3c.c+1−1
@@ -745,7 +745,7 @@ static int sdhci_s3c_runtime_resume(struct device *dev) · 744 unmodified lines
745 clk_prepare_enable(busclk);745 clk_prepare_enable(busclk);
746 if (ourhost->cur_clk >= 0)746 if (ourhost->cur_clk >= 0)
747 clk_prepare_enable(ourhost->clk_bus[ourhost->cur_clk]);747 clk_prepare_enable(ourhost->clk_bus[ourhost->cur_clk]);
748 ret = sdhci_runtime_resume_host(host);748 ret = sdhci_runtime_resume_host(host, 0);
749 return ret;749 return ret;
750}750}
751#endif751#endif
drivers/mmc/host/sdhci-sprd.c+2−1
@@ -624,6 +624,7 @@ err_cleanup_host: · 623 unmodified lines
624 sdhci_cleanup_host(host);624 sdhci_cleanup_host(host);
625 625
626pm_runtime_disable:626pm_runtime_disable:
627 pm_runtime_put_noidle(&pdev->dev);
627 pm_runtime_disable(&pdev->dev);628 pm_runtime_disable(&pdev->dev);
628 pm_runtime_set_suspended(&pdev->dev);629 pm_runtime_set_suspended(&pdev->dev);
629 630
@@ -695,7 +696,7 @@ static int sdhci_sprd_runtime_resume(struct device *dev) · 65 unmodified lines
695 if (ret)696 if (ret)
696 goto clk_disable;697 goto clk_disable;
697 698
698 sdhci_runtime_resume_host(host);699 sdhci_runtime_resume_host(host, 1);
699 return 0;700 return 0;
700 701
701clk_disable:702clk_disable:
drivers/mmc/host/sdhci-xenon.c+1−1
@@ -638,7 +638,7 @@ static int xenon_runtime_resume(struct device *dev) · 637 unmodified lines
638 priv->restore_needed = false;638 priv->restore_needed = false;
639 }639 }
640 640
641 ret = sdhci_runtime_resume_host(host);641 ret = sdhci_runtime_resume_host(host, 0);
642 if (ret)642 if (ret)
643 goto out;643 goto out;
644 return 0;644 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
3320}3320}
3321EXPORT_SYMBOL_GPL(sdhci_runtime_suspend_host);3321EXPORT_SYMBOL_GPL(sdhci_runtime_suspend_host);
3322 3322
3323int sdhci_runtime_resume_host(struct sdhci_host *host)3323int sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset)
3324{3324{
3325 struct mmc_host *mmc = host->mmc;3325 struct mmc_host *mmc = host->mmc;
3326 unsigned long flags;3326 unsigned long flags;
@@ -3331,7 +3331,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host) · 4 unmodified lines
3331 host->ops->enable_dma(host);3331 host->ops->enable_dma(host);
3332 }3332 }
3333 3333
3334 sdhci_init(host, 0);3334 sdhci_init(host, soft_reset);
3335 3335
3336 if (mmc->ios.power_mode != MMC_POWER_UNDEFINED &&3336 if (mmc->ios.power_mode != MMC_POWER_UNDEFINED &&
3337 mmc->ios.power_mode != MMC_POWER_OFF) {3337 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
781int sdhci_suspend_host(struct sdhci_host *host);781int sdhci_suspend_host(struct sdhci_host *host);
782int sdhci_resume_host(struct sdhci_host *host);782int sdhci_resume_host(struct sdhci_host *host);
783int sdhci_runtime_suspend_host(struct sdhci_host *host);783int sdhci_runtime_suspend_host(struct sdhci_host *host);
784int sdhci_runtime_resume_host(struct sdhci_host *host);784int sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset);
785#endif785#endif
786 786
787void sdhci_cqe_enable(struct mmc_host *mmc);787void sdhci_cqe_enable(struct mmc_host *mmc);
drivers/mtd/hyperbus/Kconfig+2−1
@@ -14,8 +14,9 @@ if MTD_HYPERBUS · 13 unmodified lines
14 14
15config HBMC_AM65415config HBMC_AM654
16 tristate "HyperBus controller driver for AM65x SoC"16 tristate "HyperBus controller driver for AM65x SoC"
17 depends on ARM64 || COMPILE_TEST
17 select MULTIPLEXER18 select MULTIPLEXER
18 select MUX_MMIO19 imply MUX_MMIO
19 help20 help
20 This is the driver for HyperBus controller on TI's AM65x and21 This is the driver for HyperBus controller on TI's AM65x and
21 other SoCs22 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
390 (chip->id.data[4] & MICRON_ID_INTERNAL_ECC_MASK) != 0x2)390 (chip->id.data[4] & MICRON_ID_INTERNAL_ECC_MASK) != 0x2)
391 return MICRON_ON_DIE_UNSUPPORTED;391 return MICRON_ON_DIE_UNSUPPORTED;
392 392
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 */
393 ret = micron_nand_on_die_ecc_setup(chip, true);401 ret = micron_nand_on_die_ecc_setup(chip, true);
394 if (ret)402 if (ret)
395 return MICRON_ON_DIE_UNSUPPORTED;403 return MICRON_ON_DIE_UNSUPPORTED;
@@ -398,13 +406,13 @@ static int micron_supports_on_die_ecc(struct nand_chip *chip) · 2 unmodified lines
398 if (ret)406 if (ret)
399 return MICRON_ON_DIE_UNSUPPORTED;407 return MICRON_ON_DIE_UNSUPPORTED;
400 408
401 if (!(id[4] & MICRON_ID_ECC_ENABLED))
402 return MICRON_ON_DIE_UNSUPPORTED;
403
404 ret = micron_nand_on_die_ecc_setup(chip, false);409 ret = micron_nand_on_die_ecc_setup(chip, false);
405 if (ret)410 if (ret)
406 return MICRON_ON_DIE_UNSUPPORTED;411 return MICRON_ON_DIE_UNSUPPORTED;
407 412
413 if (!(id[4] & MICRON_ID_ECC_ENABLED))
414 return MICRON_ON_DIE_UNSUPPORTED;
415
408 ret = nand_readid_op(chip, 0, id, sizeof(id));416 ret = nand_readid_op(chip, 0, id, sizeof(id));
409 if (ret)417 if (ret)
410 return MICRON_ON_DIE_UNSUPPORTED;418 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
363 switch (ints[0]) {363 switch (ints[0]) {
364 default: /* ERROR */364 default: /* ERROR */
365 pr_err("Too many arguments\n");365 pr_err("Too many arguments\n");
366 /* Fall through */
366 case 3: /* Node ID */367 case 3: /* Node ID */
367 node = ints[3];368 node = ints[3];
369 /* Fall through */
368 case 2: /* IRQ */370 case 2: /* IRQ */
369 irq = ints[2];371 irq = ints[2];
372 /* Fall through */
370 case 1: /* IO address */373 case 1: /* IO address */
371 io = ints[1];374 io = ints[1];
372 }375 }
drivers/net/arcnet/com20020-isa.c+6−0
@@ -197,16 +197,22 @@ static int __init com20020isa_setup(char *s) · 196 unmodified lines
197 switch (ints[0]) {197 switch (ints[0]) {
198 default: /* ERROR */198 default: /* ERROR */
199 pr_info("Too many arguments\n");199 pr_info("Too many arguments\n");
200 /* Fall through */
200 case 6: /* Timeout */201 case 6: /* Timeout */
201 timeout = ints[6];202 timeout = ints[6];
203 /* Fall through */
202 case 5: /* CKP value */204 case 5: /* CKP value */
203 clockp = ints[5];205 clockp = ints[5];
206 /* Fall through */
204 case 4: /* Backplane flag */207 case 4: /* Backplane flag */
205 backplane = ints[4];208 backplane = ints[4];
209 /* Fall through */
206 case 3: /* Node ID */210 case 3: /* Node ID */
207 node = ints[3];211 node = ints[3];
212 /* Fall through */
208 case 2: /* IRQ */213 case 2: /* IRQ */
209 irq = ints[2];214 irq = ints[2];
215 /* Fall through */
210 case 1: /* IO address */216 case 1: /* IO address */
211 io = ints[1];217 io = ints[1];
212 }218 }
drivers/net/arcnet/com90io.c+2−0
@@ -363,8 +363,10 @@ static int __init com90io_setup(char *s) · 362 unmodified lines
363 switch (ints[0]) {363 switch (ints[0]) {
364 default: /* ERROR */364 default: /* ERROR */
365 pr_err("Too many arguments\n");365 pr_err("Too many arguments\n");
366 /* Fall through */
366 case 2: /* IRQ */367 case 2: /* IRQ */
367 irq = ints[2];368 irq = ints[2];
369 /* Fall through */
368 case 1: /* IO address */370 case 1: /* IO address */
369 io = ints[1];371 io = ints[1];
370 }372 }
drivers/net/arcnet/com90xx.c+3−0
@@ -693,10 +693,13 @@ static int __init com90xx_setup(char *s) · 692 unmodified lines
693 switch (ints[0]) {693 switch (ints[0]) {
694 default: /* ERROR */694 default: /* ERROR */
695 pr_err("Too many arguments\n");695 pr_err("Too many arguments\n");
696 /* Fall through */
696 case 3: /* Mem address */697 case 3: /* Mem address */
697 shmem = ints[3];698 shmem = ints[3];
699 /* Fall through */
698 case 2: /* IRQ */700 case 2: /* IRQ */
699 irq = ints[2];701 irq = ints[2];
702 /* Fall through */
700 case 1: /* IO address */703 case 1: /* IO address */
701 io = ints[1];704 io = ints[1];
702 }705 }
drivers/net/bonding/bond_main.c+9−0
@@ -2196,6 +2196,15 @@ static void bond_miimon_commit(struct bonding *bond) · 2195 unmodified lines
2196 bond_for_each_slave(bond, slave, iter) {2196 bond_for_each_slave(bond, slave, iter) {
2197 switch (slave->new_link) {2197 switch (slave->new_link) {
2198 case BOND_LINK_NOCHANGE:2198 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);
2199 continue;2208 continue;
2200 2209
2201 case BOND_LINK_UP:2210 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
1249 return -EINVAL;1249 return -EINVAL;
1250 1250
1251 dev->rtnl_link_ops = &can_link_ops;1251 dev->rtnl_link_ops = &can_link_ops;
1252 netif_carrier_off(dev);
1253
1252 return register_netdev(dev);1254 return register_netdev(dev);
1253}1255}
1254EXPORT_SYMBOL_GPL(register_candev);1256EXPORT_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
400 priv->write(reg_mcr, &regs->mcr);400 priv->write(reg_mcr, &regs->mcr);
401}401}
402 402
403static inline void flexcan_enter_stop_mode(struct flexcan_priv *priv)403static inline int flexcan_enter_stop_mode(struct flexcan_priv *priv)
404{404{
405 struct flexcan_regs __iomem *regs = priv->regs;405 struct flexcan_regs __iomem *regs = priv->regs;
406 unsigned int ackval;
406 u32 reg_mcr;407 u32 reg_mcr;
407 408
408 reg_mcr = priv->read(&regs->mcr);409 reg_mcr = priv->read(&regs->mcr);
@@ -412,20 +413,37 @@ static inline void flexcan_enter_stop_mode(struct flexcan_priv *priv) · 3 unmodified lines
412 /* enable stop request */413 /* enable stop request */
413 regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,414 regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
414 1 << priv->stm.req_bit, 1 << priv->stm.req_bit);415 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;
415}424}
416 425
417static inline void flexcan_exit_stop_mode(struct flexcan_priv *priv)426static inline int flexcan_exit_stop_mode(struct flexcan_priv *priv)
418{427{
419 struct flexcan_regs __iomem *regs = priv->regs;428 struct flexcan_regs __iomem *regs = priv->regs;
429 unsigned int ackval;
420 u32 reg_mcr;430 u32 reg_mcr;
421 431
422 /* remove stop request */432 /* remove stop request */
423 regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,433 regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
424 1 << priv->stm.req_bit, 0);434 1 << priv->stm.req_bit, 0);
425 435
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
426 reg_mcr = priv->read(&regs->mcr);442 reg_mcr = priv->read(&regs->mcr);
427 reg_mcr &= ~FLEXCAN_MCR_SLF_WAK;443 reg_mcr &= ~FLEXCAN_MCR_SLF_WAK;
428 priv->write(reg_mcr, &regs->mcr);444 priv->write(reg_mcr, &regs->mcr);
445
446 return 0;
429}447}
430 448
431static inline void flexcan_error_irq_enable(const struct flexcan_priv *priv)449static 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
1437 1455
1438 priv = netdev_priv(dev);1456 priv = netdev_priv(dev);
1439 priv->stm.gpr = syscon_node_to_regmap(gpr_np);1457 priv->stm.gpr = syscon_node_to_regmap(gpr_np);
1440 of_node_put(gpr_np);
1441 if (IS_ERR(priv->stm.gpr)) {1458 if (IS_ERR(priv->stm.gpr)) {
1442 dev_dbg(&pdev->dev, "could not find gpr regmap\n");1459 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;
1444 }1462 }
1445 1463
1446 priv->stm.req_gpr = out_val[1];1464 priv->stm.req_gpr = out_val[1];
@@ -1455,7 +1473,9 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev) · 8 unmodified lines
1455 1473
1456 device_set_wakeup_capable(&pdev->dev, true);1474 device_set_wakeup_capable(&pdev->dev, true);
1457 1475
1458 return 0;1476out_put_node:
1477 of_node_put(gpr_np);
1478 return ret;
1459}1479}
1460 1480
1461static const struct of_device_id flexcan_of_match[] = {1481static const struct of_device_id flexcan_of_match[] = {
@@ -1612,7 +1632,9 @@ static int __maybe_unused flexcan_suspend(struct device *device) · 150 unmodified lines
1612 */1632 */
1613 if (device_may_wakeup(device)) {1633 if (device_may_wakeup(device)) {
1614 enable_irq_wake(dev->irq);1634 enable_irq_wake(dev->irq);
1615 flexcan_enter_stop_mode(priv);1635 err = flexcan_enter_stop_mode(priv);
1636 if (err)
1637 return err;
1616 } else {1638 } else {
1617 err = flexcan_chip_disable(priv);1639 err = flexcan_chip_disable(priv);
1618 if (err)1640 if (err)
@@ -1662,10 +1684,13 @@ static int __maybe_unused flexcan_noirq_resume(struct device *device) · 43 unmodified lines
1662{1684{
1663 struct net_device *dev = dev_get_drvdata(device);1685 struct net_device *dev = dev_get_drvdata(device);
1664 struct flexcan_priv *priv = netdev_priv(dev);1686 struct flexcan_priv *priv = netdev_priv(dev);
1687 int err;
1665 1688
1666 if (netif_running(dev) && device_may_wakeup(device)) {1689 if (netif_running(dev) && device_may_wakeup(device)) {
1667 flexcan_enable_wakeup_irq(priv, false);1690 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;
1669 }1694 }
1670 1695
1671 return 0;1696 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
1508 1508
1509 /* All packets processed */1509 /* All packets processed */
1510 if (num_pkts < quota) {1510 if (num_pkts < quota) {
1511 napi_complete_done(napi, num_pkts);1511 if (napi_complete_done(napi, num_pkts)) {
1512 /* Enable Rx FIFO interrupts */1512 /* Enable Rx FIFO interrupts */
1513 rcar_canfd_set_bit(priv->base, RCANFD_RFCC(ridx),1513 rcar_canfd_set_bit(priv->base, RCANFD_RFCC(ridx),
1514 RCANFD_RFCC_RFIE);1514 RCANFD_RFCC_RFIE);
1515 }
1515 }1516 }
1516 return num_pkts;1517 return num_pkts;
1517}1518}
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
479 if (!netdev)479 if (!netdev)
480 continue;480 continue;
481 481
482 strncpy(name, netdev->name, IFNAMSIZ);482 strlcpy(name, netdev->name, IFNAMSIZ);
483 483
484 unregister_sja1000dev(netdev);484 unregister_sja1000dev(netdev);
485 485
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
664 return regulator_disable(reg);664 return regulator_disable(reg);
665}665}
666 666
667static 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
678static int mcp251x_stop(struct net_device *net)667static int mcp251x_stop(struct net_device *net)
679{668{
680 struct mcp251x_priv *priv = netdev_priv(net);669 struct mcp251x_priv *priv = netdev_priv(net);
@@ -941,37 +930,43 @@ static int mcp251x_open(struct net_device *net) · 260 unmodified lines
941 flags | IRQF_ONESHOT, DEVICE_NAME, priv);930 flags | IRQF_ONESHOT, DEVICE_NAME, priv);
942 if (ret) {931 if (ret) {
943 dev_err(&spi->dev, "failed to acquire irq %d\n", spi->irq);932 dev_err(&spi->dev, "failed to acquire irq %d\n", spi->irq);
944 mcp251x_power_enable(priv->transceiver, 0);933 goto out_close;
945 close_candev(net);
946 goto open_unlock;
947 }934 }
948 935
949 priv->wq = alloc_workqueue("mcp251x_wq", WQ_FREEZABLE | WQ_MEM_RECLAIM,936 priv->wq = alloc_workqueue("mcp251x_wq", WQ_FREEZABLE | WQ_MEM_RECLAIM,
950 0);937 0);
938 if (!priv->wq) {
939 ret = -ENOMEM;
940 goto out_clean;
941 }
951 INIT_WORK(&priv->tx_work, mcp251x_tx_work_handler);942 INIT_WORK(&priv->tx_work, mcp251x_tx_work_handler);
952 INIT_WORK(&priv->restart_work, mcp251x_restart_work_handler);943 INIT_WORK(&priv->restart_work, mcp251x_restart_work_handler);
953 944
954 ret = mcp251x_hw_reset(spi);945 ret = mcp251x_hw_reset(spi);
955 if (ret) {946 if (ret)
956 mcp251x_open_clean(net);947 goto out_free_wq;
957 goto open_unlock;
958 }
959 ret = mcp251x_setup(net, spi);948 ret = mcp251x_setup(net, spi);
960 if (ret) {949 if (ret)
961 mcp251x_open_clean(net);950 goto out_free_wq;
962 goto open_unlock;
963 }
964 ret = mcp251x_set_normal_mode(spi);951 ret = mcp251x_set_normal_mode(spi);
965 if (ret) {952 if (ret)
966 mcp251x_open_clean(net);953 goto out_free_wq;
967 goto open_unlock;
968 }
969 954
970 can_led_event(net, CAN_LED_EVENT_OPEN);955 can_led_event(net, CAN_LED_EVENT_OPEN);
971 956
972 netif_wake_queue(net);957 netif_wake_queue(net);
958 mutex_unlock(&priv->mcp_lock);
973 959
974open_unlock:960 return 0;
961
962out_free_wq:
963 destroy_workqueue(priv->wq);
964out_clean:
965 free_irq(spi->irq, priv);
966 mcp251x_hw_sleep(spi);
967out_close:
968 mcp251x_power_enable(priv->transceiver, 0);
969 close_candev(net);
975 mutex_unlock(&priv->mcp_lock);970 mutex_unlock(&priv->mcp_lock);
976 return ret;971 return ret;
977}972}
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
568 dev->state &= ~PCAN_USB_STATE_STARTED;568 dev->state &= ~PCAN_USB_STATE_STARTED;
569 netif_stop_queue(netdev);569 netif_stop_queue(netdev);
570 570
571 close_candev(netdev);
572
573 dev->can.state = CAN_STATE_STOPPED;
574
571 /* unlink all pending urbs and free used memory */575 /* unlink all pending urbs and free used memory */
572 peak_usb_unlink_all_urbs(dev);576 peak_usb_unlink_all_urbs(dev);
573 577
574 if (dev->adapter->dev_stop)578 if (dev->adapter->dev_stop)
575 dev->adapter->dev_stop(dev);579 dev->adapter->dev_stop(dev);
576 580
577 close_candev(netdev);
578
579 dev->can.state = CAN_STATE_STOPPED;
580
581 /* can set bus off now */581 /* can set bus off now */
582 if (dev->adapter->dev_set_bus) {582 if (dev->adapter->dev_set_bus) {
583 int err = dev->adapter->dev_set_bus(dev, 0);583 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
855 855
856 dev_prev_siblings = dev->prev_siblings;856 dev_prev_siblings = dev->prev_siblings;
857 dev->state &= ~PCAN_USB_STATE_CONNECTED;857 dev->state &= ~PCAN_USB_STATE_CONNECTED;
858 strncpy(name, netdev->name, IFNAMSIZ);858 strlcpy(name, netdev->name, IFNAMSIZ);
859 859
860 unregister_netdev(netdev);860 unregister_netdev(netdev);
861 861
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
841 goto err_out;841 goto err_out;
842 842
843 /* allocate command buffer once for all for the interface */843 /* 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,
845 GFP_KERNEL);845 GFP_KERNEL);
846 if (!pdev->cmd_buffer_addr)846 if (!pdev->cmd_buffer_addr)
847 goto err_out_1;847 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
494 u8 *buffer;494 u8 *buffer;
495 int err;495 int err;
496 496
497 buffer = kmalloc(PCAN_USBPRO_FCT_DRVLD_REQ_LEN, GFP_KERNEL);497 buffer = kzalloc(PCAN_USBPRO_FCT_DRVLD_REQ_LEN, GFP_KERNEL);
498 if (!buffer)498 if (!buffer)
499 return -ENOMEM;499 return -ENOMEM;
500 500
drivers/net/dsa/mv88e6xxx/chip.c+2−27
@@ -27,7 +27,6 @@ · 26 unmodified lines
27#include <linux/platform_data/mv88e6xxx.h>27#include <linux/platform_data/mv88e6xxx.h>
28#include <linux/netdevice.h>28#include <linux/netdevice.h>
29#include <linux/gpio/consumer.h>29#include <linux/gpio/consumer.h>
30#include <linux/phy.h>
31#include <linux/phylink.h>30#include <linux/phylink.h>
32#include <net/dsa.h>31#include <net/dsa.h>
33 32
@@ -430,7 +429,7 @@ int mv88e6xxx_port_setup_mac(struct mv88e6xxx_chip *chip, int port, int link, · 396 unmodified lines
430 return 0;429 return 0;
431 430
432 /* Port's MAC control must not be changed unless the link is down */431 /* 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);
434 if (err)433 if (err)
435 return err;434 return err;
436 435
@@ -482,30 +481,6 @@ static int mv88e6xxx_phy_is_internal(struct dsa_switch *ds, int port) · 45 unmodified lines
482 return port < chip->info->num_internal_phys;481 return port < chip->info->num_internal_phys;
483}482}
484 483
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 */
489static 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
509static void mv88e6065_phylink_validate(struct mv88e6xxx_chip *chip, int port,484static void mv88e6065_phylink_validate(struct mv88e6xxx_chip *chip, int port,
510 unsigned long *mask,485 unsigned long *mask,
511 struct phylink_link_state *state)486 struct phylink_link_state *state)
@@ -2721,6 +2696,7 @@ static int mv88e6xxx_mdios_register(struct mv88e6xxx_chip *chip, · 2209 unmodified lines
2721 err = mv88e6xxx_mdio_register(chip, child, true);2696 err = mv88e6xxx_mdio_register(chip, child, true);
2722 if (err) {2697 if (err) {
2723 mv88e6xxx_mdios_unregister(chip);2698 mv88e6xxx_mdios_unregister(chip);
2699 of_node_put(child);
2724 return err;2700 return err;
2725 }2701 }
2726 }2702 }
@@ -4638,7 +4614,6 @@ static int mv88e6xxx_port_egress_floods(struct dsa_switch *ds, int port, · 1911 unmodified lines
4638static const struct dsa_switch_ops mv88e6xxx_switch_ops = {4614static const struct dsa_switch_ops mv88e6xxx_switch_ops = {
4639 .get_tag_protocol = mv88e6xxx_get_tag_protocol,4615 .get_tag_protocol = mv88e6xxx_get_tag_protocol,
4640 .setup = mv88e6xxx_setup,4616 .setup = mv88e6xxx_setup,
4641 .adjust_link = mv88e6xxx_adjust_link,
4642 .phylink_validate = mv88e6xxx_validate,4617 .phylink_validate = mv88e6xxx_validate,
4643 .phylink_mac_link_state = mv88e6xxx_link_state,4618 .phylink_mac_link_state = mv88e6xxx_link_state,
4644 .phylink_mac_config = mv88e6xxx_mac_config,4619 .phylink_mac_config = mv88e6xxx_mac_config,
drivers/net/dsa/qca8k.c+8−2
@@ -2,7 +2,7 @@ · 1 unmodified line
2/*2/*
3 * Copyright (C) 2009 Felix Fietkau <nbd@nbd.name>3 * Copyright (C) 2009 Felix Fietkau <nbd@nbd.name>
4 * Copyright (C) 2011-2012 Gabor Juhos <juhosg@openwrt.org>4 * 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.
6 * Copyright (c) 2016 John Crispin <john@phrozen.org>6 * Copyright (c) 2016 John Crispin <john@phrozen.org>
7 */7 */
8 8
@@ -583,8 +583,11 @@ qca8k_setup_mdio_bus(struct qca8k_priv *priv) · 574 unmodified lines
583 583
584 for_each_available_child_of_node(ports, port) {584 for_each_available_child_of_node(ports, port) {
585 err = of_property_read_u32(port, "reg", &reg);585 err = of_property_read_u32(port, "reg", &reg);
586 if (err)586 if (err) {
587 of_node_put(port);
588 of_node_put(ports);
587 return err;589 return err;
590 }
588 591
589 if (!dsa_is_user_port(priv->ds, reg))592 if (!dsa_is_user_port(priv->ds, reg))
590 continue;593 continue;
@@ -595,6 +598,7 @@ qca8k_setup_mdio_bus(struct qca8k_priv *priv) · 4 unmodified lines
595 internal_mdio_mask |= BIT(reg);598 internal_mdio_mask |= BIT(reg);
596 }599 }
597 600
601 of_node_put(ports);
598 if (!external_mdio_mask && !internal_mdio_mask) {602 if (!external_mdio_mask && !internal_mdio_mask) {
599 dev_err(priv->dev, "no PHYs are defined.\n");603 dev_err(priv->dev, "no PHYs are defined.\n");
600 return -EINVAL;604 return -EINVAL;
@@ -935,6 +939,8 @@ qca8k_port_enable(struct dsa_switch *ds, int port, · 334 unmodified lines
935 qca8k_port_set_status(priv, port, 1);939 qca8k_port_set_status(priv, port, 1);
936 priv->port_sts[port].enabled = 1;940 priv->port_sts[port].enabled = 1;
937 941
942 phy_support_asym_pause(phy);
943
938 return 0;944 return 0;
939}945}
940 946
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
277 SJA1105ET_SIZE_L2_LOOKUP_ENTRY, op);277 SJA1105ET_SIZE_L2_LOOKUP_ENTRY, op);
278}278}
279 279
280static 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
280static void292static void
281sja1105et_mgmt_route_cmd_packing(void *buf, struct sja1105_dyn_cmd *cmd,293sja1105et_mgmt_route_cmd_packing(void *buf, struct sja1105_dyn_cmd *cmd,
282 enum packing_op op)294 enum packing_op op)
@@ -477,7 +489,7 @@ sja1105et_general_params_entry_packing(void *buf, void *entry_ptr, · 194 unmodified lines
477/* SJA1105E/T: First generation */489/* SJA1105E/T: First generation */
478struct sja1105_dynamic_table_ops sja1105et_dyn_ops[BLK_IDX_MAX_DYN] = {490struct sja1105_dynamic_table_ops sja1105et_dyn_ops[BLK_IDX_MAX_DYN] = {
479 [BLK_IDX_L2_LOOKUP] = {491 [BLK_IDX_L2_LOOKUP] = {
480 .entry_packing = sja1105et_l2_lookup_entry_packing,492 .entry_packing = sja1105et_dyn_l2_lookup_entry_packing,
481 .cmd_packing = sja1105et_l2_lookup_cmd_packing,493 .cmd_packing = sja1105et_l2_lookup_cmd_packing,
482 .access = (OP_READ | OP_WRITE | OP_DEL),494 .access = (OP_READ | OP_WRITE | OP_DEL),
483 .max_entry_count = SJA1105_MAX_L2_LOOKUP_COUNT,495 .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
218 /* This selects between Independent VLAN Learning (IVL) and218 /* This selects between Independent VLAN Learning (IVL) and
219 * Shared VLAN Learning (SVL)219 * Shared VLAN Learning (SVL)
220 */220 */
221 .shared_learn = false,221 .shared_learn = true,
222 /* Don't discard management traffic based on ENFPORT -222 /* Don't discard management traffic based on ENFPORT -
223 * we don't perform SMAC port enforcement anyway, so223 * we don't perform SMAC port enforcement anyway, so
224 * what we are setting here doesn't matter.224 * 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
625 if (of_property_read_u32(child, "reg", &index) < 0) {625 if (of_property_read_u32(child, "reg", &index) < 0) {
626 dev_err(dev, "Port number not defined in device tree "626 dev_err(dev, "Port number not defined in device tree "
627 "(property \"reg\")\n");627 "(property \"reg\")\n");
628 of_node_put(child);
628 return -ENODEV;629 return -ENODEV;
629 }630 }
630 631
@@ -634,6 +635,7 @@ static int sja1105_parse_ports_node(struct sja1105_private *priv, · 3 unmodified lines
634 dev_err(dev, "Failed to read phy-mode or "635 dev_err(dev, "Failed to read phy-mode or "
635 "phy-interface-type property for port %d\n",636 "phy-interface-type property for port %d\n",
636 index);637 index);
638 of_node_put(child);
637 return -ENODEV;639 return -ENODEV;
638 }640 }
639 ports[index].phy_mode = phy_mode;641 ports[index].phy_mode = phy_mode;
@@ -643,6 +645,7 @@ static int sja1105_parse_ports_node(struct sja1105_private *priv, · 3 unmodified lines
643 if (!of_phy_is_fixed_link(child)) {645 if (!of_phy_is_fixed_link(child)) {
644 dev_err(dev, "phy-handle or fixed-link "646 dev_err(dev, "phy-handle or fixed-link "
645 "properties missing!\n");647 "properties missing!\n");
648 of_node_put(child);
646 return -ENODEV;649 return -ENODEV;
647 }650 }
648 /* phy-handle is missing, but fixed-link isn't.651 /* 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
1089 l2_lookup.vlanid = vid;1092 l2_lookup.vlanid = vid;
1090 l2_lookup.iotag = SJA1105_S_TAG;1093 l2_lookup.iotag = SJA1105_S_TAG;
1091 l2_lookup.mask_macaddr = GENMASK_ULL(ETH_ALEN * 8 - 1, 0);1094 l2_lookup.mask_macaddr = GENMASK_ULL(ETH_ALEN * 8 - 1, 0);
1092 l2_lookup.mask_vlanid = VLAN_VID_MASK;1095 if (dsa_port_is_vlan_filtering(&ds->ports[port])) {
1093 l2_lookup.mask_iotag = BIT(0);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 }
1094 l2_lookup.destports = BIT(port);1102 l2_lookup.destports = BIT(port);
1095 1103
1096 rc = sja1105_dynamic_config_read(priv, BLK_IDX_L2_LOOKUP,1104 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
1147 l2_lookup.vlanid = vid;1155 l2_lookup.vlanid = vid;
1148 l2_lookup.iotag = SJA1105_S_TAG;1156 l2_lookup.iotag = SJA1105_S_TAG;
1149 l2_lookup.mask_macaddr = GENMASK_ULL(ETH_ALEN * 8 - 1, 0);1157 l2_lookup.mask_macaddr = GENMASK_ULL(ETH_ALEN * 8 - 1, 0);
1150 l2_lookup.mask_vlanid = VLAN_VID_MASK;1158 if (dsa_port_is_vlan_filtering(&ds->ports[port])) {
1151 l2_lookup.mask_iotag = BIT(0);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 }
1152 l2_lookup.destports = BIT(port);1165 l2_lookup.destports = BIT(port);
1153 1166
1154 rc = sja1105_dynamic_config_read(priv, BLK_IDX_L2_LOOKUP,1167 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
1178 const unsigned char *addr, u16 vid)1191 const unsigned char *addr, u16 vid)
1179{1192{
1180 struct sja1105_private *priv = ds->priv;1193 struct sja1105_private *priv = ds->priv;
1181 u16 rx_vid, tx_vid;
1182 int rc, i;
1183 1194
1184 if (dsa_port_is_vlan_filtering(&ds->ports[port]))1195 /* dsa_8021q is in effect when the bridge's vlan_filtering isn't,
1185 return priv->info->fdb_add_cmd(ds, port, addr, vid);1196 * so the switch still does some VLAN processing internally.
1186 1197 * But Shared VLAN Learning (SVL) is also active, and it will take
1187 /* Since we make use of VLANs even when the bridge core doesn't tell us1198 * care of autonomous forwarding between the unique pvid's of each
1188 * to, translate these FDB entries into the correct dsa_8021q ones.1199 * port. Here we just make sure that users can't add duplicate FDB
1189 * The basic idea (also repeats for removal below) is:1200 * entries when in this mode - the actual VID doesn't matter except
1190 * - Each of the other front-panel ports needs to be able to forward a1201 * for what gets printed in 'bridge fdb show'. In the case of zero,
1191 * pvid-tagged (aka tagged with their rx_vid) frame that matches this1202 * no VID gets printed at all.
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.
1196 */1203 */
1197 for (i = 0; i < SJA1105_NUM_PORTS; i++) {1204 if (!dsa_port_is_vlan_filtering(&ds->ports[port]))
1198 if (i == port)1205 vid = 0;
1199 continue;
1200 if (i == dsa_upstream_port(priv->ds, port))
1201 continue;
1202 1206
1203 rx_vid = dsa_8021q_rx_vid(ds, i);1207 return priv->info->fdb_add_cmd(ds, port, addr, vid);
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);
1210}1208}
1211 1209
1212static int sja1105_fdb_del(struct dsa_switch *ds, int port,1210static int sja1105_fdb_del(struct dsa_switch *ds, int port,
1213 const unsigned char *addr, u16 vid)1211 const unsigned char *addr, u16 vid)
1214{1212{
1215 struct sja1105_private *priv = ds->priv;1213 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);
1221 1214
1222 for (i = 0; i < SJA1105_NUM_PORTS; i++) {1215 if (!dsa_port_is_vlan_filtering(&ds->ports[port]))
1223 if (i == port)1216 vid = 0;
1224 continue;
1225 if (i == dsa_upstream_port(priv->ds, port))
1226 continue;
1227 1217
1228 rx_vid = dsa_8021q_rx_vid(ds, i);1218 return priv->info->fdb_del_cmd(ds, port, addr, vid);
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);
1235}1219}
1236 1220
1237static int sja1105_fdb_dump(struct dsa_switch *ds, int port,1221static 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
1270 continue;1254 continue;
1271 u64_to_ether_addr(l2_lookup.macaddr, macaddr);1255 u64_to_ether_addr(l2_lookup.macaddr, macaddr);
1272 1256
1273 /* On SJA1105 E/T, the switch doesn't implement the LOCKEDS1257 /* We need to hide the dsa_8021q VLANs from the user. */
1274 * bit, so it doesn't tell us whether a FDB entry is static1258 if (!dsa_port_is_vlan_filtering(&ds->ports[port]))
1275 * or not.1259 l2_lookup.vlanid = 0;
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 }
1306 cb(macaddr, l2_lookup.vlanid, l2_lookup.lockeds, data);1260 cb(macaddr, l2_lookup.vlanid, l2_lookup.lockeds, data);
1307 }1261 }
1308 return 0;1262 return 0;
@@ -1594,6 +1548,7 @@ static int sja1105_vlan_prepare(struct dsa_switch *ds, int port, · 285 unmodified lines
1594 */1548 */
1595static int sja1105_vlan_filtering(struct dsa_switch *ds, int port, bool enabled)1549static int sja1105_vlan_filtering(struct dsa_switch *ds, int port, bool enabled)
1596{1550{
1551 struct sja1105_l2_lookup_params_entry *l2_lookup_params;
1597 struct sja1105_general_params_entry *general_params;1552 struct sja1105_general_params_entry *general_params;
1598 struct sja1105_private *priv = ds->priv;1553 struct sja1105_private *priv = ds->priv;
1599 struct sja1105_table *table;1554 struct sja1105_table *table;
@@ -1622,6 +1577,28 @@ static int sja1105_vlan_filtering(struct dsa_switch *ds, int port, bool enabled) · 22 unmodified lines
1622 general_params->incl_srcpt1 = enabled;1577 general_params->incl_srcpt1 = enabled;
1623 general_params->incl_srcpt0 = enabled;1578 general_params->incl_srcpt0 = enabled;
1624 1579
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
1625 rc = sja1105_static_config_reload(priv);1602 rc = sja1105_static_config_reload(priv);
1626 if (rc)1603 if (rc)
1627 dev_err(ds->dev, "Failed to change VLAN Ethertype\n");1604 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
1751 1728
1752 cancel_work_sync(&priv->tagger_data.rxtstamp_work);1729 cancel_work_sync(&priv->tagger_data.rxtstamp_work);
1753 skb_queue_purge(&priv->tagger_data.skb_rxtstamp_queue);1730 skb_queue_purge(&priv->tagger_data.skb_rxtstamp_queue);
1731 sja1105_ptp_clock_unregister(priv);
1732 sja1105_static_config_free(&priv->static_config);
1754}1733}
1755 1734
1756static int sja1105_mgmt_xmit(struct dsa_switch *ds, int port, int slot,1735static 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
2208{2187{
2209 struct sja1105_private *priv = spi_get_drvdata(spi);2188 struct sja1105_private *priv = spi_get_drvdata(spi);
2210 2189
2211 sja1105_ptp_clock_unregister(priv);
2212 dsa_unregister_switch(priv->ds);2190 dsa_unregister_switch(priv->ds);
2213 sja1105_static_config_free(&priv->static_config);
2214 return 0;2191 return 0;
2215}2192}
2216 2193
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
369 .mult = SJA1105_CC_MULT,369 .mult = SJA1105_CC_MULT,
370 };370 };
371 mutex_init(&priv->ptp_lock);371 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
376 priv->ptp_caps = sja1105_ptp_caps;372 priv->ptp_caps = sja1105_ptp_caps;
377 373
378 priv->clock = ptp_clock_register(&priv->ptp_caps, ds->dev);374 priv->clock = ptp_clock_register(&priv->ptp_caps, ds->dev);
379 if (IS_ERR_OR_NULL(priv->clock))375 if (IS_ERR_OR_NULL(priv->clock))
380 return PTR_ERR(priv->clock);376 return PTR_ERR(priv->clock);
381 377
378 INIT_DELAYED_WORK(&priv->refresh_work, sja1105_ptp_overflow_check);
379 schedule_delayed_work(&priv->refresh_work, SJA1105_REFRESH_INTERVAL);
380
382 return sja1105_ptp_reset(priv);381 return sja1105_ptp_reset(priv);
383}382}
384 383
drivers/net/ethernet/8390/Kconfig+2−2
@@ -12,8 +12,8 @@ config NET_VENDOR_8390 · 11 unmodified lines
12 12
13 Note that the answer to this question doesn't directly affect the13 Note that the answer to this question doesn't directly affect the
14 kernel: saying N will just cause the configurator to skip all14 kernel: saying N will just cause the configurator to skip all
15 the questions about Western Digital cards. If you say Y, you will be15 the questions about National Semiconductor 8390 cards. If you say Y,
16 asked for your specific card in the following questions.16 you will be asked for your specific card in the following questions.
17 17
18if NET_VENDOR_839018if NET_VENDOR_8390
19 19
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
2362 2362
2363 /* Allocate memory for the TCB's (Transmit Control Block) */2363 /* Allocate memory for the TCB's (Transmit Control Block) */
2364 tx_ring->tcb_ring = kcalloc(NUM_TCB, sizeof(struct tcb),2364 tx_ring->tcb_ring = kcalloc(NUM_TCB, sizeof(struct tcb),
2365 GFP_ATOMIC | GFP_DMA);2365 GFP_KERNEL | GFP_DMA);
2366 if (!tx_ring->tcb_ring)2366 if (!tx_ring->tcb_ring)
2367 return -ENOMEM;2367 return -ENOMEM;
2368 2368
drivers/net/ethernet/allwinner/sun4i-emac.c+3−1
@@ -860,7 +860,9 @@ static int emac_probe(struct platform_device *pdev) · 859 unmodified lines
860 goto out_clk_disable_unprepare;860 goto out_clk_disable_unprepare;
861 }861 }
862 862
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);
864 if (!db->phy_node) {866 if (!db->phy_node) {
865 dev_err(&pdev->dev, "no associated PHY\n");867 dev_err(&pdev->dev, "no associated PHY\n");
866 ret = -ENODEV;868 ret = -ENODEV;
drivers/net/ethernet/amd/Kconfig+1−1
@@ -14,7 +14,7 @@ config NET_VENDOR_AMD · 13 unmodified lines
14 say Y.14 say Y.
15 15
16 Note that the answer to this question does not directly affect16 Note that the answer to this question does not directly affect
17 the kernel: saying N will just case the configurator to skip all17 the kernel: saying N will just cause the configurator to skip all
18 the questions regarding AMD chipsets. If you say Y, you will be asked18 the questions regarding AMD chipsets. If you say Y, you will be asked
19 for your specific chipset/driver in the following questions.19 for your specific chipset/driver in the following questions.
20 20
drivers/net/ethernet/apple/Kconfig+2−2
@@ -11,8 +11,8 @@ config NET_VENDOR_APPLE · 10 unmodified lines
11 If you have a network (Ethernet) card belonging to this class, say Y.11 If you have a network (Ethernet) card belonging to this class, say Y.
12 12
13 Note that the answer to this question doesn't directly affect the13 Note that the answer to this question doesn't directly affect the
14 kernel: saying N will just cause the configurator to skip all14 kernel: saying N will just cause the configurator to skip all the
15 the questions about IBM devices. If you say Y, you will be asked for15 questions about Apple devices. If you say Y, you will be asked for
16 your specific card in the following questions.16 your specific card in the following questions.
17 17
18if NET_VENDOR_APPLE18if 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
1141 1141
1142 tx->descs_cpu = dma_alloc_coherent(&ag->pdev->dev,1142 tx->descs_cpu = dma_alloc_coherent(&ag->pdev->dev,
1143 ring_size * AG71XX_DESC_SIZE,1143 ring_size * AG71XX_DESC_SIZE,
1144 &tx->descs_dma, GFP_ATOMIC);1144 &tx->descs_dma, GFP_KERNEL);
1145 if (!tx->descs_cpu) {1145 if (!tx->descs_cpu) {
1146 kfree(tx->buf);1146 kfree(tx->buf);
1147 tx->buf = NULL;1147 tx->buf = NULL;
drivers/net/ethernet/broadcom/Kconfig+3−3
@@ -14,9 +14,9 @@ config NET_VENDOR_BROADCOM · 13 unmodified lines
14 say Y.14 say Y.
15 15
16 Note that the answer to this question does not directly affect16 Note that the answer to this question does not directly affect
17 the kernel: saying N will just case the configurator to skip all17 the kernel: saying N will just cause the configurator to skip all
18 the questions regarding AMD chipsets. If you say Y, you will be asked18 the questions regarding Broadcom chipsets. If you say Y, you will
19 for your specific chipset/driver in the following questions.19 be asked for your specific chipset/driver in the following questions.
20 20
21if NET_VENDOR_BROADCOM21if NET_VENDOR_BROADCOM
22 22
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
992{992{
993 struct bcm_sysport_priv *priv =993 struct bcm_sysport_priv *priv =
994 container_of(napi, struct bcm_sysport_priv, napi);994 container_of(napi, struct bcm_sysport_priv, napi);
995 struct dim_sample dim_sample;995 struct dim_sample dim_sample = {};
996 unsigned int work_done = 0;996 unsigned int work_done = 0;
997 997
998 work_done = bcm_sysport_desc_rx(priv, budget);998 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
1934 }1934 }
1935 1935
1936 /* select a non-FCoE queue */1936 /* select a non-FCoE queue */
1937 return netdev_pick_tx(dev, skb, NULL) %1937 return netdev_pick_tx(dev, skb, NULL) % (BNX2X_NUM_ETH_QUEUES(bp));
1938 (BNX2X_NUM_ETH_QUEUES(bp) * bp->max_cos);
1939}1938}
1940 1939
1941void bnx2x_set_num_queues(struct bnx2x *bp)1940void 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
2136 }2136 }
2137 }2137 }
2138 if (bp->flags & BNXT_FLAG_DIM) {2138 if (bp->flags & BNXT_FLAG_DIM) {
2139 struct dim_sample dim_sample;2139 struct dim_sample dim_sample = {};
2140 2140
2141 dim_update_sample(cpr->event_ctr,2141 dim_update_sample(cpr->event_ctr,
2142 cpr->rx_packets,2142 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
1895{1895{
1896 struct bcmgenet_rx_ring *ring = container_of(napi,1896 struct bcmgenet_rx_ring *ring = container_of(napi,
1897 struct bcmgenet_rx_ring, napi);1897 struct bcmgenet_rx_ring, napi);
1898 struct dim_sample dim_sample;1898 struct dim_sample dim_sample = {};
1899 unsigned int work_done;1899 unsigned int work_done;
1900 1900
1901 work_done = bcmgenet_desc_rx(ring, budget);1901 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
1381 u8 *dst)1381 u8 *dst)
1382{1382{
1383 u8 mac[ETH_ALEN];1383 u8 mac[ETH_ALEN];
1384 int ret;1384 u8 *addr;
1385 1385
1386 ret = fwnode_property_read_u8_array(acpi_fwnode_handle(adev),1386 addr = fwnode_get_mac_address(acpi_fwnode_handle(adev), mac, ETH_ALEN);
1387 "mac-address", mac, ETH_ALEN);1387 if (!addr) {
1388 if (ret)
1389 goto out;
1390
1391 if (!is_valid_ether_addr(mac)) {
1392 dev_err(dev, "MAC address invalid: %pM\n", mac);1388 dev_err(dev, "MAC address invalid: %pM\n", mac);
1393 ret = -EINVAL;1389 return -EINVAL;
1394 goto out;
1395 }1390 }
1396 1391
1397 dev_info(dev, "MAC address set to: %pM\n", mac);1392 dev_info(dev, "MAC address set to: %pM\n", mac);
1398 1393
1399 memcpy(dst, mac, ETH_ALEN);1394 ether_addr_copy(dst, mac);
1400out:1395 return 0;
1401 return ret;
1402}1396}
1403 1397
1404/* Currently only sets the MAC address. */1398/* 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
3269 if (!adapter->regs) {3269 if (!adapter->regs) {
3270 dev_err(&pdev->dev, "cannot map device registers\n");3270 dev_err(&pdev->dev, "cannot map device registers\n");
3271 err = -ENOMEM;3271 err = -ENOMEM;
3272 goto out_free_adapter;3272 goto out_free_adapter_nofail;
3273 }3273 }
3274 3274
3275 adapter->pdev = pdev;3275 adapter->pdev = pdev;
@@ -3397,6 +3397,9 @@ out_free_dev: · 121 unmodified lines
3397 if (adapter->port[i])3397 if (adapter->port[i])
3398 free_netdev(adapter->port[i]);3398 free_netdev(adapter->port[i]);
3399 3399
3400out_free_adapter_nofail:
3401 kfree_skb(adapter->nofail_skb);
3402
3400out_free_adapter:3403out_free_adapter:
3401 kfree(adapter);3404 kfree(adapter);
3402 3405
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
550 int num = 0, status = 0;550 int num = 0, status = 0;
551 struct be_mcc_obj *mcc_obj = &adapter->mcc_obj;551 struct be_mcc_obj *mcc_obj = &adapter->mcc_obj;
552 552
553 spin_lock(&adapter->mcc_cq_lock);553 spin_lock_bh(&adapter->mcc_cq_lock);
554 554
555 while ((compl = be_mcc_compl_get(adapter))) {555 while ((compl = be_mcc_compl_get(adapter))) {
556 if (compl->flags & CQE_FLAGS_ASYNC_MASK) {556 if (compl->flags & CQE_FLAGS_ASYNC_MASK) {
@@ -566,7 +566,7 @@ int be_process_mcc(struct be_adapter *adapter) · 9 unmodified lines
566 if (num)566 if (num)
567 be_cq_notify(adapter, mcc_obj->cq.id, mcc_obj->rearm_cq, num);567 be_cq_notify(adapter, mcc_obj->cq.id, mcc_obj->rearm_cq, num);
568 568
569 spin_unlock(&adapter->mcc_cq_lock);569 spin_unlock_bh(&adapter->mcc_cq_lock);
570 return status;570 return status;
571}571}
572 572
@@ -581,9 +581,7 @@ static int be_mcc_wait_compl(struct be_adapter *adapter) · 8 unmodified lines
581 if (be_check_error(adapter, BE_ERROR_ANY))581 if (be_check_error(adapter, BE_ERROR_ANY))
582 return -EIO;582 return -EIO;
583 583
584 local_bh_disable();
585 status = be_process_mcc(adapter);584 status = be_process_mcc(adapter);
586 local_bh_enable();
587 585
588 if (atomic_read(&mcc_obj->q.used) == 0)586 if (atomic_read(&mcc_obj->q.used) == 0)
589 break;587 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
5630 * mcc completions5630 * mcc completions
5631 */5631 */
5632 if (!netif_running(adapter->netdev)) {5632 if (!netif_running(adapter->netdev)) {
5633 local_bh_disable();
5634 be_process_mcc(adapter);5633 be_process_mcc(adapter);
5635 local_bh_enable();
5636 goto reschedule;5634 goto reschedule;
5637 }5635 }
5638 5636
drivers/net/ethernet/freescale/enetc/Kconfig+2−0
@@ -2,6 +2,7 @@ · 1 unmodified line
2config FSL_ENETC2config FSL_ENETC
3 tristate "ENETC PF driver"3 tristate "ENETC PF driver"
4 depends on PCI && PCI_MSI && (ARCH_LAYERSCAPE || COMPILE_TEST)4 depends on PCI && PCI_MSI && (ARCH_LAYERSCAPE || COMPILE_TEST)
5 select PHYLIB
5 help6 help
6 This driver supports NXP ENETC gigabit ethernet controller PCIe7 This driver supports NXP ENETC gigabit ethernet controller PCIe
7 physical function (PF) devices, managing ENETC Ports at a privileged8 physical function (PF) devices, managing ENETC Ports at a privileged
@@ -12,6 +13,7 @@ config FSL_ENETC · 4 unmodified lines
12config FSL_ENETC_VF13config FSL_ENETC_VF
13 tristate "ENETC VF driver"14 tristate "ENETC VF driver"
14 depends on PCI && PCI_MSI && (ARCH_LAYERSCAPE || COMPILE_TEST)15 depends on PCI && PCI_MSI && (ARCH_LAYERSCAPE || COMPILE_TEST)
16 select PHYLIB
15 help17 help
16 This driver supports NXP ENETC gigabit ethernet controller PCIe18 This driver supports NXP ENETC gigabit ethernet controller PCIe
17 virtual function (VF) devices enabled by the ENETC PF driver.19 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
2439 * buffers when not using jumbo frames.2439 * buffers when not using jumbo frames.
2440 * Must be large enough to accommodate the network MTU, but small enough2440 * Must be large enough to accommodate the network MTU, but small enough
2441 * to avoid wasting skb memory.2441 * to avoid wasting skb memory.
2442 *
2443 * Could be overridden once, at boot-time, via the
2444 * fm_set_max_frm() callback.
2445 */2442 */
2446static int fsl_fm_max_frm = FSL_FM_MAX_FRAME_SIZE;2443static int fsl_fm_max_frm = FSL_FM_MAX_FRAME_SIZE;
2447module_param(fsl_fm_max_frm, int, 0);2444module_param(fsl_fm_max_frm, int, 0);
drivers/net/ethernet/google/gve/gve.h+3−5
@@ -31,9 +31,6 @@ · 30 unmodified lines
31struct gve_rx_desc_queue {31struct gve_rx_desc_queue {
32 struct gve_rx_desc *desc_ring; /* the descriptor ring */32 struct gve_rx_desc *desc_ring; /* the descriptor ring */
33 dma_addr_t bus; /* the bus for the desc_ring */33 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 */
37 u8 seqno; /* the next expected seqno for this desc*/34 u8 seqno; /* the next expected seqno for this desc*/
38};35};
39 36
@@ -60,8 +57,6 @@ struct gve_rx_data_queue { · 20 unmodified lines
60 dma_addr_t data_bus; /* dma mapping of the slots */57 dma_addr_t data_bus; /* dma mapping of the slots */
61 struct gve_rx_slot_page_info *page_info; /* page info of the buffers */58 struct gve_rx_slot_page_info *page_info; /* page info of the buffers */
62 struct gve_queue_page_list *qpl; /* qpl assigned to this queue */59 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 */
65};60};
66 61
67struct gve_priv;62struct gve_priv;
@@ -73,6 +68,9 @@ struct gve_rx_ring { · 5 unmodified lines
73 struct gve_rx_data_queue data;68 struct gve_rx_data_queue data;
74 u64 rbytes; /* free-running bytes received */69 u64 rbytes; /* free-running bytes received */
75 u64 rpackets; /* free-running packets received */70 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 */
76 u32 q_num; /* queue index */74 u32 q_num; /* queue index */
77 u32 ntfy_id; /* notification block index */75 u32 ntfy_id; /* notification block index */
78 struct gve_queue_resources *q_resources; /* head and tail pointer idx */76 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
138 for (ring = 0; ring < priv->rx_cfg.num_queues; ring++) {138 for (ring = 0; ring < priv->rx_cfg.num_queues; ring++) {
139 struct gve_rx_ring *rx = &priv->rx[ring];139 struct gve_rx_ring *rx = &priv->rx[ring];
140 140
141 data[i++] = rx->desc.cnt;141 data[i++] = rx->cnt;
142 data[i++] = rx->desc.fill_cnt;142 data[i++] = rx->fill_cnt;
143 }143 }
144 } else {144 } else {
145 i += priv->rx_cfg.num_queues * NUM_GVE_RX_CNTS;145 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
37 rx->data.qpl = NULL;37 rx->data.qpl = NULL;
38 kvfree(rx->data.page_info);38 kvfree(rx->data.page_info);
39 39
40 slots = rx->data.mask + 1;40 slots = rx->mask + 1;
41 bytes = sizeof(*rx->data.data_ring) * slots;41 bytes = sizeof(*rx->data.data_ring) * slots;
42 dma_free_coherent(dev, bytes, rx->data.data_ring,42 dma_free_coherent(dev, bytes, rx->data.data_ring,
43 rx->data.data_bus);43 rx->data.data_bus);
@@ -64,7 +64,7 @@ static int gve_prefill_rx_pages(struct gve_rx_ring *rx) · 20 unmodified lines
64 /* Allocate one page per Rx queue slot. Each page is split into two64 /* Allocate one page per Rx queue slot. Each page is split into two
65 * packet buffers, when possible we "page flip" between the two.65 * packet buffers, when possible we "page flip" between the two.
66 */66 */
67 slots = rx->data.mask + 1;67 slots = rx->mask + 1;
68 68
69 rx->data.page_info = kvzalloc(slots *69 rx->data.page_info = kvzalloc(slots *
70 sizeof(*rx->data.page_info), GFP_KERNEL);70 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
111 rx->q_num = idx;111 rx->q_num = idx;
112 112
113 slots = priv->rx_pages_per_qpl;113 slots = priv->rx_pages_per_qpl;
114 rx->data.mask = slots - 1;114 rx->mask = slots - 1;
115 115
116 /* alloc rx data ring */116 /* alloc rx data ring */
117 bytes = sizeof(*rx->data.data_ring) * slots;117 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
125 err = -ENOMEM;125 err = -ENOMEM;
126 goto abort_with_slots;126 goto abort_with_slots;
127 }127 }
128 rx->desc.fill_cnt = filled_pages;128 rx->fill_cnt = filled_pages;
129 /* Ensure data ring slots (packet buffers) are visible. */129 /* Ensure data ring slots (packet buffers) are visible. */
130 dma_wmb();130 dma_wmb();
131 131
@@ -156,8 +156,8 @@ static int gve_rx_alloc_ring(struct gve_priv *priv, int idx) · 24 unmodified lines
156 err = -ENOMEM;156 err = -ENOMEM;
157 goto abort_with_q_resources;157 goto abort_with_q_resources;
158 }158 }
159 rx->desc.mask = slots - 1;159 rx->mask = slots - 1;
160 rx->desc.cnt = 0;160 rx->cnt = 0;
161 rx->desc.seqno = 1;161 rx->desc.seqno = 1;
162 gve_rx_add_to_block(priv, idx);162 gve_rx_add_to_block(priv, idx);
163 163
@@ -213,7 +213,7 @@ void gve_rx_write_doorbell(struct gve_priv *priv, struct gve_rx_ring *rx) · 49 unmodified lines
213{213{
214 u32 db_idx = be32_to_cpu(rx->q_resources->db_index);214 u32 db_idx = be32_to_cpu(rx->q_resources->db_index);
215 215
216 iowrite32be(rx->desc.fill_cnt, &priv->db_bar2[db_idx]);216 iowrite32be(rx->fill_cnt, &priv->db_bar2[db_idx]);
217}217}
218 218
219static enum pkt_hash_types gve_rss_type(__be16 pkt_flags)219static 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
273}273}
274 274
275static bool gve_rx(struct gve_rx_ring *rx, struct gve_rx_desc *rx_desc,275static 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)
277{277{
278 struct gve_rx_slot_page_info *page_info;278 struct gve_rx_slot_page_info *page_info;
279 struct gve_priv *priv = rx->gve;279 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
282 struct sk_buff *skb;282 struct sk_buff *skb;
283 int pagecount;283 int pagecount;
284 u16 len;284 u16 len;
285 u32 idx;
286 285
287 /* drop this packet */286 /* drop this packet */
288 if (unlikely(rx_desc->flags_seq & GVE_RXF_ERR))287 if (unlikely(rx_desc->flags_seq & GVE_RXF_ERR))
289 return true;288 return true;
290 289
291 len = be16_to_cpu(rx_desc->len) - GVE_RX_PAD;290 len = be16_to_cpu(rx_desc->len) - GVE_RX_PAD;
292 idx = rx->data.cnt & rx->data.mask;
293 page_info = &rx->data.page_info[idx];291 page_info = &rx->data.page_info[idx];
294 292
295 /* gvnic can only receive into registered segments. If the buffer293 /* gvnic can only receive into registered segments. If the buffer
@@ -340,8 +338,6 @@ have_skb: · 44 unmodified lines
340 if (!skb)338 if (!skb)
341 return true;339 return true;
342 340
343 rx->data.cnt++;
344
345 if (likely(feat & NETIF_F_RXCSUM)) {341 if (likely(feat & NETIF_F_RXCSUM)) {
346 /* NIC passes up the partial sum */342 /* NIC passes up the partial sum */
347 if (rx_desc->csum)343 if (rx_desc->csum)
@@ -370,7 +366,7 @@ static bool gve_rx_work_pending(struct gve_rx_ring *rx) · 22 unmodified lines
370 __be16 flags_seq;366 __be16 flags_seq;
371 u32 next_idx;367 u32 next_idx;
372 368
373 next_idx = rx->desc.cnt & rx->desc.mask;369 next_idx = rx->cnt & rx->mask;
374 desc = rx->desc.desc_ring + next_idx;370 desc = rx->desc.desc_ring + next_idx;
375 371
376 flags_seq = desc->flags_seq;372 flags_seq = desc->flags_seq;
@@ -385,8 +381,8 @@ bool gve_clean_rx_done(struct gve_rx_ring *rx, int budget, · 8 unmodified lines
385{381{
386 struct gve_priv *priv = rx->gve;382 struct gve_priv *priv = rx->gve;
387 struct gve_rx_desc *desc;383 struct gve_rx_desc *desc;
388 u32 cnt = rx->desc.cnt;384 u32 cnt = rx->cnt;
389 u32 idx = cnt & rx->desc.mask;385 u32 idx = cnt & rx->mask;
390 u32 work_done = 0;386 u32 work_done = 0;
391 u64 bytes = 0;387 u64 bytes = 0;
392 388
@@ -401,10 +397,10 @@ bool gve_clean_rx_done(struct gve_rx_ring *rx, int budget, · 8 unmodified lines
401 rx->q_num, GVE_SEQNO(desc->flags_seq),397 rx->q_num, GVE_SEQNO(desc->flags_seq),
402 rx->desc.seqno);398 rx->desc.seqno);
403 bytes += be16_to_cpu(desc->len) - GVE_RX_PAD;399 bytes += be16_to_cpu(desc->len) - GVE_RX_PAD;
404 if (!gve_rx(rx, desc, feat))400 if (!gve_rx(rx, desc, feat, idx))
405 gve_schedule_reset(priv);401 gve_schedule_reset(priv);
406 cnt++;402 cnt++;
407 idx = cnt & rx->desc.mask;403 idx = cnt & rx->mask;
408 desc = rx->desc.desc_ring + idx;404 desc = rx->desc.desc_ring + idx;
409 rx->desc.seqno = gve_next_seqno(rx->desc.seqno);405 rx->desc.seqno = gve_next_seqno(rx->desc.seqno);
410 work_done++;406 work_done++;
@@ -417,8 +413,8 @@ bool gve_clean_rx_done(struct gve_rx_ring *rx, int budget, · 6 unmodified lines
417 rx->rpackets += work_done;413 rx->rpackets += work_done;
418 rx->rbytes += bytes;414 rx->rbytes += bytes;
419 u64_stats_update_end(&rx->statss);415 u64_stats_update_end(&rx->statss);
420 rx->desc.cnt = cnt;416 rx->cnt = cnt;
421 rx->desc.fill_cnt += work_done;417 rx->fill_cnt += work_done;
422 418
423 /* restock desc ring slots */419 /* restock desc ring slots */
424 dma_wmb(); /* Ensure descs are visible before ringing doorbell */420 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
220 unsigned int reg_inten;220 unsigned int reg_inten;
221 221
222 struct napi_struct napi;222 struct napi_struct napi;
223 struct device *dev;
223 struct net_device *ndev;224 struct net_device *ndev;
224 225
225 struct tx_desc *tx_desc;226 struct tx_desc *tx_desc;
@@ -248,7 +249,7 @@ struct hip04_priv { · 22 unmodified lines
248 249
249static inline unsigned int tx_count(unsigned int head, unsigned int tail)250static inline unsigned int tx_count(unsigned int head, unsigned int tail)
250{251{
251 return (head - tail) % (TX_DESC_NUM - 1);252 return (head - tail) % TX_DESC_NUM;
252}253}
253 254
254static void hip04_config_port(struct net_device *ndev, u32 speed, u32 duplex)255static 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
465 }466 }
466 467
467 if (priv->tx_phys[tx_tail]) {468 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],
469 priv->tx_skb[tx_tail]->len,470 priv->tx_skb[tx_tail]->len,
470 DMA_TO_DEVICE);471 DMA_TO_DEVICE);
471 priv->tx_phys[tx_tail] = 0;472 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
516 return NETDEV_TX_BUSY;517 return NETDEV_TX_BUSY;
517 }518 }
518 519
519 phys = dma_map_single(&ndev->dev, skb->data, skb->len, DMA_TO_DEVICE);520 phys = dma_map_single(priv->dev, skb->data, skb->len, DMA_TO_DEVICE);
520 if (dma_mapping_error(&ndev->dev, phys)) {521 if (dma_mapping_error(priv->dev, phys)) {
521 dev_kfree_skb(skb);522 dev_kfree_skb(skb);
522 return NETDEV_TX_OK;523 return NETDEV_TX_OK;
523 }524 }
@@ -585,6 +586,9 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget) · 61 unmodified lines
585 u16 len;586 u16 len;
586 u32 err;587 u32 err;
587 588
589 /* clean up tx descriptors */
590 tx_remaining = hip04_tx_reclaim(ndev, false);
591
588 while (cnt && !last) {592 while (cnt && !last) {
589 buf = priv->rx_buf[priv->rx_head];593 buf = priv->rx_buf[priv->rx_head];
590 skb = build_skb(buf, priv->rx_buf_size);594 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
593 goto refill;597 goto refill;
594 }598 }
595 599
596 dma_unmap_single(&ndev->dev, priv->rx_phys[priv->rx_head],600 dma_unmap_single(priv->dev, priv->rx_phys[priv->rx_head],
597 RX_BUF_SIZE, DMA_FROM_DEVICE);601 RX_BUF_SIZE, DMA_FROM_DEVICE);
598 priv->rx_phys[priv->rx_head] = 0;602 priv->rx_phys[priv->rx_head] = 0;
599 603
@@ -622,9 +626,9 @@ refill: · 22 unmodified lines
622 buf = netdev_alloc_frag(priv->rx_buf_size);626 buf = netdev_alloc_frag(priv->rx_buf_size);
623 if (!buf)627 if (!buf)
624 goto done;628 goto done;
625 phys = dma_map_single(&ndev->dev, buf,629 phys = dma_map_single(priv->dev, buf,
626 RX_BUF_SIZE, DMA_FROM_DEVICE);630 RX_BUF_SIZE, DMA_FROM_DEVICE);
627 if (dma_mapping_error(&ndev->dev, phys))631 if (dma_mapping_error(priv->dev, phys))
628 goto done;632 goto done;
629 priv->rx_buf[priv->rx_head] = buf;633 priv->rx_buf[priv->rx_head] = buf;
630 priv->rx_phys[priv->rx_head] = phys;634 priv->rx_phys[priv->rx_head] = phys;
@@ -645,8 +649,7 @@ refill: · 14 unmodified lines
645 }649 }
646 napi_complete_done(napi, rx);650 napi_complete_done(napi, rx);
647done:651done:
648 /* clean up tx descriptors and start a new timer if necessary */652 /* start a new timer if necessary */
649 tx_remaining = hip04_tx_reclaim(ndev, false);
650 if (rx < budget && tx_remaining)653 if (rx < budget && tx_remaining)
651 hip04_start_tx_timer(priv);654 hip04_start_tx_timer(priv);
652 655
@@ -728,9 +731,9 @@ static int hip04_mac_open(struct net_device *ndev) · 75 unmodified lines
728 for (i = 0; i < RX_DESC_NUM; i++) {731 for (i = 0; i < RX_DESC_NUM; i++) {
729 dma_addr_t phys;732 dma_addr_t phys;
730 733
731 phys = dma_map_single(&ndev->dev, priv->rx_buf[i],734 phys = dma_map_single(priv->dev, priv->rx_buf[i],
732 RX_BUF_SIZE, DMA_FROM_DEVICE);735 RX_BUF_SIZE, DMA_FROM_DEVICE);
733 if (dma_mapping_error(&ndev->dev, phys))736 if (dma_mapping_error(priv->dev, phys))
734 return -EIO;737 return -EIO;
735 738
736 priv->rx_phys[i] = phys;739 priv->rx_phys[i] = phys;
@@ -764,7 +767,7 @@ static int hip04_mac_stop(struct net_device *ndev) · 27 unmodified lines
764 767
765 for (i = 0; i < RX_DESC_NUM; i++) {768 for (i = 0; i < RX_DESC_NUM; i++) {
766 if (priv->rx_phys[i]) {769 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],
768 RX_BUF_SIZE, DMA_FROM_DEVICE);771 RX_BUF_SIZE, DMA_FROM_DEVICE);
769 priv->rx_phys[i] = 0;772 priv->rx_phys[i] = 0;
770 }773 }
@@ -907,6 +910,7 @@ static int hip04_mac_probe(struct platform_device *pdev) · 136 unmodified lines
907 return -ENOMEM;910 return -ENOMEM;
908 911
909 priv = netdev_priv(ndev);912 priv = netdev_priv(ndev);
913 priv->dev = d;
910 priv->ndev = ndev;914 priv->ndev = ndev;
911 platform_set_drvdata(pdev, ndev);915 platform_set_drvdata(pdev, ndev);
912 SET_NETDEV_DEV(ndev, &pdev->dev);916 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
3251 switch (action) {3251 switch (action) {
3252 case MEM_CANCEL_OFFLINE:3252 case MEM_CANCEL_OFFLINE:
3253 pr_info("memory offlining canceled");3253 pr_info("memory offlining canceled");
3254 /* Fall through: re-add canceled memory block */3254 /* Fall through - re-add canceled memory block */
3255 3255
3256 case MEM_ONLINE:3256 case MEM_ONLINE:
3257 pr_info("memory is going online");3257 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
319 319
320 init_waitqueue_head(&dev->smi_busy_wait);320 init_waitqueue_head(&dev->smi_busy_wait);
321 321
322 for (i = 0; i < ARRAY_SIZE(dev->clk); i++) {322 if (pdev->dev.of_node) {
323 dev->clk[i] = of_clk_get(pdev->dev.of_node, i);323 for (i = 0; i < ARRAY_SIZE(dev->clk); i++) {
324 if (PTR_ERR(dev->clk[i]) == -EPROBE_DEFER) {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) {
325 ret = -EPROBE_DEFER;342 ret = -EPROBE_DEFER;
326 goto out_clk;343 goto out_clk;
327 }344 }
328 if (IS_ERR(dev->clk[i]))345 if (!IS_ERR(dev->clk[0]))
329 break;346 clk_prepare_enable(dev->clk[0]);
330 clk_prepare_enable(dev->clk[i]);
331 }347 }
332 348
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");
336 349
337 dev->err_interrupt = platform_get_irq(pdev, 0);350 dev->err_interrupt = platform_get_irq(pdev, 0);
338 if (dev->err_interrupt > 0 &&351 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
811 return 0;811 return 0;
812}812}
813 813
814static 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
814static int mvpp2_bm_update_mtu(struct net_device *dev, int mtu)834static int mvpp2_bm_update_mtu(struct net_device *dev, int mtu)
815{835{
816 struct mvpp2_port *port = netdev_priv(dev);836 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
843 /* Add port to new short & long pool */863 /* Add port to new short & long pool */
844 mvpp2_swf_bm_pool_init(port);864 mvpp2_swf_bm_pool_init(port);
845 865
846 /* Update L4 checksum when jumbo enable/disable on port */866 mvpp2_set_hw_csum(port, new_long_pool);
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 }
855 }867 }
856 868
857 dev->mtu = mtu;869 dev->mtu = mtu;
@@ -3700,6 +3712,7 @@ static int mvpp2_set_mac_address(struct net_device *dev, void *p) · 2842 unmodified lines
3700static int mvpp2_change_mtu(struct net_device *dev, int mtu)3712static int mvpp2_change_mtu(struct net_device *dev, int mtu)
3701{3713{
3702 struct mvpp2_port *port = netdev_priv(dev);3714 struct mvpp2_port *port = netdev_priv(dev);
3715 bool running = netif_running(dev);
3703 int err;3716 int err;
3704 3717
3705 if (!IS_ALIGNED(MVPP2_RX_PKT_SIZE(mtu), 8)) {3718 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
3708 mtu = ALIGN(MVPP2_RX_PKT_SIZE(mtu), 8);3721 mtu = ALIGN(MVPP2_RX_PKT_SIZE(mtu), 8);
3709 }3722 }
3710 3723
3711 if (!netif_running(dev)) {3724 if (running)
3712 err = mvpp2_bm_update_mtu(dev, mtu);3725 mvpp2_stop_dev(port);
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);
3725 3726
3726 err = mvpp2_bm_update_mtu(dev, mtu);3727 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 {
3728 port->pkt_size = MVPP2_RX_PKT_SIZE(mtu);3733 port->pkt_size = MVPP2_RX_PKT_SIZE(mtu);
3729 goto out_start;
3730 }3734 }
3731 3735
3732 /* Reconfigure BM to the original MTU */3736 if (running) {
3733 err = mvpp2_bm_update_mtu(dev, dev->mtu);3737 mvpp2_start_dev(port);
3734 if (err)3738 mvpp2_egress_enable(port);
3735 goto log_error;3739 mvpp2_ingress_enable(port);
3736 3740 }
3737out_start:
3738 mvpp2_start_dev(port);
3739 mvpp2_egress_enable(port);
3740 mvpp2_ingress_enable(port);
3741 3741
3742 return 0;
3743log_error:
3744 netdev_err(dev, "failed to change MTU\n");
3745 return err;3742 return err;
3746}3743}
3747 3744
@@ -4739,9 +4736,9 @@ static void mvpp2_xlg_config(struct mvpp2_port *port, unsigned int mode, · 991 unmodified lines
4739 else4736 else
4740 ctrl0 &= ~MVPP22_XLG_CTRL0_RX_FLOW_CTRL_EN;4737 ctrl0 &= ~MVPP22_XLG_CTRL0_RX_FLOW_CTRL_EN;
4741 4738
4742 ctrl4 &= ~MVPP22_XLG_CTRL4_MACMODSELECT_GMAC;4739 ctrl4 &= ~(MVPP22_XLG_CTRL4_MACMODSELECT_GMAC |
4743 ctrl4 |= MVPP22_XLG_CTRL4_FWD_FC | MVPP22_XLG_CTRL4_FWD_PFC |4740 MVPP22_XLG_CTRL4_EN_IDLE_CHECK);
4744 MVPP22_XLG_CTRL4_EN_IDLE_CHECK;4741 ctrl4 |= MVPP22_XLG_CTRL4_FWD_FC | MVPP22_XLG_CTRL4_FWD_PFC;
4745 4742
4746 if (old_ctrl0 != ctrl0)4743 if (old_ctrl0 != ctrl0)
4747 writel(ctrl0, port->base + MVPP22_XLG_CTRL0_REG);4744 writel(ctrl0, port->base + MVPP22_XLG_CTRL0_REG);
@@ -5208,10 +5205,7 @@ static int mvpp2_port_probe(struct platform_device *pdev, · 460 unmodified lines
5208 dev->features |= NETIF_F_NTUPLE;5205 dev->features |= NETIF_F_NTUPLE;
5209 }5206 }
5210 5207
5211 if (port->pool_long->id == MVPP2_BM_JUMBO && port->id != 0) {5208 mvpp2_set_hw_csum(port, port->pool_long->id);
5212 dev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
5213 dev->hw_features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
5214 }
5215 5209
5216 dev->vlan_features |= features;5210 dev->vlan_features |= features;
5217 dev->gso_max_segs = MVPP2_MAX_TSO_SEGS;5211 dev->gso_max_segs = MVPP2_MAX_TSO_SEGS;
@@ -5759,9 +5753,6 @@ static int mvpp2_remove(struct platform_device *pdev) · 541 unmodified lines
5759 5753
5760 mvpp2_dbgfs_cleanup(priv);5754 mvpp2_dbgfs_cleanup(priv);
5761 5755
5762 flush_workqueue(priv->stats_queue);
5763 destroy_workqueue(priv->stats_queue);
5764
5765 fwnode_for_each_available_child_node(fwnode, port_fwnode) {5756 fwnode_for_each_available_child_node(fwnode, port_fwnode) {
5766 if (priv->port_list[i]) {5757 if (priv->port_list[i]) {
5767 mutex_destroy(&priv->port_list[i]->gather_stats_lock);5758 mutex_destroy(&priv->port_list[i]->gather_stats_lock);
@@ -5770,6 +5761,8 @@ static int mvpp2_remove(struct platform_device *pdev) · 2 unmodified lines
5770 i++;5761 i++;
5771 }5762 }
5772 5763
5764 destroy_workqueue(priv->stats_queue);
5765
5773 for (i = 0; i < MVPP2_BM_POOLS_NUM; i++) {5766 for (i = 0; i < MVPP2_BM_POOLS_NUM; i++) {
5774 struct mvpp2_bm_pool *bm_pool = &priv->bm_pools[i];5767 struct mvpp2_bm_pool *bm_pool = &priv->bm_pools[i];
5775 5768
drivers/net/ethernet/marvell/sky2.c+7−0
@@ -4924,6 +4924,13 @@ static const struct dmi_system_id msi_blacklist[] = { · 4923 unmodified lines
4924 DMI_MATCH(DMI_PRODUCT_NAME, "P5W DH Deluxe"),4924 DMI_MATCH(DMI_PRODUCT_NAME, "P5W DH Deluxe"),
4925 },4925 },
4926 },4926 },
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 },
4927 {}4934 {}
4928};4935};
4929 4936
drivers/net/ethernet/mediatek/Kconfig+0−1
@@ -9,7 +9,6 @@ if NET_VENDOR_MEDIATEK · 8 unmodified lines
9 9
10config NET_MEDIATEK_SOC10config NET_MEDIATEK_SOC
11 tristate "MediaTek SoC Gigabit Ethernet support"11 tristate "MediaTek SoC Gigabit Ethernet support"
12 depends on NET_VENDOR_MEDIATEK
13 select PHYLIB12 select PHYLIB
14 ---help---13 ---help---
15 This driver supports the gigabit ethernet MACs in the14 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
213 struct mlx5_interface *intf;213 struct mlx5_interface *intf;
214 214
215 mutex_lock(&mlx5_intf_mutex);215 mutex_lock(&mlx5_intf_mutex);
216 list_for_each_entry(intf, &intf_list, list)216 list_for_each_entry_reverse(intf, &intf_list, list)
217 mlx5_remove_device(intf, priv);217 mlx5_remove_device(intf, priv);
218 list_del(&priv->dev_list);218 list_del(&priv->dev_list);
219 mutex_unlock(&mlx5_intf_mutex);219 mutex_unlock(&mlx5_intf_mutex);
drivers/net/ethernet/mellanox/mlx5/core/en.h+3−9
@@ -159,7 +159,7 @@ do { \ · 158 unmodified lines
159enum mlx5e_rq_group {159enum mlx5e_rq_group {
160 MLX5E_RQ_GROUP_REGULAR,160 MLX5E_RQ_GROUP_REGULAR,
161 MLX5E_RQ_GROUP_XSK,161 MLX5E_RQ_GROUP_XSK,
162 MLX5E_NUM_RQ_GROUPS /* Keep last. */162#define MLX5E_NUM_RQ_GROUPS(g) (1 + MLX5E_RQ_GROUP_##g)
163};163};
164 164
165static inline u16 mlx5_min_rx_wqes(int wq_type, u32 wq_size)165static 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
182 min_t(int, mlx5_comp_vectors_count(mdev), MLX5E_MAX_NUM_CHANNELS);182 min_t(int, mlx5_comp_vectors_count(mdev), MLX5E_MAX_NUM_CHANNELS);
183}183}
184 184
185/* Use this function to get max num channels after netdev was created */
186static 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
193struct mlx5e_tx_wqe {185struct mlx5e_tx_wqe {
194 struct mlx5_wqe_ctrl_seg ctrl;186 struct mlx5_wqe_ctrl_seg ctrl;
195 struct mlx5_wqe_eth_seg eth;187 struct mlx5_wqe_eth_seg eth;
@@ -830,6 +822,7 @@ struct mlx5e_priv { · 634 unmodified lines
830 struct net_device *netdev;822 struct net_device *netdev;
831 struct mlx5e_stats stats;823 struct mlx5e_stats stats;
832 struct mlx5e_channel_stats channel_stats[MLX5E_MAX_NUM_CHANNELS];824 struct mlx5e_channel_stats channel_stats[MLX5E_MAX_NUM_CHANNELS];
825 u16 max_nch;
833 u8 max_opened_tc;826 u8 max_opened_tc;
834 struct hwtstamp_config tstamp;827 struct hwtstamp_config tstamp;
835 u16 q_counter;828 u16 q_counter;
@@ -871,6 +864,7 @@ struct mlx5e_profile { · 35 unmodified lines
871 mlx5e_fp_handle_rx_cqe handle_rx_cqe_mpwqe;864 mlx5e_fp_handle_rx_cqe handle_rx_cqe_mpwqe;
872 } rx_handlers;865 } rx_handlers;
873 int max_tc;866 int max_tc;
867 u8 rq_groups;
874};868};
875 869
876void mlx5e_build_ptys2ethtool_map(void);870void 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
66 *group = qid / nch;66 *group = qid / nch;
67}67}
68 68
69static inline bool mlx5e_qid_validate(struct mlx5e_params *params, u64 qid)69static inline bool mlx5e_qid_validate(const struct mlx5e_profile *profile,
70 struct mlx5e_params *params, u64 qid)
70{71{
71 return qid < params->num_channels * MLX5E_NUM_RQ_GROUPS;72 return qid < params->num_channels * profile->rq_groups;
72}73}
73 74
74/* Parameter calculations */75/* 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
78};78};
79 79
80static void mlx5e_port_get_speed_arr(struct mlx5_core_dev *mdev,80static 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)
82{83{
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);
84 85
85 *size = ext ? ARRAY_SIZE(mlx5e_ext_link_speed) :86 *size = ext ? ARRAY_SIZE(mlx5e_ext_link_speed) :
86 ARRAY_SIZE(mlx5e_link_speed);87 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
152 sizeof(out), MLX5_REG_PTYS, 0, 1);153 sizeof(out), MLX5_REG_PTYS, 0, 1);
153}154}
154 155
155u32 mlx5e_port_ptys2speed(struct mlx5_core_dev *mdev, u32 eth_proto_oper)156u32 mlx5e_port_ptys2speed(struct mlx5_core_dev *mdev, u32 eth_proto_oper,
157 bool force_legacy)
156{158{
157 unsigned long temp = eth_proto_oper;159 unsigned long temp = eth_proto_oper;
158 const u32 *table;160 const u32 *table;
@@ -160,7 +162,7 @@ u32 mlx5e_port_ptys2speed(struct mlx5_core_dev *mdev, u32 eth_proto_oper) · 1 unmodified line
160 u32 max_size;162 u32 max_size;
161 int i;163 int i;
162 164
163 mlx5e_port_get_speed_arr(mdev, &table, &max_size);165 mlx5e_port_get_speed_arr(mdev, &table, &max_size, force_legacy);
164 i = find_first_bit(&temp, max_size);166 i = find_first_bit(&temp, max_size);
165 if (i < max_size)167 if (i < max_size)
166 speed = table[i];168 speed = table[i];
@@ -170,6 +172,7 @@ u32 mlx5e_port_ptys2speed(struct mlx5_core_dev *mdev, u32 eth_proto_oper) · 3 unmodified lines
170int mlx5e_port_linkspeed(struct mlx5_core_dev *mdev, u32 *speed)172int mlx5e_port_linkspeed(struct mlx5_core_dev *mdev, u32 *speed)
171{173{
172 struct mlx5e_port_eth_proto eproto;174 struct mlx5e_port_eth_proto eproto;
175 bool force_legacy = false;
173 bool ext;176 bool ext;
174 int err;177 int err;
175 178
@@ -177,8 +180,13 @@ int mlx5e_port_linkspeed(struct mlx5_core_dev *mdev, u32 *speed) · 1 unmodified line
177 err = mlx5_port_query_eth_proto(mdev, 1, ext, &eproto);180 err = mlx5_port_query_eth_proto(mdev, 1, ext, &eproto);
178 if (err)181 if (err)
179 goto out;182 goto out;
180 183 if (ext && !eproto.admin) {
181 *speed = mlx5e_port_ptys2speed(mdev, eproto.oper);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);
182 if (!(*speed))190 if (!(*speed))
183 err = -EINVAL;191 err = -EINVAL;
184 192
@@ -201,7 +209,7 @@ int mlx5e_port_max_linkspeed(struct mlx5_core_dev *mdev, u32 *speed) · 16 unmodified lines
201 if (err)209 if (err)
202 return err;210 return err;
203 211
204 mlx5e_port_get_speed_arr(mdev, &table, &max_size);212 mlx5e_port_get_speed_arr(mdev, &table, &max_size, false);
205 for (i = 0; i < max_size; ++i)213 for (i = 0; i < max_size; ++i)
206 if (eproto.cap & MLX5E_PROT_MASK(i))214 if (eproto.cap & MLX5E_PROT_MASK(i))
207 max_speed = max(max_speed, table[i]);215 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
210 return 0;218 return 0;
211}219}
212 220
213u32 mlx5e_port_speed2linkmodes(struct mlx5_core_dev *mdev, u32 speed)221u32 mlx5e_port_speed2linkmodes(struct mlx5_core_dev *mdev, u32 speed,
222 bool force_legacy)
214{223{
215 u32 link_modes = 0;224 u32 link_modes = 0;
216 const u32 *table;225 const u32 *table;
217 u32 max_size;226 u32 max_size;
218 int i;227 int i;
219 228
220 mlx5e_port_get_speed_arr(mdev, &table, &max_size);229 mlx5e_port_get_speed_arr(mdev, &table, &max_size, force_legacy);
221 for (i = 0; i < max_size; ++i) {230 for (i = 0; i < max_size; ++i) {
222 if (table[i] == speed)231 if (table[i] == speed)
223 link_modes |= MLX5E_PROT_MASK(i);232 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
48 u8 *an_disable_cap, u8 *an_disable_admin);48 u8 *an_disable_cap, u8 *an_disable_admin);
49int mlx5_port_set_eth_ptys(struct mlx5_core_dev *dev, bool an_disable,49int mlx5_port_set_eth_ptys(struct mlx5_core_dev *dev, bool an_disable,
50 u32 proto_admin, bool ext);50 u32 proto_admin, bool ext);
51u32 mlx5e_port_ptys2speed(struct mlx5_core_dev *mdev, u32 eth_proto_oper);51u32 mlx5e_port_ptys2speed(struct mlx5_core_dev *mdev, u32 eth_proto_oper,
52 bool force_legacy);
52int mlx5e_port_linkspeed(struct mlx5_core_dev *mdev, u32 *speed);53int mlx5e_port_linkspeed(struct mlx5_core_dev *mdev, u32 *speed);
53int mlx5e_port_max_linkspeed(struct mlx5_core_dev *mdev, u32 *speed);54int mlx5e_port_max_linkspeed(struct mlx5_core_dev *mdev, u32 *speed);
54u32 mlx5e_port_speed2linkmodes(struct mlx5_core_dev *mdev, u32 speed);55u32 mlx5e_port_speed2linkmodes(struct mlx5_core_dev *mdev, u32 speed,
56 bool force_legacy);
55 57
56int mlx5e_port_query_pbmc(struct mlx5_core_dev *mdev, void *out);58int mlx5e_port_query_pbmc(struct mlx5_core_dev *mdev, void *out);
57int mlx5e_port_set_pbmc(struct mlx5_core_dev *mdev, void *in);59int 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
412 goto out;412 goto out;
413 413
414 tls_ctx = tls_get_ctx(skb->sk);414 tls_ctx = tls_get_ctx(skb->sk);
415 if (unlikely(tls_ctx->netdev != netdev))415 if (unlikely(WARN_ON_ONCE(tls_ctx->netdev != netdev)))
416 goto err_out;416 goto err_out;
417 417
418 priv_tx = mlx5e_get_ktls_tx_priv_ctx(tls_ctx);418 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
391{391{
392 mutex_lock(&priv->state_lock);392 mutex_lock(&priv->state_lock);
393 393
394 ch->max_combined = mlx5e_get_netdev_max_channels(priv->netdev);394 ch->max_combined = priv->max_nch;
395 ch->combined_count = priv->channels.params.num_channels;395 ch->combined_count = priv->channels.params.num_channels;
396 if (priv->xsk.refcnt) {396 if (priv->xsk.refcnt) {
397 /* The upper half are XSK queues. */397 /* The upper half are XSK queues. */
@@ -785,7 +785,7 @@ static void ptys2ethtool_supported_advertised_port(struct ethtool_link_ksettings · 387 unmodified lines
785}785}
786 786
787static void get_speed_duplex(struct net_device *netdev,787static void get_speed_duplex(struct net_device *netdev,
788 u32 eth_proto_oper,788 u32 eth_proto_oper, bool force_legacy,
789 struct ethtool_link_ksettings *link_ksettings)789 struct ethtool_link_ksettings *link_ksettings)
790{790{
791 struct mlx5e_priv *priv = netdev_priv(netdev);791 struct mlx5e_priv *priv = netdev_priv(netdev);
@@ -795,7 +795,7 @@ static void get_speed_duplex(struct net_device *netdev, · 3 unmodified lines
795 if (!netif_carrier_ok(netdev))795 if (!netif_carrier_ok(netdev))
796 goto out;796 goto out;
797 797
798 speed = mlx5e_port_ptys2speed(priv->mdev, eth_proto_oper);798 speed = mlx5e_port_ptys2speed(priv->mdev, eth_proto_oper, force_legacy);
799 if (!speed) {799 if (!speed) {
800 speed = SPEED_UNKNOWN;800 speed = SPEED_UNKNOWN;
801 goto out;801 goto out;
@@ -914,8 +914,8 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, · 112 unmodified lines
914 /* Fields: eth_proto_admin and ext_eth_proto_admin are914 /* Fields: eth_proto_admin and ext_eth_proto_admin are
915 * mutually exclusive. Hence try reading legacy advertising915 * mutually exclusive. Hence try reading legacy advertising
916 * when extended advertising is zero.916 * when extended advertising is zero.
917 * admin_ext indicates how eth_proto_admin should be917 * admin_ext indicates which proto_admin (ext vs. legacy)
918 * interpreted918 * should be read and interpreted
919 */919 */
920 admin_ext = ext;920 admin_ext = ext;
921 if (ext && !eth_proto_admin) {921 if (ext && !eth_proto_admin) {
@@ -924,7 +924,7 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, · 2 unmodified lines
924 admin_ext = false;924 admin_ext = false;
925 }925 }
926 926
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,
928 eth_proto_oper);928 eth_proto_oper);
929 eth_proto_lp = MLX5_GET(ptys_reg, out, eth_proto_lp_advertise);929 eth_proto_lp = MLX5_GET(ptys_reg, out, eth_proto_lp_advertise);
930 an_disable_admin = MLX5_GET(ptys_reg, out, an_disable_admin);930 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
939 get_supported(mdev, eth_proto_cap, link_ksettings);939 get_supported(mdev, eth_proto_cap, link_ksettings);
940 get_advertising(eth_proto_admin, tx_pause, rx_pause, link_ksettings,940 get_advertising(eth_proto_admin, tx_pause, rx_pause, link_ksettings,
941 admin_ext);941 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);
943 944
944 eth_proto_oper = eth_proto_oper ? eth_proto_oper : eth_proto_cap;945 eth_proto_oper = eth_proto_oper ? eth_proto_oper : eth_proto_cap;
945 946
@@ -1016,45 +1017,69 @@ static u32 mlx5e_ethtool2ptys_ext_adver_link(const unsigned long *link_modes) · 70 unmodified lines
1016 return ptys_modes;1017 return ptys_modes;
1017}1018}
1018 1019
1020static 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
1030static 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
1036static 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
1019int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,1044int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,
1020 const struct ethtool_link_ksettings *link_ksettings)1045 const struct ethtool_link_ksettings *link_ksettings)
1021{1046{
1022 struct mlx5_core_dev *mdev = priv->mdev;1047 struct mlx5_core_dev *mdev = priv->mdev;
1023 struct mlx5e_port_eth_proto eproto;1048 struct mlx5e_port_eth_proto eproto;
1049 const unsigned long *adver;
1024 bool an_changes = false;1050 bool an_changes = false;
1025 u8 an_disable_admin;1051 u8 an_disable_admin;
1026 bool ext_supported;1052 bool ext_supported;
1027 bool ext_requested;
1028 u8 an_disable_cap;1053 u8 an_disable_cap;
1029 bool an_disable;1054 bool an_disable;
1030 u32 link_modes;1055 u32 link_modes;
1031 u8 an_status;1056 u8 an_status;
1057 u8 autoneg;
1032 u32 speed;1058 u32 speed;
1059 bool ext;
1033 int err;1060 int err;
1034 1061
1035 u32 (*ethtool2ptys_adver_func)(const unsigned long *adver);1062 u32 (*ethtool2ptys_adver_func)(const unsigned long *adver);
1036 1063
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;
1038 1067
1039 ext_requested = !!(link_ksettings->link_modes.advertising[0] >1068 ext = ext_requested(autoneg, adver, speed),
1040 MLX5E_PTYS_EXT ||
1041 link_ksettings->link_modes.advertising[1]);
1042 ext_supported = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);1069 ext_supported = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet);
1043 ext_requested &= ext_supported;1070 if (!ext_supported && ext)
1071 return -EOPNOTSUPP;
1044 1072
1045 speed = link_ksettings->base.speed;1073 ethtool2ptys_adver_func = ext ? mlx5e_ethtool2ptys_ext_adver_link :
1046 ethtool2ptys_adver_func = ext_requested ?
1047 mlx5e_ethtool2ptys_ext_adver_link :
1048 mlx5e_ethtool2ptys_adver_link;1074 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);
1050 if (err) {1076 if (err) {
1051 netdev_err(priv->netdev, "%s: query port eth proto failed: %d\n",1077 netdev_err(priv->netdev, "%s: query port eth proto failed: %d\n",
1052 __func__, err);1078 __func__, err);
1053 goto out;1079 goto out;
1054 }1080 }
1055 link_modes = link_ksettings->base.autoneg == AUTONEG_ENABLE ?1081 link_modes = autoneg == AUTONEG_ENABLE ? ethtool2ptys_adver_func(adver) :
1056 ethtool2ptys_adver_func(link_ksettings->link_modes.advertising) :1082 mlx5e_port_speed2linkmodes(mdev, speed, !ext);
1057 mlx5e_port_speed2linkmodes(mdev, speed);
1058 1083
1059 link_modes = link_modes & eproto.cap;1084 link_modes = link_modes & eproto.cap;
1060 if (!link_modes) {1085 if (!link_modes) {
@@ -1067,14 +1092,14 @@ int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv, · 6 unmodified lines
1067 mlx5_port_query_eth_autoneg(mdev, &an_status, &an_disable_cap,1092 mlx5_port_query_eth_autoneg(mdev, &an_status, &an_disable_cap,
1068 &an_disable_admin);1093 &an_disable_admin);
1069 1094
1070 an_disable = link_ksettings->base.autoneg == AUTONEG_DISABLE;1095 an_disable = autoneg == AUTONEG_DISABLE;
1071 an_changes = ((!an_disable && an_disable_admin) ||1096 an_changes = ((!an_disable && an_disable_admin) ||
1072 (an_disable && !an_disable_admin));1097 (an_disable && !an_disable_admin));
1073 1098
1074 if (!an_changes && link_modes == eproto.admin)1099 if (!an_changes && link_modes == eproto.admin)
1075 goto out;1100 goto out;
1076 1101
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);
1078 mlx5_toggle_port_link(mdev);1103 mlx5_toggle_port_link(mdev);
1079 1104
1080out:1105out:
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
611 return -ENOSPC;611 return -ENOSPC;
612 612
613 if (fs->ring_cookie != RX_CLS_FLOW_DISC)613 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))
615 return -EINVAL;616 return -EINVAL;
616 617
617 switch (fs->flow_type & ~(FLOW_EXT | FLOW_MAC_EXT)) {618 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
331 331
332static void mlx5e_init_frags_partition(struct mlx5e_rq *rq)332static void mlx5e_init_frags_partition(struct mlx5e_rq *rq)
333{333{
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;
335 int i;336 int i;
336 337
337 next_frag.di = &rq->wqe.di[0];338 next_frag.di = &rq->wqe.di[0];
338 next_frag.offset = 0;
339 prev = NULL;
340 339
341 for (i = 0; i < mlx5_wq_cyc_get_size(&rq->wqe.wq); i++) {340 for (i = 0; i < mlx5_wq_cyc_get_size(&rq->wqe.wq); i++) {
342 struct mlx5e_rq_frag_info *frag_info = &rq->wqe.info.arr[0];341 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
1677 struct mlx5e_channel_param *cparam)1676 struct mlx5e_channel_param *cparam)
1678{1677{
1679 struct mlx5e_priv *priv = c->priv;1678 struct mlx5e_priv *priv = c->priv;
1680 int err, tc, max_nch = mlx5e_get_netdev_max_channels(priv->netdev);1679 int err, tc;
1681 1680
1682 for (tc = 0; tc < params->num_tc; tc++) {1681 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;
1684 1683
1685 err = mlx5e_open_txqsq(c, c->priv->tisn[tc], txq_ix,1684 err = mlx5e_open_txqsq(c, c->priv->tisn[tc], txq_ix,
1686 params, &cparam->sq, &c->sq[tc], tc);1685 params, &cparam->sq, &c->sq[tc], tc);
@@ -2438,11 +2437,10 @@ int mlx5e_create_indirect_rqt(struct mlx5e_priv *priv) · 751 unmodified lines
2438 2437
2439int mlx5e_create_direct_rqts(struct mlx5e_priv *priv, struct mlx5e_tir *tirs)2438int mlx5e_create_direct_rqts(struct mlx5e_priv *priv, struct mlx5e_tir *tirs)
2440{2439{
2441 const int max_nch = mlx5e_get_netdev_max_channels(priv->netdev);
2442 int err;2440 int err;
2443 int ix;2441 int ix;
2444 2442
2445 for (ix = 0; ix < max_nch; ix++) {2443 for (ix = 0; ix < priv->max_nch; ix++) {
2446 err = mlx5e_create_rqt(priv, 1 /*size */, &tirs[ix].rqt);2444 err = mlx5e_create_rqt(priv, 1 /*size */, &tirs[ix].rqt);
2447 if (unlikely(err))2445 if (unlikely(err))
2448 goto err_destroy_rqts;2446 goto err_destroy_rqts;
@@ -2460,10 +2458,9 @@ err_destroy_rqts: · 11 unmodified lines
2460 2458
2461void mlx5e_destroy_direct_rqts(struct mlx5e_priv *priv, struct mlx5e_tir *tirs)2459void mlx5e_destroy_direct_rqts(struct mlx5e_priv *priv, struct mlx5e_tir *tirs)
2462{2460{
2463 const int max_nch = mlx5e_get_netdev_max_channels(priv->netdev);
2464 int i;2461 int i;
2465 2462
2466 for (i = 0; i < max_nch; i++)2463 for (i = 0; i < priv->max_nch; i++)
2467 mlx5e_destroy_rqt(priv, &tirs[i].rqt);2464 mlx5e_destroy_rqt(priv, &tirs[i].rqt);
2468}2465}
2469 2466
@@ -2557,7 +2554,7 @@ static void mlx5e_redirect_rqts(struct mlx5e_priv *priv, · 87 unmodified lines
2557 mlx5e_redirect_rqt(priv, rqtn, MLX5E_INDIR_RQT_SIZE, rrp);2554 mlx5e_redirect_rqt(priv, rqtn, MLX5E_INDIR_RQT_SIZE, rrp);
2558 }2555 }
2559 2556
2560 for (ix = 0; ix < mlx5e_get_netdev_max_channels(priv->netdev); ix++) {2557 for (ix = 0; ix < priv->max_nch; ix++) {
2561 struct mlx5e_redirect_rqt_param direct_rrp = {2558 struct mlx5e_redirect_rqt_param direct_rrp = {
2562 .is_rss = false,2559 .is_rss = false,
2563 {2560 {
@@ -2758,7 +2755,7 @@ static int mlx5e_modify_tirs_lro(struct mlx5e_priv *priv) · 194 unmodified lines
2758 goto free_in;2755 goto free_in;
2759 }2756 }
2760 2757
2761 for (ix = 0; ix < mlx5e_get_netdev_max_channels(priv->netdev); ix++) {2758 for (ix = 0; ix < priv->max_nch; ix++) {
2762 err = mlx5_core_modify_tir(mdev, priv->direct_tir[ix].tirn,2759 err = mlx5_core_modify_tir(mdev, priv->direct_tir[ix].tirn,
2763 in, inlen);2760 in, inlen);
2764 if (err)2761 if (err)
@@ -2858,12 +2855,11 @@ static void mlx5e_netdev_set_tcs(struct net_device *netdev) · 93 unmodified lines
2858 2855
2859static void mlx5e_build_tc2txq_maps(struct mlx5e_priv *priv)2856static void mlx5e_build_tc2txq_maps(struct mlx5e_priv *priv)
2860{2857{
2861 int max_nch = mlx5e_get_netdev_max_channels(priv->netdev);
2862 int i, tc;2858 int i, tc;
2863 2859
2864 for (i = 0; i < max_nch; i++)2860 for (i = 0; i < priv->max_nch; i++)
2865 for (tc = 0; tc < priv->profile->max_tc; tc++)2861 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;
2867}2863}
2868 2864
2869static void mlx5e_build_tx2sq_maps(struct mlx5e_priv *priv)2865static 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
2884void mlx5e_activate_priv_channels(struct mlx5e_priv *priv)2880void mlx5e_activate_priv_channels(struct mlx5e_priv *priv)
2885{2881{
2886 int num_txqs = priv->channels.num * priv->channels.params.num_tc;2882 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;
2888 struct net_device *netdev = priv->netdev;2884 struct net_device *netdev = priv->netdev;
2889 2885
2890 mlx5e_netdev_set_tcs(netdev);2886 mlx5e_netdev_set_tcs(netdev);
@@ -3306,7 +3302,6 @@ err_destroy_inner_tirs: · 415 unmodified lines
3306 3302
3307int mlx5e_create_direct_tirs(struct mlx5e_priv *priv, struct mlx5e_tir *tirs)3303int mlx5e_create_direct_tirs(struct mlx5e_priv *priv, struct mlx5e_tir *tirs)
3308{3304{
3309 const int max_nch = mlx5e_get_netdev_max_channels(priv->netdev);
3310 struct mlx5e_tir *tir;3305 struct mlx5e_tir *tir;
3311 void *tirc;3306 void *tirc;
3312 int inlen;3307 int inlen;
@@ -3319,7 +3314,7 @@ int mlx5e_create_direct_tirs(struct mlx5e_priv *priv, struct mlx5e_tir *tirs) · 6 unmodified lines
3319 if (!in)3314 if (!in)
3320 return -ENOMEM;3315 return -ENOMEM;
3321 3316
3322 for (ix = 0; ix < max_nch; ix++) {3317 for (ix = 0; ix < priv->max_nch; ix++) {
3323 memset(in, 0, inlen);3318 memset(in, 0, inlen);
3324 tir = &tirs[ix];3319 tir = &tirs[ix];
3325 tirc = MLX5_ADDR_OF(create_tir_in, in, ctx);3320 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
3358 3353
3359void mlx5e_destroy_direct_tirs(struct mlx5e_priv *priv, struct mlx5e_tir *tirs)3354void mlx5e_destroy_direct_tirs(struct mlx5e_priv *priv, struct mlx5e_tir *tirs)
3360{3355{
3361 const int max_nch = mlx5e_get_netdev_max_channels(priv->netdev);
3362 int i;3356 int i;
3363 3357
3364 for (i = 0; i < max_nch; i++)3358 for (i = 0; i < priv->max_nch; i++)
3365 mlx5e_destroy_tir(priv->mdev, &tirs[i]);3359 mlx5e_destroy_tir(priv->mdev, &tirs[i]);
3366}3360}
3367 3361
@@ -3487,7 +3481,7 @@ void mlx5e_fold_sw_stats64(struct mlx5e_priv *priv, struct rtnl_link_stats64 *s) · 119 unmodified lines
3487{3481{
3488 int i;3482 int i;
3489 3483
3490 for (i = 0; i < mlx5e_get_netdev_max_channels(priv->netdev); i++) {3484 for (i = 0; i < priv->max_nch; i++) {
3491 struct mlx5e_channel_stats *channel_stats = &priv->channel_stats[i];3485 struct mlx5e_channel_stats *channel_stats = &priv->channel_stats[i];
3492 struct mlx5e_rq_stats *xskrq_stats = &channel_stats->xskrq;3486 struct mlx5e_rq_stats *xskrq_stats = &channel_stats->xskrq;
3493 struct mlx5e_rq_stats *rq_stats = &channel_stats->rq;3487 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
4960 return err;4954 return err;
4961 4955
4962 mlx5e_build_nic_params(mdev, &priv->xsk, rss, &priv->channels.params,4956 mlx5e_build_nic_params(mdev, &priv->xsk, rss, &priv->channels.params,
4963 mlx5e_get_netdev_max_channels(netdev),4957 priv->max_nch, netdev->mtu);
4964 netdev->mtu);
4965 4958
4966 mlx5e_timestamp_init(priv);4959 mlx5e_timestamp_init(priv);
4967 4960
@@ -5164,6 +5157,7 @@ static const struct mlx5e_profile mlx5e_nic_profile = { · 196 unmodified lines
5164 .rx_handlers.handle_rx_cqe = mlx5e_handle_rx_cqe,5157 .rx_handlers.handle_rx_cqe = mlx5e_handle_rx_cqe,
5165 .rx_handlers.handle_rx_cqe_mpwqe = mlx5e_handle_rx_cqe_mpwrq,5158 .rx_handlers.handle_rx_cqe_mpwqe = mlx5e_handle_rx_cqe_mpwrq,
5166 .max_tc = MLX5E_MAX_NUM_TC,5159 .max_tc = MLX5E_MAX_NUM_TC,
5160 .rq_groups = MLX5E_NUM_RQ_GROUPS(XSK),
5167};5161};
5168 5162
5169/* mlx5e generic netdev management API (move to en_common.c) */5163/* 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
5181 priv->profile = profile;5175 priv->profile = profile;
5182 priv->ppriv = ppriv;5176 priv->ppriv = ppriv;
5183 priv->msglevel = MLX5E_MSG_LEVEL;5177 priv->msglevel = MLX5E_MSG_LEVEL;
5178 priv->max_nch = netdev->num_rx_queues / max_t(u8, profile->rq_groups, 1);
5184 priv->max_opened_tc = 1;5179 priv->max_opened_tc = 1;
5185 5180
5186 mutex_init(&priv->state_lock);5181 mutex_init(&priv->state_lock);
@@ -5218,7 +5213,7 @@ struct net_device *mlx5e_create_netdev(struct mlx5_core_dev *mdev, · 31 unmodified lines
5218 5213
5219 netdev = alloc_etherdev_mqs(sizeof(struct mlx5e_priv),5214 netdev = alloc_etherdev_mqs(sizeof(struct mlx5e_priv),
5220 nch * profile->max_tc,5215 nch * profile->max_tc,
5221 nch * MLX5E_NUM_RQ_GROUPS);5216 nch * profile->rq_groups);
5222 if (!netdev) {5217 if (!netdev) {
5223 mlx5_core_err(mdev, "alloc_etherdev_mqs() failed\n");5218 mlx5_core_err(mdev, "alloc_etherdev_mqs() failed\n");
5224 return NULL;5219 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
1701 .rx_handlers.handle_rx_cqe = mlx5e_handle_rx_cqe_rep,1701 .rx_handlers.handle_rx_cqe = mlx5e_handle_rx_cqe_rep,
1702 .rx_handlers.handle_rx_cqe_mpwqe = mlx5e_handle_rx_cqe_mpwrq,1702 .rx_handlers.handle_rx_cqe_mpwqe = mlx5e_handle_rx_cqe_mpwrq,
1703 .max_tc = 1,1703 .max_tc = 1,
1704 .rq_groups = MLX5E_NUM_RQ_GROUPS(REGULAR),
1704};1705};
1705 1706
1706static const struct mlx5e_profile mlx5e_uplink_rep_profile = {1707static const struct mlx5e_profile mlx5e_uplink_rep_profile = {
@@ -1718,6 +1719,7 @@ static const struct mlx5e_profile mlx5e_uplink_rep_profile = { · 11 unmodified lines
1718 .rx_handlers.handle_rx_cqe = mlx5e_handle_rx_cqe_rep,1719 .rx_handlers.handle_rx_cqe = mlx5e_handle_rx_cqe_rep,
1719 .rx_handlers.handle_rx_cqe_mpwqe = mlx5e_handle_rx_cqe_mpwrq,1720 .rx_handlers.handle_rx_cqe_mpwqe = mlx5e_handle_rx_cqe_mpwrq,
1720 .max_tc = MLX5E_MAX_NUM_TC,1721 .max_tc = MLX5E_MAX_NUM_TC,
1722 .rq_groups = MLX5E_NUM_RQ_GROUPS(REGULAR),
1721};1723};
1722 1724
1723static bool1725static 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
172 172
173 memset(s, 0, sizeof(*s));173 memset(s, 0, sizeof(*s));
174 174
175 for (i = 0; i < mlx5e_get_netdev_max_channels(priv->netdev); i++) {175 for (i = 0; i < priv->max_nch; i++) {
176 struct mlx5e_channel_stats *channel_stats =176 struct mlx5e_channel_stats *channel_stats =
177 &priv->channel_stats[i];177 &priv->channel_stats[i];
178 struct mlx5e_xdpsq_stats *xdpsq_red_stats = &channel_stats->xdpsq;178 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
1395 1395
1396static int mlx5e_grp_channels_get_num_stats(struct mlx5e_priv *priv)1396static int mlx5e_grp_channels_get_num_stats(struct mlx5e_priv *priv)
1397{1397{
1398 int max_nch = mlx5e_get_netdev_max_channels(priv->netdev);1398 int max_nch = priv->max_nch;
1399 1399
1400 return (NUM_RQ_STATS * max_nch) +1400 return (NUM_RQ_STATS * max_nch) +
1401 (NUM_CH_STATS * max_nch) +1401 (NUM_CH_STATS * max_nch) +
@@ -1409,8 +1409,8 @@ static int mlx5e_grp_channels_get_num_stats(struct mlx5e_priv *priv) · 7 unmodified lines
1409static int mlx5e_grp_channels_fill_strings(struct mlx5e_priv *priv, u8 *data,1409static int mlx5e_grp_channels_fill_strings(struct mlx5e_priv *priv, u8 *data,
1410 int idx)1410 int idx)
1411{1411{
1412 int max_nch = mlx5e_get_netdev_max_channels(priv->netdev);
1413 bool is_xsk = priv->xsk.ever_used;1412 bool is_xsk = priv->xsk.ever_used;
1413 int max_nch = priv->max_nch;
1414 int i, j, tc;1414 int i, j, tc;
1415 1415
1416 for (i = 0; i < max_nch; i++)1416 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
1452static int mlx5e_grp_channels_fill_stats(struct mlx5e_priv *priv, u64 *data,1452static int mlx5e_grp_channels_fill_stats(struct mlx5e_priv *priv, u64 *data,
1453 int idx)1453 int idx)
1454{1454{
1455 int max_nch = mlx5e_get_netdev_max_channels(priv->netdev);
1456 bool is_xsk = priv->xsk.ever_used;1455 bool is_xsk = priv->xsk.ever_used;
1456 int max_nch = priv->max_nch;
1457 int i, j, tc;1457 int i, j, tc;
1458 1458
1459 for (i = 0; i < max_nch; i++)1459 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
1230void mlx5e_tc_update_neigh_used_value(struct mlx5e_neigh_hash_entry *nhe)1230void mlx5e_tc_update_neigh_used_value(struct mlx5e_neigh_hash_entry *nhe)
1231{1231{
1232 struct mlx5e_neigh *m_neigh = &nhe->m_neigh;1232 struct mlx5e_neigh *m_neigh = &nhe->m_neigh;
1233 u64 bytes, packets, lastuse = 0;
1234 struct mlx5e_tc_flow *flow;1233 struct mlx5e_tc_flow *flow;
1235 struct mlx5e_encap_entry *e;1234 struct mlx5e_encap_entry *e;
1236 struct mlx5_fc *counter;1235 struct mlx5_fc *counter;
1237 struct neigh_table *tbl;1236 struct neigh_table *tbl;
1238 bool neigh_used = false;1237 bool neigh_used = false;
1239 struct neighbour *n;1238 struct neighbour *n;
1239 u64 lastuse;
1240 1240
1241 if (m_neigh->family == AF_INET)1241 if (m_neigh->family == AF_INET)
1242 tbl = &arp_tbl;1242 tbl = &arp_tbl;
@@ -1256,7 +1256,7 @@ void mlx5e_tc_update_neigh_used_value(struct mlx5e_neigh_hash_entry *nhe) · 13 unmodified lines
1256 encaps[efi->index]);1256 encaps[efi->index]);
1257 if (flow->flags & MLX5E_TC_FLOW_OFFLOADED) {1257 if (flow->flags & MLX5E_TC_FLOW_OFFLOADED) {
1258 counter = mlx5e_tc_get_counter(flow);1258 counter = mlx5e_tc_get_counter(flow);
1259 mlx5_fc_query_cached(counter, &bytes, &packets, &lastuse);1259 lastuse = mlx5_fc_query_lastuse(counter);
1260 if (time_after((unsigned long)lastuse, nhe->reported_lastuse)) {1260 if (time_after((unsigned long)lastuse, nhe->reported_lastuse)) {
1261 neigh_used = true;1261 neigh_used = true;
1262 break;1262 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
49static void mlx5e_handle_tx_dim(struct mlx5e_txqsq *sq)49static void mlx5e_handle_tx_dim(struct mlx5e_txqsq *sq)
50{50{
51 struct mlx5e_sq_stats *stats = sq->stats;51 struct mlx5e_sq_stats *stats = sq->stats;
52 struct dim_sample dim_sample;52 struct dim_sample dim_sample = {};
53 53
54 if (unlikely(!test_bit(MLX5E_SQ_STATE_AM, &sq->state)))54 if (unlikely(!test_bit(MLX5E_SQ_STATE_AM, &sq->state)))
55 return;55 return;
@@ -61,7 +61,7 @@ static void mlx5e_handle_tx_dim(struct mlx5e_txqsq *sq) · 5 unmodified lines
61static void mlx5e_handle_rx_dim(struct mlx5e_rq *rq)61static void mlx5e_handle_rx_dim(struct mlx5e_rq *rq)
62{62{
63 struct mlx5e_rq_stats *stats = rq->stats;63 struct mlx5e_rq_stats *stats = rq->stats;
64 struct dim_sample dim_sample;64 struct dim_sample dim_sample = {};
65 65
66 if (unlikely(!test_bit(MLX5E_RQ_STATE_AM, &rq->state)))66 if (unlikely(!test_bit(MLX5E_RQ_STATE_AM, &rq->state)))
67 return;67 return;
drivers/net/ethernet/mellanox/mlx5/core/fs_core.h+3−2
@@ -68,7 +68,7 @@ enum fs_flow_table_type { · 67 unmodified lines
68 FS_FT_SNIFFER_RX = 0X5,68 FS_FT_SNIFFER_RX = 0X5,
69 FS_FT_SNIFFER_TX = 0X6,69 FS_FT_SNIFFER_TX = 0X6,
70 FS_FT_RDMA_RX = 0X7,70 FS_FT_RDMA_RX = 0X7,
71 FS_FT_MAX_TYPE = FS_FT_SNIFFER_TX,71 FS_FT_MAX_TYPE = FS_FT_RDMA_RX,
72};72};
73 73
74enum fs_flow_table_op_mod {74enum fs_flow_table_op_mod {
@@ -275,7 +275,8 @@ void mlx5_cleanup_fs(struct mlx5_core_dev *dev); · 200 unmodified lines
275 (type == FS_FT_FDB) ? MLX5_CAP_ESW_FLOWTABLE_FDB(mdev, cap) : \275 (type == FS_FT_FDB) ? MLX5_CAP_ESW_FLOWTABLE_FDB(mdev, cap) : \
276 (type == FS_FT_SNIFFER_RX) ? MLX5_CAP_FLOWTABLE_SNIFFER_RX(mdev, cap) : \276 (type == FS_FT_SNIFFER_RX) ? MLX5_CAP_FLOWTABLE_SNIFFER_RX(mdev, cap) : \
277 (type == FS_FT_SNIFFER_TX) ? MLX5_CAP_FLOWTABLE_SNIFFER_TX(mdev, cap) : \277 (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))\
279 )280 )
280 281
281#endif282#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
369}369}
370EXPORT_SYMBOL(mlx5_fc_query);370EXPORT_SYMBOL(mlx5_fc_query);
371 371
372u64 mlx5_fc_query_lastuse(struct mlx5_fc *counter)
373{
374 return counter->cache.lastuse;
375}
376
372void mlx5_fc_query_cached(struct mlx5_fc *counter,377void mlx5_fc_query_cached(struct mlx5_fc *counter,
373 u64 *bytes, u64 *packets, u64 *lastuse)378 u64 *bytes, u64 *packets, u64 *lastuse)
374{379{
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
88 netdev->mtu = netdev->max_mtu;88 netdev->mtu = netdev->max_mtu;
89 89
90 mlx5e_build_nic_params(mdev, NULL, &priv->rss_params, &priv->channels.params,90 mlx5e_build_nic_params(mdev, NULL, &priv->rss_params, &priv->channels.params,
91 mlx5e_get_netdev_max_channels(netdev),91 priv->max_nch, netdev->mtu);
92 netdev->mtu);
93 mlx5i_build_nic_params(mdev, &priv->channels.params);92 mlx5i_build_nic_params(mdev, &priv->channels.params);
94 93
95 mlx5e_timestamp_init(priv);94 mlx5e_timestamp_init(priv);
@@ -118,11 +117,10 @@ void mlx5i_cleanup(struct mlx5e_priv *priv) · 22 unmodified lines
118 117
119static void mlx5i_grp_sw_update_stats(struct mlx5e_priv *priv)118static void mlx5i_grp_sw_update_stats(struct mlx5e_priv *priv)
120{119{
121 int max_nch = mlx5e_get_netdev_max_channels(priv->netdev);
122 struct mlx5e_sw_stats s = { 0 };120 struct mlx5e_sw_stats s = { 0 };
123 int i, j;121 int i, j;
124 122
125 for (i = 0; i < max_nch; i++) {123 for (i = 0; i < priv->max_nch; i++) {
126 struct mlx5e_channel_stats *channel_stats;124 struct mlx5e_channel_stats *channel_stats;
127 struct mlx5e_rq_stats *rq_stats;125 struct mlx5e_rq_stats *rq_stats;
128 126
@@ -436,6 +434,7 @@ static const struct mlx5e_profile mlx5i_nic_profile = { · 307 unmodified lines
436 .rx_handlers.handle_rx_cqe = mlx5i_handle_rx_cqe,434 .rx_handlers.handle_rx_cqe = mlx5i_handle_rx_cqe,
437 .rx_handlers.handle_rx_cqe_mpwqe = NULL, /* Not supported */435 .rx_handlers.handle_rx_cqe_mpwqe = NULL, /* Not supported */
438 .max_tc = MLX5I_MAX_NUM_TC,436 .max_tc = MLX5I_MAX_NUM_TC,
437 .rq_groups = MLX5E_NUM_RQ_GROUPS(REGULAR),
439};438};
440 439
441/* mlx5i netdev NDos */440/* 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
355 .rx_handlers.handle_rx_cqe = mlx5i_handle_rx_cqe,355 .rx_handlers.handle_rx_cqe = mlx5i_handle_rx_cqe,
356 .rx_handlers.handle_rx_cqe_mpwqe = NULL, /* Not supported */356 .rx_handlers.handle_rx_cqe_mpwqe = NULL, /* Not supported */
357 .max_tc = MLX5I_MAX_NUM_TC,357 .max_tc = MLX5I_MAX_NUM_TC,
358 .rq_groups = MLX5E_NUM_RQ_GROUPS(REGULAR),
358};359};
359 360
360const struct mlx5e_profile *mlx5i_pkey_get_profile(void)361const 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
6330 return 0;6330 return 0;
6331 6331
6332err_sp2_pci_driver_register:6332err_sp2_pci_driver_register:
6333 mlxsw_pci_driver_unregister(&mlxsw_sp2_pci_driver);6333 mlxsw_pci_driver_unregister(&mlxsw_sp1_pci_driver);
6334err_sp1_pci_driver_register:6334err_sp1_pci_driver_register:
6335 mlxsw_core_driver_unregister(&mlxsw_sp2_driver);6335 mlxsw_core_driver_unregister(&mlxsw_sp2_driver);
6336err_sp2_core_driver_register:6336err_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
951int mlxsw_sp_nve_init(struct mlxsw_sp *mlxsw_sp);951int mlxsw_sp_nve_init(struct mlxsw_sp *mlxsw_sp);
952void mlxsw_sp_nve_fini(struct mlxsw_sp *mlxsw_sp);952void mlxsw_sp_nve_fini(struct mlxsw_sp *mlxsw_sp);
953 953
954/* spectrum_nve_vxlan.c */
955int mlxsw_sp_nve_inc_parsing_depth_get(struct mlxsw_sp *mlxsw_sp);
956void mlxsw_sp_nve_inc_parsing_depth_put(struct mlxsw_sp *mlxsw_sp);
957
954#endif958#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
437 MLXSW_SP1_SB_PR_CPU_SIZE, true, false),437 MLXSW_SP1_SB_PR_CPU_SIZE, true, false),
438};438};
439 439
440#define MLXSW_SP2_SB_PR_INGRESS_SIZE 38128752440#define MLXSW_SP2_SB_PR_INGRESS_SIZE 35297568
441#define MLXSW_SP2_SB_PR_EGRESS_SIZE 38128752441#define MLXSW_SP2_SB_PR_EGRESS_SIZE 35297568
442#define MLXSW_SP2_SB_PR_CPU_SIZE (256 * 1000)442#define MLXSW_SP2_SB_PR_CPU_SIZE (256 * 1000)
443 443
444/* Order according to mlxsw_sp2_sb_pool_dess */444/* 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
775 ops->fini(nve);775 ops->fini(nve);
776 mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ADJ, 1,776 mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ADJ, 1,
777 nve->tunnel_index);777 nve->tunnel_index);
778 memset(&nve->config, 0, sizeof(nve->config));
778 }779 }
779 nve->num_nve_tunnels--;780 nve->num_nve_tunnels--;
780}781}
drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.h+1−0
@@ -29,6 +29,7 @@ struct mlxsw_sp_nve { · 28 unmodified lines
29 unsigned int num_max_mc_entries[MLXSW_SP_L3_PROTO_MAX];29 unsigned int num_max_mc_entries[MLXSW_SP_L3_PROTO_MAX];
30 u32 tunnel_index;30 u32 tunnel_index;
31 u16 ul_rif_index; /* Reserved for Spectrum */31 u16 ul_rif_index; /* Reserved for Spectrum */
32 unsigned int inc_parsing_depth_refs;
32};33};
33 34
34struct mlxsw_sp_nve_ops {35struct 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
103 config->udp_dport = cfg->dst_port;103 config->udp_dport = cfg->dst_port;
104}104}
105 105
106static int mlxsw_sp_nve_parsing_set(struct mlxsw_sp *mlxsw_sp,106static int __mlxsw_sp_nve_parsing_set(struct mlxsw_sp *mlxsw_sp,
107 unsigned int parsing_depth,107 unsigned int parsing_depth,
108 __be16 udp_dport)108 __be16 udp_dport)
109{109{
110 char mprs_pl[MLXSW_REG_MPRS_LEN];110 char mprs_pl[MLXSW_REG_MPRS_LEN];
111 111
@@ -113,6 +113,56 @@ static int mlxsw_sp_nve_parsing_set(struct mlxsw_sp *mlxsw_sp, · 1 unmodified line
113 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mprs), mprs_pl);113 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(mprs), mprs_pl);
114}114}
115 115
116static 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
126static 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
139err_nve_parsing_set:
140 mlxsw_sp->nve->inc_parsing_depth_refs--;
141 return err;
142}
143
144static 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
152int 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
159void 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
116static void166static void
117mlxsw_sp_nve_vxlan_config_prepare(char *tngcr_pl,167mlxsw_sp_nve_vxlan_config_prepare(char *tngcr_pl,
118 const struct mlxsw_sp_nve_config *config)168 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
176 struct mlxsw_sp *mlxsw_sp = nve->mlxsw_sp;226 struct mlxsw_sp *mlxsw_sp = nve->mlxsw_sp;
177 int err;227 int err;
178 228
179 err = mlxsw_sp_nve_parsing_set(mlxsw_sp,229 err = __mlxsw_sp_nve_inc_parsing_depth_get(mlxsw_sp, config->udp_dport);
180 MLXSW_SP_NVE_VXLAN_PARSING_DEPTH,
181 config->udp_dport);
182 if (err)230 if (err)
183 return err;231 return err;
184 232
@@ -203,8 +251,7 @@ err_promote_decap: · 18 unmodified lines
203err_rtdp_set:251err_rtdp_set:
204 mlxsw_sp1_nve_vxlan_config_clear(mlxsw_sp);252 mlxsw_sp1_nve_vxlan_config_clear(mlxsw_sp);
205err_config_set:253err_config_set:
206 mlxsw_sp_nve_parsing_set(mlxsw_sp, MLXSW_SP_NVE_DEFAULT_PARSING_DEPTH,254 __mlxsw_sp_nve_inc_parsing_depth_put(mlxsw_sp, 0);
207 config->udp_dport);
208 return err;255 return err;
209}256}
210 257
@@ -216,8 +263,7 @@ static void mlxsw_sp1_nve_vxlan_fini(struct mlxsw_sp_nve *nve) · 5 unmodified lines
216 mlxsw_sp_router_nve_demote_decap(mlxsw_sp, config->ul_tb_id,263 mlxsw_sp_router_nve_demote_decap(mlxsw_sp, config->ul_tb_id,
217 config->ul_proto, &config->ul_sip);264 config->ul_proto, &config->ul_sip);
218 mlxsw_sp1_nve_vxlan_config_clear(mlxsw_sp);265 mlxsw_sp1_nve_vxlan_config_clear(mlxsw_sp);
219 mlxsw_sp_nve_parsing_set(mlxsw_sp, MLXSW_SP_NVE_DEFAULT_PARSING_DEPTH,266 __mlxsw_sp_nve_inc_parsing_depth_put(mlxsw_sp, 0);
220 config->udp_dport);
221}267}
222 268
223static int269static int
@@ -320,9 +366,7 @@ static int mlxsw_sp2_nve_vxlan_init(struct mlxsw_sp_nve *nve, · 96 unmodified lines
320 struct mlxsw_sp *mlxsw_sp = nve->mlxsw_sp;366 struct mlxsw_sp *mlxsw_sp = nve->mlxsw_sp;
321 int err;367 int err;
322 368
323 err = mlxsw_sp_nve_parsing_set(mlxsw_sp,369 err = __mlxsw_sp_nve_inc_parsing_depth_get(mlxsw_sp, config->udp_dport);
324 MLXSW_SP_NVE_VXLAN_PARSING_DEPTH,
325 config->udp_dport);
326 if (err)370 if (err)
327 return err;371 return err;
328 372
@@ -348,8 +392,7 @@ err_promote_decap: · 19 unmodified lines
348err_rtdp_set:392err_rtdp_set:
349 mlxsw_sp2_nve_vxlan_config_clear(mlxsw_sp);393 mlxsw_sp2_nve_vxlan_config_clear(mlxsw_sp);
350err_config_set:394err_config_set:
351 mlxsw_sp_nve_parsing_set(mlxsw_sp, MLXSW_SP_NVE_DEFAULT_PARSING_DEPTH,395 __mlxsw_sp_nve_inc_parsing_depth_put(mlxsw_sp, 0);
352 config->udp_dport);
353 return err;396 return err;
354}397}
355 398
@@ -361,8 +404,7 @@ static void mlxsw_sp2_nve_vxlan_fini(struct mlxsw_sp_nve *nve) · 5 unmodified lines
361 mlxsw_sp_router_nve_demote_decap(mlxsw_sp, config->ul_tb_id,404 mlxsw_sp_router_nve_demote_decap(mlxsw_sp, config->ul_tb_id,
362 config->ul_proto, &config->ul_sip);405 config->ul_proto, &config->ul_sip);
363 mlxsw_sp2_nve_vxlan_config_clear(mlxsw_sp);406 mlxsw_sp2_nve_vxlan_config_clear(mlxsw_sp);
364 mlxsw_sp_nve_parsing_set(mlxsw_sp, MLXSW_SP_NVE_DEFAULT_PARSING_DEPTH,407 __mlxsw_sp_nve_inc_parsing_depth_put(mlxsw_sp, 0);
365 config->udp_dport);
366}408}
367 409
368const struct mlxsw_sp_nve_ops mlxsw_sp2_nve_vxlan_ops = {410const 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
979{979{
980 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;980 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
981 struct mlxsw_sp_port *tmp;981 struct mlxsw_sp_port *tmp;
982 u16 orig_ing_types = 0;
983 u16 orig_egr_types = 0;
984 int err;
982 int i;985 int i;
983 986
984 /* MTPPPC configures timestamping globally, not per port. Find the987 /* 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
986 */989 */
987 for (i = 1; i < mlxsw_core_max_ports(mlxsw_sp->core); i++) {990 for (i = 1; i < mlxsw_core_max_ports(mlxsw_sp->core); i++) {
988 tmp = mlxsw_sp->ports[i];991 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 }
989 if (tmp && tmp != mlxsw_sp_port) {996 if (tmp && tmp != mlxsw_sp_port) {
990 ing_types |= tmp->ptp.ing_types;997 ing_types |= tmp->ptp.ing_types;
991 egr_types |= tmp->ptp.egr_types;998 egr_types |= tmp->ptp.egr_types;
992 }999 }
993 }1000 }
994 1001
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
995 return mlxsw_sp1_ptp_mtpppc_set(mlxsw_sp_port->mlxsw_sp,1012 return mlxsw_sp1_ptp_mtpppc_set(mlxsw_sp_port->mlxsw_sp,
996 ing_types, egr_types);1013 ing_types, egr_types);
997}1014}
drivers/net/ethernet/mscc/ocelot.c+1−0
@@ -1818,6 +1818,7 @@ EXPORT_SYMBOL(ocelot_init); · 1817 unmodified lines
1818 1818
1819void ocelot_deinit(struct ocelot *ocelot)1819void ocelot_deinit(struct ocelot *ocelot)
1820{1820{
1821 cancel_delayed_work(&ocelot->stats_work);
1821 destroy_workqueue(ocelot->stats_queue);1822 destroy_workqueue(ocelot->stats_queue);
1822 mutex_destroy(&ocelot->stats_lock);1823 mutex_destroy(&ocelot->stats_lock);
1823 ocelot_ace_deinit();1824 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
444 data = nfp_pr_et(data, "hw_rx_csum_complete");444 data = nfp_pr_et(data, "hw_rx_csum_complete");
445 data = nfp_pr_et(data, "hw_rx_csum_err");445 data = nfp_pr_et(data, "hw_rx_csum_err");
446 data = nfp_pr_et(data, "rx_replace_buf_alloc_fail");446 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");
448 data = nfp_pr_et(data, "hw_tx_csum");448 data = nfp_pr_et(data, "hw_tx_csum");
449 data = nfp_pr_et(data, "hw_tx_inner_csum");449 data = nfp_pr_et(data, "hw_tx_inner_csum");
450 data = nfp_pr_et(data, "tx_gather");450 data = nfp_pr_et(data, "tx_gather");
451 data = nfp_pr_et(data, "tx_lso");451 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");
453 data = nfp_pr_et(data, "tx_tls_ooo");453 data = nfp_pr_et(data, "tx_tls_ooo");
454 data = nfp_pr_et(data, "tx_tls_drop_no_sync_data");454 data = nfp_pr_et(data, "tx_tls_drop_no_sync_data");
455 455
drivers/net/ethernet/ni/Kconfig+1−1
@@ -11,7 +11,7 @@ config NET_VENDOR_NI · 10 unmodified lines
11 11
12 Note that the answer to this question doesn't directly affect the12 Note that the answer to this question doesn't directly affect the
13 kernel: saying N will just cause the configurator to skip all13 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.
15 If you say Y, you will be asked for your specific device in the15 If you say Y, you will be asked for your specific device in the
16 following questions.16 following questions.
17 17
drivers/net/ethernet/packetengines/Kconfig+3−3
@@ -1,10 +1,10 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2#2#
3# Packet engine device configuration3# Packet Engines device configuration
4#4#
5 5
6config NET_VENDOR_PACKET_ENGINES6config NET_VENDOR_PACKET_ENGINES
7 bool "Packet Engine devices"7 bool "Packet Engines devices"
8 default y8 default y
9 depends on PCI9 depends on PCI
10 ---help---10 ---help---
@@ -12,7 +12,7 @@ config NET_VENDOR_PACKET_ENGINES · 1 unmodified line
12 12
13 Note that the answer to this question doesn't directly affect the13 Note that the answer to this question doesn't directly affect the
14 kernel: saying N will just cause the configurator to skip all14 kernel: saying N will just cause the configurator to skip all
15 the questions about packet engine devices. If you say Y, you will15 the questions about Packet Engines devices. If you say Y, you will
16 be asked for your specific card in the following questions.16 be asked for your specific card in the following questions.
17 17
18if NET_VENDOR_PACKET_ENGINES18if NET_VENDOR_PACKET_ENGINES
drivers/net/ethernet/packetengines/Makefile+1−1
@@ -1,6 +1,6 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2#2#
3# Makefile for the Packet Engine network device drivers.3# Makefile for the Packet Engines network device drivers.
4#4#
5 5
6obj-$(CONFIG_HAMACHI) += hamachi.o6obj-$(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
1093 snprintf(bit_name, 30,1093 snprintf(bit_name, 30,
1094 p_aeu->bit_name, num);1094 p_aeu->bit_name, num);
1095 else1095 else
1096 strncpy(bit_name,1096 strlcpy(bit_name,
1097 p_aeu->bit_name, 30);1097 p_aeu->bit_name, 30);
1098 1098
1099 /* We now need to pass bitmask in its1099 /* 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
442 /* Vendor specific information */442 /* Vendor specific information */
443 dev->vendor_id = cdev->vendor_id;443 dev->vendor_id = cdev->vendor_id;
444 dev->vendor_part_id = cdev->device_id;444 dev->vendor_part_id = cdev->device_id;
445 dev->hw_ver = 0;445 dev->hw_ver = cdev->chip_rev;
446 dev->fw_ver = (FW_MAJOR_VERSION << 24) | (FW_MINOR_VERSION << 16) |446 dev->fw_ver = (FW_MAJOR_VERSION << 24) | (FW_MINOR_VERSION << 16) |
447 (FW_REVISION_VERSION << 8) | (FW_ENGINEERING_VERSION);447 (FW_REVISION_VERSION << 8) | (FW_ENGINEERING_VERSION);
448 448
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
206 ul_header->csum_insert_offset = skb->csum_offset;206 ul_header->csum_insert_offset = skb->csum_offset;
207 ul_header->csum_enabled = 1;207 ul_header->csum_enabled = 1;
208 if (ip4h->protocol == IPPROTO_UDP)208 if (ip4h->protocol == IPPROTO_UDP)
209 ul_header->udp_ip4_ind = 1;209 ul_header->udp_ind = 1;
210 else210 else
211 ul_header->udp_ip4_ind = 0;211 ul_header->udp_ind = 0;
212 212
213 /* Changing remaining fields to network order */213 /* Changing remaining fields to network order */
214 hdr++;214 hdr++;
@@ -239,6 +239,7 @@ rmnet_map_ipv6_ul_csum_header(void *ip6hdr, · 24 unmodified lines
239 struct rmnet_map_ul_csum_header *ul_header,239 struct rmnet_map_ul_csum_header *ul_header,
240 struct sk_buff *skb)240 struct sk_buff *skb)
241{241{
242 struct ipv6hdr *ip6h = (struct ipv6hdr *)ip6hdr;
242 __be16 *hdr = (__be16 *)ul_header, offset;243 __be16 *hdr = (__be16 *)ul_header, offset;
243 244
244 offset = htons((__force u16)(skb_transport_header(skb) -245 offset = htons((__force u16)(skb_transport_header(skb) -
@@ -246,7 +247,11 @@ rmnet_map_ipv6_ul_csum_header(void *ip6hdr, · 1 unmodified line
246 ul_header->csum_start_offset = offset;247 ul_header->csum_start_offset = offset;
247 ul_header->csum_insert_offset = skb->csum_offset;248 ul_header->csum_insert_offset = skb->csum_offset;
248 ul_header->csum_enabled = 1;249 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;
250 255
251 /* Changing remaining fields to network order */256 /* Changing remaining fields to network order */
252 hdr++;257 hdr++;
@@ -419,7 +424,7 @@ sw_csum: · 166 unmodified lines
419 ul_header->csum_start_offset = 0;424 ul_header->csum_start_offset = 0;
420 ul_header->csum_insert_offset = 0;425 ul_header->csum_insert_offset = 0;
421 ul_header->csum_enabled = 0;426 ul_header->csum_enabled = 0;
422 ul_header->udp_ip4_ind = 0;427 ul_header->udp_ind = 0;
423 428
424 priv->stats.csum_sw++;429 priv->stats.csum_sw++;
425}430}
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
6136 if (ret)6136 if (ret)
6137 return ret;6137 return ret;
6138 6138
6139 if (tp->supports_gmii)6139 if (!tp->supports_gmii)
6140 phy_remove_link_mode(phydev,
6141 ETHTOOL_LINK_MODE_1000baseT_Half_BIT);
6142 else
6143 phy_set_max_speed(phydev, SPEED_100);6140 phy_set_max_speed(phydev, SPEED_100);
6144 6141
6145 phy_support_asym_pause(phydev);6142 phy_support_asym_pause(phydev);
@@ -6589,13 +6586,18 @@ static int rtl_alloc_irq(struct rtl8169_private *tp) · 443 unmodified lines
6589{6586{
6590 unsigned int flags;6587 unsigned int flags;
6591 6588
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:
6593 rtl_unlock_config_regs(tp);6591 rtl_unlock_config_regs(tp);
6594 RTL_W8(tp, Config2, RTL_R8(tp, Config2) & ~MSIEnable);6592 RTL_W8(tp, Config2, RTL_R8(tp, Config2) & ~MSIEnable);
6595 rtl_lock_config_regs(tp);6593 rtl_lock_config_regs(tp);
6594 /* fall through */
6595 case RTL_GIGA_MAC_VER_07 ... RTL_GIGA_MAC_VER_24:
6596 flags = PCI_IRQ_LEGACY;6596 flags = PCI_IRQ_LEGACY;
6597 } else {6597 break;
6598 default:
6598 flags = PCI_IRQ_ALL_TYPES;6599 flags = PCI_IRQ_ALL_TYPES;
6600 break;
6599 }6601 }
6600 6602
6601 return pci_alloc_irq_vectors(tp->pci_dev, 1, 1, flags);6603 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
2208 2208
2209 if (fen_info->fi->fib_nh_is_v6) {2209 if (fen_info->fi->fib_nh_is_v6) {
2210 NL_SET_ERR_MSG_MOD(info->extack, "IPv6 gateway with IPv4 route is not supported");2210 NL_SET_ERR_MSG_MOD(info->extack, "IPv6 gateway with IPv4 route is not supported");
2211 kfree(fib_work);
2211 return notifier_from_errno(-EINVAL);2212 return notifier_from_errno(-EINVAL);
2212 }2213 }
2213 if (fen_info->fi->nh) {2214 if (fen_info->fi->nh) {
2214 NL_SET_ERR_MSG_MOD(info->extack, "IPv4 route with nexthop objects is not supported");2215 NL_SET_ERR_MSG_MOD(info->extack, "IPv4 route with nexthop objects is not supported");
2216 kfree(fib_work);
2215 return notifier_from_errno(-EINVAL);2217 return notifier_from_errno(-EINVAL);
2216 }2218 }
2217 }2219 }
drivers/net/ethernet/samsung/Kconfig+1−1
@@ -11,7 +11,7 @@ config NET_VENDOR_SAMSUNG · 10 unmodified lines
11 say Y.11 say Y.
12 12
13 Note that the answer to this question does not directly affect13 Note that the answer to this question does not directly affect
14 the kernel: saying N will just case the configurator to skip all14 the kernel: saying N will just cause the configurator to skip all
15 the questions about Samsung chipsets. If you say Y, you will be asked15 the questions about Samsung chipsets. If you say Y, you will be asked
16 for your specific chipset/driver in the following questions.16 for your specific chipset/driver in the following questions.
17 17
drivers/net/ethernet/smsc/smc911x.c+1−0
@@ -712,6 +712,7 @@ static void smc911x_phy_detect(struct net_device *dev) · 711 unmodified lines
712 /* Found an external PHY */712 /* Found an external PHY */
713 break;713 break;
714 }714 }
715 /* Else, fall through */
715 default:716 default:
716 /* Internal media only */717 /* Internal media only */
717 SMC_GET_PHY_ID1(lp, 1, id1);718 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
85 u32 value;85 u32 value;
86 86
87 base_register = (queue < 4) ? GMAC_RXQ_CTRL2 : GMAC_RXQ_CTRL3;87 base_register = (queue < 4) ? GMAC_RXQ_CTRL2 : GMAC_RXQ_CTRL3;
88 if (queue >= 4)
89 queue -= 4;
88 90
89 value = readl(ioaddr + base_register);91 value = readl(ioaddr + base_register);
90 92
@@ -102,6 +104,8 @@ static void dwmac4_tx_queue_priority(struct mac_device_info *hw, · 11 unmodified lines
102 u32 value;104 u32 value;
103 105
104 base_register = (queue < 4) ? GMAC_TXQ_PRTY_MAP0 : GMAC_TXQ_PRTY_MAP1;106 base_register = (queue < 4) ? GMAC_TXQ_PRTY_MAP0 : GMAC_TXQ_PRTY_MAP1;
107 if (queue >= 4)
108 queue -= 4;
105 109
106 value = readl(ioaddr + base_register);110 value = readl(ioaddr + base_register);
107 111
drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h+5−2
@@ -44,11 +44,13 @@ · 43 unmodified lines
44#define XGMAC_CORE_INIT_RX 044#define XGMAC_CORE_INIT_RX 0
45#define XGMAC_PACKET_FILTER 0x0000000845#define XGMAC_PACKET_FILTER 0x00000008
46#define XGMAC_FILTER_RA BIT(31)46#define XGMAC_FILTER_RA BIT(31)
47#define XGMAC_FILTER_HPF BIT(10)
47#define XGMAC_FILTER_PCF BIT(7)48#define XGMAC_FILTER_PCF BIT(7)
48#define XGMAC_FILTER_PM BIT(4)49#define XGMAC_FILTER_PM BIT(4)
49#define XGMAC_FILTER_HMC BIT(2)50#define XGMAC_FILTER_HMC BIT(2)
50#define XGMAC_FILTER_PR BIT(0)51#define XGMAC_FILTER_PR BIT(0)
51#define XGMAC_HASH_TABLE(x) (0x00000010 + (x) * 4)52#define XGMAC_HASH_TABLE(x) (0x00000010 + (x) * 4)
53#define XGMAC_MAX_HASH_TABLE 8
52#define XGMAC_RXQ_CTRL0 0x000000a054#define XGMAC_RXQ_CTRL0 0x000000a0
53#define XGMAC_RXQEN(x) GENMASK((x) * 2 + 1, (x) * 2)55#define XGMAC_RXQEN(x) GENMASK((x) * 2 + 1, (x) * 2)
54#define XGMAC_RXQEN_SHIFT(x) ((x) * 2)56#define XGMAC_RXQEN_SHIFT(x) ((x) * 2)
@@ -99,11 +101,12 @@ · 44 unmodified lines
99#define XGMAC_MDIO_ADDR 0x00000200101#define XGMAC_MDIO_ADDR 0x00000200
100#define XGMAC_MDIO_DATA 0x00000204102#define XGMAC_MDIO_DATA 0x00000204
101#define XGMAC_MDIO_C22P 0x00000220103#define XGMAC_MDIO_C22P 0x00000220
102#define XGMAC_ADDR0_HIGH 0x00000300104#define XGMAC_ADDRx_HIGH(x) (0x00000300 + (x) * 0x8)
105#define XGMAC_ADDR_MAX 32
103#define XGMAC_AE BIT(31)106#define XGMAC_AE BIT(31)
104#define XGMAC_DCS GENMASK(19, 16)107#define XGMAC_DCS GENMASK(19, 16)
105#define XGMAC_DCS_SHIFT 16108#define XGMAC_DCS_SHIFT 16
106#define XGMAC_ADDR0_LOW 0x00000304109#define XGMAC_ADDRx_LOW(x) (0x00000304 + (x) * 0x8)
107#define XGMAC_ARP_ADDR 0x00000c10110#define XGMAC_ARP_ADDR 0x00000c10
108#define XGMAC_TIMESTAMP_STATUS 0x00000d20111#define XGMAC_TIMESTAMP_STATUS 0x00000d20
109#define XGMAC_TXTSC BIT(15)112#define XGMAC_TXTSC BIT(15)
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c+78−9
@@ -4,6 +4,8 @@ · 3 unmodified lines
4 * stmmac XGMAC support.4 * stmmac XGMAC support.
5 */5 */
6 6
7#include <linux/bitrev.h>
8#include <linux/crc32.h>
7#include "stmmac.h"9#include "stmmac.h"
8#include "dwxgmac2.h"10#include "dwxgmac2.h"
9 11
@@ -106,6 +108,8 @@ static void dwxgmac2_rx_queue_prio(struct mac_device_info *hw, u32 prio, · 96 unmodified lines
106 u32 value, reg;108 u32 value, reg;
107 109
108 reg = (queue < 4) ? XGMAC_RXQ_CTRL2 : XGMAC_RXQ_CTRL3;110 reg = (queue < 4) ? XGMAC_RXQ_CTRL2 : XGMAC_RXQ_CTRL3;
111 if (queue >= 4)
112 queue -= 4;
109 113
110 value = readl(ioaddr + reg);114 value = readl(ioaddr + reg);
111 value &= ~XGMAC_PSRQ(queue);115 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
169 u32 value, reg;173 u32 value, reg;
170 174
171 reg = (queue < 4) ? XGMAC_MTL_RXQ_DMA_MAP0 : XGMAC_MTL_RXQ_DMA_MAP1;175 reg = (queue < 4) ? XGMAC_MTL_RXQ_DMA_MAP0 : XGMAC_MTL_RXQ_DMA_MAP1;
176 if (queue >= 4)
177 queue -= 4;
172 178
173 value = readl(ioaddr + reg);179 value = readl(ioaddr + reg);
174 value &= ~XGMAC_QxMDMACH(queue);180 value &= ~XGMAC_QxMDMACH(queue);
@@ -278,10 +284,10 @@ static void dwxgmac2_set_umac_addr(struct mac_device_info *hw, · 103 unmodified lines
278 u32 value;284 u32 value;
279 285
280 value = (addr[5] << 8) | addr[4];286 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));
282 288
283 value = (addr[3] << 24) | (addr[2] << 16) | (addr[1] << 8) | addr[0];289 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));
285}291}
286 292
287static void dwxgmac2_get_umac_addr(struct mac_device_info *hw,293static 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
291 u32 hi_addr, lo_addr;297 u32 hi_addr, lo_addr;
292 298
293 /* Read the MAC address from the hardware */299 /* Read the MAC address from the hardware */
294 hi_addr = readl(ioaddr + XGMAC_ADDR0_HIGH);300 hi_addr = readl(ioaddr + XGMAC_ADDRx_HIGH(reg_n));
295 lo_addr = readl(ioaddr + XGMAC_ADDR0_LOW);301 lo_addr = readl(ioaddr + XGMAC_ADDRx_LOW(reg_n));
296 302
297 /* Extract the MAC address from the high and low words */303 /* Extract the MAC address from the high and low words */
298 addr[0] = lo_addr & 0xff;304 addr[0] = lo_addr & 0xff;
@@ -303,19 +309,82 @@ static void dwxgmac2_get_umac_addr(struct mac_device_info *hw, · 4 unmodified lines
303 addr[5] = (hi_addr >> 8) & 0xff;309 addr[5] = (hi_addr >> 8) & 0xff;
304}310}
305 311
312static 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
306static void dwxgmac2_set_filter(struct mac_device_info *hw,335static void dwxgmac2_set_filter(struct mac_device_info *hw,
307 struct net_device *dev)336 struct net_device *dev)
308{337{
309 void __iomem *ioaddr = (void __iomem *)dev->base_addr;338 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));
311 348
312 if (dev->flags & IFF_PROMISC) {349 if (dev->flags & IFF_PROMISC) {
313 value |= XGMAC_FILTER_PR | XGMAC_FILTER_PCF;350 value |= XGMAC_FILTER_PR;
351 value |= XGMAC_FILTER_PCF;
314 } else if ((dev->flags & IFF_ALLMULTI) ||352 } else if ((dev->flags & IFF_ALLMULTI) ||
315 (netdev_mc_count(dev) > HASH_TABLE_SIZE)) {353 (netdev_mc_count(dev) > hw->multicast_filter_bins)) {
316 value |= XGMAC_FILTER_PM;354 value |= XGMAC_FILTER_PM;
317 writel(~0x0, ioaddr + XGMAC_HASH_TABLE(0));355
318 writel(~0x0, ioaddr + XGMAC_HASH_TABLE(1));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 }
319 }388 }
320 389
321 writel(value, ioaddr + XGMAC_PACKET_FILTER);390 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
814 phylink_set(mac_supported, 10baseT_Full);814 phylink_set(mac_supported, 10baseT_Full);
815 phylink_set(mac_supported, 100baseT_Half);815 phylink_set(mac_supported, 100baseT_Half);
816 phylink_set(mac_supported, 100baseT_Full);816 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);
817 820
818 phylink_set(mac_supported, Autoneg);821 phylink_set(mac_supported, Autoneg);
819 phylink_set(mac_supported, Pause);822 phylink_set(mac_supported, Pause);
820 phylink_set(mac_supported, Asym_Pause);823 phylink_set(mac_supported, Asym_Pause);
821 phylink_set_port_modes(mac_supported);824 phylink_set_port_modes(mac_supported);
822 825
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
831 /* Cut down 1G if asked to */826 /* Cut down 1G if asked to */
832 if ((max_speed > 0) && (max_speed < 1000)) {827 if ((max_speed > 0) && (max_speed < 1000)) {
833 phylink_set(mask, 1000baseT_Full);828 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
1295 "(%s) dma_rx_phy=0x%08x\n", __func__,1290 "(%s) dma_rx_phy=0x%08x\n", __func__,
1296 (u32)rx_q->dma_rx_phy);1291 (u32)rx_q->dma_rx_phy);
1297 1292
1293 stmmac_clear_rx_descriptors(priv, queue);
1294
1298 for (i = 0; i < DMA_RX_SIZE; i++) {1295 for (i = 0; i < DMA_RX_SIZE; i++) {
1299 struct dma_desc *p;1296 struct dma_desc *p;
1300 1297
@@ -1312,8 +1309,6 @@ static int init_dma_rx_desc_rings(struct net_device *dev, gfp_t flags) · 11 unmodified lines
1312 rx_q->cur_rx = 0;1309 rx_q->cur_rx = 0;
1313 rx_q->dirty_rx = (unsigned int)(i - DMA_RX_SIZE);1310 rx_q->dirty_rx = (unsigned int)(i - DMA_RX_SIZE);
1314 1311
1315 stmmac_clear_rx_descriptors(priv, queue);
1316
1317 /* Setup the chained descriptor addresses */1312 /* Setup the chained descriptor addresses */
1318 if (priv->mode == STMMAC_CHAIN_MODE) {1313 if (priv->mode == STMMAC_CHAIN_MODE) {
1319 if (priv->extend_desc)1314 if (priv->extend_desc)
@@ -1555,9 +1550,8 @@ static int alloc_dma_rx_desc_resources(struct stmmac_priv *priv) · 235 unmodified lines
1555 goto err_dma;1550 goto err_dma;
1556 }1551 }
1557 1552
1558 rx_q->buf_pool = kmalloc_array(DMA_RX_SIZE,1553 rx_q->buf_pool = kcalloc(DMA_RX_SIZE, sizeof(*rx_q->buf_pool),
1559 sizeof(*rx_q->buf_pool),1554 GFP_KERNEL);
1560 GFP_KERNEL);
1561 if (!rx_q->buf_pool)1555 if (!rx_q->buf_pool)
1562 goto err_dma;1556 goto err_dma;
1563 1557
@@ -1608,15 +1602,15 @@ static int alloc_dma_tx_desc_resources(struct stmmac_priv *priv) · 44 unmodified lines
1608 tx_q->queue_index = queue;1602 tx_q->queue_index = queue;
1609 tx_q->priv_data = priv;1603 tx_q->priv_data = priv;
1610 1604
1611 tx_q->tx_skbuff_dma = kmalloc_array(DMA_TX_SIZE,1605 tx_q->tx_skbuff_dma = kcalloc(DMA_TX_SIZE,
1612 sizeof(*tx_q->tx_skbuff_dma),1606 sizeof(*tx_q->tx_skbuff_dma),
1613 GFP_KERNEL);1607 GFP_KERNEL);
1614 if (!tx_q->tx_skbuff_dma)1608 if (!tx_q->tx_skbuff_dma)
1615 goto err_dma;1609 goto err_dma;
1616 1610
1617 tx_q->tx_skbuff = kmalloc_array(DMA_TX_SIZE,1611 tx_q->tx_skbuff = kcalloc(DMA_TX_SIZE,
1618 sizeof(struct sk_buff *),1612 sizeof(struct sk_buff *),
1619 GFP_KERNEL);1613 GFP_KERNEL);
1620 if (!tx_q->tx_skbuff)1614 if (!tx_q->tx_skbuff)
1621 goto err_dma;1615 goto err_dma;
1622 1616
@@ -3277,9 +3271,11 @@ static inline int stmmac_rx_threshold_count(struct stmmac_rx_queue *rx_q) · 1654 unmodified lines
3277static inline void stmmac_rx_refill(struct stmmac_priv *priv, u32 queue)3271static inline void stmmac_rx_refill(struct stmmac_priv *priv, u32 queue)
3278{3272{
3279 struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue];3273 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);
3281 unsigned int entry = rx_q->dirty_rx;3275 unsigned int entry = rx_q->dirty_rx;
3282 3276
3277 len = DIV_ROUND_UP(priv->dma_buf_sz, PAGE_SIZE) * PAGE_SIZE;
3278
3283 while (dirty-- > 0) {3279 while (dirty-- > 0) {
3284 struct stmmac_rx_buffer *buf = &rx_q->buf_pool[entry];3280 struct stmmac_rx_buffer *buf = &rx_q->buf_pool[entry];
3285 struct dma_desc *p;3281 struct dma_desc *p;
@@ -3297,6 +3293,13 @@ static inline void stmmac_rx_refill(struct stmmac_priv *priv, u32 queue) · 11 unmodified lines
3297 }3293 }
3298 3294
3299 buf->addr = page_pool_get_dma_addr(buf->page);3295 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
3300 stmmac_set_desc_addr(priv, p, buf->addr);3303 stmmac_set_desc_addr(priv, p, buf->addr);
3301 stmmac_refill_desc3(priv, rx_q, p);3304 stmmac_refill_desc3(priv, rx_q, p);
3302 3305
@@ -3431,8 +3434,6 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue) · 128 unmodified lines
3431 skb_copy_to_linear_data(skb, page_address(buf->page),3434 skb_copy_to_linear_data(skb, page_address(buf->page),
3432 frame_len);3435 frame_len);
3433 skb_put(skb, frame_len);3436 skb_put(skb, frame_len);
3434 dma_sync_single_for_device(priv->device, buf->addr,
3435 frame_len, DMA_FROM_DEVICE);
3436 3437
3437 if (netif_msg_pktdata(priv)) {3438 if (netif_msg_pktdata(priv)) {
3438 netdev_dbg(priv->dev, "frame received (%dbytes)",3439 netdev_dbg(priv->dev, "frame received (%dbytes)",
@@ -4319,8 +4320,9 @@ int stmmac_dvr_probe(struct device *device, · 880 unmodified lines
4319 NAPI_POLL_WEIGHT);4320 NAPI_POLL_WEIGHT);
4320 }4321 }
4321 if (queue < priv->plat->tx_queues_to_use) {4322 if (queue < priv->plat->tx_queues_to_use) {
4322 netif_napi_add(ndev, &ch->tx_napi, stmmac_napi_poll_tx,4323 netif_tx_napi_add(ndev, &ch->tx_napi,
4323 NAPI_POLL_WEIGHT);4324 stmmac_napi_poll_tx,
4325 NAPI_POLL_WEIGHT);
4324 }4326 }
4325 }4327 }
4326 4328
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
370 return ERR_PTR(-ENOMEM);370 return ERR_PTR(-ENOMEM);
371 371
372 *mac = of_get_mac_address(np);372 *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
373 plat->interface = of_get_phy_mode(np);380 plat->interface = of_get_phy_mode(np);
374 381
375 /* Some wrapper drivers still rely on phy_node. Let's save it while382 /* 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
37 entry = &priv->tc_entries[i];37 entry = &priv->tc_entries[i];
38 if (!entry->in_use && !first && free)38 if (!entry->in_use && !first && free)
39 first = entry;39 first = entry;
40 if (entry->handle == loc && !free)40 if ((entry->handle == loc) && !free && !entry->is_frag)
41 dup = entry;41 dup = entry;
42 }42 }
43 43
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
788 /* fallthrough, if we release the descriptors788 /* fallthrough, if we release the descriptors
789 * brutally (then we don't care about789 * brutally (then we don't care about
790 * SPIDER_NET_DESCR_CARDOWNED) */790 * SPIDER_NET_DESCR_CARDOWNED) */
791 /* Fall through */
791 792
792 case SPIDER_NET_DESCR_RESPONSE_ERROR:793 case SPIDER_NET_DESCR_RESPONSE_ERROR:
793 case SPIDER_NET_DESCR_PROTECTION_ERROR:794 case SPIDER_NET_DESCR_PROTECTION_ERROR:
drivers/net/ethernet/xscale/Kconfig+1−1
@@ -13,7 +13,7 @@ config NET_VENDOR_XSCALE · 12 unmodified lines
13 13
14 Note that the answer to this question does not directly affect the14 Note that the answer to this question does not directly affect the
15 kernel: saying N will just cause the configurator to skip all15 kernel: saying N will just cause the configurator to skip all
16 the questions about XSacle IXP devices. If you say Y, you will be16 the questions about XScale IXP devices. If you say Y, you will be
17 asked for your specific card in the following questions.17 asked for your specific card in the following questions.
18 18
19if NET_VENDOR_XSCALE19if 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
500 }500 }
501 break;501 break;
502 }502 }
503 /* fall through */
503 504
504 default: /* fall through */505 default:
505 if (bc->hdlctx.calibrate <= 0)506 if (bc->hdlctx.calibrate <= 0)
506 return 0;507 return 0;
507 i = min_t(int, cnt, bc->hdlctx.calibrate);508 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
216 if (IS_ERR(gpiod)) {216 if (IS_ERR(gpiod)) {
217 if (PTR_ERR(gpiod) == -EPROBE_DEFER)217 if (PTR_ERR(gpiod) == -EPROBE_DEFER)
218 return gpiod;218 return gpiod;
219 pr_err("error getting GPIO for fixed link %pOF, proceed without\n",219
220 fixed_link_node);220 if (PTR_ERR(gpiod) != -ENOENT)
221 pr_err("error getting GPIO for fixed link %pOF, proceed without\n",
222 fixed_link_node);
221 gpiod = NULL;223 gpiod = NULL;
222 }224 }
223 225
drivers/net/phy/mscc.c+8−8
@@ -2226,8 +2226,8 @@ static int vsc8514_probe(struct phy_device *phydev) · 2225 unmodified lines
2226 vsc8531->supp_led_modes = VSC85XX_SUPP_LED_MODES;2226 vsc8531->supp_led_modes = VSC85XX_SUPP_LED_MODES;
2227 vsc8531->hw_stats = vsc85xx_hw_stats;2227 vsc8531->hw_stats = vsc85xx_hw_stats;
2228 vsc8531->nstats = ARRAY_SIZE(vsc85xx_hw_stats);2228 vsc8531->nstats = ARRAY_SIZE(vsc85xx_hw_stats);
2229 vsc8531->stats = devm_kmalloc_array(&phydev->mdio.dev, vsc8531->nstats,2229 vsc8531->stats = devm_kcalloc(&phydev->mdio.dev, vsc8531->nstats,
2230 sizeof(u64), GFP_KERNEL);2230 sizeof(u64), GFP_KERNEL);
2231 if (!vsc8531->stats)2231 if (!vsc8531->stats)
2232 return -ENOMEM;2232 return -ENOMEM;
2233 2233
@@ -2251,8 +2251,8 @@ static int vsc8574_probe(struct phy_device *phydev) · 17 unmodified lines
2251 vsc8531->supp_led_modes = VSC8584_SUPP_LED_MODES;2251 vsc8531->supp_led_modes = VSC8584_SUPP_LED_MODES;
2252 vsc8531->hw_stats = vsc8584_hw_stats;2252 vsc8531->hw_stats = vsc8584_hw_stats;
2253 vsc8531->nstats = ARRAY_SIZE(vsc8584_hw_stats);2253 vsc8531->nstats = ARRAY_SIZE(vsc8584_hw_stats);
2254 vsc8531->stats = devm_kmalloc_array(&phydev->mdio.dev, vsc8531->nstats,2254 vsc8531->stats = devm_kcalloc(&phydev->mdio.dev, vsc8531->nstats,
2255 sizeof(u64), GFP_KERNEL);2255 sizeof(u64), GFP_KERNEL);
2256 if (!vsc8531->stats)2256 if (!vsc8531->stats)
2257 return -ENOMEM;2257 return -ENOMEM;
2258 2258
@@ -2281,8 +2281,8 @@ static int vsc8584_probe(struct phy_device *phydev) · 22 unmodified lines
2281 vsc8531->supp_led_modes = VSC8584_SUPP_LED_MODES;2281 vsc8531->supp_led_modes = VSC8584_SUPP_LED_MODES;
2282 vsc8531->hw_stats = vsc8584_hw_stats;2282 vsc8531->hw_stats = vsc8584_hw_stats;
2283 vsc8531->nstats = ARRAY_SIZE(vsc8584_hw_stats);2283 vsc8531->nstats = ARRAY_SIZE(vsc8584_hw_stats);
2284 vsc8531->stats = devm_kmalloc_array(&phydev->mdio.dev, vsc8531->nstats,2284 vsc8531->stats = devm_kcalloc(&phydev->mdio.dev, vsc8531->nstats,
2285 sizeof(u64), GFP_KERNEL);2285 sizeof(u64), GFP_KERNEL);
2286 if (!vsc8531->stats)2286 if (!vsc8531->stats)
2287 return -ENOMEM;2287 return -ENOMEM;
2288 2288
@@ -2311,8 +2311,8 @@ static int vsc85xx_probe(struct phy_device *phydev) · 22 unmodified lines
2311 vsc8531->supp_led_modes = VSC85XX_SUPP_LED_MODES;2311 vsc8531->supp_led_modes = VSC85XX_SUPP_LED_MODES;
2312 vsc8531->hw_stats = vsc85xx_hw_stats;2312 vsc8531->hw_stats = vsc85xx_hw_stats;
2313 vsc8531->nstats = ARRAY_SIZE(vsc85xx_hw_stats);2313 vsc8531->nstats = ARRAY_SIZE(vsc85xx_hw_stats);
2314 vsc8531->stats = devm_kmalloc_array(&phydev->mdio.dev, vsc8531->nstats,2314 vsc8531->stats = devm_kcalloc(&phydev->mdio.dev, vsc8531->nstats,
2315 sizeof(u64), GFP_KERNEL);2315 sizeof(u64), GFP_KERNEL);
2316 if (!vsc8531->stats)2316 if (!vsc8531->stats)
2317 return -ENOMEM;2317 return -ENOMEM;
2318 2318
drivers/net/phy/phy_device.c+6−0
@@ -1774,6 +1774,12 @@ done: · 1773 unmodified lines
1774 phydev->link = status & BMSR_LSTATUS ? 1 : 0;1774 phydev->link = status & BMSR_LSTATUS ? 1 : 0;
1775 phydev->autoneg_complete = status & BMSR_ANEGCOMPLETE ? 1 : 0;1775 phydev->autoneg_complete = status & BMSR_ANEGCOMPLETE ? 1 : 0;
1776 1776
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
1777 return 0;1783 return 0;
1778}1784}
1779EXPORT_SYMBOL(genphy_update_link);1785EXPORT_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
48 if (!phy->last_triggered)48 if (!phy->last_triggered)
49 led_trigger_event(&phy->led_link_trigger->trigger,49 led_trigger_event(&phy->led_link_trigger->trigger,
50 LED_FULL);50 LED_FULL);
51 else
52 led_trigger_event(&phy->last_triggered->trigger, LED_OFF);
51 53
52 led_trigger_event(&phy->last_triggered->trigger, LED_OFF);
53 led_trigger_event(&plt->trigger, LED_FULL);54 led_trigger_event(&plt->trigger, LED_FULL);
54 phy->last_triggered = plt;55 phy->last_triggered = plt;
55 }56 }
drivers/net/phy/phylink.c+6−4
@@ -216,6 +216,8 @@ static int phylink_parse_fixedlink(struct phylink *pl, · 215 unmodified lines
216 pl->supported, true);216 pl->supported, true);
217 linkmode_zero(pl->supported);217 linkmode_zero(pl->supported);
218 phylink_set(pl->supported, MII);218 phylink_set(pl->supported, MII);
219 phylink_set(pl->supported, Pause);
220 phylink_set(pl->supported, Asym_Pause);
219 if (s) {221 if (s) {
220 __set_bit(s->bit, pl->supported);222 __set_bit(s->bit, pl->supported);
221 } else {223 } else {
@@ -990,10 +992,10 @@ void phylink_start(struct phylink *pl) · 768 unmodified lines
990 }992 }
991 if (pl->link_an_mode == MLO_AN_FIXED && pl->get_fixed_state)993 if (pl->link_an_mode == MLO_AN_FIXED && pl->get_fixed_state)
992 mod_timer(&pl->link_poll, jiffies + HZ);994 mod_timer(&pl->link_poll, jiffies + HZ);
993 if (pl->sfp_bus)
994 sfp_upstream_start(pl->sfp_bus);
995 if (pl->phydev)995 if (pl->phydev)
996 phy_start(pl->phydev);996 phy_start(pl->phydev);
997 if (pl->sfp_bus)
998 sfp_upstream_start(pl->sfp_bus);
997}999}
998EXPORT_SYMBOL_GPL(phylink_start);1000EXPORT_SYMBOL_GPL(phylink_start);
999 1001
@@ -1010,10 +1012,10 @@ void phylink_stop(struct phylink *pl) · 10 unmodified lines
1010{1012{
1011 ASSERT_RTNL();1013 ASSERT_RTNL();
1012 1014
1013 if (pl->phydev)
1014 phy_stop(pl->phydev);
1015 if (pl->sfp_bus)1015 if (pl->sfp_bus)
1016 sfp_upstream_stop(pl->sfp_bus);1016 sfp_upstream_stop(pl->sfp_bus);
1017 if (pl->phydev)
1018 phy_stop(pl->phydev);
1017 del_timer_sync(&pl->link_poll);1019 del_timer_sync(&pl->link_poll);
1018 if (pl->link_irq) {1020 if (pl->link_irq) {
1019 free_irq(pl->link_irq, pl);1021 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
1115 .recvmsg = pppoe_recvmsg,1115 .recvmsg = pppoe_recvmsg,
1116 .mmap = sock_no_mmap,1116 .mmap = sock_no_mmap,
1117 .ioctl = pppox_ioctl,1117 .ioctl = pppox_ioctl,
1118#ifdef CONFIG_COMPAT
1119 .compat_ioctl = pppox_compat_ioctl,
1120#endif
1118};1121};
1119 1122
1120static const struct pppox_proto pppoe_proto = {1123static const struct pppox_proto pppoe_proto = {
drivers/net/ppp/pppox.c+13−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
17#include <linux/string.h>17#include <linux/string.h>
18#include <linux/module.h>18#include <linux/module.h>
19#include <linux/kernel.h>19#include <linux/kernel.h>
20#include <linux/compat.h>
20#include <linux/errno.h>21#include <linux/errno.h>
21#include <linux/netdevice.h>22#include <linux/netdevice.h>
22#include <linux/net.h>23#include <linux/net.h>
@@ -98,6 +99,18 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) · 75 unmodified lines
98 99
99EXPORT_SYMBOL(pppox_ioctl);100EXPORT_SYMBOL(pppox_ioctl);
100 101
102#ifdef CONFIG_COMPAT
103int 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
111EXPORT_SYMBOL(pppox_compat_ioctl);
112#endif
113
101static int pppox_create(struct net *net, struct socket *sock, int protocol,114static int pppox_create(struct net *net, struct socket *sock, int protocol,
102 int kern)115 int kern)
103{116{
drivers/net/ppp/pptp.c+3−0
@@ -623,6 +623,9 @@ static const struct proto_ops pptp_ops = { · 622 unmodified lines
623 .recvmsg = sock_no_recvmsg,623 .recvmsg = sock_no_recvmsg,
624 .mmap = sock_no_mmap,624 .mmap = sock_no_mmap,
625 .ioctl = pppox_ioctl,625 .ioctl = pppox_ioctl,
626#ifdef CONFIG_COMPAT
627 .compat_ioctl = pppox_compat_ioctl,
628#endif
626};629};
627 630
628static const struct pppox_proto pppox_pptp_proto = {631static 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
1599 return true;1599 return true;
1600}1600}
1601 1601
1602static struct sk_buff *__tun_build_skb(struct page_frag *alloc_frag, char *buf,1602static struct sk_buff *__tun_build_skb(struct tun_file *tfile,
1603 struct page_frag *alloc_frag, char *buf,
1603 int buflen, int len, int pad)1604 int buflen, int len, int pad)
1604{1605{
1605 struct sk_buff *skb = build_skb(buf, buflen);1606 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
1609 1610
1610 skb_reserve(skb, pad);1611 skb_reserve(skb, pad);
1611 skb_put(skb, len);1612 skb_put(skb, len);
1613 skb_set_owner_w(skb, tfile->socket.sk);
1612 1614
1613 get_page(alloc_frag->page);1615 get_page(alloc_frag->page);
1614 alloc_frag->offset += buflen;1616 alloc_frag->offset += buflen;
@@ -1686,7 +1688,8 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun, · 71 unmodified lines
1686 */1688 */
1687 if (hdr->gso_type || !xdp_prog) {1689 if (hdr->gso_type || !xdp_prog) {
1688 *skb_xdp = 1;1690 *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);
1690 }1693 }
1691 1694
1692 *skb_xdp = 0;1695 *skb_xdp = 0;
@@ -1723,7 +1726,7 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun, · 30 unmodified lines
1723 rcu_read_unlock();1726 rcu_read_unlock();
1724 local_bh_enable();1727 local_bh_enable();
1725 1728
1726 return __tun_build_skb(alloc_frag, buf, buflen, len, pad);1729 return __tun_build_skb(tfile, alloc_frag, buf, buflen, len, pad);
1727 1730
1728err_xdp:1731err_xdp:
1729 put_page(alloc_frag->page);1732 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
282static int read_eprom_word(pegasus_t *pegasus, __u8 index, __u16 *retdata)282static int read_eprom_word(pegasus_t *pegasus, __u8 index, __u16 *retdata)
283{283{
284 int i;284 int i;
285 __u8 tmp;285 __u8 tmp = 0;
286 __le16 retdatai;286 __le16 retdatai;
287 int ret;287 int ret;
288 288
drivers/net/usb/qmi_wwan.c+1−0
@@ -1295,6 +1295,7 @@ static const struct usb_device_id products[] = { · 1294 unmodified lines
1295 {QMI_FIXED_INTF(0x2001, 0x7e3d, 4)}, /* D-Link DWM-222 A2 */1295 {QMI_FIXED_INTF(0x2001, 0x7e3d, 4)}, /* D-Link DWM-222 A2 */
1296 {QMI_FIXED_INTF(0x2020, 0x2031, 4)}, /* Olicard 600 */1296 {QMI_FIXED_INTF(0x2020, 0x2031, 4)}, /* Olicard 600 */
1297 {QMI_FIXED_INTF(0x2020, 0x2033, 4)}, /* BroadMobi BM806U */1297 {QMI_FIXED_INTF(0x2020, 0x2033, 4)}, /* BroadMobi BM806U */
1298 {QMI_FIXED_INTF(0x2020, 0x2060, 4)}, /* BroadMobi BM818 */
1298 {QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */1299 {QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */
1299 {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */1300 {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */
1300 {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */1301 {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
50#define PLA_TEREDO_WAKE_BASE 0xc0c450#define PLA_TEREDO_WAKE_BASE 0xc0c4
51#define PLA_MAR 0xcd0051#define PLA_MAR 0xcd00
52#define PLA_BACKUP 0xd00052#define PLA_BACKUP 0xd000
53#define PAL_BDC_CR 0xd1a053#define PLA_BDC_CR 0xd1a0
54#define PLA_TEREDO_TIMER 0xd2cc54#define PLA_TEREDO_TIMER 0xd2cc
55#define PLA_REALWOW_TIMER 0xd2e855#define PLA_REALWOW_TIMER 0xd2e8
56#define PLA_SUSPEND_FLAG 0xd38a56#define PLA_SUSPEND_FLAG 0xd38a
@@ -274,7 +274,7 @@ · 217 unmodified lines
274#define TEREDO_RS_EVENT_MASK 0x00fe274#define TEREDO_RS_EVENT_MASK 0x00fe
275#define OOB_TEREDO_EN 0x0001275#define OOB_TEREDO_EN 0x0001
276 276
277/* PAL_BDC_CR */277/* PLA_BDC_CR */
278#define ALDPS_PROXY_MODE 0x0001278#define ALDPS_PROXY_MODE 0x0001
279 279
280/* PLA_EFUSE_CMD */280/* PLA_EFUSE_CMD */
@@ -3191,9 +3191,9 @@ static void r8152b_enter_oob(struct r8152 *tp) · 2910 unmodified lines
3191 3191
3192 rtl_rx_vlan_en(tp, true);3192 rtl_rx_vlan_en(tp, true);
3193 3193
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);
3195 ocp_data |= ALDPS_PROXY_MODE;3195 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);
3197 3197
3198 ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);3198 ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
3199 ocp_data |= NOW_IS_OOB | DIS_MCU_CLROOB;3199 ocp_data |= NOW_IS_OOB | DIS_MCU_CLROOB;
@@ -3577,9 +3577,9 @@ static void r8153_enter_oob(struct r8152 *tp) · 377 unmodified lines
3577 3577
3578 rtl_rx_vlan_en(tp, true);3578 rtl_rx_vlan_en(tp, true);
3579 3579
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);
3581 ocp_data |= ALDPS_PROXY_MODE;3581 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);
3583 3583
3584 ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);3584 ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
3585 ocp_data |= NOW_IS_OOB | DIS_MCU_CLROOB;3585 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
413 case SDLA_RET_NO_BUFS:413 case SDLA_RET_NO_BUFS:
414 if (cmd == SDLA_INFORMATION_WRITE)414 if (cmd == SDLA_INFORMATION_WRITE)
415 break;415 break;
416 /* Else, fall through */
416 417
417 default: 418 default:
418 netdev_dbg(dev, "Cmd 0x%02X generated return code 0x%02X\n",419 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
776 u8 indirection_table[IWL_RSS_INDIRECTION_TABLE_SIZE];776 u8 indirection_table[IWL_RSS_INDIRECTION_TABLE_SIZE];
777} __packed; /* RSS_CONFIG_CMD_API_S_VER_1 */777} __packed; /* RSS_CONFIG_CMD_API_S_VER_1 */
778 778
779#define IWL_MULTI_QUEUE_SYNC_MSG_MAX_SIZE 128
780#define IWL_MULTI_QUEUE_SYNC_SENDER_POS 0779#define IWL_MULTI_QUEUE_SYNC_SENDER_POS 0
781#define IWL_MULTI_QUEUE_SYNC_SENDER_MSK 0xf780#define IWL_MULTI_QUEUE_SYNC_SENDER_MSK 0xf
782 781
@@ -812,10 +811,12 @@ struct iwl_rxq_sync_notification { · 29 unmodified lines
812 *811 *
813 * @IWL_MVM_RXQ_EMPTY: empty sync notification812 * @IWL_MVM_RXQ_EMPTY: empty sync notification
814 * @IWL_MVM_RXQ_NOTIF_DEL_BA: notify RSS queues of delBA813 * @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
815 */815 */
816enum iwl_mvm_rxq_notif_type {816enum iwl_mvm_rxq_notif_type {
817 IWL_MVM_RXQ_EMPTY,817 IWL_MVM_RXQ_EMPTY,
818 IWL_MVM_RXQ_NOTIF_DEL_BA,818 IWL_MVM_RXQ_NOTIF_DEL_BA,
819 IWL_MVM_RXQ_NSSN_SYNC,
819};820};
820 821
821/**822/**
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
2438{2438{
2439 u32 img_name_len = le32_to_cpu(dbg_info->img_name_len);2439 u32 img_name_len = le32_to_cpu(dbg_info->img_name_len);
2440 u32 dbg_cfg_name_len = le32_to_cpu(dbg_info->dbg_cfg_name_len);2440 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";
2443 2441
2444 if (img_name_len != IWL_FW_INI_MAX_IMG_NAME_LEN) {2442 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,
2446 IWL_FW_INI_MAX_IMG_NAME_LEN);2446 IWL_FW_INI_MAX_IMG_NAME_LEN);
2447 return;2447 return;
2448 }2448 }
2449 2449
2450 if (dbg_cfg_name_len != IWL_FW_INI_MAX_DBG_CFG_NAME_LEN) {2450 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,
2452 IWL_FW_INI_MAX_DBG_CFG_NAME_LEN);2454 IWL_FW_INI_MAX_DBG_CFG_NAME_LEN);
2453 return;2455 return;
2454 }2456 }
@@ -2775,8 +2777,6 @@ static void _iwl_fw_dbg_apply_point(struct iwl_fw_runtime *fwrt, · 320 unmodified lines
2775 struct iwl_ucode_tlv *tlv = iter;2777 struct iwl_ucode_tlv *tlv = iter;
2776 void *ini_tlv = (void *)tlv->data;2778 void *ini_tlv = (void *)tlv->data;
2777 u32 type = le32_to_cpu(tlv->type);2779 u32 type = le32_to_cpu(tlv->type);
2778 const char invalid_ap_str[] =
2779 "WRT: ext=%d. Invalid apply point %d for %s\n";
2780 2780
2781 switch (type) {2781 switch (type) {
2782 case IWL_UCODE_TLV_TYPE_DEBUG_INFO:2782 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
2786 struct iwl_fw_ini_allocation_data *buf_alloc = ini_tlv;2786 struct iwl_fw_ini_allocation_data *buf_alloc = ini_tlv;
2787 2787
2788 if (pnt != IWL_FW_INI_APPLY_EARLY) {2788 if (pnt != IWL_FW_INI_APPLY_EARLY) {
2789 IWL_ERR(fwrt, invalid_ap_str, ext, pnt,2789 IWL_ERR(fwrt,
2790 "buffer allocation");2790 "WRT: ext=%d. Invalid apply point %d for buffer allocation\n",
2791 ext, pnt);
2791 goto next;2792 goto next;
2792 }2793 }
2793 2794
@@ -2797,8 +2798,9 @@ static void _iwl_fw_dbg_apply_point(struct iwl_fw_runtime *fwrt, · 3 unmodified lines
2797 }2798 }
2798 case IWL_UCODE_TLV_TYPE_HCMD:2799 case IWL_UCODE_TLV_TYPE_HCMD:
2799 if (pnt < IWL_FW_INI_APPLY_AFTER_ALIVE) {2800 if (pnt < IWL_FW_INI_APPLY_AFTER_ALIVE) {
2800 IWL_ERR(fwrt, invalid_ap_str, ext, pnt,2801 IWL_ERR(fwrt,
2801 "host command");2802 "WRT: ext=%d. Invalid apply point %d for host command\n",
2803 ext, pnt);
2802 goto next;2804 goto next;
2803 }2805 }
2804 iwl_fw_dbg_send_hcmd(fwrt, tlv, ext);2806 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
1640 init_completion(&drv->request_firmware_complete);1640 init_completion(&drv->request_firmware_complete);
1641 INIT_LIST_HEAD(&drv->list);1641 INIT_LIST_HEAD(&drv->list);
1642 1642
1643 iwl_load_fw_dbg_tlv(drv->trans->dev, drv->trans);
1644
1643#ifdef CONFIG_IWLWIFI_DEBUGFS1645#ifdef CONFIG_IWLWIFI_DEBUGFS
1644 /* Create the device debugfs entries. */1646 /* Create the device debugfs entries. */
1645 drv->dbgfs_drv = debugfs_create_dir(dev_name(trans->dev),1647 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
1660err_fw:1662err_fw:
1661#ifdef CONFIG_IWLWIFI_DEBUGFS1663#ifdef CONFIG_IWLWIFI_DEBUGFS
1662 debugfs_remove_recursive(drv->dbgfs_drv);1664 debugfs_remove_recursive(drv->dbgfs_drv);
1663 iwl_fw_dbg_free(drv->trans);
1664#endif1665#endif
1666 iwl_fw_dbg_free(drv->trans);
1665 kfree(drv);1667 kfree(drv);
1666err:1668err:
1667 return ERR_PTR(ret);1669 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
755 755
756 for (i = 0; i < n_profiles; i++) {756 for (i = 0; i < n_profiles; i++) {
757 /* the tables start at element 3 */757 /* the tables start at element 3 */
758 static int pos = 3;758 int pos = 3;
759 759
760 /* The EWRD profiles officially go from 2 to 4, but we760 /* The EWRD profiles officially go from 2 to 4, but we
761 * save them in sar_profiles[1-3] (because we don't761 * 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
880 return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, len, &cmd);880 return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, len, &cmd);
881}881}
882 882
883static 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
883int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm)899int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm)
884{900{
885 struct iwl_geo_tx_power_profiles_resp *resp;901 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
909 .data = { data },925 .data = { data },
910 };926 };
911 927
928 if (!iwl_mvm_sar_geo_support(mvm))
929 return -EOPNOTSUPP;
930
912 ret = iwl_mvm_send_cmd(mvm, &cmd);931 ret = iwl_mvm_send_cmd(mvm, &cmd);
913 if (ret) {932 if (ret) {
914 IWL_ERR(mvm, "Failed to get geographic profile info %d\n", ret);933 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
934 int ret, i, j;953 int ret, i, j;
935 u16 cmd_wide_id = WIDE_ID(PHY_OPS_GROUP, GEO_TX_POWER_LIMIT);954 u16 cmd_wide_id = WIDE_ID(PHY_OPS_GROUP, GEO_TX_POWER_LIMIT);
936 955
937 /*956 if (!iwl_mvm_sar_geo_support(mvm))
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)
944 return 0;957 return 0;
945 958
946 ret = iwl_mvm_sar_get_wgds_table(mvm);959 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
207 },207 },
208};208};
209 209
210static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw,210static int __iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
211 enum set_key_cmd cmd,211 enum set_key_cmd cmd,
212 struct ieee80211_vif *vif,212 struct ieee80211_vif *vif,
213 struct ieee80211_sta *sta,213 struct ieee80211_sta *sta,
214 struct ieee80211_key_conf *key);214 struct ieee80211_key_conf *key);
215 215
216void iwl_mvm_ref(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type)216void iwl_mvm_ref(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type)
217{217{
@@ -474,7 +474,19 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) · 256 unmodified lines
474 ieee80211_hw_set(hw, SUPPORTS_VHT_EXT_NSS_BW);474 ieee80211_hw_set(hw, SUPPORTS_VHT_EXT_NSS_BW);
475 ieee80211_hw_set(hw, BUFF_MMPDU_TXQ);475 ieee80211_hw_set(hw, BUFF_MMPDU_TXQ);
476 ieee80211_hw_set(hw, STA_MMPDU_TXQ);476 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);
478 ieee80211_hw_set(hw, TX_FRAG_LIST);490 ieee80211_hw_set(hw, TX_FRAG_LIST);
479 491
480 if (iwl_mvm_has_tlc_offload(mvm)) {492 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
2726 2738
2727 mvmvif->ap_early_keys[i] = NULL;2739 mvmvif->ap_early_keys[i] = NULL;
2728 2740
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);
2730 if (ret)2742 if (ret)
2731 goto out_quota_failed;2743 goto out_quota_failed;
2732 }2744 }
@@ -3494,11 +3506,11 @@ static int iwl_mvm_mac_sched_scan_stop(struct ieee80211_hw *hw, · 761 unmodified lines
3494 return ret;3506 return ret;
3495}3507}
3496 3508
3497static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw,3509static int __iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
3498 enum set_key_cmd cmd,3510 enum set_key_cmd cmd,
3499 struct ieee80211_vif *vif,3511 struct ieee80211_vif *vif,
3500 struct ieee80211_sta *sta,3512 struct ieee80211_sta *sta,
3501 struct ieee80211_key_conf *key)3513 struct ieee80211_key_conf *key)
3502{3514{
3503 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);3515 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
3504 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);3516 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
3553 return -EOPNOTSUPP;3565 return -EOPNOTSUPP;
3554 }3566 }
3555 3567
3556 mutex_lock(&mvm->mutex);
3557
3558 switch (cmd) {3568 switch (cmd) {
3559 case SET_KEY:3569 case SET_KEY:
3560 if ((vif->type == NL80211_IFTYPE_ADHOC ||3570 if ((vif->type == NL80211_IFTYPE_ADHOC ||
@@ -3700,7 +3710,22 @@ static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw, · 139 unmodified lines
3700 ret = -EINVAL;3710 ret = -EINVAL;
3701 }3711 }
3702 3712
3713 return ret;
3714}
3715
3716static 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);
3703 mutex_unlock(&mvm->mutex);3727 mutex_unlock(&mvm->mutex);
3728
3704 return ret;3729 return ret;
3705}3730}
3706 3731
@@ -5041,7 +5066,6 @@ void iwl_mvm_sync_rx_queues_internal(struct iwl_mvm *mvm, · 1334 unmodified lines
5041 u32 qmask = BIT(mvm->trans->num_rx_queues) - 1;5066 u32 qmask = BIT(mvm->trans->num_rx_queues) - 1;
5042 int ret;5067 int ret;
5043 5068
5044 lockdep_assert_held(&mvm->mutex);
5045 5069
5046 if (!iwl_mvm_has_new_rx_api(mvm))5070 if (!iwl_mvm_has_new_rx_api(mvm))
5047 return;5071 return;
@@ -5052,13 +5076,15 @@ void iwl_mvm_sync_rx_queues_internal(struct iwl_mvm *mvm, · 4 unmodified lines
5052 atomic_set(&mvm->queue_sync_counter,5076 atomic_set(&mvm->queue_sync_counter,
5053 mvm->trans->num_rx_queues);5077 mvm->trans->num_rx_queues);
5054 5078
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);
5056 if (ret) {5081 if (ret) {
5057 IWL_ERR(mvm, "Failed to trigger RX queues sync (%d)\n", ret);5082 IWL_ERR(mvm, "Failed to trigger RX queues sync (%d)\n", ret);
5058 goto out;5083 goto out;
5059 }5084 }
5060 5085
5061 if (notif->sync) {5086 if (notif->sync) {
5087 lockdep_assert_held(&mvm->mutex);
5062 ret = wait_event_timeout(mvm->rx_sync_waitq,5088 ret = wait_event_timeout(mvm->rx_sync_waitq,
5063 atomic_read(&mvm->queue_sync_counter) == 0 ||5089 atomic_read(&mvm->queue_sync_counter) == 0 ||
5064 iwl_mvm_is_radio_killed(mvm),5090 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
1664void iwl_mvm_rx_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi,1664void iwl_mvm_rx_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi,
1665 struct iwl_rx_cmd_buffer *rxb, int queue);1665 struct iwl_rx_cmd_buffer *rxb, int queue);
1666int iwl_mvm_notify_rx_queue(struct iwl_mvm *mvm, u32 rxq_mask,1666int iwl_mvm_notify_rx_queue(struct iwl_mvm *mvm, u32 rxq_mask,
1667 const u8 *data, u32 count);1667 const u8 *data, u32 count, bool async);
1668void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,1668void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct napi_struct *napi,
1669 int queue);1669 struct iwl_rx_cmd_buffer *rxb, int queue);
1670void iwl_mvm_rx_tx_cmd(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb);1670void iwl_mvm_rx_tx_cmd(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb);
1671void iwl_mvm_mfu_assert_dump_notif(struct iwl_mvm *mvm,1671void iwl_mvm_mfu_assert_dump_notif(struct iwl_mvm *mvm,
1672 struct iwl_rx_cmd_buffer *rxb);1672 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
1813#endif /* CONFIG_IWLWIFI_DEBUGFS */1813#endif /* CONFIG_IWLWIFI_DEBUGFS */
1814 1814
1815/* rate scaling */1815/* rate scaling */
1816int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, bool sync);1816int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq);
1817void iwl_mvm_update_frame_stats(struct iwl_mvm *mvm, u32 rate, bool agg);1817void iwl_mvm_update_frame_stats(struct iwl_mvm *mvm, u32 rate, bool agg);
1818int rs_pretty_print_rate(char *buf, int bufsz, const u32 rate);1818int rs_pretty_print_rate(char *buf, int bufsz, const u32 rate);
1819void rs_update_last_rssi(struct iwl_mvm *mvm,1819void 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
620 enum iwl_mcc_source src;620 enum iwl_mcc_source src;
621 char mcc[3];621 char mcc[3];
622 struct ieee80211_regdomain *regd;622 struct ieee80211_regdomain *regd;
623 u32 wgds_tbl_idx;623 int wgds_tbl_idx;
624 624
625 lockdep_assert_held(&mvm->mutex);625 lockdep_assert_held(&mvm->mutex);
626 626
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
1088 iwl_mvm_rx_mpdu_mq(mvm, napi, rxb, 0);1088 iwl_mvm_rx_mpdu_mq(mvm, napi, rxb, 0);
1089 else if (unlikely(cmd == WIDE_ID(DATA_PATH_GROUP,1089 else if (unlikely(cmd == WIDE_ID(DATA_PATH_GROUP,
1090 RX_QUEUES_NOTIFICATION)))1090 RX_QUEUES_NOTIFICATION)))
1091 iwl_mvm_rx_queue_notif(mvm, rxb, 0);1091 iwl_mvm_rx_queue_notif(mvm, napi, rxb, 0);
1092 else if (cmd == WIDE_ID(LEGACY_GROUP, FRAME_RELEASE))1092 else if (cmd == WIDE_ID(LEGACY_GROUP, FRAME_RELEASE))
1093 iwl_mvm_rx_frame_release(mvm, napi, rxb, 0);1093 iwl_mvm_rx_frame_release(mvm, napi, rxb, 0);
1094 else if (cmd == WIDE_ID(DATA_PATH_GROUP, RX_NO_DATA_NOTIF))1094 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
1812 iwl_mvm_rx_frame_release(mvm, napi, rxb, queue);1812 iwl_mvm_rx_frame_release(mvm, napi, rxb, queue);
1813 else if (unlikely(cmd == WIDE_ID(DATA_PATH_GROUP,1813 else if (unlikely(cmd == WIDE_ID(DATA_PATH_GROUP,
1814 RX_QUEUES_NOTIFICATION)))1814 RX_QUEUES_NOTIFICATION)))
1815 iwl_mvm_rx_queue_notif(mvm, rxb, queue);1815 iwl_mvm_rx_queue_notif(mvm, napi, rxb, queue);
1816 else if (likely(cmd == WIDE_ID(LEGACY_GROUP, REPLY_RX_MPDU_CMD)))1816 else if (likely(cmd == WIDE_ID(LEGACY_GROUP, REPLY_RX_MPDU_CMD)))
1817 iwl_mvm_rx_mpdu_mq(mvm, napi, rxb, queue);1817 iwl_mvm_rx_mpdu_mq(mvm, napi, rxb, queue);
1818}1818}
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
1197 return tid;1197 return tid;
1198}1198}
1199 1199
1200void 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);
1427done:
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
1433/*1200/*
1434 * mac80211 sends us Tx status1201 * mac80211 sends us Tx status
1435 */1202 */
@@ -1442,8 +1209,9 @@ static void rs_drv_mac80211_tx_status(void *mvm_r, · 6 unmodified lines
1442 struct iwl_op_mode *op_mode = mvm_r;1209 struct iwl_op_mode *op_mode = mvm_r;
1443 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);1210 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);
1444 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);1211 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1212 struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
1445 1213
1446 if (!iwl_mvm_sta_from_mac80211(sta)->vif)1214 if (!mvmsta->vif)
1447 return;1215 return;
1448 1216
1449 if (!ieee80211_is_data(hdr->frame_control) ||1217 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
1584 tbl->expected_tpt = rs_get_expected_tpt_table(lq_sta, column, rate->bw);1352 tbl->expected_tpt = rs_get_expected_tpt_table(lq_sta, column, rate->bw);
1585}1353}
1586 1354
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 */
1362static inline u8 rs_search_tbl(u8 active_tbl)
1363{
1364 return (active_tbl ^ 1) & 1;
1365}
1366
1587static s32 rs_get_best_rate(struct iwl_mvm *mvm,1367static s32 rs_get_best_rate(struct iwl_mvm *mvm,
1588 struct iwl_lq_sta *lq_sta,1368 struct iwl_lq_sta *lq_sta,
1589 struct iwl_scale_tbl_info *tbl, /* "search" */1369 struct iwl_scale_tbl_info *tbl, /* "search" */
@@ -1794,7 +1574,7 @@ static void rs_update_rate_tbl(struct iwl_mvm *mvm, · 204 unmodified lines
1794 struct iwl_scale_tbl_info *tbl)1574 struct iwl_scale_tbl_info *tbl)
1795{1575{
1796 rs_fill_lq_cmd(mvm, sta, lq_sta, &tbl->rate);1576 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);
1798}1578}
1799 1579
1800static bool rs_tweak_rate_tbl(struct iwl_mvm *mvm,1580static 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
1931 struct ieee80211_sta *sta,1711 struct ieee80211_sta *sta,
1932 enum rs_column col_id)1712 enum rs_column col_id)
1933{1713{
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];
1935 struct iwl_scale_tbl_info *search_tbl =1715 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)];
1937 struct rs_rate *rate = &search_tbl->rate;1717 struct rs_rate *rate = &search_tbl->rate;
1938 const struct rs_tx_column *column = &rs_tx_columns[col_id];1718 const struct rs_tx_column *column = &rs_tx_columns[col_id];
1939 const struct rs_tx_column *curr_column = &rs_tx_columns[tbl->column];1719 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
2341 if (!lq_sta->search_better_tbl)2121 if (!lq_sta->search_better_tbl)
2342 active_tbl = lq_sta->active_tbl;2122 active_tbl = lq_sta->active_tbl;
2343 else2123 else
2344 active_tbl = 1 - lq_sta->active_tbl;2124 active_tbl = rs_search_tbl(lq_sta->active_tbl);
2345 2125
2346 tbl = &(lq_sta->lq_info[active_tbl]);2126 tbl = &(lq_sta->lq_info[active_tbl]);
2347 rate = &tbl->rate;2127 rate = &tbl->rate;
@@ -2565,7 +2345,7 @@ lq_update: · 217 unmodified lines
2565 /* If new "search" mode was selected, set up in uCode table */2345 /* If new "search" mode was selected, set up in uCode table */
2566 if (lq_sta->search_better_tbl) {2346 if (lq_sta->search_better_tbl) {
2567 /* Access the "search" table, clear its history. */2347 /* 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)];
2569 rs_rate_scale_clear_tbl_windows(mvm, tbl);2349 rs_rate_scale_clear_tbl_windows(mvm, tbl);
2570 2350
2571 /* Use new "search" start rate */2351 /* Use new "search" start rate */
@@ -2896,7 +2676,7 @@ void rs_update_last_rssi(struct iwl_mvm *mvm, · 324 unmodified lines
2896static void rs_initialize_lq(struct iwl_mvm *mvm,2676static void rs_initialize_lq(struct iwl_mvm *mvm,
2897 struct ieee80211_sta *sta,2677 struct ieee80211_sta *sta,
2898 struct iwl_lq_sta *lq_sta,2678 struct iwl_lq_sta *lq_sta,
2899 enum nl80211_band band, bool update)2679 enum nl80211_band band)
2900{2680{
2901 struct iwl_scale_tbl_info *tbl;2681 struct iwl_scale_tbl_info *tbl;
2902 struct rs_rate *rate;2682 struct rs_rate *rate;
@@ -2908,7 +2688,7 @@ static void rs_initialize_lq(struct iwl_mvm *mvm, · 5 unmodified lines
2908 if (!lq_sta->search_better_tbl)2688 if (!lq_sta->search_better_tbl)
2909 active_tbl = lq_sta->active_tbl;2689 active_tbl = lq_sta->active_tbl;
2910 else2690 else
2911 active_tbl = 1 - lq_sta->active_tbl;2691 active_tbl = rs_search_tbl(lq_sta->active_tbl);
2912 2692
2913 tbl = &(lq_sta->lq_info[active_tbl]);2693 tbl = &(lq_sta->lq_info[active_tbl]);
2914 rate = &tbl->rate;2694 rate = &tbl->rate;
@@ -2926,7 +2706,7 @@ static void rs_initialize_lq(struct iwl_mvm *mvm, · 11 unmodified lines
2926 rs_set_expected_tpt_table(lq_sta, tbl);2706 rs_set_expected_tpt_table(lq_sta, tbl);
2927 rs_fill_lq_cmd(mvm, sta, lq_sta, rate);2707 rs_fill_lq_cmd(mvm, sta, lq_sta, rate);
2928 /* TODO restore station should remember the lq cmd */2708 /* 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);
2930}2710}
2931 2711
2932static void rs_drv_get_rate(void *mvm_r, struct ieee80211_sta *sta,2712static 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
3175 * Called after adding a new station to initialize rate scaling2955 * Called after adding a new station to initialize rate scaling
3176 */2956 */
3177static void rs_drv_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,2957static 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)
3179{2959{
3180 int i, j;2960 int i, j;
3181 struct ieee80211_hw *hw = mvm->hw;2961 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
3186 struct ieee80211_supported_band *sband;2966 struct ieee80211_supported_band *sband;
3187 unsigned long supp; /* must be unsigned long for for_each_set_bit */2967 unsigned long supp; /* must be unsigned long for for_each_set_bit */
3188 2968
2969 lockdep_assert_held(&mvmsta->lq_sta.rs_drv.pers.lock);
2970
3189 /* clear all non-persistent lq data */2971 /* clear all non-persistent lq data */
3190 memset(lq_sta, 0, offsetof(typeof(*lq_sta), pers));2972 memset(lq_sta, 0, offsetof(typeof(*lq_sta), pers));
3191 2973
@@ -3255,7 +3037,7 @@ static void rs_drv_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta, · 63 unmodified lines
3255#ifdef CONFIG_IWLWIFI_DEBUGFS3037#ifdef CONFIG_IWLWIFI_DEBUGFS
3256 iwl_mvm_reset_frame_stats(mvm);3038 iwl_mvm_reset_frame_stats(mvm);
3257#endif3039#endif
3258 rs_initialize_lq(mvm, sta, lq_sta, band, update);3040 rs_initialize_lq(mvm, sta, lq_sta, band);
3259}3041}
3260 3042
3261static void rs_drv_rate_update(void *mvm_r,3043static void rs_drv_rate_update(void *mvm_r,
@@ -3278,6 +3060,258 @@ static void rs_drv_rate_update(void *mvm_r, · 16 unmodified lines
3278 iwl_mvm_rs_rate_init(mvm, sta, sband->band, true);3060 iwl_mvm_rs_rate_init(mvm, sta, sband->band, true);
3279}3061}
3280 3062
3063static 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);
3294done:
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
3300void 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
3281#ifdef CONFIG_MAC80211_DEBUGFS3315#ifdef CONFIG_MAC80211_DEBUGFS
3282static void rs_build_rates_table_from_fixed(struct iwl_mvm *mvm,3316static void rs_build_rates_table_from_fixed(struct iwl_mvm *mvm,
3283 struct iwl_lq_cmd *lq_cmd,3317 struct iwl_lq_cmd *lq_cmd,
@@ -3569,7 +3603,7 @@ static void rs_set_lq_ss_params(struct iwl_mvm *mvm, · 285 unmodified lines
3569 3603
3570 bfersta_ss_params &= ~LQ_SS_BFER_ALLOWED;3604 bfersta_ss_params &= ~LQ_SS_BFER_ALLOWED;
3571 bfersta_lq_cmd->ss_params = cpu_to_le32(bfersta_ss_params);3605 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);
3573 3607
3574 ss_params |= LQ_SS_BFER_ALLOWED;3608 ss_params |= LQ_SS_BFER_ALLOWED;
3575 IWL_DEBUG_RATE(mvm,3609 IWL_DEBUG_RATE(mvm,
@@ -3735,7 +3769,7 @@ static void rs_program_fix_rate(struct iwl_mvm *mvm, · 159 unmodified lines
3735 3769
3736 if (lq_sta->pers.dbg_fixed_rate) {3770 if (lq_sta->pers.dbg_fixed_rate) {
3737 rs_fill_lq_cmd(mvm, NULL, lq_sta, NULL);3771 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);
3739 }3773 }
3740}3774}
3741 3775
@@ -4132,10 +4166,15 @@ static const struct rate_control_ops rs_mvm_ops_drv = { · 390 unmodified lines
4132void iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,4166void iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
4133 enum nl80211_band band, bool update)4167 enum nl80211_band band, bool update)
4134{4168{
4135 if (iwl_mvm_has_tlc_offload(mvm))4169 if (iwl_mvm_has_tlc_offload(mvm)) {
4136 rs_fw_rate_init(mvm, sta, band, update);4170 rs_fw_rate_init(mvm, sta, band, update);
4137 else4171 } else {
4138 rs_drv_rate_init(mvm, sta, band, update);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 }
4139}4178}
4140 4179
4141int iwl_mvm_rate_control_register(void)4180int 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
4165 lq->flags &= ~LQ_FLAG_USE_RTS_MSK;4204 lq->flags &= ~LQ_FLAG_USE_RTS_MSK;
4166 }4205 }
4167 4206
4168 return iwl_mvm_send_lq_cmd(mvm, lq, false);4207 return iwl_mvm_send_lq_cmd(mvm, lq);
4169}4208}
4170 4209
4171/**4210/**
drivers/net/wireless/intel/iwlwifi/mvm/rs.h+2−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
4 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.4 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
5 * Copyright(c) 2015 Intel Mobile Communications GmbH5 * Copyright(c) 2015 Intel Mobile Communications GmbH
6 * Copyright(c) 2017 Intel Deutschland GmbH6 * Copyright(c) 2017 Intel Deutschland GmbH
7 * Copyright(c) 2018 Intel Corporation7 * Copyright(c) 2018 - 2019 Intel Corporation
8 *8 *
9 * Contact Information:9 * Contact Information:
10 * Intel Linux Wireless <linuxwifi@intel.com>10 * Intel Linux Wireless <linuxwifi@intel.com>
@@ -390,6 +390,7 @@ struct iwl_lq_sta { · 379 unmodified lines
390 s8 last_rssi;390 s8 last_rssi;
391 struct rs_rate_stats tx_stats[RS_COLUMN_COUNT][IWL_RATE_COUNT];391 struct rs_rate_stats tx_stats[RS_COLUMN_COUNT][IWL_RATE_COUNT];
392 struct iwl_mvm *drv;392 struct iwl_mvm *drv;
393 spinlock_t lock; /* for races in reinit/update table */
393 } pers;394 } pers;
394};395};
395 396
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
463}463}
464 464
465int iwl_mvm_notify_rx_queue(struct iwl_mvm *mvm, u32 rxq_mask,465int 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)
467{467{
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;
469 u32 data_size = sizeof(*cmd) + count;471 u32 data_size = sizeof(*cmd) + count;
470 int ret;472 int ret;
471 473
472 /* should be DWORD aligned */474 /*
473 if (WARN_ON(count & 3 || count > IWL_MULTI_QUEUE_SYNC_MSG_MAX_SIZE))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)))
474 return -EINVAL;480 return -EINVAL;
475 481
476 cmd = kzalloc(data_size, GFP_KERNEL);
477 if (!cmd)
478 return -ENOMEM;
479
480 cmd->rxq_mask = cpu_to_le32(rxq_mask);482 cmd->rxq_mask = cpu_to_le32(rxq_mask);
481 cmd->count = cpu_to_le32(count);483 cmd->count = cpu_to_le32(count);
482 cmd->flags = 0;484 cmd->flags = 0;
@@ -485,9 +487,8 @@ int iwl_mvm_notify_rx_queue(struct iwl_mvm *mvm, u32 rxq_mask, · 2 unmodified lines
485 ret = iwl_mvm_send_cmd_pdu(mvm,487 ret = iwl_mvm_send_cmd_pdu(mvm,
486 WIDE_ID(DATA_PATH_GROUP,488 WIDE_ID(DATA_PATH_GROUP,
487 TRIGGER_RX_QUEUES_NOTIF_CMD),489 TRIGGER_RX_QUEUES_NOTIF_CMD),
488 0, data_size, cmd);490 async ? CMD_ASYNC : 0, data_size, cmd);
489 491
490 kfree(cmd);
491 return ret;492 return ret;
492}493}
493 494
@@ -503,14 +504,31 @@ static bool iwl_mvm_is_sn_less(u16 sn1, u16 sn2, u16 buffer_size) · 9 unmodified lines
503 !ieee80211_sn_less(sn1, sn2 - buffer_size);504 !ieee80211_sn_less(sn1, sn2 - buffer_size);
504}505}
505 506
507static 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
506#define RX_REORDER_BUF_TIMEOUT_MQ (HZ / 10)519#define RX_REORDER_BUF_TIMEOUT_MQ (HZ / 10)
507 520
521enum iwl_mvm_release_flags {
522 IWL_MVM_RELEASE_SEND_RSS_SYNC = BIT(0),
523 IWL_MVM_RELEASE_FROM_RSS_SYNC = BIT(1),
524};
525
508static void iwl_mvm_release_frames(struct iwl_mvm *mvm,526static void iwl_mvm_release_frames(struct iwl_mvm *mvm,
509 struct ieee80211_sta *sta,527 struct ieee80211_sta *sta,
510 struct napi_struct *napi,528 struct napi_struct *napi,
511 struct iwl_mvm_baid_data *baid_data,529 struct iwl_mvm_baid_data *baid_data,
512 struct iwl_mvm_reorder_buffer *reorder_buf,530 struct iwl_mvm_reorder_buffer *reorder_buf,
513 u16 nssn)531 u16 nssn, u32 flags)
514{532{
515 struct iwl_mvm_reorder_buf_entry *entries =533 struct iwl_mvm_reorder_buf_entry *entries =
516 &baid_data->entries[reorder_buf->queue *534 &baid_data->entries[reorder_buf->queue *
@@ -519,6 +537,18 @@ static void iwl_mvm_release_frames(struct iwl_mvm *mvm, · 2 unmodified lines
519 537
520 lockdep_assert_held(&reorder_buf->lock);538 lockdep_assert_held(&reorder_buf->lock);
521 539
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
522 /* ignore nssn smaller than head sn - this can happen due to timeout */552 /* ignore nssn smaller than head sn - this can happen due to timeout */
523 if (iwl_mvm_is_sn_less(nssn, ssn, reorder_buf->buf_size))553 if (iwl_mvm_is_sn_less(nssn, ssn, reorder_buf->buf_size))
524 goto set_timer;554 goto set_timer;
@@ -529,6 +559,9 @@ static void iwl_mvm_release_frames(struct iwl_mvm *mvm, · 4 unmodified lines
529 struct sk_buff *skb;559 struct sk_buff *skb;
530 560
531 ssn = ieee80211_sn_inc(ssn);561 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);
532 565
533 /*566 /*
534 * Empty the list. Will have more than one frame for A-MSDU.567 * 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
615 sta_id, sn);648 sta_id, sn);
616 iwl_mvm_event_frame_timeout_callback(buf->mvm, mvmsta->vif,649 iwl_mvm_event_frame_timeout_callback(buf->mvm, mvmsta->vif,
617 sta, baid_data->tid);650 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);
619 rcu_read_unlock();653 rcu_read_unlock();
620 } else {654 } else {
621 /*655 /*
@@ -657,7 +691,8 @@ static void iwl_mvm_del_ba(struct iwl_mvm *mvm, int queue, · 35 unmodified lines
657 spin_lock_bh(&reorder_buf->lock);691 spin_lock_bh(&reorder_buf->lock);
658 iwl_mvm_release_frames(mvm, sta, NULL, ba_data, reorder_buf,692 iwl_mvm_release_frames(mvm, sta, NULL, ba_data, reorder_buf,
659 ieee80211_sn_add(reorder_buf->head_sn,693 ieee80211_sn_add(reorder_buf->head_sn,
660 reorder_buf->buf_size));694 reorder_buf->buf_size),
695 0);
661 spin_unlock_bh(&reorder_buf->lock);696 spin_unlock_bh(&reorder_buf->lock);
662 del_timer_sync(&reorder_buf->reorder_timer);697 del_timer_sync(&reorder_buf->reorder_timer);
663 698
@@ -665,8 +700,54 @@ out: · 1 unmodified line
665 rcu_read_unlock();700 rcu_read_unlock();
666}701}
667 702
668void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,703static void iwl_mvm_release_frames_from_notif(struct iwl_mvm *mvm,
669 int queue)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
736out:
737 rcu_read_unlock();
738}
739
740static 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
749void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct napi_struct *napi,
750 struct iwl_rx_cmd_buffer *rxb, int queue)
670{751{
671 struct iwl_rx_packet *pkt = rxb_addr(rxb);752 struct iwl_rx_packet *pkt = rxb_addr(rxb);
672 struct iwl_rxq_sync_notification *notif;753 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
687 case IWL_MVM_RXQ_NOTIF_DEL_BA:768 case IWL_MVM_RXQ_NOTIF_DEL_BA:
688 iwl_mvm_del_ba(mvm, queue, (void *)internal_notif->data);769 iwl_mvm_del_ba(mvm, queue, (void *)internal_notif->data);
689 break;770 break;
771 case IWL_MVM_RXQ_NSSN_SYNC:
772 iwl_mvm_nssn_sync(mvm, napi, queue,
773 (void *)internal_notif->data);
774 break;
690 default:775 default:
691 WARN_ONCE(1, "Invalid identifier %d", internal_notif->type);776 WARN_ONCE(1, "Invalid identifier %d", internal_notif->type);
692 }777 }
@@ -785,7 +870,8 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm, · 92 unmodified lines
785 }870 }
786 871
787 if (ieee80211_is_back_req(hdr->frame_control)) {872 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);
789 goto drop;875 goto drop;
790 }876 }
791 877
@@ -794,7 +880,10 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm, · 2 unmodified lines
794 * If the SN is smaller than the NSSN it might need to first go into880 * If the SN is smaller than the NSSN it might need to first go into
795 * the reorder buffer, in which case we just release up to it and the881 * the reorder buffer, in which case we just release up to it and the
796 * rest of the function will take care of storing it and releasing up to882 * rest of the function will take care of storing it and releasing up to
797 * the nssn883 * 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.
798 */887 */
799 if (!iwl_mvm_is_sn_less(nssn, buffer->head_sn + buffer->buf_size,888 if (!iwl_mvm_is_sn_less(nssn, buffer->head_sn + buffer->buf_size,
800 buffer->buf_size) ||889 buffer->buf_size) ||
@@ -802,7 +891,7 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm, · 1 unmodified line
802 u16 min_sn = ieee80211_sn_less(sn, nssn) ? sn : nssn;891 u16 min_sn = ieee80211_sn_less(sn, nssn) ? sn : nssn;
803 892
804 iwl_mvm_release_frames(mvm, sta, napi, baid_data, buffer,893 iwl_mvm_release_frames(mvm, sta, napi, baid_data, buffer,
805 min_sn);894 min_sn, IWL_MVM_RELEASE_SEND_RSS_SYNC);
806 }895 }
807 896
808 /* drop any oudated packets */897 /* drop any oudated packets */
@@ -813,8 +902,23 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm, · 4 unmodified lines
813 if (!buffer->num_stored && ieee80211_sn_less(sn, nssn)) {902 if (!buffer->num_stored && ieee80211_sn_less(sn, nssn)) {
814 if (iwl_mvm_is_sn_less(buffer->head_sn, nssn,903 if (iwl_mvm_is_sn_less(buffer->head_sn, nssn,
815 buffer->buf_size) &&904 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);
817 buffer->head_sn = nssn;920 buffer->head_sn = nssn;
921 }
818 /* No need to update AMSDU last SN - we are moving the head */922 /* No need to update AMSDU last SN - we are moving the head */
819 spin_unlock_bh(&buffer->lock);923 spin_unlock_bh(&buffer->lock);
820 return false;924 return false;
@@ -829,8 +933,11 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm, · 8 unmodified lines
829 * while technically there is no hole and we can move forward.933 * while technically there is no hole and we can move forward.
830 */934 */
831 if (!buffer->num_stored && sn == buffer->head_sn) {935 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);
833 buffer->head_sn = ieee80211_sn_inc(buffer->head_sn);939 buffer->head_sn = ieee80211_sn_inc(buffer->head_sn);
940 }
834 /* No need to update AMSDU last SN - we are moving the head */941 /* No need to update AMSDU last SN - we are moving the head */
835 spin_unlock_bh(&buffer->lock);942 spin_unlock_bh(&buffer->lock);
836 return false;943 return false;
@@ -875,7 +982,9 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm, · 38 unmodified lines
875 * release notification with up to date NSSN.982 * release notification with up to date NSSN.
876 */983 */
877 if (!amsdu || last_subframe)984 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);
879 988
880 spin_unlock_bh(&buffer->lock);989 spin_unlock_bh(&buffer->lock);
881 return true;990 return true;
@@ -1840,40 +1949,14 @@ void iwl_mvm_rx_monitor_no_data(struct iwl_mvm *mvm, struct napi_struct *napi, · 958 unmodified lines
1840out:1949out:
1841 rcu_read_unlock();1950 rcu_read_unlock();
1842}1951}
1952
1843void iwl_mvm_rx_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi,1953void iwl_mvm_rx_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi,
1844 struct iwl_rx_cmd_buffer *rxb, int queue)1954 struct iwl_rx_cmd_buffer *rxb, int queue)
1845{1955{
1846 struct iwl_rx_packet *pkt = rxb_addr(rxb);1956 struct iwl_rx_packet *pkt = rxb_addr(rxb);
1847 struct iwl_frame_release *release = (void *)pkt->data;1957 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));
1856 1958
1857 if (WARN_ON_ONCE(baid == IWL_RX_REORDER_DATA_INVALID_BAID))1959 iwl_mvm_release_frames_from_notif(mvm, napi, release->baid,
1858 return;1960 le16_to_cpu(release->nssn),
1859 1961 queue, 0);
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
1877out:
1878 rcu_read_unlock();
1879}1962}
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
1684 */1684 */
1685 if (iwl_mvm_has_tlc_offload(mvm))1685 if (iwl_mvm_has_tlc_offload(mvm))
1686 iwl_mvm_rs_add_sta(mvm, mvm_sta);1686 iwl_mvm_rs_add_sta(mvm, mvm_sta);
1687 else
1688 spin_lock_init(&mvm_sta->lq_sta.rs_drv.pers.lock);
1687 1689
1688 iwl_mvm_toggle_tx_ant(mvm, &mvm_sta->tx_ant);1690 iwl_mvm_toggle_tx_ant(mvm, &mvm_sta->tx_ant);
1689 1691
@@ -2421,7 +2423,7 @@ int iwl_mvm_rm_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) · 731 unmodified lines
2421 2423
2422static void iwl_mvm_sync_rxq_del_ba(struct iwl_mvm *mvm, u8 baid)2424static void iwl_mvm_sync_rxq_del_ba(struct iwl_mvm *mvm, u8 baid)
2423{2425{
2424 struct iwl_mvm_delba_notif notif = {2426 struct iwl_mvm_rss_sync_notif notif = {
2425 .metadata.type = IWL_MVM_RXQ_NOTIF_DEL_BA,2427 .metadata.type = IWL_MVM_RXQ_NOTIF_DEL_BA,
2426 .metadata.sync = 1,2428 .metadata.sync = 1,
2427 .delba.baid = baid,2429 .delba.baid = baid,
@@ -2972,7 +2974,7 @@ out: · 544 unmodified lines
2972 IWL_DEBUG_HT(mvm, "Tx aggregation enabled on ra = %pM tid = %d\n",2974 IWL_DEBUG_HT(mvm, "Tx aggregation enabled on ra = %pM tid = %d\n",
2973 sta->addr, tid);2975 sta->addr, tid);
2974 2976
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);
2976}2978}
2977 2979
2978static void iwl_mvm_unreserve_agg_queue(struct iwl_mvm *mvm,2980static 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
343 u32 baid;343 u32 baid;
344} __packed;344} __packed;
345 345
346struct iwl_mvm_delba_notif {346struct iwl_mvm_nssn_sync_data {
347 u32 baid;
348 u32 nssn;
349} __packed;
350
351struct iwl_mvm_rss_sync_notif {
347 struct iwl_mvm_internal_rxq_notif metadata;352 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 };
349} __packed;357} __packed;
350 358
351/**359/**
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
831 unsigned int tcp_payload_len;831 unsigned int tcp_payload_len;
832 unsigned int mss = skb_shinfo(skb)->gso_size;832 unsigned int mss = skb_shinfo(skb)->gso_size;
833 bool ipv4 = (skb->protocol == htons(ETH_P_IP));833 bool ipv4 = (skb->protocol == htons(ETH_P_IP));
834 bool qos = ieee80211_is_data_qos(hdr->frame_control);
834 u16 ip_base_id = ipv4 ? ntohs(ip_hdr(skb)->id) : 0;835 u16 ip_base_id = ipv4 ? ntohs(ip_hdr(skb)->id) : 0;
835 836
836 skb_shinfo(skb)->gso_size = num_subframes * mss;837 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
864 if (tcp_payload_len > mss) {865 if (tcp_payload_len > mss) {
865 skb_shinfo(tmp)->gso_size = mss;866 skb_shinfo(tmp)->gso_size = mss;
866 } else {867 } else {
867 if (ieee80211_is_data_qos(hdr->frame_control)) {868 if (qos) {
868 u8 *qc;869 u8 *qc;
869 870
870 if (ipv4)871 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
653 * this case to clear the state indicating that station creation is in653 * this case to clear the state indicating that station creation is in
654 * progress.654 * progress.
655 */655 */
656int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, bool sync)656int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq)
657{657{
658 struct iwl_host_cmd cmd = {658 struct iwl_host_cmd cmd = {
659 .id = LQ_CMD,659 .id = LQ_CMD,
660 .len = { sizeof(struct iwl_lq_cmd), },660 .len = { sizeof(struct iwl_lq_cmd), },
661 .flags = sync ? 0 : CMD_ASYNC,661 .flags = CMD_ASYNC,
662 .data = { lq, },662 .data = { lq, },
663 };663 };
664 664
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
604 {IWL_PCI_DEVICE(0x2526, 0x40A4, iwl9460_2ac_cfg)},604 {IWL_PCI_DEVICE(0x2526, 0x40A4, iwl9460_2ac_cfg)},
605 {IWL_PCI_DEVICE(0x2526, 0x4234, iwl9560_2ac_cfg_soc)},605 {IWL_PCI_DEVICE(0x2526, 0x4234, iwl9560_2ac_cfg_soc)},
606 {IWL_PCI_DEVICE(0x2526, 0x42A4, iwl9462_2ac_cfg_soc)},606 {IWL_PCI_DEVICE(0x2526, 0x42A4, iwl9462_2ac_cfg_soc)},
607 {IWL_PCI_DEVICE(0x2526, 0x6010, iwl9260_2ac_160_cfg)},
607 {IWL_PCI_DEVICE(0x2526, 0x6014, iwl9260_2ac_160_cfg)},608 {IWL_PCI_DEVICE(0x2526, 0x6014, iwl9260_2ac_160_cfg)},
608 {IWL_PCI_DEVICE(0x2526, 0x8014, iwl9260_2ac_160_cfg)},609 {IWL_PCI_DEVICE(0x2526, 0x8014, iwl9260_2ac_160_cfg)},
609 {IWL_PCI_DEVICE(0x2526, 0x8010, iwl9260_2ac_160_cfg)},610 {IWL_PCI_DEVICE(0x2526, 0x8010, iwl9260_2ac_160_cfg)},
610 {IWL_PCI_DEVICE(0x2526, 0xA014, iwl9260_2ac_160_cfg)},611 {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)},
611 {IWL_PCI_DEVICE(0x271B, 0x0010, iwl9160_2ac_cfg)},614 {IWL_PCI_DEVICE(0x271B, 0x0010, iwl9160_2ac_cfg)},
612 {IWL_PCI_DEVICE(0x271B, 0x0014, iwl9160_2ac_cfg)},615 {IWL_PCI_DEVICE(0x271B, 0x0014, iwl9160_2ac_cfg)},
613 {IWL_PCI_DEVICE(0x271B, 0x0210, iwl9160_2ac_cfg)},616 {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
435 DMA_TO_DEVICE);435 DMA_TO_DEVICE);
436 }436 }
437 437
438 meta->tbs = 0;
439
438 if (trans->cfg->use_tfh) {440 if (trans->cfg->use_tfh) {
439 struct iwl_tfh_tfd *tfd_fh = (void *)tfd;441 struct iwl_tfh_tfd *tfd_fh = (void *)tfd;
440 442
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
3617 hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).portid,3617 hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).portid,
3618 cb->nlh->nlmsg_seq, &hwsim_genl_family,3618 cb->nlh->nlmsg_seq, &hwsim_genl_family,
3619 NLM_F_MULTI, HWSIM_CMD_GET_RADIO);3619 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 {
3621 res = -EMSGSIZE;3624 res = -EMSGSIZE;
3622 genl_dump_check_consistent(cb, hdr);3625 }
3623 genlmsg_end(skb, hdr);
3624 }3626 }
3625 3627
3626done:3628done:
drivers/net/wireless/marvell/mwifiex/main.h+1−0
@@ -124,6 +124,7 @@ enum { · 123 unmodified lines
124 124
125#define MWIFIEX_MAX_TOTAL_SCAN_TIME (MWIFIEX_TIMER_10S - MWIFIEX_TIMER_1S)125#define MWIFIEX_MAX_TOTAL_SCAN_TIME (MWIFIEX_TIMER_10S - MWIFIEX_TIMER_1S)
126 126
127#define WPA_GTK_OUI_OFFSET 2
127#define RSN_GTK_OUI_OFFSET 2128#define RSN_GTK_OUI_OFFSET 2
128 129
129#define MWIFIEX_OUI_NOT_PRESENT 0130#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
181 u8 ret = MWIFIEX_OUI_NOT_PRESENT;181 u8 ret = MWIFIEX_OUI_NOT_PRESENT;
182 182
183 if (has_vendor_hdr(bss_desc->bcn_wpa_ie, WLAN_EID_VENDOR_SPECIFIC)) {183 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);
185 oui = &mwifiex_wpa_oui[cipher][0];186 oui = &mwifiex_wpa_oui[cipher][0];
186 ret = mwifiex_search_oui_in_ie(iebody, oui);187 ret = mwifiex_search_oui_in_ie(iebody, oui);
187 if (ret)188 if (ret)
drivers/nfc/nfcmrvl/main.c+2−2
@@ -244,7 +244,7 @@ void nfcmrvl_chip_reset(struct nfcmrvl_private *priv) · 243 unmodified lines
244 /* Reset possible fault of previous session */244 /* Reset possible fault of previous session */
245 clear_bit(NFCMRVL_PHY_ERROR, &priv->flags);245 clear_bit(NFCMRVL_PHY_ERROR, &priv->flags);
246 246
247 if (priv->config.reset_n_io) {247 if (gpio_is_valid(priv->config.reset_n_io)) {
248 nfc_info(priv->dev, "reset the chip\n");248 nfc_info(priv->dev, "reset the chip\n");
249 gpio_set_value(priv->config.reset_n_io, 0);249 gpio_set_value(priv->config.reset_n_io, 0);
250 usleep_range(5000, 10000);250 usleep_range(5000, 10000);
@@ -255,7 +255,7 @@ void nfcmrvl_chip_reset(struct nfcmrvl_private *priv) · 4 unmodified lines
255 255
256void nfcmrvl_chip_halt(struct nfcmrvl_private *priv)256void nfcmrvl_chip_halt(struct nfcmrvl_private *priv)
257{257{
258 if (priv->config.reset_n_io)258 if (gpio_is_valid(priv->config.reset_n_io))
259 gpio_set_value(priv->config.reset_n_io, 0);259 gpio_set_value(priv->config.reset_n_io, 0);
260}260}
261 261
drivers/nfc/nfcmrvl/uart.c+2−2
@@ -26,7 +26,7 @@ · 25 unmodified lines
26static unsigned int hci_muxed;26static unsigned int hci_muxed;
27static unsigned int flow_control;27static unsigned int flow_control;
28static unsigned int break_control;28static unsigned int break_control;
29static unsigned int reset_n_io;29static int reset_n_io = -EINVAL;
30 30
31/*31/*
32** NFCMRVL NCI OPS32** NFCMRVL NCI OPS
@@ -231,5 +231,5 @@ MODULE_PARM_DESC(break_control, "Tell if UART driver must drive break signal."); · 198 unmodified lines
231module_param(hci_muxed, uint, 0);231module_param(hci_muxed, uint, 0);
232MODULE_PARM_DESC(hci_muxed, "Tell if transport is muxed in HCI one.");232MODULE_PARM_DESC(hci_muxed, "Tell if transport is muxed in HCI one.");
233 233
234module_param(reset_n_io, uint, 0);234module_param(reset_n_io, int, 0);
235MODULE_PARM_DESC(reset_n_io, "GPIO that is wired to RESET_N signal.");235MODULE_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
305 305
306 /* No configuration for USB */306 /* No configuration for USB */
307 memset(&config, 0, sizeof(config));307 memset(&config, 0, sizeof(config));
308 config.reset_n_io = -EINVAL;
308 309
309 nfc_info(&udev->dev, "intf %p id %p\n", intf, id);310 nfc_info(&udev->dev, "intf %p id %p\n", intf, id);
310 311
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
333 333
334 transaction = (struct nfc_evt_transaction *)devm_kzalloc(dev,334 transaction = (struct nfc_evt_transaction *)devm_kzalloc(dev,
335 skb->len - 2, GFP_KERNEL);335 skb->len - 2, GFP_KERNEL);
336 if (!transaction)
337 return -ENOMEM;
336 338
337 transaction->aid_len = skb->data[1];339 transaction->aid_len = skb->data[1];
338 memcpy(transaction->aid, &skb->data[2], transaction->aid_len);340 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
317 317
318 transaction = (struct nfc_evt_transaction *)devm_kzalloc(dev,318 transaction = (struct nfc_evt_transaction *)devm_kzalloc(dev,
319 skb->len - 2, GFP_KERNEL);319 skb->len - 2, GFP_KERNEL);
320 if (!transaction)
321 return -ENOMEM;
320 322
321 transaction->aid_len = skb->data[1];323 transaction->aid_len = skb->data[1];
322 memcpy(transaction->aid, &skb->data[2],324 memcpy(transaction->aid, &skb->data[2],
drivers/ntb/msi.c+0−5
@@ -6,11 +6,6 @@ · 5 unmodified lines
6#include <linux/msi.h>6#include <linux/msi.h>
7#include <linux/pci.h>7#include <linux/pci.h>
8 8
9MODULE_LICENSE("Dual BSD/GPL");
10MODULE_VERSION("0.1");
11MODULE_AUTHOR("Logan Gunthorpe <logang@deltatee.com>");
12MODULE_DESCRIPTION("NTB MSI Interrupt Library");
13
14struct ntb_msi {9struct ntb_msi {
15 u64 base_addr;10 u64 base_addr;
16 u64 end_addr;11 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
224 if (!config->base_dev)224 if (!config->base_dev)
225 return -EINVAL;225 return -EINVAL;
226 226
227 if (nvmem->read_only)227 if (nvmem->read_only) {
228 nvmem->eeprom = bin_attr_ro_root_nvmem;228 if (config->root_only)
229 else229 nvmem->eeprom = bin_attr_ro_root_nvmem;
230 nvmem->eeprom = bin_attr_rw_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 }
231 nvmem->eeprom.attr.name = "eeprom";238 nvmem->eeprom.attr.name = "eeprom";
232 nvmem->eeprom.size = nvmem->size;239 nvmem->eeprom.size = nvmem->size;
233#ifdef CONFIG_DEBUG_LOCK_ALLOC240#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
1025 if (state == PCI_D0) {1025 if (state == PCI_D0) {
1026 pci_platform_power_transition(dev, PCI_D0);1026 pci_platform_power_transition(dev, PCI_D0);
1027 /*1027 /*
1028 * Mandatory power management transition delays are1028 * Mandatory power management transition delays, see
1029 * handled in the PCIe portdrv resume hooks.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.
1030 */1033 */
1031 if (dev->runtime_d3cold) {1034 if (dev->runtime_d3cold) {
1035 if (dev->d3cold_delay && !dev->imm_ready)
1036 msleep(dev->d3cold_delay);
1032 /*1037 /*
1033 * When powering on a bridge from D3cold, the1038 * When powering on a bridge from D3cold, the
1034 * whole hierarchy may be powered on into1039 * 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
4602 4607
4603 return pci_dev_wait(dev, "PM D3->D0", PCIE_RESET_READY_POLL_MS);4608 return pci_dev_wait(dev, "PM D3->D0", PCIE_RESET_READY_POLL_MS);
4604}4609}
4605
4606/**4610/**
4607 * pcie_wait_for_link_delay - Wait until link is active or inactive4611 * pcie_wait_for_link - Wait until link is active or inactive
4608 * @pdev: Bridge device4612 * @pdev: Bridge device
4609 * @active: waiting for active or inactive?4613 * @active: waiting for active or inactive?
4610 * @delay: Delay to wait after link has become active (in ms)
4611 *4614 *
4612 * Use this to wait till link becomes active or inactive.4615 * Use this to wait till link becomes active or inactive.
4613 */4616 */
4614bool pcie_wait_for_link_delay(struct pci_dev *pdev, bool active, int delay)4617bool pcie_wait_for_link(struct pci_dev *pdev, bool active)
4615{4618{
4616 int timeout = 1000;4619 int timeout = 1000;
4617 bool ret;4620 bool ret;
@@ -4648,25 +4651,13 @@ bool pcie_wait_for_link_delay(struct pci_dev *pdev, bool active, int delay) · 30 unmodified lines
4648 timeout -= 10;4651 timeout -= 10;
4649 }4652 }
4650 if (active && ret)4653 if (active && ret)
4651 msleep(delay);4654 msleep(100);
4652 else if (ret != active)4655 else if (ret != active)
4653 pci_info(pdev, "Data Link Layer Link Active not %s in 1000 msec\n",4656 pci_info(pdev, "Data Link Layer Link Active not %s in 1000 msec\n",
4654 active ? "set" : "cleared");4657 active ? "set" : "cleared");
4655 return ret == active;4658 return ret == active;
4656}4659}
4657 4660
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 */
4665bool pcie_wait_for_link(struct pci_dev *pdev, bool active)
4666{
4667 return pcie_wait_for_link_delay(pdev, active, 100);
4668}
4669
4670void pci_reset_secondary_bus(struct pci_dev *dev)4661void pci_reset_secondary_bus(struct pci_dev *dev)
4671{4662{
4672 u16 ctrl;4663 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
497void pcie_do_recovery(struct pci_dev *dev, enum pci_channel_state state,497void pcie_do_recovery(struct pci_dev *dev, enum pci_channel_state state,
498 u32 service);498 u32 service);
499 499
500bool pcie_wait_for_link_delay(struct pci_dev *pdev, bool active, int delay);
501bool pcie_wait_for_link(struct pci_dev *pdev, bool active);500bool pcie_wait_for_link(struct pci_dev *pdev, bool active);
502#ifdef CONFIG_PCIEASPM501#ifdef CONFIG_PCIEASPM
503void pcie_aspm_init_link_state(struct pci_dev *pdev);502void pcie_aspm_init_link_state(struct pci_dev *pdev);
drivers/pci/pcie/portdrv_core.c+0−66
@@ -9,7 +9,6 @@ · 8 unmodified lines
9#include <linux/module.h>9#include <linux/module.h>
10#include <linux/pci.h>10#include <linux/pci.h>
11#include <linux/kernel.h>11#include <linux/kernel.h>
12#include <linux/delay.h>
13#include <linux/errno.h>12#include <linux/errno.h>
14#include <linux/pm.h>13#include <linux/pm.h>
15#include <linux/pm_runtime.h>14#include <linux/pm_runtime.h>
@@ -379,67 +378,6 @@ static int pm_iter(struct device *dev, void *data) · 363 unmodified lines
379 return 0;378 return 0;
380}379}
381 380
382static 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 */
411static 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
443/**381/**
444 * pcie_port_device_suspend - suspend port services associated with a PCIe port382 * pcie_port_device_suspend - suspend port services associated with a PCIe port
445 * @dev: PCI Express port to handle383 * @dev: PCI Express port to handle
@@ -453,8 +391,6 @@ int pcie_port_device_suspend(struct device *dev) · 7 unmodified lines
453int pcie_port_device_resume_noirq(struct device *dev)391int pcie_port_device_resume_noirq(struct device *dev)
454{392{
455 size_t off = offsetof(struct pcie_port_service_driver, resume_noirq);393 size_t off = offsetof(struct pcie_port_service_driver, resume_noirq);
456
457 wait_for_downstream_link(to_pci_dev(dev));
458 return device_for_each_child(dev, &off, pm_iter);394 return device_for_each_child(dev, &off, pm_iter);
459}395}
460 396
@@ -485,8 +421,6 @@ int pcie_port_device_runtime_suspend(struct device *dev) · 24 unmodified lines
485int pcie_port_device_runtime_resume(struct device *dev)421int pcie_port_device_runtime_resume(struct device *dev)
486{422{
487 size_t off = offsetof(struct pcie_port_service_driver, runtime_resume);423 size_t off = offsetof(struct pcie_port_service_driver, runtime_resume);
488
489 wait_for_downstream_link(to_pci_dev(dev));
490 return device_for_each_child(dev, &off, pm_iter);424 return device_for_each_child(dev, &off, pm_iter);
491}425}
492#endif /* PM */426#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
255 switch (state->Vcc) {255 switch (state->Vcc) {
256 case 50:256 case 50:
257 ++v;257 ++v;
258 /* fall through */
258 case 33:259 case 33:
259 ++v;260 ++v;
261 /* fall through */
260 case 0:262 case 0:
261 break;263 break;
262 default:264 default:
@@ -267,9 +269,11 @@ static int db1x_pcmcia_configure(struct pcmcia_socket *skt, · 4 unmodified lines
267 switch (state->Vpp) {269 switch (state->Vpp) {
268 case 12:270 case 12:
269 ++p;271 ++p;
272 /* fall through */
270 case 33:273 case 33:
271 case 50:274 case 50:
272 ++p;275 ++p;
276 /* fall through */
273 case 0:277 case 0:
274 break;278 break;
275 default:279 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
723 cpu_pm_pmu_setup(armpmu, cmd);723 cpu_pm_pmu_setup(armpmu, cmd);
724 break;724 break;
725 case CPU_PM_EXIT:725 case CPU_PM_EXIT:
726 cpu_pm_pmu_setup(armpmu, cmd);
727 case CPU_PM_ENTER_FAILED:726 case CPU_PM_ENTER_FAILED:
727 cpu_pm_pmu_setup(armpmu, cmd);
728 armpmu->start(armpmu);728 armpmu->start(armpmu);
729 break;729 break;
730 default:730 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
2412 { PIN_CONFIG_INPUT_DEBOUNCE, { C14, B14 }, SCUA8, 27 },2412 { PIN_CONFIG_INPUT_DEBOUNCE, { C14, B14 }, SCUA8, 27 },
2413};2413};
2414 2414
2415static int aspeed_g4_sig_expr_set(const struct aspeed_pinmux_data *ctx,2415static int aspeed_g4_sig_expr_set(struct aspeed_pinmux_data *ctx,
2416 const struct aspeed_sig_expr *expr,2416 const struct aspeed_sig_expr *expr,
2417 bool enable)2417 bool enable)
2418{2418{
drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c+65−27
@@ -2507,6 +2507,61 @@ static struct aspeed_pin_config aspeed_g5_configs[] = { · 2506 unmodified lines
2507 { PIN_CONFIG_INPUT_DEBOUNCE, { A20, B19 }, SCUA8, 27 },2507 { PIN_CONFIG_INPUT_DEBOUNCE, { A20, B19 }, SCUA8, 27 },
2508};2508};
2509 2509
2510static 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
2510/**2565/**
2511 * Configure a pin's signal by applying an expression's descriptor state for2566 * Configure a pin's signal by applying an expression's descriptor state for
2512 * all descriptors in the expression.2567 * all descriptors in the expression.
@@ -2520,7 +2575,7 @@ static struct aspeed_pin_config aspeed_g5_configs[] = { · 7 unmodified lines
2520 * Return: 0 if the expression is configured as requested and a negative error2575 * Return: 0 if the expression is configured as requested and a negative error
2521 * code otherwise2576 * code otherwise
2522 */2577 */
2523static int aspeed_g5_sig_expr_set(const struct aspeed_pinmux_data *ctx,2578static int aspeed_g5_sig_expr_set(struct aspeed_pinmux_data *ctx,
2524 const struct aspeed_sig_expr *expr,2579 const struct aspeed_sig_expr *expr,
2525 bool enable)2580 bool enable)
2526{2581{
@@ -2531,9 +2586,15 @@ static int aspeed_g5_sig_expr_set(const struct aspeed_pinmux_data *ctx, · 4 unmodified lines
2531 const struct aspeed_sig_desc *desc = &expr->descs[i];2586 const struct aspeed_sig_desc *desc = &expr->descs[i];
2532 u32 pattern = enable ? desc->enable : desc->disable;2587 u32 pattern = enable ? desc->enable : desc->disable;
2533 u32 val = (pattern << __ffs(desc->mask));2588 u32 val = (pattern << __ffs(desc->mask));
2589 struct regmap *map;
2534 2590
2535 if (!ctx->maps[desc->ip])2591 map = aspeed_g5_acquire_regmap(ctx, desc->ip);
2536 return -ENODEV;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 }
2537 2598
2538 /*2599 /*
2539 * Strap registers are configured in hardware or by early-boot2600 * 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
2641static int aspeed_g5_pinctrl_probe(struct platform_device *pdev)2702static int aspeed_g5_pinctrl_probe(struct platform_device *pdev)
2642{2703{
2643 int i;2704 int i;
2644 struct regmap *map;
2645 struct device_node *node;
2646 2705
2647 for (i = 0; i < ARRAY_SIZE(aspeed_g5_pins); i++)2706 for (i = 0; i < ARRAY_SIZE(aspeed_g5_pins); i++)
2648 aspeed_g5_pins[i].number = i;2707 aspeed_g5_pins[i].number = i;
2649 2708
2650 node = of_parse_phandle(pdev->dev.of_node, "aspeed,external-nodes", 0);2709 aspeed_g5_pinctrl_data.pinmux.dev = &pdev->dev;
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;
2672 2710
2673 return aspeed_pinctrl_probe(pdev, &aspeed_g5_pinctrl_desc,2711 return aspeed_pinctrl_probe(pdev, &aspeed_g5_pinctrl_desc,
2674 &aspeed_g5_pinctrl_data);2712 &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
71 return 0;71 return 0;
72}72}
73 73
74static int aspeed_sig_expr_enable(const struct aspeed_pinmux_data *ctx,74static int aspeed_sig_expr_enable(struct aspeed_pinmux_data *ctx,
75 const struct aspeed_sig_expr *expr)75 const struct aspeed_sig_expr *expr)
76{76{
77 int ret;77 int ret;
@@ -86,7 +86,7 @@ static int aspeed_sig_expr_enable(const struct aspeed_pinmux_data *ctx, · 8 unmodified lines
86 return 0;86 return 0;
87}87}
88 88
89static int aspeed_sig_expr_disable(const struct aspeed_pinmux_data *ctx,89static int aspeed_sig_expr_disable(struct aspeed_pinmux_data *ctx,
90 const struct aspeed_sig_expr *expr)90 const struct aspeed_sig_expr *expr)
91{91{
92 int ret;92 int ret;
@@ -109,7 +109,7 @@ static int aspeed_sig_expr_disable(const struct aspeed_pinmux_data *ctx, · 16 unmodified lines
109 *109 *
110 * Return: 0 if all expressions are disabled, otherwise a negative error code110 * Return: 0 if all expressions are disabled, otherwise a negative error code
111 */111 */
112static int aspeed_disable_sig(const struct aspeed_pinmux_data *ctx,112static int aspeed_disable_sig(struct aspeed_pinmux_data *ctx,
113 const struct aspeed_sig_expr **exprs)113 const struct aspeed_sig_expr **exprs)
114{114{
115 int ret = 0;115 int ret = 0;
@@ -217,8 +217,7 @@ int aspeed_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int function, · 101 unmodified lines
217{217{
218 int i;218 int i;
219 int ret;219 int ret;
220 const struct aspeed_pinctrl_data *pdata =220 struct aspeed_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
221 pinctrl_dev_get_drvdata(pctldev);
222 const struct aspeed_pin_group *pgroup = &pdata->pinmux.groups[group];221 const struct aspeed_pin_group *pgroup = &pdata->pinmux.groups[group];
223 const struct aspeed_pin_function *pfunc =222 const struct aspeed_pin_function *pfunc =
224 &pdata->pinmux.functions[function];223 &pdata->pinmux.functions[function];
@@ -306,8 +305,7 @@ int aspeed_gpio_request_enable(struct pinctrl_dev *pctldev, · 81 unmodified lines
306 unsigned int offset)305 unsigned int offset)
307{306{
308 int ret;307 int ret;
309 const struct aspeed_pinctrl_data *pdata =308 struct aspeed_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
310 pinctrl_dev_get_drvdata(pctldev);
311 const struct aspeed_pin_desc *pdesc = pdata->pins[offset].drv_data;309 const struct aspeed_pin_desc *pdesc = pdata->pins[offset].drv_data;
312 const struct aspeed_sig_expr ***prios, **funcs, *expr;310 const struct aspeed_sig_expr ***prios, **funcs, *expr;
313 311
drivers/pinctrl/aspeed/pinmux-aspeed.c+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
5 5
6#include "pinmux-aspeed.h"6#include "pinmux-aspeed.h"
7 7
8const char *const aspeed_pinmux_ips[] = {8static const char *const aspeed_pinmux_ips[] = {
9 [ASPEED_IP_SCU] = "SCU",9 [ASPEED_IP_SCU] = "SCU",
10 [ASPEED_IP_GFX] = "GFX",10 [ASPEED_IP_GFX] = "GFX",
11 [ASPEED_IP_LPC] = "LPC",11 [ASPEED_IP_LPC] = "LPC",
drivers/pinctrl/aspeed/pinmux-aspeed.h+3−2
@@ -702,11 +702,12 @@ struct aspeed_pin_function { · 701 unmodified lines
702struct aspeed_pinmux_data;702struct aspeed_pinmux_data;
703 703
704struct aspeed_pinmux_ops {704struct aspeed_pinmux_ops {
705 int (*set)(const struct aspeed_pinmux_data *ctx,705 int (*set)(struct aspeed_pinmux_data *ctx,
706 const struct aspeed_sig_expr *expr, bool enabled);706 const struct aspeed_sig_expr *expr, bool enabled);
707};707};
708 708
709struct aspeed_pinmux_data {709struct aspeed_pinmux_data {
710 struct device *dev;
710 struct regmap *maps[ASPEED_NR_PINMUX_IPS];711 struct regmap *maps[ASPEED_NR_PINMUX_IPS];
711 712
712 const struct aspeed_pinmux_ops *ops;713 const struct aspeed_pinmux_ops *ops;
@@ -725,7 +726,7 @@ int aspeed_sig_expr_eval(const struct aspeed_pinmux_data *ctx, · 12 unmodified lines
725 const struct aspeed_sig_expr *expr,726 const struct aspeed_sig_expr *expr,
726 bool enabled);727 bool enabled);
727 728
728static inline int aspeed_sig_expr_set(const struct aspeed_pinmux_data *ctx,729static inline int aspeed_sig_expr_set(struct aspeed_pinmux_data *ctx,
729 const struct aspeed_sig_expr *expr,730 const struct aspeed_sig_expr *expr,
730 bool enabled)731 bool enabled)
731{732{
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
736};736};
737MODULE_DEVICE_TABLE(of, olpc_xo175_ec_of_match);737MODULE_DEVICE_TABLE(of, olpc_xo175_ec_of_match);
738 738
739static const struct spi_device_id olpc_xo175_ec_id_table[] = {
740 { "xo1.75-ec", 0 },
741 {}
742};
743MODULE_DEVICE_TABLE(spi, olpc_xo175_ec_id_table);
744
739static struct spi_driver olpc_xo175_ec_spi_driver = {745static struct spi_driver olpc_xo175_ec_spi_driver = {
740 .driver = {746 .driver = {
741 .name = "olpc-xo175-ec",747 .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
812 INTEL_CPU_FAM6(KABYLAKE_DESKTOP, spt_reg_map),812 INTEL_CPU_FAM6(KABYLAKE_DESKTOP, spt_reg_map),
813 INTEL_CPU_FAM6(CANNONLAKE_MOBILE, cnp_reg_map),813 INTEL_CPU_FAM6(CANNONLAKE_MOBILE, cnp_reg_map),
814 INTEL_CPU_FAM6(ICELAKE_MOBILE, icl_reg_map),814 INTEL_CPU_FAM6(ICELAKE_MOBILE, icl_reg_map),
815 INTEL_CPU_FAM6(ICELAKE_NNPI, icl_reg_map),
815 {}816 {}
816};817};
817 818
drivers/platform/x86/pcengines-apuv2.c+2−4
@@ -93,7 +93,7 @@ static struct gpiod_lookup_table gpios_led_table = { · 92 unmodified lines
93 93
94static struct gpio_keys_button apu2_keys_buttons[] = {94static struct gpio_keys_button apu2_keys_buttons[] = {
95 {95 {
96 .code = KEY_SETUP,96 .code = KEY_RESTART,
97 .active_low = 1,97 .active_low = 1,
98 .desc = "front button",98 .desc = "front button",
99 .type = EV_KEY,99 .type = EV_KEY,
@@ -255,6 +255,4 @@ MODULE_DESCRIPTION("PC Engines APUv2/APUv3 board GPIO/LED/keys driver"); · 155 unmodified lines
255MODULE_LICENSE("GPL");255MODULE_LICENSE("GPL");
256MODULE_DEVICE_TABLE(dmi, apu_gpio_dmi_table);256MODULE_DEVICE_TABLE(dmi, apu_gpio_dmi_table);
257MODULE_ALIAS("platform:pcengines-apuv2");257MODULE_ALIAS("platform:pcengines-apuv2");
258MODULE_SOFTDEP("pre: platform:" AMD_FCH_GPIO_DRIVER_NAME);258MODULE_SOFTDEP("pre: platform:" AMD_FCH_GPIO_DRIVER_NAME " platform:leds-gpio platform:gpio_keys_polled");
259MODULE_SOFTDEP("pre: platform:leds-gpio");
260MODULE_SOFTDEP("pre: 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
882 return of_pwm_get(dev, dev->of_node, con_id);882 return of_pwm_get(dev, dev->of_node, con_id);
883 883
884 /* then lookup via ACPI */884 /* then lookup via ACPI */
885 if (dev && is_acpi_node(dev->fwnode))885 if (dev && is_acpi_node(dev->fwnode)) {
886 return acpi_pwm_get(dev->fwnode);886 pwm = acpi_pwm_get(dev->fwnode);
887 if (!IS_ERR(pwm) || PTR_ERR(pwm) != -ENOENT)
888 return pwm;
889 }
887 890
888 /*891 /*
889 * We look up the provider in the static table typically provided by892 * 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
174#define AXP803_DCDC5_1140mV_STEPS 35174#define AXP803_DCDC5_1140mV_STEPS 35
175#define AXP803_DCDC5_1140mV_END \175#define AXP803_DCDC5_1140mV_END \
176 (AXP803_DCDC5_1140mV_START + AXP803_DCDC5_1140mV_STEPS)176 (AXP803_DCDC5_1140mV_START + AXP803_DCDC5_1140mV_STEPS)
177#define AXP803_DCDC5_NUM_VOLTAGES 68177#define AXP803_DCDC5_NUM_VOLTAGES 69
178 178
179#define AXP803_DCDC6_600mV_START 0x00179#define AXP803_DCDC6_600mV_START 0x00
180#define AXP803_DCDC6_600mV_STEPS 50180#define AXP803_DCDC6_600mV_STEPS 50
181#define AXP803_DCDC6_600mV_END \181#define AXP803_DCDC6_600mV_END \
182 (AXP803_DCDC6_600mV_START + AXP803_DCDC6_600mV_STEPS)182 (AXP803_DCDC6_600mV_START + AXP803_DCDC6_600mV_STEPS)
183#define AXP803_DCDC6_1120mV_START 0x33183#define AXP803_DCDC6_1120mV_START 0x33
184#define AXP803_DCDC6_1120mV_STEPS 14184#define AXP803_DCDC6_1120mV_STEPS 20
185#define AXP803_DCDC6_1120mV_END \185#define AXP803_DCDC6_1120mV_END \
186 (AXP803_DCDC6_1120mV_START + AXP803_DCDC6_1120mV_STEPS)186 (AXP803_DCDC6_1120mV_START + AXP803_DCDC6_1120mV_STEPS)
187#define AXP803_DCDC6_NUM_VOLTAGES 72187#define AXP803_DCDC6_NUM_VOLTAGES 72
@@ -240,7 +240,7 @@ · 52 unmodified lines
240#define AXP806_DCDCA_600mV_END \240#define AXP806_DCDCA_600mV_END \
241 (AXP806_DCDCA_600mV_START + AXP806_DCDCA_600mV_STEPS)241 (AXP806_DCDCA_600mV_START + AXP806_DCDCA_600mV_STEPS)
242#define AXP806_DCDCA_1120mV_START 0x33242#define AXP806_DCDCA_1120mV_START 0x33
243#define AXP806_DCDCA_1120mV_STEPS 14243#define AXP806_DCDCA_1120mV_STEPS 20
244#define AXP806_DCDCA_1120mV_END \244#define AXP806_DCDCA_1120mV_END \
245 (AXP806_DCDCA_1120mV_START + AXP806_DCDCA_1120mV_STEPS)245 (AXP806_DCDCA_1120mV_START + AXP806_DCDCA_1120mV_STEPS)
246#define AXP806_DCDCA_NUM_VOLTAGES 72246#define AXP806_DCDCA_NUM_VOLTAGES 72
@@ -774,8 +774,8 @@ static const struct regulator_linear_range axp806_dcdcd_ranges[] = { · 527 unmodified lines
774 AXP806_DCDCD_600mV_END,774 AXP806_DCDCD_600mV_END,
775 20000),775 20000),
776 REGULATOR_LINEAR_RANGE(1600000,776 REGULATOR_LINEAR_RANGE(1600000,
777 AXP806_DCDCD_600mV_START,777 AXP806_DCDCD_1600mV_START,
778 AXP806_DCDCD_600mV_END,778 AXP806_DCDCD_1600mV_END,
779 100000),779 100000),
780};780};
781 781
drivers/regulator/lp87565-regulator.c+4−4
@@ -163,7 +163,7 @@ static int lp87565_regulator_probe(struct platform_device *pdev) · 162 unmodified lines
163 struct lp87565 *lp87565 = dev_get_drvdata(pdev->dev.parent);163 struct lp87565 *lp87565 = dev_get_drvdata(pdev->dev.parent);
164 struct regulator_config config = { };164 struct regulator_config config = { };
165 struct regulator_dev *rdev;165 struct regulator_dev *rdev;
166 int i, min_idx = LP87565_BUCK_0, max_idx = LP87565_BUCK_3;166 int i, min_idx, max_idx;
167 167
168 platform_set_drvdata(pdev, lp87565);168 platform_set_drvdata(pdev, lp87565);
169 169
@@ -182,9 +182,9 @@ static int lp87565_regulator_probe(struct platform_device *pdev) · 12 unmodified lines
182 max_idx = LP87565_BUCK_3210;182 max_idx = LP87565_BUCK_3210;
183 break;183 break;
184 default:184 default:
185 dev_err(lp87565->dev, "Invalid lp config %d\n",185 min_idx = LP87565_BUCK_0;
186 lp87565->dev_type);186 max_idx = LP87565_BUCK_3;
187 return -EINVAL;187 break;
188 }188 }
189 189
190 for (i = min_idx; i <= max_idx; i++) {190 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
416 if (!name)416 if (!name)
417 name = child->name;417 name = child->name;
418 418
419 if (!strcmp(desc->of_match, name))419 if (!strcmp(desc->of_match, name)) {
420 of_node_put(search);
420 return of_node_get(child);421 return of_node_get(child);
422 }
421 }423 }
422 424
423 of_node_put(search);425 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
383 char msg_format;383 char msg_format;
384 char msg_no;384 char msg_no;
385 385
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
386 sense = dasd_get_sense(&cqr->irb);400 sense = dasd_get_sense(&cqr->irb);
387 if (!sense)401 if (!sense)
388 return 0;402 return 0;
@@ -447,12 +461,8 @@ static int read_unit_address_configuration(struct dasd_device *device, · 58 unmodified lines
447 lcu->flags &= ~NEED_UAC_UPDATE;461 lcu->flags &= ~NEED_UAC_UPDATE;
448 spin_unlock_irqrestore(&lcu->lock, flags);462 spin_unlock_irqrestore(&lcu->lock, flags);
449 463
450 do {464 rc = dasd_sleep_on(cqr);
451 rc = dasd_sleep_on(cqr);465 if (rc && !suborder_not_supported(cqr)) {
452 if (rc && suborder_not_supported(cqr))
453 return -EOPNOTSUPP;
454 } while (rc && (cqr->retries > 0));
455 if (rc) {
456 spin_lock_irqsave(&lcu->lock, flags);466 spin_lock_irqsave(&lcu->lock, flags);
457 lcu->flags |= NEED_UAC_UPDATE;467 lcu->flags |= NEED_UAC_UPDATE;
458 spin_unlock_irqrestore(&lcu->lock, flags);468 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
398 }398 }
399 if (dstat == 0x08)399 if (dstat == 0x08)
400 break;400 break;
401 /* else, fall through */
401 case 0x04:402 case 0x04:
402 /* Device end interrupt. */403 /* Device end interrupt. */
403 if ((raw = req->info) == NULL)404 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
677 switch (device->tape_state) {677 switch (device->tape_state) {
678 case TS_INIT:678 case TS_INIT:
679 tape_state_set(device, TS_NOT_OPER);679 tape_state_set(device, TS_NOT_OPER);
680 /* fallthrough */
680 case TS_NOT_OPER:681 case TS_NOT_OPER:
681 /*682 /*
682 * Nothing to do.683 * Nothing to do.
@@ -949,6 +950,7 @@ __tape_start_request(struct tape_device *device, struct tape_request *request) · 266 unmodified lines
949 break;950 break;
950 if (device->tape_state == TS_UNUSED)951 if (device->tape_state == TS_UNUSED)
951 break;952 break;
953 /* fallthrough */
952 default:954 default:
953 if (device->tape_state == TS_BLKUSE)955 if (device->tape_state == TS_BLKUSE)
954 break;956 break;
@@ -1116,6 +1118,7 @@ __tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb) · 161 unmodified lines
1116 case -ETIMEDOUT:1118 case -ETIMEDOUT:
1117 DBF_LH(1, "(%08x): Request timed out\n",1119 DBF_LH(1, "(%08x): Request timed out\n",
1118 device->cdev_id);1120 device->cdev_id);
1121 /* fallthrough */
1119 case -EIO:1122 case -EIO:
1120 __tape_end_request(device, request, -EIO);1123 __tape_end_request(device, request, -EIO);
1121 break;1124 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
70 70
71}71}
72 72
73const struct vfio_ccw_regops vfio_ccw_async_region_ops = {73static const struct vfio_ccw_regops vfio_ccw_async_region_ops = {
74 .read = vfio_ccw_async_region_read,74 .read = vfio_ccw_async_region_read,
75 .write = vfio_ccw_async_region_write,75 .write = vfio_ccw_async_region_write,
76 .release = vfio_ccw_async_region_release,76 .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
152 ap_msg->receive(aq, ap_msg, aq->reply);152 ap_msg->receive(aq, ap_msg, aq->reply);
153 break;153 break;
154 }154 }
155 /* fall through */
155 case AP_RESPONSE_NO_PENDING_REPLY:156 case AP_RESPONSE_NO_PENDING_REPLY:
156 if (!status.queue_empty || aq->queue_count <= 0)157 if (!status.queue_empty || aq->queue_count <= 0)
157 break;158 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
801 if (msg->cprbx.cprb_ver_id == 0x02)801 if (msg->cprbx.cprb_ver_id == 0x02)
802 return convert_type86_ica(zq, reply,802 return convert_type86_ica(zq, reply,
803 outputdata, outputdatalength);803 outputdata, outputdatalength);
804 /*804 /* fall through - wrong cprb version is an unknown response */
805 * Fall through, no break, incorrect cprb version is an unknown
806 * response
807 */
808 default: /* Unknown response type, this should NEVER EVER happen */805 default: /* Unknown response type, this should NEVER EVER happen */
809 zq->online = 0;806 zq->online = 0;
810 pr_err("Cryptographic device %02x.%04x failed and was set offline\n",807 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
837 }834 }
838 if (msg->cprbx.cprb_ver_id == 0x02)835 if (msg->cprbx.cprb_ver_id == 0x02)
839 return convert_type86_xcrb(zq, reply, xcRB);836 return convert_type86_xcrb(zq, reply, xcRB);
840 /*837 /* fall through - wrong cprb version is an unknown response */
841 * Fall through, no break, incorrect cprb version is an unknown
842 * response
843 */
844 default: /* Unknown response type, this should NEVER EVER happen */838 default: /* Unknown response type, this should NEVER EVER happen */
845 xcRB->status = 0x0008044DL; /* HDD_InvalidParm */839 xcRB->status = 0x0008044DL; /* HDD_InvalidParm */
846 zq->online = 0;840 zq->online = 0;
@@ -870,7 +864,7 @@ static int convert_response_ep11_xcrb(struct zcrypt_queue *zq, · 23 unmodified lines
870 return convert_error(zq, reply);864 return convert_error(zq, reply);
871 if (msg->cprbx.cprb_ver_id == 0x04)865 if (msg->cprbx.cprb_ver_id == 0x04)
872 return convert_type86_ep11_xcrb(zq, reply, xcRB);866 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 */
874 default: /* Unknown response type, this should NEVER EVER happen */868 default: /* Unknown response type, this should NEVER EVER happen */
875 zq->online = 0;869 zq->online = 0;
876 pr_err("Cryptographic device %02x.%04x failed and was set offline\n",870 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
900 return -EINVAL;894 return -EINVAL;
901 if (msg->cprbx.cprb_ver_id == 0x02)895 if (msg->cprbx.cprb_ver_id == 0x02)
902 return convert_type86_rng(zq, reply, data);896 return convert_type86_rng(zq, reply, data);
903 /*897 /* fall through - wrong cprb version is an unknown response */
904 * Fall through, no break, incorrect cprb version is an unknown
905 * response
906 */
907 default: /* Unknown response type, this should NEVER EVER happen */898 default: /* Unknown response type, this should NEVER EVER happen */
908 zq->online = 0;899 zq->online = 0;
909 pr_err("Cryptographic device %02x.%04x failed and was set offline\n",900 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
1704 grp->changed_side = 2;1704 grp->changed_side = 2;
1705 break;1705 break;
1706 }1706 }
1707 /* Else, fall through */
1707 case MPCG_STATE_XID0IOWAIX:1708 case MPCG_STATE_XID0IOWAIX:
1708 case MPCG_STATE_XID7INITW:1709 case MPCG_STATE_XID7INITW:
1709 case MPCG_STATE_XID7INITX:1710 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
357 /*fsm_newstate(grp->fsm, MPCG_STATE_XID2INITW);*/357 /*fsm_newstate(grp->fsm, MPCG_STATE_XID2INITW);*/
358 if (callback)358 if (callback)
359 grp->send_qllc_disc = 1;359 grp->send_qllc_disc = 1;
360 /* Else, fall through */
360 case MPCG_STATE_XID0IOWAIT:361 case MPCG_STATE_XID0IOWAIT:
361 fsm_deltimer(&grp->timer);362 fsm_deltimer(&grp->timer);
362 grp->outstanding_xid2 = 0;363 grp->outstanding_xid2 = 0;
@@ -1469,6 +1470,7 @@ static void mpc_action_timeout(fsm_instance *fi, int event, void *arg) · 1106 unmodified lines
1469 if ((fsm_getstate(rch->fsm) == CH_XID0_PENDING) &&1470 if ((fsm_getstate(rch->fsm) == CH_XID0_PENDING) &&
1470 (fsm_getstate(wch->fsm) == CH_XID0_PENDING))1471 (fsm_getstate(wch->fsm) == CH_XID0_PENDING))
1471 break;1472 break;
1473 /* Else, fall through */
1472 default:1474 default:
1473 fsm_event(grp->fsm, MPCG_EVENT_INOP, dev);1475 fsm_event(grp->fsm, MPCG_EVENT_INOP, dev);
1474 }1476 }
@@ -2089,6 +2091,7 @@ static int mpc_send_qllc_discontact(struct net_device *dev) · 614 unmodified lines
2089 grp->estconnfunc = NULL;2091 grp->estconnfunc = NULL;
2090 break;2092 break;
2091 }2093 }
2094 /* Else, fall through */
2092 case MPCG_STATE_FLOWC:2095 case MPCG_STATE_FLOWC:
2093 case MPCG_STATE_READY:2096 case MPCG_STATE_READY:
2094 grp->send_qllc_disc = 2;2097 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
333 card->osn_info.data_cb(skb);333 card->osn_info.data_cb(skb);
334 break;334 break;
335 }335 }
336 /* else unknown */336 /* Else, fall through */
337 default:337 default:
338 dev_kfree_skb_any(skb);338 dev_kfree_skb_any(skb);
339 QETH_CARD_TEXT(card, 3, "inbunkno");339 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
603 msgqueue_flush(&info->scsi.msgs);603 msgqueue_flush(&info->scsi.msgs);
604 msgqueue_addmsg(&info->scsi.msgs, 1, MESSAGE_REJECT);604 msgqueue_addmsg(&info->scsi.msgs, 1, MESSAGE_REJECT);
605 info->scsi.phase = PHASE_MSGOUT_EXPECT;605 info->scsi.phase = PHASE_MSGOUT_EXPECT;
606 /* fall through */
606 607
607 case async:608 case async:
608 dev->period = info->ifcfg.asyncperiod / 4;609 dev->period = info->ifcfg.asyncperiod / 4;
@@ -915,6 +916,7 @@ static void fas216_disconnect_intr(FAS216_Info *info) · 306 unmodified lines
915 fas216_done(info, DID_ABORT);916 fas216_done(info, DID_ABORT);
916 break;917 break;
917 }918 }
919 /* else, fall through */
918 920
919 default: /* huh? */921 default: /* huh? */
920 printk(KERN_ERR "scsi%d.%c: unexpected disconnect in phase %s\n",922 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
1411 case STATE(STAT_STATUS, PHASE_DATAOUT): /* Data Out -> Status */1413 case STATE(STAT_STATUS, PHASE_DATAOUT): /* Data Out -> Status */
1412 case STATE(STAT_STATUS, PHASE_DATAIN): /* Data In -> Status */1414 case STATE(STAT_STATUS, PHASE_DATAIN): /* Data In -> Status */
1413 fas216_stoptransfer(info);1415 fas216_stoptransfer(info);
1416 /* fall through */
1417
1414 case STATE(STAT_STATUS, PHASE_SELSTEPS):/* Sel w/ steps -> Status */1418 case STATE(STAT_STATUS, PHASE_SELSTEPS):/* Sel w/ steps -> Status */
1415 case STATE(STAT_STATUS, PHASE_MSGOUT): /* Message Out -> Status */1419 case STATE(STAT_STATUS, PHASE_MSGOUT): /* Message Out -> Status */
1416 case STATE(STAT_STATUS, PHASE_COMMAND): /* Command -> Status */1420 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
1422 case STATE(STAT_MESGIN, PHASE_DATAOUT): /* Data Out -> Message In */1426 case STATE(STAT_MESGIN, PHASE_DATAOUT): /* Data Out -> Message In */
1423 case STATE(STAT_MESGIN, PHASE_DATAIN): /* Data In -> Message In */1427 case STATE(STAT_MESGIN, PHASE_DATAIN): /* Data In -> Message In */
1424 fas216_stoptransfer(info);1428 fas216_stoptransfer(info);
1429 /* fall through */
1430
1425 case STATE(STAT_MESGIN, PHASE_COMMAND): /* Command -> Message In */1431 case STATE(STAT_MESGIN, PHASE_COMMAND): /* Command -> Message In */
1426 case STATE(STAT_MESGIN, PHASE_SELSTEPS):/* Sel w/ steps -> Message In */1432 case STATE(STAT_MESGIN, PHASE_SELSTEPS):/* Sel w/ steps -> Message In */
1427 case STATE(STAT_MESGIN, PHASE_MSGOUT): /* Message Out -> Message In */1433 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
1575 fas216_message(info);1581 fas216_message(info);
1576 break;1582 break;
1577 }1583 }
1584 /* else, fall through */
1578 1585
1579 default:1586 default:
1580 fas216_log(info, 0, "internal phase %s for function done?"1587 fas216_log(info, 0, "internal phase %s for function done?"
@@ -1957,6 +1964,7 @@ static void fas216_kick(FAS216_Info *info) · 376 unmodified lines
1957 switch (where_from) {1964 switch (where_from) {
1958 case TYPE_QUEUE:1965 case TYPE_QUEUE:
1959 fas216_allocate_tag(info, SCpnt);1966 fas216_allocate_tag(info, SCpnt);
1967 /* fall through */
1960 case TYPE_OTHER:1968 case TYPE_OTHER:
1961 fas216_start_command(info, SCpnt);1969 fas216_start_command(info, SCpnt);
1962 break;1970 break;
drivers/scsi/fcoe/fcoe_ctlr.c+65−73
@@ -2005,7 +2005,7 @@ EXPORT_SYMBOL_GPL(fcoe_wwn_from_mac); · 2004 unmodified lines
2005 */2005 */
2006static inline struct fcoe_rport *fcoe_ctlr_rport(struct fc_rport_priv *rdata)2006static inline struct fcoe_rport *fcoe_ctlr_rport(struct fc_rport_priv *rdata)
2007{2007{
2008 return (struct fcoe_rport *)(rdata + 1);2008 return container_of(rdata, struct fcoe_rport, rdata);
2009}2009}
2010 2010
2011/**2011/**
@@ -2269,7 +2269,7 @@ static void fcoe_ctlr_vn_start(struct fcoe_ctlr *fip) · 257 unmodified lines
2269 */2269 */
2270static int fcoe_ctlr_vn_parse(struct fcoe_ctlr *fip,2270static int fcoe_ctlr_vn_parse(struct fcoe_ctlr *fip,
2271 struct sk_buff *skb,2271 struct sk_buff *skb,
2272 struct fc_rport_priv *rdata)2272 struct fcoe_rport *frport)
2273{2273{
2274 struct fip_header *fiph;2274 struct fip_header *fiph;
2275 struct fip_desc *desc = NULL;2275 struct fip_desc *desc = NULL;
@@ -2277,16 +2277,12 @@ static int fcoe_ctlr_vn_parse(struct fcoe_ctlr *fip, · 1 unmodified line
2277 struct fip_wwn_desc *wwn = NULL;2277 struct fip_wwn_desc *wwn = NULL;
2278 struct fip_vn_desc *vn = NULL;2278 struct fip_vn_desc *vn = NULL;
2279 struct fip_size_desc *size = NULL;2279 struct fip_size_desc *size = NULL;
2280 struct fcoe_rport *frport;
2281 size_t rlen;2280 size_t rlen;
2282 size_t dlen;2281 size_t dlen;
2283 u32 desc_mask = 0;2282 u32 desc_mask = 0;
2284 u32 dtype;2283 u32 dtype;
2285 u8 sub;2284 u8 sub;
2286 2285
2287 memset(rdata, 0, sizeof(*rdata) + sizeof(*frport));
2288 frport = fcoe_ctlr_rport(rdata);
2289
2290 fiph = (struct fip_header *)skb->data;2286 fiph = (struct fip_header *)skb->data;
2291 frport->flags = ntohs(fiph->fip_flags);2287 frport->flags = ntohs(fiph->fip_flags);
2292 2288
@@ -2349,15 +2345,17 @@ static int fcoe_ctlr_vn_parse(struct fcoe_ctlr *fip, · 56 unmodified lines
2349 if (dlen != sizeof(struct fip_wwn_desc))2345 if (dlen != sizeof(struct fip_wwn_desc))
2350 goto len_err;2346 goto len_err;
2351 wwn = (struct fip_wwn_desc *)desc;2347 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);
2353 break;2350 break;
2354 case FIP_DT_VN_ID:2351 case FIP_DT_VN_ID:
2355 if (dlen != sizeof(struct fip_vn_desc))2352 if (dlen != sizeof(struct fip_vn_desc))
2356 goto len_err;2353 goto len_err;
2357 vn = (struct fip_vn_desc *)desc;2354 vn = (struct fip_vn_desc *)desc;
2358 memcpy(frport->vn_mac, vn->fd_mac, ETH_ALEN);2355 memcpy(frport->vn_mac, vn->fd_mac, ETH_ALEN);
2359 rdata->ids.port_id = ntoh24(vn->fd_fc_id);2356 frport->rdata.ids.port_id = ntoh24(vn->fd_fc_id);
2360 rdata->ids.port_name = get_unaligned_be64(&vn->fd_wwpn);2357 frport->rdata.ids.port_name =
2358 get_unaligned_be64(&vn->fd_wwpn);
2361 break;2359 break;
2362 case FIP_DT_FC4F:2360 case FIP_DT_FC4F:
2363 if (dlen != sizeof(struct fip_fc4_feat))2361 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
2403/**2401/**
2404 * fcoe_ctlr_vn_probe_req() - handle incoming VN2VN probe request.2402 * fcoe_ctlr_vn_probe_req() - handle incoming VN2VN probe request.
2405 * @fip: The FCoE controller2403 * @fip: The FCoE controller
2406 * @rdata: parsed remote port with frport from the probe request2404 * @frport: parsed FCoE rport from the probe request
2407 *2405 *
2408 * Called with ctlr_mutex held.2406 * Called with ctlr_mutex held.
2409 */2407 */
2410static void fcoe_ctlr_vn_probe_req(struct fcoe_ctlr *fip,2408static void fcoe_ctlr_vn_probe_req(struct fcoe_ctlr *fip,
2411 struct fc_rport_priv *rdata)2409 struct fcoe_rport *frport)
2412{2410{
2413 struct fcoe_rport *frport = fcoe_ctlr_rport(rdata);2411 if (frport->rdata.ids.port_id != fip->port_id)
2414
2415 if (rdata->ids.port_id != fip->port_id)
2416 return;2412 return;
2417 2413
2418 switch (fip->state) {2414 switch (fip->state) {
@@ -2432,7 +2428,7 @@ static void fcoe_ctlr_vn_probe_req(struct fcoe_ctlr *fip, · 13 unmodified lines
2432 * Probe's REC bit is not set.2428 * Probe's REC bit is not set.
2433 * If we don't reply, we will change our address.2429 * If we don't reply, we will change our address.
2434 */2430 */
2435 if (fip->lp->wwpn > rdata->ids.port_name &&2431 if (fip->lp->wwpn > frport->rdata.ids.port_name &&
2436 !(frport->flags & FIP_FL_REC_OR_P2P)) {2432 !(frport->flags & FIP_FL_REC_OR_P2P)) {
2437 LIBFCOE_FIP_DBG(fip, "vn_probe_req: "2433 LIBFCOE_FIP_DBG(fip, "vn_probe_req: "
2438 "port_id collision\n");2434 "port_id collision\n");
@@ -2456,14 +2452,14 @@ static void fcoe_ctlr_vn_probe_req(struct fcoe_ctlr *fip, · 17 unmodified lines
2456/**2452/**
2457 * fcoe_ctlr_vn_probe_reply() - handle incoming VN2VN probe reply.2453 * fcoe_ctlr_vn_probe_reply() - handle incoming VN2VN probe reply.
2458 * @fip: The FCoE controller2454 * @fip: The FCoE controller
2459 * @rdata: parsed remote port with frport from the probe request2455 * @frport: parsed FCoE rport from the probe request
2460 *2456 *
2461 * Called with ctlr_mutex held.2457 * Called with ctlr_mutex held.
2462 */2458 */
2463static void fcoe_ctlr_vn_probe_reply(struct fcoe_ctlr *fip,2459static void fcoe_ctlr_vn_probe_reply(struct fcoe_ctlr *fip,
2464 struct fc_rport_priv *rdata)2460 struct fcoe_rport *frport)
2465{2461{
2466 if (rdata->ids.port_id != fip->port_id)2462 if (frport->rdata.ids.port_id != fip->port_id)
2467 return;2463 return;
2468 switch (fip->state) {2464 switch (fip->state) {
2469 case FIP_ST_VNMP_START:2465 case FIP_ST_VNMP_START:
@@ -2486,11 +2482,11 @@ static void fcoe_ctlr_vn_probe_reply(struct fcoe_ctlr *fip, · 16 unmodified lines
2486/**2482/**
2487 * fcoe_ctlr_vn_add() - Add a VN2VN entry to the list, based on a claim reply.2483 * fcoe_ctlr_vn_add() - Add a VN2VN entry to the list, based on a claim reply.
2488 * @fip: The FCoE controller2484 * @fip: The FCoE controller
2489 * @new: newly-parsed remote port with frport as a template for new rdata2485 * @new: newly-parsed FCoE rport as a template for new rdata
2490 *2486 *
2491 * Called with ctlr_mutex held.2487 * Called with ctlr_mutex held.
2492 */2488 */
2493static void fcoe_ctlr_vn_add(struct fcoe_ctlr *fip, struct fc_rport_priv *new)2489static void fcoe_ctlr_vn_add(struct fcoe_ctlr *fip, struct fcoe_rport *new)
2494{2490{
2495 struct fc_lport *lport = fip->lp;2491 struct fc_lport *lport = fip->lp;
2496 struct fc_rport_priv *rdata;2492 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
2498 struct fcoe_rport *frport;2494 struct fcoe_rport *frport;
2499 u32 port_id;2495 u32 port_id;
2500 2496
2501 port_id = new->ids.port_id;2497 port_id = new->rdata.ids.port_id;
2502 if (port_id == fip->port_id)2498 if (port_id == fip->port_id)
2503 return;2499 return;
2504 2500
@@ -2515,22 +2511,28 @@ static void fcoe_ctlr_vn_add(struct fcoe_ctlr *fip, struct fc_rport_priv *new) · 10 unmodified lines
2515 rdata->disc_id = lport->disc.disc_id;2511 rdata->disc_id = lport->disc.disc_id;
2516 2512
2517 ids = &rdata->ids;2513 ids = &rdata->ids;
2518 if ((ids->port_name != -1 && ids->port_name != new->ids.port_name) ||2514 if ((ids->port_name != -1 &&
2519 (ids->node_name != -1 && ids->node_name != new->ids.node_name)) {2515 ids->port_name != new->rdata.ids.port_name) ||
2516 (ids->node_name != -1 &&
2517 ids->node_name != new->rdata.ids.node_name)) {
2520 mutex_unlock(&rdata->rp_mutex);2518 mutex_unlock(&rdata->rp_mutex);
2521 LIBFCOE_FIP_DBG(fip, "vn_add rport logoff %6.6x\n", port_id);2519 LIBFCOE_FIP_DBG(fip, "vn_add rport logoff %6.6x\n", port_id);
2522 fc_rport_logoff(rdata);2520 fc_rport_logoff(rdata);
2523 mutex_lock(&rdata->rp_mutex);2521 mutex_lock(&rdata->rp_mutex);
2524 }2522 }
2525 ids->port_name = new->ids.port_name;2523 ids->port_name = new->rdata.ids.port_name;
2526 ids->node_name = new->ids.node_name;2524 ids->node_name = new->rdata.ids.node_name;
2527 mutex_unlock(&rdata->rp_mutex);2525 mutex_unlock(&rdata->rp_mutex);
2528 2526
2529 frport = fcoe_ctlr_rport(rdata);2527 frport = fcoe_ctlr_rport(rdata);
2530 LIBFCOE_FIP_DBG(fip, "vn_add rport %6.6x %s state %d\n",2528 LIBFCOE_FIP_DBG(fip, "vn_add rport %6.6x %s state %d\n",
2531 port_id, frport->fcoe_len ? "old" : "new",2529 port_id, frport->fcoe_len ? "old" : "new",
2532 rdata->rp_state);2530 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);
2534 frport->time = 0;2536 frport->time = 0;
2535}2537}
2536 2538
@@ -2562,16 +2564,14 @@ static int fcoe_ctlr_vn_lookup(struct fcoe_ctlr *fip, u32 port_id, u8 *mac) · 25 unmodified lines
2562/**2564/**
2563 * fcoe_ctlr_vn_claim_notify() - handle received FIP VN2VN Claim Notification2565 * fcoe_ctlr_vn_claim_notify() - handle received FIP VN2VN Claim Notification
2564 * @fip: The FCoE controller2566 * @fip: The FCoE controller
2565 * @new: newly-parsed remote port with frport as a template for new rdata2567 * @new: newly-parsed FCoE rport as a template for new rdata
2566 *2568 *
2567 * Called with ctlr_mutex held.2569 * Called with ctlr_mutex held.
2568 */2570 */
2569static void fcoe_ctlr_vn_claim_notify(struct fcoe_ctlr *fip,2571static void fcoe_ctlr_vn_claim_notify(struct fcoe_ctlr *fip,
2570 struct fc_rport_priv *new)2572 struct fcoe_rport *new)
2571{2573{
2572 struct fcoe_rport *frport = fcoe_ctlr_rport(new);2574 if (new->flags & FIP_FL_REC_OR_P2P) {
2573
2574 if (frport->flags & FIP_FL_REC_OR_P2P) {
2575 LIBFCOE_FIP_DBG(fip, "send probe req for P2P/REC\n");2575 LIBFCOE_FIP_DBG(fip, "send probe req for P2P/REC\n");
2576 fcoe_ctlr_vn_send(fip, FIP_SC_VN_PROBE_REQ, fcoe_all_vn2vn, 0);2576 fcoe_ctlr_vn_send(fip, FIP_SC_VN_PROBE_REQ, fcoe_all_vn2vn, 0);
2577 return;2577 return;
@@ -2580,7 +2580,7 @@ static void fcoe_ctlr_vn_claim_notify(struct fcoe_ctlr *fip, · 2 unmodified lines
2580 case FIP_ST_VNMP_START:2580 case FIP_ST_VNMP_START:
2581 case FIP_ST_VNMP_PROBE1:2581 case FIP_ST_VNMP_PROBE1:
2582 case FIP_ST_VNMP_PROBE2:2582 case FIP_ST_VNMP_PROBE2:
2583 if (new->ids.port_id == fip->port_id) {2583 if (new->rdata.ids.port_id == fip->port_id) {
2584 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: "2584 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: "
2585 "restart, state %d\n",2585 "restart, state %d\n",
2586 fip->state);2586 fip->state);
@@ -2589,8 +2589,8 @@ static void fcoe_ctlr_vn_claim_notify(struct fcoe_ctlr *fip, · 2 unmodified lines
2589 break;2589 break;
2590 case FIP_ST_VNMP_CLAIM:2590 case FIP_ST_VNMP_CLAIM:
2591 case FIP_ST_VNMP_UP:2591 case FIP_ST_VNMP_UP:
2592 if (new->ids.port_id == fip->port_id) {2592 if (new->rdata.ids.port_id == fip->port_id) {
2593 if (new->ids.port_name > fip->lp->wwpn) {2593 if (new->rdata.ids.port_name > fip->lp->wwpn) {
2594 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: "2594 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: "
2595 "restart, port_id collision\n");2595 "restart, port_id collision\n");
2596 fcoe_ctlr_vn_restart(fip);2596 fcoe_ctlr_vn_restart(fip);
@@ -2602,15 +2602,16 @@ static void fcoe_ctlr_vn_claim_notify(struct fcoe_ctlr *fip, · 5 unmodified lines
2602 break;2602 break;
2603 }2603 }
2604 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: send reply to %x\n",2604 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: send reply to %x\n",
2605 new->ids.port_id);2605 new->rdata.ids.port_id);
2606 fcoe_ctlr_vn_send(fip, FIP_SC_VN_CLAIM_REP, frport->enode_mac,2606 fcoe_ctlr_vn_send(fip, FIP_SC_VN_CLAIM_REP, new->enode_mac,
2607 min((u32)frport->fcoe_len,2607 min((u32)new->fcoe_len,
2608 fcoe_ctlr_fcoe_size(fip)));2608 fcoe_ctlr_fcoe_size(fip)));
2609 fcoe_ctlr_vn_add(fip, new);2609 fcoe_ctlr_vn_add(fip, new);
2610 break;2610 break;
2611 default:2611 default:
2612 LIBFCOE_FIP_DBG(fip, "vn_claim_notify: "2612 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);
2614 break;2615 break;
2615 }2616 }
2616}2617}
@@ -2618,15 +2619,15 @@ static void fcoe_ctlr_vn_claim_notify(struct fcoe_ctlr *fip, · 1 unmodified line
2618/**2619/**
2619 * fcoe_ctlr_vn_claim_resp() - handle received Claim Response2620 * fcoe_ctlr_vn_claim_resp() - handle received Claim Response
2620 * @fip: The FCoE controller that received the frame2621 * @fip: The FCoE controller that received the frame
2621 * @new: newly-parsed remote port with frport from the Claim Response2622 * @new: newly-parsed FCoE rport from the Claim Response
2622 *2623 *
2623 * Called with ctlr_mutex held.2624 * Called with ctlr_mutex held.
2624 */2625 */
2625static void fcoe_ctlr_vn_claim_resp(struct fcoe_ctlr *fip,2626static void fcoe_ctlr_vn_claim_resp(struct fcoe_ctlr *fip,
2626 struct fc_rport_priv *new)2627 struct fcoe_rport *new)
2627{2628{
2628 LIBFCOE_FIP_DBG(fip, "claim resp from from rport %x - state %s\n",2629 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));
2630 if (fip->state == FIP_ST_VNMP_UP || fip->state == FIP_ST_VNMP_CLAIM)2631 if (fip->state == FIP_ST_VNMP_UP || fip->state == FIP_ST_VNMP_CLAIM)
2631 fcoe_ctlr_vn_add(fip, new);2632 fcoe_ctlr_vn_add(fip, new);
2632}2633}
@@ -2634,28 +2635,28 @@ static void fcoe_ctlr_vn_claim_resp(struct fcoe_ctlr *fip, · 1 unmodified line
2634/**2635/**
2635 * fcoe_ctlr_vn_beacon() - handle received beacon.2636 * fcoe_ctlr_vn_beacon() - handle received beacon.
2636 * @fip: The FCoE controller that received the frame2637 * @fip: The FCoE controller that received the frame
2637 * @new: newly-parsed remote port with frport from the Beacon2638 * @new: newly-parsed FCoE rport from the Beacon
2638 *2639 *
2639 * Called with ctlr_mutex held.2640 * Called with ctlr_mutex held.
2640 */2641 */
2641static void fcoe_ctlr_vn_beacon(struct fcoe_ctlr *fip,2642static void fcoe_ctlr_vn_beacon(struct fcoe_ctlr *fip,
2642 struct fc_rport_priv *new)2643 struct fcoe_rport *new)
2643{2644{
2644 struct fc_lport *lport = fip->lp;2645 struct fc_lport *lport = fip->lp;
2645 struct fc_rport_priv *rdata;2646 struct fc_rport_priv *rdata;
2646 struct fcoe_rport *frport;2647 struct fcoe_rport *frport;
2647 2648
2648 frport = fcoe_ctlr_rport(new);2649 if (new->flags & FIP_FL_REC_OR_P2P) {
2649 if (frport->flags & FIP_FL_REC_OR_P2P) {
2650 LIBFCOE_FIP_DBG(fip, "p2p beacon while in vn2vn mode\n");2650 LIBFCOE_FIP_DBG(fip, "p2p beacon while in vn2vn mode\n");
2651 fcoe_ctlr_vn_send(fip, FIP_SC_VN_PROBE_REQ, fcoe_all_vn2vn, 0);2651 fcoe_ctlr_vn_send(fip, FIP_SC_VN_PROBE_REQ, fcoe_all_vn2vn, 0);
2652 return;2652 return;
2653 }2653 }
2654 rdata = fc_rport_lookup(lport, new->ids.port_id);2654 rdata = fc_rport_lookup(lport, new->rdata.ids.port_id);
2655 if (rdata) {2655 if (rdata) {
2656 if (rdata->ids.node_name == new->ids.node_name &&2656 if (rdata->ids.node_name == new->rdata.ids.node_name &&
2657 rdata->ids.port_name == new->ids.port_name) {2657 rdata->ids.port_name == new->rdata.ids.port_name) {
2658 frport = fcoe_ctlr_rport(rdata);2658 frport = fcoe_ctlr_rport(rdata);
2659
2659 LIBFCOE_FIP_DBG(fip, "beacon from rport %x\n",2660 LIBFCOE_FIP_DBG(fip, "beacon from rport %x\n",
2660 rdata->ids.port_id);2661 rdata->ids.port_id);
2661 if (!frport->time && fip->state == FIP_ST_VNMP_UP) {2662 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
2678 * Don't add the neighbor yet.2679 * Don't add the neighbor yet.
2679 */2680 */
2680 LIBFCOE_FIP_DBG(fip, "beacon from new rport %x. sending claim notify\n",2681 LIBFCOE_FIP_DBG(fip, "beacon from new rport %x. sending claim notify\n",
2681 new->ids.port_id);2682 new->rdata.ids.port_id);
2682 if (time_after(jiffies,2683 if (time_after(jiffies,
2683 fip->sol_time + msecs_to_jiffies(FIP_VN_ANN_WAIT)))2684 fip->sol_time + msecs_to_jiffies(FIP_VN_ANN_WAIT)))
2684 fcoe_ctlr_vn_send_claim(fip);2685 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
2738{2739{
2739 struct fip_header *fiph;2740 struct fip_header *fiph;
2740 enum fip_vn2vn_subcode sub;2741 enum fip_vn2vn_subcode sub;
2741 struct {2742 struct fcoe_rport frport = { };
2742 struct fc_rport_priv rdata;
2743 struct fcoe_rport frport;
2744 } buf;
2745 int rc, vlan_id = 0;2743 int rc, vlan_id = 0;
2746 2744
2747 fiph = (struct fip_header *)skb->data;2745 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
2757 goto drop;2755 goto drop;
2758 }2756 }
2759 2757
2760 rc = fcoe_ctlr_vn_parse(fip, skb, &buf.rdata);2758 rc = fcoe_ctlr_vn_parse(fip, skb, &frport);
2761 if (rc) {2759 if (rc) {
2762 LIBFCOE_FIP_DBG(fip, "vn_recv vn_parse error %d\n", rc);2760 LIBFCOE_FIP_DBG(fip, "vn_recv vn_parse error %d\n", rc);
2763 goto drop;2761 goto drop;
@@ -2766,19 +2764,19 @@ static int fcoe_ctlr_vn_recv(struct fcoe_ctlr *fip, struct sk_buff *skb) · 2 unmodified lines
2766 mutex_lock(&fip->ctlr_mutex);2764 mutex_lock(&fip->ctlr_mutex);
2767 switch (sub) {2765 switch (sub) {
2768 case FIP_SC_VN_PROBE_REQ:2766 case FIP_SC_VN_PROBE_REQ:
2769 fcoe_ctlr_vn_probe_req(fip, &buf.rdata);2767 fcoe_ctlr_vn_probe_req(fip, &frport);
2770 break;2768 break;
2771 case FIP_SC_VN_PROBE_REP:2769 case FIP_SC_VN_PROBE_REP:
2772 fcoe_ctlr_vn_probe_reply(fip, &buf.rdata);2770 fcoe_ctlr_vn_probe_reply(fip, &frport);
2773 break;2771 break;
2774 case FIP_SC_VN_CLAIM_NOTIFY:2772 case FIP_SC_VN_CLAIM_NOTIFY:
2775 fcoe_ctlr_vn_claim_notify(fip, &buf.rdata);2773 fcoe_ctlr_vn_claim_notify(fip, &frport);
2776 break;2774 break;
2777 case FIP_SC_VN_CLAIM_REP:2775 case FIP_SC_VN_CLAIM_REP:
2778 fcoe_ctlr_vn_claim_resp(fip, &buf.rdata);2776 fcoe_ctlr_vn_claim_resp(fip, &frport);
2779 break;2777 break;
2780 case FIP_SC_VN_BEACON:2778 case FIP_SC_VN_BEACON:
2781 fcoe_ctlr_vn_beacon(fip, &buf.rdata);2779 fcoe_ctlr_vn_beacon(fip, &frport);
2782 break;2780 break;
2783 default:2781 default:
2784 LIBFCOE_FIP_DBG(fip, "vn_recv unknown subcode %d\n", sub);2782 LIBFCOE_FIP_DBG(fip, "vn_recv unknown subcode %d\n", sub);
@@ -2802,22 +2800,18 @@ drop: · 17 unmodified lines
2802 */2800 */
2803static int fcoe_ctlr_vlan_parse(struct fcoe_ctlr *fip,2801static int fcoe_ctlr_vlan_parse(struct fcoe_ctlr *fip,
2804 struct sk_buff *skb,2802 struct sk_buff *skb,
2805 struct fc_rport_priv *rdata)2803 struct fcoe_rport *frport)
2806{2804{
2807 struct fip_header *fiph;2805 struct fip_header *fiph;
2808 struct fip_desc *desc = NULL;2806 struct fip_desc *desc = NULL;
2809 struct fip_mac_desc *macd = NULL;2807 struct fip_mac_desc *macd = NULL;
2810 struct fip_wwn_desc *wwn = NULL;2808 struct fip_wwn_desc *wwn = NULL;
2811 struct fcoe_rport *frport;
2812 size_t rlen;2809 size_t rlen;
2813 size_t dlen;2810 size_t dlen;
2814 u32 desc_mask = 0;2811 u32 desc_mask = 0;
2815 u32 dtype;2812 u32 dtype;
2816 u8 sub;2813 u8 sub;
2817 2814
2818 memset(rdata, 0, sizeof(*rdata) + sizeof(*frport));
2819 frport = fcoe_ctlr_rport(rdata);
2820
2821 fiph = (struct fip_header *)skb->data;2815 fiph = (struct fip_header *)skb->data;
2822 frport->flags = ntohs(fiph->fip_flags);2816 frport->flags = ntohs(fiph->fip_flags);
2823 2817
@@ -2871,7 +2865,8 @@ static int fcoe_ctlr_vlan_parse(struct fcoe_ctlr *fip, · 47 unmodified lines
2871 if (dlen != sizeof(struct fip_wwn_desc))2865 if (dlen != sizeof(struct fip_wwn_desc))
2872 goto len_err;2866 goto len_err;
2873 wwn = (struct fip_wwn_desc *)desc;2867 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);
2875 break;2870 break;
2876 default:2871 default:
2877 LIBFCOE_FIP_DBG(fip, "unexpected descriptor type %x "2872 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
2957/**2952/**
2958 * fcoe_ctlr_vlan_disk_reply() - send FIP VLAN Discovery Notification.2953 * fcoe_ctlr_vlan_disk_reply() - send FIP VLAN Discovery Notification.
2959 * @fip: The FCoE controller2954 * @fip: The FCoE controller
2955 * @frport: The newly-parsed FCoE rport from the Discovery Request
2960 *2956 *
2961 * Called with ctlr_mutex held.2957 * Called with ctlr_mutex held.
2962 */2958 */
2963static void fcoe_ctlr_vlan_disc_reply(struct fcoe_ctlr *fip,2959static void fcoe_ctlr_vlan_disc_reply(struct fcoe_ctlr *fip,
2964 struct fc_rport_priv *rdata)2960 struct fcoe_rport *frport)
2965{2961{
2966 struct fcoe_rport *frport = fcoe_ctlr_rport(rdata);
2967 enum fip_vlan_subcode sub = FIP_SC_VL_NOTE;2962 enum fip_vlan_subcode sub = FIP_SC_VL_NOTE;
2968 2963
2969 if (fip->mode == FIP_MODE_VN2VN)2964 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
2982{2977{
2983 struct fip_header *fiph;2978 struct fip_header *fiph;
2984 enum fip_vlan_subcode sub;2979 enum fip_vlan_subcode sub;
2985 struct {2980 struct fcoe_rport frport = { };
2986 struct fc_rport_priv rdata;
2987 struct fcoe_rport frport;
2988 } buf;
2989 int rc;2981 int rc;
2990 2982
2991 fiph = (struct fip_header *)skb->data;2983 fiph = (struct fip_header *)skb->data;
2992 sub = fiph->fip_subcode;2984 sub = fiph->fip_subcode;
2993 rc = fcoe_ctlr_vlan_parse(fip, skb, &buf.rdata);2985 rc = fcoe_ctlr_vlan_parse(fip, skb, &frport);
2994 if (rc) {2986 if (rc) {
2995 LIBFCOE_FIP_DBG(fip, "vlan_recv vlan_parse error %d\n", rc);2987 LIBFCOE_FIP_DBG(fip, "vlan_recv vlan_parse error %d\n", rc);
2996 goto drop;2988 goto drop;
2997 }2989 }
2998 mutex_lock(&fip->ctlr_mutex);2990 mutex_lock(&fip->ctlr_mutex);
2999 if (sub == FIP_SC_VL_REQ)2991 if (sub == FIP_SC_VL_REQ)
3000 fcoe_ctlr_vlan_disc_reply(fip, &buf.rdata);2992 fcoe_ctlr_vlan_disc_reply(fip, &frport);
3001 mutex_unlock(&fip->ctlr_mutex);2993 mutex_unlock(&fip->ctlr_mutex);
3002 2994
3003drop:2995drop:
drivers/scsi/hpsa.c+11−3
@@ -2334,6 +2334,8 @@ static int handle_ioaccel_mode2_error(struct ctlr_info *h, · 2333 unmodified lines
2334 case IOACCEL2_SERV_RESPONSE_COMPLETE:2334 case IOACCEL2_SERV_RESPONSE_COMPLETE:
2335 switch (c2->error_data.status) {2335 switch (c2->error_data.status) {
2336 case IOACCEL2_STATUS_SR_TASK_COMP_GOOD:2336 case IOACCEL2_STATUS_SR_TASK_COMP_GOOD:
2337 if (cmd)
2338 cmd->result = 0;
2337 break;2339 break;
2338 case IOACCEL2_STATUS_SR_TASK_COMP_CHK_COND:2340 case IOACCEL2_STATUS_SR_TASK_COMP_CHK_COND:
2339 cmd->result |= SAM_STAT_CHECK_CONDITION;2341 cmd->result |= SAM_STAT_CHECK_CONDITION;
@@ -2483,8 +2485,10 @@ static void process_ioaccel2_completion(struct ctlr_info *h, · 143 unmodified lines
2483 2485
2484 /* check for good status */2486 /* check for good status */
2485 if (likely(c2->error_data.serv_response == 0 &&2487 if (likely(c2->error_data.serv_response == 0 &&
2486 c2->error_data.status == 0))2488 c2->error_data.status == 0)) {
2489 cmd->result = 0;
2487 return hpsa_cmd_free_and_done(h, c, cmd);2490 return hpsa_cmd_free_and_done(h, c, cmd);
2491 }
2488 2492
2489 /*2493 /*
2490 * Any RAID offload error results in retry which will use2494 * 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
5653 if (c == NULL)5657 if (c == NULL)
5654 return SCSI_MLQUEUE_DEVICE_BUSY;5658 return SCSI_MLQUEUE_DEVICE_BUSY;
5655 5659
5660 /*
5661 * This is necessary because the SML doesn't zero out this field during
5662 * error recovery.
5663 */
5664 cmd->result = 0;
5665
5656 /*5666 /*
5657 * Call alternate submit routine for I/O accelerated commands.5667 * Call alternate submit routine for I/O accelerated commands.
5658 * Retries always go down the normal I/O path.5668 * 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
6081 if (idx != h->last_collision_tag) { /* Print once per tag */6091 if (idx != h->last_collision_tag) { /* Print once per tag */
6082 dev_warn(&h->pdev->dev,6092 dev_warn(&h->pdev->dev,
6083 "%s: tag collision (tag=%d)\n", __func__, idx);6093 "%s: tag collision (tag=%d)\n", __func__, idx);
6084 if (c->scsi_cmd != NULL)
6085 scsi_print_command(c->scsi_cmd);
6086 if (scmd)6094 if (scmd)
6087 scsi_print_command(scmd);6095 scsi_print_command(scmd);
6088 h->last_collision_tag = idx;6096 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
128struct fc_rport_priv *fc_rport_create(struct fc_lport *lport, u32 port_id)128struct fc_rport_priv *fc_rport_create(struct fc_lport *lport, u32 port_id)
129{129{
130 struct fc_rport_priv *rdata;130 struct fc_rport_priv *rdata;
131 size_t rport_priv_size = sizeof(*rdata);
131 132
132 lockdep_assert_held(&lport->disc.disc_mutex);133 lockdep_assert_held(&lport->disc.disc_mutex);
133 134
@@ -135,7 +136,9 @@ struct fc_rport_priv *fc_rport_create(struct fc_lport *lport, u32 port_id) · 1 unmodified line
135 if (rdata)136 if (rdata)
136 return rdata;137 return rdata;
137 138
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);
139 if (!rdata)142 if (!rdata)
140 return NULL;143 return NULL;
141 144
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
2703{2703{
2704 u64 required_mask, coherent_mask;2704 u64 required_mask, coherent_mask;
2705 struct sysinfo s;2705 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;
2706 2708
2707 if (ioc->is_mcpu_endpoint)2709 if (ioc->is_mcpu_endpoint)
2708 goto try_32bit;2710 goto try_32bit;
@@ -2712,17 +2714,17 @@ _base_config_dma_addressing(struct MPT3SAS_ADAPTER *ioc, struct pci_dev *pdev) · 3 unmodified lines
2712 goto try_32bit;2714 goto try_32bit;
2713 2715
2714 if (ioc->dma_mask)2716 if (ioc->dma_mask)
2715 coherent_mask = DMA_BIT_MASK(64);2717 coherent_mask = DMA_BIT_MASK(dma_mask);
2716 else2718 else
2717 coherent_mask = DMA_BIT_MASK(32);2719 coherent_mask = DMA_BIT_MASK(32);
2718 2720
2719 if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) ||2721 if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(dma_mask)) ||
2720 dma_set_coherent_mask(&pdev->dev, coherent_mask))2722 dma_set_coherent_mask(&pdev->dev, coherent_mask))
2721 goto try_32bit;2723 goto try_32bit;
2722 2724
2723 ioc->base_add_sg_single = &_base_add_sg_single_64;2725 ioc->base_add_sg_single = &_base_add_sg_single_64;
2724 ioc->sge_size = sizeof(Mpi2SGESimple64_t);2726 ioc->sge_size = sizeof(Mpi2SGESimple64_t);
2725 ioc->dma_mask = 64;2727 ioc->dma_mask = dma_mask;
2726 goto out;2728 goto out;
2727 2729
2728 try_32bit:2730 try_32bit:
@@ -2744,7 +2746,7 @@ static int · 15 unmodified lines
2744_base_change_consistent_dma_mask(struct MPT3SAS_ADAPTER *ioc,2746_base_change_consistent_dma_mask(struct MPT3SAS_ADAPTER *ioc,
2745 struct pci_dev *pdev)2747 struct pci_dev *pdev)
2746{2748{
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))) {
2748 if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)))2750 if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)))
2749 return -ENODEV;2751 return -ENODEV;
2750 }2752 }
@@ -4989,7 +4991,7 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc) · 2238 unmodified lines
4989 total_sz += sz;4991 total_sz += sz;
4990 } while (ioc->rdpq_array_enable && (++i < ioc->reply_queue_count));4992 } while (ioc->rdpq_array_enable && (++i < ioc->reply_queue_count));
4991 4993
4992 if (ioc->dma_mask == 64) {4994 if (ioc->dma_mask > 32) {
4993 if (_base_change_consistent_dma_mask(ioc, ioc->pdev) != 0) {4995 if (_base_change_consistent_dma_mask(ioc, ioc->pdev) != 0) {
4994 ioc_warn(ioc, "no suitable consistent DMA mask for %s\n",4996 ioc_warn(ioc, "no suitable consistent DMA mask for %s\n",
4995 pci_name(ioc->pdev));4997 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
4877 ql_log(ql_log_warn, vha, 0xd049,4877 ql_log(ql_log_warn, vha, 0xd049,
4878 "Failed to allocate ct_sns request.\n");4878 "Failed to allocate ct_sns request.\n");
4879 kfree(fcport);4879 kfree(fcport);
4880 fcport = NULL;4880 return NULL;
4881 }4881 }
4882 4882
4883 INIT_WORK(&fcport->del_work, qla24xx_delete_sess_fn);4883 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
834 bcm2835_wr(bs, BCM2835_SPI_CLK, cdiv);834 bcm2835_wr(bs, BCM2835_SPI_CLK, cdiv);
835 835
836 /* handle all the 3-wire mode */836 /* 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)
838 cs |= BCM2835_SPI_CS_REN;839 cs |= BCM2835_SPI_CS_REN;
839 else840 else
840 cs &= ~BCM2835_SPI_CS_REN;841 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
206};206};
207 207
208static const struct fsl_qspi_devtype_data imx7d_data = {208static const struct fsl_qspi_devtype_data imx7d_data = {
209 .rxfifo = SZ_512,209 .rxfifo = SZ_128,
210 .txfifo = SZ_512,210 .txfifo = SZ_512,
211 .ahb_buf_size = SZ_1K,211 .ahb_buf_size = SZ_1K,
212 .quirks = QUADSPI_QUIRK_TKT253890 | QUADSPI_QUIRK_4X_INT_CLK,212 .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
410 410
411 bb = &spi_gpio->bitbang;411 bb = &spi_gpio->bitbang;
412 bb->master = master;412 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;
413 bb->chipselect = spi_gpio_chipselect;419 bb->chipselect = spi_gpio_chipselect;
414 bb->set_line_direction = spi_gpio_set_direction;420 bb->set_line_direction = spi_gpio_set_direction;
415 421
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
1457 { PCI_VDEVICE(INTEL, 0x02aa), LPSS_CNL_SSP },1457 { PCI_VDEVICE(INTEL, 0x02aa), LPSS_CNL_SSP },
1458 { PCI_VDEVICE(INTEL, 0x02ab), LPSS_CNL_SSP },1458 { PCI_VDEVICE(INTEL, 0x02ab), LPSS_CNL_SSP },
1459 { PCI_VDEVICE(INTEL, 0x02fb), LPSS_CNL_SSP },1459 { 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 },
1460 { },1468 { },
1461};1469};
1462 1470
@@ -1831,14 +1839,16 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) · 368 unmodified lines
1831 status = devm_spi_register_controller(&pdev->dev, controller);1839 status = devm_spi_register_controller(&pdev->dev, controller);
1832 if (status != 0) {1840 if (status != 0) {
1833 dev_err(&pdev->dev, "problem registering spi controller\n");1841 dev_err(&pdev->dev, "problem registering spi controller\n");
1834 goto out_error_clock_enabled;1842 goto out_error_pm_runtime_enabled;
1835 }1843 }
1836 1844
1837 return status;1845 return status;
1838 1846
1839out_error_clock_enabled:1847out_error_pm_runtime_enabled:
1840 pm_runtime_put_noidle(&pdev->dev);1848 pm_runtime_put_noidle(&pdev->dev);
1841 pm_runtime_disable(&pdev->dev);1849 pm_runtime_disable(&pdev->dev);
1850
1851out_error_clock_enabled:
1842 clk_disable_unprepare(ssp->clk);1852 clk_disable_unprepare(ssp->clk);
1843 1853
1844out_error_dma_irq_alloc:1854out_error_dma_irq_alloc:
drivers/staging/android/ion/ion_page_pool.c+3−0
@@ -8,11 +8,14 @@ · 7 unmodified lines
8#include <linux/list.h>8#include <linux/list.h>
9#include <linux/slab.h>9#include <linux/slab.h>
10#include <linux/swap.h>10#include <linux/swap.h>
11#include <linux/sched/signal.h>
11 12
12#include "ion.h"13#include "ion.h"
13 14
14static inline struct page *ion_page_pool_alloc_pages(struct ion_page_pool *pool)15static inline struct page *ion_page_pool_alloc_pages(struct ion_page_pool *pool)
15{16{
17 if (fatal_signal_pending(current))
18 return NULL;
16 return alloc_pages(pool->gfp_mask, pool->order);19 return alloc_pages(pool->gfp_mask, pool->order);
17}20}
18 21
drivers/staging/fbtft/fb_bd663474.c+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
24 24
25static int init_display(struct fbtft_par *par)25static int init_display(struct fbtft_par *par)
26{26{
27 if (!par->gpio.cs)27 if (par->gpio.cs)
28 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */28 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */
29 29
30 par->fbtftops.reset(par);30 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
77{77{
78 par->fbtftops.reset(par);78 par->fbtftops.reset(par);
79 79
80 if (!par->gpio.cs)80 if (par->gpio.cs)
81 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */81 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */
82 82
83 write_reg(par, MIPI_DCS_SOFT_RESET); /* software reset */83 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
85{85{
86 par->fbtftops.reset(par);86 par->fbtftops.reset(par);
87 87
88 if (!par->gpio.cs)88 if (par->gpio.cs)
89 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */89 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */
90 90
91 bt &= 0x07;91 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
29{29{
30 par->fbtftops.reset(par);30 par->fbtftops.reset(par);
31 31
32 if (!par->gpio.cs)32 if (par->gpio.cs)
33 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */33 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */
34 34
35 /* Initialization sequence from Lib_UTFT */35 /* 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
28{28{
29 par->fbtftops.reset(par);29 par->fbtftops.reset(par);
30 30
31 if (!par->gpio.cs)31 if (par->gpio.cs)
32 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */32 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */
33 33
34 write_reg(par, 0x00, 0x0001);34 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
81 va_start(args, len);81 va_start(args, len);
82 82
83 *buf = (u8)va_arg(args, unsigned int);83 *buf = (u8)va_arg(args, unsigned int);
84 if (!par->gpio.dc)84 if (par->gpio.dc)
85 gpiod_set_value(par->gpio.dc, 0);85 gpiod_set_value(par->gpio.dc, 0);
86 ret = par->fbtftops.write(par, par->buf, sizeof(u8));86 ret = par->fbtftops.write(par, par->buf, sizeof(u8));
87 if (ret < 0) {87 if (ret < 0) {
@@ -104,7 +104,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...) · 16 unmodified lines
104 return;104 return;
105 }105 }
106 }106 }
107 if (!par->gpio.dc)107 if (par->gpio.dc)
108 gpiod_set_value(par->gpio.dc, 1);108 gpiod_set_value(par->gpio.dc, 1);
109 va_end(args);109 va_end(args);
110}110}
drivers/staging/fbtft/fb_upd161704.c+1−1
@@ -26,7 +26,7 @@ static int init_display(struct fbtft_par *par) · 25 unmodified lines
26{26{
27 par->fbtftops.reset(par);27 par->fbtftops.reset(par);
28 28
29 if (!par->gpio.cs)29 if (par->gpio.cs)
30 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */30 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */
31 31
32 /* Initialization sequence from Lib_UTFT */32 /* 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
135 remain = len / 2;135 remain = len / 2;
136 vmem16 = (u16 *)(par->info->screen_buffer + offset);136 vmem16 = (u16 *)(par->info->screen_buffer + offset);
137 137
138 if (!par->gpio.dc)138 if (par->gpio.dc)
139 gpiod_set_value(par->gpio.dc, 1);139 gpiod_set_value(par->gpio.dc, 1);
140 140
141 /* non buffered write */141 /* 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
76 struct gpio_desc **gpiop)76 struct gpio_desc **gpiop)
77{77{
78 struct device *dev = par->info->device;78 struct device *dev = par->info->device;
79 struct device_node *node = dev->of_node;
80 int ret = 0;79 int ret = 0;
81 80
82 if (of_find_property(node, name, NULL)) {81 *gpiop = devm_gpiod_get_index_optional(dev, name, index,
83 *gpiop = devm_gpiod_get_index(dev, dev->driver->name, index,82 GPIOD_OUT_HIGH);
84 GPIOD_OUT_HIGH);83 if (IS_ERR(*gpiop)) {
85 if (IS_ERR(*gpiop)) {84 ret = PTR_ERR(*gpiop);
86 ret = PTR_ERR(*gpiop);85 dev_err(dev,
87 dev_err(dev,86 "Failed to request %s GPIO: %d\n", name, ret);
88 "Failed to request %s GPIO:%d\n", name, ret);87 return ret;
89 return ret;
90 }
91 fbtft_par_dbg(DEBUG_REQUEST_GPIOS, par, "%s: '%s' GPIO\n",
92 __func__, name);
93 }88 }
89 fbtft_par_dbg(DEBUG_REQUEST_GPIOS, par, "%s: '%s' GPIO\n",
90 __func__, name);
94 91
95 return ret;92 return ret;
96}93}
@@ -103,34 +100,34 @@ static int fbtft_request_gpios_dt(struct fbtft_par *par) · 6 unmodified lines
103 if (!par->info->device->of_node)100 if (!par->info->device->of_node)
104 return -EINVAL;101 return -EINVAL;
105 102
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);
107 if (ret)104 if (ret)
108 return ret;105 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);
110 if (ret)107 if (ret)
111 return ret;108 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);
113 if (ret)110 if (ret)
114 return ret;111 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);
116 if (ret)113 if (ret)
117 return ret;114 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);
119 if (ret)116 if (ret)
120 return ret;117 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);
122 if (ret)119 if (ret)
123 return ret;120 return ret;
124 for (i = 0; i < 16; i++) {121 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,
126 &par->gpio.db[i]);123 &par->gpio.db[i]);
127 if (ret)124 if (ret)
128 return ret;125 return ret;
129 ret = fbtft_request_one_gpio(par, "led-gpios", i,126 ret = fbtft_request_one_gpio(par, "led", i,
130 &par->gpio.led[i]);127 &par->gpio.led[i]);
131 if (ret)128 if (ret)
132 return ret;129 return ret;
133 ret = fbtft_request_one_gpio(par, "aux-gpios", i,130 ret = fbtft_request_one_gpio(par, "aux", i,
134 &par->gpio.aux[i]);131 &par->gpio.aux[i]);
135 if (ret)132 if (ret)
136 return ret;133 return ret;
@@ -234,9 +231,9 @@ static void fbtft_reset(struct fbtft_par *par) · 97 unmodified lines
234 if (!par->gpio.reset)231 if (!par->gpio.reset)
235 return;232 return;
236 fbtft_par_dbg(DEBUG_RESET, par, "%s()\n", __func__);233 fbtft_par_dbg(DEBUG_RESET, par, "%s()\n", __func__);
237 gpiod_set_value_cansleep(par->gpio.reset, 0);
238 usleep_range(20, 40);
239 gpiod_set_value_cansleep(par->gpio.reset, 1);234 gpiod_set_value_cansleep(par->gpio.reset, 1);
235 usleep_range(20, 40);
236 gpiod_set_value_cansleep(par->gpio.reset, 0);
240 msleep(120);237 msleep(120);
241}238}
242 239
@@ -921,7 +918,7 @@ static int fbtft_init_display_dt(struct fbtft_par *par) · 678 unmodified lines
921 return -EINVAL;918 return -EINVAL;
922 919
923 par->fbtftops.reset(par);920 par->fbtftops.reset(par);
924 if (!par->gpio.cs)921 if (par->gpio.cs)
925 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */922 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */
926 923
927 while (p) {924 while (p) {
@@ -1012,7 +1009,7 @@ int fbtft_init_display(struct fbtft_par *par) · 84 unmodified lines
1012 }1009 }
1013 1010
1014 par->fbtftops.reset(par);1011 par->fbtftops.reset(par);
1015 if (!par->gpio.cs)1012 if (par->gpio.cs)
1016 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */1013 gpiod_set_value(par->gpio.cs, 0); /* Activate chip */
1017 1014
1018 i = 0;1015 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
532 break;532 break;
533 case ATTR_KERNEL_HIB_SIMPLE_PAGE_TABLE_SIZE:533 case ATTR_KERNEL_HIB_SIMPLE_PAGE_TABLE_SIZE:
534 ret = scnprintf(buf, PAGE_SIZE, "%u\n",534 ret = scnprintf(buf, PAGE_SIZE, "%u\n",
535 gasket_page_table_num_entries(535 gasket_page_table_num_simple_entries(
536 gasket_dev->page_table[0]));536 gasket_dev->page_table[0]));
537 break;537 break;
538 case ATTR_KERNEL_HIB_NUM_ACTIVE_PAGES:538 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
1750}1750}
1751 1751
1752/* poll_for_irq - checks the status of the response queue1752/* 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.
1754 *1755 *
1755 * Main function of the vnic_incoming thread. Periodically check the response1756 * Main function of the vnic_incoming thread. Periodically check the response
1756 * queue and drain it if needed.1757 * 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
1969 1969
1970 priv->p2p_listen_state = false;1970 priv->p2p_listen_state = false;
1971 1971
1972 flush_workqueue(vif->wilc->hif_workqueue);
1972 mutex_destroy(&priv->scan_req_lock);1973 mutex_destroy(&priv->scan_req_lock);
1973 ret = wilc_deinit(vif);1974 ret = wilc_deinit(vif);
1974 1975
drivers/tty/serial/kgdboc.c+4−0
@@ -277,10 +277,14 @@ static void kgdboc_pre_exp_handler(void) · 276 unmodified lines
277 /* Increment the module count when the debugger is active */277 /* Increment the module count when the debugger is active */
278 if (!kgdb_connected)278 if (!kgdb_connected)
279 try_module_get(THIS_MODULE);279 try_module_get(THIS_MODULE);
280
281 atomic_inc(&ignore_console_lock_warning);
280}282}
281 283
282static void kgdboc_post_exp_handler(void)284static void kgdboc_post_exp_handler(void)
283{285{
286 atomic_dec(&ignore_console_lock_warning);
287
284 /* decrement the module count when the debugger detaches */288 /* decrement the module count when the debugger detaches */
285 if (!kgdb_connected)289 if (!kgdb_connected)
286 module_put(THIS_MODULE);290 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
1812 return 0;1812 return 0;
1813 1813
1814 error:1814 error:
1815 if (as && as->usbm)
1816 dec_usb_memory_use_count(as->usbm, &as->usbm->urb_use_count);
1817 kfree(isopkt);1815 kfree(isopkt);
1818 kfree(dr);1816 kfree(dr);
1819 if (as)1817 if (as)
drivers/usb/core/hcd.c+0−123
@@ -103,11 +103,6 @@ static DEFINE_SPINLOCK(hcd_urb_unlink_lock); · 102 unmodified lines
103/* wait queue for synchronous unlinks */103/* wait queue for synchronous unlinks */
104DECLARE_WAIT_QUEUE_HEAD(usb_kill_urb_queue);104DECLARE_WAIT_QUEUE_HEAD(usb_kill_urb_queue);
105 105
106static inline int is_root_hub(struct usb_device *udev)
107{
108 return (udev->parent == NULL);
109}
110
111/*-------------------------------------------------------------------------*/106/*-------------------------------------------------------------------------*/
112 107
113/*108/*
@@ -880,101 +875,6 @@ static int usb_rh_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) · 766 unmodified lines
880}875}
881 876
882 877
883
884/*
885 * Show & store the current value of authorized_default
886 */
887static 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
898static 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}
919static 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 */
928static 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 */
944static 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}
962static DEVICE_ATTR_RW(interface_authorized_default);
963
964/* Group all the USB bus attributes */
965static struct attribute *usb_bus_attrs[] = {
966 &dev_attr_authorized_default.attr,
967 &dev_attr_interface_authorized_default.attr,
968 NULL,
969};
970
971static 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
978/*-------------------------------------------------------------------------*/878/*-------------------------------------------------------------------------*/
979 879
980/**880/**
@@ -2894,32 +2794,11 @@ int usb_add_hcd(struct usb_hcd *hcd, · 1913 unmodified lines
2894 if (retval != 0)2794 if (retval != 0)
2895 goto err_register_root_hub;2795 goto err_register_root_hub;
2896 2796
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 }
2903 if (hcd->uses_new_polling && HCD_POLL_RH(hcd))2797 if (hcd->uses_new_polling && HCD_POLL_RH(hcd))
2904 usb_hcd_poll_rh_status(hcd);2798 usb_hcd_poll_rh_status(hcd);
2905 2799
2906 return retval;2800 return retval;
2907 2801
2908error_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);
2923err_register_root_hub:2802err_register_root_hub:
2924 hcd->rh_pollable = 0;2803 hcd->rh_pollable = 0;
2925 clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);2804 clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
@@ -2963,8 +2842,6 @@ void usb_remove_hcd(struct usb_hcd *hcd) · 37 unmodified lines
2963 dev_info(hcd->self.controller, "remove, state %x\n", hcd->state);2842 dev_info(hcd->self.controller, "remove, state %x\n", hcd->state);
2964 2843
2965 usb_get_dev(rhdev);2844 usb_get_dev(rhdev);
2966 sysfs_remove_group(&rhdev->dev.kobj, &usb_bus_attr_group);
2967
2968 clear_bit(HCD_FLAG_RH_RUNNING, &hcd->flags);2845 clear_bit(HCD_FLAG_RH_RUNNING, &hcd->flags);
2969 if (HC_IS_RUNNING (hcd->state))2846 if (HC_IS_RUNNING (hcd->state))
2970 hcd->state = HC_STATE_QUIESCING;2847 hcd->state = HC_STATE_QUIESCING;
drivers/usb/core/sysfs.c+121−0
@@ -15,6 +15,7 @@ · 14 unmodified lines
15#include <linux/kernel.h>15#include <linux/kernel.h>
16#include <linux/string.h>16#include <linux/string.h>
17#include <linux/usb.h>17#include <linux/usb.h>
18#include <linux/usb/hcd.h>
18#include <linux/usb/quirks.h>19#include <linux/usb/quirks.h>
19#include <linux/of.h>20#include <linux/of.h>
20#include "usb.h"21#include "usb.h"
@@ -922,6 +923,116 @@ static struct bin_attribute dev_bin_attr_descriptors = { · 901 unmodified lines
922 .size = 18 + 65535, /* dev descr + max-size raw descriptor */923 .size = 18 + 65535, /* dev descr + max-size raw descriptor */
923};924};
924 925
926/*
927 * Show & store the current value of authorized_default
928 */
929static 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
940static 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}
961static 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 */
970static 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 */
986static 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}
1004static DEVICE_ATTR_RW(interface_authorized_default);
1005
1006/* Group all the USB bus attributes */
1007static struct attribute *usb_bus_attrs[] = {
1008 &dev_attr_authorized_default.attr,
1009 &dev_attr_interface_authorized_default.attr,
1010 NULL,
1011};
1012
1013static 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
1019static 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
1029static 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
925int usb_create_sysfs_dev_files(struct usb_device *udev)1036int usb_create_sysfs_dev_files(struct usb_device *udev)
926{1037{
927 struct device *dev = &udev->dev;1038 struct device *dev = &udev->dev;
@@ -938,7 +1049,14 @@ int usb_create_sysfs_dev_files(struct usb_device *udev) · 10 unmodified lines
938 retval = add_power_attributes(dev);1049 retval = add_power_attributes(dev);
939 if (retval)1050 if (retval)
940 goto error;1051 goto error;
1052
1053 if (is_root_hub(udev)) {
1054 retval = add_default_authorized_attributes(dev);
1055 if (retval)
1056 goto error;
1057 }
941 return retval;1058 return retval;
1059
942error:1060error:
943 usb_remove_sysfs_dev_files(udev);1061 usb_remove_sysfs_dev_files(udev);
944 return retval;1062 return retval;
@@ -948,6 +1066,9 @@ void usb_remove_sysfs_dev_files(struct usb_device *udev) · 3 unmodified lines
948{1066{
949 struct device *dev = &udev->dev;1067 struct device *dev = &udev->dev;
950 1068
1069 if (is_root_hub(udev))
1070 remove_default_authorized_attributes(dev);
1071
951 remove_power_attributes(dev);1072 remove_power_attributes(dev);
952 remove_persist_attributes(dev);1073 remove_persist_attributes(dev);
953 device_remove_bin_file(dev, &dev_bin_attr_descriptors);1074 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
153 return dev->type == &usb_port_device_type;153 return dev->type == &usb_port_device_type;
154}154}
155 155
156static inline int is_root_hub(struct usb_device *udev)
157{
158 return (udev->parent == NULL);
159}
160
156/* Do the same for device drivers and interface drivers. */161/* Do the same for device drivers and interface drivers. */
157 162
158static inline int is_usb_device_driver(struct device_driver *drv)163static 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
238 * pointers. So, this driver clears the AC64 bit of xhci->hcc_params238 * pointers. So, this driver clears the AC64 bit of xhci->hcc_params
239 * to call dma_set_coherent_mask(dev, DMA_BIT_MASK(32)) in239 * to call dma_set_coherent_mask(dev, DMA_BIT_MASK(32)) in
240 * xhci_gen_setup().240 * 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().
241 */245 */
242 if (xhci_rcar_is_gen2(hcd->self.controller) ||246 if (xhci_rcar_is_gen2(hcd->self.controller) ||
243 xhci_rcar_is_gen3(hcd->self.controller))247 xhci_rcar_is_gen3(hcd->self.controller)) {
244 xhci->quirks |= XHCI_NO_64BIT_SUPPORT;248 xhci->quirks |= XHCI_NO_64BIT_SUPPORT | XHCI_SLOW_SUSPEND;
249 }
245 250
246 if (!xhci_rcar_wait_for_pll_active(hcd))251 if (!xhci_rcar_wait_for_pll_active(hcd))
247 return -ETIMEDOUT;252 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
3089 return;3089 return;
3090 udev = (struct usb_device *) host_ep->hcpriv;3090 udev = (struct usb_device *) host_ep->hcpriv;
3091 vdev = xhci->devs[udev->slot_id];3091 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;
3092 ep_index = xhci_get_endpoint_index(&host_ep->desc);3100 ep_index = xhci_get_endpoint_index(&host_ep->desc);
3093 ep = &vdev->eps[ep_index];3101 ep = &vdev->eps[ep_index];
3102 if (!ep)
3103 return;
3094 3104
3095 /* Bail out if toggle is already being cleared by a endpoint reset */3105 /* Bail out if toggle is already being cleared by a endpoint reset */
3096 if (ep->ep_state & EP_HARD_CLEAR_TOGGLE) {3106 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
866 dev = usb_get_intfdata(interface);866 dev = usb_get_intfdata(interface);
867 mutex_lock(&iowarrior_open_disc_lock);867 mutex_lock(&iowarrior_open_disc_lock);
868 usb_set_intfdata(interface, NULL);868 usb_set_intfdata(interface, NULL);
869 /* prevent device read, write and ioctl */
870 dev->present = 0;
869 871
870 minor = dev->minor;872 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*/
871 875
872 /* give back our minor */
873 usb_deregister_dev(interface, &iowarrior_class);876 usb_deregister_dev(interface, &iowarrior_class);
874 877
875 mutex_lock(&dev->mutex);878 mutex_lock(&dev->mutex);
876 879
877 /* prevent device read, write and ioctl */880 /* prevent device read, write and ioctl */
878 dev->present = 0;
879 881
880 mutex_unlock(&dev->mutex);882 mutex_unlock(&dev->mutex);
881 mutex_unlock(&iowarrior_open_disc_lock);
882 883
883 if (dev->opened) {884 if (dev->opened) {
884 /* There is a process that holds a filedescriptor to the device ,885 /* 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
51 char *obuf, *ibuf; /* transfer buffers */51 char *obuf, *ibuf; /* transfer buffers */
52 char bulk_in_ep, bulk_out_ep; /* Endpoint assignments */52 char bulk_in_ep, bulk_out_ep; /* Endpoint assignments */
53 wait_queue_head_t wait_q; /* for timeouts */53 wait_queue_head_t wait_q; /* for timeouts */
54 struct mutex lock; /* general race avoidance */
54};55};
55 56
56static DEFINE_MUTEX(rio500_mutex);57static DEFINE_MUTEX(rio500_mutex);
@@ -62,8 +63,10 @@ static int open_rio(struct inode *inode, struct file *file) · 5 unmodified lines
62 63
63 /* against disconnect() */64 /* against disconnect() */
64 mutex_lock(&rio500_mutex);65 mutex_lock(&rio500_mutex);
66 mutex_lock(&(rio->lock));
65 67
66 if (rio->isopen || !rio->present) {68 if (rio->isopen || !rio->present) {
69 mutex_unlock(&(rio->lock));
67 mutex_unlock(&rio500_mutex);70 mutex_unlock(&rio500_mutex);
68 return -EBUSY;71 return -EBUSY;
69 }72 }
@@ -71,6 +74,7 @@ static int open_rio(struct inode *inode, struct file *file) · 1 unmodified line
71 74
72 init_waitqueue_head(&rio->wait_q);75 init_waitqueue_head(&rio->wait_q);
73 76
77 mutex_unlock(&(rio->lock));
74 78
75 dev_info(&rio->rio_dev->dev, "Rio opened.\n");79 dev_info(&rio->rio_dev->dev, "Rio opened.\n");
76 mutex_unlock(&rio500_mutex);80 mutex_unlock(&rio500_mutex);
@@ -84,6 +88,7 @@ static int close_rio(struct inode *inode, struct file *file) · 7 unmodified lines
84 88
85 /* against disconnect() */89 /* against disconnect() */
86 mutex_lock(&rio500_mutex);90 mutex_lock(&rio500_mutex);
91 mutex_lock(&(rio->lock));
87 92
88 rio->isopen = 0;93 rio->isopen = 0;
89 if (!rio->present) {94 if (!rio->present) {
@@ -95,6 +100,7 @@ static int close_rio(struct inode *inode, struct file *file) · 5 unmodified lines
95 } else {100 } else {
96 dev_info(&rio->rio_dev->dev, "Rio closed.\n");101 dev_info(&rio->rio_dev->dev, "Rio closed.\n");
97 }102 }
103 mutex_unlock(&(rio->lock));
98 mutex_unlock(&rio500_mutex);104 mutex_unlock(&rio500_mutex);
99 return 0;105 return 0;
100}106}
@@ -109,7 +115,7 @@ static long ioctl_rio(struct file *file, unsigned int cmd, unsigned long arg) · 8 unmodified lines
109 int retries;115 int retries;
110 int retval=0;116 int retval=0;
111 117
112 mutex_lock(&rio500_mutex);118 mutex_lock(&(rio->lock));
113 /* Sanity check to make sure rio is connected, powered, etc */119 /* Sanity check to make sure rio is connected, powered, etc */
114 if (rio->present == 0 || rio->rio_dev == NULL) {120 if (rio->present == 0 || rio->rio_dev == NULL) {
115 retval = -ENODEV;121 retval = -ENODEV;
@@ -253,7 +259,7 @@ static long ioctl_rio(struct file *file, unsigned int cmd, unsigned long arg) · 137 unmodified lines
253 259
254 260
255err_out:261err_out:
256 mutex_unlock(&rio500_mutex);262 mutex_unlock(&(rio->lock));
257 return retval;263 return retval;
258}264}
259 265
@@ -273,12 +279,12 @@ write_rio(struct file *file, const char __user *buffer, · 13 unmodified lines
273 int errn = 0;279 int errn = 0;
274 int intr;280 int intr;
275 281
276 intr = mutex_lock_interruptible(&rio500_mutex);282 intr = mutex_lock_interruptible(&(rio->lock));
277 if (intr)283 if (intr)
278 return -EINTR;284 return -EINTR;
279 /* Sanity check to make sure rio is connected, powered, etc */285 /* Sanity check to make sure rio is connected, powered, etc */
280 if (rio->present == 0 || rio->rio_dev == NULL) {286 if (rio->present == 0 || rio->rio_dev == NULL) {
281 mutex_unlock(&rio500_mutex);287 mutex_unlock(&(rio->lock));
282 return -ENODEV;288 return -ENODEV;
283 }289 }
284 290
@@ -301,7 +307,7 @@ write_rio(struct file *file, const char __user *buffer, · 16 unmodified lines
301 goto error;307 goto error;
302 }308 }
303 if (signal_pending(current)) {309 if (signal_pending(current)) {
304 mutex_unlock(&rio500_mutex);310 mutex_unlock(&(rio->lock));
305 return bytes_written ? bytes_written : -EINTR;311 return bytes_written ? bytes_written : -EINTR;
306 }312 }
307 313
@@ -339,12 +345,12 @@ write_rio(struct file *file, const char __user *buffer, · 31 unmodified lines
339 buffer += copy_size;345 buffer += copy_size;
340 } while (count > 0);346 } while (count > 0);
341 347
342 mutex_unlock(&rio500_mutex);348 mutex_unlock(&(rio->lock));
343 349
344 return bytes_written ? bytes_written : -EIO;350 return bytes_written ? bytes_written : -EIO;
345 351
346error:352error:
347 mutex_unlock(&rio500_mutex);353 mutex_unlock(&(rio->lock));
348 return errn;354 return errn;
349}355}
350 356
@@ -361,12 +367,12 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos) · 10 unmodified lines
361 char *ibuf;367 char *ibuf;
362 int intr;368 int intr;
363 369
364 intr = mutex_lock_interruptible(&rio500_mutex);370 intr = mutex_lock_interruptible(&(rio->lock));
365 if (intr)371 if (intr)
366 return -EINTR;372 return -EINTR;
367 /* Sanity check to make sure rio is connected, powered, etc */373 /* Sanity check to make sure rio is connected, powered, etc */
368 if (rio->present == 0 || rio->rio_dev == NULL) {374 if (rio->present == 0 || rio->rio_dev == NULL) {
369 mutex_unlock(&rio500_mutex);375 mutex_unlock(&(rio->lock));
370 return -ENODEV;376 return -ENODEV;
371 }377 }
372 378
@@ -377,11 +383,11 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos) · 4 unmodified lines
377 383
378 while (count > 0) {384 while (count > 0) {
379 if (signal_pending(current)) {385 if (signal_pending(current)) {
380 mutex_unlock(&rio500_mutex);386 mutex_unlock(&(rio->lock));
381 return read_count ? read_count : -EINTR;387 return read_count ? read_count : -EINTR;
382 }388 }
383 if (!rio->rio_dev) {389 if (!rio->rio_dev) {
384 mutex_unlock(&rio500_mutex);390 mutex_unlock(&(rio->lock));
385 return -ENODEV;391 return -ENODEV;
386 }392 }
387 this_read = (count >= IBUF_SIZE) ? IBUF_SIZE : count;393 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
399 count = this_read = partial;405 count = this_read = partial;
400 } else if (result == -ETIMEDOUT || result == 15) { /* FIXME: 15 ??? */406 } else if (result == -ETIMEDOUT || result == 15) { /* FIXME: 15 ??? */
401 if (!maxretry--) {407 if (!maxretry--) {
402 mutex_unlock(&rio500_mutex);408 mutex_unlock(&(rio->lock));
403 dev_err(&rio->rio_dev->dev,409 dev_err(&rio->rio_dev->dev,
404 "read_rio: maxretry timeout\n");410 "read_rio: maxretry timeout\n");
405 return -ETIME;411 return -ETIME;
@@ -409,19 +415,19 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos) · 3 unmodified lines
409 finish_wait(&rio->wait_q, &wait);415 finish_wait(&rio->wait_q, &wait);
410 continue;416 continue;
411 } else if (result != -EREMOTEIO) {417 } else if (result != -EREMOTEIO) {
412 mutex_unlock(&rio500_mutex);418 mutex_unlock(&(rio->lock));
413 dev_err(&rio->rio_dev->dev,419 dev_err(&rio->rio_dev->dev,
414 "Read Whoops - result:%d partial:%u this_read:%u\n",420 "Read Whoops - result:%d partial:%u this_read:%u\n",
415 result, partial, this_read);421 result, partial, this_read);
416 return -EIO;422 return -EIO;
417 } else {423 } else {
418 mutex_unlock(&rio500_mutex);424 mutex_unlock(&(rio->lock));
419 return (0);425 return (0);
420 }426 }
421 427
422 if (this_read) {428 if (this_read) {
423 if (copy_to_user(buffer, ibuf, this_read)) {429 if (copy_to_user(buffer, ibuf, this_read)) {
424 mutex_unlock(&rio500_mutex);430 mutex_unlock(&(rio->lock));
425 return -EFAULT;431 return -EFAULT;
426 }432 }
427 count -= this_read;433 count -= this_read;
@@ -429,7 +435,7 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos) · 1 unmodified line
429 buffer += this_read;435 buffer += this_read;
430 }436 }
431 }437 }
432 mutex_unlock(&rio500_mutex);438 mutex_unlock(&(rio->lock));
433 return read_count;439 return read_count;
434}440}
435 441
@@ -494,6 +500,8 @@ static int probe_rio(struct usb_interface *intf, · 58 unmodified lines
494 }500 }
495 dev_dbg(&intf->dev, "ibuf address:%p\n", rio->ibuf);501 dev_dbg(&intf->dev, "ibuf address:%p\n", rio->ibuf);
496 502
503 mutex_init(&(rio->lock));
504
497 usb_set_intfdata (intf, rio);505 usb_set_intfdata (intf, rio);
498 rio->present = 1;506 rio->present = 1;
499bail_out:507bail_out:
@@ -511,10 +519,12 @@ static void disconnect_rio(struct usb_interface *intf) · 11 unmodified lines
511 if (rio) {519 if (rio) {
512 usb_deregister_dev(intf, &usb_rio_class);520 usb_deregister_dev(intf, &usb_rio_class);
513 521
522 mutex_lock(&(rio->lock));
514 if (rio->isopen) {523 if (rio->isopen) {
515 rio->isopen = 0;524 rio->isopen = 0;
516 /* better let it finish - the release will do whats needed */525 /* better let it finish - the release will do whats needed */
517 rio->rio_dev = NULL;526 rio->rio_dev = NULL;
527 mutex_unlock(&(rio->lock));
518 mutex_unlock(&rio500_mutex);528 mutex_unlock(&rio500_mutex);
519 return;529 return;
520 }530 }
@@ -524,6 +534,7 @@ static void disconnect_rio(struct usb_interface *intf) · 3 unmodified lines
524 dev_info(&intf->dev, "USB Rio disconnected.\n");534 dev_info(&intf->dev, "USB Rio disconnected.\n");
525 535
526 rio->present = 0;536 rio->present = 0;
537 mutex_unlock(&(rio->lock));
527 }538 }
528 mutex_unlock(&rio500_mutex);539 mutex_unlock(&rio500_mutex);
529}540}
drivers/usb/misc/yurex.c+1−1
@@ -92,7 +92,6 @@ static void yurex_delete(struct kref *kref) · 91 unmodified lines
92 92
93 dev_dbg(&dev->interface->dev, "%s\n", __func__);93 dev_dbg(&dev->interface->dev, "%s\n", __func__);
94 94
95 usb_put_dev(dev->udev);
96 if (dev->cntl_urb) {95 if (dev->cntl_urb) {
97 usb_kill_urb(dev->cntl_urb);96 usb_kill_urb(dev->cntl_urb);
98 kfree(dev->cntl_req);97 kfree(dev->cntl_req);
@@ -108,6 +107,7 @@ static void yurex_delete(struct kref *kref) · 9 unmodified lines
108 dev->int_buffer, dev->urb->transfer_dma);107 dev->int_buffer, dev->urb->transfer_dma);
109 usb_free_urb(dev->urb);108 usb_free_urb(dev->urb);
110 }109 }
110 usb_put_dev(dev->udev);
111 kfree(dev);111 kfree(dev);
112}112}
113 113
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
379 return SNK_UNATTACHED;379 return SNK_UNATTACHED;
380 else if (port->try_role == TYPEC_SOURCE)380 else if (port->try_role == TYPEC_SOURCE)
381 return SRC_UNATTACHED;381 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)
383 return SNK_UNATTACHED;384 return SNK_UNATTACHED;
384 /* Fall through to return SRC_UNATTACHED */385 /* Fall through to return SRC_UNATTACHED */
385 } else if (port->port_type == TYPEC_PORT_SNK) {386 } else if (port->port_type == TYPEC_PORT_SNK) {
@@ -586,7 +587,20 @@ static void tcpm_debugfs_init(struct tcpm_port *port) · 200 unmodified lines
586 587
587static void tcpm_debugfs_exit(struct tcpm_port *port)588static void tcpm_debugfs_exit(struct tcpm_port *port)
588{589{
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
589 debugfs_remove(port->dentry);599 debugfs_remove(port->dentry);
600 if (list_empty(&rootdir->d_subdirs)) {
601 debugfs_remove(rootdir);
602 rootdir = NULL;
603 }
590}604}
591 605
592#else606#else
@@ -1095,7 +1109,8 @@ static int tcpm_pd_svdm(struct tcpm_port *port, const __le32 *payload, int cnt, · 502 unmodified lines
1095 break;1109 break;
1096 case CMD_ATTENTION:1110 case CMD_ATTENTION:
1097 /* Attention command does not have response */1111 /* Attention command does not have response */
1098 typec_altmode_attention(adev, p[1]);1112 if (adev)
1113 typec_altmode_attention(adev, p[1]);
1099 return 0;1114 return 0;
1100 default:1115 default:
1101 break;1116 break;
@@ -1147,20 +1162,26 @@ static int tcpm_pd_svdm(struct tcpm_port *port, const __le32 *payload, int cnt, · 45 unmodified lines
1147 }1162 }
1148 break;1163 break;
1149 case CMD_ENTER_MODE:1164 case CMD_ENTER_MODE:
1150 typec_altmode_update_active(pdev, true);1165 if (adev && pdev) {
1151 1166 typec_altmode_update_active(pdev, true);
1152 if (typec_altmode_vdm(adev, p[0], &p[1], cnt)) {1167
1153 response[0] = VDO(adev->svid, 1, CMD_EXIT_MODE);1168 if (typec_altmode_vdm(adev, p[0], &p[1], cnt)) {
1154 response[0] |= VDO_OPOS(adev->mode);1169 response[0] = VDO(adev->svid, 1,
1155 return 1;1170 CMD_EXIT_MODE);
1171 response[0] |= VDO_OPOS(adev->mode);
1172 return 1;
1173 }
1156 }1174 }
1157 return 0;1175 return 0;
1158 case CMD_EXIT_MODE:1176 case CMD_EXIT_MODE:
1159 typec_altmode_update_active(pdev, false);1177 if (adev && pdev) {
1178 typec_altmode_update_active(pdev, false);
1160 1179
1161 /* Back to USB Operation */1180 /* Back to USB Operation */
1162 WARN_ON(typec_altmode_notify(adev, TYPEC_STATE_USB,1181 WARN_ON(typec_altmode_notify(adev,
1163 NULL));1182 TYPEC_STATE_USB,
1183 NULL));
1184 }
1164 break;1185 break;
1165 default:1186 default:
1166 break;1187 break;
@@ -1170,8 +1191,10 @@ static int tcpm_pd_svdm(struct tcpm_port *port, const __le32 *payload, int cnt, · 3 unmodified lines
1170 switch (cmd) {1191 switch (cmd) {
1171 case CMD_ENTER_MODE:1192 case CMD_ENTER_MODE:
1172 /* Back to USB Operation */1193 /* Back to USB Operation */
1173 WARN_ON(typec_altmode_notify(adev, TYPEC_STATE_USB,1194 if (adev)
1174 NULL));1195 WARN_ON(typec_altmode_notify(adev,
1196 TYPEC_STATE_USB,
1197 NULL));
1175 break;1198 break;
1176 default:1199 default:
1177 break;1200 break;
@@ -1182,7 +1205,8 @@ static int tcpm_pd_svdm(struct tcpm_port *port, const __le32 *payload, int cnt, · 4 unmodified lines
1182 }1205 }
1183 1206
1184 /* Informing the alternate mode drivers about everything */1207 /* 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);
1186 1210
1187 return rlen;1211 return rlen;
1188}1212}
@@ -4114,7 +4138,7 @@ static int tcpm_try_role(const struct typec_capability *cap, int role) · 2925 unmodified lines
4114 mutex_lock(&port->lock);4138 mutex_lock(&port->lock);
4115 if (tcpc->try_role)4139 if (tcpc->try_role)
4116 ret = tcpc->try_role(tcpc, role);4140 ret = tcpc->try_role(tcpc, role);
4117 if (!ret && !tcpc->config->try_role_hw)4141 if (!ret && (!tcpc->config || !tcpc->config->try_role_hw))
4118 port->try_role = role;4142 port->try_role = role;
4119 port->try_src_count = 0;4143 port->try_src_count = 0;
4120 port->try_snk_count = 0;4144 port->try_snk_count = 0;
@@ -4701,7 +4725,7 @@ static int tcpm_copy_caps(struct tcpm_port *port, · 580 unmodified lines
4701 port->typec_caps.prefer_role = tcfg->default_role;4725 port->typec_caps.prefer_role = tcfg->default_role;
4702 port->typec_caps.type = tcfg->type;4726 port->typec_caps.type = tcfg->type;
4703 port->typec_caps.data = tcfg->data;4727 port->typec_caps.data = tcfg->data;
4704 port->self_powered = port->tcpc->config->self_powered;4728 port->self_powered = tcfg->self_powered;
4705 4729
4706 return 0;4730 return 0;
4707}4731}
drivers/usb/typec/ucsi/ucsi_ccg.c+1−1
@@ -1018,7 +1018,7 @@ release_fw: · 1017 unmodified lines
1018 ******************************************************************************/1018 ******************************************************************************/
1019static int ccg_fw_update(struct ucsi_ccg *uc, enum enum_flash_mode flash_mode)1019static int ccg_fw_update(struct ucsi_ccg *uc, enum enum_flash_mode flash_mode)
1020{1020{
1021 int err;1021 int err = 0;
1022 1022
1023 while (flash_mode != FLASH_NOT_NEEDED) {1023 while (flash_mode != FLASH_NOT_NEEDED) {
1024 err = do_flash(uc, flash_mode);1024 err = do_flash(uc, flash_mode);
drivers/vhost/vhost.h+1−1
@@ -96,7 +96,7 @@ struct vhost_uaddr { · 95 unmodified lines
96};96};
97 97
98#if defined(CONFIG_MMU_NOTIFIER) && ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE == 098#if defined(CONFIG_MMU_NOTIFIER) && ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE == 0
99#define VHOST_ARCH_CAN_ACCEL_UACCESS 199#define VHOST_ARCH_CAN_ACCEL_UACCESS 0
100#else100#else
101#define VHOST_ARCH_CAN_ACCEL_UACCESS 0101#define VHOST_ARCH_CAN_ACCEL_UACCESS 0
102#endif102#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
447 return 0;447 return 0;
448 case 12:448 case 12:
449 var->bits_per_pixel = 16;449 var->bits_per_pixel = 16;
450 /* fall through */
450 case 16:451 case 16:
451 if (plane->fbdev->panel->bpp == 12)452 if (plane->fbdev->panel->bpp == 12)
452 plane->color_mode = OMAPFB_COLOR_RGB444;453 plane->color_mode = OMAPFB_COLOR_RGB444;
@@ -1534,20 +1535,27 @@ static void omapfb_free_resources(struct omapfb_device *fbdev, int state) · 1081 unmodified lines
1534 case OMAPFB_ACTIVE:1535 case OMAPFB_ACTIVE:
1535 for (i = 0; i < fbdev->mem_desc.region_cnt; i++)1536 for (i = 0; i < fbdev->mem_desc.region_cnt; i++)
1536 unregister_framebuffer(fbdev->fb_info[i]);1537 unregister_framebuffer(fbdev->fb_info[i]);
1538 /* fall through */
1537 case 7:1539 case 7:
1538 omapfb_unregister_sysfs(fbdev);1540 omapfb_unregister_sysfs(fbdev);
1541 /* fall through */
1539 case 6:1542 case 6:
1540 if (fbdev->panel->disable)1543 if (fbdev->panel->disable)
1541 fbdev->panel->disable(fbdev->panel);1544 fbdev->panel->disable(fbdev->panel);
1545 /* fall through */
1542 case 5:1546 case 5:
1543 omapfb_set_update_mode(fbdev, OMAPFB_UPDATE_DISABLED);1547 omapfb_set_update_mode(fbdev, OMAPFB_UPDATE_DISABLED);
1548 /* fall through */
1544 case 4:1549 case 4:
1545 planes_cleanup(fbdev);1550 planes_cleanup(fbdev);
1551 /* fall through */
1546 case 3:1552 case 3:
1547 ctrl_cleanup(fbdev);1553 ctrl_cleanup(fbdev);
1554 /* fall through */
1548 case 2:1555 case 2:
1549 if (fbdev->panel->cleanup)1556 if (fbdev->panel->cleanup)
1550 fbdev->panel->cleanup(fbdev->panel);1557 fbdev->panel->cleanup(fbdev->panel);
1558 /* fall through */
1551 case 1:1559 case 1:
1552 dev_set_drvdata(fbdev->dev, NULL);1560 dev_set_drvdata(fbdev->dev, NULL);
1553 kfree(fbdev);1561 kfree(fbdev);
drivers/watchdog/ar7_wdt.c+1−0
@@ -235,6 +235,7 @@ static long ar7_wdt_ioctl(struct file *file, · 234 unmodified lines
235 ar7_wdt_update_margin(new_margin);235 ar7_wdt_update_margin(new_margin);
236 ar7_wdt_kick(1);236 ar7_wdt_kick(1);
237 spin_unlock(&wdt_lock);237 spin_unlock(&wdt_lock);
238 /* Fall through */
238 239
239 case WDIOC_GETTIMEOUT:240 case WDIOC_GETTIMEOUT:
240 if (put_user(margin, (int *)arg))241 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
651 return -EINVAL;651 return -EINVAL;
652 652
653 pcwd_keepalive();653 pcwd_keepalive();
654 /* Fall */654 /* Fall through */
655 655
656 case WDIOC_GETTIMEOUT:656 case WDIOC_GETTIMEOUT:
657 return put_user(heartbeat, argp);657 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
134 return -EINVAL;134 return -EINVAL;
135 riowd_timeout = (new_margin + 59) / 60;135 riowd_timeout = (new_margin + 59) / 60;
136 riowd_writereg(p, riowd_timeout, WDTO_INDEX);136 riowd_writereg(p, riowd_timeout, WDTO_INDEX);
137 /* Fall */137 /* Fall through */
138 138
139 case WDIOC_GETTIMEOUT:139 case WDIOC_GETTIMEOUT:
140 return put_user(riowd_timeout * 60, (int __user *)argp);140 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
202 timeout = time;202 timeout = time;
203 sbwdog_set(user_dog, timeout);203 sbwdog_set(user_dog, timeout);
204 sbwdog_pet(user_dog);204 sbwdog_pet(user_dog);
205 /* Fall through */
205 206
206 case WDIOC_GETTIMEOUT:207 case WDIOC_GETTIMEOUT:
207 /*208 /*
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
186 margin = new_margin;186 margin = new_margin;
187 scx200_wdt_update_margin();187 scx200_wdt_update_margin();
188 scx200_wdt_ping();188 scx200_wdt_ping();
189 /* Fall through */
189 case WDIOC_GETTIMEOUT:190 case WDIOC_GETTIMEOUT:
190 if (put_user(margin, p))191 if (put_user(margin, p))
191 return -EFAULT;192 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
389 if (wdt_set_heartbeat(new_heartbeat))389 if (wdt_set_heartbeat(new_heartbeat))
390 return -EINVAL;390 return -EINVAL;
391 wdt_ping();391 wdt_ping();
392 /* Fall */392 /* Fall through */
393 case WDIOC_GETTIMEOUT:393 case WDIOC_GETTIMEOUT:
394 return put_user(heartbeat, p);394 return put_user(heartbeat, p);
395 default:395 default:
drivers/watchdog/wdt977.c+1−1
@@ -398,7 +398,7 @@ static long wdt977_ioctl(struct file *file, unsigned int cmd, · 397 unmodified lines
398 return -EINVAL;398 return -EINVAL;
399 399
400 wdt977_keepalive();400 wdt977_keepalive();
401 /* Fall */401 /* Fall through */
402 402
403 case WDIOC_GETTIMEOUT:403 case WDIOC_GETTIMEOUT:
404 return put_user(timeout, uarg.i);404 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
1143 goto out_put_map;1143 goto out_put_map;
1144 1144
1145 if (!use_ptemod) {1145 if (!use_ptemod) {
1146 err = vm_map_pages(vma, map->pages, map->count);1146 err = vm_map_pages_zero(vma, map->pages, map->count);
1147 if (err)1147 if (err)
1148 goto out_put_map;1148 goto out_put_map;
1149 } else {1149 } 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
724 return 0;724 return 0;
725}725}
726 726
727struct remap_pfn {
728 struct mm_struct *mm;
729 struct page **pages;
730 pgprot_t prot;
731 unsigned long i;
732};
733
734static 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
746static long privcmd_ioctl_mmap_resource(struct file *file, void __user *udata)727static long privcmd_ioctl_mmap_resource(struct file *file, void __user *udata)
747{728{
748 struct privcmd_data *data = file->private_data;729 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
774 goto out;755 goto out;
775 }756 }
776 757
777 if (xen_feature(XENFEAT_auto_translated_physmap)) {758 if (IS_ENABLED(CONFIG_XEN_AUTO_XLATE) &&
759 xen_feature(XENFEAT_auto_translated_physmap)) {
778 unsigned int nr = DIV_ROUND_UP(kdata.num, XEN_PFN_PER_PAGE);760 unsigned int nr = DIV_ROUND_UP(kdata.num, XEN_PFN_PER_PAGE);
779 struct page **pages;761 struct page **pages;
780 unsigned int i;762 unsigned int i;
@@ -808,16 +790,9 @@ static long privcmd_ioctl_mmap_resource(struct file *file, void __user *udata) · 27 unmodified lines
808 if (rc)790 if (rc)
809 goto out;791 goto out;
810 792
811 if (xen_feature(XENFEAT_auto_translated_physmap)) {793 if (IS_ENABLED(CONFIG_XEN_AUTO_XLATE) &&
812 struct remap_pfn r = {794 xen_feature(XENFEAT_auto_translated_physmap)) {
813 .mm = vma->vm_mm,795 rc = xen_remap_vma_range(vma, kdata.addr, kdata.num << PAGE_SHIFT);
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);
821 } else {796 } else {
822 unsigned int domid =797 unsigned int domid =
823 (xdata.flags & XENMEM_rsrc_acq_caller_owned) ?798 (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
83 return xen_phys_to_bus(virt_to_phys(address));83 return xen_phys_to_bus(virt_to_phys(address));
84}84}
85 85
86static int check_pages_physically_contiguous(unsigned long xen_pfn,86static inline int range_straddles_page_boundary(phys_addr_t p, size_t size)
87 unsigned int offset,
88 size_t length)
89{87{
90 unsigned long next_bfn;88 unsigned long next_bfn, xen_pfn = XEN_PFN_DOWN(p);
91 int i;89 unsigned int i, nr_pages = XEN_PFN_UP(xen_offset_in_page(p) + size);
92 int nr_pages;
93 90
94 next_bfn = pfn_to_bfn(xen_pfn);91 next_bfn = pfn_to_bfn(xen_pfn);
95 nr_pages = (offset + length + XEN_PAGE_SIZE-1) >> XEN_PAGE_SHIFT;
96 92
97 for (i = 1; i < nr_pages; i++) {93 for (i = 1; i < nr_pages; i++)
98 if (pfn_to_bfn(++xen_pfn) != ++next_bfn)94 if (pfn_to_bfn(++xen_pfn) != ++next_bfn)
99 return 0;95 return 1;
100 }
101 return 1;
102}
103 96
104static inline int range_straddles_page_boundary(phys_addr_t p, size_t size)97 return 0;
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;
114}98}
115 99
116static int is_xen_swiotlb_buffer(dma_addr_t dma_addr)100static 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
338 xen_free_coherent_pages(hwdev, size, ret, (dma_addr_t)phys, attrs);322 xen_free_coherent_pages(hwdev, size, ret, (dma_addr_t)phys, attrs);
339 return NULL;323 return NULL;
340 }324 }
325 SetPageXenRemapped(virt_to_page(ret));
341 }326 }
342 memset(ret, 0, size);327 memset(ret, 0, size);
343 return ret;328 return ret;
@@ -361,8 +346,9 @@ xen_swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr, · 17 unmodified lines
361 /* Convert the size to actually allocated. */346 /* Convert the size to actually allocated. */
362 size = 1UL << (order + XEN_PAGE_SHIFT);347 size = 1UL << (order + XEN_PAGE_SHIFT);
363 348
364 if (((dev_addr + size - 1 <= dma_mask)) ||349 if (!WARN_ON((dev_addr + size - 1 > dma_mask) ||
365 range_straddles_page_boundary(phys, size))350 range_straddles_page_boundary(phys, size)) &&
351 TestClearPageXenRemapped(virt_to_page(vaddr)))
366 xen_destroy_contiguous_region(phys, order);352 xen_destroy_contiguous_region(phys, order);
367 353
368 xen_free_coherent_pages(hwdev, size, vaddr, (dma_addr_t)phys, attrs);354 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
116{116{
117 int err;117 int err;
118 u16 old_value;118 u16 old_value;
119 pci_power_t new_state, old_state;119 pci_power_t new_state;
120 120
121 err = pci_read_config_word(dev, offset, &old_value);121 err = pci_read_config_word(dev, offset, &old_value);
122 if (err)122 if (err)
123 goto out;123 goto out;
124 124
125 old_state = (pci_power_t)(old_value & PCI_PM_CTRL_STATE_MASK);
126 new_state = (pci_power_t)(new_value & PCI_PM_CTRL_STATE_MASK);125 new_state = (pci_power_t)(new_value & PCI_PM_CTRL_STATE_MASK);
127 126
128 new_value &= PM_OK_BITS;127 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
262 return 0;262 return 0;
263}263}
264EXPORT_SYMBOL_GPL(xen_xlate_map_ballooned_pages);264EXPORT_SYMBOL_GPL(xen_xlate_map_ballooned_pages);
265
266struct remap_pfn {
267 struct mm_struct *mm;
268 struct page **pages;
269 pgprot_t prot;
270 unsigned long i;
271};
272
273static 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 */
286int 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}
296EXPORT_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
349 loff_t pos = iocb->ki_pos;349 loff_t pos = iocb->ki_pos;
350 blk_qc_t qc = BLK_QC_T_NONE;350 blk_qc_t qc = BLK_QC_T_NONE;
351 gfp_t gfp;351 gfp_t gfp;
352 ssize_t ret;352 int ret;
353 353
354 if ((pos | iov_iter_alignment(iter)) &354 if ((pos | iov_iter_alignment(iter)) &
355 (bdev_logical_block_size(bdev) - 1))355 (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
386 386
387 ret = 0;387 ret = 0;
388 for (;;) {388 for (;;) {
389 int err;
390
391 bio_set_dev(bio, bdev);389 bio_set_dev(bio, bdev);
392 bio->bi_iter.bi_sector = pos >> 9;390 bio->bi_iter.bi_sector = pos >> 9;
393 bio->bi_write_hint = iocb->ki_hint;391 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
395 bio->bi_end_io = blkdev_bio_end_io;393 bio->bi_end_io = blkdev_bio_end_io;
396 bio->bi_ioprio = iocb->ki_ioprio;394 bio->bi_ioprio = iocb->ki_ioprio;
397 395
398 err = bio_iov_iter_get_pages(bio, iter);396 ret = bio_iov_iter_get_pages(bio, iter);
399 if (unlikely(err)) {397 if (unlikely(ret)) {
400 if (!ret)
401 ret = err;
402 bio->bi_status = BLK_STS_IOERR;398 bio->bi_status = BLK_STS_IOERR;
403 bio_endio(bio);399 bio_endio(bio);
404 break;400 break;
@@ -421,7 +417,6 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) · 16 unmodified lines
421 if (nowait)417 if (nowait)
422 bio->bi_opf |= (REQ_NOWAIT | REQ_NOWAIT_INLINE);418 bio->bi_opf |= (REQ_NOWAIT | REQ_NOWAIT_INLINE);
423 419
424 dio->size += bio->bi_iter.bi_size;
425 pos += bio->bi_iter.bi_size;420 pos += bio->bi_iter.bi_size;
426 421
427 nr_pages = iov_iter_npages(iter, BIO_MAX_PAGES);422 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
433 polled = true;428 polled = true;
434 }429 }
435 430
431 dio->size += bio->bi_iter.bi_size;
436 qc = submit_bio(bio);432 qc = submit_bio(bio);
437 if (qc == BLK_QC_T_EAGAIN) {433 if (qc == BLK_QC_T_EAGAIN) {
438 if (!ret)434 dio->size -= bio->bi_iter.bi_size;
439 ret = -EAGAIN;435 ret = -EAGAIN;
440 goto error;436 goto error;
441 }437 }
442 438
@@ -459,18 +455,17 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) · 16 unmodified lines
459 atomic_inc(&dio->ref);455 atomic_inc(&dio->ref);
460 }456 }
461 457
458 dio->size += bio->bi_iter.bi_size;
462 qc = submit_bio(bio);459 qc = submit_bio(bio);
463 if (qc == BLK_QC_T_EAGAIN) {460 if (qc == BLK_QC_T_EAGAIN) {
464 if (!ret)461 dio->size -= bio->bi_iter.bi_size;
465 ret = -EAGAIN;462 ret = -EAGAIN;
466 goto error;463 goto error;
467 }464 }
468 ret += bio->bi_iter.bi_size;
469 465
470 bio = bio_alloc(gfp, nr_pages);466 bio = bio_alloc(gfp, nr_pages);
471 if (!bio) {467 if (!bio) {
472 if (!ret)468 ret = -EAGAIN;
473 ret = -EAGAIN;
474 goto error;469 goto error;
475 }470 }
476 }471 }
@@ -495,6 +490,8 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) · 18 unmodified lines
495out:490out:
496 if (!ret)491 if (!ret)
497 ret = blk_status_to_errno(dio->bio.bi_status);492 ret = blk_status_to_errno(dio->bio.bi_status);
493 if (likely(!ret))
494 ret = dio->size;
498 495
499 bio_put(&dio->bio);496 bio_put(&dio->bio);
500 return ret;497 return ret;
@@ -1181,8 +1178,7 @@ static struct gendisk *bdev_get_gendisk(struct block_device *bdev, int *partno) · 680 unmodified lines
1181 * Pointer to the block device containing @bdev on success, ERR_PTR()1178 * Pointer to the block device containing @bdev on success, ERR_PTR()
1182 * value on failure.1179 * value on failure.
1183 */1180 */
1184static struct block_device *bd_start_claiming(struct block_device *bdev,1181struct block_device *bd_start_claiming(struct block_device *bdev, void *holder)
1185 void *holder)
1186{1182{
1187 struct gendisk *disk;1183 struct gendisk *disk;
1188 struct block_device *whole;1184 struct block_device *whole;
@@ -1229,6 +1225,62 @@ static struct block_device *bd_start_claiming(struct block_device *bdev, · 40 unmodified lines
1229 return ERR_PTR(err);1225 return ERR_PTR(err);
1230 }1226 }
1231}1227}
1228EXPORT_SYMBOL(bd_start_claiming);
1229
1230static 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 */
1248void 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}
1264EXPORT_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 */
1276void 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}
1283EXPORT_SYMBOL(bd_abort_claiming);
1232 1284
1233#ifdef CONFIG_SYSFS1285#ifdef CONFIG_SYSFS
1234struct bd_holder_disk {1286struct bd_holder_disk {
@@ -1698,29 +1750,10 @@ int blkdev_get(struct block_device *bdev, fmode_t mode, void *holder) · 463 unmodified lines
1698 1750
1699 /* finish claiming */1751 /* finish claiming */
1700 mutex_lock(&bdev->bd_mutex);1752 mutex_lock(&bdev->bd_mutex);
1701 spin_lock(&bdev_lock);1753 if (!res)
1702 1754 bd_finish_claiming(bdev, whole, holder);
1703 if (!res) {1755 else
1704 BUG_ON(!bd_may_claim(bdev, whole, holder));1756 bd_abort_claiming(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
1724 /*1757 /*
1725 * Block event polling for write claims if requested. Any1758 * Block event polling for write claims if requested. Any
1726 * write holder makes the write_holder state stick until1759 * 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
1483 ulist_init(roots);1483 ulist_init(roots);
1484 ulist_init(tmp);1484 ulist_init(tmp);
1485 1485
1486 trans = btrfs_attach_transaction(root);1486 trans = btrfs_join_transaction_nostart(root);
1487 if (IS_ERR(trans)) {1487 if (IS_ERR(trans)) {
1488 if (PTR_ERR(trans) != -ENOENT && PTR_ERR(trans) != -EROFS) {1488 if (PTR_ERR(trans) != -ENOENT && PTR_ERR(trans) != -EROFS) {
1489 ret = PTR_ERR(trans);1489 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
6322{6322{
6323 int ret = 0;6323 int ret = 0;
6324 6324
6325 if (sctx->cur_ino != sctx->cmp_key->objectid) {6325 /*
6326 6326 * We have found an extent item that changed without the inode item
6327 if (result == BTRFS_COMPARE_TREE_CHANGED) {6327 * having changed. This can happen either after relocation (where the
6328 struct extent_buffer *leaf_l;6328 * disk_bytenr of an extent item is replaced at
6329 struct extent_buffer *leaf_r;6329 * relocation.c:replace_file_extents()) or after deduplication into a
6330 struct btrfs_file_extent_item *ei_l;6330 * file in both the parent and send snapshots (where an extent item can
6331 struct btrfs_file_extent_item *ei_r;6331 * get modified or replaced with a new one). Note that deduplication
6332 6332 * updates the inode item, but it only changes the iversion (sequence
6333 leaf_l = sctx->left_path->nodes[0];6333 * field in the inode item) of the inode, so if a file is deduplicated
6334 leaf_r = sctx->right_path->nodes[0];6334 * the same amount of times in both the parent and send snapshots, its
6335 ei_l = btrfs_item_ptr(leaf_l,6335 * iversion becames the same in both snapshots, whence the inode item is
6336 sctx->left_path->slots[0],6336 * the same on both snapshots.
6337 struct btrfs_file_extent_item);6337 */
6338 ei_r = btrfs_item_ptr(leaf_r,6338 if (sctx->cur_ino != sctx->cmp_key->objectid)
6339 sctx->right_path->slots[0],6339 return 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 }
6387 6340
6388 if (!sctx->cur_inode_new_gen && !sctx->cur_inode_deleted) {6341 if (!sctx->cur_inode_new_gen && !sctx->cur_inode_deleted) {
6389 if (result != BTRFS_COMPARE_TREE_DELETED)6342 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
28 [TRANS_STATE_COMMIT_START] = (__TRANS_START | __TRANS_ATTACH),28 [TRANS_STATE_COMMIT_START] = (__TRANS_START | __TRANS_ATTACH),
29 [TRANS_STATE_COMMIT_DOING] = (__TRANS_START |29 [TRANS_STATE_COMMIT_DOING] = (__TRANS_START |
30 __TRANS_ATTACH |30 __TRANS_ATTACH |
31 __TRANS_JOIN),31 __TRANS_JOIN |
32 __TRANS_JOIN_NOSTART),
32 [TRANS_STATE_UNBLOCKED] = (__TRANS_START |33 [TRANS_STATE_UNBLOCKED] = (__TRANS_START |
33 __TRANS_ATTACH |34 __TRANS_ATTACH |
34 __TRANS_JOIN |35 __TRANS_JOIN |
35 __TRANS_JOIN_NOLOCK),36 __TRANS_JOIN_NOLOCK |
37 __TRANS_JOIN_NOSTART),
36 [TRANS_STATE_COMPLETED] = (__TRANS_START |38 [TRANS_STATE_COMPLETED] = (__TRANS_START |
37 __TRANS_ATTACH |39 __TRANS_ATTACH |
38 __TRANS_JOIN |40 __TRANS_JOIN |
39 __TRANS_JOIN_NOLOCK),41 __TRANS_JOIN_NOLOCK |
42 __TRANS_JOIN_NOSTART),
40};43};
41 44
42void btrfs_put_transaction(struct btrfs_transaction *transaction)45void btrfs_put_transaction(struct btrfs_transaction *transaction)
@@ -543,7 +546,8 @@ again: · 500 unmodified lines
543 ret = join_transaction(fs_info, type);546 ret = join_transaction(fs_info, type);
544 if (ret == -EBUSY) {547 if (ret == -EBUSY) {
545 wait_current_trans(fs_info);548 wait_current_trans(fs_info);
546 if (unlikely(type == TRANS_ATTACH))549 if (unlikely(type == TRANS_ATTACH ||
550 type == TRANS_JOIN_NOSTART))
547 ret = -ENOENT;551 ret = -ENOENT;
548 }552 }
549 } while (ret == -EBUSY);553 } while (ret == -EBUSY);
@@ -659,6 +663,16 @@ struct btrfs_trans_handle *btrfs_join_transaction_nolock(struct btrfs_root *root · 109 unmodified lines
659 BTRFS_RESERVE_NO_FLUSH, true);663 BTRFS_RESERVE_NO_FLUSH, true);
660}664}
661 665
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 */
670struct 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
662/*676/*
663 * btrfs_attach_transaction() - catch the running transaction677 * btrfs_attach_transaction() - catch the running transaction
664 *678 *
@@ -2037,6 +2051,16 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans) · 1372 unmodified lines
2037 }2051 }
2038 } else {2052 } else {
2039 spin_unlock(&fs_info->trans_lock);2053 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 }
2040 }2064 }
2041 2065
2042 extwriter_counter_dec(cur_trans, trans->type);2066 extwriter_counter_dec(cur_trans, trans->type);
fs/btrfs/transaction.h+3−0
@@ -94,11 +94,13 @@ struct btrfs_transaction { · 93 unmodified lines
94#define __TRANS_JOIN (1U << 11)94#define __TRANS_JOIN (1U << 11)
95#define __TRANS_JOIN_NOLOCK (1U << 12)95#define __TRANS_JOIN_NOLOCK (1U << 12)
96#define __TRANS_DUMMY (1U << 13)96#define __TRANS_DUMMY (1U << 13)
97#define __TRANS_JOIN_NOSTART (1U << 14)
97 98
98#define TRANS_START (__TRANS_START | __TRANS_FREEZABLE)99#define TRANS_START (__TRANS_START | __TRANS_FREEZABLE)
99#define TRANS_ATTACH (__TRANS_ATTACH)100#define TRANS_ATTACH (__TRANS_ATTACH)
100#define TRANS_JOIN (__TRANS_JOIN | __TRANS_FREEZABLE)101#define TRANS_JOIN (__TRANS_JOIN | __TRANS_FREEZABLE)
101#define TRANS_JOIN_NOLOCK (__TRANS_JOIN_NOLOCK)102#define TRANS_JOIN_NOLOCK (__TRANS_JOIN_NOLOCK)
103#define TRANS_JOIN_NOSTART (__TRANS_JOIN_NOSTART)
102 104
103#define TRANS_EXTWRITERS (__TRANS_START | __TRANS_ATTACH)105#define TRANS_EXTWRITERS (__TRANS_START | __TRANS_ATTACH)
104 106
@@ -183,6 +185,7 @@ struct btrfs_trans_handle *btrfs_start_transaction_fallback_global_rsv( · 78 unmodified lines
183 int min_factor);185 int min_factor);
184struct btrfs_trans_handle *btrfs_join_transaction(struct btrfs_root *root);186struct btrfs_trans_handle *btrfs_join_transaction(struct btrfs_root *root);
185struct btrfs_trans_handle *btrfs_join_transaction_nolock(struct btrfs_root *root);187struct btrfs_trans_handle *btrfs_join_transaction_nolock(struct btrfs_root *root);
188struct btrfs_trans_handle *btrfs_join_transaction_nostart(struct btrfs_root *root);
186struct btrfs_trans_handle *btrfs_attach_transaction(struct btrfs_root *root);189struct btrfs_trans_handle *btrfs_attach_transaction(struct btrfs_root *root);
187struct btrfs_trans_handle *btrfs_attach_transaction_barrier(190struct btrfs_trans_handle *btrfs_attach_transaction_barrier(
188 struct btrfs_root *root);191 struct btrfs_root *root);
fs/cifs/connect.c+1−0
@@ -1113,6 +1113,7 @@ cifs_demultiplex_thread(void *p) · 1112 unmodified lines
1113 mempool_resize(cifs_req_poolp, length + cifs_min_rcv);1113 mempool_resize(cifs_req_poolp, length + cifs_min_rcv);
1114 1114
1115 set_freezable();1115 set_freezable();
1116 allow_signal(SIGKILL);
1116 while (server->tcpStatus != CifsExiting) {1117 while (server->tcpStatus != CifsExiting) {
1117 if (try_to_freeze())1118 if (try_to_freeze())
1118 continue;1119 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
3489static inline void smb2_sg_set_buf(struct scatterlist *sg, const void *buf,3489static inline void smb2_sg_set_buf(struct scatterlist *sg, const void *buf,
3490 unsigned int buflen)3490 unsigned int buflen)
3491{3491{
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));
3493}3501}
3494 3502
3495/* Assumes the first rqst has a transform header as the first iov.3503/* 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
4070{4078{
4071 int ret, length;4079 int ret, length;
4072 char *buf = server->smallbuf;4080 char *buf = server->smallbuf;
4073 char *tmpbuf;
4074 struct smb2_sync_hdr *shdr;4081 struct smb2_sync_hdr *shdr;
4075 unsigned int pdu_length = server->pdu_size;4082 unsigned int pdu_length = server->pdu_size;
4076 unsigned int buf_size;4083 unsigned int buf_size;
@@ -4100,18 +4107,15 @@ receive_encrypted_standard(struct TCP_Server_Info *server, · 23 unmodified lines
4100 return length;4107 return length;
4101 4108
4102 next_is_large = server->large_buf;4109 next_is_large = server->large_buf;
4103 one_more:4110one_more:
4104 shdr = (struct smb2_sync_hdr *)buf;4111 shdr = (struct smb2_sync_hdr *)buf;
4105 if (shdr->NextCommand) {4112 if (shdr->NextCommand) {
4106 if (next_is_large) {4113 if (next_is_large)
4107 tmpbuf = server->bigbuf;
4108 next_buffer = (char *)cifs_buf_get();4114 next_buffer = (char *)cifs_buf_get();
4109 } else {4115 else
4110 tmpbuf = server->smallbuf;
4111 next_buffer = (char *)cifs_small_buf_get();4116 next_buffer = (char *)cifs_small_buf_get();
4112 }
4113 memcpy(next_buffer,4117 memcpy(next_buffer,
4114 tmpbuf + le32_to_cpu(shdr->NextCommand),4118 buf + le32_to_cpu(shdr->NextCommand),
4115 pdu_length - le32_to_cpu(shdr->NextCommand));4119 pdu_length - le32_to_cpu(shdr->NextCommand));
4116 }4120 }
4117 4121
@@ -4140,12 +4144,21 @@ receive_encrypted_standard(struct TCP_Server_Info *server, · 22 unmodified lines
4140 pdu_length -= le32_to_cpu(shdr->NextCommand);4144 pdu_length -= le32_to_cpu(shdr->NextCommand);
4141 server->large_buf = next_is_large;4145 server->large_buf = next_is_large;
4142 if (next_is_large)4146 if (next_is_large)
4143 server->bigbuf = next_buffer;4147 server->bigbuf = buf = next_buffer;
4144 else4148 else
4145 server->smallbuf = next_buffer;4149 server->smallbuf = buf = next_buffer;
4146
4147 buf += le32_to_cpu(shdr->NextCommand);
4148 goto one_more;4150 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);
4149 }4162 }
4150 4163
4151 return ret;4164 return ret;
fs/cifs/smb2pdu.c+6−1
@@ -252,7 +252,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon) · 251 unmodified lines
252 if (tcon == NULL)252 if (tcon == NULL)
253 return 0;253 return 0;
254 254
255 if (smb2_command == SMB2_TREE_CONNECT)255 if (smb2_command == SMB2_TREE_CONNECT || smb2_command == SMB2_IOCTL)
256 return 0;256 return 0;
257 257
258 if (tcon->tidStatus == CifsExiting) {258 if (tcon->tidStatus == CifsExiting) {
@@ -1196,7 +1196,12 @@ SMB2_sess_alloc_buffer(struct SMB2_sess_data *sess_data) · 937 unmodified lines
1196 else1196 else
1197 req->SecurityMode = 0;1197 req->SecurityMode = 0;
1198 1198
1199#ifdef CONFIG_CIFS_DFS_UPCALL
1200 req->Capabilities = cpu_to_le32(SMB2_GLOBAL_CAP_DFS);
1201#else
1199 req->Capabilities = 0;1202 req->Capabilities = 0;
1203#endif /* DFS_UPCALL */
1204
1200 req->Channel = 0; /* MBZ */1205 req->Channel = 0; /* MBZ */
1201 1206
1202 sess_data->iov[0].iov_base = (char *)req;1207 sess_data->iov[0].iov_base = (char *)req;
fs/compat_ioctl.c+0−3
@@ -638,9 +638,6 @@ COMPATIBLE_IOCTL(PPPIOCDISCONN) · 637 unmodified lines
638COMPATIBLE_IOCTL(PPPIOCATTCHAN)638COMPATIBLE_IOCTL(PPPIOCATTCHAN)
639COMPATIBLE_IOCTL(PPPIOCGCHAN)639COMPATIBLE_IOCTL(PPPIOCGCHAN)
640COMPATIBLE_IOCTL(PPPIOCGL2TPSTATS)640COMPATIBLE_IOCTL(PPPIOCGL2TPSTATS)
641/* PPPOX */
642COMPATIBLE_IOCTL(PPPOEIOCSFWD)
643COMPATIBLE_IOCTL(PPPOEIOCDFWD)
644/* Big A */641/* Big A */
645/* sparc only */642/* sparc only */
646/* Big Q for sound/OSS */643/* Big Q for sound/OSS */
fs/coredump.c+39−5
@@ -7,6 +7,7 @@ · 6 unmodified lines
7#include <linux/stat.h>7#include <linux/stat.h>
8#include <linux/fcntl.h>8#include <linux/fcntl.h>
9#include <linux/swap.h>9#include <linux/swap.h>
10#include <linux/ctype.h>
10#include <linux/string.h>11#include <linux/string.h>
11#include <linux/init.h>12#include <linux/init.h>
12#include <linux/pagemap.h>13#include <linux/pagemap.h>
@@ -187,11 +188,13 @@ put_exe_file: · 174 unmodified lines
187 * name into corename, which must have space for at least188 * name into corename, which must have space for at least
188 * CORENAME_MAX_SIZE bytes plus one byte for the zero terminator.189 * CORENAME_MAX_SIZE bytes plus one byte for the zero terminator.
189 */190 */
190static int format_corename(struct core_name *cn, struct coredump_params *cprm)191static int format_corename(struct core_name *cn, struct coredump_params *cprm,
192 size_t **argv, int *argc)
191{193{
192 const struct cred *cred = current_cred();194 const struct cred *cred = current_cred();
193 const char *pat_ptr = core_pattern;195 const char *pat_ptr = core_pattern;
194 int ispipe = (*pat_ptr == '|');196 int ispipe = (*pat_ptr == '|');
197 bool was_space = false;
195 int pid_in_pattern = 0;198 int pid_in_pattern = 0;
196 int err = 0;199 int err = 0;
197 200
@@ -201,12 +204,35 @@ static int format_corename(struct core_name *cn, struct coredump_params *cprm) · 3 unmodified lines
201 return -ENOMEM;204 return -ENOMEM;
202 cn->corename[0] = '\0';205 cn->corename[0] = '\0';
203 206
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;
205 ++pat_ptr;213 ++pat_ptr;
214 }
206 215
207 /* Repeat as long as we have more pattern to process and more output216 /* Repeat as long as we have more pattern to process and more output
208 space */217 space */
209 while (*pat_ptr) {218 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 }
210 if (*pat_ptr != '%') {236 if (*pat_ptr != '%') {
211 err = cn_printf(cn, "%c", *pat_ptr++);237 err = cn_printf(cn, "%c", *pat_ptr++);
212 } else {238 } else {
@@ -546,6 +572,8 @@ void do_coredump(const kernel_siginfo_t *siginfo) · 333 unmodified lines
546 struct cred *cred;572 struct cred *cred;
547 int retval = 0;573 int retval = 0;
548 int ispipe;574 int ispipe;
575 size_t *argv = NULL;
576 int argc = 0;
549 struct files_struct *displaced;577 struct files_struct *displaced;
550 /* require nonrelative corefile path and be extra careful */578 /* require nonrelative corefile path and be extra careful */
551 bool need_suid_safe = false;579 bool need_suid_safe = false;
@@ -592,9 +620,10 @@ void do_coredump(const kernel_siginfo_t *siginfo) · 40 unmodified lines
592 620
593 old_cred = override_creds(cred);621 old_cred = override_creds(cred);
594 622
595 ispipe = format_corename(&cn, &cprm);623 ispipe = format_corename(&cn, &cprm, &argv, &argc);
596 624
597 if (ispipe) {625 if (ispipe) {
626 int argi;
598 int dump_count;627 int dump_count;
599 char **helper_argv;628 char **helper_argv;
600 struct subprocess_info *sub_info;629 struct subprocess_info *sub_info;
@@ -637,12 +666,16 @@ void do_coredump(const kernel_siginfo_t *siginfo) · 36 unmodified lines
637 goto fail_dropcount;666 goto fail_dropcount;
638 }667 }
639 668
640 helper_argv = argv_split(GFP_KERNEL, cn.corename, NULL);669 helper_argv = kmalloc_array(argc + 1, sizeof(*helper_argv),
670 GFP_KERNEL);
641 if (!helper_argv) {671 if (!helper_argv) {
642 printk(KERN_WARNING "%s failed to allocate memory\n",672 printk(KERN_WARNING "%s failed to allocate memory\n",
643 __func__);673 __func__);
644 goto fail_dropcount;674 goto fail_dropcount;
645 }675 }
676 for (argi = 0; argi < argc; argi++)
677 helper_argv[argi] = cn.corename + argv[argi];
678 helper_argv[argi] = NULL;
646 679
647 retval = -ENOMEM;680 retval = -ENOMEM;
648 sub_info = call_usermodehelper_setup(helper_argv[0],681 sub_info = call_usermodehelper_setup(helper_argv[0],
@@ -652,7 +685,7 @@ void do_coredump(const kernel_siginfo_t *siginfo) · 3 unmodified lines
652 retval = call_usermodehelper_exec(sub_info,685 retval = call_usermodehelper_exec(sub_info,
653 UMH_WAIT_EXEC);686 UMH_WAIT_EXEC);
654 687
655 argv_free(helper_argv);688 kfree(helper_argv);
656 if (retval) {689 if (retval) {
657 printk(KERN_INFO "Core dump to |%s pipe failed\n",690 printk(KERN_INFO "Core dump to |%s pipe failed\n",
658 cn.corename);691 cn.corename);
@@ -766,6 +799,7 @@ fail_dropcount: · 107 unmodified lines
766 if (ispipe)799 if (ispipe)
767 atomic_dec(&core_dump_count);800 atomic_dec(&core_dump_count);
768fail_unlock:801fail_unlock:
802 kfree(argv);
769 kfree(cn.corename);803 kfree(cn.corename);
770 coredump_finish(mm, core_dumped);804 coredump_finish(mm, core_dumped);
771 revert_creds(old_cred);805 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
266static void put_unlocked_entry(struct xa_state *xas, void *entry)266static void put_unlocked_entry(struct xa_state *xas, void *entry)
267{267{
268 /* If we were the only waiter woken, wake the next one */268 /* 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))
270 dax_wake_entry(xas, entry, false);270 dax_wake_entry(xas, entry, false);
271}271}
272 272
@@ -600,7 +600,7 @@ struct page *dax_layout_busy_page(struct address_space *mapping) · 327 unmodified lines
600 * guaranteed to either see new references or prevent new600 * guaranteed to either see new references or prevent new
601 * references from being established.601 * references from being established.
602 */602 */
603 unmap_mapping_range(mapping, 0, 0, 1);603 unmap_mapping_range(mapping, 0, 0, 0);
604 604
605 xas_lock_irq(&xas);605 xas_lock_irq(&xas);
606 xas_for_each(&xas, entry, ULONG_MAX) {606 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
1653static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask)1653static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask)
1654{1654{
1655 struct f2fs_inode_info *fi = F2FS_I(inode);1655 struct f2fs_inode_info *fi = F2FS_I(inode);
1656 u32 oldflags;
1657 1656
1658 /* Is it quota file? Do not allow user to mess with it */1657 /* Is it quota file? Do not allow user to mess with it */
1659 if (IS_NOQUOTA(inode))1658 if (IS_NOQUOTA(inode))
1660 return -EPERM;1659 return -EPERM;
1661 1660
1662 oldflags = fi->i_flags;1661 fi->i_flags = iflags | (fi->i_flags & ~mask);
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);
1669 1662
1670 if (fi->i_flags & F2FS_PROJINHERIT_FL)1663 if (fi->i_flags & F2FS_PROJINHERIT_FL)
1671 set_inode_flag(inode, FI_PROJ_INHERIT);1664 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
1770static int f2fs_ioc_setflags(struct file *filp, unsigned long arg)1763static int f2fs_ioc_setflags(struct file *filp, unsigned long arg)
1771{1764{
1772 struct inode *inode = file_inode(filp);1765 struct inode *inode = file_inode(filp);
1773 u32 fsflags;1766 struct f2fs_inode_info *fi = F2FS_I(inode);
1767 u32 fsflags, old_fsflags;
1774 u32 iflags;1768 u32 iflags;
1775 int ret;1769 int ret;
1776 1770
@@ -1794,8 +1788,14 @@ static int f2fs_ioc_setflags(struct file *filp, unsigned long arg) · 17 unmodified lines
1794 1788
1795 inode_lock(inode);1789 inode_lock(inode);
1796 1790
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
1797 ret = f2fs_setflags_common(inode, iflags,1796 ret = f2fs_setflags_common(inode, iflags,
1798 f2fs_fsflags_to_iflags(F2FS_SETTABLE_FS_FL));1797 f2fs_fsflags_to_iflags(F2FS_SETTABLE_FS_FL));
1798out:
1799 inode_unlock(inode);1799 inode_unlock(inode);
1800 mnt_drop_write_file(filp);1800 mnt_drop_write_file(filp);
1801 return ret;1801 return ret;
@@ -2855,52 +2855,32 @@ static inline u32 f2fs_xflags_to_iflags(u32 xflags) · 1053 unmodified lines
2855 return iflags;2855 return iflags;
2856}2856}
2857 2857
2858static int f2fs_ioc_fsgetxattr(struct file *filp, unsigned long arg)2858static void f2fs_fill_fsxattr(struct inode *inode, struct fsxattr *fa)
2859{2859{
2860 struct inode *inode = file_inode(filp);
2861 struct f2fs_inode_info *fi = F2FS_I(inode);2860 struct f2fs_inode_info *fi = F2FS_I(inode);
2862 struct fsxattr fa;
2863 2861
2864 memset(&fa, 0, sizeof(struct fsxattr));2862 simple_fill_fsxattr(fa, f2fs_iflags_to_xflags(fi->i_flags));
2865 fa.fsx_xflags = f2fs_iflags_to_xflags(fi->i_flags);
2866 2863
2867 if (f2fs_sb_has_project_quota(F2FS_I_SB(inode)))2864 if (f2fs_sb_has_project_quota(F2FS_I_SB(inode)))
2868 fa.fsx_projid = (__u32)from_kprojid(&init_user_ns,2865 fa->fsx_projid = from_kprojid(&init_user_ns, fi->i_projid);
2869 fi->i_projid);
2870
2871 if (copy_to_user((struct fsxattr __user *)arg, &fa, sizeof(fa)))
2872 return -EFAULT;
2873 return 0;
2874}2866}
2875 2867
2876static int f2fs_ioctl_check_project(struct inode *inode, struct fsxattr *fa)2868static int f2fs_ioc_fsgetxattr(struct file *filp, unsigned long arg)
2877{2869{
2878 /*2870 struct inode *inode = file_inode(filp);
2879 * Project Quota ID state is only allowed to change from within the init2871 struct fsxattr fa;
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;
2885 2872
2886 if (__kprojid_val(F2FS_I(inode)->i_projid) != fa->fsx_projid)2873 f2fs_fill_fsxattr(inode, &fa);
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 }
2896 2874
2875 if (copy_to_user((struct fsxattr __user *)arg, &fa, sizeof(fa)))
2876 return -EFAULT;
2897 return 0;2877 return 0;
2898}2878}
2899 2879
2900static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)2880static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)
2901{2881{
2902 struct inode *inode = file_inode(filp);2882 struct inode *inode = file_inode(filp);
2903 struct fsxattr fa;2883 struct fsxattr fa, old_fa;
2904 u32 iflags;2884 u32 iflags;
2905 int err;2885 int err;
2906 2886
@@ -2923,9 +2903,12 @@ static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg) · 16 unmodified lines
2923 return err;2903 return err;
2924 2904
2925 inode_lock(inode);2905 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);
2927 if (err)2909 if (err)
2928 goto out;2910 goto out;
2911
2929 err = f2fs_setflags_common(inode, iflags,2912 err = f2fs_setflags_common(inode, iflags,
2930 f2fs_xflags_to_iflags(F2FS_SUPPORTED_XFLAGS));2913 f2fs_xflags_to_iflags(F2FS_SUPPORTED_XFLAGS));
2931 if (err)2914 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
796 if (lfs_mode)796 if (lfs_mode)
797 down_write(&fio.sbi->io_order_lock);797 down_write(&fio.sbi->io_order_lock);
798 798
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
799 f2fs_allocate_data_block(fio.sbi, NULL, fio.old_blkaddr, &newaddr,822 f2fs_allocate_data_block(fio.sbi, NULL, fio.old_blkaddr, &newaddr,
800 &sum, CURSEG_COLD_DATA, NULL, false);823 &sum, CURSEG_COLD_DATA, NULL, false);
801 824
@@ -803,44 +826,18 @@ static int move_data_block(struct inode *inode, block_t bidx, · 1 unmodified line
803 newaddr, FGP_LOCK | FGP_CREAT, GFP_NOFS);826 newaddr, FGP_LOCK | FGP_CREAT, GFP_NOFS);
804 if (!fio.encrypted_page) {827 if (!fio.encrypted_page) {
805 err = -ENOMEM;828 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 }
819 f2fs_put_page(mpage, 1);829 f2fs_put_page(mpage, 1);
820 invalidate_mapping_pages(META_MAPPING(fio.sbi),830 goto recover_block;
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;
840 }831 }
841 832
842write_page:833 /* write target block */
843 f2fs_wait_on_page_writeback(fio.encrypted_page, DATA, true, true);834 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
844 set_page_dirty(fio.encrypted_page);841 set_page_dirty(fio.encrypted_page);
845 if (clear_page_dirty_for_io(fio.encrypted_page))842 if (clear_page_dirty_for_io(fio.encrypted_page))
846 dec_page_count(fio.sbi, F2FS_DIRTY_META);843 dec_page_count(fio.sbi, F2FS_DIRTY_META);
@@ -871,11 +868,12 @@ write_page: · 24 unmodified lines
871put_page_out:868put_page_out:
872 f2fs_put_page(fio.encrypted_page, 1);869 f2fs_put_page(fio.encrypted_page, 1);
873recover_block:870recover_block:
874 if (lfs_mode)
875 up_write(&fio.sbi->io_order_lock);
876 if (err)871 if (err)
877 f2fs_do_replace_block(fio.sbi, &sum, newaddr, fio.old_blkaddr,872 f2fs_do_replace_block(fio.sbi, &sum, newaddr, fio.old_blkaddr,
878 true, true);873 true, true);
874up_out:
875 if (lfs_mode)
876 up_write(&fio.sbi->io_order_lock);
879put_out:877put_out:
880 f2fs_put_dnode(&dn);878 f2fs_put_dnode(&dn);
881out:879out:
fs/f2fs/super.c+24−24
@@ -2422,6 +2422,12 @@ static int sanity_check_raw_super(struct f2fs_sb_info *sbi, · 2421 unmodified lines
2422 size_t crc_offset = 0;2422 size_t crc_offset = 0;
2423 __u32 crc = 0;2423 __u32 crc = 0;
2424 2424
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
2425 /* Check checksum_offset and crc in superblock */2431 /* Check checksum_offset and crc in superblock */
2426 if (__F2FS_HAS_FEATURE(raw_super, F2FS_FEATURE_SB_CHKSUM)) {2432 if (__F2FS_HAS_FEATURE(raw_super, F2FS_FEATURE_SB_CHKSUM)) {
2427 crc_offset = le32_to_cpu(raw_super->checksum_offset);2433 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
2429 offsetof(struct f2fs_super_block, crc)) {2435 offsetof(struct f2fs_super_block, crc)) {
2430 f2fs_info(sbi, "Invalid SB checksum offset: %zu",2436 f2fs_info(sbi, "Invalid SB checksum offset: %zu",
2431 crc_offset);2437 crc_offset);
2432 return 1;2438 return -EFSCORRUPTED;
2433 }2439 }
2434 crc = le32_to_cpu(raw_super->crc);2440 crc = le32_to_cpu(raw_super->crc);
2435 if (!f2fs_crc_valid(sbi, crc, raw_super, crc_offset)) {2441 if (!f2fs_crc_valid(sbi, crc, raw_super, crc_offset)) {
2436 f2fs_info(sbi, "Invalid SB checksum value: %u", crc);2442 f2fs_info(sbi, "Invalid SB checksum value: %u", crc);
2437 return 1;2443 return -EFSCORRUPTED;
2438 }2444 }
2439 }2445 }
2440 2446
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
2447 /* Currently, support only 4KB page cache size */2447 /* Currently, support only 4KB page cache size */
2448 if (F2FS_BLKSIZE != PAGE_SIZE) {2448 if (F2FS_BLKSIZE != PAGE_SIZE) {
2449 f2fs_info(sbi, "Invalid page_cache_size (%lu), supports only 4KB",2449 f2fs_info(sbi, "Invalid page_cache_size (%lu), supports only 4KB",
2450 PAGE_SIZE);2450 PAGE_SIZE);
2451 return 1;2451 return -EFSCORRUPTED;
2452 }2452 }
2453 2453
2454 /* Currently, support only 4KB block size */2454 /* Currently, support only 4KB block size */
@@ -2456,14 +2456,14 @@ static int sanity_check_raw_super(struct f2fs_sb_info *sbi, · 1 unmodified line
2456 if (blocksize != F2FS_BLKSIZE) {2456 if (blocksize != F2FS_BLKSIZE) {
2457 f2fs_info(sbi, "Invalid blocksize (%u), supports only 4KB",2457 f2fs_info(sbi, "Invalid blocksize (%u), supports only 4KB",
2458 blocksize);2458 blocksize);
2459 return 1;2459 return -EFSCORRUPTED;
2460 }2460 }
2461 2461
2462 /* check log blocks per segment */2462 /* check log blocks per segment */
2463 if (le32_to_cpu(raw_super->log_blocks_per_seg) != 9) {2463 if (le32_to_cpu(raw_super->log_blocks_per_seg) != 9) {
2464 f2fs_info(sbi, "Invalid log blocks per segment (%u)",2464 f2fs_info(sbi, "Invalid log blocks per segment (%u)",
2465 le32_to_cpu(raw_super->log_blocks_per_seg));2465 le32_to_cpu(raw_super->log_blocks_per_seg));
2466 return 1;2466 return -EFSCORRUPTED;
2467 }2467 }
2468 2468
2469 /* Currently, support 512/1024/2048/4096 bytes sector size */2469 /* 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
2473 F2FS_MIN_LOG_SECTOR_SIZE) {2473 F2FS_MIN_LOG_SECTOR_SIZE) {
2474 f2fs_info(sbi, "Invalid log sectorsize (%u)",2474 f2fs_info(sbi, "Invalid log sectorsize (%u)",
2475 le32_to_cpu(raw_super->log_sectorsize));2475 le32_to_cpu(raw_super->log_sectorsize));
2476 return 1;2476 return -EFSCORRUPTED;
2477 }2477 }
2478 if (le32_to_cpu(raw_super->log_sectors_per_block) +2478 if (le32_to_cpu(raw_super->log_sectors_per_block) +
2479 le32_to_cpu(raw_super->log_sectorsize) !=2479 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
2481 f2fs_info(sbi, "Invalid log sectors per block(%u) log sectorsize(%u)",2481 f2fs_info(sbi, "Invalid log sectors per block(%u) log sectorsize(%u)",
2482 le32_to_cpu(raw_super->log_sectors_per_block),2482 le32_to_cpu(raw_super->log_sectors_per_block),
2483 le32_to_cpu(raw_super->log_sectorsize));2483 le32_to_cpu(raw_super->log_sectorsize));
2484 return 1;2484 return -EFSCORRUPTED;
2485 }2485 }
2486 2486
2487 segment_count = le32_to_cpu(raw_super->segment_count);2487 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
2495 if (segment_count > F2FS_MAX_SEGMENT ||2495 if (segment_count > F2FS_MAX_SEGMENT ||
2496 segment_count < F2FS_MIN_SEGMENTS) {2496 segment_count < F2FS_MIN_SEGMENTS) {
2497 f2fs_info(sbi, "Invalid segment count (%u)", segment_count);2497 f2fs_info(sbi, "Invalid segment count (%u)", segment_count);
2498 return 1;2498 return -EFSCORRUPTED;
2499 }2499 }
2500 2500
2501 if (total_sections > segment_count ||2501 if (total_sections > segment_count ||
@@ -2503,25 +2503,25 @@ static int sanity_check_raw_super(struct f2fs_sb_info *sbi, · 1 unmodified line
2503 segs_per_sec > segment_count || !segs_per_sec) {2503 segs_per_sec > segment_count || !segs_per_sec) {
2504 f2fs_info(sbi, "Invalid segment/section count (%u, %u x %u)",2504 f2fs_info(sbi, "Invalid segment/section count (%u, %u x %u)",
2505 segment_count, total_sections, segs_per_sec);2505 segment_count, total_sections, segs_per_sec);
2506 return 1;2506 return -EFSCORRUPTED;
2507 }2507 }
2508 2508
2509 if ((segment_count / segs_per_sec) < total_sections) {2509 if ((segment_count / segs_per_sec) < total_sections) {
2510 f2fs_info(sbi, "Small segment_count (%u < %u * %u)",2510 f2fs_info(sbi, "Small segment_count (%u < %u * %u)",
2511 segment_count, segs_per_sec, total_sections);2511 segment_count, segs_per_sec, total_sections);
2512 return 1;2512 return -EFSCORRUPTED;
2513 }2513 }
2514 2514
2515 if (segment_count > (le64_to_cpu(raw_super->block_count) >> 9)) {2515 if (segment_count > (le64_to_cpu(raw_super->block_count) >> 9)) {
2516 f2fs_info(sbi, "Wrong segment_count / block_count (%u > %llu)",2516 f2fs_info(sbi, "Wrong segment_count / block_count (%u > %llu)",
2517 segment_count, le64_to_cpu(raw_super->block_count));2517 segment_count, le64_to_cpu(raw_super->block_count));
2518 return 1;2518 return -EFSCORRUPTED;
2519 }2519 }
2520 2520
2521 if (secs_per_zone > total_sections || !secs_per_zone) {2521 if (secs_per_zone > total_sections || !secs_per_zone) {
2522 f2fs_info(sbi, "Wrong secs_per_zone / total_sections (%u, %u)",2522 f2fs_info(sbi, "Wrong secs_per_zone / total_sections (%u, %u)",
2523 secs_per_zone, total_sections);2523 secs_per_zone, total_sections);
2524 return 1;2524 return -EFSCORRUPTED;
2525 }2525 }
2526 if (le32_to_cpu(raw_super->extension_count) > F2FS_MAX_EXTENSION ||2526 if (le32_to_cpu(raw_super->extension_count) > F2FS_MAX_EXTENSION ||
2527 raw_super->hot_ext_count > F2FS_MAX_EXTENSION ||2527 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
2531 le32_to_cpu(raw_super->extension_count),2531 le32_to_cpu(raw_super->extension_count),
2532 raw_super->hot_ext_count,2532 raw_super->hot_ext_count,
2533 F2FS_MAX_EXTENSION);2533 F2FS_MAX_EXTENSION);
2534 return 1;2534 return -EFSCORRUPTED;
2535 }2535 }
2536 2536
2537 if (le32_to_cpu(raw_super->cp_payload) >2537 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
2539 f2fs_info(sbi, "Insane cp_payload (%u > %u)",2539 f2fs_info(sbi, "Insane cp_payload (%u > %u)",
2540 le32_to_cpu(raw_super->cp_payload),2540 le32_to_cpu(raw_super->cp_payload),
2541 blocks_per_seg - F2FS_CP_PACKS);2541 blocks_per_seg - F2FS_CP_PACKS);
2542 return 1;2542 return -EFSCORRUPTED;
2543 }2543 }
2544 2544
2545 /* check reserved ino info */2545 /* check reserved ino info */
@@ -2550,12 +2550,12 @@ static int sanity_check_raw_super(struct f2fs_sb_info *sbi, · 4 unmodified lines
2550 le32_to_cpu(raw_super->node_ino),2550 le32_to_cpu(raw_super->node_ino),
2551 le32_to_cpu(raw_super->meta_ino),2551 le32_to_cpu(raw_super->meta_ino),
2552 le32_to_cpu(raw_super->root_ino));2552 le32_to_cpu(raw_super->root_ino));
2553 return 1;2553 return -EFSCORRUPTED;
2554 }2554 }
2555 2555
2556 /* check CP/SIT/NAT/SSA/MAIN_AREA area boundary */2556 /* check CP/SIT/NAT/SSA/MAIN_AREA area boundary */
2557 if (sanity_check_area_boundary(sbi, bh))2557 if (sanity_check_area_boundary(sbi, bh))
2558 return 1;2558 return -EFSCORRUPTED;
2559 2559
2560 return 0;2560 return 0;
2561}2561}
@@ -2870,10 +2870,10 @@ static int read_raw_super_block(struct f2fs_sb_info *sbi, · 308 unmodified lines
2870 }2870 }
2871 2871
2872 /* sanity checking of raw super */2872 /* sanity checking of raw super */
2873 if (sanity_check_raw_super(sbi, bh)) {2873 err = sanity_check_raw_super(sbi, bh);
2874 if (err) {
2874 f2fs_err(sbi, "Can't find valid F2FS filesystem in %dth superblock",2875 f2fs_err(sbi, "Can't find valid F2FS filesystem in %dth superblock",
2875 block + 1);2876 block + 1);
2876 err = -EFSCORRUPTED;
2877 brelse(bh);2877 brelse(bh);
2878 continue;2878 continue;
2879 }2879 }
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
390 return mp->mp_aheight - x - 1;390 return mp->mp_aheight - x - 1;
391}391}
392 392
393static 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
393static void release_metapath(struct metapath *mp)406static void release_metapath(struct metapath *mp)
394{407{
395 int i;408 int i;
@@ -430,60 +443,84 @@ static inline unsigned int gfs2_extent_length(struct buffer_head *bh, __be64 *pt · 34 unmodified lines
430 return ptr - first;443 return ptr - first;
431}444}
432 445
433typedef const __be64 *(*gfs2_metadata_walker)(446enum walker_status { WALK_STOP, WALK_FOLLOW, WALK_CONTINUE };
434 struct metapath *mp,447
435 const __be64 *start, const __be64 *end,448/*
436 u64 factor, void *data);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 */
456typedef enum walker_status (*gfs2_metadata_walker)(struct metapath *mp,
457 unsigned int ptrs);
437 458
438#define WALK_STOP ((__be64 *)0)459/*
439#define WALK_NEXT ((__be64 *)1)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 */
440 469
441static int gfs2_walk_metadata(struct inode *inode, sector_t lblock,470static int gfs2_walk_metadata(struct inode *inode, struct metapath *mp,
442 u64 len, struct metapath *mp, gfs2_metadata_walker walker,471 u64 max_len, gfs2_metadata_walker walker)
443 void *data)
444{472{
445 struct metapath clone;
446 struct gfs2_inode *ip = GFS2_I(inode);473 struct gfs2_inode *ip = GFS2_I(inode);
447 struct gfs2_sbd *sdp = GFS2_SB(inode);474 struct gfs2_sbd *sdp = GFS2_SB(inode);
448 const __be64 *start, *end, *ptr;
449 u64 factor = 1;475 u64 factor = 1;
450 unsigned int hgt;476 unsigned int hgt;
451 int ret = 0;477 int ret;
452 478
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;
454 factor *= sdp->sd_inptrs;487 factor *= sdp->sd_inptrs;
488 }
455 489
456 for (;;) {490 for (;;) {
457 u64 step;491 u16 start = mp->mp_list[hgt];
492 enum walker_status status;
493 unsigned int ptrs;
494 u64 len;
458 495
459 /* Walk indirect block. */496 /* Walk indirect block. */
460 start = metapointer(hgt, mp);497 ptrs = (hgt >= 1 ? sdp->sd_inptrs : sdp->sd_diptrs) - start;
461 end = metaend(hgt, mp);498 len = ptrs * factor;
462 499 if (len > max_len)
463 step = (end - start) * factor;500 ptrs = DIV_ROUND_UP_ULL(max_len, factor);
464 if (step > len)501 status = walker(mp, ptrs);
465 end = start + DIV_ROUND_UP_ULL(len, factor);502 switch (status) {
466 503 case WALK_STOP:
467 ptr = walker(mp, start, end, factor, data);504 return 1;
468 if (ptr == WALK_STOP)505 case WALK_FOLLOW:
506 BUG_ON(mp->mp_aheight == mp->mp_fheight);
507 ptrs = mp->mp_list[hgt] - start;
508 len = ptrs * factor;
469 break;509 break;
470 if (step >= len)510 case WALK_CONTINUE:
471 break;511 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;
477 }512 }
513 if (len >= max_len)
514 break;
515 max_len -= len;
516 if (status == WALK_FOLLOW)
517 goto fill_up_metapath;
478 518
479lower_metapath:519lower_metapath:
480 /* Decrease height of metapath. */520 /* Decrease height of metapath. */
481 if (mp != &clone) {
482 clone_metapath(&clone, mp);
483 mp = &clone;
484 }
485 brelse(mp->mp_bh[hgt]);521 brelse(mp->mp_bh[hgt]);
486 mp->mp_bh[hgt] = NULL;522 mp->mp_bh[hgt] = NULL;
523 mp->mp_list[hgt] = 0;
487 if (!hgt)524 if (!hgt)
488 break;525 break;
489 hgt--;526 hgt--;
@@ -491,10 +528,7 @@ lower_metapath: · 1 unmodified line
491 528
492 /* Advance in metadata tree. */529 /* Advance in metadata tree. */
493 (mp->mp_list[hgt])++;530 (mp->mp_list[hgt])++;
494 start = metapointer(hgt, mp);531 if (mp->mp_list[hgt] >= sdp->sd_inptrs) {
495 end = metaend(hgt, mp);
496 if (start >= end) {
497 mp->mp_list[hgt] = 0;
498 if (!hgt)532 if (!hgt)
499 break;533 break;
500 goto lower_metapath;534 goto lower_metapath;
@@ -502,44 +536,36 @@ lower_metapath: · 1 unmodified line
502 536
503fill_up_metapath:537fill_up_metapath:
504 /* Increase height of metapath. */538 /* Increase height of metapath. */
505 if (mp != &clone) {
506 clone_metapath(&clone, mp);
507 mp = &clone;
508 }
509 ret = fillup_metapath(ip, mp, ip->i_height - 1);539 ret = fillup_metapath(ip, mp, ip->i_height - 1);
510 if (ret < 0)540 if (ret < 0)
511 break;541 return ret;
512 hgt += ret;542 hgt += ret;
513 for (; ret; ret--)543 for (; ret; ret--)
514 do_div(factor, sdp->sd_inptrs);544 do_div(factor, sdp->sd_inptrs);
515 mp->mp_aheight = hgt + 1;545 mp->mp_aheight = hgt + 1;
516 }546 }
517 if (mp == &clone)547 return 0;
518 release_metapath(mp);
519 return ret;
520}548}
521 549
522struct gfs2_hole_walker_args {550static enum walker_status gfs2_hole_walker(struct metapath *mp,
523 u64 blocks;551 unsigned int ptrs)
524};
525
526static const __be64 *gfs2_hole_walker(struct metapath *mp,
527 const __be64 *start, const __be64 *end,
528 u64 factor, void *data)
529{552{
530 struct gfs2_hole_walker_args *args = data;553 const __be64 *start, *ptr, *end;
531 const __be64 *ptr;554 unsigned int hgt;
555
556 hgt = mp->mp_aheight - 1;
557 start = metapointer(hgt, mp);
558 end = start + ptrs;
532 559
533 for (ptr = start; ptr < end; ptr++) {560 for (ptr = start; ptr < end; ptr++) {
534 if (*ptr) {561 if (*ptr) {
535 args->blocks += (ptr - start) * factor;562 mp->mp_list[hgt] += ptr - start;
536 if (mp->mp_aheight == mp->mp_fheight)563 if (mp->mp_aheight == mp->mp_fheight)
537 return WALK_STOP;564 return WALK_STOP;
538 return ptr; /* increase height */565 return WALK_FOLLOW;
539 }566 }
540 }567 }
541 args->blocks += (end - start) * factor;568 return WALK_CONTINUE;
542 return WALK_NEXT;
543}569}
544 570
545/**571/**
@@ -557,12 +583,24 @@ static const __be64 *gfs2_hole_walker(struct metapath *mp, · 11 unmodified lines
557static int gfs2_hole_size(struct inode *inode, sector_t lblock, u64 len,583static int gfs2_hole_size(struct inode *inode, sector_t lblock, u64 len,
558 struct metapath *mp, struct iomap *iomap)584 struct metapath *mp, struct iomap *iomap)
559{585{
560 struct gfs2_hole_walker_args args = { };586 struct metapath clone;
561 int ret = 0;587 u64 hole_size;
588 int ret;
562 589
563 ret = gfs2_walk_metadata(inode, lblock, len, mp, gfs2_hole_walker, &args);590 clone_metapath(&clone, mp);
564 if (!ret)591 ret = gfs2_walk_metadata(inode, &clone, len, gfs2_hole_walker);
565 iomap->length = args.blocks << inode->i_blkbits;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
602out:
603 release_metapath(&clone);
566 return ret;604 return ret;
567}605}
568 606
@@ -1002,11 +1040,16 @@ static void gfs2_iomap_page_done(struct inode *inode, loff_t pos, · 433 unmodified lines
1002 unsigned copied, struct page *page,1040 unsigned copied, struct page *page,
1003 struct iomap *iomap)1041 struct iomap *iomap)
1004{1042{
1043 struct gfs2_trans *tr = current->journal_info;
1005 struct gfs2_inode *ip = GFS2_I(inode);1044 struct gfs2_inode *ip = GFS2_I(inode);
1006 struct gfs2_sbd *sdp = GFS2_SB(inode);1045 struct gfs2_sbd *sdp = GFS2_SB(inode);
1007 1046
1008 if (page && !gfs2_is_stuffed(ip))1047 if (page && !gfs2_is_stuffed(ip))
1009 gfs2_page_add_databufs(ip, page, offset_in_page(pos), copied);1048 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
1010 gfs2_trans_end(sdp);1053 gfs2_trans_end(sdp);
1011}1054}
1012 1055
@@ -1099,8 +1142,6 @@ static int gfs2_iomap_begin_write(struct inode *inode, loff_t pos, · 86 unmodified lines
1099 tr = current->journal_info;1142 tr = current->journal_info;
1100 if (tr->tr_num_buf_new)1143 if (tr->tr_num_buf_new)
1101 __mark_inode_dirty(inode, I_DIRTY_DATASYNC);1144 __mark_inode_dirty(inode, I_DIRTY_DATASYNC);
1102 else
1103 gfs2_trans_add_meta(ip->i_gl, mp->mp_bh[0]);
1104 1145
1105 gfs2_trans_end(sdp);1146 gfs2_trans_end(sdp);
1106 }1147 }
@@ -1181,10 +1222,16 @@ static int gfs2_iomap_end(struct inode *inode, loff_t pos, loff_t length, · 74 unmodified lines
1181 1222
1182 if (ip->i_qadata && ip->i_qadata->qa_qd_num)1223 if (ip->i_qadata && ip->i_qadata->qa_qd_num)
1183 gfs2_quota_unlock(ip);1224 gfs2_quota_unlock(ip);
1225
1226 if (unlikely(!written))
1227 goto out_unlock;
1228
1184 if (iomap->flags & IOMAP_F_SIZE_CHANGED)1229 if (iomap->flags & IOMAP_F_SIZE_CHANGED)
1185 mark_inode_dirty(inode);1230 mark_inode_dirty(inode);
1186 gfs2_write_unlock(inode);1231 set_bit(GLF_DIRTY, &ip->i_gl->gl_flags);
1187 1232
1233out_unlock:
1234 gfs2_write_unlock(inode);
1188out:1235out:
1189 return 0;1236 return 0;
1190}1237}
fs/io_uring.c+2−1
@@ -1838,6 +1838,7 @@ restart: · 1837 unmodified lines
1838 do {1838 do {
1839 struct sqe_submit *s = &req->submit;1839 struct sqe_submit *s = &req->submit;
1840 const struct io_uring_sqe *sqe = s->sqe;1840 const struct io_uring_sqe *sqe = s->sqe;
1841 unsigned int flags = req->flags;
1841 1842
1842 /* Ensure we clear previously set non-block flag */1843 /* Ensure we clear previously set non-block flag */
1843 req->rw.ki_flags &= ~IOCB_NOWAIT;1844 req->rw.ki_flags &= ~IOCB_NOWAIT;
@@ -1883,7 +1884,7 @@ restart: · 39 unmodified lines
1883 kfree(sqe);1884 kfree(sqe);
1884 1885
1885 /* req from defer and link list needn't decrease async cnt */1886 /* 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))
1887 goto out;1888 goto out;
1888 1889
1889 if (!async_list)1890 if (!async_list)
fs/nfs/delegation.c+18−7
@@ -153,7 +153,7 @@ again: · 152 unmodified lines
153 /* Block nfs4_proc_unlck */153 /* Block nfs4_proc_unlck */
154 mutex_lock(&sp->so_delegreturn_mutex);154 mutex_lock(&sp->so_delegreturn_mutex);
155 seq = raw_seqcount_begin(&sp->so_reclaim_seqcount);155 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);
157 if (!err)157 if (!err)
158 err = nfs_delegation_claim_locks(state, stateid);158 err = nfs_delegation_claim_locks(state, stateid);
159 if (!err && read_seqcount_retry(&sp->so_reclaim_seqcount, seq))159 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
1046 nfs4_schedule_state_manager(clp);1046 nfs4_schedule_state_manager(clp);
1047}1047}
1048 1048
1049static void
1050nfs_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
1049/**1065/**
1050 * nfs_reap_expired_delegations - reap expired delegations1066 * nfs_reap_expired_delegations - reap expired delegations
1051 * @clp: nfs_client to process1067 * @clp: nfs_client to process
@@ -1057,7 +1073,6 @@ void nfs_test_expired_all_delegations(struct nfs_client *clp) · 5 unmodified lines
1057 */1073 */
1058void nfs_reap_expired_delegations(struct nfs_client *clp)1074void nfs_reap_expired_delegations(struct nfs_client *clp)
1059{1075{
1060 const struct nfs4_minor_version_ops *ops = clp->cl_mvops;
1061 struct nfs_delegation *delegation;1076 struct nfs_delegation *delegation;
1062 struct nfs_server *server;1077 struct nfs_server *server;
1063 struct inode *inode;1078 struct inode *inode;
@@ -1088,11 +1103,7 @@ restart: · 24 unmodified lines
1088 nfs4_stateid_copy(&stateid, &delegation->stateid);1103 nfs4_stateid_copy(&stateid, &delegation->stateid);
1089 clear_bit(NFS_DELEGATION_TEST_EXPIRED, &delegation->flags);1104 clear_bit(NFS_DELEGATION_TEST_EXPIRED, &delegation->flags);
1090 rcu_read_unlock();1105 rcu_read_unlock();
1091 if (cred != NULL &&1106 nfs_delegation_test_free_expired(inode, &stateid, cred);
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 }
1096 put_cred(cred);1107 put_cred(cred);
1097 if (nfs4_server_rebooted(clp)) {1108 if (nfs4_server_rebooted(clp)) {
1098 nfs_inode_mark_test_expired_delegation(server,inode);1109 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
63 63
64/* NFSv4 delegation-related procedures */64/* NFSv4 delegation-related procedures */
65int nfs4_proc_delegreturn(struct inode *inode, const struct cred *cred, const nfs4_stateid *stateid, int issync);65int nfs4_proc_delegreturn(struct inode *inode, const struct cred *cred, const nfs4_stateid *stateid, int issync);
66int nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid, fmode_t type);66int nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid);
67int nfs4_lock_delegation_recall(struct file_lock *fl, struct nfs4_state *state, const nfs4_stateid *stateid);67int nfs4_lock_delegation_recall(struct file_lock *fl, struct nfs4_state *state, const nfs4_stateid *stateid);
68bool nfs4_copy_delegation_stateid(struct inode *inode, fmode_t flags, nfs4_stateid *dst, const struct cred **cred);68bool nfs4_copy_delegation_stateid(struct inode *inode, fmode_t flags, nfs4_stateid *dst, const struct cred **cred);
69bool nfs4_refresh_delegation_stateid(nfs4_stateid *dst, struct inode *inode);69bool 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
114 struct rb_node **p, *parent;114 struct rb_node **p, *parent;
115 int diff;115 int diff;
116 116
117 nfss->fscache_key = NULL;
118 nfss->fscache = NULL;
119 if (!(nfss->options & NFS_OPTION_FSCACHE))
120 return;
117 if (!uniq) {121 if (!uniq) {
118 uniq = "";122 uniq = "";
119 ulen = 1;123 ulen = 1;
@@ -226,10 +230,11 @@ void nfs_fscache_release_super_cookie(struct super_block *sb) · 106 unmodified lines
226void nfs_fscache_init_inode(struct inode *inode)230void nfs_fscache_init_inode(struct inode *inode)
227{231{
228 struct nfs_fscache_inode_auxdata auxdata;232 struct nfs_fscache_inode_auxdata auxdata;
233 struct nfs_server *nfss = NFS_SERVER(inode);
229 struct nfs_inode *nfsi = NFS_I(inode);234 struct nfs_inode *nfsi = NFS_I(inode);
230 235
231 nfsi->fscache = NULL;236 nfsi->fscache = NULL;
232 if (!S_ISREG(inode->i_mode))237 if (!(nfss->fscache && S_ISREG(inode->i_mode)))
233 return;238 return;
234 239
235 memset(&auxdata, 0, sizeof(auxdata));240 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
182 */182 */
183static inline const char *nfs_server_fscache_state(struct nfs_server *server)183static inline const char *nfs_server_fscache_state(struct nfs_server *server)
184{184{
185 if (server->fscache && (server->options & NFS_OPTION_FSCACHE))185 if (server->fscache)
186 return "yes";186 return "yes";
187 return "no ";187 return "no ";
188}188}
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
465 465
466extern struct nfs4_state_owner *nfs4_get_state_owner(struct nfs_server *, const struct cred *, gfp_t);466extern struct nfs4_state_owner *nfs4_get_state_owner(struct nfs_server *, const struct cred *, gfp_t);
467extern void nfs4_put_state_owner(struct nfs4_state_owner *);467extern void nfs4_put_state_owner(struct nfs4_state_owner *);
468extern void nfs4_purge_state_owners(struct nfs_server *);468extern void nfs4_purge_state_owners(struct nfs_server *, struct list_head *);
469extern void nfs4_free_state_owners(struct list_head *head);
469extern struct nfs4_state * nfs4_get_open_state(struct inode *, struct nfs4_state_owner *);470extern struct nfs4_state * nfs4_get_open_state(struct inode *, struct nfs4_state_owner *);
470extern void nfs4_put_open_state(struct nfs4_state *);471extern void nfs4_put_open_state(struct nfs4_state *);
471extern void nfs4_close_state(struct nfs4_state *, fmode_t);472extern void nfs4_close_state(struct nfs4_state *, fmode_t);
fs/nfs/nfs4client.c+4−1
@@ -758,9 +758,12 @@ out: · 757 unmodified lines
758 758
759static void nfs4_destroy_server(struct nfs_server *server)759static void nfs4_destroy_server(struct nfs_server *server)
760{760{
761 LIST_HEAD(freeme);
762
761 nfs_server_return_all_delegations(server);763 nfs_server_return_all_delegations(server);
762 unset_pnfs_layoutdriver(server);764 unset_pnfs_layoutdriver(server);
763 nfs4_purge_state_owners(server);765 nfs4_purge_state_owners(server, &freeme);
766 nfs4_free_state_owners(&freeme);
764}767}
765 768
766/*769/*
fs/nfs/nfs4proc.c+62−47
@@ -1683,6 +1683,14 @@ static void nfs_state_set_open_stateid(struct nfs4_state *state, · 1682 unmodified lines
1683 write_sequnlock(&state->seqlock);1683 write_sequnlock(&state->seqlock);
1684}1684}
1685 1685
1686static 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
1686static void nfs_state_set_delegation(struct nfs4_state *state,1694static void nfs_state_set_delegation(struct nfs4_state *state,
1687 const nfs4_stateid *deleg_stateid,1695 const nfs4_stateid *deleg_stateid,
1688 fmode_t fmode)1696 fmode_t fmode)
@@ -1907,8 +1915,9 @@ _nfs4_opendata_reclaim_to_nfs4_state(struct nfs4_opendata *data) · 218 unmodified lines
1907 if (data->o_res.delegation_type != 0)1915 if (data->o_res.delegation_type != 0)
1908 nfs4_opendata_check_deleg(data, state);1916 nfs4_opendata_check_deleg(data, state);
1909update:1917update:
1910 update_open_stateid(state, &data->o_res.stateid, NULL,1918 if (!update_open_stateid(state, &data->o_res.stateid,
1911 data->o_arg.fmode);1919 NULL, data->o_arg.fmode))
1920 return ERR_PTR(-EAGAIN);
1912 refcount_inc(&state->count);1921 refcount_inc(&state->count);
1913 1922
1914 return state;1923 return state;
@@ -1973,8 +1982,11 @@ _nfs4_opendata_to_nfs4_state(struct nfs4_opendata *data) · 58 unmodified lines
1973 1982
1974 if (data->o_res.delegation_type != 0)1983 if (data->o_res.delegation_type != 0)
1975 nfs4_opendata_check_deleg(data, state);1984 nfs4_opendata_check_deleg(data, state);
1976 update_open_stateid(state, &data->o_res.stateid, NULL,1985 if (!update_open_stateid(state, &data->o_res.stateid,
1977 data->o_arg.fmode);1986 NULL, data->o_arg.fmode)) {
1987 nfs4_put_open_state(state);
1988 state = ERR_PTR(-EAGAIN);
1989 }
1978out:1990out:
1979 nfs_release_seqid(data->o_arg.seqid);1991 nfs_release_seqid(data->o_arg.seqid);
1980 return state;1992 return state;
@@ -2074,13 +2086,7 @@ static int nfs4_open_recover(struct nfs4_opendata *opendata, struct nfs4_state * · 93 unmodified lines
2074{2086{
2075 int ret;2087 int ret;
2076 2088
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);
2081 /* memory barrier prior to reading state->n_* */2089 /* memory barrier prior to reading state->n_* */
2082 clear_bit(NFS_DELEGATED_STATE, &state->flags);
2083 clear_bit(NFS_OPEN_STATE, &state->flags);
2084 smp_rmb();2090 smp_rmb();
2085 ret = nfs4_open_recover_helper(opendata, FMODE_READ|FMODE_WRITE);2091 ret = nfs4_open_recover_helper(opendata, FMODE_READ|FMODE_WRITE);
2086 if (ret != 0)2092 if (ret != 0)
@@ -2156,6 +2162,8 @@ static int nfs4_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state *sta · 69 unmodified lines
2156 ctx = nfs4_state_find_open_context(state);2162 ctx = nfs4_state_find_open_context(state);
2157 if (IS_ERR(ctx))2163 if (IS_ERR(ctx))
2158 return -EAGAIN;2164 return -EAGAIN;
2165 clear_bit(NFS_DELEGATED_STATE, &state->flags);
2166 nfs_state_clear_open_state_flags(state);
2159 ret = nfs4_do_open_reclaim(ctx, state);2167 ret = nfs4_do_open_reclaim(ctx, state);
2160 put_nfs_open_context(ctx);2168 put_nfs_open_context(ctx);
2161 return ret;2169 return ret;
@@ -2171,18 +2179,17 @@ static int nfs4_handle_delegation_recall_error(struct nfs_server *server, struct · 9 unmodified lines
2171 case -ENOENT:2179 case -ENOENT:
2172 case -EAGAIN:2180 case -EAGAIN:
2173 case -ESTALE:2181 case -ESTALE:
2182 case -ETIMEDOUT:
2174 break;2183 break;
2175 case -NFS4ERR_BADSESSION:2184 case -NFS4ERR_BADSESSION:
2176 case -NFS4ERR_BADSLOT:2185 case -NFS4ERR_BADSLOT:
2177 case -NFS4ERR_BAD_HIGH_SLOT:2186 case -NFS4ERR_BAD_HIGH_SLOT:
2178 case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION:2187 case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION:
2179 case -NFS4ERR_DEADSESSION:2188 case -NFS4ERR_DEADSESSION:
2180 set_bit(NFS_DELEGATED_STATE, &state->flags);
2181 nfs4_schedule_session_recovery(server->nfs_client->cl_session, err);2189 nfs4_schedule_session_recovery(server->nfs_client->cl_session, err);
2182 return -EAGAIN;2190 return -EAGAIN;
2183 case -NFS4ERR_STALE_CLIENTID:2191 case -NFS4ERR_STALE_CLIENTID:
2184 case -NFS4ERR_STALE_STATEID:2192 case -NFS4ERR_STALE_STATEID:
2185 set_bit(NFS_DELEGATED_STATE, &state->flags);
2186 /* Don't recall a delegation if it was lost */2193 /* Don't recall a delegation if it was lost */
2187 nfs4_schedule_lease_recovery(server->nfs_client);2194 nfs4_schedule_lease_recovery(server->nfs_client);
2188 return -EAGAIN;2195 return -EAGAIN;
@@ -2203,7 +2210,6 @@ static int nfs4_handle_delegation_recall_error(struct nfs_server *server, struct · 14 unmodified lines
2203 return -EAGAIN;2210 return -EAGAIN;
2204 case -NFS4ERR_DELAY:2211 case -NFS4ERR_DELAY:
2205 case -NFS4ERR_GRACE:2212 case -NFS4ERR_GRACE:
2206 set_bit(NFS_DELEGATED_STATE, &state->flags);
2207 ssleep(1);2213 ssleep(1);
2208 return -EAGAIN;2214 return -EAGAIN;
2209 case -ENOMEM:2215 case -ENOMEM:
@@ -2219,8 +2225,7 @@ static int nfs4_handle_delegation_recall_error(struct nfs_server *server, struct · 9 unmodified lines
2219}2225}
2220 2226
2221int nfs4_open_delegation_recall(struct nfs_open_context *ctx,2227int nfs4_open_delegation_recall(struct nfs_open_context *ctx,
2222 struct nfs4_state *state, const nfs4_stateid *stateid,2228 struct nfs4_state *state, const nfs4_stateid *stateid)
2223 fmode_t type)
2224{2229{
2225 struct nfs_server *server = NFS_SERVER(state->inode);2230 struct nfs_server *server = NFS_SERVER(state->inode);
2226 struct nfs4_opendata *opendata;2231 struct nfs4_opendata *opendata;
@@ -2231,20 +2236,23 @@ int nfs4_open_delegation_recall(struct nfs_open_context *ctx, · 4 unmodified lines
2231 if (IS_ERR(opendata))2236 if (IS_ERR(opendata))
2232 return PTR_ERR(opendata);2237 return PTR_ERR(opendata);
2233 nfs4_stateid_copy(&opendata->o_arg.u.delegation, stateid);2238 nfs4_stateid_copy(&opendata->o_arg.u.delegation, stateid);
2234 nfs_state_clear_delegation(state);2239 if (!test_bit(NFS_O_RDWR_STATE, &state->flags)) {
2235 switch (type & (FMODE_READ|FMODE_WRITE)) {
2236 case FMODE_READ|FMODE_WRITE:
2237 case FMODE_WRITE:
2238 err = nfs4_open_recover_helper(opendata, FMODE_READ|FMODE_WRITE);2240 err = nfs4_open_recover_helper(opendata, FMODE_READ|FMODE_WRITE);
2239 if (err)2241 if (err)
2240 break;2242 goto out;
2243 }
2244 if (!test_bit(NFS_O_WRONLY_STATE, &state->flags)) {
2241 err = nfs4_open_recover_helper(opendata, FMODE_WRITE);2245 err = nfs4_open_recover_helper(opendata, FMODE_WRITE);
2242 if (err)2246 if (err)
2243 break;2247 goto out;
2244 /* Fall through */2248 }
2245 case FMODE_READ:2249 if (!test_bit(NFS_O_RDONLY_STATE, &state->flags)) {
2246 err = nfs4_open_recover_helper(opendata, FMODE_READ);2250 err = nfs4_open_recover_helper(opendata, FMODE_READ);
2251 if (err)
2252 goto out;
2247 }2253 }
2254 nfs_state_clear_delegation(state);
2255out:
2248 nfs4_opendata_put(opendata);2256 nfs4_opendata_put(opendata);
2249 return nfs4_handle_delegation_recall_error(server, state, stateid, NULL, err);2257 return nfs4_handle_delegation_recall_error(server, state, stateid, NULL, err);
2250}2258}
@@ -2492,6 +2500,7 @@ static int nfs4_run_open_task(struct nfs4_opendata *data, · 241 unmodified lines
2492 if (!ctx) {2500 if (!ctx) {
2493 nfs4_init_sequence(&o_arg->seq_args, &o_res->seq_res, 1, 1);2501 nfs4_init_sequence(&o_arg->seq_args, &o_res->seq_res, 1, 1);
2494 data->is_recover = true;2502 data->is_recover = true;
2503 task_setup_data.flags |= RPC_TASK_TIMEOUT;
2495 } else {2504 } else {
2496 nfs4_init_sequence(&o_arg->seq_args, &o_res->seq_res, 1, 0);2505 nfs4_init_sequence(&o_arg->seq_args, &o_res->seq_res, 1, 0);
2497 pnfs_lgopen_prepare(data, ctx);2506 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
2698{2707{
2699 /* NFSv4.0 doesn't allow for delegation recovery on open expire */2708 /* NFSv4.0 doesn't allow for delegation recovery on open expire */
2700 nfs40_clear_delegation_stateid(state);2709 nfs40_clear_delegation_stateid(state);
2710 nfs_state_clear_open_state_flags(state);
2701 return nfs4_open_expired(sp, state);2711 return nfs4_open_expired(sp, state);
2702}2712}
2703 2713
@@ -2740,13 +2750,13 @@ out_free: · 36 unmodified lines
2740 return -NFS4ERR_EXPIRED;2750 return -NFS4ERR_EXPIRED;
2741}2751}
2742 2752
2743static void nfs41_check_delegation_stateid(struct nfs4_state *state)2753static int nfs41_check_delegation_stateid(struct nfs4_state *state)
2744{2754{
2745 struct nfs_server *server = NFS_SERVER(state->inode);2755 struct nfs_server *server = NFS_SERVER(state->inode);
2746 nfs4_stateid stateid;2756 nfs4_stateid stateid;
2747 struct nfs_delegation *delegation;2757 struct nfs_delegation *delegation;
2748 const struct cred *cred = NULL;2758 const struct cred *cred = NULL;
2749 int status;2759 int status, ret = NFS_OK;
2750 2760
2751 /* Get the delegation credential for use by test/free_stateid */2761 /* Get the delegation credential for use by test/free_stateid */
2752 rcu_read_lock();2762 rcu_read_lock();
@@ -2754,20 +2764,15 @@ static void nfs41_check_delegation_stateid(struct nfs4_state *state) · 1 unmodified line
2754 if (delegation == NULL) {2764 if (delegation == NULL) {
2755 rcu_read_unlock();2765 rcu_read_unlock();
2756 nfs_state_clear_delegation(state);2766 nfs_state_clear_delegation(state);
2757 return;2767 return NFS_OK;
2758 }2768 }
2759 2769
2760 nfs4_stateid_copy(&stateid, &delegation->stateid);2770 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 }
2766 2771
2767 if (!test_and_clear_bit(NFS_DELEGATION_TEST_EXPIRED,2772 if (!test_and_clear_bit(NFS_DELEGATION_TEST_EXPIRED,
2768 &delegation->flags)) {2773 &delegation->flags)) {
2769 rcu_read_unlock();2774 rcu_read_unlock();
2770 return;2775 return NFS_OK;
2771 }2776 }
2772 2777
2773 if (delegation->cred)2778 if (delegation->cred)
@@ -2777,9 +2782,24 @@ static void nfs41_check_delegation_stateid(struct nfs4_state *state) · 3 unmodified lines
2777 trace_nfs4_test_delegation_stateid(state, NULL, status);2782 trace_nfs4_test_delegation_stateid(state, NULL, status);
2778 if (status == -NFS4ERR_EXPIRED || status == -NFS4ERR_BAD_STATEID)2783 if (status == -NFS4ERR_EXPIRED || status == -NFS4ERR_BAD_STATEID)
2779 nfs_finish_clear_delegation_stateid(state, &stateid);2784 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.